dealposbarcode 25.41.1 → 25.41.2

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.
@@ -1,33 +1,33 @@
1
- import{a as Ps,b as js,c as Im}from"./chunk-3HVQWFM3.js";import{a as Hs,b as qi,c as Di,d as Lr}from"./chunk-MSLVFLMV.js";import{a as Uc}from"./chunk-ELVIF57Z.js";import{$ as Em,B as kt,C as Vt,D as Is,F as Ds,G as ks,H as Wi,I as gt,J as bt,K as Br,L as Ts,M as Ms,N as Os,O as Fs,P as As,Q as Rs,S as Cm,T as Sm,U as Bs,V as Ns,W as zs,Y as Ls,Z as Pm,a as Pi,aa as zr,b as Cs,d as Ss,da as $i,ia as qc,ja as Dm,k as vm,l as Ui,n as Ei,o as _m,q as ym,r as Rt,s as Dt,t as wm,u as Rr,v as ht,w as mt,x as xm,y as ft,z as Es}from"./chunk-MCHSQWDB.js";import{$a as gs,$b as ae,$c as Vc,Aa as Ge,Ab as W,Ac as dm,Ad as et,Bc as pm,C as wt,Ca as U,Cb as ci,Cc as um,Cd as bm,D as us,Da as O,Dc as di,Ea as Ac,Eb as bs,Ec as fe,Fa as Rc,Fc as ze,Gb as Mo,Gc as Ao,H as Vi,Ha as pe,Hb as kn,I as Ve,Ia as _e,Id as Ro,J as tm,Ja as Ue,Jb as Lc,Jc as Je,Jd as $n,Ka as fs,Kb as B,Kc as pi,Kd as Bo,Lb as cm,Lc as Si,M as im,Mb as Ci,Mc as Hc,Md as Ii,N as nm,Nc as we,Nd as sn,O as hs,Oa as sm,Ob as Lt,P as Hn,Pd as Nr,Qd as Wc,Ra as $t,Rb as H,Rd as $c,S as Vn,Sa as X,Sb as jc,Ta as K,Tb as Oo,U as st,Ua as Bc,Ub as qe,Uc as hm,Va as Nc,Vb as C,Wa as Ye,Wb as Fo,Xa as Ct,Xb as Ze,Xc as It,Y as Oc,Yb as rn,Z as En,Za as He,Zb as vs,Zc as xt,_a as We,_c as mm,a as _,aa as Pr,ab as To,ac as kr,ad as fm,b as k,bb as Ce,bc as Tn,bd as an,c as Cr,ca as In,cb as Dn,cc as St,d as q,dc as Pt,e as Ne,ea as rm,ec as h,fa as ko,fc as m,g as j,gb as zc,gc as J,h as Sr,ha as om,hb as Ir,hc as _s,hd as Le,i as cs,ib as lm,ic as ys,j as ds,jc as on,k as ps,kc as Se,l as ei,lc as Tr,md as ws,n as Ft,na as am,nc as N,oa as Fc,oc as S,od as Mn,pa as ms,pc as jt,q as Te,qa as Ai,qc as At,qd as Mr,r as Do,ra as Ri,sa as ti,sb as Dr,sc as Et,ta as Ee,tc as ut,ub as Un,uc as Fe,ud as Or,vc as Ae,vd as Fr,wa as Er,wc as Wn,xa as be,xc as b,xd as xs,ya as ve,yc as P,yd as Ar,zb as f,zc as Ht,zd as gm}from"./chunk-YB6XMFOT.js";var of=q((hA,rf)=>{var s1=4,l1=.001,c1=1e-7,d1=10,Uo=11,Ks=1/(Uo-1),p1=typeof Float32Array=="function";function Jm(i,t){return 1-3*t+3*i}function ef(i,t){return 3*t-6*i}function tf(i){return 3*i}function Qs(i,t,e){return((Jm(t,e)*i+ef(t,e))*i+tf(t))*i}function nf(i,t,e){return 3*Jm(t,e)*i*i+2*ef(t,e)*i+tf(t)}function u1(i,t,e,n,r){var o,a,s=0;do a=t+(e-t)/2,o=Qs(a,n,r)-i,o>0?e=a:t=a;while(Math.abs(o)>c1&&++s<d1);return a}function h1(i,t,e,n){for(var r=0;r<s1;++r){var o=nf(t,e,n);if(o===0)return t;var a=Qs(t,e,n)-i;t-=a/o}return t}function m1(i){return i}rf.exports=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return m1;for(var o=p1?new Float32Array(Uo):new Array(Uo),a=0;a<Uo;++a)o[a]=Qs(a*Ks,t,n);function s(l){for(var c=0,d=1,p=Uo-1;d!==p&&o[d]<=l;++d)c+=Ks;--d;var v=(l-o[d])/(o[d+1]-o[d]),g=c+v*Ks,w=nf(g,t,n);return w>=l1?h1(l,g,t,n):w===0?g:u1(l,c,c+Ks,t,n)}return function(c){return c===0?0:c===1?1:Qs(s(c),e,r)}}});var Cg=q((oz,xg)=>{xg.exports=function(){var t={},e=t._fns={};t.emit=function(a,s,l,c,d,p,v){var g=n(a);g.length&&r(a,g,[s,l,c,d,p,v])},t.on=function(a,s){e[a]||(e[a]=[]),e[a].push(s)},t.once=function(a,s){function l(){s.apply(this,arguments),t.off(a,l)}this.on(a,l)},t.off=function(a,s){var l=[];if(a&&s){var c=this._fns[a],d=0,p=c?c.length:0;for(d;d<p;d++)c[d]!==s&&l.push(c[d])}l.length?this._fns[a]=l:delete this._fns[a]};function n(o){var a=e[o]?e[o]:[],s=o.indexOf(":"),l=s===-1?[o]:[o.substring(0,s),o.substring(s+1)],c=Object.keys(e),d=0,p=c.length;for(d;d<p;d++){var v=c[d];if(v==="*"&&(a=a.concat(e[v])),l.length===2&&l[0]===v){a=a.concat(e[v]);break}}return a}function r(o,a,s){var l=0,c=a.length;for(l;l<c&&a[l];l++)a[l].event=o,a[l].apply(a[l],s)}return t}});var xl=q((sz,Sg)=>{function cC(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}Sg.exports=cC});var Eg=q((lz,Pg)=>{var dC=typeof global=="object"&&global&&global.Object===Object&&global;Pg.exports=dC});var jd=q((cz,Ig)=>{var pC=Eg(),uC=typeof self=="object"&&self&&self.Object===Object&&self,hC=pC||uC||Function("return this")();Ig.exports=hC});var kg=q((dz,Dg)=>{var mC=jd(),fC=function(){return mC.Date.now()};Dg.exports=fC});var Mg=q((pz,Tg)=>{var gC=/\s/;function bC(i){for(var t=i.length;t--&&gC.test(i.charAt(t)););return t}Tg.exports=bC});var Fg=q((uz,Og)=>{var vC=Mg(),_C=/^\s+/;function yC(i){return i&&i.slice(0,vC(i)+1).replace(_C,"")}Og.exports=yC});var Hd=q((hz,Ag)=>{var wC=jd(),xC=wC.Symbol;Ag.exports=xC});var zg=q((mz,Ng)=>{var Rg=Hd(),Bg=Object.prototype,CC=Bg.hasOwnProperty,SC=Bg.toString,ia=Rg?Rg.toStringTag:void 0;function PC(i){var t=CC.call(i,ia),e=i[ia];try{i[ia]=void 0;var n=!0}catch{}var r=SC.call(i);return n&&(t?i[ia]=e:delete i[ia]),r}Ng.exports=PC});var jg=q((fz,Lg)=>{var EC=Object.prototype,IC=EC.toString;function DC(i){return IC.call(i)}Lg.exports=DC});var Wg=q((gz,Ug)=>{var Hg=Hd(),kC=zg(),TC=jg(),MC="[object Null]",OC="[object Undefined]",Vg=Hg?Hg.toStringTag:void 0;function FC(i){return i==null?i===void 0?OC:MC:Vg&&Vg in Object(i)?kC(i):TC(i)}Ug.exports=FC});var qg=q((bz,$g)=>{function AC(i){return i!=null&&typeof i=="object"}$g.exports=AC});var Yg=q((vz,Gg)=>{var RC=Wg(),BC=qg(),NC="[object Symbol]";function zC(i){return typeof i=="symbol"||BC(i)&&RC(i)==NC}Gg.exports=zC});var Zg=q((_z,Qg)=>{var LC=Fg(),Xg=xl(),jC=Yg(),Kg=NaN,HC=/^[-+]0x[0-9a-f]+$/i,VC=/^0b[01]+$/i,UC=/^0o[0-7]+$/i,WC=parseInt;function $C(i){if(typeof i=="number")return i;if(jC(i))return Kg;if(Xg(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=Xg(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=LC(i);var e=VC.test(i);return e||UC.test(i)?WC(i.slice(2),e?2:8):HC.test(i)?Kg:+i}Qg.exports=$C});var Ud=q((yz,e0)=>{var qC=xl(),Vd=kg(),Jg=Zg(),GC="Expected a function",YC=Math.max,XC=Math.min;function KC(i,t,e){var n,r,o,a,s,l,c=0,d=!1,p=!1,v=!0;if(typeof i!="function")throw new TypeError(GC);t=Jg(t)||0,qC(e)&&(d=!!e.leading,p="maxWait"in e,o=p?YC(Jg(e.maxWait)||0,t):o,v="trailing"in e?!!e.trailing:v);function g(y){var x=n,D=r;return n=r=void 0,c=y,a=i.apply(D,x),a}function w(y){return c=y,s=setTimeout(F,t),d?g(y):a}function E(y){var x=y-l,D=y-c,z=t-x;return p?XC(z,o-D):z}function L(y){var x=y-l,D=y-c;return l===void 0||x>=t||x<0||p&&D>=o}function F(){var y=Vd();if(L(y))return G(y);s=setTimeout(F,E(y))}function G(y){return s=void 0,v&&n?g(y):(n=r=void 0,a)}function he(){s!==void 0&&clearTimeout(s),c=0,n=l=r=s=void 0}function me(){return s===void 0?a:G(Vd())}function se(){var y=Vd(),x=L(y);if(n=arguments,r=this,l=y,x){if(s===void 0)return w(l);if(p)return clearTimeout(s),s=setTimeout(F,t),g(l)}return s===void 0&&(s=setTimeout(F,t)),a}return se.cancel=he,se.flush=me,se}e0.exports=KC});var i0=q((wz,t0)=>{var QC=Ud(),ZC=xl(),JC="Expected a function";function eS(i,t,e){var n=!0,r=!0;if(typeof i!="function")throw new TypeError(JC);return ZC(e)&&(n="leading"in e?!!e.leading:n,r="trailing"in e?!!e.trailing:r),QC(i,t,{leading:n,maxWait:t,trailing:r})}t0.exports=eS});var ra=q((Nz,c0)=>{"use strict";c0.exports=function(t){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected a number, got ${typeof t}`);let e=t<0,n=Math.abs(t);if(e&&(n=-n),n===0)return"0 B";let r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),r.length-1),a=Number(n/1024**o),s=r[o];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${s}`}});var u0=q((zz,p0)=>{"use strict";function d0(i,t){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=t,this.parts=i.split(t)}d0.prototype.match=function(i){var t=!0,e=this.parts,n,r=e.length,o;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)t=!1;else{for(o=(i||"").split(this.separator),n=0;t&&n<r;n++)e[n]!=="*"&&(n<o.length?t=e[n]===o[n]:t=!1);t=t&&o}else if(typeof i.splice=="function")for(t=[],n=i.length;n--;)this.match(i[n])&&(t[t.length]=i[n]);else if(typeof i=="object"){t={};for(var a in i)this.match(a)&&(t[a]=i[a])}return t};p0.exports=function(i,t,e){var n=new d0(i,e||/[\/\.]/);return typeof t<"u"?n.match(t):n}});var m0=q((Lz,h0)=>{var aS=u0(),sS=/[\/\+\.]/;h0.exports=function(i,t){function e(n){var r=aS(n,i,sS);return r&&r.length>=2}return t?e(t.split(";")[0]):e}});var Gt=q((y4,Rl)=>{(function(){"use strict";var i={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(r=n(r,e(a)))}return r}function e(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var a in r)i.call(r,a)&&r[a]&&(o=n(o,a));return o}function n(r,o){return o?r?r+" "+o:r+o:r}typeof Rl<"u"&&Rl.exports?(t.default=t,Rl.exports=t):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return t}):window.classNames=t})()});var Rb=q((P8,Yp)=>{"use strict";var BP=Object.prototype.hasOwnProperty,Xt="~";function Aa(){}Object.create&&(Aa.prototype=Object.create(null),new Aa().__proto__||(Xt=!1));function NP(i,t,e){this.fn=i,this.context=t,this.once=e||!1}function Ab(i,t,e,n,r){if(typeof e!="function")throw new TypeError("The listener must be a function");var o=new NP(e,n||i,r),a=Xt?Xt+t:t;return i._events[a]?i._events[a].fn?i._events[a]=[i._events[a],o]:i._events[a].push(o):(i._events[a]=o,i._eventsCount++),i}function ec(i,t){--i._eventsCount===0?i._events=new Aa:delete i._events[t]}function Ut(){this._events=new Aa,this._eventsCount=0}Ut.prototype.eventNames=function(){var t=[],e,n;if(this._eventsCount===0)return t;for(n in e=this._events)BP.call(e,n)&&t.push(Xt?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};Ut.prototype.listeners=function(t){var e=Xt?Xt+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a};Ut.prototype.listenerCount=function(t){var e=Xt?Xt+t:t,n=this._events[e];return n?n.fn?1:n.length:0};Ut.prototype.emit=function(t,e,n,r,o,a){var s=Xt?Xt+t:t;if(!this._events[s])return!1;var l=this._events[s],c=arguments.length,d,p;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,o),!0;case 6:return l.fn.call(l.context,e,n,r,o,a),!0}for(p=1,d=new Array(c-1);p<c;p++)d[p-1]=arguments[p];l.fn.apply(l.context,d)}else{var v=l.length,g;for(p=0;p<v;p++)switch(l[p].once&&this.removeListener(t,l[p].fn,void 0,!0),c){case 1:l[p].fn.call(l[p].context);break;case 2:l[p].fn.call(l[p].context,e);break;case 3:l[p].fn.call(l[p].context,e,n);break;case 4:l[p].fn.call(l[p].context,e,n,r);break;default:if(!d)for(g=1,d=new Array(c-1);g<c;g++)d[g-1]=arguments[g];l[p].fn.apply(l[p].context,d)}}return!0};Ut.prototype.on=function(t,e,n){return Ab(this,t,e,n,!1)};Ut.prototype.once=function(t,e,n){return Ab(this,t,e,n,!0)};Ut.prototype.removeListener=function(t,e,n,r){var o=Xt?Xt+t:t;if(!this._events[o])return this;if(!e)return ec(this,o),this;var a=this._events[o];if(a.fn)a.fn===e&&(!r||a.once)&&(!n||a.context===n)&&ec(this,o);else{for(var s=0,l=[],c=a.length;s<c;s++)(a[s].fn!==e||r&&!a[s].once||n&&a[s].context!==n)&&l.push(a[s]);l.length?this._events[o]=l.length===1?l[0]:l:ec(this,o)}return this};Ut.prototype.removeAllListeners=function(t){var e;return t?(e=Xt?Xt+t:t,this._events[e]&&ec(this,e)):(this._events=new Aa,this._eventsCount=0),this};Ut.prototype.off=Ut.prototype.removeListener;Ut.prototype.addListener=Ut.prototype.on;Ut.prefixed=Xt;Ut.EventEmitter=Ut;typeof Yp<"u"&&(Yp.exports=Ut)});var Sv=q((ku,Tu)=>{(function(i,t){typeof ku=="object"&&typeof Tu<"u"?Tu.exports=t():typeof define=="function"&&define.amd?define(t):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=t())})(ku,function(){"use strict";function i(A,I){var T=Object.keys(A);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(A);I&&(M=M.filter(function(R){return Object.getOwnPropertyDescriptor(A,R).enumerable})),T.push.apply(T,M)}return T}function t(A){for(var I=1;I<arguments.length;I++){var T=arguments[I]!=null?arguments[I]:{};I%2?i(Object(T),!0).forEach(function(M){o(A,M,T[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(T)):i(Object(T)).forEach(function(M){Object.defineProperty(A,M,Object.getOwnPropertyDescriptor(T,M))})}return A}function e(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function n(A,I){for(var T=0;T<I.length;T++){var M=I[T];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(A,l(M.key),M)}}function r(A,I,T){return I&&n(A.prototype,I),T&&n(A,T),Object.defineProperty(A,"prototype",{writable:!1}),A}function o(A,I,T){return I=l(I),I in A?Object.defineProperty(A,I,{value:T,enumerable:!0,configurable:!0,writable:!0}):A[I]=T,A}function a(){return a=Object.assign?Object.assign.bind():function(A){for(var I=1;I<arguments.length;I++){var T=arguments[I];for(var M in T)Object.prototype.hasOwnProperty.call(T,M)&&(A[M]=T[M])}return A},a.apply(this,arguments)}function s(A,I){if(typeof A!="object"||A===null)return A;var T=A[Symbol.toPrimitive];if(T!==void 0){var M=T.call(A,I||"default");if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(A)}function l(A){var I=s(A,"string");return typeof I=="symbol"?I:String(I)}var c={exports:{}};(function(A){typeof window>"u"||function(I){var T=I.HTMLCanvasElement&&I.HTMLCanvasElement.prototype,M=I.Blob&&function(){try{return!!new Blob}catch{return!1}}(),R=M&&I.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),Y=I.BlobBuilder||I.WebKitBlobBuilder||I.MozBlobBuilder||I.MSBlobBuilder,ce=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,Z=(M||Y)&&I.atob&&I.ArrayBuffer&&I.Uint8Array&&function(Q){var te,de,ue,Pe,re,oe,De,ke,Zt;if(te=Q.match(ce),!te)throw new Error("invalid data URI");for(de=te[2]?te[1]:"text/plain"+(te[3]||";charset=US-ASCII"),ue=!!te[4],Pe=Q.slice(te[0].length),ue?re=atob(Pe):re=decodeURIComponent(Pe),oe=new ArrayBuffer(re.length),De=new Uint8Array(oe),ke=0;ke<re.length;ke+=1)De[ke]=re.charCodeAt(ke);return M?new Blob([R?De:oe],{type:de}):(Zt=new Y,Zt.append(oe),Zt.getBlob(de))};I.HTMLCanvasElement&&!T.toBlob&&(T.mozGetAsFile?T.toBlob=function(Q,te,de){var ue=this;setTimeout(function(){de&&T.toDataURL&&Z?Q(Z(ue.toDataURL(te,de))):Q(ue.mozGetAsFile("blob",te))})}:T.toDataURL&&Z&&(T.msToBlob?T.toBlob=function(Q,te,de){var ue=this;setTimeout(function(){(te&&te!=="image/png"||de)&&T.toDataURL&&Z?Q(Z(ue.toDataURL(te,de))):Q(ue.msToBlob(te))})}:T.toBlob=function(Q,te,de){var ue=this;setTimeout(function(){Q(Z(ue.toDataURL(te,de)))})})),A.exports?A.exports=Z:I.dataURLtoBlob=Z}(window)})(c);var d=c.exports,p=function(I){return typeof Blob>"u"?!1:I instanceof Blob||Object.prototype.toString.call(I)==="[object Blob]"},v={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},g=typeof window<"u"&&typeof window.document<"u",w=g?window:{},E=function(I){return I>0&&I<1/0},L=Array.prototype.slice;function F(A){return Array.from?Array.from(A):L.call(A)}var G=/^image\/.+$/;function he(A){return G.test(A)}function me(A){var I=he(A)?A.substr(6):"";return I==="jpeg"&&(I="jpg"),".".concat(I)}var se=String.fromCharCode;function y(A,I,T){var M="",R;for(T+=I,R=I;R<T;R+=1)M+=se(A.getUint8(R));return M}var x=w.btoa;function D(A,I){for(var T=[],M=8192,R=new Uint8Array(A);R.length>0;)T.push(se.apply(null,F(R.subarray(0,M)))),R=R.subarray(M);return"data:".concat(I,";base64,").concat(x(T.join("")))}function z(A){var I=new DataView(A),T;try{var M,R,Y;if(I.getUint8(0)===255&&I.getUint8(1)===216)for(var ce=I.byteLength,Z=2;Z+1<ce;){if(I.getUint8(Z)===255&&I.getUint8(Z+1)===225){R=Z;break}Z+=1}if(R){var Q=R+4,te=R+10;if(y(I,Q,4)==="Exif"){var de=I.getUint16(te);if(M=de===18761,(M||de===19789)&&I.getUint16(te+2,M)===42){var ue=I.getUint32(te+4,M);ue>=8&&(Y=te+ue)}}}if(Y){var Pe=I.getUint16(Y,M),re,oe;for(oe=0;oe<Pe;oe+=1)if(re=Y+oe*12+2,I.getUint16(re,M)===274){re+=8,T=I.getUint16(re,M),I.setUint16(re,1,M);break}}}catch{T=1}return T}function V(A){var I=0,T=1,M=1;switch(A){case 2:T=-1;break;case 3:I=-180;break;case 4:M=-1;break;case 5:I=90,M=-1;break;case 6:I=90;break;case 7:I=90,T=-1;break;case 8:I=-90;break}return{rotate:I,scaleX:T,scaleY:M}}var ie=/\.\d*(?:0|9){12}\d*$/;function Ie(A){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return ie.test(A)?Math.round(A*I)/I:A}function it(A){var I=A.aspectRatio,T=A.height,M=A.width,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",Y=E(M),ce=E(T);if(Y&&ce){var Z=T*I;(R==="contain"||R==="none")&&Z>M||R==="cover"&&Z<M?T=M/I:M=T*I}else Y?T=M/I:ce&&(M=T*I);return{width:M,height:T}}function Be(A){for(var I=F(new Uint8Array(A)),T=I.length,M=[],R=0;R+3<T;){var Y=I[R],ce=I[R+1];if(Y===255&&ce===218)break;if(Y===255&&ce===216)R+=2;else{var Z=I[R+2]*256+I[R+3],Q=R+Z+2,te=I.slice(R,Q);M.push(te),R=Q}}return M.reduce(function(de,ue){return ue[0]===255&&ue[1]===225?de.concat(ue):de},[])}function Oe(A,I){var T=F(new Uint8Array(A));if(T[2]!==255||T[3]!==224)return A;var M=T[4]*256+T[5],R=[255,216].concat(I,T.slice(4+M));return new Uint8Array(R)}var ne=w.ArrayBuffer,nt=w.FileReader,le=w.URL||w.webkitURL,ai=/\.\w+$/,xe=w.Compressor,ee=function(){function A(I,T){e(this,A),this.file=I,this.exif=[],this.image=new Image,this.options=t(t({},v),T),this.aborted=!1,this.result=null,this.init()}return r(A,[{key:"init",value:function(){var T=this,M=this.file,R=this.options;if(!p(M)){this.fail(new Error("The first argument must be a File or Blob object."));return}var Y=M.type;if(!he(Y)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!le||!nt){this.fail(new Error("The current browser does not support image compression."));return}ne||(R.checkOrientation=!1,R.retainExif=!1);var ce=Y==="image/jpeg",Z=ce&&R.checkOrientation,Q=ce&&R.retainExif;if(le&&!Z&&!Q)this.load({url:le.createObjectURL(M)});else{var te=new nt;this.reader=te,te.onload=function(de){var ue=de.target,Pe=ue.result,re={},oe=1;Z&&(oe=z(Pe),oe>1&&a(re,V(oe))),Q&&(T.exif=Be(Pe)),Z||Q?!le||oe>1?re.url=D(Pe,Y):re.url=le.createObjectURL(M):re.url=Pe,T.load(re)},te.onabort=function(){T.fail(new Error("Aborted to read the image with FileReader."))},te.onerror=function(){T.fail(new Error("Failed to read the image with FileReader."))},te.onloadend=function(){T.reader=null},Z||Q?te.readAsArrayBuffer(M):te.readAsDataURL(M)}}},{key:"load",value:function(T){var M=this,R=this.file,Y=this.image;Y.onload=function(){M.draw(t(t({},T),{},{naturalWidth:Y.naturalWidth,naturalHeight:Y.naturalHeight}))},Y.onabort=function(){M.fail(new Error("Aborted to load the image."))},Y.onerror=function(){M.fail(new Error("Failed to load the image."))},w.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(w.navigator.userAgent)&&(Y.crossOrigin="anonymous"),Y.alt=R.name,Y.src=T.url}},{key:"draw",value:function(T){var M=this,R=T.naturalWidth,Y=T.naturalHeight,ce=T.rotate,Z=ce===void 0?0:ce,Q=T.scaleX,te=Q===void 0?1:Q,de=T.scaleY,ue=de===void 0?1:de,Pe=this.file,re=this.image,oe=this.options,De=document.createElement("canvas"),ke=De.getContext("2d"),Zt=Math.abs(Z)%180===90,si=(oe.resize==="contain"||oe.resize==="cover")&&E(oe.width)&&E(oe.height),at=Math.max(oe.maxWidth,0)||1/0,Jt=Math.max(oe.maxHeight,0)||1/0,$e=Math.max(oe.minWidth,0)||0,Mt=Math.max(oe.minHeight,0)||0,Ot=R/Y,Ke=oe.width,yt=oe.height;if(Zt){var nn=[Jt,at];at=nn[0],Jt=nn[1];var li=[Mt,$e];$e=li[0],Mt=li[1];var Pn=[yt,Ke];Ke=Pn[0],yt=Pn[1]}si&&(Ot=Ke/yt);var Po=it({aspectRatio:Ot,width:at,height:Jt},"contain");at=Po.width,Jt=Po.height;var Hh=it({aspectRatio:Ot,width:$e,height:Mt},"cover");if($e=Hh.width,Mt=Hh.height,si){var Vh=it({aspectRatio:Ot,width:Ke,height:yt},oe.resize);Ke=Vh.width,yt=Vh.height}else{var Uh=it({aspectRatio:Ot,width:Ke,height:yt}),Wh=Uh.width;Ke=Wh===void 0?R:Wh;var $h=Uh.height;yt=$h===void 0?Y:$h}Ke=Math.floor(Ie(Math.min(Math.max(Ke,$e),at))),yt=Math.floor(Ie(Math.min(Math.max(yt,Mt),Jt)));var dy=-Ke/2,py=-yt/2,uy=Ke,hy=yt,Dc=[];if(si){var qh=0,Gh=0,kc=R,Tc=Y,Yh=it({aspectRatio:Ot,width:R,height:Y},{contain:"cover",cover:"contain"}[oe.resize]);kc=Yh.width,Tc=Yh.height,qh=(R-kc)/2,Gh=(Y-Tc)/2,Dc.push(qh,Gh,kc,Tc)}if(Dc.push(dy,py,uy,hy),Zt){var Xh=[yt,Ke];Ke=Xh[0],yt=Xh[1]}De.width=Ke,De.height=yt,he(oe.mimeType)||(oe.mimeType=Pe.type);var Kh="transparent";Pe.size>oe.convertSize&&oe.convertTypes.indexOf(oe.mimeType)>=0&&(oe.mimeType="image/jpeg");var Qh=oe.mimeType==="image/jpeg";if(Qh&&(Kh="#fff"),ke.fillStyle=Kh,ke.fillRect(0,0,Ke,yt),oe.beforeDraw&&oe.beforeDraw.call(this,ke,De),!this.aborted&&(ke.save(),ke.translate(Ke/2,yt/2),ke.rotate(Z*Math.PI/180),ke.scale(te,ue),ke.drawImage.apply(ke,[re].concat(Dc)),ke.restore(),oe.drew&&oe.drew.call(this,ke,De),!this.aborted)){var Zh=function(Eo){if(!M.aborted){var Jh=function(Io){return M.done({naturalWidth:R,naturalHeight:Y,result:Io})};if(Eo&&Qh&&oe.retainExif&&M.exif&&M.exif.length>0){var em=function(Io){return Jh(d(D(Oe(Io,M.exif),oe.mimeType)))};if(Eo.arrayBuffer)Eo.arrayBuffer().then(em).catch(function(){M.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var xr=new nt;M.reader=xr,xr.onload=function(Mc){var Io=Mc.target;em(Io.result)},xr.onabort=function(){M.fail(new Error("Aborted to read the compressed image with FileReader."))},xr.onerror=function(){M.fail(new Error("Failed to read the compressed image with FileReader."))},xr.onloadend=function(){M.reader=null},xr.readAsArrayBuffer(Eo)}}else Jh(Eo)}};De.toBlob?De.toBlob(Zh,oe.mimeType,oe.quality):Zh(d(De.toDataURL(oe.mimeType,oe.quality)))}}},{key:"done",value:function(T){var M=T.naturalWidth,R=T.naturalHeight,Y=T.result,ce=this.file,Z=this.image,Q=this.options;if(le&&Z.src.indexOf("blob:")===0&&le.revokeObjectURL(Z.src),Y)if(Q.strict&&!Q.retainExif&&Y.size>ce.size&&Q.mimeType===ce.type&&!(Q.width>M||Q.height>R||Q.minWidth>M||Q.minHeight>R||Q.maxWidth<M||Q.maxHeight<R))Y=ce;else{var te=new Date;Y.lastModified=te.getTime(),Y.lastModifiedDate=te,Y.name=ce.name,Y.name&&Y.type!==ce.type&&(Y.name=Y.name.replace(ai,me(Y.type)))}else Y=ce;this.result=Y,Q.success&&Q.success.call(this,Y)}},{key:"fail",value:function(T){var M=this.options;if(M.error)M.error.call(this,T);else throw T}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=xe,A}},{key:"setDefaults",value:function(T){a(v,T)}}]),A}();return ee})});var Dv=q((Ou,Fu)=>{((i,t)=>{typeof define=="function"&&define.amd?define([],t):typeof Fu=="object"&&typeof Ou<"u"?Fu.exports=t():i.Papa=t()})(Ou,function i(){var t=typeof self<"u"?self:typeof window<"u"?window:t!==void 0?t:{},e,n=!t.document&&!!t.postMessage,r=t.IS_PAPA_WORKER||!1,o={},a=0,s={};function l(y){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(x){var D=he(x);D.chunkSize=parseInt(D.chunkSize),x.step||x.chunk||(D.chunkSize=null),this._handle=new g(D),(this._handle.streamer=this)._config=D}.call(this,y),this.parseChunk=function(x,D){var z=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<z){let ie=this._config.newline;ie||(V=this._config.quoteChar||'"',ie=this._handle.guessLineEndings(x,V)),x=[...x.split(ie).slice(z)].join(ie)}this.isFirstChunk&&se(this._config.beforeFirstChunk)&&(V=this._config.beforeFirstChunk(x))!==void 0&&(x=V),this.isFirstChunk=!1,this._halted=!1;var z=this._partialLine+x,V=(this._partialLine="",this._handle.parse(z,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(x=V.meta.cursor,z=(this._finished||(this._partialLine=z.substring(x-this._baseIndex),this._baseIndex=x),V&&V.data&&(this._rowCount+=V.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)t.postMessage({results:V,workerId:s.WORKER_ID,finished:z});else if(se(this._config.chunk)&&!D){if(this._config.chunk(V,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=V=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(V.data),this._completeResults.errors=this._completeResults.errors.concat(V.errors),this._completeResults.meta=V.meta),this._completed||!z||!se(this._config.complete)||V&&V.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),z||V&&V.meta.paused||this._nextChunk(),V}this._halted=!0},this._sendError=function(x){se(this._config.error)?this._config.error(x):r&&this._config.error&&t.postMessage({workerId:s.WORKER_ID,error:x,finished:!1})}}function c(y){var x;(y=y||{}).chunkSize||(y.chunkSize=s.RemoteChunkSize),l.call(this,y),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(D){this._input=D,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(x=new XMLHttpRequest,this._config.withCredentials&&(x.withCredentials=this._config.withCredentials),n||(x.onload=me(this._chunkLoaded,this),x.onerror=me(this._chunkError,this)),x.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var D,z=this._config.downloadRequestHeaders;for(D in z)x.setRequestHeader(D,z[D])}var V;this._config.chunkSize&&(V=this._start+this._config.chunkSize-1,x.setRequestHeader("Range","bytes="+this._start+"-"+V));try{x.send(this._config.downloadRequestBody)}catch(ie){this._chunkError(ie.message)}n&&x.status===0&&this._chunkError()}},this._chunkLoaded=function(){x.readyState===4&&(x.status<200||400<=x.status?this._chunkError():(this._start+=this._config.chunkSize||x.responseText.length,this._finished=!this._config.chunkSize||this._start>=(D=>(D=D.getResponseHeader("Content-Range"))!==null?parseInt(D.substring(D.lastIndexOf("/")+1)):-1)(x),this.parseChunk(x.responseText)))},this._chunkError=function(D){D=x.statusText||D,this._sendError(new Error(D))}}function d(y){(y=y||{}).chunkSize||(y.chunkSize=s.LocalChunkSize),l.call(this,y);var x,D,z=typeof FileReader<"u";this.stream=function(V){this._input=V,D=V.slice||V.webkitSlice||V.mozSlice,z?((x=new FileReader).onload=me(this._chunkLoaded,this),x.onerror=me(this._chunkError,this)):x=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var V=this._input,ie=(this._config.chunkSize&&(ie=Math.min(this._start+this._config.chunkSize,this._input.size),V=D.call(V,this._start,ie)),x.readAsText(V,this._config.encoding));z||this._chunkLoaded({target:{result:ie}})},this._chunkLoaded=function(V){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(V.target.result)},this._chunkError=function(){this._sendError(x.error)}}function p(y){var x;l.call(this,y=y||{}),this.stream=function(D){return x=D,this._nextChunk()},this._nextChunk=function(){var D,z;if(!this._finished)return D=this._config.chunkSize,x=D?(z=x.substring(0,D),x.substring(D)):(z=x,""),this._finished=!x,this.parseChunk(z)}}function v(y){l.call(this,y=y||{});var x=[],D=!0,z=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(V){this._input=V,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){z&&x.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),x.length?this.parseChunk(x.shift()):D=!0},this._streamData=me(function(V){try{x.push(typeof V=="string"?V:V.toString(this._config.encoding)),D&&(D=!1,this._checkIsFinished(),this.parseChunk(x.shift()))}catch(ie){this._streamError(ie)}},this),this._streamError=me(function(V){this._streamCleanUp(),this._sendError(V)},this),this._streamEnd=me(function(){this._streamCleanUp(),z=!0,this._streamData("")},this),this._streamCleanUp=me(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function g(y){var x,D,z,V,ie=Math.pow(2,53),Ie=-ie,it=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Be=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,Oe=this,ne=0,nt=0,le=!1,ai=!1,xe=[],ee={data:[],errors:[],meta:{}};function A(R){return y.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function I(){if(ee&&z&&(M("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),z=!1),y.skipEmptyLines&&(ee.data=ee.data.filter(function(Q){return!A(Q)})),T()){let Q=function(te,de){se(y.transformHeader)&&(te=y.transformHeader(te,de)),xe.push(te)};var Z=Q;if(ee)if(Array.isArray(ee.data[0])){for(var R=0;T()&&R<ee.data.length;R++)ee.data[R].forEach(Q);ee.data.splice(0,1)}else ee.data.forEach(Q)}function Y(Q,te){for(var de=y.header?{}:[],ue=0;ue<Q.length;ue++){var Pe=ue,re=Q[ue],re=((oe,De)=>(ke=>(y.dynamicTypingFunction&&y.dynamicTyping[ke]===void 0&&(y.dynamicTyping[ke]=y.dynamicTypingFunction(ke)),(y.dynamicTyping[ke]||y.dynamicTyping)===!0))(oe)?De==="true"||De==="TRUE"||De!=="false"&&De!=="FALSE"&&((ke=>{if(it.test(ke)&&(ke=parseFloat(ke),Ie<ke&&ke<ie))return 1})(De)?parseFloat(De):Be.test(De)?new Date(De):De===""?null:De):De)(Pe=y.header?ue>=xe.length?"__parsed_extra":xe[ue]:Pe,re=y.transform?y.transform(re,Pe):re);Pe==="__parsed_extra"?(de[Pe]=de[Pe]||[],de[Pe].push(re)):de[Pe]=re}return y.header&&(ue>xe.length?M("FieldMismatch","TooManyFields","Too many fields: expected "+xe.length+" fields but parsed "+ue,nt+te):ue<xe.length&&M("FieldMismatch","TooFewFields","Too few fields: expected "+xe.length+" fields but parsed "+ue,nt+te)),de}var ce;ee&&(y.header||y.dynamicTyping||y.transform)&&(ce=1,!ee.data.length||Array.isArray(ee.data[0])?(ee.data=ee.data.map(Y),ce=ee.data.length):ee.data=Y(ee.data,0),y.header&&ee.meta&&(ee.meta.fields=xe),nt+=ce)}function T(){return y.header&&xe.length===0}function M(R,Y,ce,Z){R={type:R,code:Y,message:ce},Z!==void 0&&(R.row=Z),ee.errors.push(R)}se(y.step)&&(V=y.step,y.step=function(R){ee=R,T()?I():(I(),ee.data.length!==0&&(ne+=R.data.length,y.preview&&ne>y.preview?D.abort():(ee.data=ee.data[0],V(ee,Oe))))}),this.parse=function(R,Y,ce){var Z=y.quoteChar||'"',Z=(y.newline||(y.newline=this.guessLineEndings(R,Z)),z=!1,y.delimiter?se(y.delimiter)&&(y.delimiter=y.delimiter(R),ee.meta.delimiter=y.delimiter):((Z=((Q,te,de,ue,Pe)=>{var re,oe,De,ke;Pe=Pe||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var Zt=0;Zt<Pe.length;Zt++){for(var si,at=Pe[Zt],Jt=0,$e=0,Mt=0,Ot=(De=void 0,new E({comments:ue,delimiter:at,newline:te,preview:10}).parse(Q)),Ke=0;Ke<Ot.data.length;Ke++)de&&A(Ot.data[Ke])?Mt++:(si=Ot.data[Ke].length,$e+=si,De===void 0?De=si:0<si&&(Jt+=Math.abs(si-De),De=si));0<Ot.data.length&&($e/=Ot.data.length-Mt),(oe===void 0||Jt<=oe)&&(ke===void 0||ke<$e)&&1.99<$e&&(oe=Jt,re=at,ke=$e)}return{successful:!!(y.delimiter=re),bestDelimiter:re}})(R,y.newline,y.skipEmptyLines,y.comments,y.delimitersToGuess)).successful?y.delimiter=Z.bestDelimiter:(z=!0,y.delimiter=s.DefaultDelimiter),ee.meta.delimiter=y.delimiter),he(y));return y.preview&&y.header&&Z.preview++,x=R,D=new E(Z),ee=D.parse(x,Y,ce),I(),le?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return le},this.pause=function(){le=!0,D.abort(),x=se(y.chunk)?"":x.substring(D.getCharIndex())},this.resume=function(){Oe.streamer._halted?(le=!1,Oe.streamer.parseChunk(x,!0)):setTimeout(Oe.resume,3)},this.aborted=function(){return ai},this.abort=function(){ai=!0,D.abort(),ee.meta.aborted=!0,se(y.complete)&&y.complete(ee),x=""},this.guessLineEndings=function(Q,Z){Q=Q.substring(0,1048576);var Z=new RegExp(w(Z)+"([^]*?)"+w(Z),"gm"),ce=(Q=Q.replace(Z,"")).split("\r"),Z=Q.split(`
1
+ import{a as Es,b as Hs,c as Im}from"./chunk-3HVQWFM3.js";import{a as Vs,b as qi,c as Di,d as Lr}from"./chunk-MSLVFLMV.js";import{a as Uc}from"./chunk-V6METRMW.js";import{$ as Em,B as kt,C as Vt,D as Ds,F as ks,G as Ts,H as Wi,I as gt,J as bt,K as Br,L as Ms,M as Os,N as Fs,O as As,P as Rs,Q as Bs,S as Cm,T as Sm,U as Ns,V as zs,W as Ls,Y as js,Z as Pm,a as Pi,aa as zr,b as Ss,d as Ps,da as $i,ia as qc,ja as Dm,k as vm,l as Ui,n as Ei,o as _m,q as ym,r as Rt,s as Dt,t as wm,u as Rr,v as ht,w as mt,x as xm,y as ft,z as Is}from"./chunk-MCHSQWDB.js";import{$a as bs,$b as ae,$c as Vc,Aa as Ge,Ab as W,Ac as dm,Ad as et,Bc as pm,C as wt,Ca as U,Cb as ci,Cc as um,Cd as bm,D as hs,Da as O,Dc as di,Ea as Ac,Eb as vs,Ec as fe,Fa as Rc,Fc as ze,Gb as Oo,Gc as Ro,H as Vi,Ha as pe,Hb as kn,I as Ve,Ia as _e,Id as Bo,J as tm,Ja as Ue,Jb as Lc,Jc as Je,Jd as qn,Ka as gs,Kb as B,Kc as pi,Kd as No,Lb as cm,Lc as Si,M as im,Mb as Ci,Mc as Hc,Md as Ii,N as nm,Nc as we,Nd as sn,O as ms,Oa as sm,Ob as Lt,P as Vn,Pd as Nr,Qd as Wc,Ra as $t,Rb as H,Rd as $c,S as Un,Sa as X,Sb as jc,Ta as K,Tb as Fo,U as st,Ua as Bc,Ub as qe,Uc as hm,Va as Nc,Vb as C,Wa as Ye,Wb as Ao,Xa as Ct,Xb as Ze,Xc as It,Y as Oc,Yb as rn,Z as En,Za as He,Zb as _s,Zc as xt,_a as We,_c as mm,a as _,aa as Er,ab as Mo,ac as Tn,ad as fm,b as k,bb as Ce,bc as Mn,bd as an,c as Sr,ca as In,cb as Dn,cc as St,d as q,dc as Pt,e as Ne,ea as rm,ec as h,fa as To,fc as m,g as j,gb as zc,gc as J,h as Pr,ha as om,hb as Dr,hc as ys,hd as Le,i as ds,ib as lm,ic as ws,j as ps,jc as on,k as us,kc as Se,l as ei,lc as Tr,md as xs,n as Ft,na as am,nc as N,oa as Fc,oc as S,od as On,pa as fs,pc as jt,q as Te,qa as Ai,qc as At,qd as Mr,r as ko,ra as Ri,sa as ti,sb as kr,sc as Et,ta as Ee,tc as ut,ub as Wn,uc as Fe,ud as Or,vc as Ae,vd as Fr,wa as Ir,wc as $n,xa as be,xc as b,xd as Cs,ya as ve,yc as P,yd as Ar,zb as f,zc as Ht,zd as gm}from"./chunk-YB6XMFOT.js";var of=q((uA,rf)=>{var s1=4,l1=.001,c1=1e-7,d1=10,Wo=11,Qs=1/(Wo-1),p1=typeof Float32Array=="function";function Jm(i,t){return 1-3*t+3*i}function ef(i,t){return 3*t-6*i}function tf(i){return 3*i}function Zs(i,t,e){return((Jm(t,e)*i+ef(t,e))*i+tf(t))*i}function nf(i,t,e){return 3*Jm(t,e)*i*i+2*ef(t,e)*i+tf(t)}function u1(i,t,e,n,r){var o,a,s=0;do a=t+(e-t)/2,o=Zs(a,n,r)-i,o>0?e=a:t=a;while(Math.abs(o)>c1&&++s<d1);return a}function h1(i,t,e,n){for(var r=0;r<s1;++r){var o=nf(t,e,n);if(o===0)return t;var a=Zs(t,e,n)-i;t-=a/o}return t}function m1(i){return i}rf.exports=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return m1;for(var o=p1?new Float32Array(Wo):new Array(Wo),a=0;a<Wo;++a)o[a]=Zs(a*Qs,t,n);function s(l){for(var c=0,d=1,p=Wo-1;d!==p&&o[d]<=l;++d)c+=Qs;--d;var v=(l-o[d])/(o[d+1]-o[d]),g=c+v*Qs,w=nf(g,t,n);return w>=l1?h1(l,g,t,n):w===0?g:u1(l,c,c+Qs,t,n)}return function(c){return c===0?0:c===1?1:Zs(s(c),e,r)}}});var Cg=q((rz,xg)=>{xg.exports=function(){var t={},e=t._fns={};t.emit=function(a,s,l,c,d,p,v){var g=n(a);g.length&&r(a,g,[s,l,c,d,p,v])},t.on=function(a,s){e[a]||(e[a]=[]),e[a].push(s)},t.once=function(a,s){function l(){s.apply(this,arguments),t.off(a,l)}this.on(a,l)},t.off=function(a,s){var l=[];if(a&&s){var c=this._fns[a],d=0,p=c?c.length:0;for(d;d<p;d++)c[d]!==s&&l.push(c[d])}l.length?this._fns[a]=l:delete this._fns[a]};function n(o){var a=e[o]?e[o]:[],s=o.indexOf(":"),l=s===-1?[o]:[o.substring(0,s),o.substring(s+1)],c=Object.keys(e),d=0,p=c.length;for(d;d<p;d++){var v=c[d];if(v==="*"&&(a=a.concat(e[v])),l.length===2&&l[0]===v){a=a.concat(e[v]);break}}return a}function r(o,a,s){var l=0,c=a.length;for(l;l<c&&a[l];l++)a[l].event=o,a[l].apply(a[l],s)}return t}});var xl=q((az,Sg)=>{function cC(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}Sg.exports=cC});var Eg=q((sz,Pg)=>{var dC=typeof global=="object"&&global&&global.Object===Object&&global;Pg.exports=dC});var jd=q((lz,Ig)=>{var pC=Eg(),uC=typeof self=="object"&&self&&self.Object===Object&&self,hC=pC||uC||Function("return this")();Ig.exports=hC});var kg=q((cz,Dg)=>{var mC=jd(),fC=function(){return mC.Date.now()};Dg.exports=fC});var Mg=q((dz,Tg)=>{var gC=/\s/;function bC(i){for(var t=i.length;t--&&gC.test(i.charAt(t)););return t}Tg.exports=bC});var Fg=q((pz,Og)=>{var vC=Mg(),_C=/^\s+/;function yC(i){return i&&i.slice(0,vC(i)+1).replace(_C,"")}Og.exports=yC});var Hd=q((uz,Ag)=>{var wC=jd(),xC=wC.Symbol;Ag.exports=xC});var zg=q((hz,Ng)=>{var Rg=Hd(),Bg=Object.prototype,CC=Bg.hasOwnProperty,SC=Bg.toString,na=Rg?Rg.toStringTag:void 0;function PC(i){var t=CC.call(i,na),e=i[na];try{i[na]=void 0;var n=!0}catch{}var r=SC.call(i);return n&&(t?i[na]=e:delete i[na]),r}Ng.exports=PC});var jg=q((mz,Lg)=>{var EC=Object.prototype,IC=EC.toString;function DC(i){return IC.call(i)}Lg.exports=DC});var Wg=q((fz,Ug)=>{var Hg=Hd(),kC=zg(),TC=jg(),MC="[object Null]",OC="[object Undefined]",Vg=Hg?Hg.toStringTag:void 0;function FC(i){return i==null?i===void 0?OC:MC:Vg&&Vg in Object(i)?kC(i):TC(i)}Ug.exports=FC});var qg=q((gz,$g)=>{function AC(i){return i!=null&&typeof i=="object"}$g.exports=AC});var Yg=q((bz,Gg)=>{var RC=Wg(),BC=qg(),NC="[object Symbol]";function zC(i){return typeof i=="symbol"||BC(i)&&RC(i)==NC}Gg.exports=zC});var Zg=q((vz,Qg)=>{var LC=Fg(),Xg=xl(),jC=Yg(),Kg=NaN,HC=/^[-+]0x[0-9a-f]+$/i,VC=/^0b[01]+$/i,UC=/^0o[0-7]+$/i,WC=parseInt;function $C(i){if(typeof i=="number")return i;if(jC(i))return Kg;if(Xg(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=Xg(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=LC(i);var e=VC.test(i);return e||UC.test(i)?WC(i.slice(2),e?2:8):HC.test(i)?Kg:+i}Qg.exports=$C});var Ud=q((_z,e0)=>{var qC=xl(),Vd=kg(),Jg=Zg(),GC="Expected a function",YC=Math.max,XC=Math.min;function KC(i,t,e){var n,r,o,a,s,l,c=0,d=!1,p=!1,v=!0;if(typeof i!="function")throw new TypeError(GC);t=Jg(t)||0,qC(e)&&(d=!!e.leading,p="maxWait"in e,o=p?YC(Jg(e.maxWait)||0,t):o,v="trailing"in e?!!e.trailing:v);function g(y){var x=n,D=r;return n=r=void 0,c=y,a=i.apply(D,x),a}function w(y){return c=y,s=setTimeout(F,t),d?g(y):a}function E(y){var x=y-l,D=y-c,z=t-x;return p?XC(z,o-D):z}function L(y){var x=y-l,D=y-c;return l===void 0||x>=t||x<0||p&&D>=o}function F(){var y=Vd();if(L(y))return G(y);s=setTimeout(F,E(y))}function G(y){return s=void 0,v&&n?g(y):(n=r=void 0,a)}function he(){s!==void 0&&clearTimeout(s),c=0,n=l=r=s=void 0}function me(){return s===void 0?a:G(Vd())}function se(){var y=Vd(),x=L(y);if(n=arguments,r=this,l=y,x){if(s===void 0)return w(l);if(p)return clearTimeout(s),s=setTimeout(F,t),g(l)}return s===void 0&&(s=setTimeout(F,t)),a}return se.cancel=he,se.flush=me,se}e0.exports=KC});var i0=q((yz,t0)=>{var QC=Ud(),ZC=xl(),JC="Expected a function";function eS(i,t,e){var n=!0,r=!0;if(typeof i!="function")throw new TypeError(JC);return ZC(e)&&(n="leading"in e?!!e.leading:n,r="trailing"in e?!!e.trailing:r),QC(i,t,{leading:n,maxWait:t,trailing:r})}t0.exports=eS});var oa=q((Bz,c0)=>{"use strict";c0.exports=function(t){if(typeof t!="number"||Number.isNaN(t))throw new TypeError(`Expected a number, got ${typeof t}`);let e=t<0,n=Math.abs(t);if(e&&(n=-n),n===0)return"0 B";let r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),r.length-1),a=Number(n/1024**o),s=r[o];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${s}`}});var u0=q((Nz,p0)=>{"use strict";function d0(i,t){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=t,this.parts=i.split(t)}d0.prototype.match=function(i){var t=!0,e=this.parts,n,r=e.length,o;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)t=!1;else{for(o=(i||"").split(this.separator),n=0;t&&n<r;n++)e[n]!=="*"&&(n<o.length?t=e[n]===o[n]:t=!1);t=t&&o}else if(typeof i.splice=="function")for(t=[],n=i.length;n--;)this.match(i[n])&&(t[t.length]=i[n]);else if(typeof i=="object"){t={};for(var a in i)this.match(a)&&(t[a]=i[a])}return t};p0.exports=function(i,t,e){var n=new d0(i,e||/[\/\.]/);return typeof t<"u"?n.match(t):n}});var m0=q((zz,h0)=>{var aS=u0(),sS=/[\/\+\.]/;h0.exports=function(i,t){function e(n){var r=aS(n,i,sS);return r&&r.length>=2}return t?e(t.split(";")[0]):e}});var Gt=q((_4,Rl)=>{(function(){"use strict";var i={}.hasOwnProperty;function t(){for(var r="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(r=n(r,e(a)))}return r}function e(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var a in r)i.call(r,a)&&r[a]&&(o=n(o,a));return o}function n(r,o){return o?r?r+" "+o:r+o:r}typeof Rl<"u"&&Rl.exports?(t.default=t,Rl.exports=t):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return t}):window.classNames=t})()});var Rb=q((S8,Yp)=>{"use strict";var BP=Object.prototype.hasOwnProperty,Xt="~";function Ra(){}Object.create&&(Ra.prototype=Object.create(null),new Ra().__proto__||(Xt=!1));function NP(i,t,e){this.fn=i,this.context=t,this.once=e||!1}function Ab(i,t,e,n,r){if(typeof e!="function")throw new TypeError("The listener must be a function");var o=new NP(e,n||i,r),a=Xt?Xt+t:t;return i._events[a]?i._events[a].fn?i._events[a]=[i._events[a],o]:i._events[a].push(o):(i._events[a]=o,i._eventsCount++),i}function ec(i,t){--i._eventsCount===0?i._events=new Ra:delete i._events[t]}function Ut(){this._events=new Ra,this._eventsCount=0}Ut.prototype.eventNames=function(){var t=[],e,n;if(this._eventsCount===0)return t;for(n in e=this._events)BP.call(e,n)&&t.push(Xt?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};Ut.prototype.listeners=function(t){var e=Xt?Xt+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a};Ut.prototype.listenerCount=function(t){var e=Xt?Xt+t:t,n=this._events[e];return n?n.fn?1:n.length:0};Ut.prototype.emit=function(t,e,n,r,o,a){var s=Xt?Xt+t:t;if(!this._events[s])return!1;var l=this._events[s],c=arguments.length,d,p;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,o),!0;case 6:return l.fn.call(l.context,e,n,r,o,a),!0}for(p=1,d=new Array(c-1);p<c;p++)d[p-1]=arguments[p];l.fn.apply(l.context,d)}else{var v=l.length,g;for(p=0;p<v;p++)switch(l[p].once&&this.removeListener(t,l[p].fn,void 0,!0),c){case 1:l[p].fn.call(l[p].context);break;case 2:l[p].fn.call(l[p].context,e);break;case 3:l[p].fn.call(l[p].context,e,n);break;case 4:l[p].fn.call(l[p].context,e,n,r);break;default:if(!d)for(g=1,d=new Array(c-1);g<c;g++)d[g-1]=arguments[g];l[p].fn.apply(l[p].context,d)}}return!0};Ut.prototype.on=function(t,e,n){return Ab(this,t,e,n,!1)};Ut.prototype.once=function(t,e,n){return Ab(this,t,e,n,!0)};Ut.prototype.removeListener=function(t,e,n,r){var o=Xt?Xt+t:t;if(!this._events[o])return this;if(!e)return ec(this,o),this;var a=this._events[o];if(a.fn)a.fn===e&&(!r||a.once)&&(!n||a.context===n)&&ec(this,o);else{for(var s=0,l=[],c=a.length;s<c;s++)(a[s].fn!==e||r&&!a[s].once||n&&a[s].context!==n)&&l.push(a[s]);l.length?this._events[o]=l.length===1?l[0]:l:ec(this,o)}return this};Ut.prototype.removeAllListeners=function(t){var e;return t?(e=Xt?Xt+t:t,this._events[e]&&ec(this,e)):(this._events=new Ra,this._eventsCount=0),this};Ut.prototype.off=Ut.prototype.removeListener;Ut.prototype.addListener=Ut.prototype.on;Ut.prefixed=Xt;Ut.EventEmitter=Ut;typeof Yp<"u"&&(Yp.exports=Ut)});var Sv=q((ku,Tu)=>{(function(i,t){typeof ku=="object"&&typeof Tu<"u"?Tu.exports=t():typeof define=="function"&&define.amd?define(t):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=t())})(ku,function(){"use strict";function i(A,I){var T=Object.keys(A);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(A);I&&(M=M.filter(function(R){return Object.getOwnPropertyDescriptor(A,R).enumerable})),T.push.apply(T,M)}return T}function t(A){for(var I=1;I<arguments.length;I++){var T=arguments[I]!=null?arguments[I]:{};I%2?i(Object(T),!0).forEach(function(M){o(A,M,T[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(T)):i(Object(T)).forEach(function(M){Object.defineProperty(A,M,Object.getOwnPropertyDescriptor(T,M))})}return A}function e(A,I){if(!(A instanceof I))throw new TypeError("Cannot call a class as a function")}function n(A,I){for(var T=0;T<I.length;T++){var M=I[T];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(A,l(M.key),M)}}function r(A,I,T){return I&&n(A.prototype,I),T&&n(A,T),Object.defineProperty(A,"prototype",{writable:!1}),A}function o(A,I,T){return I=l(I),I in A?Object.defineProperty(A,I,{value:T,enumerable:!0,configurable:!0,writable:!0}):A[I]=T,A}function a(){return a=Object.assign?Object.assign.bind():function(A){for(var I=1;I<arguments.length;I++){var T=arguments[I];for(var M in T)Object.prototype.hasOwnProperty.call(T,M)&&(A[M]=T[M])}return A},a.apply(this,arguments)}function s(A,I){if(typeof A!="object"||A===null)return A;var T=A[Symbol.toPrimitive];if(T!==void 0){var M=T.call(A,I||"default");if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(A)}function l(A){var I=s(A,"string");return typeof I=="symbol"?I:String(I)}var c={exports:{}};(function(A){typeof window>"u"||function(I){var T=I.HTMLCanvasElement&&I.HTMLCanvasElement.prototype,M=I.Blob&&function(){try{return!!new Blob}catch{return!1}}(),R=M&&I.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),Y=I.BlobBuilder||I.WebKitBlobBuilder||I.MozBlobBuilder||I.MSBlobBuilder,ce=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,Z=(M||Y)&&I.atob&&I.ArrayBuffer&&I.Uint8Array&&function(Q){var te,de,ue,Pe,re,oe,De,ke,Zt;if(te=Q.match(ce),!te)throw new Error("invalid data URI");for(de=te[2]?te[1]:"text/plain"+(te[3]||";charset=US-ASCII"),ue=!!te[4],Pe=Q.slice(te[0].length),ue?re=atob(Pe):re=decodeURIComponent(Pe),oe=new ArrayBuffer(re.length),De=new Uint8Array(oe),ke=0;ke<re.length;ke+=1)De[ke]=re.charCodeAt(ke);return M?new Blob([R?De:oe],{type:de}):(Zt=new Y,Zt.append(oe),Zt.getBlob(de))};I.HTMLCanvasElement&&!T.toBlob&&(T.mozGetAsFile?T.toBlob=function(Q,te,de){var ue=this;setTimeout(function(){de&&T.toDataURL&&Z?Q(Z(ue.toDataURL(te,de))):Q(ue.mozGetAsFile("blob",te))})}:T.toDataURL&&Z&&(T.msToBlob?T.toBlob=function(Q,te,de){var ue=this;setTimeout(function(){(te&&te!=="image/png"||de)&&T.toDataURL&&Z?Q(Z(ue.toDataURL(te,de))):Q(ue.msToBlob(te))})}:T.toBlob=function(Q,te,de){var ue=this;setTimeout(function(){Q(Z(ue.toDataURL(te,de)))})})),A.exports?A.exports=Z:I.dataURLtoBlob=Z}(window)})(c);var d=c.exports,p=function(I){return typeof Blob>"u"?!1:I instanceof Blob||Object.prototype.toString.call(I)==="[object Blob]"},v={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},g=typeof window<"u"&&typeof window.document<"u",w=g?window:{},E=function(I){return I>0&&I<1/0},L=Array.prototype.slice;function F(A){return Array.from?Array.from(A):L.call(A)}var G=/^image\/.+$/;function he(A){return G.test(A)}function me(A){var I=he(A)?A.substr(6):"";return I==="jpeg"&&(I="jpg"),".".concat(I)}var se=String.fromCharCode;function y(A,I,T){var M="",R;for(T+=I,R=I;R<T;R+=1)M+=se(A.getUint8(R));return M}var x=w.btoa;function D(A,I){for(var T=[],M=8192,R=new Uint8Array(A);R.length>0;)T.push(se.apply(null,F(R.subarray(0,M)))),R=R.subarray(M);return"data:".concat(I,";base64,").concat(x(T.join("")))}function z(A){var I=new DataView(A),T;try{var M,R,Y;if(I.getUint8(0)===255&&I.getUint8(1)===216)for(var ce=I.byteLength,Z=2;Z+1<ce;){if(I.getUint8(Z)===255&&I.getUint8(Z+1)===225){R=Z;break}Z+=1}if(R){var Q=R+4,te=R+10;if(y(I,Q,4)==="Exif"){var de=I.getUint16(te);if(M=de===18761,(M||de===19789)&&I.getUint16(te+2,M)===42){var ue=I.getUint32(te+4,M);ue>=8&&(Y=te+ue)}}}if(Y){var Pe=I.getUint16(Y,M),re,oe;for(oe=0;oe<Pe;oe+=1)if(re=Y+oe*12+2,I.getUint16(re,M)===274){re+=8,T=I.getUint16(re,M),I.setUint16(re,1,M);break}}}catch{T=1}return T}function V(A){var I=0,T=1,M=1;switch(A){case 2:T=-1;break;case 3:I=-180;break;case 4:M=-1;break;case 5:I=90,M=-1;break;case 6:I=90;break;case 7:I=90,T=-1;break;case 8:I=-90;break}return{rotate:I,scaleX:T,scaleY:M}}var ie=/\.\d*(?:0|9){12}\d*$/;function Ie(A){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return ie.test(A)?Math.round(A*I)/I:A}function it(A){var I=A.aspectRatio,T=A.height,M=A.width,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",Y=E(M),ce=E(T);if(Y&&ce){var Z=T*I;(R==="contain"||R==="none")&&Z>M||R==="cover"&&Z<M?T=M/I:M=T*I}else Y?T=M/I:ce&&(M=T*I);return{width:M,height:T}}function Be(A){for(var I=F(new Uint8Array(A)),T=I.length,M=[],R=0;R+3<T;){var Y=I[R],ce=I[R+1];if(Y===255&&ce===218)break;if(Y===255&&ce===216)R+=2;else{var Z=I[R+2]*256+I[R+3],Q=R+Z+2,te=I.slice(R,Q);M.push(te),R=Q}}return M.reduce(function(de,ue){return ue[0]===255&&ue[1]===225?de.concat(ue):de},[])}function Oe(A,I){var T=F(new Uint8Array(A));if(T[2]!==255||T[3]!==224)return A;var M=T[4]*256+T[5],R=[255,216].concat(I,T.slice(4+M));return new Uint8Array(R)}var ne=w.ArrayBuffer,nt=w.FileReader,le=w.URL||w.webkitURL,ai=/\.\w+$/,xe=w.Compressor,ee=function(){function A(I,T){e(this,A),this.file=I,this.exif=[],this.image=new Image,this.options=t(t({},v),T),this.aborted=!1,this.result=null,this.init()}return r(A,[{key:"init",value:function(){var T=this,M=this.file,R=this.options;if(!p(M)){this.fail(new Error("The first argument must be a File or Blob object."));return}var Y=M.type;if(!he(Y)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!le||!nt){this.fail(new Error("The current browser does not support image compression."));return}ne||(R.checkOrientation=!1,R.retainExif=!1);var ce=Y==="image/jpeg",Z=ce&&R.checkOrientation,Q=ce&&R.retainExif;if(le&&!Z&&!Q)this.load({url:le.createObjectURL(M)});else{var te=new nt;this.reader=te,te.onload=function(de){var ue=de.target,Pe=ue.result,re={},oe=1;Z&&(oe=z(Pe),oe>1&&a(re,V(oe))),Q&&(T.exif=Be(Pe)),Z||Q?!le||oe>1?re.url=D(Pe,Y):re.url=le.createObjectURL(M):re.url=Pe,T.load(re)},te.onabort=function(){T.fail(new Error("Aborted to read the image with FileReader."))},te.onerror=function(){T.fail(new Error("Failed to read the image with FileReader."))},te.onloadend=function(){T.reader=null},Z||Q?te.readAsArrayBuffer(M):te.readAsDataURL(M)}}},{key:"load",value:function(T){var M=this,R=this.file,Y=this.image;Y.onload=function(){M.draw(t(t({},T),{},{naturalWidth:Y.naturalWidth,naturalHeight:Y.naturalHeight}))},Y.onabort=function(){M.fail(new Error("Aborted to load the image."))},Y.onerror=function(){M.fail(new Error("Failed to load the image."))},w.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(w.navigator.userAgent)&&(Y.crossOrigin="anonymous"),Y.alt=R.name,Y.src=T.url}},{key:"draw",value:function(T){var M=this,R=T.naturalWidth,Y=T.naturalHeight,ce=T.rotate,Z=ce===void 0?0:ce,Q=T.scaleX,te=Q===void 0?1:Q,de=T.scaleY,ue=de===void 0?1:de,Pe=this.file,re=this.image,oe=this.options,De=document.createElement("canvas"),ke=De.getContext("2d"),Zt=Math.abs(Z)%180===90,si=(oe.resize==="contain"||oe.resize==="cover")&&E(oe.width)&&E(oe.height),at=Math.max(oe.maxWidth,0)||1/0,Jt=Math.max(oe.maxHeight,0)||1/0,$e=Math.max(oe.minWidth,0)||0,Mt=Math.max(oe.minHeight,0)||0,Ot=R/Y,Ke=oe.width,yt=oe.height;if(Zt){var nn=[Jt,at];at=nn[0],Jt=nn[1];var li=[Mt,$e];$e=li[0],Mt=li[1];var Pn=[yt,Ke];Ke=Pn[0],yt=Pn[1]}si&&(Ot=Ke/yt);var Eo=it({aspectRatio:Ot,width:at,height:Jt},"contain");at=Eo.width,Jt=Eo.height;var Hh=it({aspectRatio:Ot,width:$e,height:Mt},"cover");if($e=Hh.width,Mt=Hh.height,si){var Vh=it({aspectRatio:Ot,width:Ke,height:yt},oe.resize);Ke=Vh.width,yt=Vh.height}else{var Uh=it({aspectRatio:Ot,width:Ke,height:yt}),Wh=Uh.width;Ke=Wh===void 0?R:Wh;var $h=Uh.height;yt=$h===void 0?Y:$h}Ke=Math.floor(Ie(Math.min(Math.max(Ke,$e),at))),yt=Math.floor(Ie(Math.min(Math.max(yt,Mt),Jt)));var dy=-Ke/2,py=-yt/2,uy=Ke,hy=yt,Dc=[];if(si){var qh=0,Gh=0,kc=R,Tc=Y,Yh=it({aspectRatio:Ot,width:R,height:Y},{contain:"cover",cover:"contain"}[oe.resize]);kc=Yh.width,Tc=Yh.height,qh=(R-kc)/2,Gh=(Y-Tc)/2,Dc.push(qh,Gh,kc,Tc)}if(Dc.push(dy,py,uy,hy),Zt){var Xh=[yt,Ke];Ke=Xh[0],yt=Xh[1]}De.width=Ke,De.height=yt,he(oe.mimeType)||(oe.mimeType=Pe.type);var Kh="transparent";Pe.size>oe.convertSize&&oe.convertTypes.indexOf(oe.mimeType)>=0&&(oe.mimeType="image/jpeg");var Qh=oe.mimeType==="image/jpeg";if(Qh&&(Kh="#fff"),ke.fillStyle=Kh,ke.fillRect(0,0,Ke,yt),oe.beforeDraw&&oe.beforeDraw.call(this,ke,De),!this.aborted&&(ke.save(),ke.translate(Ke/2,yt/2),ke.rotate(Z*Math.PI/180),ke.scale(te,ue),ke.drawImage.apply(ke,[re].concat(Dc)),ke.restore(),oe.drew&&oe.drew.call(this,ke,De),!this.aborted)){var Zh=function(Io){if(!M.aborted){var Jh=function(Do){return M.done({naturalWidth:R,naturalHeight:Y,result:Do})};if(Io&&Qh&&oe.retainExif&&M.exif&&M.exif.length>0){var em=function(Do){return Jh(d(D(Oe(Do,M.exif),oe.mimeType)))};if(Io.arrayBuffer)Io.arrayBuffer().then(em).catch(function(){M.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var Cr=new nt;M.reader=Cr,Cr.onload=function(Mc){var Do=Mc.target;em(Do.result)},Cr.onabort=function(){M.fail(new Error("Aborted to read the compressed image with FileReader."))},Cr.onerror=function(){M.fail(new Error("Failed to read the compressed image with FileReader."))},Cr.onloadend=function(){M.reader=null},Cr.readAsArrayBuffer(Io)}}else Jh(Io)}};De.toBlob?De.toBlob(Zh,oe.mimeType,oe.quality):Zh(d(De.toDataURL(oe.mimeType,oe.quality)))}}},{key:"done",value:function(T){var M=T.naturalWidth,R=T.naturalHeight,Y=T.result,ce=this.file,Z=this.image,Q=this.options;if(le&&Z.src.indexOf("blob:")===0&&le.revokeObjectURL(Z.src),Y)if(Q.strict&&!Q.retainExif&&Y.size>ce.size&&Q.mimeType===ce.type&&!(Q.width>M||Q.height>R||Q.minWidth>M||Q.minHeight>R||Q.maxWidth<M||Q.maxHeight<R))Y=ce;else{var te=new Date;Y.lastModified=te.getTime(),Y.lastModifiedDate=te,Y.name=ce.name,Y.name&&Y.type!==ce.type&&(Y.name=Y.name.replace(ai,me(Y.type)))}else Y=ce;this.result=Y,Q.success&&Q.success.call(this,Y)}},{key:"fail",value:function(T){var M=this.options;if(M.error)M.error.call(this,T);else throw T}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=xe,A}},{key:"setDefaults",value:function(T){a(v,T)}}]),A}();return ee})});var Dv=q((Ou,Fu)=>{((i,t)=>{typeof define=="function"&&define.amd?define([],t):typeof Fu=="object"&&typeof Ou<"u"?Fu.exports=t():i.Papa=t()})(Ou,function i(){var t=typeof self<"u"?self:typeof window<"u"?window:t!==void 0?t:{},e,n=!t.document&&!!t.postMessage,r=t.IS_PAPA_WORKER||!1,o={},a=0,s={};function l(y){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(x){var D=he(x);D.chunkSize=parseInt(D.chunkSize),x.step||x.chunk||(D.chunkSize=null),this._handle=new g(D),(this._handle.streamer=this)._config=D}.call(this,y),this.parseChunk=function(x,D){var z=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<z){let ie=this._config.newline;ie||(V=this._config.quoteChar||'"',ie=this._handle.guessLineEndings(x,V)),x=[...x.split(ie).slice(z)].join(ie)}this.isFirstChunk&&se(this._config.beforeFirstChunk)&&(V=this._config.beforeFirstChunk(x))!==void 0&&(x=V),this.isFirstChunk=!1,this._halted=!1;var z=this._partialLine+x,V=(this._partialLine="",this._handle.parse(z,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(x=V.meta.cursor,z=(this._finished||(this._partialLine=z.substring(x-this._baseIndex),this._baseIndex=x),V&&V.data&&(this._rowCount+=V.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)t.postMessage({results:V,workerId:s.WORKER_ID,finished:z});else if(se(this._config.chunk)&&!D){if(this._config.chunk(V,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=V=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(V.data),this._completeResults.errors=this._completeResults.errors.concat(V.errors),this._completeResults.meta=V.meta),this._completed||!z||!se(this._config.complete)||V&&V.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),z||V&&V.meta.paused||this._nextChunk(),V}this._halted=!0},this._sendError=function(x){se(this._config.error)?this._config.error(x):r&&this._config.error&&t.postMessage({workerId:s.WORKER_ID,error:x,finished:!1})}}function c(y){var x;(y=y||{}).chunkSize||(y.chunkSize=s.RemoteChunkSize),l.call(this,y),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(D){this._input=D,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(x=new XMLHttpRequest,this._config.withCredentials&&(x.withCredentials=this._config.withCredentials),n||(x.onload=me(this._chunkLoaded,this),x.onerror=me(this._chunkError,this)),x.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var D,z=this._config.downloadRequestHeaders;for(D in z)x.setRequestHeader(D,z[D])}var V;this._config.chunkSize&&(V=this._start+this._config.chunkSize-1,x.setRequestHeader("Range","bytes="+this._start+"-"+V));try{x.send(this._config.downloadRequestBody)}catch(ie){this._chunkError(ie.message)}n&&x.status===0&&this._chunkError()}},this._chunkLoaded=function(){x.readyState===4&&(x.status<200||400<=x.status?this._chunkError():(this._start+=this._config.chunkSize||x.responseText.length,this._finished=!this._config.chunkSize||this._start>=(D=>(D=D.getResponseHeader("Content-Range"))!==null?parseInt(D.substring(D.lastIndexOf("/")+1)):-1)(x),this.parseChunk(x.responseText)))},this._chunkError=function(D){D=x.statusText||D,this._sendError(new Error(D))}}function d(y){(y=y||{}).chunkSize||(y.chunkSize=s.LocalChunkSize),l.call(this,y);var x,D,z=typeof FileReader<"u";this.stream=function(V){this._input=V,D=V.slice||V.webkitSlice||V.mozSlice,z?((x=new FileReader).onload=me(this._chunkLoaded,this),x.onerror=me(this._chunkError,this)):x=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var V=this._input,ie=(this._config.chunkSize&&(ie=Math.min(this._start+this._config.chunkSize,this._input.size),V=D.call(V,this._start,ie)),x.readAsText(V,this._config.encoding));z||this._chunkLoaded({target:{result:ie}})},this._chunkLoaded=function(V){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(V.target.result)},this._chunkError=function(){this._sendError(x.error)}}function p(y){var x;l.call(this,y=y||{}),this.stream=function(D){return x=D,this._nextChunk()},this._nextChunk=function(){var D,z;if(!this._finished)return D=this._config.chunkSize,x=D?(z=x.substring(0,D),x.substring(D)):(z=x,""),this._finished=!x,this.parseChunk(z)}}function v(y){l.call(this,y=y||{});var x=[],D=!0,z=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(V){this._input=V,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){z&&x.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),x.length?this.parseChunk(x.shift()):D=!0},this._streamData=me(function(V){try{x.push(typeof V=="string"?V:V.toString(this._config.encoding)),D&&(D=!1,this._checkIsFinished(),this.parseChunk(x.shift()))}catch(ie){this._streamError(ie)}},this),this._streamError=me(function(V){this._streamCleanUp(),this._sendError(V)},this),this._streamEnd=me(function(){this._streamCleanUp(),z=!0,this._streamData("")},this),this._streamCleanUp=me(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function g(y){var x,D,z,V,ie=Math.pow(2,53),Ie=-ie,it=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Be=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,Oe=this,ne=0,nt=0,le=!1,ai=!1,xe=[],ee={data:[],errors:[],meta:{}};function A(R){return y.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function I(){if(ee&&z&&(M("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),z=!1),y.skipEmptyLines&&(ee.data=ee.data.filter(function(Q){return!A(Q)})),T()){let Q=function(te,de){se(y.transformHeader)&&(te=y.transformHeader(te,de)),xe.push(te)};var Z=Q;if(ee)if(Array.isArray(ee.data[0])){for(var R=0;T()&&R<ee.data.length;R++)ee.data[R].forEach(Q);ee.data.splice(0,1)}else ee.data.forEach(Q)}function Y(Q,te){for(var de=y.header?{}:[],ue=0;ue<Q.length;ue++){var Pe=ue,re=Q[ue],re=((oe,De)=>(ke=>(y.dynamicTypingFunction&&y.dynamicTyping[ke]===void 0&&(y.dynamicTyping[ke]=y.dynamicTypingFunction(ke)),(y.dynamicTyping[ke]||y.dynamicTyping)===!0))(oe)?De==="true"||De==="TRUE"||De!=="false"&&De!=="FALSE"&&((ke=>{if(it.test(ke)&&(ke=parseFloat(ke),Ie<ke&&ke<ie))return 1})(De)?parseFloat(De):Be.test(De)?new Date(De):De===""?null:De):De)(Pe=y.header?ue>=xe.length?"__parsed_extra":xe[ue]:Pe,re=y.transform?y.transform(re,Pe):re);Pe==="__parsed_extra"?(de[Pe]=de[Pe]||[],de[Pe].push(re)):de[Pe]=re}return y.header&&(ue>xe.length?M("FieldMismatch","TooManyFields","Too many fields: expected "+xe.length+" fields but parsed "+ue,nt+te):ue<xe.length&&M("FieldMismatch","TooFewFields","Too few fields: expected "+xe.length+" fields but parsed "+ue,nt+te)),de}var ce;ee&&(y.header||y.dynamicTyping||y.transform)&&(ce=1,!ee.data.length||Array.isArray(ee.data[0])?(ee.data=ee.data.map(Y),ce=ee.data.length):ee.data=Y(ee.data,0),y.header&&ee.meta&&(ee.meta.fields=xe),nt+=ce)}function T(){return y.header&&xe.length===0}function M(R,Y,ce,Z){R={type:R,code:Y,message:ce},Z!==void 0&&(R.row=Z),ee.errors.push(R)}se(y.step)&&(V=y.step,y.step=function(R){ee=R,T()?I():(I(),ee.data.length!==0&&(ne+=R.data.length,y.preview&&ne>y.preview?D.abort():(ee.data=ee.data[0],V(ee,Oe))))}),this.parse=function(R,Y,ce){var Z=y.quoteChar||'"',Z=(y.newline||(y.newline=this.guessLineEndings(R,Z)),z=!1,y.delimiter?se(y.delimiter)&&(y.delimiter=y.delimiter(R),ee.meta.delimiter=y.delimiter):((Z=((Q,te,de,ue,Pe)=>{var re,oe,De,ke;Pe=Pe||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var Zt=0;Zt<Pe.length;Zt++){for(var si,at=Pe[Zt],Jt=0,$e=0,Mt=0,Ot=(De=void 0,new E({comments:ue,delimiter:at,newline:te,preview:10}).parse(Q)),Ke=0;Ke<Ot.data.length;Ke++)de&&A(Ot.data[Ke])?Mt++:(si=Ot.data[Ke].length,$e+=si,De===void 0?De=si:0<si&&(Jt+=Math.abs(si-De),De=si));0<Ot.data.length&&($e/=Ot.data.length-Mt),(oe===void 0||Jt<=oe)&&(ke===void 0||ke<$e)&&1.99<$e&&(oe=Jt,re=at,ke=$e)}return{successful:!!(y.delimiter=re),bestDelimiter:re}})(R,y.newline,y.skipEmptyLines,y.comments,y.delimitersToGuess)).successful?y.delimiter=Z.bestDelimiter:(z=!0,y.delimiter=s.DefaultDelimiter),ee.meta.delimiter=y.delimiter),he(y));return y.preview&&y.header&&Z.preview++,x=R,D=new E(Z),ee=D.parse(x,Y,ce),I(),le?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return le},this.pause=function(){le=!0,D.abort(),x=se(y.chunk)?"":x.substring(D.getCharIndex())},this.resume=function(){Oe.streamer._halted?(le=!1,Oe.streamer.parseChunk(x,!0)):setTimeout(Oe.resume,3)},this.aborted=function(){return ai},this.abort=function(){ai=!0,D.abort(),ee.meta.aborted=!0,se(y.complete)&&y.complete(ee),x=""},this.guessLineEndings=function(Q,Z){Q=Q.substring(0,1048576);var Z=new RegExp(w(Z)+"([^]*?)"+w(Z),"gm"),ce=(Q=Q.replace(Z,"")).split("\r"),Z=Q.split(`
2
2
  `),Q=1<Z.length&&Z[0].length<ce[0].length;if(ce.length===1||Q)return`
3
3
  `;for(var te=0,de=0;de<ce.length;de++)ce[de][0]===`
4
4
  `&&te++;return te>=ce.length/2?`\r
5
5
  `:"\r"}}function w(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(y){var x=(y=y||{}).delimiter,D=y.newline,z=y.comments,V=y.step,ie=y.preview,Ie=y.fastMode,it=null,Be=y.quoteChar==null?'"':y.quoteChar,Oe=Be;if(y.escapeChar!==void 0&&(Oe=y.escapeChar),(typeof x!="string"||-1<s.BAD_DELIMITERS.indexOf(x))&&(x=","),z===x)throw new Error("Comment character same as delimiter");z===!0?z="#":(typeof z!="string"||-1<s.BAD_DELIMITERS.indexOf(z))&&(z=!1),D!==`
6
6
  `&&D!=="\r"&&D!==`\r
7
7
  `&&(D=`
8
- `);var ne=0,nt=!1;this.parse=function(le,ai,xe){if(typeof le!="string")throw new Error("Input must be a string");var ee=le.length,A=x.length,I=D.length,T=z.length,M=se(V),R=[],Y=[],ce=[],Z=ne=0;if(!le)return at();if(Ie||Ie!==!1&&le.indexOf(Be)===-1){for(var Q=le.split(D),te=0;te<Q.length;te++){if(ce=Q[te],ne+=ce.length,te!==Q.length-1)ne+=D.length;else if(xe)return at();if(!z||ce.substring(0,T)!==z){if(M){if(R=[],De(ce.split(x)),Jt(),nt)return at()}else De(ce.split(x));if(ie&&ie<=te)return R=R.slice(0,ie),at(!0)}}return at()}for(var de=le.indexOf(x,ne),ue=le.indexOf(D,ne),Pe=new RegExp(w(Oe)+w(Be),"g"),re=le.indexOf(Be,ne);;)if(le[ne]===Be)for(re=ne,ne++;;){if((re=le.indexOf(Be,re+1))===-1)return xe||Y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:R.length,index:ne}),Zt();if(re===ee-1)return Zt(le.substring(ne,re).replace(Pe,Be));if(Be===Oe&&le[re+1]===Oe)re++;else if(Be===Oe||re===0||le[re-1]!==Oe){de!==-1&&de<re+1&&(de=le.indexOf(x,re+1));var oe=ke((ue=ue!==-1&&ue<re+1?le.indexOf(D,re+1):ue)===-1?de:Math.min(de,ue));if(le.substr(re+1+oe,A)===x){ce.push(le.substring(ne,re).replace(Pe,Be)),le[ne=re+1+oe+A]!==Be&&(re=le.indexOf(Be,ne)),de=le.indexOf(x,ne),ue=le.indexOf(D,ne);break}if(oe=ke(ue),le.substring(re+1+oe,re+1+oe+I)===D){if(ce.push(le.substring(ne,re).replace(Pe,Be)),si(re+1+oe+I),de=le.indexOf(x,ne),re=le.indexOf(Be,ne),M&&(Jt(),nt))return at();if(ie&&R.length>=ie)return at(!0);break}Y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:R.length,index:ne}),re++}}else if(z&&ce.length===0&&le.substring(ne,ne+T)===z){if(ue===-1)return at();ne=ue+I,ue=le.indexOf(D,ne),de=le.indexOf(x,ne)}else if(de!==-1&&(de<ue||ue===-1))ce.push(le.substring(ne,de)),ne=de+A,de=le.indexOf(x,ne);else{if(ue===-1)break;if(ce.push(le.substring(ne,ue)),si(ue+I),M&&(Jt(),nt))return at();if(ie&&R.length>=ie)return at(!0)}return Zt();function De($e){R.push($e),Z=ne}function ke($e){var Mt=0;return Mt=$e!==-1&&($e=le.substring(re+1,$e))&&$e.trim()===""?$e.length:Mt}function Zt($e){return xe||($e===void 0&&($e=le.substring(ne)),ce.push($e),ne=ee,De(ce),M&&Jt()),at()}function si($e){ne=$e,De(ce),ce=[],ue=le.indexOf(D,ne)}function at($e){if(y.header&&!ai&&R.length){var Mt=R[0],Ot={},Ke=new Set(Mt);let yt=!1;for(let nn=0;nn<Mt.length;nn++){let li=Mt[nn];if(Ot[li=se(y.transformHeader)?y.transformHeader(li,nn):li]){let Pn,Po=Ot[li];for(;Pn=li+"_"+Po,Po++,Ke.has(Pn););Ke.add(Pn),Mt[nn]=Pn,Ot[li]++,yt=!0,(it=it===null?{}:it)[Pn]=li}else Ot[li]=1,Mt[nn]=li;Ke.add(li)}yt&&console.warn("Duplicate headers found and renamed.")}return{data:R,errors:Y,meta:{delimiter:x,linebreak:D,aborted:nt,truncated:!!$e,cursor:Z+(ai||0),renamedHeaders:it}}}function Jt(){V(at()),R=[],Y=[]}},this.abort=function(){nt=!0},this.getCharIndex=function(){return ne}}function L(y){var x=y.data,D=o[x.workerId],z=!1;if(x.error)D.userError(x.error,x.file);else if(x.results&&x.results.data){var V={abort:function(){z=!0,F(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:G,resume:G};if(se(D.userStep)){for(var ie=0;ie<x.results.data.length&&(D.userStep({data:x.results.data[ie],errors:x.results.errors,meta:x.results.meta},V),!z);ie++);delete x.results}else se(D.userChunk)&&(D.userChunk(x.results,V,x.file),delete x.results)}x.finished&&!z&&F(x.workerId,x.results)}function F(y,x){var D=o[y];se(D.userComplete)&&D.userComplete(x),D.terminate(),delete o[y]}function G(){throw new Error("Not implemented.")}function he(y){if(typeof y!="object"||y===null)return y;var x,D=Array.isArray(y)?[]:{};for(x in y)D[x]=he(y[x]);return D}function me(y,x){return function(){y.apply(x,arguments)}}function se(y){return typeof y=="function"}return s.parse=function(y,x){var D=(x=x||{}).dynamicTyping||!1;if(se(D)&&(x.dynamicTypingFunction=D,D={}),x.dynamicTyping=D,x.transform=!!se(x.transform)&&x.transform,!x.worker||!s.WORKERS_SUPPORTED)return D=null,s.NODE_STREAM_INPUT,typeof y=="string"?(y=(z=>z.charCodeAt(0)!==65279?z:z.slice(1))(y),D=new(x.download?c:p)(x)):y.readable===!0&&se(y.read)&&se(y.on)?D=new v(x):(t.File&&y instanceof File||y instanceof Object)&&(D=new d(x)),D.stream(y);(D=(()=>{var z;return!!s.WORKERS_SUPPORTED&&(z=(()=>{var V=t.URL||t.webkitURL||null,ie=i.toString();return s.BLOB_URL||(s.BLOB_URL=V.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",ie,")();"],{type:"text/javascript"})))})(),(z=new t.Worker(z)).onmessage=L,z.id=a++,o[z.id]=z)})()).userStep=x.step,D.userChunk=x.chunk,D.userComplete=x.complete,D.userError=x.error,x.step=se(x.step),x.chunk=se(x.chunk),x.complete=se(x.complete),x.error=se(x.error),delete x.worker,D.postMessage({input:y,config:x,workerId:D.id})},s.unparse=function(y,x){var D=!1,z=!0,V=",",ie=`\r
8
+ `);var ne=0,nt=!1;this.parse=function(le,ai,xe){if(typeof le!="string")throw new Error("Input must be a string");var ee=le.length,A=x.length,I=D.length,T=z.length,M=se(V),R=[],Y=[],ce=[],Z=ne=0;if(!le)return at();if(Ie||Ie!==!1&&le.indexOf(Be)===-1){for(var Q=le.split(D),te=0;te<Q.length;te++){if(ce=Q[te],ne+=ce.length,te!==Q.length-1)ne+=D.length;else if(xe)return at();if(!z||ce.substring(0,T)!==z){if(M){if(R=[],De(ce.split(x)),Jt(),nt)return at()}else De(ce.split(x));if(ie&&ie<=te)return R=R.slice(0,ie),at(!0)}}return at()}for(var de=le.indexOf(x,ne),ue=le.indexOf(D,ne),Pe=new RegExp(w(Oe)+w(Be),"g"),re=le.indexOf(Be,ne);;)if(le[ne]===Be)for(re=ne,ne++;;){if((re=le.indexOf(Be,re+1))===-1)return xe||Y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:R.length,index:ne}),Zt();if(re===ee-1)return Zt(le.substring(ne,re).replace(Pe,Be));if(Be===Oe&&le[re+1]===Oe)re++;else if(Be===Oe||re===0||le[re-1]!==Oe){de!==-1&&de<re+1&&(de=le.indexOf(x,re+1));var oe=ke((ue=ue!==-1&&ue<re+1?le.indexOf(D,re+1):ue)===-1?de:Math.min(de,ue));if(le.substr(re+1+oe,A)===x){ce.push(le.substring(ne,re).replace(Pe,Be)),le[ne=re+1+oe+A]!==Be&&(re=le.indexOf(Be,ne)),de=le.indexOf(x,ne),ue=le.indexOf(D,ne);break}if(oe=ke(ue),le.substring(re+1+oe,re+1+oe+I)===D){if(ce.push(le.substring(ne,re).replace(Pe,Be)),si(re+1+oe+I),de=le.indexOf(x,ne),re=le.indexOf(Be,ne),M&&(Jt(),nt))return at();if(ie&&R.length>=ie)return at(!0);break}Y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:R.length,index:ne}),re++}}else if(z&&ce.length===0&&le.substring(ne,ne+T)===z){if(ue===-1)return at();ne=ue+I,ue=le.indexOf(D,ne),de=le.indexOf(x,ne)}else if(de!==-1&&(de<ue||ue===-1))ce.push(le.substring(ne,de)),ne=de+A,de=le.indexOf(x,ne);else{if(ue===-1)break;if(ce.push(le.substring(ne,ue)),si(ue+I),M&&(Jt(),nt))return at();if(ie&&R.length>=ie)return at(!0)}return Zt();function De($e){R.push($e),Z=ne}function ke($e){var Mt=0;return Mt=$e!==-1&&($e=le.substring(re+1,$e))&&$e.trim()===""?$e.length:Mt}function Zt($e){return xe||($e===void 0&&($e=le.substring(ne)),ce.push($e),ne=ee,De(ce),M&&Jt()),at()}function si($e){ne=$e,De(ce),ce=[],ue=le.indexOf(D,ne)}function at($e){if(y.header&&!ai&&R.length){var Mt=R[0],Ot={},Ke=new Set(Mt);let yt=!1;for(let nn=0;nn<Mt.length;nn++){let li=Mt[nn];if(Ot[li=se(y.transformHeader)?y.transformHeader(li,nn):li]){let Pn,Eo=Ot[li];for(;Pn=li+"_"+Eo,Eo++,Ke.has(Pn););Ke.add(Pn),Mt[nn]=Pn,Ot[li]++,yt=!0,(it=it===null?{}:it)[Pn]=li}else Ot[li]=1,Mt[nn]=li;Ke.add(li)}yt&&console.warn("Duplicate headers found and renamed.")}return{data:R,errors:Y,meta:{delimiter:x,linebreak:D,aborted:nt,truncated:!!$e,cursor:Z+(ai||0),renamedHeaders:it}}}function Jt(){V(at()),R=[],Y=[]}},this.abort=function(){nt=!0},this.getCharIndex=function(){return ne}}function L(y){var x=y.data,D=o[x.workerId],z=!1;if(x.error)D.userError(x.error,x.file);else if(x.results&&x.results.data){var V={abort:function(){z=!0,F(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:G,resume:G};if(se(D.userStep)){for(var ie=0;ie<x.results.data.length&&(D.userStep({data:x.results.data[ie],errors:x.results.errors,meta:x.results.meta},V),!z);ie++);delete x.results}else se(D.userChunk)&&(D.userChunk(x.results,V,x.file),delete x.results)}x.finished&&!z&&F(x.workerId,x.results)}function F(y,x){var D=o[y];se(D.userComplete)&&D.userComplete(x),D.terminate(),delete o[y]}function G(){throw new Error("Not implemented.")}function he(y){if(typeof y!="object"||y===null)return y;var x,D=Array.isArray(y)?[]:{};for(x in y)D[x]=he(y[x]);return D}function me(y,x){return function(){y.apply(x,arguments)}}function se(y){return typeof y=="function"}return s.parse=function(y,x){var D=(x=x||{}).dynamicTyping||!1;if(se(D)&&(x.dynamicTypingFunction=D,D={}),x.dynamicTyping=D,x.transform=!!se(x.transform)&&x.transform,!x.worker||!s.WORKERS_SUPPORTED)return D=null,s.NODE_STREAM_INPUT,typeof y=="string"?(y=(z=>z.charCodeAt(0)!==65279?z:z.slice(1))(y),D=new(x.download?c:p)(x)):y.readable===!0&&se(y.read)&&se(y.on)?D=new v(x):(t.File&&y instanceof File||y instanceof Object)&&(D=new d(x)),D.stream(y);(D=(()=>{var z;return!!s.WORKERS_SUPPORTED&&(z=(()=>{var V=t.URL||t.webkitURL||null,ie=i.toString();return s.BLOB_URL||(s.BLOB_URL=V.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",ie,")();"],{type:"text/javascript"})))})(),(z=new t.Worker(z)).onmessage=L,z.id=a++,o[z.id]=z)})()).userStep=x.step,D.userChunk=x.chunk,D.userComplete=x.complete,D.userError=x.error,x.step=se(x.step),x.chunk=se(x.chunk),x.complete=se(x.complete),x.error=se(x.error),delete x.worker,D.postMessage({input:y,config:x,workerId:D.id})},s.unparse=function(y,x){var D=!1,z=!0,V=",",ie=`\r
9
9
  `,Ie='"',it=Ie+Ie,Be=!1,Oe=null,ne=!1,nt=((()=>{if(typeof x=="object"){if(typeof x.delimiter!="string"||s.BAD_DELIMITERS.filter(function(xe){return x.delimiter.indexOf(xe)!==-1}).length||(V=x.delimiter),typeof x.quotes!="boolean"&&typeof x.quotes!="function"&&!Array.isArray(x.quotes)||(D=x.quotes),typeof x.skipEmptyLines!="boolean"&&typeof x.skipEmptyLines!="string"||(Be=x.skipEmptyLines),typeof x.newline=="string"&&(ie=x.newline),typeof x.quoteChar=="string"&&(Ie=x.quoteChar),typeof x.header=="boolean"&&(z=x.header),Array.isArray(x.columns)){if(x.columns.length===0)throw new Error("Option columns is empty");Oe=x.columns}x.escapeChar!==void 0&&(it=x.escapeChar+Ie),x.escapeFormulae instanceof RegExp?ne=x.escapeFormulae:typeof x.escapeFormulae=="boolean"&&x.escapeFormulae&&(ne=/^[=+\-@\t\r].*$/)}})(),new RegExp(w(Ie),"g"));if(typeof y=="string"&&(y=JSON.parse(y)),Array.isArray(y)){if(!y.length||Array.isArray(y[0]))return le(null,y,Be);if(typeof y[0]=="object")return le(Oe||Object.keys(y[0]),y,Be)}else if(typeof y=="object")return typeof y.data=="string"&&(y.data=JSON.parse(y.data)),Array.isArray(y.data)&&(y.fields||(y.fields=y.meta&&y.meta.fields||Oe),y.fields||(y.fields=Array.isArray(y.data[0])?y.fields:typeof y.data[0]=="object"?Object.keys(y.data[0]):[]),Array.isArray(y.data[0])||typeof y.data[0]=="object"||(y.data=[y.data])),le(y.fields||[],y.data||[],Be);throw new Error("Unable to serialize unrecognized input");function le(xe,ee,A){var I="",T=(typeof xe=="string"&&(xe=JSON.parse(xe)),typeof ee=="string"&&(ee=JSON.parse(ee)),Array.isArray(xe)&&0<xe.length),M=!Array.isArray(ee[0]);if(T&&z){for(var R=0;R<xe.length;R++)0<R&&(I+=V),I+=ai(xe[R],R);0<ee.length&&(I+=ie)}for(var Y=0;Y<ee.length;Y++){var ce=(T?xe:ee[Y]).length,Z=!1,Q=T?Object.keys(ee[Y]).length===0:ee[Y].length===0;if(A&&!T&&(Z=A==="greedy"?ee[Y].join("").trim()==="":ee[Y].length===1&&ee[Y][0].length===0),A==="greedy"&&T){for(var te=[],de=0;de<ce;de++){var ue=M?xe[de]:de;te.push(ee[Y][ue])}Z=te.join("").trim()===""}if(!Z){for(var Pe=0;Pe<ce;Pe++){0<Pe&&!Q&&(I+=V);var re=T&&M?xe[Pe]:Pe;I+=ai(ee[Y][re],Pe)}Y<ee.length-1&&(!A||0<ce&&!Q)&&(I+=ie)}}return I}function ai(xe,ee){var A,I;return xe==null?"":xe.constructor===Date?JSON.stringify(xe).slice(1,25):(I=!1,ne&&typeof xe=="string"&&ne.test(xe)&&(xe="'"+xe,I=!0),A=xe.toString().replace(nt,it),(I=I||D===!0||typeof D=="function"&&D(xe,ee)||Array.isArray(D)&&D[ee]||((T,M)=>{for(var R=0;R<M.length;R++)if(-1<T.indexOf(M[R]))return!0;return!1})(A,s.BAD_DELIMITERS)||-1<A.indexOf(V)||A.charAt(0)===" "||A.charAt(A.length-1)===" ")?Ie+A+Ie:A)}},s.RECORD_SEP="",s.UNIT_SEP="",s.BYTE_ORDER_MARK="\uFEFF",s.BAD_DELIMITERS=["\r",`
10
- `,'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!n&&!!t.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=E,s.ParserHandle=g,s.NetworkStreamer=c,s.FileStreamer=d,s.StringStreamer=p,s.ReadableStreamStreamer=v,t.jQuery&&((e=t.jQuery).fn.parse=function(y){var x=y.config||{},D=[];return this.each(function(ie){if(!(e(this).prop("tagName").toUpperCase()==="INPUT"&&e(this).attr("type").toLowerCase()==="file"&&t.FileReader)||!this.files||this.files.length===0)return!0;for(var Ie=0;Ie<this.files.length;Ie++)D.push({file:this.files[Ie],inputElem:this,instanceConfig:e.extend({},x)})}),z(),this;function z(){if(D.length===0)se(y.complete)&&y.complete();else{var ie,Ie,it,Be,Oe=D[0];if(se(y.before)){var ne=y.before(Oe.file,Oe.inputElem);if(typeof ne=="object"){if(ne.action==="abort")return ie="AbortError",Ie=Oe.file,it=Oe.inputElem,Be=ne.reason,void(se(y.error)&&y.error({name:ie},Ie,it,Be));if(ne.action==="skip")return void V();typeof ne.config=="object"&&(Oe.instanceConfig=e.extend(Oe.instanceConfig,ne.config))}else if(ne==="skip")return void V()}var nt=Oe.instanceConfig.complete;Oe.instanceConfig.complete=function(le){se(nt)&&nt(le,Oe.file,Oe.inputElem),V()},s.parse(Oe.file,Oe.instanceConfig)}}function V(){D.splice(0,1),z()}}),r&&(t.onmessage=function(y){y=y.data,s.WORKER_ID===void 0&&y&&(s.WORKER_ID=y.workerId),typeof y.input=="string"?t.postMessage({workerId:s.WORKER_ID,results:s.parse(y.input,y.config),finished:!0}):(t.File&&y.input instanceof File||y.input instanceof Object)&&(y=s.parse(y.input,y.config))&&t.postMessage({workerId:s.WORKER_ID,results:y,finished:!0})}),(c.prototype=Object.create(l.prototype)).constructor=c,(d.prototype=Object.create(l.prototype)).constructor=d,(p.prototype=Object.create(p.prototype)).constructor=p,(v.prototype=Object.create(l.prototype)).constructor=v,s})});var wi=q(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});function fI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var gI=function i(t,e){fI(this,i),this.data=t,this.text=e.text||t,this.options=e};Au.default=gI});var Rv=q(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.CODE39=void 0;var bI=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),vI=wi(),_I=yI(vI);function yI(i){return i&&i.__esModule?i:{default:i}}function wI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function CI(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var SI=function(i){CI(t,i);function t(e,n){return wI(this,t),e=e.toUpperCase(),n.mod43&&(e+=II(DI(e))),xI(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return bI(t,[{key:"encode",value:function(){for(var n=Ru("*"),r=0;r<this.data.length;r++)n+=Ru(this.data[r])+"0";return n+=Ru("*"),{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),t}(_I.default),Fv=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],PI=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function Ru(i){return EI(Av(i))}function EI(i){return PI[i].toString(2)}function II(i){return Fv[i]}function Av(i){return Fv.indexOf(i)}function DI(i){for(var t=0,e=0;e<i.length;e++)t+=Av(i[e]);return t=t%43,t}mc.CODE39=SI});var go=q(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});var Qa;function Bu(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Bv=pt.SET_A=0,Nv=pt.SET_B=1,zv=pt.SET_C=2,JV=pt.SHIFT=98,kI=pt.START_A=103,TI=pt.START_B=104,MI=pt.START_C=105,eU=pt.MODULO=103,tU=pt.STOP=106,iU=pt.FNC1=207,nU=pt.SET_BY_CODE=(Qa={},Bu(Qa,kI,Bv),Bu(Qa,TI,Nv),Bu(Qa,MI,zv),Qa),rU=pt.SWAP={101:Bv,100:Nv,99:zv},oU=pt.A_START_CHAR="\xD0",aU=pt.B_START_CHAR="\xD1",sU=pt.C_START_CHAR="\xD2",lU=pt.A_CHARS="[\0-_\xC8-\xCF]",cU=pt.B_CHARS="[ -\x7F\xC8-\xCF]",dU=pt.C_CHARS="(\xCF*[0-9]{2}\xCF*)",pU=pt.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]});var Za=q(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});var OI=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),FI=wi(),AI=RI(FI),xi=go();function RI(i){return i&&i.__esModule?i:{default:i}}function BI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function NI(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function zI(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var LI=function(i){zI(t,i);function t(e,n){BI(this,t);var r=NI(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.substring(1),n));return r.bytes=e.split("").map(function(o){return o.charCodeAt(0)}),r}return OI(t,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,r=n.shift()-105,o=xi.SET_BY_CODE[r];if(o===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(xi.FNC1);var a=t.next(n,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:t.getBar(r)+a.result+t.getBar((a.checksum+r)%xi.MODULO)+t.getBar(xi.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return xi.BARS[n]?xi.BARS[n].toString():""}},{key:"correctIndex",value:function(n,r){if(r===xi.SET_A){var o=n.shift();return o<32?o+64:o-32}else return r===xi.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,r,o){if(!n.length)return{result:"",checksum:0};var a=void 0,s=void 0;if(n[0]>=200){s=n.shift()-105;var l=xi.SWAP[s];l!==void 0?a=t.next(n,r+1,l):((o===xi.SET_A||o===xi.SET_B)&&s===xi.SHIFT&&(n[0]=o===xi.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),a=t.next(n,r+1,o))}else s=t.correctIndex(n,o),a=t.next(n,r+1,o);var c=t.getBar(s),d=s*r;return{result:c+a.result,checksum:d+a.checksum}}}]),t}(AI.default);Nu.default=LI});var Uv=q(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});var zn=go(),Lv=function(t){return t.match(new RegExp("^"+zn.A_CHARS+"*"))[0].length},jv=function(t){return t.match(new RegExp("^"+zn.B_CHARS+"*"))[0].length},Hv=function(t){return t.match(new RegExp("^"+zn.C_CHARS+"*"))[0]};function zu(i,t){var e=t?zn.A_CHARS:zn.B_CHARS,n=i.match(new RegExp("^("+e+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+"\xCC"+Vv(i.substring(n[1].length));var r=i.match(new RegExp("^"+e+"+"))[0];return r.length===i.length?i:r+String.fromCharCode(t?205:206)+zu(i.substring(r.length),!t)}function Vv(i){var t=Hv(i),e=t.length;if(e===i.length)return i;i=i.substring(e);var n=Lv(i)>=jv(i);return t+String.fromCharCode(n?206:205)+zu(i,n)}Lu.default=function(i){var t=void 0,e=Hv(i).length;if(e>=2)t=zn.C_START_CHAR+Vv(i);else{var n=Lv(i)>jv(i);t=(n?zn.A_START_CHAR:zn.B_START_CHAR)+zu(i,n)}return t.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(r,o){return"\xCB"+o})}});var $v=q(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});var jI=Za(),HI=Wv(jI),VI=Uv(),UI=Wv(VI);function Wv(i){return i&&i.__esModule?i:{default:i}}function WI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function ju(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function $I(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var qI=function(i){$I(t,i);function t(e,n){if(WI(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(e))var r=ju(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,UI.default)(e),n));else var r=ju(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return ju(r)}return t}(HI.default);Hu.default=qI});var Gv=q(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});var GI=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),YI=Za(),XI=KI(YI),qv=go();function KI(i){return i&&i.__esModule?i:{default:i}}function QI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function ZI(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function JI(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var e2=function(i){JI(t,i);function t(e,n){return QI(this,t),ZI(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,qv.A_START_CHAR+e,n))}return GI(t,[{key:"valid",value:function(){return new RegExp("^"+qv.A_CHARS+"+$").test(this.data)}}]),t}(XI.default);Vu.default=e2});var Xv=q(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});var t2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),i2=Za(),n2=r2(i2),Yv=go();function r2(i){return i&&i.__esModule?i:{default:i}}function o2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function a2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function s2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var l2=function(i){s2(t,i);function t(e,n){return o2(this,t),a2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Yv.B_START_CHAR+e,n))}return t2(t,[{key:"valid",value:function(){return new RegExp("^"+Yv.B_CHARS+"+$").test(this.data)}}]),t}(n2.default);Uu.default=l2});var Qv=q(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});var c2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),d2=Za(),p2=u2(d2),Kv=go();function u2(i){return i&&i.__esModule?i:{default:i}}function h2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function m2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function f2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var g2=function(i){f2(t,i);function t(e,n){return h2(this,t),m2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Kv.C_START_CHAR+e,n))}return c2(t,[{key:"valid",value:function(){return new RegExp("^"+Kv.C_CHARS+"+$").test(this.data)}}]),t}(p2.default);Wu.default=g2});var Zv=q(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.CODE128C=tn.CODE128B=tn.CODE128A=tn.CODE128=void 0;var b2=$v(),v2=fc(b2),_2=Gv(),y2=fc(_2),w2=Xv(),x2=fc(w2),C2=Qv(),S2=fc(C2);function fc(i){return i&&i.__esModule?i:{default:i}}tn.CODE128=v2.default;tn.CODE128A=y2.default;tn.CODE128B=x2.default;tn.CODE128C=S2.default});var bo=q(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});var yU=Ln.SIDE_BIN="101",wU=Ln.MIDDLE_BIN="01010",xU=Ln.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},CU=Ln.EAN2_STRUCTURE=["LL","LG","GL","GG"],SU=Ln.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],PU=Ln.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]});var vo=q($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});var P2=bo(),E2=function(t,e,n){var r=t.split("").map(function(a,s){return P2.BINARIES[e[s]]}).map(function(a,s){return a?a[t[s]]:""});if(n){var o=t.length-1;r=r.map(function(a,s){return s<o?a+n:a})}return r.join("")};$u.default=E2});var Gu=q(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});var I2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),_o=bo(),D2=vo(),Jv=e_(D2),k2=wi(),T2=e_(k2);function e_(i){return i&&i.__esModule?i:{default:i}}function M2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function O2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function F2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var A2=function(i){F2(t,i);function t(e,n){M2(this,t);var r=O2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.fontSize=!n.flat&&n.fontSize>n.width*10?n.width*10:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return I2(t,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,r){return this.text.substr(n,r)}},{key:"leftEncode",value:function(n,r){return(0,Jv.default)(n,r)}},{key:"rightText",value:function(n,r){return this.text.substr(n,r)}},{key:"rightEncode",value:function(n,r){return(0,Jv.default)(n,r)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},r={height:this.guardHeight};return[{data:_o.SIDE_BIN,options:r},{data:this.leftEncode(),text:this.leftText(),options:n},{data:_o.MIDDLE_BIN,options:r},{data:this.rightEncode(),text:this.rightText(),options:n},{data:_o.SIDE_BIN,options:r}]}},{key:"encodeFlat",value:function(){var n=[_o.SIDE_BIN,this.leftEncode(),_o.MIDDLE_BIN,this.rightEncode(),_o.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),t}(T2.default);qu.default=A2});var i_=q(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});var R2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),Ja=function i(t,e,n){t===null&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(r===void 0){var o=Object.getPrototypeOf(t);return o===null?void 0:i(o,e,n)}else{if("value"in r)return r.value;var a=r.get;return a===void 0?void 0:a.call(n)}},B2=bo(),N2=Gu(),z2=L2(N2);function L2(i){return i&&i.__esModule?i:{default:i}}function j2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function H2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function V2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var t_=function(t){var e=t.substr(0,12).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*3:n+r},0);return(10-e%10)%10},U2=function(i){V2(t,i);function t(e,n){j2(this,t),e.search(/^[0-9]{12}$/)!==-1&&(e+=t_(e));var r=H2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.lastChar=n.lastChar,r}return R2(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===t_(this.data)}},{key:"leftText",value:function(){return Ja(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var n=this.data.substr(1,6),r=B2.EAN13_STRUCTURE[this.data[0]];return Ja(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftEncode",this).call(this,n,r)}},{key:"rightText",value:function(){return Ja(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var n=this.data.substr(7,6);return Ja(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightEncode",this).call(this,n,"RRRRRR")}},{key:"encodeGuarded",value:function(){var n=Ja(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(n.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(n.push({data:"00"}),n.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),n}}]),t}(z2.default);Yu.default=U2});var r_=q(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});var W2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),gc=function i(t,e,n){t===null&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(r===void 0){var o=Object.getPrototypeOf(t);return o===null?void 0:i(o,e,n)}else{if("value"in r)return r.value;var a=r.get;return a===void 0?void 0:a.call(n)}},$2=Gu(),q2=G2($2);function G2(i){return i&&i.__esModule?i:{default:i}}function Y2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function X2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function K2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var n_=function(t){var e=t.substr(0,7).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r:n+r*3},0);return(10-e%10)%10},Q2=function(i){K2(t,i);function t(e,n){return Y2(this,t),e.search(/^[0-9]{7}$/)!==-1&&(e+=n_(e)),X2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return W2(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===n_(this.data)}},{key:"leftText",value:function(){return gc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var n=this.data.substr(0,4);return gc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftEncode",this).call(this,n,"LLLL")}},{key:"rightText",value:function(){return gc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var n=this.data.substr(4,4);return gc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightEncode",this).call(this,n,"RRRR")}}]),t}(q2.default);Xu.default=Q2});var a_=q(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});var Z2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),J2=bo(),eD=vo(),tD=o_(eD),iD=wi(),nD=o_(iD);function o_(i){return i&&i.__esModule?i:{default:i}}function rD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function oD(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function aD(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var sD=function(t){var e=t.split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*9:n+r*3},0);return e%10},lD=function(i){aD(t,i);function t(e,n){return rD(this,t),oD(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return Z2(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var n=J2.EAN5_STRUCTURE[sD(this.data)];return{data:"1011"+(0,tD.default)(this.data,n,"01"),text:this.text}}}]),t}(nD.default);Ku.default=lD});var l_=q(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});var cD=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),dD=bo(),pD=vo(),uD=s_(pD),hD=wi(),mD=s_(hD);function s_(i){return i&&i.__esModule?i:{default:i}}function fD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function gD(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function bD(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var vD=function(i){bD(t,i);function t(e,n){return fD(this,t),gD(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return cD(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var n=dD.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,uD.default)(this.data,n,"01"),text:this.text}}}]),t}(mD.default);Qu.default=vD});var Ju=q(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var _D=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}();bc.checksum=Zu;var yD=vo(),yo=c_(yD),wD=wi(),xD=c_(wD);function c_(i){return i&&i.__esModule?i:{default:i}}function CD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function SD(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function PD(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var ED=function(i){PD(t,i);function t(e,n){CD(this,t),e.search(/^[0-9]{11}$/)!==-1&&(e+=Zu(e));var r=SD(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return _D(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Zu(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,yo.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,yo.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,yo.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,yo.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,yo.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,yo.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),t}(xD.default);function Zu(i){var t=0,e;for(e=1;e<11;e+=2)t+=parseInt(i[e]);for(e=0;e<11;e+=2)t+=parseInt(i[e])*3;return(10-t%10)%10}bc.default=ED});var u_=q(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});var ID=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),DD=vo(),kD=p_(DD),TD=wi(),MD=p_(TD),OD=Ju();function p_(i){return i&&i.__esModule?i:{default:i}}function FD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function eh(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function AD(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var RD=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],BD=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],ND=function(i){AD(t,i);function t(e,n){FD(this,t);var r=eh(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(r.isValid=!1,e.search(/^[0-9]{6}$/)!==-1)r.middleDigits=e,r.upcA=d_(e,"0"),r.text=n.text||""+r.upcA[0]+e+r.upcA[r.upcA.length-1],r.isValid=!0;else if(e.search(/^[01][0-9]{7}$/)!==-1)if(r.middleDigits=e.substring(1,e.length-1),r.upcA=d_(r.middleDigits,e[0]),r.upcA[r.upcA.length-1]===e[e.length-1])r.isValid=!0;else return eh(r);else return eh(r);return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return ID(t,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],r=this.upcA[this.upcA.length-1],o=BD[parseInt(r)][parseInt(n)];return(0,kD.default)(this.middleDigits,o)}}]),t}(MD.default);function d_(i,t){for(var e=parseInt(i[i.length-1]),n=RD[e],r="",o=0,a=0;a<n.length;a++){var s=n[a];s==="X"?r+=i[o++]:r+=s}return r=""+t+r,""+r+(0,OD.checksum)(r)}th.default=ND});var h_=q(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.UPCE=oi.UPC=oi.EAN2=oi.EAN5=oi.EAN8=oi.EAN13=void 0;var zD=i_(),LD=wo(zD),jD=r_(),HD=wo(jD),VD=a_(),UD=wo(VD),WD=l_(),$D=wo(WD),qD=Ju(),GD=wo(qD),YD=u_(),XD=wo(YD);function wo(i){return i&&i.__esModule?i:{default:i}}oi.EAN13=LD.default;oi.EAN8=HD.default;oi.EAN5=UD.default;oi.EAN2=$D.default;oi.UPC=GD.default;oi.UPCE=XD.default});var m_=q(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});var BU=es.START_BIN="1010",NU=es.END_BIN="11101",zU=es.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]});var nh=q(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var KD=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),vc=m_(),QD=wi(),ZD=JD(QD);function JD(i){return i&&i.__esModule?i:{default:i}}function ek(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function tk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function ik(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var nk=function(i){ik(t,i);function t(){return ek(this,t),tk(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return KD(t,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,r=this.data.match(/.{2}/g).map(function(o){return n.encodePair(o)}).join("");return{data:vc.START_BIN+r+vc.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var r=vc.BINARIES[n[1]];return vc.BINARIES[n[0]].split("").map(function(o,a){return(o==="1"?"111":"1")+(r[a]==="1"?"000":"0")}).join("")}}]),t}(ZD.default);ih.default=nk});var g_=q(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});var rk=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),ok=nh(),ak=sk(ok);function sk(i){return i&&i.__esModule?i:{default:i}}function lk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function ck(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function dk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var f_=function(t){var e=t.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,r,o){return n+r*(3-o%2*2)},0);return Math.ceil(e/10)*10-e},pk=function(i){dk(t,i);function t(e,n){return lk(this,t),e.search(/^[0-9]{13}$/)!==-1&&(e+=f_(e)),ck(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return rk(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===f_(this.data)}}]),t}(ak.default);rh.default=pk});var v_=q(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.ITF14=xo.ITF=void 0;var uk=nh(),hk=b_(uk),mk=g_(),fk=b_(mk);function b_(i){return i&&i.__esModule?i:{default:i}}xo.ITF=hk.default;xo.ITF14=fk.default});var Co=q(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var gk=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),bk=wi(),vk=_k(bk);function _k(i){return i&&i.__esModule?i:{default:i}}function yk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function wk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function xk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var Ck=function(i){xk(t,i);function t(e,n){return yk(this,t),wk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return gk(t,[{key:"encode",value:function(){for(var n="110",r=0;r<this.data.length;r++){var o=parseInt(this.data[r]),a=o.toString(2);a=Sk(a,4-a.length);for(var s=0;s<a.length;s++)n+=a[s]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),t}(vk.default);function Sk(i,t){for(var e=0;e<t;e++)i="0"+i;return i}oh.default=Ck});var ts=q(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.mod10=Pk;_c.mod11=Ek;function Pk(i){for(var t=0,e=0;e<i.length;e++){var n=parseInt(i[e]);(e+i.length)%2===0?t+=n:t+=n*2%10+Math.floor(n*2/10)}return(10-t%10)%10}function Ek(i){for(var t=0,e=[2,3,4,5,6,7],n=0;n<i.length;n++){var r=parseInt(i[i.length-1-n]);t+=e[n%e.length]*r}return(11-t%11)%11}});var __=q(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var Ik=Co(),Dk=Tk(Ik),kk=ts();function Tk(i){return i&&i.__esModule?i:{default:i}}function Mk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Ok(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function Fk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var Ak=function(i){Fk(t,i);function t(e,n){return Mk(this,t),Ok(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e+(0,kk.mod10)(e),n))}return t}(Dk.default);ah.default=Ak});var y_=q(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var Rk=Co(),Bk=zk(Rk),Nk=ts();function zk(i){return i&&i.__esModule?i:{default:i}}function Lk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function jk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function Hk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var Vk=function(i){Hk(t,i);function t(e,n){return Lk(this,t),jk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e+(0,Nk.mod11)(e),n))}return t}(Bk.default);sh.default=Vk});var x_=q(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var Uk=Co(),Wk=$k(Uk),w_=ts();function $k(i){return i&&i.__esModule?i:{default:i}}function qk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Gk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function Yk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var Xk=function(i){Yk(t,i);function t(e,n){return qk(this,t),e+=(0,w_.mod10)(e),e+=(0,w_.mod10)(e),Gk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return t}(Wk.default);lh.default=Xk});var S_=q(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var Kk=Co(),Qk=Zk(Kk),C_=ts();function Zk(i){return i&&i.__esModule?i:{default:i}}function Jk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function eT(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function tT(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var iT=function(i){tT(t,i);function t(e,n){return Jk(this,t),e+=(0,C_.mod11)(e),e+=(0,C_.mod10)(e),eT(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return t}(Qk.default);ch.default=iT});var P_=q(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.MSI1110=Oi.MSI1010=Oi.MSI11=Oi.MSI10=Oi.MSI=void 0;var nT=Co(),rT=is(nT),oT=__(),aT=is(oT),sT=y_(),lT=is(sT),cT=x_(),dT=is(cT),pT=S_(),uT=is(pT);function is(i){return i&&i.__esModule?i:{default:i}}Oi.MSI=rT.default;Oi.MSI10=aT.default;Oi.MSI11=lT.default;Oi.MSI1010=dT.default;Oi.MSI1110=uT.default});var E_=q(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.pharmacode=void 0;var hT=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),mT=wi(),fT=gT(mT);function gT(i){return i&&i.__esModule?i:{default:i}}function bT(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function vT(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function _T(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var yT=function(i){_T(t,i);function t(e,n){bT(this,t);var r=vT(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.number=parseInt(e,10),r}return hT(t,[{key:"encode",value:function(){for(var n=this.number,r="";!isNaN(n)&&n!=0;)n%2===0?(r="11100"+r,n=(n-2)/2):(r="100"+r,n=(n-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),t}(fT.default);yc.pharmacode=yT});var I_=q(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.codabar=void 0;var wT=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),xT=wi(),CT=ST(xT);function ST(i){return i&&i.__esModule?i:{default:i}}function PT(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function ET(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function IT(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var DT=function(i){IT(t,i);function t(e,n){PT(this,t),e.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(e="A"+e+"A");var r=ET(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return wT(t,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],r=this.getEncodings(),o=0;o<this.data.length;o++)n.push(r[this.data.charAt(o)]),o!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),t}(CT.default);wc.codabar=DT});var D_=q(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.GenericBarcode=void 0;var kT=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),TT=wi(),MT=OT(TT);function OT(i){return i&&i.__esModule?i:{default:i}}function FT(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function AT(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function RT(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var BT=function(i){RT(t,i);function t(e,n){return FT(this,t),AT(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return kT(t,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),t}(MT.default);xc.GenericBarcode=BT});var T_=q(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var NT=Rv(),Cc=Zv(),So=h_(),k_=v_(),ns=P_(),zT=E_(),LT=I_(),jT=D_();dh.default={CODE39:NT.CODE39,CODE128:Cc.CODE128,CODE128A:Cc.CODE128A,CODE128B:Cc.CODE128B,CODE128C:Cc.CODE128C,EAN13:So.EAN13,EAN8:So.EAN8,EAN5:So.EAN5,EAN2:So.EAN2,UPC:So.UPC,UPCE:So.UPCE,ITF14:k_.ITF14,ITF:k_.ITF,MSI:ns.MSI,MSI10:ns.MSI10,MSI11:ns.MSI11,MSI1010:ns.MSI1010,MSI1110:ns.MSI1110,pharmacode:zT.pharmacode,codabar:LT.codabar,GenericBarcode:jT.GenericBarcode}});var rs=q(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var HT=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i};ph.default=function(i,t){return HT({},i,t)}});var M_=q(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.default=VT;function VT(i){var t=[];function e(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)e(n[r]);else n.text=n.text||"",n.data=n.data||"",t.push(n)}return e(i),t}});var O_=q(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.default=UT;function UT(i){return i.marginTop=i.marginTop||i.margin,i.marginBottom=i.marginBottom||i.margin,i.marginRight=i.marginRight||i.margin,i.marginLeft=i.marginLeft||i.margin,i}});var fh=q(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.default=WT;function WT(i){var t=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var e in t)t.hasOwnProperty(e)&&(e=t[e],typeof i[e]=="string"&&(i[e]=parseInt(i[e],10)));return typeof i.displayValue=="string"&&(i.displayValue=i.displayValue!="false"),i}});var bh=q(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var $T={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};gh.default=$T});var R_=q(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var qT=fh(),GT=A_(qT),YT=bh(),F_=A_(YT);function A_(i){return i&&i.__esModule?i:{default:i}}function XT(i){var t={};for(var e in F_.default)F_.default.hasOwnProperty(e)&&(i.hasAttribute("jsbarcode-"+e.toLowerCase())&&(t[e]=i.getAttribute("jsbarcode-"+e.toLowerCase())),i.hasAttribute("data-"+e.toLowerCase())&&(t[e]=i.getAttribute("data-"+e.toLowerCase())));return t.value=i.getAttribute("jsbarcode-value")||i.getAttribute("data-value"),t=(0,GT.default)(t),t}vh.default=XT});var _h=q(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.getTotalWidthOfEncodings=Fi.calculateEncodingAttributes=Fi.getBarcodePadding=Fi.getEncodingHeight=Fi.getMaximumHeightOfEncodings=void 0;var KT=rs(),QT=ZT(KT);function ZT(i){return i&&i.__esModule?i:{default:i}}function B_(i,t){return t.height+(t.displayValue&&i.text.length>0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function N_(i,t,e){if(e.displayValue&&t<i){if(e.textAlign=="center")return Math.floor((i-t)/2);if(e.textAlign=="left")return 0;if(e.textAlign=="right")return Math.floor(i-t)}return 0}function JT(i,t,e){for(var n=0;n<i.length;n++){var r=i[n],o=(0,QT.default)(t,r.options),a;o.displayValue?a=iM(r.text,o,e):a=0;var s=r.data.length*o.width;r.width=Math.ceil(Math.max(a,s)),r.height=B_(r,o),r.barcodePadding=N_(a,s,o)}}function eM(i){for(var t=0,e=0;e<i.length;e++)t+=i[e].width;return t}function tM(i){for(var t=0,e=0;e<i.length;e++)i[e].height>t&&(t=i[e].height);return t}function iM(i,t,e){var n;if(e)n=e;else if(typeof document<"u")n=document.createElement("canvas").getContext("2d");else return 0;n.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var r=n.measureText(i);if(!r)return 0;var o=r.width;return o}Fi.getMaximumHeightOfEncodings=tM;Fi.getEncodingHeight=B_;Fi.getBarcodePadding=N_;Fi.calculateEncodingAttributes=JT;Fi.getTotalWidthOfEncodings=eM});var z_=q(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});var nM=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),rM=rs(),oM=aM(rM),yh=_h();function aM(i){return i&&i.__esModule?i:{default:i}}function sM(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var lM=function(){function i(t,e,n){sM(this,i),this.canvas=t,this.encodings=e,this.options=n}return nM(i,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var e=0;e<this.encodings.length;e++){var n=(0,oM.default)(this.options,this.encodings[e].options);this.drawCanvasBarcode(n,this.encodings[e]),this.drawCanvasText(n,this.encodings[e]),this.moveCanvasDrawing(this.encodings[e])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var e=this.canvas.getContext("2d");e.save(),(0,yh.calculateEncodingAttributes)(this.encodings,this.options,e);var n=(0,yh.getTotalWidthOfEncodings)(this.encodings),r=(0,yh.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=n+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,e.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(e.fillStyle=this.options.background,e.fillRect(0,0,this.canvas.width,this.canvas.height)),e.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(e,n){var r=this.canvas.getContext("2d"),o=n.data,a;e.textPosition=="top"?a=e.marginTop+e.fontSize+e.textMargin:a=e.marginTop,r.fillStyle=e.lineColor;for(var s=0;s<o.length;s++){var l=s*e.width+n.barcodePadding;o[s]==="1"?r.fillRect(l,a,e.width,e.height):o[s]&&r.fillRect(l,a,e.width,e.height*o[s])}}},{key:"drawCanvasText",value:function(e,n){var r=this.canvas.getContext("2d"),o=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var a,s;e.textPosition=="top"?s=e.marginTop+e.fontSize-e.textMargin:s=e.height+e.textMargin+e.marginTop+e.fontSize,r.font=o,e.textAlign=="left"||n.barcodePadding>0?(a=0,r.textAlign="left"):e.textAlign=="right"?(a=n.width-1,r.textAlign="right"):(a=n.width/2,r.textAlign="center"),r.fillText(n.text,a,s)}}},{key:"moveCanvasDrawing",value:function(e){var n=this.canvas.getContext("2d");n.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),i}();wh.default=lM});var L_=q(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var cM=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),dM=rs(),pM=uM(dM),xh=_h();function uM(i){return i&&i.__esModule?i:{default:i}}function hM(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var Sc="http://www.w3.org/2000/svg",mM=function(){function i(t,e,n){hM(this,i),this.svg=t,this.encodings=e,this.options=n,this.document=n.xmlDocument||document}return cM(i,[{key:"render",value:function(){var e=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var r=this.encodings[n],o=(0,pM.default)(this.options,r.options),a=this.createGroup(e,o.marginTop,this.svg);this.setGroupOptions(a,o),this.drawSvgBarcode(a,o,r),this.drawSVGText(a,o,r),e+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,xh.calculateEncodingAttributes)(this.encodings,this.options);var e=(0,xh.getTotalWidthOfEncodings)(this.encodings),n=(0,xh.getMaximumHeightOfEncodings)(this.encodings),r=e+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,n),this.options.background&&this.drawRect(0,0,r,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(e,n,r){var o=r.data,a;n.textPosition=="top"?a=n.fontSize+n.textMargin:a=0;for(var s=0,l=0,c=0;c<o.length;c++)l=c*n.width+r.barcodePadding,o[c]==="1"?s++:s>0&&(this.drawRect(l-n.width*s,a,n.width*s,n.height,e),s=0);s>0&&this.drawRect(l-n.width*(s-1),a,n.width*s,n.height,e)}},{key:"drawSVGText",value:function(e,n,r){var o=this.document.createElementNS(Sc,"text");if(n.displayValue){var a,s;o.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?s=n.fontSize-n.textMargin:s=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(a=0,o.setAttribute("text-anchor","start")):n.textAlign=="right"?(a=r.width-1,o.setAttribute("text-anchor","end")):(a=r.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",a),o.setAttribute("y",s),o.appendChild(this.document.createTextNode(r.text)),e.appendChild(o)}}},{key:"setSvgAttributes",value:function(e,n){var r=this.svg;r.setAttribute("width",e+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+e+" "+n),r.setAttribute("xmlns",Sc),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(e,n,r){var o=this.document.createElementNS(Sc,"g");return o.setAttribute("transform","translate("+e+", "+n+")"),r.appendChild(o),o}},{key:"setGroupOptions",value:function(e,n){e.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(e,n,r,o,a){var s=this.document.createElementNS(Sc,"rect");return s.setAttribute("x",e),s.setAttribute("y",n),s.setAttribute("width",r),s.setAttribute("height",o),a.appendChild(s),s}}]),i}();Ch.default=mM});var j_=q(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var fM=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}();function gM(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var bM=function(){function i(t,e,n){gM(this,i),this.object=t,this.encodings=e,this.options=n}return fM(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),i}();Sh.default=bM});var H_=q(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var vM=z_(),_M=Ph(vM),yM=L_(),wM=Ph(yM),xM=j_(),CM=Ph(xM);function Ph(i){return i&&i.__esModule?i:{default:i}}Eh.default={CanvasRenderer:_M.default,SVGRenderer:wM.default,ObjectRenderer:CM.default}});var Th=q(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});function Ih(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Dh(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function kh(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var SM=function(i){kh(t,i);function t(e,n){Ih(this,t);var r=Dh(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.name="InvalidInputException",r.symbology=e,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return t}(Error),PM=function(i){kh(t,i);function t(){Ih(this,t);var e=Dh(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="InvalidElementException",e.message="Not supported type to render on",e}return t}(Error),EM=function(i){kh(t,i);function t(){Ih(this,t);var e=Dh(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="NoElementException",e.message="No element to render on.",e}return t}(Error);os.InvalidInputException=SM;os.InvalidElementException=PM;os.NoElementException=EM});var U_=q(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var IM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},DM=R_(),Mh=V_(DM),kM=H_(),as=V_(kM),TM=Th();function V_(i){return i&&i.__esModule?i:{default:i}}function Oh(i){if(typeof i=="string")return MM(i);if(Array.isArray(i)){for(var t=[],e=0;e<i.length;e++)t.push(Oh(i[e]));return t}else{if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLImageElement)return OM(i);if(i&&i.nodeName&&i.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&i instanceof SVGElement)return{element:i,options:(0,Mh.default)(i),renderer:as.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement)return{element:i,options:(0,Mh.default)(i),renderer:as.default.CanvasRenderer};if(i&&i.getContext)return{element:i,renderer:as.default.CanvasRenderer};if(i&&(typeof i>"u"?"undefined":IM(i))==="object"&&!i.nodeName)return{element:i,renderer:as.default.ObjectRenderer};throw new TM.InvalidElementException}}function MM(i){var t=document.querySelectorAll(i);if(t.length!==0){for(var e=[],n=0;n<t.length;n++)e.push(Oh(t[n]));return e}}function OM(i){var t=document.createElement("canvas");return{element:t,options:(0,Mh.default)(i),renderer:as.default.CanvasRenderer,afterRender:function(){i.setAttribute("src",t.toDataURL())}}}Fh.default=Oh});var W_=q(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});var FM=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}();function AM(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var RM=function(){function i(t){AM(this,i),this.api=t}return FM(i,[{key:"handleCatch",value:function(e){if(e.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw e.message;else throw e;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(e){try{var n=e.apply(void 0,arguments);return this.api._options.valid(!0),n}catch(r){return this.handleCatch(r),this.api}}}]),i}();Ah.default=RM});var Nh=q((m9,Q_)=>{"use strict";var BM=T_(),wr=jn(BM),NM=rs(),ss=jn(NM),zM=M_(),q_=jn(zM),LM=O_(),$_=jn(LM),jM=U_(),HM=jn(jM),VM=fh(),UM=jn(VM),WM=W_(),$M=jn(WM),G_=Th(),qM=bh(),Y_=jn(qM);function jn(i){return i&&i.__esModule?i:{default:i}}var Sn=function(){},Pc=function(t,e,n){var r=new Sn;if(typeof t>"u")throw Error("No element to render on was provided.");return r._renderProperties=(0,HM.default)(t),r._encodings=[],r._options=Y_.default,r._errorHandler=new $M.default(r),typeof e<"u"&&(n=n||{},n.format||(n.format=K_()),r.options(n)[n.format](e,n).render()),r};Pc.getModule=function(i){return wr.default[i]};for(Rh in wr.default)wr.default.hasOwnProperty(Rh)&&GM(wr.default,Rh);var Rh;function GM(i,t){Sn.prototype[t]=Sn.prototype[t.toUpperCase()]=Sn.prototype[t.toLowerCase()]=function(e,n){var r=this;return r._errorHandler.wrapBarcodeCall(function(){n.text=typeof n.text>"u"?void 0:""+n.text;var o=(0,ss.default)(r._options,n);o=(0,UM.default)(o);var a=i[t],s=X_(e,a,o);return r._encodings.push(s),r})}}function X_(i,t,e){i=""+i;var n=new t(i,e);if(!n.valid())throw new G_.InvalidInputException(n.constructor.name,i);var r=n.encode();r=(0,q_.default)(r);for(var o=0;o<r.length;o++)r[o].options=(0,ss.default)(e,r[o].options);return r}function K_(){return wr.default.CODE128?"CODE128":Object.keys(wr.default)[0]}Sn.prototype.options=function(i){return this._options=(0,ss.default)(this._options,i),this};Sn.prototype.blank=function(i){var t=new Array(i+1).join("0");return this._encodings.push({data:t}),this};Sn.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var i;for(var t in this._renderProperties){i=this._renderProperties[t];var e=(0,ss.default)(this._options,i.options);e.format=="auto"&&(e.format=K_()),this._errorHandler.wrapBarcodeCall(function(){var n=e.value,r=wr.default[e.format.toUpperCase()],o=X_(n,r,e);Bh(i,o,e)})}}};Sn.prototype.render=function(){if(!this._renderProperties)throw new G_.NoElementException;if(Array.isArray(this._renderProperties))for(var i=0;i<this._renderProperties.length;i++)Bh(this._renderProperties[i],this._encodings,this._options);else Bh(this._renderProperties,this._encodings,this._options);return this};Sn.prototype._defaults=Y_.default;function Bh(i,t,e){t=(0,q_.default)(t);for(var n=0;n<t.length;n++)t[n].options=(0,ss.default)(e,t[n].options),(0,$_.default)(t[n].options);(0,$_.default)(e);var r=i.renderer,o=new r(i.element,t,e);o.render(),i.afterRender&&i.afterRender()}typeof window<"u"&&(window.JsBarcode=Pc);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(i,t){var e=[];return jQuery(this).each(function(){e.push(this)}),Pc(e,i,t)});Q_.exports=Pc});var Lh=q((Ic,zh)=>{(function(t,e){typeof Ic=="object"&&typeof zh=="object"?zh.exports=e():typeof define=="function"&&define.amd?define([],e):typeof Ic=="object"?Ic.printJS=e():t.printJS=e()})(window,function(){return function(i){var t={};function e(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=i,e.c=t,e.d=function(n,r,o){e.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:o})},e.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,r){if(r&1&&(n=e(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var a in n)e.d(o,a,function(s){return n[s]}.bind(null,a));return o},e.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,"a",r),r},e.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},e.p="",e(e.s=0)}({"./src/index.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/sass/index.scss"),r=e.n(n),o=e("./src/js/init.js"),a=o.default.init;typeof window<"u"&&(window.printJS=a),t.default=a},"./src/js/browser.js":function(i,t,e){"use strict";e.r(t);var n={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!n.isIE()&&!!window.StyleMedia},isChrome:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;return!!o.chrome},isSafari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||navigator.userAgent.toLowerCase().indexOf("safari")!==-1},isIOSChrome:function(){return navigator.userAgent.toLowerCase().indexOf("crios")!==-1}};t.default=n},"./src/js/functions.js":function(i,t,e){"use strict";e.r(t),e.d(t,"addWrapper",function(){return a}),e.d(t,"capitalizePrint",function(){return s}),e.d(t,"collectStyles",function(){return l}),e.d(t,"addHeader",function(){return d}),e.d(t,"cleanUp",function(){return p}),e.d(t,"isRawHTML",function(){return v});var n=e("./src/js/modal.js"),r=e("./src/js/browser.js");function o(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(E){return typeof E}:o=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},o(g)}function a(g,w){var E="font-family:"+w.font+" !important; font-size: "+w.font_size+" !important; width:100%;";return'<div style="'+E+'">'+g+"</div>"}function s(g){return g.charAt(0).toUpperCase()+g.slice(1)}function l(g,w){for(var E=document.defaultView||window,L="",F=E.getComputedStyle(g,""),G=0;G<F.length;G++)(w.targetStyles.indexOf("*")!==-1||w.targetStyle.indexOf(F[G])!==-1||c(w.targetStyles,F[G]))&&F.getPropertyValue(F[G])&&(L+=F[G]+":"+F.getPropertyValue(F[G])+";");return L+="max-width: "+w.maxWidth+"px !important; font-size: "+w.font_size+" !important;",L}function c(g,w){for(var E=0;E<g.length;E++)if(o(w)==="object"&&w.indexOf(g[E])!==-1)return!0;return!1}function d(g,w){var E=document.createElement("div");if(v(w.header))E.innerHTML=w.header;else{var L=document.createElement("h1"),F=document.createTextNode(w.header);L.appendChild(F),L.setAttribute("style",w.headerStyle),E.appendChild(L)}g.insertBefore(E,g.childNodes[0])}function p(g){g.showModal&&n.default.close(),g.onLoadingEnd&&g.onLoadingEnd(),(g.showModal||g.onLoadingStart)&&window.URL.revokeObjectURL(g.printable);var w="mouseover";(r.default.isChrome()||r.default.isFirefox())&&(w="focus");var E=function L(){window.removeEventListener(w,L),g.onPrintDialogClose();var F=document.getElementById(g.frameId);F&&F.remove()};window.addEventListener(w,E)}function v(g){var w=new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>");return w.test(g)}},"./src/js/html.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/functions.js"),r=e("./src/js/print.js");function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(d){return typeof d}:o=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(l)}t.default={print:function(c,d){var p=s(c.printable)?c.printable:document.getElementById(c.printable);if(!p){window.console.error("Invalid HTML element id: "+c.printable);return}c.printableElement=a(p,c),c.header&&Object(n.addHeader)(c.printableElement,c),r.default.send(c,d)}};function a(l,c){for(var d=l.cloneNode(),p=Array.prototype.slice.call(l.childNodes),v=0;v<p.length;v++)if(c.ignoreElements.indexOf(p[v].id)===-1){var g=a(p[v],c);d.appendChild(g)}switch(c.scanStyles&&l.nodeType===1&&d.setAttribute("style",Object(n.collectStyles)(l,c)),l.tagName){case"SELECT":d.value=l.value;break;case"CANVAS":d.getContext("2d").drawImage(l,0,0);break}return d}function s(l){return o(l)==="object"&&l&&(l instanceof HTMLElement||l.nodeType===1)}},"./src/js/image.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/functions.js"),r=e("./src/js/print.js"),o=e("./src/js/browser.js");t.default={print:function(s,l){s.printable.constructor!==Array&&(s.printable=[s.printable]),s.printableElement=document.createElement("div"),s.printable.forEach(function(c){var d=document.createElement("img");if(d.setAttribute("style",s.imageStyle),d.src=c,o.default.isFirefox()){var p=d.src;d.src=p}var v=document.createElement("div");v.appendChild(d),s.printableElement.appendChild(v)}),s.header&&Object(n.addHeader)(s.printableElement,s),r.default.send(s,l)}}},"./src/js/init.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/browser.js"),r=e("./src/js/modal.js"),o=e("./src/js/pdf.js"),a=e("./src/js/html.js"),s=e("./src/js/raw-html.js"),l=e("./src/js/image.js"),c=e("./src/js/json.js");function d(v){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(w){return typeof w}:d=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},d(v)}var p=["pdf","html","image","json","raw-html"];t.default={init:function(){var g={printable:null,fallbackPrintable:null,type:"pdf",header:null,headerStyle:"font-weight: 300;",maxWidth:800,properties:null,gridHeaderStyle:"font-weight: bold; padding: 5px; border: 1px solid #dddddd;",gridStyle:"border: 1px solid lightgray; margin-bottom: -1px;",showModal:!1,onError:function(me){throw me},onLoadingStart:null,onLoadingEnd:null,onPrintDialogClose:function(){},onIncompatibleBrowser:function(){},modalMessage:"Retrieving Document...",frameId:"printJS",printableElement:null,documentTitle:"Document",targetStyle:["clear","display","width","min-width","height","min-height","max-height"],targetStyles:["border","box","break","text-decoration"],ignoreElements:[],repeatTableHeader:!0,css:null,style:null,scanStyles:!0,base64:!1,onPdfOpen:null,font:"TimesNewRoman",font_size:"12pt",honorMarginPadding:!0,honorColor:!1,imageStyle:"max-width: 100%;"},w=arguments[0];if(w===void 0)throw new Error("printJS expects at least 1 attribute.");switch(d(w)){case"string":g.printable=encodeURI(w),g.fallbackPrintable=g.printable,g.type=arguments[1]||g.type;break;case"object":g.printable=w.printable,g.fallbackPrintable=typeof w.fallbackPrintable<"u"?w.fallbackPrintable:g.printable,g.fallbackPrintable=g.base64?"data:application/pdf;base64,".concat(g.fallbackPrintable):g.fallbackPrintable;for(var E in g)E==="printable"||E==="fallbackPrintable"||(g[E]=typeof w[E]<"u"?w[E]:g[E]);break;default:throw new Error('Unexpected argument type! Expected "string" or "object", got '+d(w))}if(!g.printable)throw new Error("Missing printable information.");if(!g.type||typeof g.type!="string"||p.indexOf(g.type.toLowerCase())===-1)throw new Error("Invalid print type. Available types are: pdf, html, image and json.");g.showModal&&r.default.show(g),g.onLoadingStart&&g.onLoadingStart();var L=document.getElementById(g.frameId);L&&L.parentNode.removeChild(L);var F=document.createElement("iframe");switch(n.default.isFirefox()?F.setAttribute("style","width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0"):F.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute; border: 0"),F.setAttribute("id",g.frameId),g.type!=="pdf"&&(F.srcdoc="<html><head><title>"+g.documentTitle+"</title>",g.css&&(Array.isArray(g.css)||(g.css=[g.css]),g.css.forEach(function(he){F.srcdoc+='<link rel="stylesheet" href="'+he+'">'})),F.srcdoc+="</head><body></body></html>"),g.type){case"pdf":if(n.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var G=window.open(g.fallbackPrintable,"_blank");G.focus(),g.onIncompatibleBrowser()}catch(he){g.onError(he)}finally{g.showModal&&r.default.close(),g.onLoadingEnd&&g.onLoadingEnd()}else o.default.print(g,F);break;case"image":l.default.print(g,F);break;case"html":a.default.print(g,F);break;case"raw-html":s.default.print(g,F);break;case"json":c.default.print(g,F);break}}}},"./src/js/json.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/functions.js"),r=e("./src/js/print.js");function o(s){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(s)}t.default={print:function(l,c){if(o(l.printable)!=="object")throw new Error("Invalid javascript data object (JSON).");if(typeof l.repeatTableHeader!="boolean")throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!l.properties||!Array.isArray(l.properties))throw new Error("Invalid properties array for your JSON data.");l.properties=l.properties.map(function(d){return{field:o(d)==="object"?d.field:d,displayName:o(d)==="object"?d.displayName:d,columnSize:o(d)==="object"&&d.columnSize?d.columnSize+";":100/l.properties.length+"%;"}}),l.printableElement=document.createElement("div"),l.header&&Object(n.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=a(l),r.default.send(l,c)}};function a(s){var l=s.printable,c=s.properties,d='<table style="border-collapse: collapse; width: 100%;">';s.repeatTableHeader&&(d+="<thead>"),d+="<tr>";for(var p=0;p<c.length;p++)d+='<th style="width:'+c[p].columnSize+";"+s.gridHeaderStyle+'">'+Object(n.capitalizePrint)(c[p].displayName)+"</th>";d+="</tr>",s.repeatTableHeader&&(d+="</thead>"),d+="<tbody>";for(var v=0;v<l.length;v++){d+="<tr>";for(var g=0;g<c.length;g++){var w=l[v],E=c[g].field.split(".");if(E.length>1)for(var L=0;L<E.length;L++)w=w[E[L]];else w=w[c[g].field];d+='<td style="width:'+c[g].columnSize+s.gridStyle+'">'+w+"</td>"}d+="</tr>"}return d+="</tbody></table>",d}},"./src/js/modal.js":function(i,t,e){"use strict";e.r(t);var n={show:function(o){var a="font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;",s=document.createElement("div");s.setAttribute("style",a),s.setAttribute("id","printJS-Modal");var l=document.createElement("div");l.setAttribute("style","display:table-cell; vertical-align:middle; padding-bottom:100px;");var c=document.createElement("div");c.setAttribute("class","printClose"),c.setAttribute("id","printClose"),l.appendChild(c);var d=document.createElement("span");d.setAttribute("class","printSpinner"),l.appendChild(d);var p=document.createTextNode(o.modalMessage);l.appendChild(p),s.appendChild(l),document.getElementsByTagName("body")[0].appendChild(s),document.getElementById("printClose").addEventListener("click",function(){n.close()})},close:function(){var o=document.getElementById("printJS-Modal");o&&o.parentNode.removeChild(o)}};t.default=n},"./src/js/pdf.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/print.js"),r=e("./src/js/functions.js");t.default={print:function(s,l){if(s.base64){var c=Uint8Array.from(atob(s.printable),function(p){return p.charCodeAt(0)});o(s,l,c);return}s.printable=/^(blob|http|\/\/)/i.test(s.printable)?s.printable:window.location.origin+(s.printable.charAt(0)!=="/"?"/"+s.printable:s.printable);var d=new window.XMLHttpRequest;d.responseType="arraybuffer",d.addEventListener("error",function(){Object(r.cleanUp)(s),s.onError(d.statusText,d)}),d.addEventListener("load",function(){if([200,201].indexOf(d.status)===-1){Object(r.cleanUp)(s),s.onError(d.statusText,d);return}o(s,l,d.response)}),d.open("GET",s.printable,!0),d.send()}};function o(a,s,l){var c=new window.Blob([l],{type:"application/pdf"});c=window.URL.createObjectURL(c),s.setAttribute("src",c),n.default.send(a,s)}},"./src/js/print.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/browser.js"),r=e("./src/js/functions.js"),o={send:function(d,p){document.getElementsByTagName("body")[0].appendChild(p);var v=document.getElementById(d.frameId);v.onload=function(){if(d.type==="pdf"){n.default.isFirefox()?setTimeout(function(){return a(v,d)},1e3):a(v,d);return}var g=v.contentWindow||v.contentDocument;if(g.document&&(g=g.document),g.body.appendChild(d.printableElement),d.type!=="pdf"&&d.style){var w=document.createElement("style");w.innerHTML=d.style,g.head.appendChild(w)}var E=g.getElementsByTagName("img");E.length>0?s(Array.from(E)).then(function(){return a(v,d)}):a(v,d)}}};function a(c,d){try{if(c.focus(),n.default.isEdge()||n.default.isIE())try{c.contentWindow.document.execCommand("print",!1,null)}catch{c.contentWindow.print()}else c.contentWindow.print()}catch(p){d.onError(p)}finally{n.default.isFirefox()&&(c.style.visibility="hidden",c.style.left="-1px"),Object(r.cleanUp)(d)}}function s(c){var d=c.map(function(p){if(p.src&&p.src!==window.location.href)return l(p)});return Promise.all(d)}function l(c){return new Promise(function(d){var p=function v(){!c||typeof c.naturalWidth>"u"||c.naturalWidth===0||!c.complete?setTimeout(v,500):d()};p()})}t.default=o},"./src/js/raw-html.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/print.js");t.default={print:function(o,a){o.printableElement=document.createElement("div"),o.printableElement.setAttribute("style","width:100%"),o.printableElement.innerHTML=o.printable,n.default.send(o,a)}}},"./src/sass/index.scss":function(i,t,e){},0:function(i,t,e){i.exports=e("./src/index.js")}}).default})});var km={equal:my};function Tm(i,t=km){let e=Object.keys(i),n=e.reduce((r,o)=>k(_({},r),{[o]:B(i[o],t)}),{});return{select(r,o=km){return Vc(()=>r(n),o)},update(r,o){let a=n[r];typeof o=="function"?a.update(o):a.set(o)},reset(){e.forEach(r=>{n[r].set(i[r])})}}}function my(i,t){return i===t}var Re=(()=>{class i{constructor(){this.INITIAL_STATE={stepper:{state:0,min:0,max:2},shelfLabelConfig:{CurrencySymbolFontSize:12,NormalFontSize:12,PromotionPriceFontSize:12,PromotionDateFontSize:12,PromotionDescFontSize:12,ProductNameFontSize:12,ProductCodeFontSize:12,PrintDateFontSize:12,StoreNameFontSize:12,CompanyNameLabel:"",CurrencySymbol:""},productItems:[],productItemsSelected:{},paperConfig:{},sidebarExpanded:!0,paperConfiguration:{},taxs:[],options:{theme:"light",dir:"ltr",layout:"vertical",sidebartype:"full",sidebarpos:"fixed",headerpos:"fixed",boxed:"full",navbarbg:"skin6",sidebarbg:"skin6",logobg:"skin6",active:1,tabStatus:"justify",isCollapsed:!1,innerWidth:window.innerWidth,defaultSidebar:"full",showSettings:!1,showMobileMenu:!1,expandLogo:!1},stepperRef:void 0,outlet:{},paperSource:""},this.#e=Tm(this.INITIAL_STATE),this.stepper$=this.#e.select(e=>e.stepper()),this.productItems=this.#e.select(e=>e.productItems()),this.paperConfig=this.#e.select(e=>e.paperConfig()),this.sidebarExpanded=this.#e.select(e=>e.sidebarExpanded()),this.paperConfiguration=this.#e.select(e=>e.paperConfiguration()),this.paperShelfLabelConfig=this.#e.select(e=>e.shelfLabelConfig()),this.taxs=this.#e.select(e=>e.taxs()),this.options=this.#e.select(e=>e.options()),this.expandProductItems=this.#e.select(e=>e.productItems().flatMap(n=>new Array(n.Quantity).fill(_(_({},n),n.Print?.[0]||null)))),this.expandProductItem=this.#e.select(e=>{if(e.productItems().length){let[n]=e.productItems();return[_(_({},n),n.Print?.[0]||null)]}return[]}),this.productItemsSelected$=this.#e.select(e=>e.productItemsSelected()),this.stepperRef=this.#e.select(e=>e.stepperRef()),this.outlet$=this.#e.select(e=>{let n=e.paperConfig()?.Outlets,r=e.paperConfiguration()?.OutletID;if(!Array.isArray(n)||!r)return null;let o=n.findIndex(a=>a.ID===r);return o!==-1?n[o]:null}),this.paperSource=this.#e.select(e=>e.paperSource())}#e;onNextStep(){let e=this.stepper$().state+1;this.#e.update("stepper",k(_({},this.stepper$()),{state:e}))}onPrevStep(){let e=this.stepper$().state-1;this.#e.update("stepper",k(_({},this.stepper$()),{state:e}))}onGotoStepper(e){this.#e.update("stepper",k(_({},this.stepper$()),{state:e}))}onChangeProductItems(e){this.#e.update("productItems",e)}onChangePaperConfig(e){this.#e.update("paperConfig",e)}onChangePaperConfiguration(e){this.#e.update("paperConfiguration",e)}onChangeTaxs(e){this.#e.update("taxs",e)}onChangeOptions(e){this.#e.update("options",_(_({},this.options()),e))}onChangeProductItemsSelected(e){this.#e.update("productItemsSelected",e)}onChangeStepperRef(e){this.#e.update("stepperRef",e)}onChangeShelfLabelConfig(e){this.#e.update("shelfLabelConfig",e)}onChangePaperSource(e){this.#e.update("paperSource",e)}onReset(){this.#e.reset()}onToggleSidebarType(){switch(this.options().sidebartype){case"full":case"iconbar":this.onChangeOptions({sidebartype:"mini-sidebar"});break;case"overlay":this.onChangeOptions({showMobileMenu:!this.options().showMobileMenu});break;case"mini-sidebar":this.options().defaultSidebar==="mini-sidebar"?this.onChangeOptions({sidebartype:"full"}):this.onChangeOptions({sidebartype:this.options().defaultSidebar});break;default:}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function Mm(i){let{anchorOffset:t=0,focusOffset:e=0}=i.ownerDocument.getSelection()||{},n=Math.min(t,e),r=Math.max(t,e);return[n,r]}function fy(i,[t,e]){var n,r,o,a;let s=i.ownerDocument,l=s.createRange();l.setStart(i.firstChild||i,Math.min(t,(r=(n=i.textContent)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0)),l.setEnd(i.lastChild||i,Math.min(e,(a=(o=i.textContent)===null||o===void 0?void 0:o.length)!==null&&a!==void 0?a:0));let c=s.getSelection();c&&(c.removeAllRanges(),c.addRange(l))}var Gc=class{constructor(t){this.element=t,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
10
+ `,'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!n&&!!t.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=E,s.ParserHandle=g,s.NetworkStreamer=c,s.FileStreamer=d,s.StringStreamer=p,s.ReadableStreamStreamer=v,t.jQuery&&((e=t.jQuery).fn.parse=function(y){var x=y.config||{},D=[];return this.each(function(ie){if(!(e(this).prop("tagName").toUpperCase()==="INPUT"&&e(this).attr("type").toLowerCase()==="file"&&t.FileReader)||!this.files||this.files.length===0)return!0;for(var Ie=0;Ie<this.files.length;Ie++)D.push({file:this.files[Ie],inputElem:this,instanceConfig:e.extend({},x)})}),z(),this;function z(){if(D.length===0)se(y.complete)&&y.complete();else{var ie,Ie,it,Be,Oe=D[0];if(se(y.before)){var ne=y.before(Oe.file,Oe.inputElem);if(typeof ne=="object"){if(ne.action==="abort")return ie="AbortError",Ie=Oe.file,it=Oe.inputElem,Be=ne.reason,void(se(y.error)&&y.error({name:ie},Ie,it,Be));if(ne.action==="skip")return void V();typeof ne.config=="object"&&(Oe.instanceConfig=e.extend(Oe.instanceConfig,ne.config))}else if(ne==="skip")return void V()}var nt=Oe.instanceConfig.complete;Oe.instanceConfig.complete=function(le){se(nt)&&nt(le,Oe.file,Oe.inputElem),V()},s.parse(Oe.file,Oe.instanceConfig)}}function V(){D.splice(0,1),z()}}),r&&(t.onmessage=function(y){y=y.data,s.WORKER_ID===void 0&&y&&(s.WORKER_ID=y.workerId),typeof y.input=="string"?t.postMessage({workerId:s.WORKER_ID,results:s.parse(y.input,y.config),finished:!0}):(t.File&&y.input instanceof File||y.input instanceof Object)&&(y=s.parse(y.input,y.config))&&t.postMessage({workerId:s.WORKER_ID,results:y,finished:!0})}),(c.prototype=Object.create(l.prototype)).constructor=c,(d.prototype=Object.create(l.prototype)).constructor=d,(p.prototype=Object.create(p.prototype)).constructor=p,(v.prototype=Object.create(l.prototype)).constructor=v,s})});var wi=q(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});function mI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var fI=function i(t,e){mI(this,i),this.data=t,this.text=e.text||t,this.options=e};Au.default=fI});var Rv=q(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.CODE39=void 0;var gI=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),bI=wi(),vI=_I(bI);function _I(i){return i&&i.__esModule?i:{default:i}}function yI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function xI(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var CI=function(i){xI(t,i);function t(e,n){return yI(this,t),e=e.toUpperCase(),n.mod43&&(e+=EI(II(e))),wI(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return gI(t,[{key:"encode",value:function(){for(var n=Ru("*"),r=0;r<this.data.length;r++)n+=Ru(this.data[r])+"0";return n+=Ru("*"),{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),t}(vI.default),Fv=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],SI=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function Ru(i){return PI(Av(i))}function PI(i){return SI[i].toString(2)}function EI(i){return Fv[i]}function Av(i){return Fv.indexOf(i)}function II(i){for(var t=0,e=0;e<i.length;e++)t+=Av(i[e]);return t=t%43,t}mc.CODE39=CI});var bo=q(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});var Za;function Bu(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var Bv=pt.SET_A=0,Nv=pt.SET_B=1,zv=pt.SET_C=2,JV=pt.SHIFT=98,DI=pt.START_A=103,kI=pt.START_B=104,TI=pt.START_C=105,eU=pt.MODULO=103,tU=pt.STOP=106,iU=pt.FNC1=207,nU=pt.SET_BY_CODE=(Za={},Bu(Za,DI,Bv),Bu(Za,kI,Nv),Bu(Za,TI,zv),Za),rU=pt.SWAP={101:Bv,100:Nv,99:zv},oU=pt.A_START_CHAR="\xD0",aU=pt.B_START_CHAR="\xD1",sU=pt.C_START_CHAR="\xD2",lU=pt.A_CHARS="[\0-_\xC8-\xCF]",cU=pt.B_CHARS="[ -\x7F\xC8-\xCF]",dU=pt.C_CHARS="(\xCF*[0-9]{2}\xCF*)",pU=pt.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]});var Ja=q(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});var MI=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),OI=wi(),FI=AI(OI),xi=bo();function AI(i){return i&&i.__esModule?i:{default:i}}function RI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function BI(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function NI(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var zI=function(i){NI(t,i);function t(e,n){RI(this,t);var r=BI(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.substring(1),n));return r.bytes=e.split("").map(function(o){return o.charCodeAt(0)}),r}return MI(t,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,r=n.shift()-105,o=xi.SET_BY_CODE[r];if(o===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(xi.FNC1);var a=t.next(n,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:t.getBar(r)+a.result+t.getBar((a.checksum+r)%xi.MODULO)+t.getBar(xi.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return xi.BARS[n]?xi.BARS[n].toString():""}},{key:"correctIndex",value:function(n,r){if(r===xi.SET_A){var o=n.shift();return o<32?o+64:o-32}else return r===xi.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,r,o){if(!n.length)return{result:"",checksum:0};var a=void 0,s=void 0;if(n[0]>=200){s=n.shift()-105;var l=xi.SWAP[s];l!==void 0?a=t.next(n,r+1,l):((o===xi.SET_A||o===xi.SET_B)&&s===xi.SHIFT&&(n[0]=o===xi.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),a=t.next(n,r+1,o))}else s=t.correctIndex(n,o),a=t.next(n,r+1,o);var c=t.getBar(s),d=s*r;return{result:c+a.result,checksum:d+a.checksum}}}]),t}(FI.default);Nu.default=zI});var Uv=q(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});var Ln=bo(),Lv=function(t){return t.match(new RegExp("^"+Ln.A_CHARS+"*"))[0].length},jv=function(t){return t.match(new RegExp("^"+Ln.B_CHARS+"*"))[0].length},Hv=function(t){return t.match(new RegExp("^"+Ln.C_CHARS+"*"))[0]};function zu(i,t){var e=t?Ln.A_CHARS:Ln.B_CHARS,n=i.match(new RegExp("^("+e+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+"\xCC"+Vv(i.substring(n[1].length));var r=i.match(new RegExp("^"+e+"+"))[0];return r.length===i.length?i:r+String.fromCharCode(t?205:206)+zu(i.substring(r.length),!t)}function Vv(i){var t=Hv(i),e=t.length;if(e===i.length)return i;i=i.substring(e);var n=Lv(i)>=jv(i);return t+String.fromCharCode(n?206:205)+zu(i,n)}Lu.default=function(i){var t=void 0,e=Hv(i).length;if(e>=2)t=Ln.C_START_CHAR+Vv(i);else{var n=Lv(i)>jv(i);t=(n?Ln.A_START_CHAR:Ln.B_START_CHAR)+zu(i,n)}return t.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(r,o){return"\xCB"+o})}});var $v=q(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});var LI=Ja(),jI=Wv(LI),HI=Uv(),VI=Wv(HI);function Wv(i){return i&&i.__esModule?i:{default:i}}function UI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function ju(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function WI(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var $I=function(i){WI(t,i);function t(e,n){if(UI(this,t),/^[\x00-\x7F\xC8-\xD3]+$/.test(e))var r=ju(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,(0,VI.default)(e),n));else var r=ju(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return ju(r)}return t}(jI.default);Hu.default=$I});var Gv=q(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});var qI=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),GI=Ja(),YI=XI(GI),qv=bo();function XI(i){return i&&i.__esModule?i:{default:i}}function KI(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function QI(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function ZI(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var JI=function(i){ZI(t,i);function t(e,n){return KI(this,t),QI(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,qv.A_START_CHAR+e,n))}return qI(t,[{key:"valid",value:function(){return new RegExp("^"+qv.A_CHARS+"+$").test(this.data)}}]),t}(YI.default);Vu.default=JI});var Xv=q(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});var e2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),t2=Ja(),i2=n2(t2),Yv=bo();function n2(i){return i&&i.__esModule?i:{default:i}}function r2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function o2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function a2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var s2=function(i){a2(t,i);function t(e,n){return r2(this,t),o2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Yv.B_START_CHAR+e,n))}return e2(t,[{key:"valid",value:function(){return new RegExp("^"+Yv.B_CHARS+"+$").test(this.data)}}]),t}(i2.default);Uu.default=s2});var Qv=q(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});var l2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),c2=Ja(),d2=p2(c2),Kv=bo();function p2(i){return i&&i.__esModule?i:{default:i}}function u2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function h2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function m2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var f2=function(i){m2(t,i);function t(e,n){return u2(this,t),h2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,Kv.C_START_CHAR+e,n))}return l2(t,[{key:"valid",value:function(){return new RegExp("^"+Kv.C_CHARS+"+$").test(this.data)}}]),t}(d2.default);Wu.default=f2});var Zv=q(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.CODE128C=tn.CODE128B=tn.CODE128A=tn.CODE128=void 0;var g2=$v(),b2=fc(g2),v2=Gv(),_2=fc(v2),y2=Xv(),w2=fc(y2),x2=Qv(),C2=fc(x2);function fc(i){return i&&i.__esModule?i:{default:i}}tn.CODE128=b2.default;tn.CODE128A=_2.default;tn.CODE128B=w2.default;tn.CODE128C=C2.default});var vo=q(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});var yU=jn.SIDE_BIN="101",wU=jn.MIDDLE_BIN="01010",xU=jn.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},CU=jn.EAN2_STRUCTURE=["LL","LG","GL","GG"],SU=jn.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],PU=jn.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]});var _o=q($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});var S2=vo(),P2=function(t,e,n){var r=t.split("").map(function(a,s){return S2.BINARIES[e[s]]}).map(function(a,s){return a?a[t[s]]:""});if(n){var o=t.length-1;r=r.map(function(a,s){return s<o?a+n:a})}return r.join("")};$u.default=P2});var Gu=q(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});var E2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),yo=vo(),I2=_o(),Jv=e_(I2),D2=wi(),k2=e_(D2);function e_(i){return i&&i.__esModule?i:{default:i}}function T2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function M2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function O2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var F2=function(i){O2(t,i);function t(e,n){T2(this,t);var r=M2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.fontSize=!n.flat&&n.fontSize>n.width*10?n.width*10:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return E2(t,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,r){return this.text.substr(n,r)}},{key:"leftEncode",value:function(n,r){return(0,Jv.default)(n,r)}},{key:"rightText",value:function(n,r){return this.text.substr(n,r)}},{key:"rightEncode",value:function(n,r){return(0,Jv.default)(n,r)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},r={height:this.guardHeight};return[{data:yo.SIDE_BIN,options:r},{data:this.leftEncode(),text:this.leftText(),options:n},{data:yo.MIDDLE_BIN,options:r},{data:this.rightEncode(),text:this.rightText(),options:n},{data:yo.SIDE_BIN,options:r}]}},{key:"encodeFlat",value:function(){var n=[yo.SIDE_BIN,this.leftEncode(),yo.MIDDLE_BIN,this.rightEncode(),yo.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),t}(k2.default);qu.default=F2});var i_=q(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});var A2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),es=function i(t,e,n){t===null&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(r===void 0){var o=Object.getPrototypeOf(t);return o===null?void 0:i(o,e,n)}else{if("value"in r)return r.value;var a=r.get;return a===void 0?void 0:a.call(n)}},R2=vo(),B2=Gu(),N2=z2(B2);function z2(i){return i&&i.__esModule?i:{default:i}}function L2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function j2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function H2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var t_=function(t){var e=t.substr(0,12).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*3:n+r},0);return(10-e%10)%10},V2=function(i){H2(t,i);function t(e,n){L2(this,t),e.search(/^[0-9]{12}$/)!==-1&&(e+=t_(e));var r=j2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.lastChar=n.lastChar,r}return A2(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===t_(this.data)}},{key:"leftText",value:function(){return es(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var n=this.data.substr(1,6),r=R2.EAN13_STRUCTURE[this.data[0]];return es(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftEncode",this).call(this,n,r)}},{key:"rightText",value:function(){return es(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var n=this.data.substr(7,6);return es(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightEncode",this).call(this,n,"RRRRRR")}},{key:"encodeGuarded",value:function(){var n=es(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(n.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(n.push({data:"00"}),n.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),n}}]),t}(N2.default);Yu.default=V2});var r_=q(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});var U2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),gc=function i(t,e,n){t===null&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(r===void 0){var o=Object.getPrototypeOf(t);return o===null?void 0:i(o,e,n)}else{if("value"in r)return r.value;var a=r.get;return a===void 0?void 0:a.call(n)}},W2=Gu(),$2=q2(W2);function q2(i){return i&&i.__esModule?i:{default:i}}function G2(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Y2(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function X2(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var n_=function(t){var e=t.substr(0,7).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r:n+r*3},0);return(10-e%10)%10},K2=function(i){X2(t,i);function t(e,n){return G2(this,t),e.search(/^[0-9]{7}$/)!==-1&&(e+=n_(e)),Y2(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return U2(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===n_(this.data)}},{key:"leftText",value:function(){return gc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var n=this.data.substr(0,4);return gc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"leftEncode",this).call(this,n,"LLLL")}},{key:"rightText",value:function(){return gc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var n=this.data.substr(4,4);return gc(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"rightEncode",this).call(this,n,"RRRR")}}]),t}($2.default);Xu.default=K2});var a_=q(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});var Q2=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),Z2=vo(),J2=_o(),eD=o_(J2),tD=wi(),iD=o_(tD);function o_(i){return i&&i.__esModule?i:{default:i}}function nD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function rD(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function oD(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var aD=function(t){var e=t.split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*9:n+r*3},0);return e%10},sD=function(i){oD(t,i);function t(e,n){return nD(this,t),rD(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return Q2(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var n=Z2.EAN5_STRUCTURE[aD(this.data)];return{data:"1011"+(0,eD.default)(this.data,n,"01"),text:this.text}}}]),t}(iD.default);Ku.default=sD});var l_=q(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});var lD=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),cD=vo(),dD=_o(),pD=s_(dD),uD=wi(),hD=s_(uD);function s_(i){return i&&i.__esModule?i:{default:i}}function mD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function fD(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function gD(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var bD=function(i){gD(t,i);function t(e,n){return mD(this,t),fD(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return lD(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var n=cD.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,pD.default)(this.data,n,"01"),text:this.text}}}]),t}(hD.default);Qu.default=bD});var Ju=q(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var vD=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}();bc.checksum=Zu;var _D=_o(),wo=c_(_D),yD=wi(),wD=c_(yD);function c_(i){return i&&i.__esModule?i:{default:i}}function xD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function CD(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function SD(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var PD=function(i){SD(t,i);function t(e,n){xD(this,t),e.search(/^[0-9]{11}$/)!==-1&&(e+=Zu(e));var r=CD(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return vD(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==Zu(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,wo.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,wo.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,wo.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,wo.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,wo.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,wo.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),t}(wD.default);function Zu(i){var t=0,e;for(e=1;e<11;e+=2)t+=parseInt(i[e]);for(e=0;e<11;e+=2)t+=parseInt(i[e])*3;return(10-t%10)%10}bc.default=PD});var u_=q(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});var ED=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),ID=_o(),DD=p_(ID),kD=wi(),TD=p_(kD),MD=Ju();function p_(i){return i&&i.__esModule?i:{default:i}}function OD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function eh(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function FD(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var AD=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],RD=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],BD=function(i){FD(t,i);function t(e,n){OD(this,t);var r=eh(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if(r.isValid=!1,e.search(/^[0-9]{6}$/)!==-1)r.middleDigits=e,r.upcA=d_(e,"0"),r.text=n.text||""+r.upcA[0]+e+r.upcA[r.upcA.length-1],r.isValid=!0;else if(e.search(/^[01][0-9]{7}$/)!==-1)if(r.middleDigits=e.substring(1,e.length-1),r.upcA=d_(r.middleDigits,e[0]),r.upcA[r.upcA.length-1]===e[e.length-1])r.isValid=!0;else return eh(r);else return eh(r);return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return ED(t,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],r=this.upcA[this.upcA.length-1],o=RD[parseInt(r)][parseInt(n)];return(0,DD.default)(this.middleDigits,o)}}]),t}(TD.default);function d_(i,t){for(var e=parseInt(i[i.length-1]),n=AD[e],r="",o=0,a=0;a<n.length;a++){var s=n[a];s==="X"?r+=i[o++]:r+=s}return r=""+t+r,""+r+(0,MD.checksum)(r)}th.default=BD});var h_=q(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.UPCE=oi.UPC=oi.EAN2=oi.EAN5=oi.EAN8=oi.EAN13=void 0;var ND=i_(),zD=xo(ND),LD=r_(),jD=xo(LD),HD=a_(),VD=xo(HD),UD=l_(),WD=xo(UD),$D=Ju(),qD=xo($D),GD=u_(),YD=xo(GD);function xo(i){return i&&i.__esModule?i:{default:i}}oi.EAN13=zD.default;oi.EAN8=jD.default;oi.EAN5=VD.default;oi.EAN2=WD.default;oi.UPC=qD.default;oi.UPCE=YD.default});var m_=q(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});var BU=ts.START_BIN="1010",NU=ts.END_BIN="11101",zU=ts.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]});var nh=q(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});var XD=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),vc=m_(),KD=wi(),QD=ZD(KD);function ZD(i){return i&&i.__esModule?i:{default:i}}function JD(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function ek(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function tk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var ik=function(i){tk(t,i);function t(){return JD(this,t),ek(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return XD(t,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,r=this.data.match(/.{2}/g).map(function(o){return n.encodePair(o)}).join("");return{data:vc.START_BIN+r+vc.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var r=vc.BINARIES[n[1]];return vc.BINARIES[n[0]].split("").map(function(o,a){return(o==="1"?"111":"1")+(r[a]==="1"?"000":"0")}).join("")}}]),t}(QD.default);ih.default=ik});var g_=q(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});var nk=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),rk=nh(),ok=ak(rk);function ak(i){return i&&i.__esModule?i:{default:i}}function sk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function lk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function ck(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var f_=function(t){var e=t.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,r,o){return n+r*(3-o%2*2)},0);return Math.ceil(e/10)*10-e},dk=function(i){ck(t,i);function t(e,n){return sk(this,t),e.search(/^[0-9]{13}$/)!==-1&&(e+=f_(e)),lk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return nk(t,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===f_(this.data)}}]),t}(ok.default);rh.default=dk});var v_=q(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.ITF14=Co.ITF=void 0;var pk=nh(),uk=b_(pk),hk=g_(),mk=b_(hk);function b_(i){return i&&i.__esModule?i:{default:i}}Co.ITF=uk.default;Co.ITF14=mk.default});var So=q(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});var fk=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),gk=wi(),bk=vk(gk);function vk(i){return i&&i.__esModule?i:{default:i}}function _k(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function yk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function wk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var xk=function(i){wk(t,i);function t(e,n){return _k(this,t),yk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return fk(t,[{key:"encode",value:function(){for(var n="110",r=0;r<this.data.length;r++){var o=parseInt(this.data[r]),a=o.toString(2);a=Ck(a,4-a.length);for(var s=0;s<a.length;s++)n+=a[s]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),t}(bk.default);function Ck(i,t){for(var e=0;e<t;e++)i="0"+i;return i}oh.default=xk});var is=q(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.mod10=Sk;_c.mod11=Pk;function Sk(i){for(var t=0,e=0;e<i.length;e++){var n=parseInt(i[e]);(e+i.length)%2===0?t+=n:t+=n*2%10+Math.floor(n*2/10)}return(10-t%10)%10}function Pk(i){for(var t=0,e=[2,3,4,5,6,7],n=0;n<i.length;n++){var r=parseInt(i[i.length-1-n]);t+=e[n%e.length]*r}return(11-t%11)%11}});var __=q(ah=>{"use strict";Object.defineProperty(ah,"__esModule",{value:!0});var Ek=So(),Ik=kk(Ek),Dk=is();function kk(i){return i&&i.__esModule?i:{default:i}}function Tk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Mk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function Ok(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var Fk=function(i){Ok(t,i);function t(e,n){return Tk(this,t),Mk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e+(0,Dk.mod10)(e),n))}return t}(Ik.default);ah.default=Fk});var y_=q(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});var Ak=So(),Rk=Nk(Ak),Bk=is();function Nk(i){return i&&i.__esModule?i:{default:i}}function zk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Lk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function jk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var Hk=function(i){jk(t,i);function t(e,n){return zk(this,t),Lk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e+(0,Bk.mod11)(e),n))}return t}(Rk.default);sh.default=Hk});var x_=q(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});var Vk=So(),Uk=Wk(Vk),w_=is();function Wk(i){return i&&i.__esModule?i:{default:i}}function $k(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function qk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function Gk(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var Yk=function(i){Gk(t,i);function t(e,n){return $k(this,t),e+=(0,w_.mod10)(e),e+=(0,w_.mod10)(e),qk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return t}(Uk.default);lh.default=Yk});var S_=q(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var Xk=So(),Kk=Qk(Xk),C_=is();function Qk(i){return i&&i.__esModule?i:{default:i}}function Zk(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Jk(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function eT(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var tT=function(i){eT(t,i);function t(e,n){return Zk(this,t),e+=(0,C_.mod11)(e),e+=(0,C_.mod10)(e),Jk(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return t}(Kk.default);ch.default=tT});var P_=q(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.MSI1110=Oi.MSI1010=Oi.MSI11=Oi.MSI10=Oi.MSI=void 0;var iT=So(),nT=ns(iT),rT=__(),oT=ns(rT),aT=y_(),sT=ns(aT),lT=x_(),cT=ns(lT),dT=S_(),pT=ns(dT);function ns(i){return i&&i.__esModule?i:{default:i}}Oi.MSI=nT.default;Oi.MSI10=oT.default;Oi.MSI11=sT.default;Oi.MSI1010=cT.default;Oi.MSI1110=pT.default});var E_=q(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.pharmacode=void 0;var uT=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),hT=wi(),mT=fT(hT);function fT(i){return i&&i.__esModule?i:{default:i}}function gT(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function bT(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function vT(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var _T=function(i){vT(t,i);function t(e,n){gT(this,t);var r=bT(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.number=parseInt(e,10),r}return uT(t,[{key:"encode",value:function(){for(var n=this.number,r="";!isNaN(n)&&n!=0;)n%2===0?(r="11100"+r,n=(n-2)/2):(r="100"+r,n=(n-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),t}(mT.default);yc.pharmacode=_T});var I_=q(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.codabar=void 0;var yT=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),wT=wi(),xT=CT(wT);function CT(i){return i&&i.__esModule?i:{default:i}}function ST(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function PT(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function ET(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var IT=function(i){ET(t,i);function t(e,n){ST(this,t),e.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(e="A"+e+"A");var r=PT(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return yT(t,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],r=this.getEncodings(),o=0;o<this.data.length;o++)n.push(r[this.data.charAt(o)]),o!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),t}(xT.default);wc.codabar=IT});var D_=q(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.GenericBarcode=void 0;var DT=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),kT=wi(),TT=MT(kT);function MT(i){return i&&i.__esModule?i:{default:i}}function OT(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function FT(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function AT(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var RT=function(i){AT(t,i);function t(e,n){return OT(this,t),FT(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return DT(t,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),t}(TT.default);xc.GenericBarcode=RT});var T_=q(dh=>{"use strict";Object.defineProperty(dh,"__esModule",{value:!0});var BT=Rv(),Cc=Zv(),Po=h_(),k_=v_(),rs=P_(),NT=E_(),zT=I_(),LT=D_();dh.default={CODE39:BT.CODE39,CODE128:Cc.CODE128,CODE128A:Cc.CODE128A,CODE128B:Cc.CODE128B,CODE128C:Cc.CODE128C,EAN13:Po.EAN13,EAN8:Po.EAN8,EAN5:Po.EAN5,EAN2:Po.EAN2,UPC:Po.UPC,UPCE:Po.UPCE,ITF14:k_.ITF14,ITF:k_.ITF,MSI:rs.MSI,MSI10:rs.MSI10,MSI11:rs.MSI11,MSI1010:rs.MSI1010,MSI1110:rs.MSI1110,pharmacode:NT.pharmacode,codabar:zT.codabar,GenericBarcode:LT.GenericBarcode}});var os=q(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});var jT=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i};ph.default=function(i,t){return jT({},i,t)}});var M_=q(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.default=HT;function HT(i){var t=[];function e(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)e(n[r]);else n.text=n.text||"",n.data=n.data||"",t.push(n)}return e(i),t}});var O_=q(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.default=VT;function VT(i){return i.marginTop=i.marginTop||i.margin,i.marginBottom=i.marginBottom||i.margin,i.marginRight=i.marginRight||i.margin,i.marginLeft=i.marginLeft||i.margin,i}});var fh=q(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.default=UT;function UT(i){var t=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var e in t)t.hasOwnProperty(e)&&(e=t[e],typeof i[e]=="string"&&(i[e]=parseInt(i[e],10)));return typeof i.displayValue=="string"&&(i.displayValue=i.displayValue!="false"),i}});var bh=q(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});var WT={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};gh.default=WT});var R_=q(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});var $T=fh(),qT=A_($T),GT=bh(),F_=A_(GT);function A_(i){return i&&i.__esModule?i:{default:i}}function YT(i){var t={};for(var e in F_.default)F_.default.hasOwnProperty(e)&&(i.hasAttribute("jsbarcode-"+e.toLowerCase())&&(t[e]=i.getAttribute("jsbarcode-"+e.toLowerCase())),i.hasAttribute("data-"+e.toLowerCase())&&(t[e]=i.getAttribute("data-"+e.toLowerCase())));return t.value=i.getAttribute("jsbarcode-value")||i.getAttribute("data-value"),t=(0,qT.default)(t),t}vh.default=YT});var _h=q(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.getTotalWidthOfEncodings=Fi.calculateEncodingAttributes=Fi.getBarcodePadding=Fi.getEncodingHeight=Fi.getMaximumHeightOfEncodings=void 0;var XT=os(),KT=QT(XT);function QT(i){return i&&i.__esModule?i:{default:i}}function B_(i,t){return t.height+(t.displayValue&&i.text.length>0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function N_(i,t,e){if(e.displayValue&&t<i){if(e.textAlign=="center")return Math.floor((i-t)/2);if(e.textAlign=="left")return 0;if(e.textAlign=="right")return Math.floor(i-t)}return 0}function ZT(i,t,e){for(var n=0;n<i.length;n++){var r=i[n],o=(0,KT.default)(t,r.options),a;o.displayValue?a=tM(r.text,o,e):a=0;var s=r.data.length*o.width;r.width=Math.ceil(Math.max(a,s)),r.height=B_(r,o),r.barcodePadding=N_(a,s,o)}}function JT(i){for(var t=0,e=0;e<i.length;e++)t+=i[e].width;return t}function eM(i){for(var t=0,e=0;e<i.length;e++)i[e].height>t&&(t=i[e].height);return t}function tM(i,t,e){var n;if(e)n=e;else if(typeof document<"u")n=document.createElement("canvas").getContext("2d");else return 0;n.font=t.fontOptions+" "+t.fontSize+"px "+t.font;var r=n.measureText(i);if(!r)return 0;var o=r.width;return o}Fi.getMaximumHeightOfEncodings=eM;Fi.getEncodingHeight=B_;Fi.getBarcodePadding=N_;Fi.calculateEncodingAttributes=ZT;Fi.getTotalWidthOfEncodings=JT});var z_=q(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});var iM=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),nM=os(),rM=oM(nM),yh=_h();function oM(i){return i&&i.__esModule?i:{default:i}}function aM(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var sM=function(){function i(t,e,n){aM(this,i),this.canvas=t,this.encodings=e,this.options=n}return iM(i,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var e=0;e<this.encodings.length;e++){var n=(0,rM.default)(this.options,this.encodings[e].options);this.drawCanvasBarcode(n,this.encodings[e]),this.drawCanvasText(n,this.encodings[e]),this.moveCanvasDrawing(this.encodings[e])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var e=this.canvas.getContext("2d");e.save(),(0,yh.calculateEncodingAttributes)(this.encodings,this.options,e);var n=(0,yh.getTotalWidthOfEncodings)(this.encodings),r=(0,yh.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=n+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,e.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(e.fillStyle=this.options.background,e.fillRect(0,0,this.canvas.width,this.canvas.height)),e.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(e,n){var r=this.canvas.getContext("2d"),o=n.data,a;e.textPosition=="top"?a=e.marginTop+e.fontSize+e.textMargin:a=e.marginTop,r.fillStyle=e.lineColor;for(var s=0;s<o.length;s++){var l=s*e.width+n.barcodePadding;o[s]==="1"?r.fillRect(l,a,e.width,e.height):o[s]&&r.fillRect(l,a,e.width,e.height*o[s])}}},{key:"drawCanvasText",value:function(e,n){var r=this.canvas.getContext("2d"),o=e.fontOptions+" "+e.fontSize+"px "+e.font;if(e.displayValue){var a,s;e.textPosition=="top"?s=e.marginTop+e.fontSize-e.textMargin:s=e.height+e.textMargin+e.marginTop+e.fontSize,r.font=o,e.textAlign=="left"||n.barcodePadding>0?(a=0,r.textAlign="left"):e.textAlign=="right"?(a=n.width-1,r.textAlign="right"):(a=n.width/2,r.textAlign="center"),r.fillText(n.text,a,s)}}},{key:"moveCanvasDrawing",value:function(e){var n=this.canvas.getContext("2d");n.translate(e.width,0)}},{key:"restoreCanvas",value:function(){var e=this.canvas.getContext("2d");e.restore()}}]),i}();wh.default=sM});var L_=q(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});var lM=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}(),cM=os(),dM=pM(cM),xh=_h();function pM(i){return i&&i.__esModule?i:{default:i}}function uM(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var Sc="http://www.w3.org/2000/svg",hM=function(){function i(t,e,n){uM(this,i),this.svg=t,this.encodings=e,this.options=n,this.document=n.xmlDocument||document}return lM(i,[{key:"render",value:function(){var e=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var r=this.encodings[n],o=(0,dM.default)(this.options,r.options),a=this.createGroup(e,o.marginTop,this.svg);this.setGroupOptions(a,o),this.drawSvgBarcode(a,o,r),this.drawSVGText(a,o,r),e+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,xh.calculateEncodingAttributes)(this.encodings,this.options);var e=(0,xh.getTotalWidthOfEncodings)(this.encodings),n=(0,xh.getMaximumHeightOfEncodings)(this.encodings),r=e+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,n),this.options.background&&this.drawRect(0,0,r,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(e,n,r){var o=r.data,a;n.textPosition=="top"?a=n.fontSize+n.textMargin:a=0;for(var s=0,l=0,c=0;c<o.length;c++)l=c*n.width+r.barcodePadding,o[c]==="1"?s++:s>0&&(this.drawRect(l-n.width*s,a,n.width*s,n.height,e),s=0);s>0&&this.drawRect(l-n.width*(s-1),a,n.width*s,n.height,e)}},{key:"drawSVGText",value:function(e,n,r){var o=this.document.createElementNS(Sc,"text");if(n.displayValue){var a,s;o.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?s=n.fontSize-n.textMargin:s=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(a=0,o.setAttribute("text-anchor","start")):n.textAlign=="right"?(a=r.width-1,o.setAttribute("text-anchor","end")):(a=r.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",a),o.setAttribute("y",s),o.appendChild(this.document.createTextNode(r.text)),e.appendChild(o)}}},{key:"setSvgAttributes",value:function(e,n){var r=this.svg;r.setAttribute("width",e+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+e+" "+n),r.setAttribute("xmlns",Sc),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(e,n,r){var o=this.document.createElementNS(Sc,"g");return o.setAttribute("transform","translate("+e+", "+n+")"),r.appendChild(o),o}},{key:"setGroupOptions",value:function(e,n){e.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(e,n,r,o,a){var s=this.document.createElementNS(Sc,"rect");return s.setAttribute("x",e),s.setAttribute("y",n),s.setAttribute("width",r),s.setAttribute("height",o),a.appendChild(s),s}}]),i}();Ch.default=hM});var j_=q(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});var mM=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}();function fM(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var gM=function(){function i(t,e,n){fM(this,i),this.object=t,this.encodings=e,this.options=n}return mM(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),i}();Sh.default=gM});var H_=q(Eh=>{"use strict";Object.defineProperty(Eh,"__esModule",{value:!0});var bM=z_(),vM=Ph(bM),_M=L_(),yM=Ph(_M),wM=j_(),xM=Ph(wM);function Ph(i){return i&&i.__esModule?i:{default:i}}Eh.default={CanvasRenderer:vM.default,SVGRenderer:yM.default,ObjectRenderer:xM.default}});var Th=q(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});function Ih(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function Dh(i,t){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:i}function kh(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(i,t):i.__proto__=t)}var CM=function(i){kh(t,i);function t(e,n){Ih(this,t);var r=Dh(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.name="InvalidInputException",r.symbology=e,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return t}(Error),SM=function(i){kh(t,i);function t(){Ih(this,t);var e=Dh(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="InvalidElementException",e.message="Not supported type to render on",e}return t}(Error),PM=function(i){kh(t,i);function t(){Ih(this,t);var e=Dh(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="NoElementException",e.message="No element to render on.",e}return t}(Error);as.InvalidInputException=CM;as.InvalidElementException=SM;as.NoElementException=PM});var U_=q(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});var EM=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},IM=R_(),Mh=V_(IM),DM=H_(),ss=V_(DM),kM=Th();function V_(i){return i&&i.__esModule?i:{default:i}}function Oh(i){if(typeof i=="string")return TM(i);if(Array.isArray(i)){for(var t=[],e=0;e<i.length;e++)t.push(Oh(i[e]));return t}else{if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLImageElement)return MM(i);if(i&&i.nodeName&&i.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&i instanceof SVGElement)return{element:i,options:(0,Mh.default)(i),renderer:ss.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement)return{element:i,options:(0,Mh.default)(i),renderer:ss.default.CanvasRenderer};if(i&&i.getContext)return{element:i,renderer:ss.default.CanvasRenderer};if(i&&(typeof i>"u"?"undefined":EM(i))==="object"&&!i.nodeName)return{element:i,renderer:ss.default.ObjectRenderer};throw new kM.InvalidElementException}}function TM(i){var t=document.querySelectorAll(i);if(t.length!==0){for(var e=[],n=0;n<t.length;n++)e.push(Oh(t[n]));return e}}function MM(i){var t=document.createElement("canvas");return{element:t,options:(0,Mh.default)(i),renderer:ss.default.CanvasRenderer,afterRender:function(){i.setAttribute("src",t.toDataURL())}}}Fh.default=Oh});var W_=q(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});var OM=function(){function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}}();function FM(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}var AM=function(){function i(t){FM(this,i),this.api=t}return OM(i,[{key:"handleCatch",value:function(e){if(e.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw e.message;else throw e;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(e){try{var n=e.apply(void 0,arguments);return this.api._options.valid(!0),n}catch(r){return this.handleCatch(r),this.api}}}]),i}();Ah.default=AM});var Nh=q((m9,Q_)=>{"use strict";var RM=T_(),xr=Hn(RM),BM=os(),ls=Hn(BM),NM=M_(),q_=Hn(NM),zM=O_(),$_=Hn(zM),LM=U_(),jM=Hn(LM),HM=fh(),VM=Hn(HM),UM=W_(),WM=Hn(UM),G_=Th(),$M=bh(),Y_=Hn($M);function Hn(i){return i&&i.__esModule?i:{default:i}}var Sn=function(){},Pc=function(t,e,n){var r=new Sn;if(typeof t>"u")throw Error("No element to render on was provided.");return r._renderProperties=(0,jM.default)(t),r._encodings=[],r._options=Y_.default,r._errorHandler=new WM.default(r),typeof e<"u"&&(n=n||{},n.format||(n.format=K_()),r.options(n)[n.format](e,n).render()),r};Pc.getModule=function(i){return xr.default[i]};for(Rh in xr.default)xr.default.hasOwnProperty(Rh)&&qM(xr.default,Rh);var Rh;function qM(i,t){Sn.prototype[t]=Sn.prototype[t.toUpperCase()]=Sn.prototype[t.toLowerCase()]=function(e,n){var r=this;return r._errorHandler.wrapBarcodeCall(function(){n.text=typeof n.text>"u"?void 0:""+n.text;var o=(0,ls.default)(r._options,n);o=(0,VM.default)(o);var a=i[t],s=X_(e,a,o);return r._encodings.push(s),r})}}function X_(i,t,e){i=""+i;var n=new t(i,e);if(!n.valid())throw new G_.InvalidInputException(n.constructor.name,i);var r=n.encode();r=(0,q_.default)(r);for(var o=0;o<r.length;o++)r[o].options=(0,ls.default)(e,r[o].options);return r}function K_(){return xr.default.CODE128?"CODE128":Object.keys(xr.default)[0]}Sn.prototype.options=function(i){return this._options=(0,ls.default)(this._options,i),this};Sn.prototype.blank=function(i){var t=new Array(i+1).join("0");return this._encodings.push({data:t}),this};Sn.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var i;for(var t in this._renderProperties){i=this._renderProperties[t];var e=(0,ls.default)(this._options,i.options);e.format=="auto"&&(e.format=K_()),this._errorHandler.wrapBarcodeCall(function(){var n=e.value,r=xr.default[e.format.toUpperCase()],o=X_(n,r,e);Bh(i,o,e)})}}};Sn.prototype.render=function(){if(!this._renderProperties)throw new G_.NoElementException;if(Array.isArray(this._renderProperties))for(var i=0;i<this._renderProperties.length;i++)Bh(this._renderProperties[i],this._encodings,this._options);else Bh(this._renderProperties,this._encodings,this._options);return this};Sn.prototype._defaults=Y_.default;function Bh(i,t,e){t=(0,q_.default)(t);for(var n=0;n<t.length;n++)t[n].options=(0,ls.default)(e,t[n].options),(0,$_.default)(t[n].options);(0,$_.default)(e);var r=i.renderer,o=new r(i.element,t,e);o.render(),i.afterRender&&i.afterRender()}typeof window<"u"&&(window.JsBarcode=Pc);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(i,t){var e=[];return jQuery(this).each(function(){e.push(this)}),Pc(e,i,t)});Q_.exports=Pc});var Lh=q((Ic,zh)=>{(function(t,e){typeof Ic=="object"&&typeof zh=="object"?zh.exports=e():typeof define=="function"&&define.amd?define([],e):typeof Ic=="object"?Ic.printJS=e():t.printJS=e()})(window,function(){return function(i){var t={};function e(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=i,e.c=t,e.d=function(n,r,o){e.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:o})},e.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,r){if(r&1&&(n=e(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var a in n)e.d(o,a,function(s){return n[s]}.bind(null,a));return o},e.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,"a",r),r},e.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},e.p="",e(e.s=0)}({"./src/index.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/sass/index.scss"),r=e.n(n),o=e("./src/js/init.js"),a=o.default.init;typeof window<"u"&&(window.printJS=a),t.default=a},"./src/js/browser.js":function(i,t,e){"use strict";e.r(t);var n={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!n.isIE()&&!!window.StyleMedia},isChrome:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;return!!o.chrome},isSafari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||navigator.userAgent.toLowerCase().indexOf("safari")!==-1},isIOSChrome:function(){return navigator.userAgent.toLowerCase().indexOf("crios")!==-1}};t.default=n},"./src/js/functions.js":function(i,t,e){"use strict";e.r(t),e.d(t,"addWrapper",function(){return a}),e.d(t,"capitalizePrint",function(){return s}),e.d(t,"collectStyles",function(){return l}),e.d(t,"addHeader",function(){return d}),e.d(t,"cleanUp",function(){return p}),e.d(t,"isRawHTML",function(){return v});var n=e("./src/js/modal.js"),r=e("./src/js/browser.js");function o(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(E){return typeof E}:o=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},o(g)}function a(g,w){var E="font-family:"+w.font+" !important; font-size: "+w.font_size+" !important; width:100%;";return'<div style="'+E+'">'+g+"</div>"}function s(g){return g.charAt(0).toUpperCase()+g.slice(1)}function l(g,w){for(var E=document.defaultView||window,L="",F=E.getComputedStyle(g,""),G=0;G<F.length;G++)(w.targetStyles.indexOf("*")!==-1||w.targetStyle.indexOf(F[G])!==-1||c(w.targetStyles,F[G]))&&F.getPropertyValue(F[G])&&(L+=F[G]+":"+F.getPropertyValue(F[G])+";");return L+="max-width: "+w.maxWidth+"px !important; font-size: "+w.font_size+" !important;",L}function c(g,w){for(var E=0;E<g.length;E++)if(o(w)==="object"&&w.indexOf(g[E])!==-1)return!0;return!1}function d(g,w){var E=document.createElement("div");if(v(w.header))E.innerHTML=w.header;else{var L=document.createElement("h1"),F=document.createTextNode(w.header);L.appendChild(F),L.setAttribute("style",w.headerStyle),E.appendChild(L)}g.insertBefore(E,g.childNodes[0])}function p(g){g.showModal&&n.default.close(),g.onLoadingEnd&&g.onLoadingEnd(),(g.showModal||g.onLoadingStart)&&window.URL.revokeObjectURL(g.printable);var w="mouseover";(r.default.isChrome()||r.default.isFirefox())&&(w="focus");var E=function L(){window.removeEventListener(w,L),g.onPrintDialogClose();var F=document.getElementById(g.frameId);F&&F.remove()};window.addEventListener(w,E)}function v(g){var w=new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>");return w.test(g)}},"./src/js/html.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/functions.js"),r=e("./src/js/print.js");function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(d){return typeof d}:o=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(l)}t.default={print:function(c,d){var p=s(c.printable)?c.printable:document.getElementById(c.printable);if(!p){window.console.error("Invalid HTML element id: "+c.printable);return}c.printableElement=a(p,c),c.header&&Object(n.addHeader)(c.printableElement,c),r.default.send(c,d)}};function a(l,c){for(var d=l.cloneNode(),p=Array.prototype.slice.call(l.childNodes),v=0;v<p.length;v++)if(c.ignoreElements.indexOf(p[v].id)===-1){var g=a(p[v],c);d.appendChild(g)}switch(c.scanStyles&&l.nodeType===1&&d.setAttribute("style",Object(n.collectStyles)(l,c)),l.tagName){case"SELECT":d.value=l.value;break;case"CANVAS":d.getContext("2d").drawImage(l,0,0);break}return d}function s(l){return o(l)==="object"&&l&&(l instanceof HTMLElement||l.nodeType===1)}},"./src/js/image.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/functions.js"),r=e("./src/js/print.js"),o=e("./src/js/browser.js");t.default={print:function(s,l){s.printable.constructor!==Array&&(s.printable=[s.printable]),s.printableElement=document.createElement("div"),s.printable.forEach(function(c){var d=document.createElement("img");if(d.setAttribute("style",s.imageStyle),d.src=c,o.default.isFirefox()){var p=d.src;d.src=p}var v=document.createElement("div");v.appendChild(d),s.printableElement.appendChild(v)}),s.header&&Object(n.addHeader)(s.printableElement,s),r.default.send(s,l)}}},"./src/js/init.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/browser.js"),r=e("./src/js/modal.js"),o=e("./src/js/pdf.js"),a=e("./src/js/html.js"),s=e("./src/js/raw-html.js"),l=e("./src/js/image.js"),c=e("./src/js/json.js");function d(v){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(w){return typeof w}:d=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},d(v)}var p=["pdf","html","image","json","raw-html"];t.default={init:function(){var g={printable:null,fallbackPrintable:null,type:"pdf",header:null,headerStyle:"font-weight: 300;",maxWidth:800,properties:null,gridHeaderStyle:"font-weight: bold; padding: 5px; border: 1px solid #dddddd;",gridStyle:"border: 1px solid lightgray; margin-bottom: -1px;",showModal:!1,onError:function(me){throw me},onLoadingStart:null,onLoadingEnd:null,onPrintDialogClose:function(){},onIncompatibleBrowser:function(){},modalMessage:"Retrieving Document...",frameId:"printJS",printableElement:null,documentTitle:"Document",targetStyle:["clear","display","width","min-width","height","min-height","max-height"],targetStyles:["border","box","break","text-decoration"],ignoreElements:[],repeatTableHeader:!0,css:null,style:null,scanStyles:!0,base64:!1,onPdfOpen:null,font:"TimesNewRoman",font_size:"12pt",honorMarginPadding:!0,honorColor:!1,imageStyle:"max-width: 100%;"},w=arguments[0];if(w===void 0)throw new Error("printJS expects at least 1 attribute.");switch(d(w)){case"string":g.printable=encodeURI(w),g.fallbackPrintable=g.printable,g.type=arguments[1]||g.type;break;case"object":g.printable=w.printable,g.fallbackPrintable=typeof w.fallbackPrintable<"u"?w.fallbackPrintable:g.printable,g.fallbackPrintable=g.base64?"data:application/pdf;base64,".concat(g.fallbackPrintable):g.fallbackPrintable;for(var E in g)E==="printable"||E==="fallbackPrintable"||(g[E]=typeof w[E]<"u"?w[E]:g[E]);break;default:throw new Error('Unexpected argument type! Expected "string" or "object", got '+d(w))}if(!g.printable)throw new Error("Missing printable information.");if(!g.type||typeof g.type!="string"||p.indexOf(g.type.toLowerCase())===-1)throw new Error("Invalid print type. Available types are: pdf, html, image and json.");g.showModal&&r.default.show(g),g.onLoadingStart&&g.onLoadingStart();var L=document.getElementById(g.frameId);L&&L.parentNode.removeChild(L);var F=document.createElement("iframe");switch(n.default.isFirefox()?F.setAttribute("style","width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0"):F.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute; border: 0"),F.setAttribute("id",g.frameId),g.type!=="pdf"&&(F.srcdoc="<html><head><title>"+g.documentTitle+"</title>",g.css&&(Array.isArray(g.css)||(g.css=[g.css]),g.css.forEach(function(he){F.srcdoc+='<link rel="stylesheet" href="'+he+'">'})),F.srcdoc+="</head><body></body></html>"),g.type){case"pdf":if(n.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var G=window.open(g.fallbackPrintable,"_blank");G.focus(),g.onIncompatibleBrowser()}catch(he){g.onError(he)}finally{g.showModal&&r.default.close(),g.onLoadingEnd&&g.onLoadingEnd()}else o.default.print(g,F);break;case"image":l.default.print(g,F);break;case"html":a.default.print(g,F);break;case"raw-html":s.default.print(g,F);break;case"json":c.default.print(g,F);break}}}},"./src/js/json.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/functions.js"),r=e("./src/js/print.js");function o(s){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(s)}t.default={print:function(l,c){if(o(l.printable)!=="object")throw new Error("Invalid javascript data object (JSON).");if(typeof l.repeatTableHeader!="boolean")throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!l.properties||!Array.isArray(l.properties))throw new Error("Invalid properties array for your JSON data.");l.properties=l.properties.map(function(d){return{field:o(d)==="object"?d.field:d,displayName:o(d)==="object"?d.displayName:d,columnSize:o(d)==="object"&&d.columnSize?d.columnSize+";":100/l.properties.length+"%;"}}),l.printableElement=document.createElement("div"),l.header&&Object(n.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=a(l),r.default.send(l,c)}};function a(s){var l=s.printable,c=s.properties,d='<table style="border-collapse: collapse; width: 100%;">';s.repeatTableHeader&&(d+="<thead>"),d+="<tr>";for(var p=0;p<c.length;p++)d+='<th style="width:'+c[p].columnSize+";"+s.gridHeaderStyle+'">'+Object(n.capitalizePrint)(c[p].displayName)+"</th>";d+="</tr>",s.repeatTableHeader&&(d+="</thead>"),d+="<tbody>";for(var v=0;v<l.length;v++){d+="<tr>";for(var g=0;g<c.length;g++){var w=l[v],E=c[g].field.split(".");if(E.length>1)for(var L=0;L<E.length;L++)w=w[E[L]];else w=w[c[g].field];d+='<td style="width:'+c[g].columnSize+s.gridStyle+'">'+w+"</td>"}d+="</tr>"}return d+="</tbody></table>",d}},"./src/js/modal.js":function(i,t,e){"use strict";e.r(t);var n={show:function(o){var a="font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;",s=document.createElement("div");s.setAttribute("style",a),s.setAttribute("id","printJS-Modal");var l=document.createElement("div");l.setAttribute("style","display:table-cell; vertical-align:middle; padding-bottom:100px;");var c=document.createElement("div");c.setAttribute("class","printClose"),c.setAttribute("id","printClose"),l.appendChild(c);var d=document.createElement("span");d.setAttribute("class","printSpinner"),l.appendChild(d);var p=document.createTextNode(o.modalMessage);l.appendChild(p),s.appendChild(l),document.getElementsByTagName("body")[0].appendChild(s),document.getElementById("printClose").addEventListener("click",function(){n.close()})},close:function(){var o=document.getElementById("printJS-Modal");o&&o.parentNode.removeChild(o)}};t.default=n},"./src/js/pdf.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/print.js"),r=e("./src/js/functions.js");t.default={print:function(s,l){if(s.base64){var c=Uint8Array.from(atob(s.printable),function(p){return p.charCodeAt(0)});o(s,l,c);return}s.printable=/^(blob|http|\/\/)/i.test(s.printable)?s.printable:window.location.origin+(s.printable.charAt(0)!=="/"?"/"+s.printable:s.printable);var d=new window.XMLHttpRequest;d.responseType="arraybuffer",d.addEventListener("error",function(){Object(r.cleanUp)(s),s.onError(d.statusText,d)}),d.addEventListener("load",function(){if([200,201].indexOf(d.status)===-1){Object(r.cleanUp)(s),s.onError(d.statusText,d);return}o(s,l,d.response)}),d.open("GET",s.printable,!0),d.send()}};function o(a,s,l){var c=new window.Blob([l],{type:"application/pdf"});c=window.URL.createObjectURL(c),s.setAttribute("src",c),n.default.send(a,s)}},"./src/js/print.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/browser.js"),r=e("./src/js/functions.js"),o={send:function(d,p){document.getElementsByTagName("body")[0].appendChild(p);var v=document.getElementById(d.frameId);v.onload=function(){if(d.type==="pdf"){n.default.isFirefox()?setTimeout(function(){return a(v,d)},1e3):a(v,d);return}var g=v.contentWindow||v.contentDocument;if(g.document&&(g=g.document),g.body.appendChild(d.printableElement),d.type!=="pdf"&&d.style){var w=document.createElement("style");w.innerHTML=d.style,g.head.appendChild(w)}var E=g.getElementsByTagName("img");E.length>0?s(Array.from(E)).then(function(){return a(v,d)}):a(v,d)}}};function a(c,d){try{if(c.focus(),n.default.isEdge()||n.default.isIE())try{c.contentWindow.document.execCommand("print",!1,null)}catch{c.contentWindow.print()}else c.contentWindow.print()}catch(p){d.onError(p)}finally{n.default.isFirefox()&&(c.style.visibility="hidden",c.style.left="-1px"),Object(r.cleanUp)(d)}}function s(c){var d=c.map(function(p){if(p.src&&p.src!==window.location.href)return l(p)});return Promise.all(d)}function l(c){return new Promise(function(d){var p=function v(){!c||typeof c.naturalWidth>"u"||c.naturalWidth===0||!c.complete?setTimeout(v,500):d()};p()})}t.default=o},"./src/js/raw-html.js":function(i,t,e){"use strict";e.r(t);var n=e("./src/js/print.js");t.default={print:function(o,a){o.printableElement=document.createElement("div"),o.printableElement.setAttribute("style","width:100%"),o.printableElement.innerHTML=o.printable,n.default.send(o,a)}}},"./src/sass/index.scss":function(i,t,e){},0:function(i,t,e){i.exports=e("./src/index.js")}}).default})});var km={equal:my};function Tm(i,t=km){let e=Object.keys(i),n=e.reduce((r,o)=>k(_({},r),{[o]:B(i[o],t)}),{});return{select(r,o=km){return Vc(()=>r(n),o)},update(r,o){let a=n[r];typeof o=="function"?a.update(o):a.set(o)},reset(){e.forEach(r=>{n[r].set(i[r])})}}}function my(i,t){return i===t}var Re=(()=>{class i{constructor(){this.INITIAL_STATE={stepper:{state:0,min:0,max:2},shelfLabelConfig:{CurrencySymbolFontSize:12,NormalFontSize:12,PromotionPriceFontSize:12,PromotionDateFontSize:12,PromotionDescFontSize:12,ProductNameFontSize:12,ProductCodeFontSize:12,PrintDateFontSize:12,StoreNameFontSize:12,CompanyNameLabel:"",CurrencySymbol:""},productItems:[],productItemsSelected:{},paperConfig:{},sidebarExpanded:!0,paperConfiguration:{},taxs:[],options:{theme:"light",dir:"ltr",layout:"vertical",sidebartype:"full",sidebarpos:"fixed",headerpos:"fixed",boxed:"full",navbarbg:"skin6",sidebarbg:"skin6",logobg:"skin6",active:1,tabStatus:"justify",isCollapsed:!1,innerWidth:window.innerWidth,defaultSidebar:"full",showSettings:!1,showMobileMenu:!1,expandLogo:!1},stepperRef:void 0,outlet:{},paperSource:""},this.#e=Tm(this.INITIAL_STATE),this.stepper$=this.#e.select(e=>e.stepper()),this.productItems=this.#e.select(e=>e.productItems()),this.paperConfig=this.#e.select(e=>e.paperConfig()),this.sidebarExpanded=this.#e.select(e=>e.sidebarExpanded()),this.paperConfiguration=this.#e.select(e=>e.paperConfiguration()),this.paperShelfLabelConfig=this.#e.select(e=>e.shelfLabelConfig()),this.taxs=this.#e.select(e=>e.taxs()),this.options=this.#e.select(e=>e.options()),this.expandProductItems=this.#e.select(e=>e.productItems().flatMap(n=>new Array(n.Quantity).fill(_(_({},n),n.Print?.[0]||null)))),this.expandProductItem=this.#e.select(e=>{if(e.productItems().length){let[n]=e.productItems();return[_(_({},n),n.Print?.[0]||null)]}return[]}),this.productItemsSelected$=this.#e.select(e=>e.productItemsSelected()),this.stepperRef=this.#e.select(e=>e.stepperRef()),this.outlet$=this.#e.select(e=>{let n=e.paperConfig()?.Outlets,r=e.paperConfiguration()?.OutletID;if(!Array.isArray(n)||!r)return null;let o=n.findIndex(a=>a.ID===r);return o!==-1?n[o]:null}),this.paperSource=this.#e.select(e=>e.paperSource())}#e;onNextStep(){let e=this.stepper$().state+1;this.#e.update("stepper",k(_({},this.stepper$()),{state:e}))}onPrevStep(){let e=this.stepper$().state-1;this.#e.update("stepper",k(_({},this.stepper$()),{state:e}))}onGotoStepper(e){this.#e.update("stepper",k(_({},this.stepper$()),{state:e}))}onChangeProductItems(e){this.#e.update("productItems",e)}onChangePaperConfig(e){this.#e.update("paperConfig",e)}onChangePaperConfiguration(e){this.#e.update("paperConfiguration",e)}onChangeTaxs(e){this.#e.update("taxs",e)}onChangeOptions(e){this.#e.update("options",_(_({},this.options()),e))}onChangeProductItemsSelected(e){this.#e.update("productItemsSelected",e)}onChangeStepperRef(e){this.#e.update("stepperRef",e)}onChangeShelfLabelConfig(e){this.#e.update("shelfLabelConfig",e)}onChangePaperSource(e){this.#e.update("paperSource",e)}onReset(){this.#e.reset()}onToggleSidebarType(){switch(this.options().sidebartype){case"full":case"iconbar":this.onChangeOptions({sidebartype:"mini-sidebar"});break;case"overlay":this.onChangeOptions({showMobileMenu:!this.options().showMobileMenu});break;case"mini-sidebar":this.options().defaultSidebar==="mini-sidebar"?this.onChangeOptions({sidebartype:"full"}):this.onChangeOptions({sidebartype:this.options().defaultSidebar});break;default:}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function Mm(i){let{anchorOffset:t=0,focusOffset:e=0}=i.ownerDocument.getSelection()||{},n=Math.min(t,e),r=Math.max(t,e);return[n,r]}function fy(i,[t,e]){var n,r,o,a;let s=i.ownerDocument,l=s.createRange();l.setStart(i.firstChild||i,Math.min(t,(r=(n=i.textContent)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0)),l.setEnd(i.lastChild||i,Math.min(e,(a=(o=i.textContent)===null||o===void 0?void 0:o.length)!==null&&a!==void 0?a:0));let c=s.getSelection();c&&(c.removeAllRanges(),c.addRange(l))}var Gc=class{constructor(t){this.element=t,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
11
11
  `)}set value(t){this.element.innerHTML=t.replace(/\n$/,`
12
12
 
13
- `)}get selectionStart(){return Mm(this.element)[0]}get selectionEnd(){return Mm(this.element)[1]}setSelectionRange(t,e){fy(this.element,[t??0,e??0])}select(){this.setSelectionRange(0,this.value.length)}};function gy(i){let t=new Gc(i);return new Proxy(i,{get(e,n){if(n in t)return t[n];let r=e[n];return typeof r=="function"?r.bind(e):r},set(e,n,r,o){return Reflect.set(n in t?t:e,n,r,o)}})}var Rm=i=>i.isContentEditable?gy(i):i.querySelector("input,textarea")||i,jr={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"},Yc=class{constructor(){this.now=null,this.past=[],this.future=[]}undo(){let t=this.past.pop();t&&this.now&&(this.future.push(this.now),this.updateElement(t,"historyUndo"))}redo(){let t=this.future.pop();t&&this.now&&(this.past.push(this.now),this.updateElement(t,"historyRedo"))}updateHistory(t){if(!this.now){this.now=t;return}let e=this.now.value!==t.value,n=this.now.selection.some((r,o)=>r!==t.selection[o]);!e&&!n||(e&&(this.past.push(this.now),this.future=[]),this.now=t)}updateElement(t,e){this.now=t,this.updateElementState(t,{inputType:e,data:null})}};function by(i,...t){return t.every(({value:e})=>e===i.value)}function vy(i,...t){return t.every(({value:e,selection:n})=>e===i.value&&n[0]===i.selection[0]&&n[1]===i.selection[1])}function _y({value:i,selection:t},e,n){let[r,o]=t,a=typeof n=="function"?n({value:i,selection:t}):n;return{value:i,selection:a==="replace"?[r,Math.max(r+e.length,o)]:[r,o]}}function $s(i){return typeof i=="string"}function Om(i,t,e,n){let r="";for(let o=t.length;o<i.length;o++){let a=i[o]||"",s=n?.value[o]===a;if(!$s(a)||a===e&&!s)return r;r+=a}return r}function Bm(i,t){return Array.isArray(t)?i.length===t.length&&Array.from(i).every((e,n)=>{let r=t[n]||"";return $s(r)?e===r:e.match(r)}):t.test(i)}function yy(i,t,e){let n=null,r=null,o=Array.from(i.value).reduce((s,l,c)=>{let d=Om(t,s,l,e),p=s+d,v=t[p.length]||"";return n===null&&c>=i.selection[0]&&(n=p.length),r===null&&c>=i.selection[1]&&(r=p.length),$s(v)?p+v:l.match(v)?p+l:p},""),a=Om(t,o,"",e);return{value:Bm(o+a,t)?o+a:o,selection:[n??o.length,r??o.length]}}function wy({value:i,selection:t},e){let[n,r]=t,o=n,a=r,s=Array.from(i).reduce((l,c,d)=>{let p=l+c;return n===d&&(o=l.length),r===d&&(a=l.length),p.match(e)?p:l},"");return{value:s,selection:[Math.min(o,s.length),Math.min(a,s.length)]}}function Vs(i,t,e=null){if(Bm(i.value,t))return i;let{value:n,selection:r}=Array.isArray(t)?yy(i,t,e):wy(i,t);return{selection:r,value:Array.isArray(t)?n.slice(0,t.length):n}}function Fm(i,t){if(!Array.isArray(t))return i;let[e,n]=i.selection,r=[],o=Array.from(i.value).reduce((a,s,l)=>{let c=t[l]||"";return l===e&&r.push(a.length),l===n&&r.push(a.length),$s(c)&&c===s?a:a+s},"");return r.length<2&&r.push(...new Array(2-r.length).fill(o.length)),{value:o,selection:[r[0],r[1]]}}var Lo=class{constructor(t,e){this.initialElementState=t,this.maskOptions=e,this.value="",this.selection=[0,0];let{value:n,selection:r}=Vs(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=n,this.selection=r}addCharacters([t,e],n){let{value:r,maskOptions:o}=this,a=this.getMaskExpression({value:r.slice(0,t)+n+r.slice(e),selection:[t+n.length,t+n.length]}),s={value:r,selection:[t,e]},l=Fm(s,a),[c,d]=_y(l,n,o.overwriteMode).selection,p=l.value.slice(0,c)+n,v=p.length,g=Vs({value:p+l.value.slice(d),selection:[v,v]},a,s);if(r.slice(0,t)===Vs({value:p,selection:[v,v]},a,s).value||vy(this,g))throw new Error("Invalid mask value");this.value=g.value,this.selection=g.selection}deleteCharacters([t,e]){if(t===e||!e)return;let{value:n}=this,r=this.getMaskExpression({value:n.slice(0,t)+n.slice(e),selection:[t,t]}),o={value:n,selection:[t,e]},a=Fm(o,r),[s,l]=a.selection,c=a.value.slice(0,s)+a.value.slice(l),d=Vs({value:c,selection:[s,s]},r,o);this.value=d.value,this.selection=d.selection}getMaskExpression(t){let{mask:e}=this.maskOptions;return typeof e=="function"?e(t):e}},Xc=class{constructor(t){this.element=t,this.listeners=[]}listen(t,e,n){let r=e;this.element.addEventListener(t,r,n),this.listeners.push(()=>this.element.removeEventListener(t,r,n))}destroy(){this.listeners.forEach(t=>t())}},Bi={CTRL:1,ALT:2,SHIFT:4,META:8},No={Y:89,Z:90};function zo(i,t,e){return i.ctrlKey===!!(t&Bi.CTRL)&&i.altKey===!!(t&Bi.ALT)&&i.shiftKey===!!(t&Bi.SHIFT)&&i.metaKey===!!(t&Bi.META)&&i.keyCode===e}function xy(i){return zo(i,Bi.CTRL,No.Y)||zo(i,Bi.CTRL|Bi.SHIFT,No.Z)||zo(i,Bi.META|Bi.SHIFT,No.Z)}function Cy(i){return zo(i,Bi.CTRL,No.Z)||zo(i,Bi.META,No.Z)}function Hr(i,t){var e;let n=i.value;if(typeof t=="string")i.value=t;else{let[r,o]=t.selection;i.value=t.value,i.matches(":focus")&&((e=i.setSelectionRange)===null||e===void 0||e.call(i,r,o))}i.value!==n&&i.dispatchEvent(new Event("input",{bubbles:!0}))}function Sy({value:i,selection:t},e){let[n,r]=t;if(n!==r)return[n,r];let o=e?i.slice(n).indexOf(`
13
+ `)}get selectionStart(){return Mm(this.element)[0]}get selectionEnd(){return Mm(this.element)[1]}setSelectionRange(t,e){fy(this.element,[t??0,e??0])}select(){this.setSelectionRange(0,this.value.length)}};function gy(i){let t=new Gc(i);return new Proxy(i,{get(e,n){if(n in t)return t[n];let r=e[n];return typeof r=="function"?r.bind(e):r},set(e,n,r,o){return Reflect.set(n in t?t:e,n,r,o)}})}var Rm=i=>i.isContentEditable?gy(i):i.querySelector("input,textarea")||i,jr={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"},Yc=class{constructor(){this.now=null,this.past=[],this.future=[]}undo(){let t=this.past.pop();t&&this.now&&(this.future.push(this.now),this.updateElement(t,"historyUndo"))}redo(){let t=this.future.pop();t&&this.now&&(this.past.push(this.now),this.updateElement(t,"historyRedo"))}updateHistory(t){if(!this.now){this.now=t;return}let e=this.now.value!==t.value,n=this.now.selection.some((r,o)=>r!==t.selection[o]);!e&&!n||(e&&(this.past.push(this.now),this.future=[]),this.now=t)}updateElement(t,e){this.now=t,this.updateElementState(t,{inputType:e,data:null})}};function by(i,...t){return t.every(({value:e})=>e===i.value)}function vy(i,...t){return t.every(({value:e,selection:n})=>e===i.value&&n[0]===i.selection[0]&&n[1]===i.selection[1])}function _y({value:i,selection:t},e,n){let[r,o]=t,a=typeof n=="function"?n({value:i,selection:t}):n;return{value:i,selection:a==="replace"?[r,Math.max(r+e.length,o)]:[r,o]}}function qs(i){return typeof i=="string"}function Om(i,t,e,n){let r="";for(let o=t.length;o<i.length;o++){let a=i[o]||"",s=n?.value[o]===a;if(!qs(a)||a===e&&!s)return r;r+=a}return r}function Bm(i,t){return Array.isArray(t)?i.length===t.length&&Array.from(i).every((e,n)=>{let r=t[n]||"";return qs(r)?e===r:e.match(r)}):t.test(i)}function yy(i,t,e){let n=null,r=null,o=Array.from(i.value).reduce((s,l,c)=>{let d=Om(t,s,l,e),p=s+d,v=t[p.length]||"";return n===null&&c>=i.selection[0]&&(n=p.length),r===null&&c>=i.selection[1]&&(r=p.length),qs(v)?p+v:l.match(v)?p+l:p},""),a=Om(t,o,"",e);return{value:Bm(o+a,t)?o+a:o,selection:[n??o.length,r??o.length]}}function wy({value:i,selection:t},e){let[n,r]=t,o=n,a=r,s=Array.from(i).reduce((l,c,d)=>{let p=l+c;return n===d&&(o=l.length),r===d&&(a=l.length),p.match(e)?p:l},"");return{value:s,selection:[Math.min(o,s.length),Math.min(a,s.length)]}}function Us(i,t,e=null){if(Bm(i.value,t))return i;let{value:n,selection:r}=Array.isArray(t)?yy(i,t,e):wy(i,t);return{selection:r,value:Array.isArray(t)?n.slice(0,t.length):n}}function Fm(i,t){if(!Array.isArray(t))return i;let[e,n]=i.selection,r=[],o=Array.from(i.value).reduce((a,s,l)=>{let c=t[l]||"";return l===e&&r.push(a.length),l===n&&r.push(a.length),qs(c)&&c===s?a:a+s},"");return r.length<2&&r.push(...new Array(2-r.length).fill(o.length)),{value:o,selection:[r[0],r[1]]}}var jo=class{constructor(t,e){this.initialElementState=t,this.maskOptions=e,this.value="",this.selection=[0,0];let{value:n,selection:r}=Us(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=n,this.selection=r}addCharacters([t,e],n){let{value:r,maskOptions:o}=this,a=this.getMaskExpression({value:r.slice(0,t)+n+r.slice(e),selection:[t+n.length,t+n.length]}),s={value:r,selection:[t,e]},l=Fm(s,a),[c,d]=_y(l,n,o.overwriteMode).selection,p=l.value.slice(0,c)+n,v=p.length,g=Us({value:p+l.value.slice(d),selection:[v,v]},a,s);if(r.slice(0,t)===Us({value:p,selection:[v,v]},a,s).value||vy(this,g))throw new Error("Invalid mask value");this.value=g.value,this.selection=g.selection}deleteCharacters([t,e]){if(t===e||!e)return;let{value:n}=this,r=this.getMaskExpression({value:n.slice(0,t)+n.slice(e),selection:[t,t]}),o={value:n,selection:[t,e]},a=Fm(o,r),[s,l]=a.selection,c=a.value.slice(0,s)+a.value.slice(l),d=Us({value:c,selection:[s,s]},r,o);this.value=d.value,this.selection=d.selection}getMaskExpression(t){let{mask:e}=this.maskOptions;return typeof e=="function"?e(t):e}},Xc=class{constructor(t){this.element=t,this.listeners=[]}listen(t,e,n){let r=e;this.element.addEventListener(t,r,n),this.listeners.push(()=>this.element.removeEventListener(t,r,n))}destroy(){this.listeners.forEach(t=>t())}},Bi={CTRL:1,ALT:2,SHIFT:4,META:8},zo={Y:89,Z:90};function Lo(i,t,e){return i.ctrlKey===!!(t&Bi.CTRL)&&i.altKey===!!(t&Bi.ALT)&&i.shiftKey===!!(t&Bi.SHIFT)&&i.metaKey===!!(t&Bi.META)&&i.keyCode===e}function xy(i){return Lo(i,Bi.CTRL,zo.Y)||Lo(i,Bi.CTRL|Bi.SHIFT,zo.Z)||Lo(i,Bi.META|Bi.SHIFT,zo.Z)}function Cy(i){return Lo(i,Bi.CTRL,zo.Z)||Lo(i,Bi.META,zo.Z)}function Hr(i,t){var e;let n=i.value;if(typeof t=="string")i.value=t;else{let[r,o]=t.selection;i.value=t.value,i.matches(":focus")&&((e=i.setSelectionRange)===null||e===void 0||e.call(i,r,o))}i.value!==n&&i.dispatchEvent(new Event("input",{bubbles:!0}))}function Sy({value:i,selection:t},e){let[n,r]=t;if(n!==r)return[n,r];let o=e?i.slice(n).indexOf(`
14
14
  `)+1||i.length:i.slice(0,r).lastIndexOf(`
15
- `)+1;return[e?n:o,e?o:r]}function Py({value:i,selection:t},e){let[n,r]=t;return n!==r?[n,r]:(e?[n,r+1]:[n-1,r]).map(a=>Math.min(Math.max(a,0),i.length))}var Ey=/\s+$/g,Iy=/^\s+/g,Am=/\s/;function Dy({value:i,selection:t},e){let[n,r]=t;if(n!==r)return[n,r];if(e){let l=i.slice(n),[c]=l.match(Iy)||[""],d=l.trimStart().search(Am);return[n,d!==-1?n+c.length+d:i.length]}let o=i.slice(0,r),[a]=o.match(Ey)||[""],s=o.trimEnd().split("").reverse().findIndex(l=>Am.exec(l));return[s!==-1?r-a.length-s:0,r]}function Us(i=[]){return(t,...e)=>i.reduce((n,r)=>Object.assign(Object.assign({},n),r(n,...e)),t)}function qn(i,t){let e=Object.assign(Object.assign({},jr),t),n=Us(e.preprocessors),r=Us(e.postprocessors),o=typeof i=="string"?{value:i,selection:[0,0]}:i,{elementState:a}=n({elementState:o,data:""},"validation"),s=new Lo(a,e),{value:l,selection:c}=r(s,o);return typeof i=="string"?l:{value:l,selection:c}}var Ws=class extends Yc{constructor(t,e){super(),this.element=t,this.maskitoOptions=e,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new Xc(this.element),this.options=Object.assign(Object.assign({},jr),this.maskitoOptions),this.upcomingElementState=null,this.preprocessor=Us(this.options.preprocessors),this.postprocessor=Us(this.options.postprocessors),this.teardowns=this.options.plugins.map(n=>n(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",n=>{if(xy(n))return n.preventDefault(),this.redo();if(Cy(n))return n.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",n=>{var r,o,a;let s=n.inputType.includes("Forward");switch(this.updateHistory(this.elementState),n.inputType){case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:n,isForward:s,selection:Py(this.elementState,s)});case"deleteHardLineBackward":case"deleteHardLineForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":return this.handleDelete({event:n,isForward:s,selection:Sy(this.elementState,s),force:!0});case"deleteWordBackward":case"deleteWordForward":return this.handleDelete({event:n,isForward:s,selection:Dy(this.elementState,s),force:!0});case"historyRedo":return n.preventDefault(),this.redo();case"historyUndo":return n.preventDefault(),this.undo();case"insertCompositionText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(n);case"insertReplacementText":return;case"insertFromDrop":case"insertFromPaste":case"insertText":default:return this.handleInsert(n,(a=(r=n.data)!==null&&r!==void 0?r:(o=n.dataTransfer)===null||o===void 0?void 0:o.getData("text/plain"))!==null&&a!==void 0?a:"")}}),this.eventListener.listen("input",()=>{this.upcomingElementState&&(this.updateElementState(this.upcomingElementState),this.upcomingElementState=null)},{capture:!0}),this.eventListener.listen("input",({inputType:n})=>{n!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}destroy(){this.eventListener.destroy(),this.teardowns.forEach(t=>t?.())}updateElementState({value:t,selection:e},n){let r=this.elementState.value;this.updateValue(t),this.updateSelectionRange(e),n&&r!==t&&this.dispatchInputEvent(n)}get elementState(){let{value:t,selectionStart:e,selectionEnd:n}=this.element;return{value:t,selection:[e??0,n??0]}}get maxLength(){let{maxLength:t}=this.element;return t===-1?1/0:t}updateSelectionRange([t,e]){var n;let{element:r}=this;r.matches(":focus")&&(r.selectionStart!==t||r.selectionEnd!==e)&&((n=r.setSelectionRange)===null||n===void 0||n.call(r,t,e))}updateValue(t){this.element.value=t}ensureValueFitsMask(){this.updateElementState(qn(this.elementState,this.options),{inputType:"insertText",data:null})}dispatchInputEvent(t={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},t),{bubbles:!0,cancelable:!1})))}handleDelete({event:t,selection:e,isForward:n,force:r=!1}){let o={value:this.elementState.value,selection:e},[a,s]=o.selection,{elementState:l}=this.preprocessor({elementState:o,data:""},n?"deleteForward":"deleteBackward"),c=new Lo(l,this.options),[d,p]=l.selection;c.deleteCharacters([d,p]);let v=this.postprocessor(c,o);if(!(o.value.slice(0,a)+o.value.slice(s)===v.value&&!r&&!this.element.isContentEditable)){if(by(o,l,c,v))return t.preventDefault(),this.updateSelectionRange(n?[p,p]:[d,d]);this.upcomingElementState=v}}handleInsert(t,e){let{options:n,maxLength:r,element:o,elementState:a}=this,{elementState:s,data:l=e}=this.preprocessor({data:e,elementState:a},"insert"),c=new Lo(s,n);try{c.addCharacters(s.selection,l)}catch{return t.preventDefault()}let[d,p]=s.selection,v=a.value.slice(0,d)+e+a.value.slice(p),g=this.postprocessor(c,a);if(g.value.length>r)return t.preventDefault();(v!==g.value||o.isContentEditable)&&(this.upcomingElementState=g,n.overwriteMode==="replace"&&v.length>r&&this.dispatchInputEvent({inputType:"insertText",data:e}))}handleEnter(t){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(t,`
16
- `)}};function Vr(i,t,e){let n=Math.min(Number(e),Math.max(Number(t),Number(i)));return i instanceof Date?new Date(n):n}var ky=[".",",","\u0431","\u044E"];var Qc="\xA0",Ty="\u200B",Hm="\u2013",Vm="\u2014",qs="-",Kc="\u2212",Um="\u30FC";var TF=new RegExp(`[${Qc}APM]+$`,"g"),MF=new RegExp(`${Qc}[AP]M$`,"g"),My=[":","."];function Ur(i){return i}function Oy(){}var Wm=/[\\^$.*+?()[\]{}|]/g,Fy=new RegExp(Wm.source);function qt(i){return i&&Fy.test(i)?i.replaceAll(Wm,String.raw`\$&`):i}function Ni(i,{prefix:t,postfix:e}){var n,r;let o=new RegExp(`^${qt(t)}`),a=new RegExp(`${qt(e)}$`),[s=""]=(n=i.match(o))!==null&&n!==void 0?n:[],[l=""]=(r=i.match(a))!==null&&r!==void 0?r:[];return{extractedPrefix:s,extractedPostfix:l,cleanValue:s||l?i.slice(s.length,l.length?-l.length:1/0):i}}function Ay(i,t){let e="";for(let n=0;n<i.length;n++){if(i[n]!==t[n])return e;e+=i[n]}return e}function Nm(i){return i.replaceAll(/[0-9]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248))}function Ry(){return({elementState:i,data:t})=>{let{value:e,selection:n}=i;return{elementState:{selection:n,value:Nm(e)},data:Nm(t)}}}var OF=new RegExp(`[${My.map(qt).join("")}]$`);function By(i){let t=new RegExp(`${qt(i)}$`);return i?({value:e,selection:n},r)=>{if(!e&&!r.value.endsWith(i))return{value:e,selection:n};if(!e.endsWith(i)&&!r.value.endsWith(i))return{selection:n,value:e+i};let o=r.value.replace(t,""),a=r.selection[1]>o.length,s=Ay(o,e);return{selection:n,value:Array.from(i).reverse().reduce((l,c,d)=>{let p=l.length-1-d,v=s[p]===c&&a;return l[p]!==c||v?l.slice(0,p+1)+c+l.slice(p+1):l},e)}}:Ur}function Ny(i){return i?({value:t,selection:e},n)=>{if(t.startsWith(i)||!t&&!n.value.startsWith(i))return{value:t,selection:e};let[r,o]=e,a=Array.from(i).reduce((l,c,d)=>l[d]===c?l:l.slice(0,d)+c+l.slice(d),t),s=a.length-t.length;return{selection:[r+s,o+s],value:a}}:Ur}function Wr(i,t,e){return(n,r)=>{let o=()=>t(n,r);return n.addEventListener(i,o,e),()=>n.removeEventListener(i,o,e)}}function zy(i){return(t,e)=>{let n=t.ownerDocument,r=0,o=()=>r++,a=()=>{r=Math.max(--r,0)},s=()=>{if(t.matches(":focus")){if(r)return n.addEventListener("mouseup",s,{once:!0,passive:!0});i(t,e)}};return n.addEventListener("selectionchange",s,{passive:!0}),t.addEventListener("mousedown",o,{passive:!0}),n.addEventListener("mouseup",a,{passive:!0}),()=>{n.removeEventListener("selectionchange",s),n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",a)}}}function $m(i){return zy(t=>{var e,n;let r=(e=t.selectionStart)!==null&&e!==void 0?e:0,o=(n=t.selectionEnd)!==null&&n!==void 0?n:0,[a,s]=i(t.value,[r,o]);(a>r||s<o)&&t.setSelectionRange(Vr(r,a,s),Vr(o,a,s))})}function Ly({prefix:i,postfix:t}){return({elementState:e,data:n})=>{let{cleanValue:r}=Ni(n,{prefix:i,postfix:t});return{elementState:e,data:r}}}function qm({decimalSeparator:i,isNegativeAllowed:t,precision:e,thousandSeparator:n,prefix:r,postfix:o,decimalPseudoSeparators:a=[],pseudoMinuses:s=[],minusSign:l}){let c=zm(r),d=String.raw`\d`,p=t?`[${l}${s.map(L=>`\\${L}`).join("")}]?`:"",v=n?`[${d}${qt(n).replaceAll(/\s/g,String.raw`\s`)}]*`:`[${d}]*`,g=Number.isFinite(e)?e:"",w=e>0?`([${qt(i)}${a.map(qt).join("")}]${d}{0,${g}})?`:"",E=zm(o);return new RegExp(`^${c}${p}${v}${w}${E}$`)}function zm(i){return i?`${i.split("").map(t=>`${qt(t)}?`).join("")}`:""}function Zc(i,t="."){let e=!!new RegExp(`^\\D*[${Kc}\\${qs}${Hm}${Vm}${Um}]`).exec(i),n=qt(t),r=i.replaceAll(new RegExp(`${n}(?!\\d)`,"g"),"").replaceAll(new RegExp(`[^\\d${n}]`,"g"),"").replace(t,t&&".");return r?+`${e?qs:""}${r}`:NaN}function jy(i){var t;let e=String(i),[n="",r]=e.split("e-"),o=e;if(r){let[,a]=n.split("."),s=Number(r)+((t=a?.length)!==null&&t!==void 0?t:0);o=i.toFixed(s)}return o}function Gm(i,{decimalSeparator:t,minusSign:e}){let[n="",r=""]=t?i.split(t):[i],o=qt(e),[,a="",s=""]=new RegExp(`^(?:[^\\d${o}])?(${o})?(.*)`).exec(n)||[];return{minus:a,integerPart:s,decimalPart:r}}function Hy({decimalSeparator:i,thousandSeparator:t,decimalPseudoSeparators:e=ky}){return e.filter(n=>n!==t&&n!==i)}function Vy({decimalSeparator:i,precision:t,decimalZeroPadding:e,prefix:n,postfix:r}){return t<=0||!e?Ur:({value:o,selection:a})=>{let{cleanValue:s,extractedPrefix:l,extractedPostfix:c}=Ni(o,{prefix:n,postfix:r});if(Number.isNaN(Zc(s,i)))return{value:o,selection:a};let[d,p=""]=s.split(i);return{value:l+d+i+p.padEnd(t,"0")+c,selection:a}}}function Uy({prefix:i,postfix:t,decimalSeparator:e,minusSign:n}){return({value:r,selection:o})=>{let[a]=o,{cleanValue:s,extractedPrefix:l,extractedPostfix:c}=Ni(r,{prefix:i,postfix:t}),{minus:d,integerPart:p,decimalPart:v}=Gm(s,{decimalSeparator:e,minusSign:n}),g=!p&&!v&&!!e&&s.includes(e);return!p&&!Number(v)&&a===(d+l).length||g?{selection:o,value:l+d+c}:{value:r,selection:o}}}function Wy({decimalSeparator:i,decimalPseudoSeparators:t,pseudoMinuses:e,prefix:n,postfix:r,minusSign:o}){let a=!0,s=qm({decimalSeparator:i,decimalPseudoSeparators:t,pseudoMinuses:e,prefix:"",postfix:"",thousandSeparator:"",precision:1/0,isNegativeAllowed:!0,minusSign:o});return({elementState:l,data:c})=>{if(!a)return{elementState:l,data:c};a=!1;let{value:d,selection:p}=l,[v,g]=p,{extractedPrefix:w,cleanValue:E,extractedPostfix:L}=Ni(d,{prefix:n,postfix:r}),F=qn({selection:[Math.max(v-w.length,0),Vr(g-w.length,0,E.length)],value:E},{mask:s}),[G,he]=F.selection;return{elementState:{selection:[G+w.length,he+w.length],value:w+F.value+L},data:c}}}function $y({decimalSeparator:i,thousandSeparator:t,prefix:e,postfix:n}){let r=a=>{let s=qt(t);return a.replace(new RegExp(`^(\\D+)?[0${s}]+(?=0)`),"$1").replace(new RegExp(`^(\\D+)?[0${s}]+(?=[1-9])`),"$1")},o=(a,s)=>{let l=a.slice(0,s),c=a.slice(s).startsWith("0");return l.length-r(l).length+(c?1:0)};return({value:a,selection:s})=>{let[l,c]=s,{cleanValue:d,extractedPrefix:p,extractedPostfix:v}=Ni(a,{prefix:e,postfix:n}),g=!!i&&d.includes(i),[w="",E=""]=i?d.split(i):[d],L=r(w);if(w===L)return{value:a,selection:s};let F=l-o(a,l),G=c-o(a,c);return{value:p+L+(g?i:"")+E+v,selection:[Math.max(F,0),Math.max(G,0)]}}}function qy({min:i,max:t,decimalSeparator:e,minusSign:n}){return({value:r,selection:o})=>{let a=Zc(r,e),s=a>0?Math.min(a,t):Math.max(a,i);if(a&&s!==a){let l=`${s}`.replace(".",e).replace(qs,n);return{value:l,selection:[l.length,l.length]}}return{value:r,selection:o}}}function Gy({decimalSeparator:i,thousandSeparator:t,decimalZeroPadding:e}){return({elementState:n,data:r},o)=>{let{value:a,selection:s}=n,[l,c]=s,d=a.slice(l,c),p=e?[i,t]:[t],v=e&&l>a.indexOf(i)&&!!d.match(/^0+$/gi);return o!=="deleteBackward"&&o!=="deleteForward"||!p.includes(d)&&!v?{elementState:n,data:r}:{elementState:{value:a,selection:o==="deleteForward"?[c,c]:[l,l]},data:r}}}function Yy({decimalSeparator:i,precision:t,prefix:e,postfix:n}){let r=new RegExp(`^\\D*${qt(i)}`);return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPrefix:d}=Ni(s,{prefix:e,postfix:n}),[p,v]=l,g=Vr(p-d.length,0,c.length),w=Vr(v-d.length,0,c.length);if(t<=0||c.slice(0,g).includes(i)||c.slice(w).includes(i)||!a.match(r))return{elementState:o,data:a};let E=/\d+/.exec(c.slice(0,g));return{elementState:o,data:E?a:`0${a}`}}}function Lm({validCharacter:i,pseudoCharacters:t,prefix:e,postfix:n}){let r=new RegExp(`[${t.join("")}]`,"gi");return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPostfix:d,extractedPrefix:p}=Ni(s,{prefix:e,postfix:n});return{elementState:{selection:l,value:p+c.replace(r,i)+d},data:a.replace(r,i)}}}function Xy({decimalSeparator:i,prefix:t,postfix:e}){return i?({elementState:n,data:r})=>{let{value:o,selection:a}=n,[s,l]=a,{cleanValue:c}=Ni(o,{prefix:t,postfix:e});return{elementState:n,data:!c.includes(i)||o.slice(s,l+1).includes(i)?r:r.replaceAll(new RegExp(qt(i),"gi"),"")}}:Ur}function Ky({thousandSeparator:i,decimalSeparator:t,prefix:e,postfix:n,minusSign:r}){if(!i)return Ur;let o=(...a)=>a.every(s=>/\s/.test(s));return({value:a,selection:s})=>{let[l,c]=s,[d,p]=s,{cleanValue:v,extractedPostfix:g,extractedPrefix:w}=Ni(a,{prefix:e,postfix:n}),{minus:E,integerPart:L,decimalPart:F}=Gm(v,{decimalSeparator:t,minusSign:r}),G=t&&v.includes(t),he=v.length-(E+L+(G?t+F:"")).length;he>0&&l&&l<=he&&(d-=he),he>0&&c&&c<=he&&(p-=he);let me=Array.from(L).reduceRight((se,y,x)=>{let z=!(!x&&y===i)&&!!se.length&&(se.length+1)%4===0,V=y===i||o(y,i);return z&&V?i+se:!z&&V?(x&&x<=l&&d--,x&&x<=c&&p--,se):z?(x<l&&d++,x<c&&p++,y+i+se):y+se},"");return{value:w+E+me+(G?t:"")+F+g,selection:[d,p]}}}function Qy({precision:i,decimalSeparator:t,prefix:e,postfix:n}){if(i>0||!t)return Ur;let r=new RegExp(`${qt(t)}.*$`,"g");return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPrefix:d,extractedPostfix:p}=Ni(s,{prefix:e,postfix:n}),[v,g]=l,w=d+c.replace(r,"")+p;return{elementState:{selection:[Math.min(v,w.length),Math.min(g,w.length)],value:w},data:a.replace(r,"")}}}var jm=[0,0];function Zy({decimalSeparator:i,thousandSeparator:t,prefix:e,postfix:n}){let r=$y({decimalSeparator:i,thousandSeparator:t,prefix:e,postfix:n});return Wr("blur",o=>{let a=r({value:o.value,selection:jm},{value:"",selection:jm}).value;Hr(o,a)},{capture:!0})}function Jy({min:i,max:t,decimalSeparator:e}){return Wr("blur",(n,r)=>{let o=Zc(n.value,e),a=Vr(o,i,t);!Number.isNaN(o)&&o!==a&&Hr(n,qn(jy(a),r))},{capture:!0})}function e1({decimalSeparator:i,prefix:t,postfix:e}){return i?Wr("blur",n=>{let{cleanValue:r,extractedPostfix:o,extractedPrefix:a}=Ni(n.value,{prefix:t,postfix:e}),s=a+r.replace(new RegExp(`^(\\D+)?${qt(i)}`),`$10${i}`)+o;Hr(n,s)},{capture:!0}):Oy}function $r({max:i=Number.MAX_SAFE_INTEGER,min:t=Number.MIN_SAFE_INTEGER,precision:e=0,thousandSeparator:n=Qc,decimalSeparator:r=".",decimalPseudoSeparators:o,decimalZeroPadding:a=!1,prefix:s="",postfix:l="",minusSign:c=Kc}={}){let d=[qs,Hm,Vm,Um,Kc].filter(w=>w!==n&&w!==r&&w!==c),p=Hy({decimalSeparator:r,thousandSeparator:n,decimalPseudoSeparators:o}),v=s.endsWith(r)&&e>0?`${s}${Ty}`:s,g=Wy({decimalSeparator:r,decimalPseudoSeparators:p,pseudoMinuses:d,prefix:v,postfix:l,minusSign:c});return r=e<=0&&r===n?"":r,Object.assign(Object.assign({},jr),{mask:qm({decimalSeparator:r,precision:e,thousandSeparator:n,prefix:v,postfix:l,isNegativeAllowed:t<0,minusSign:c}),preprocessors:[Ry(),g,Ly({prefix:v,postfix:l}),Lm({validCharacter:c,pseudoCharacters:d,prefix:v,postfix:l}),Lm({validCharacter:r,pseudoCharacters:p,prefix:v,postfix:l}),Yy({decimalSeparator:r,precision:e,prefix:v,postfix:l}),Gy({decimalSeparator:r,decimalZeroPadding:a,thousandSeparator:n}),Qy({precision:e,decimalSeparator:r,prefix:v,postfix:l}),Xy({decimalSeparator:r,prefix:v,postfix:l})],postprocessors:[qy({decimalSeparator:r,min:t,max:i,minusSign:c}),Ny(v),By(l),Ky({decimalSeparator:r,thousandSeparator:n,prefix:v,postfix:l,minusSign:c}),Vy({decimalSeparator:r,decimalZeroPadding:a,precision:e,prefix:v,postfix:l}),Uy({prefix:v,postfix:l,decimalSeparator:r,minusSign:c})],plugins:[Zy({decimalSeparator:r,thousandSeparator:n,prefix:v,postfix:l}),e1({decimalSeparator:r,prefix:v,postfix:l}),Jy({min:t,max:i,decimalSeparator:r})],overwriteMode:a?({value:w,selection:[E]})=>E<=w.indexOf(r)?"shift":"replace":"shift"})}var Gi=(()=>{class i{constructor(){this.elementRef=O(Ce).nativeElement,this.ngZone=O(We),this.maskedElement=null,this.options=null,this.elementPredicate=Rm;let e=O(ht,{self:!0,optional:!0});if(e){let n=e.writeValue.bind(e);e.writeValue=r=>{n(this.options?qn(String(r??""),this.options):r)}}}ngOnChanges(){return j(this,null,function*(){let{elementPredicate:e,options:n,maskedElement:r,elementRef:o,ngZone:a}=this;if(r?.destroy(),!n)return;let s=yield e(o);this.elementPredicate!==e||this.options!==n||a.runOutsideAngular(()=>{this.maskedElement=new Ws(s,n)})})}ngOnDestroy(){this.maskedElement?.destroy()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=Ue({type:i,selectors:[["","maskito",""]],inputs:{options:[0,"maskito","options"],elementPredicate:[0,"maskitoElement","elementPredicate"]},standalone:!0,features:[$t]})}}return i})(),Ym=(()=>{class i{transform(e,n){return qn(String(e??""),n??jr)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=fs({name:"maskito",type:i,pure:!0,standalone:!0})}}return i})();var t1=new Ge("cdk-dir-doc",{providedIn:"root",factory:i1});function i1(){return O(Le)}var n1=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function r1(i){let t=i?.toLowerCase()||"";return t==="auto"&&typeof navigator<"u"&&navigator?.language?n1.test(navigator.language)?"rtl":"ltr":t==="rtl"?"rtl":"ltr"}var On=(()=>{class i{constructor(e){if(this.value="ltr",this.change=new He,e){let n=e.body?e.body.dir:null,r=e.documentElement?e.documentElement.dir:null;this.value=r1(n||r||"ltr")}}ngOnDestroy(){this.change.complete()}static{this.\u0275fac=function(n){return new(n||i)(U(t1,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ki=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var jo=class{attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},Jc=class extends jo{constructor(t,e,n,r,o){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.componentFactoryResolver=r,this.projectableNodes=o}},Fn=class extends jo{constructor(t,e,n,r){super(),this.templateRef=t,this.viewContainerRef=e,this.context=n,this.injector=r}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}},ed=class extends jo{constructor(t){super(),this.element=t instanceof Ce?t.nativeElement:t}},Ys=class{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof Jc)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof Fn)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof ed)return this._attachedPortal=t,this.attachDomPortal(t)}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}};var Xs=class extends Ys{constructor(t,e,n,r,o){super(),this.outletElement=t,this._componentFactoryResolver=e,this._appRef=n,this._defaultInjector=r,this.attachDomPortal=a=>{this._document;let s=a.element;s.parentNode;let l=this._document.createComment("dom-portal");s.parentNode.insertBefore(l,s),this.outletElement.appendChild(s),this._attachedPortal=a,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(s,l)})},this._document=o}attachComponentPortal(t){let n=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),r;return t.viewContainerRef?(r=t.viewContainerRef.createComponent(n,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector,t.projectableNodes||void 0),this.setDisposeFn(()=>r.destroy())):(r=n.create(t.injector||this._defaultInjector||Ye.NULL),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.viewCount>0&&this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=t,r}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return n.rootNodes.forEach(r=>this.outletElement.appendChild(r)),n.detectChanges(),this.setDisposeFn(()=>{let r=e.indexOf(n);r!==-1&&e.remove(r)}),this._attachedPortal=t,n}dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Xm=(()=>{class i extends Ys{constructor(e,n,r){super(),this._componentFactoryResolver=e,this._viewContainerRef=n,this._isInitialized=!1,this.attached=new He,this.attachDomPortal=o=>{this._document;let a=o.element;a.parentNode;let s=this._document.createComment("dom-portal");o.setAttachedHost(this),a.parentNode.insertBefore(s,a),this._getRootNode().appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{s.parentNode&&s.parentNode.replaceChild(a,s)})},this._document=r}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let n=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,o=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component),a=n.createComponent(o,n.length,e.injector||n.injector,e.projectableNodes||void 0);return n!==this._viewContainerRef&&this._getRootNode().appendChild(a.hostView.rootNodes[0]),super.setDisposeFn(()=>a.destroy()),this._attachedPortal=e,this._attachedRef=a,this.attached.emit(a),a}attachTemplatePortal(e){e.setAttachedHost(this);let n=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static{this.\u0275fac=function(n){return new(n||i)(W(bs),W(kn),W(Le))}}static{this.\u0275dir=Ue({type:i,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],standalone:!0,features:[Ci]})}}return i})();var qr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var id;try{id=typeof Intl<"u"&&Intl.v8BreakIterator}catch{id=!1}var lt=(()=>{class i{constructor(e){this._platformId=e,this.isBrowser=this._platformId?bm(this._platformId):typeof document=="object"&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!!(window.chrome||id)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}static{this.\u0275fac=function(n){return new(n||i)(U(zc))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Km=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var Ho;function o1(){if(Ho==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Ho=!0}))}finally{Ho=Ho||!1}return Ho}function Gr(i){return o1()?i:!!i.capture}var Gn;function Qm(){if(Gn==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return Gn=!1,Gn;if("scrollBehavior"in document.documentElement.style)Gn=!0;else{let i=Element.prototype.scrollTo;i?Gn=!/\{\s*\[native code\]\s*\}/.test(i.toString()):Gn=!1}}return Gn}var td;function a1(){if(td==null){let i=typeof document<"u"?document.head:null;td=!!(i&&(i.createShadowRoot||i.attachShadow))}return td}function Zm(i){if(a1()){let t=i.getRootNode?i.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}function nd(){let i=typeof document<"u"&&document?document.activeElement:null;for(;i&&i.shadowRoot;){let t=i.shadowRoot.activeElement;if(t===i)break;i=t}return i}function ui(i){return i.composedPath?i.composedPath()[0]:i.target}function Vo(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}function Xr(i){return Array.isArray(i)?i:[i]}function ct(i){return i==null?"":typeof i=="string"?i:`${i}px`}function ln(i){return i instanceof Ce?i.nativeElement:i}var f1=Ne(of(),1);var yA=new Ge("SMOOTH_SCROLL_OPTIONS");var af=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ve({}),i})();var g1=new Ge("NG_SCROLLBAR_OPTIONS");var Zs=(()=>{class i{static withConfig(e){return{ngModule:i,providers:[{provide:g1,useValue:e}]}}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ve({imports:[et,ki,qr,Km,af]}),i})();function Yi(i,...t){return t.length?t.some(e=>i[e]):i.altKey||i.shiftKey||i.ctrlKey||i.metaKey}var b1=(()=>{class i{create(e){return typeof MutationObserver>"u"?null:new MutationObserver(e)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var sf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({providers:[b1]})}}return i})();var lf=new Set,Yn,v1=(()=>{class i{constructor(e,n){this._platform=e,this._nonce=n,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):y1}matchMedia(e){return(this._platform.WEBKIT||this._platform.BLINK)&&_1(e,this._nonce),this._matchMedia(e)}static{this.\u0275fac=function(n){return new(n||i)(U(lt),U(lm,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function _1(i,t){if(!lf.has(i))try{Yn||(Yn=document.createElement("style"),t&&Yn.setAttribute("nonce",t),Yn.setAttribute("type","text/css"),document.head.appendChild(Yn)),Yn.sheet&&(Yn.sheet.insertRule(`@media ${i} {body{ }}`,0),lf.add(i))}catch(e){console.error(e)}}function y1(i){return{matches:i==="all"||i==="",media:i,addListener:()=>{},removeListener:()=>{}}}var Js=(()=>{class i{constructor(e,n){this._mediaMatcher=e,this._zone=n,this._queries=new Map,this._destroySubject=new Te}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(e){return cf(Xr(e)).some(r=>this._registerQuery(r).mql.matches)}observe(e){let r=cf(Xr(e)).map(a=>this._registerQuery(a).observable),o=tm(r);return o=im(o.pipe(In(1)),o.pipe(ms(1),Pr(0))),o.pipe(Ve(a=>{let s={matches:!1,breakpoints:{}};return a.forEach(({matches:l,query:c})=>{s.matches=s.matches||l,s.breakpoints[c]=l}),s}))}_registerQuery(e){if(this._queries.has(e))return this._queries.get(e);let n=this._mediaMatcher.matchMedia(e),o={observable:new Ft(a=>{let s=l=>this._zone.run(()=>a.next(l));return n.addListener(s),()=>{n.removeListener(s)}}).pipe(Ai(n),Ve(({matches:a})=>({query:e,matches:a})),ti(this._destroySubject)),mql:n};return this._queries.set(e,o),o}static{this.\u0275fac=function(n){return new(n||i)(U(v1),U(We))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function cf(i){return i.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}var df={XSmall:"(max-width: 599.98px)",Small:"(min-width: 600px) and (max-width: 959.98px)",Medium:"(min-width: 960px) and (max-width: 1279.98px)",Large:"(min-width: 1280px) and (max-width: 1919.98px)",XLarge:"(min-width: 1920px)",Handset:"(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)",Tablet:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), (min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",Web:"(min-width: 840px) and (orientation: portrait), (min-width: 1280px) and (orientation: landscape)",HandsetPortrait:"(max-width: 599.98px) and (orientation: portrait)",TabletPortrait:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)",WebPortrait:"(min-width: 840px) and (orientation: portrait)",HandsetLandscape:"(max-width: 959.98px) and (orientation: landscape)",TabletLandscape:"(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",WebLandscape:"(min-width: 1280px) and (orientation: landscape)"};var hf=" ";function ld(i,t,e){let n=mf(i,t);e=e.trim(),!n.some(r=>r.trim()===e)&&(n.push(e),i.setAttribute(t,n.join(hf)))}function al(i,t,e){let n=mf(i,t);e=e.trim();let r=n.filter(o=>o!==e);r.length?i.setAttribute(t,r.join(hf)):i.removeAttribute(t)}function mf(i,t){return i.getAttribute(t)?.match(/\S+/g)??[]}var N1=200,od=class{constructor(t,e){this._letterKeyStream=new Te,this._items=[],this._selectedItemIndex=-1,this._pressedLetters=[],this._selectedItem=new Te,this.selectedItem=this._selectedItem;let n=typeof e?.debounceInterval=="number"?e.debounceInterval:N1;e?.skipPredicate&&(this._skipPredicateFn=e.skipPredicate),this.setItems(t),this._setupKeyHandler(n)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(t){this._selectedItemIndex=t}setItems(t){this._items=t}handleKey(t){let e=t.keyCode;t.key&&t.key.length===1?this._letterKeyStream.next(t.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(t){this._letterKeyStream.pipe(Ee(e=>this._pressedLetters.push(e)),Pr(t),st(()=>this._pressedLetters.length>0),Ve(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(e=>{for(let n=1;n<this._items.length+1;n++){let r=(this._selectedItemIndex+n)%this._items.length,o=this._items[r];if(!this._skipPredicateFn?.(o)&&o.getLabel?.().toLocaleUpperCase().trim().indexOf(e)===0){this._selectedItem.next(o);break}}this._pressedLetters=[]})}},il=class{constructor(t,e){this._items=t,this._activeItemIndex=-1,this._activeItem=B(null),this._wrap=!1,this._typeaheadSubscription=ei.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._pageUpAndDown={enabled:!1,delta:10},this._skipPredicateFn=n=>n.disabled,this.tabOut=new Te,this.change=new Te,t instanceof Dn?this._itemChangesSubscription=t.changes.subscribe(n=>this._itemsChanged(n.toArray())):Lc(t)&&(this._effectRef=an(()=>this._itemsChanged(t()),{injector:e}))}skipPredicate(t){return this._skipPredicateFn=t,this}withWrap(t=!0){return this._wrap=t,this}withVerticalOrientation(t=!0){return this._vertical=t,this}withHorizontalOrientation(t){return this._horizontal=t,this}withAllowedModifierKeys(t){return this._allowedModifierKeys=t,this}withTypeAhead(t=200){this._typeaheadSubscription.unsubscribe();let e=this._getItemsArray();return this._typeahead=new od(e,{debounceInterval:typeof t=="number"?t:void 0,skipPredicate:n=>this._skipPredicateFn(n)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(n=>{this.setActiveItem(n)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(t=!0){return this._homeAndEnd=t,this}withPageUpDown(t=!0,e=10){return this._pageUpAndDown={enabled:t,delta:e},this}setActiveItem(t){let e=this._activeItem();this.updateActiveItem(t),this._activeItem()!==e&&this.change.next(this._activeItemIndex)}onKeydown(t){let e=t.keyCode,r=["altKey","ctrlKey","metaKey","shiftKey"].every(o=>!t[o]||this._allowedModifierKeys.indexOf(o)>-1);switch(e){case 9:this.tabOut.next();return;case 40:if(this._vertical&&r){this.setNextItemActive();break}else return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}else return;case 39:if(this._horizontal&&r){this._horizontal==="rtl"?this.setPreviousItemActive():this.setNextItemActive();break}else return;case 37:if(this._horizontal&&r){this._horizontal==="rtl"?this.setNextItemActive():this.setPreviousItemActive();break}else return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}else return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}else return;case 33:if(this._pageUpAndDown.enabled&&r){let o=this._activeItemIndex-this._pageUpAndDown.delta;this._setActiveItemByIndex(o>0?o:0,1);break}else return;case 34:if(this._pageUpAndDown.enabled&&r){let o=this._activeItemIndex+this._pageUpAndDown.delta,a=this._getItemsArray().length;this._setActiveItemByIndex(o<a?o:a-1,-1);break}else return;default:(r||Yi(t,"shiftKey"))&&this._typeahead?.handleKey(t);return}this._typeahead?.reset(),t.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem()}isTyping(){return!!this._typeahead&&this._typeahead.isTyping()}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._getItemsArray().length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(t){let e=this._getItemsArray(),n=typeof t=="number"?t:e.indexOf(t),r=e[n];this._activeItem.set(r??null),this._activeItemIndex=n,this._typeahead?.setCurrentSelectedItemIndex(n)}destroy(){this._typeaheadSubscription.unsubscribe(),this._itemChangesSubscription?.unsubscribe(),this._effectRef?.destroy(),this._typeahead?.destroy(),this.tabOut.complete(),this.change.complete()}_setActiveItemByDelta(t){this._wrap?this._setActiveInWrapMode(t):this._setActiveInDefaultMode(t)}_setActiveInWrapMode(t){let e=this._getItemsArray();for(let n=1;n<=e.length;n++){let r=(this._activeItemIndex+t*n+e.length)%e.length,o=e[r];if(!this._skipPredicateFn(o)){this.setActiveItem(r);return}}}_setActiveInDefaultMode(t){this._setActiveItemByIndex(this._activeItemIndex+t,t)}_setActiveItemByIndex(t,e){let n=this._getItemsArray();if(n[t]){for(;this._skipPredicateFn(n[t]);)if(t+=e,!n[t])return;this.setActiveItem(t)}}_getItemsArray(){return Lc(this._items)?this._items():this._items instanceof Dn?this._items.toArray():this._items}_itemsChanged(t){this._typeahead?.setItems(t);let e=this._activeItem();if(e){let n=t.indexOf(e);n>-1&&n!==this._activeItemIndex&&(this._activeItemIndex=n,this._typeahead?.setCurrentSelectedItemIndex(n))}}},nl=class extends il{setActiveItem(t){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(t),this.activeItem&&this.activeItem.setActiveStyles()}},rl=class extends il{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(t){return this._origin=t,this}setActiveItem(t){super.setActiveItem(t),this.activeItem&&this.activeItem.focus(this._origin)}};function cd(i){return i.buttons===0||i.detail===0}function dd(i){let t=i.touches&&i.touches[0]||i.changedTouches&&i.changedTouches[0];return!!t&&t.identifier===-1&&(t.radiusX==null||t.radiusX===1)&&(t.radiusY==null||t.radiusY===1)}var z1=new Ge("cdk-input-modality-detector-options"),L1={ignoreKeys:[18,17,224,91,16]},ff=650,Kr=Gr({passive:!0,capture:!0}),j1=(()=>{class i{get mostRecentModality(){return this._modality.value}constructor(e,n,r,o){this._platform=e,this._mostRecentTarget=null,this._modality=new Do(null),this._lastTouchMs=0,this._onKeydown=a=>{this._options?.ignoreKeys?.some(s=>s===a.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ui(a))},this._onMousedown=a=>{Date.now()-this._lastTouchMs<ff||(this._modality.next(cd(a)?"keyboard":"mouse"),this._mostRecentTarget=ui(a))},this._onTouchstart=a=>{if(dd(a)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ui(a)},this._options=_(_({},L1),o),this.modalityDetected=this._modality.pipe(ms(1)),this.modalityChanged=this.modalityDetected.pipe(ko()),e.isBrowser&&n.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,Kr),r.addEventListener("mousedown",this._onMousedown,Kr),r.addEventListener("touchstart",this._onTouchstart,Kr)})}ngOnDestroy(){this._modality.complete(),this._platform.isBrowser&&(document.removeEventListener("keydown",this._onKeydown,Kr),document.removeEventListener("mousedown",this._onMousedown,Kr),document.removeEventListener("touchstart",this._onTouchstart,Kr))}static{this.\u0275fac=function(n){return new(n||i)(U(lt),U(We),U(Le),U(z1,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var tl=function(i){return i[i.IMMEDIATE=0]="IMMEDIATE",i[i.EVENTUAL=1]="EVENTUAL",i}(tl||{}),H1=new Ge("cdk-focus-monitor-default-options"),el=Gr({passive:!0,capture:!0}),gf=(()=>{class i{constructor(e,n,r,o,a){this._ngZone=e,this._platform=n,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=window.setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new Te,this._rootNodeFocusAndBlurListener=s=>{let l=ui(s);for(let c=l;c;c=c.parentElement)s.type==="focus"?this._onFocus(s,c):this._onBlur(s,c)},this._document=o,this._detectionMode=a?.detectionMode||tl.IMMEDIATE}monitor(e,n=!1){let r=ln(e);if(!this._platform.isBrowser||r.nodeType!==1)return wt();let o=Zm(r)||this._getDocument(),a=this._elementInfo.get(r);if(a)return n&&(a.checkChildren=!0),a.subject;let s={checkChildren:n,subject:new Te,rootNode:o};return this._elementInfo.set(r,s),this._registerGlobalListeners(s),s.subject}stopMonitoring(e){let n=ln(e),r=this._elementInfo.get(n);r&&(r.subject.complete(),this._setClasses(n),this._elementInfo.delete(n),this._removeGlobalListeners(r))}focusVia(e,n,r){let o=ln(e),a=this._getDocument().activeElement;o===a?this._getClosestElementsInfo(o).forEach(([s,l])=>this._originChanged(s,n,l)):(this._setOrigin(n),typeof o.focus=="function"&&o.focus(r))}ngOnDestroy(){this._elementInfo.forEach((e,n)=>this.stopMonitoring(n))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_getFocusOrigin(e){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(e)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:e&&this._isLastInteractionFromInputLabel(e)?"mouse":"program"}_shouldBeAttributedToTouch(e){return this._detectionMode===tl.EVENTUAL||!!e?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(e,n){e.classList.toggle("cdk-focused",!!n),e.classList.toggle("cdk-touch-focused",n==="touch"),e.classList.toggle("cdk-keyboard-focused",n==="keyboard"),e.classList.toggle("cdk-mouse-focused",n==="mouse"),e.classList.toggle("cdk-program-focused",n==="program")}_setOrigin(e,n=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=e,this._originFromTouchInteraction=e==="touch"&&n,this._detectionMode===tl.IMMEDIATE){clearTimeout(this._originTimeoutId);let r=this._originFromTouchInteraction?ff:1;this._originTimeoutId=setTimeout(()=>this._origin=null,r)}})}_onFocus(e,n){let r=this._elementInfo.get(n),o=ui(e);!r||!r.checkChildren&&n!==o||this._originChanged(n,this._getFocusOrigin(o),r)}_onBlur(e,n){let r=this._elementInfo.get(n);!r||r.checkChildren&&e.relatedTarget instanceof Node&&n.contains(e.relatedTarget)||(this._setClasses(n),this._emitOrigin(r,null))}_emitOrigin(e,n){e.subject.observers.length&&this._ngZone.run(()=>e.subject.next(n))}_registerGlobalListeners(e){if(!this._platform.isBrowser)return;let n=e.rootNode,r=this._rootNodeFocusListenerCount.get(n)||0;r||this._ngZone.runOutsideAngular(()=>{n.addEventListener("focus",this._rootNodeFocusAndBlurListener,el),n.addEventListener("blur",this._rootNodeFocusAndBlurListener,el)}),this._rootNodeFocusListenerCount.set(n,r+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(ti(this._stopInputModalityDetector)).subscribe(o=>{this._setOrigin(o,!0)}))}_removeGlobalListeners(e){let n=e.rootNode;if(this._rootNodeFocusListenerCount.has(n)){let r=this._rootNodeFocusListenerCount.get(n);r>1?this._rootNodeFocusListenerCount.set(n,r-1):(n.removeEventListener("focus",this._rootNodeFocusAndBlurListener,el),n.removeEventListener("blur",this._rootNodeFocusAndBlurListener,el),this._rootNodeFocusListenerCount.delete(n))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(e,n,r){this._setClasses(e,n),this._emitOrigin(r,n),this._lastFocusOrigin=n}_getClosestElementsInfo(e){let n=[];return this._elementInfo.forEach((r,o)=>{(o===e||r.checkChildren&&o.contains(e))&&n.push([o,r])}),n}_isLastInteractionFromInputLabel(e){let{_mostRecentTarget:n,mostRecentModality:r}=this._inputModalityDetector;if(r!=="mouse"||!n||n===e||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"||e.disabled)return!1;let o=e.labels;if(o){for(let a=0;a<o.length;a++)if(o[a].contains(n))return!0}return!1}static{this.\u0275fac=function(n){return new(n||i)(U(We),U(lt),U(j1),U(Le,8),U(H1,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Xn=function(i){return i[i.NONE=0]="NONE",i[i.BLACK_ON_WHITE=1]="BLACK_ON_WHITE",i[i.WHITE_ON_BLACK=2]="WHITE_ON_BLACK",i}(Xn||{}),pf="cdk-high-contrast-black-on-white",uf="cdk-high-contrast-white-on-black",rd="cdk-high-contrast-active",bf=(()=>{class i{constructor(e,n){this._platform=e,this._document=n,this._breakpointSubscription=O(Js).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return Xn.NONE;let e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);let n=this._document.defaultView||window,r=n&&n.getComputedStyle?n.getComputedStyle(e):null,o=(r&&r.backgroundColor||"").replace(/ /g,"");switch(e.remove(),o){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return Xn.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return Xn.BLACK_ON_WHITE}return Xn.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){let e=this._document.body.classList;e.remove(rd,pf,uf),this._hasCheckedHighContrastMode=!0;let n=this.getHighContrastMode();n===Xn.BLACK_ON_WHITE?e.add(rd,pf):n===Xn.WHITE_ON_BLACK&&e.add(rd,uf)}}static{this.\u0275fac=function(n){return new(n||i)(U(lt),U(Le))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var U1=["text"],W1=[[["mat-icon"]],"*"],$1=["mat-icon","*"];function q1(i,t){if(i&1&&J(0,"mat-pseudo-checkbox",1),i&2){let e=S();C("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function G1(i,t){if(i&1&&J(0,"mat-pseudo-checkbox",3),i&2){let e=S();C("disabled",e.disabled)}}function Y1(i,t){if(i&1&&(h(0,"span",4),b(1),m()),i&2){let e=S();f(),Ht("(",e.group.label,")")}}function X1(){return!0}var K1=new Ge("mat-sanity-checks",{providedIn:"root",factory:X1}),rt=(()=>{class i{constructor(e,n,r){this._sanityChecks=n,this._document=r,this._hasDoneGlobalChecks=!1,e._applyBodyHighContrastModeCssClasses(),this._hasDoneGlobalChecks||(this._hasDoneGlobalChecks=!0)}_checkIsEnabled(e){return Vo()?!1:typeof this._sanityChecks=="boolean"?this._sanityChecks:!!this._sanityChecks[e]}static{this.\u0275fac=function(n){return new(n||i)(U(bf),U(K1,8),U(Le))}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[ki,ki]})}}return i})();var qo=(()=>{class i{isErrorState(e,n){return!!(e&&e.invalid&&(e.touched||n&&n.submitted))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ti=function(i){return i[i.FADING_IN=0]="FADING_IN",i[i.VISIBLE=1]="VISIBLE",i[i.FADING_OUT=2]="FADING_OUT",i[i.HIDDEN=3]="HIDDEN",i}(Ti||{}),pd=class{constructor(t,e,n,r=!1){this._renderer=t,this.element=e,this.config=n,this._animationForciblyDisabledThroughCss=r,this.state=Ti.HIDDEN}fadeOut(){this._renderer.fadeOutRipple(this)}},_f=Gr({passive:!0,capture:!0}),ud=class{constructor(){this._events=new Map,this._delegateEventHandler=t=>{let e=ui(t);e&&this._events.get(t.type)?.forEach((n,r)=>{(r===e||r.contains(e))&&n.forEach(o=>o.handleEvent(t))})}}addHandler(t,e,n,r){let o=this._events.get(e);if(o){let a=o.get(n);a?a.add(r):o.set(n,new Set([r]))}else this._events.set(e,new Map([[n,new Set([r])]])),t.runOutsideAngular(()=>{document.addEventListener(e,this._delegateEventHandler,_f)})}removeHandler(t,e,n){let r=this._events.get(t);if(!r)return;let o=r.get(e);o&&(o.delete(n),o.size===0&&r.delete(e),r.size===0&&(this._events.delete(t),document.removeEventListener(t,this._delegateEventHandler,_f)))}},yf={enterDuration:225,exitDuration:150},Q1=800,wf=Gr({passive:!0,capture:!0}),xf=["mousedown","touchstart"],Cf=["mouseup","mouseleave","touchend","touchcancel"],hd=class i{static{this._eventManager=new ud}constructor(t,e,n,r){this._target=t,this._ngZone=e,this._platform=r,this._isPointerDown=!1,this._activeRipples=new Map,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=ln(n))}fadeInRipple(t,e,n={}){let r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o=_(_({},yf),n.animation);n.centered&&(t=r.left+r.width/2,e=r.top+r.height/2);let a=n.radius||Z1(t,e,r),s=t-r.left,l=e-r.top,c=o.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=`${s-a}px`,d.style.top=`${l-a}px`,d.style.height=`${a*2}px`,d.style.width=`${a*2}px`,n.color!=null&&(d.style.backgroundColor=n.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d);let p=window.getComputedStyle(d),v=p.transitionProperty,g=p.transitionDuration,w=v==="none"||g==="0s"||g==="0s, 0s"||r.width===0&&r.height===0,E=new pd(this,d,n,w);d.style.transform="scale3d(1, 1, 1)",E.state=Ti.FADING_IN,n.persistent||(this._mostRecentTransientRipple=E);let L=null;return!w&&(c||o.exitDuration)&&this._ngZone.runOutsideAngular(()=>{let F=()=>{L&&(L.fallbackTimer=null),clearTimeout(he),this._finishRippleTransition(E)},G=()=>this._destroyRipple(E),he=setTimeout(G,c+100);d.addEventListener("transitionend",F),d.addEventListener("transitioncancel",G),L={onTransitionEnd:F,onTransitionCancel:G,fallbackTimer:he}}),this._activeRipples.set(E,L),(w||!c)&&this._finishRippleTransition(E),E}fadeOutRipple(t){if(t.state===Ti.FADING_OUT||t.state===Ti.HIDDEN)return;let e=t.element,n=_(_({},yf),t.config.animation);e.style.transitionDuration=`${n.exitDuration}ms`,e.style.opacity="0",t.state=Ti.FADING_OUT,(t._animationForciblyDisabledThroughCss||!n.exitDuration)&&this._finishRippleTransition(t)}fadeOutAll(){this._getActiveRipples().forEach(t=>t.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(t=>{t.config.persistent||t.fadeOut()})}setupTriggerEvents(t){let e=ln(t);!this._platform.isBrowser||!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,xf.forEach(n=>{i._eventManager.addHandler(this._ngZone,n,e,this)}))}handleEvent(t){t.type==="mousedown"?this._onMousedown(t):t.type==="touchstart"?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{Cf.forEach(e=>{this._triggerElement.addEventListener(e,this,wf)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(t){t.state===Ti.FADING_IN?this._startFadeOutTransition(t):t.state===Ti.FADING_OUT&&this._destroyRipple(t)}_startFadeOutTransition(t){let e=t===this._mostRecentTransientRipple,{persistent:n}=t.config;t.state=Ti.VISIBLE,!n&&(!e||!this._isPointerDown)&&t.fadeOut()}_destroyRipple(t){let e=this._activeRipples.get(t)??null;this._activeRipples.delete(t),this._activeRipples.size||(this._containerRect=null),t===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),t.state=Ti.HIDDEN,e!==null&&(t.element.removeEventListener("transitionend",e.onTransitionEnd),t.element.removeEventListener("transitioncancel",e.onTransitionCancel),e.fallbackTimer!==null&&clearTimeout(e.fallbackTimer)),t.element.remove()}_onMousedown(t){let e=cd(t),n=this._lastTouchStartEvent&&Date.now()<this._lastTouchStartEvent+Q1;!this._target.rippleDisabled&&!e&&!n&&(this._isPointerDown=!0,this.fadeInRipple(t.clientX,t.clientY,this._target.rippleConfig))}_onTouchStart(t){if(!this._target.rippleDisabled&&!dd(t)){this._lastTouchStartEvent=Date.now(),this._isPointerDown=!0;let e=t.changedTouches;if(e)for(let n=0;n<e.length;n++)this.fadeInRipple(e[n].clientX,e[n].clientY,this._target.rippleConfig)}}_onPointerUp(){this._isPointerDown&&(this._isPointerDown=!1,this._getActiveRipples().forEach(t=>{let e=t.state===Ti.VISIBLE||t.config.terminateOnPointerUp&&t.state===Ti.FADING_IN;!t.config.persistent&&e&&t.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){let t=this._triggerElement;t&&(xf.forEach(e=>i._eventManager.removeHandler(e,t,this)),this._pointerUpEventsRegistered&&(Cf.forEach(e=>t.removeEventListener(e,this,wf)),this._pointerUpEventsRegistered=!1))}};function Z1(i,t,e){let n=Math.max(Math.abs(i-e.left),Math.abs(i-e.right)),r=Math.max(Math.abs(t-e.top),Math.abs(t-e.bottom));return Math.sqrt(n*n+r*r)}var J1=new Ge("mat-ripple-global-options"),fd=(()=>{class i{get disabled(){return this._disabled}set disabled(e){e&&this.fadeOutAllNonPersistent(),this._disabled=e,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(e){this._trigger=e,this._setupTriggerEventsIfEnabled()}constructor(e,n,r,o,a){this._elementRef=e,this._animationMode=a,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=o||{},this._rippleRenderer=new hd(this,n,e,r)}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:_(_(_({},this._globalOptions.animation),this._animationMode==="NoopAnimations"?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(e,n=0,r){return typeof e=="number"?this._rippleRenderer.fadeInRipple(e,n,_(_({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,_(_({},this.rippleConfig),e))}static{this.\u0275fac=function(n){return new(n||i)(W(Ce),W(We),W(lt),W(J1,8),W(Ir,8))}}static{this.\u0275dir=Ue({type:i,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(n,r){n&2&&Ze("mat-ripple-unbounded",r.unbounded)},inputs:{color:[0,"matRippleColor","color"],unbounded:[0,"matRippleUnbounded","unbounded"],centered:[0,"matRippleCentered","centered"],radius:[0,"matRippleRadius","radius"],animation:[0,"matRippleAnimation","animation"],disabled:[0,"matRippleDisabled","disabled"],trigger:[0,"matRippleTrigger","trigger"]},exportAs:["matRipple"],standalone:!0})}}return i})(),Go=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,rt]})}}return i})(),ew=(()=>{class i{constructor(e){this._animationMode=e,this.state="unchecked",this.disabled=!1,this.appearance="full"}static{this.\u0275fac=function(n){return new(n||i)(W(Ir,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(n,r){n&2&&Ze("mat-pseudo-checkbox-indeterminate",r.state==="indeterminate")("mat-pseudo-checkbox-checked",r.state==="checked")("mat-pseudo-checkbox-disabled",r.disabled)("mat-pseudo-checkbox-minimal",r.appearance==="minimal")("mat-pseudo-checkbox-full",r.appearance==="full")("_mat-animation-noopable",r._animationMode==="NoopAnimations")},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},standalone:!0,features:[fe],decls:0,vars:0,template:function(n,r){},styles:['.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color, var(--mat-app-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color)}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color, var(--mat-app-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color, var(--mat-app-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color, var(--mat-app-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color, var(--mat-app-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}'],encapsulation:2,changeDetection:0})}}return i})(),tw=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt]})}}return i})(),gd=new Ge("MAT_OPTION_PARENT_COMPONENT");var bd=new Ge("MatOptgroup");var iw=0,Wo=class{constructor(t,e=!1){this.source=t,this.isUserInput=e}},sl=(()=>{class i{get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(e){this._disabled=e}get disableRipple(){return!!(this._parent&&this._parent.disableRipple)}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}constructor(e,n,r,o){this._element=e,this._changeDetectorRef=n,this._parent=r,this.group=o,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id=`mat-option-${iw++}`,this.onSelectionChange=new He,this._stateChanges=new Te}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,n){let r=this._getHostElement();typeof r.focus=="function"&&r.focus(n)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!Yi(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new Wo(this,e))}static{this.\u0275fac=function(n){return new(n||i)(W(Ce),W(It),W(gd,8),W(bd,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-option"]],viewQuery:function(n,r){if(n&1&&ut(U1,7),n&2){let o;Fe(o=Ae())&&(r._text=o.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(n,r){n&1&&N("click",function(){return r._selectViaInteraction()})("keydown",function(a){return r._handleKeydown(a)}),n&2&&(Tr("id",r.id),qe("aria-selected",r.selected)("aria-disabled",r.disabled.toString()),Ze("mdc-list-item--selected",r.selected)("mat-mdc-option-multiple",r.multiple)("mat-mdc-option-active",r.active)("mdc-list-item--disabled",r.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",xt]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],standalone:!0,features:[Lt,fe],ngContentSelectors:$1,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(n,r){n&1&&(jt(W1),H(0,q1,1,2,"mat-pseudo-checkbox",1),At(1),h(2,"span",2,0),At(4,1),m(),H(5,G1,1,1,"mat-pseudo-checkbox",3)(6,Y1,2,1,"span",4),J(7,"div",5)),n&2&&(ae(r.multiple?0:-1),f(5),ae(!r.multiple&&r.selected&&!r.hideSingleSelectionIndicator?5:-1),f(),ae(r.group&&r.group._inert?6:-1),f(),C("matRippleTrigger",r._getHostElement())("matRippleDisabled",r.disabled||r.disableRipple))},dependencies:[ew,fd],styles:['.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-app-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-app-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-app-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-app-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-app-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-app-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color)}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color);outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-app-on-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-app-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-app-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}.cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{right:auto;left:16px}.mat-mdc-option-multiple{--mdc-list-list-item-selected-container-color:var(--mdc-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-mdc-focus-indicator::before{content:""}'],encapsulation:2,changeDetection:0})}}return i})();function Sf(i,t,e){if(e.length){let n=t.toArray(),r=e.toArray(),o=0;for(let a=0;a<i+1;a++)n[a].group&&n[a].group===r[o]&&o++;return o}return 0}function Pf(i,t,e,n){return i<e?i:i+t>e+n?Math.max(0,i-n+t):e}var vd=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[Go,rt,tw]})}}return i})();var nw=20,If=(()=>{class i{constructor(e,n,r){this._ngZone=e,this._platform=n,this._scrolled=new Te,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let n=this.scrollContainers.get(e);n&&(n.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=nw){return this._platform.isBrowser?new Ft(n=>{this._globalSubscription||this._addGlobalListener();let r=e>0?this._scrolled.pipe(Oc(e)).subscribe(n):this._scrolled.subscribe(n);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):wt()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((e,n)=>this.deregister(n)),this._scrolled.complete()}ancestorScrolled(e,n){let r=this.getAncestorScrollContainers(e);return this.scrolled(n).pipe(st(o=>!o||r.indexOf(o)>-1))}getAncestorScrollContainers(e){let n=[];return this.scrollContainers.forEach((r,o)=>{this._scrollableContainsElement(o,e)&&n.push(o)}),n}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(e,n){let r=ln(n),o=e.getElementRef().nativeElement;do if(r==o)return!0;while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>{let e=this._getWindow();return Hn(e.document,"scroll").subscribe(()=>this._scrolled.next())})}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}static{this.\u0275fac=function(n){return new(n||i)(U(We),U(lt),U(Le,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var rw=20,Yo=(()=>{class i{constructor(e,n,r){this._platform=e,this._change=new Te,this._changeListener=o=>{this._change.next(o)},this._document=r,n.runOutsideAngular(()=>{if(e.isBrowser){let o=this._getWindow();o.addEventListener("resize",this._changeListener),o.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:n,height:r}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+r,right:e.left+n,height:r,width:n}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,n=this._getWindow(),r=e.documentElement,o=r.getBoundingClientRect(),a=-o.top||e.body.scrollTop||n.scrollY||r.scrollTop||0,s=-o.left||e.body.scrollLeft||n.scrollX||r.scrollLeft||0;return{top:a,left:s}}change(e=rw){return e>0?this._change.pipe(Oc(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static{this.\u0275fac=function(n){return new(n||i)(U(lt),U(We),U(Le,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ll=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})(),_d=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[ki,ll,ki,ll]})}}return i})();var kf=Qm(),yd=class{constructor(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=ct(-this._previousScrollPosition.left),t.style.top=ct(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,n=t.style,r=e.style,o=n.scrollBehavior||"",a=r.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),kf&&(n.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),kf&&(n.scrollBehavior=o,r.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.body,n=this._viewportRuler.getViewportSize();return e.scrollHeight>n.height||e.scrollWidth>n.width}};var wd=class{constructor(t,e,n,r){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(st(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},cl=class{enable(){}disable(){}attach(){}};function xd(i,t){return t.some(e=>{let n=i.bottom<e.top,r=i.top>e.bottom,o=i.right<e.left,a=i.left>e.right;return n||r||o||a})}function Tf(i,t){return t.some(e=>{let n=i.top<e.top,r=i.bottom>e.bottom,o=i.left<e.left,a=i.right>e.right;return n||r||o||a})}var Cd=class{constructor(t,e,n,r){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=r,this._scrollSubscription=null}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:n,height:r}=this._viewportRuler.getViewportSize();xd(e,[{width:n,height:r,bottom:r,right:n,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},ow=(()=>{class i{constructor(e,n,r,o){this._scrollDispatcher=e,this._viewportRuler=n,this._ngZone=r,this.noop=()=>new cl,this.close=a=>new wd(this._scrollDispatcher,this._ngZone,this._viewportRuler,a),this.block=()=>new yd(this._viewportRuler,this._document),this.reposition=a=>new Cd(this._scrollDispatcher,this._viewportRuler,this._ngZone,a),this._document=o}static{this.\u0275fac=function(n){return new(n||i)(U(If),U(Yo),U(We),U(Le))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Xo=class{constructor(t){if(this.scrollStrategy=new cl,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){let e=Object.keys(t);for(let n of e)t[n]!==void 0&&(this[n]=t[n])}}};var Sd=class{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var Bf=(()=>{class i{constructor(e){this._attachedOverlays=[],this._document=e}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let n=this._attachedOverlays.indexOf(e);n>-1&&this._attachedOverlays.splice(n,1),this._attachedOverlays.length===0&&this.detach()}static{this.\u0275fac=function(n){return new(n||i)(U(Le))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),aw=(()=>{class i extends Bf{constructor(e,n){super(e),this._ngZone=n,this._keydownListener=r=>{let o=this._attachedOverlays;for(let a=o.length-1;a>-1;a--)if(o[a]._keydownEvents.observers.length>0){let s=o[a]._keydownEvents;this._ngZone?this._ngZone.run(()=>s.next(r)):s.next(r);break}}}add(e){super.add(e),this._isAttached||(this._ngZone?this._ngZone.runOutsideAngular(()=>this._document.body.addEventListener("keydown",this._keydownListener)):this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}static{this.\u0275fac=function(n){return new(n||i)(U(Le),U(We,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),sw=(()=>{class i extends Bf{constructor(e,n,r){super(e),this._platform=n,this._ngZone=r,this._cursorStyleIsSet=!1,this._pointerDownListener=o=>{this._pointerDownEventTarget=ui(o)},this._clickListener=o=>{let a=ui(o),s=o.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:a;this._pointerDownEventTarget=null;let l=this._attachedOverlays.slice();for(let c=l.length-1;c>-1;c--){let d=l[c];if(d._outsidePointerEvents.observers.length<1||!d.hasAttached())continue;if(Mf(d.overlayElement,a)||Mf(d.overlayElement,s))break;let p=d._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>p.next(o)):p.next(o)}}}add(e){if(super.add(e),!this._isAttached){let n=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(n)):this._addEventListeners(n),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){let e=this._document.body;e.removeEventListener("pointerdown",this._pointerDownListener,!0),e.removeEventListener("click",this._clickListener,!0),e.removeEventListener("auxclick",this._clickListener,!0),e.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(e.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(e){e.addEventListener("pointerdown",this._pointerDownListener,!0),e.addEventListener("click",this._clickListener,!0),e.addEventListener("auxclick",this._clickListener,!0),e.addEventListener("contextmenu",this._clickListener,!0)}static{this.\u0275fac=function(n){return new(n||i)(U(Le),U(lt),U(We,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function Mf(i,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,n=t;for(;n;){if(n===i)return!0;n=e&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}var Nf=(()=>{class i{constructor(e,n){this._platform=n,this._document=e}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||Vo()){let r=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let o=0;o<r.length;o++)r[o].remove()}let n=this._document.createElement("div");n.classList.add(e),Vo()?n.setAttribute("platform","test"):this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._containerElement=n}static{this.\u0275fac=function(n){return new(n||i)(U(Le),U(lt))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Pd=class{constructor(t,e,n,r,o,a,s,l,c,d=!1,p){this._portalOutlet=t,this._host=e,this._pane=n,this._config=r,this._ngZone=o,this._keyboardDispatcher=a,this._document=s,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=d,this._injector=p,this._backdropElement=null,this._backdropClick=new Te,this._attachments=new Te,this._detachments=new Te,this._locationChanges=ei.EMPTY,this._backdropClickHandler=v=>this._backdropClick.next(v),this._backdropTransitionendHandler=v=>{this._disposeBackdrop(v.target)},this._keydownEvents=new Te,this._outsidePointerEvents=new Te,this._renders=new Te,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy,this._afterRenderRef=fm(()=>jc(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Oo(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._disposeBackdrop(this._backdropElement),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=null,t&&this._detachments.next(),this._detachments.complete(),this._afterRenderRef.destroy(),this._renders.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=_(_({},this._config),t),this._updateElementSize()}setDirection(t){this._config=k(_({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=ct(this._config.width),t.height=ct(this._config.height),t.minWidth=ct(this._config.minWidth),t.minHeight=ct(this._config.minHeight),t.maxWidth=ct(this._config.maxWidth),t.maxHeight=ct(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._animationsDisabled&&this._backdropElement.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(t)})}):this._backdropElement.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let t=this._backdropElement;if(t){if(this._animationsDisabled){this._disposeBackdrop(t);return}t.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{t.addEventListener("transitionend",this._backdropTransitionendHandler)}),t.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(()=>{this._disposeBackdrop(t)},500))}}_toggleClasses(t,e,n){let r=Xr(e||[]).filter(o=>!!o);r.length&&(n?t.classList.add(...r):t.classList.remove(...r))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{let t=this._renders.pipe(ti(Vn(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),t.unsubscribe())})})}_disposeScrollStrategy(){let t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}_disposeBackdrop(t){t&&(t.removeEventListener("click",this._backdropClickHandler),t.removeEventListener("transitionend",this._backdropTransitionendHandler),t.remove(),this._backdropElement===t&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}},Of="cdk-overlay-connected-position-bounding-box",lw=/([A-Za-z%]+)$/,Ed=class{get positions(){return this._preferredPositions}constructor(t,e,n,r,o){this._viewportRuler=e,this._document=n,this._platform=r,this._overlayContainer=o,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new Te,this._resizeSubscription=ei.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Of),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._originRect,e=this._overlayRect,n=this._viewportRect,r=this._containerRect,o=[],a;for(let s of this._preferredPositions){let l=this._getOriginPoint(t,r,s),c=this._getOverlayPoint(l,e,s),d=this._getOverlayFit(c,e,n,s);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(s,l);return}if(this._canFitWithFlexibleDimensions(d,c,n)){o.push({position:s,origin:l,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(l,s)});continue}(!a||a.overlayFit.visibleArea<d.visibleArea)&&(a={overlayFit:d,overlayPoint:c,originPoint:l,position:s,overlayRect:e})}if(o.length){let s=null,l=-1;for(let c of o){let d=c.boundingBoxRect.width*c.boundingBoxRect.height*(c.position.weight||1);d>l&&(l=d,s=c)}this._isPushed=!1,this._applyPosition(s.position,s.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Kn(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Of),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,n){let r;if(n.originX=="center")r=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,s=this._isRtl()?t.left:t.right;r=n.originX=="start"?a:s}e.left<0&&(r-=e.left);let o;return n.originY=="center"?o=t.top+t.height/2:o=n.originY=="top"?t.top:t.bottom,e.top<0&&(o-=e.top),{x:r,y:o}}_getOverlayPoint(t,e,n){let r;n.overlayX=="center"?r=-e.width/2:n.overlayX==="start"?r=this._isRtl()?-e.width:0:r=this._isRtl()?0:-e.width;let o;return n.overlayY=="center"?o=-e.height/2:o=n.overlayY=="top"?0:-e.height,{x:t.x+r,y:t.y+o}}_getOverlayFit(t,e,n,r){let o=Af(e),{x:a,y:s}=t,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(a+=l),c&&(s+=c);let d=0-a,p=a+o.width-n.width,v=0-s,g=s+o.height-n.height,w=this._subtractOverflows(o.width,d,p),E=this._subtractOverflows(o.height,v,g),L=w*E;return{visibleArea:L,isCompletelyWithinViewport:o.width*o.height===L,fitsInViewportVertically:E===o.height,fitsInViewportHorizontally:w==o.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){let r=n.bottom-e.y,o=n.right-e.x,a=Ff(this._overlayRef.getConfig().minHeight),s=Ff(this._overlayRef.getConfig().minWidth),l=t.fitsInViewportVertically||a!=null&&a<=r,c=t.fitsInViewportHorizontally||s!=null&&s<=o;return l&&c}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let r=Af(e),o=this._viewportRect,a=Math.max(t.x+r.width-o.width,0),s=Math.max(t.y+r.height-o.height,0),l=Math.max(o.top-n.top-t.y,0),c=Math.max(o.left-n.left-t.x,0),d=0,p=0;return r.width<=o.width?d=c||-a:d=t.x<this._viewportMargin?o.left-n.left-t.x:0,r.height<=o.height?p=l||-s:p=t.y<this._viewportMargin?o.top-n.top-t.y:0,this._previousPushAmount={x:d,y:p},{x:t.x+d,y:t.y+p}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let n=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!cw(this._lastScrollVisibility,n)){let r=new Sd(t,n);this._positionChanges.next(r)}this._lastScrollVisibility=n}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),n,r=t.overlayY;t.overlayX==="center"?n="center":this._isRtl()?n=t.overlayX==="start"?"right":"left":n=t.overlayX==="start"?"left":"right";for(let o=0;o<e.length;o++)e[o].style.transformOrigin=`${n} ${r}`}_calculateBoundingBoxRect(t,e){let n=this._viewportRect,r=this._isRtl(),o,a,s;if(e.overlayY==="top")a=t.y,o=n.height-a+this._viewportMargin;else if(e.overlayY==="bottom")s=n.height-t.y+this._viewportMargin*2,o=n.height-s+this._viewportMargin;else{let g=Math.min(n.bottom-t.y+n.top,t.y),w=this._lastBoundingBoxSize.height;o=g*2,a=t.y-g,o>w&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-w/2)}let l=e.overlayX==="start"&&!r||e.overlayX==="end"&&r,c=e.overlayX==="end"&&!r||e.overlayX==="start"&&r,d,p,v;if(c)v=n.width-t.x+this._viewportMargin*2,d=t.x-this._viewportMargin;else if(l)p=t.x,d=n.right-t.x;else{let g=Math.min(n.right-t.x+n.left,t.x),w=this._lastBoundingBoxSize.width;d=g*2,p=t.x-g,d>w&&!this._isInitialRender&&!this._growAfterOpen&&(p=t.x-w/2)}return{top:a,left:p,bottom:s,right:v,width:d,height:o}}_setBoundingBoxStyles(t,e){let n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));let r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{let o=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;r.height=ct(n.height),r.top=ct(n.top),r.bottom=ct(n.bottom),r.width=ct(n.width),r.left=ct(n.left),r.right=ct(n.right),e.overlayX==="center"?r.alignItems="center":r.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?r.justifyContent="center":r.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",o&&(r.maxHeight=ct(o)),a&&(r.maxWidth=ct(a))}this._lastBoundingBoxSize=n,Kn(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Kn(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Kn(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let n={},r=this._hasExactPosition(),o=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(r){let d=this._viewportRuler.getViewportScrollPosition();Kn(n,this._getExactOverlayY(e,t,d)),Kn(n,this._getExactOverlayX(e,t,d))}else n.position="static";let s="",l=this._getOffset(e,"x"),c=this._getOffset(e,"y");l&&(s+=`translateX(${l}px) `),c&&(s+=`translateY(${c}px)`),n.transform=s.trim(),a.maxHeight&&(r?n.maxHeight=ct(a.maxHeight):o&&(n.maxHeight="")),a.maxWidth&&(r?n.maxWidth=ct(a.maxWidth):o&&(n.maxWidth="")),Kn(this._pane.style,n)}_getExactOverlayY(t,e,n){let r={top:"",bottom:""},o=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;r.bottom=`${a-(o.y+this._overlayRect.height)}px`}else r.top=ct(o.y);return r}_getExactOverlayX(t,e,n){let r={left:"",right:""},o=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let s=this._document.documentElement.clientWidth;r.right=`${s-(o.x+this._overlayRect.width)}px`}else r.left=ct(o.x);return r}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Tf(t,n),isOriginOutsideView:xd(t,n),isOverlayClipped:Tf(e,n),isOverlayOutsideView:xd(e,n)}}_subtractOverflows(t,...e){return e.reduce((n,r)=>n-Math.max(r,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+t-this._viewportMargin,bottom:n.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&Xr(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){let t=this._origin;if(t instanceof Ce)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}};function Kn(i,t){for(let e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i}function Ff(i){if(typeof i!="number"&&i!=null){let[t,e]=i.split(lw);return!e||e==="px"?parseFloat(t):null}return i||null}function Af(i){return{top:Math.floor(i.top),right:Math.floor(i.right),bottom:Math.floor(i.bottom),left:Math.floor(i.left),width:Math.floor(i.width),height:Math.floor(i.height)}}function cw(i,t){return i===t?!0:i.isOriginClipped===t.isOriginClipped&&i.isOriginOutsideView===t.isOriginOutsideView&&i.isOverlayClipped===t.isOverlayClipped&&i.isOverlayOutsideView===t.isOverlayOutsideView}var Rf="cdk-global-overlay-wrapper",Id=class{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Rf),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:r,height:o,maxWidth:a,maxHeight:s}=n,l=(r==="100%"||r==="100vw")&&(!a||a==="100%"||a==="100vw"),c=(o==="100%"||o==="100vh")&&(!s||s==="100%"||s==="100vh"),d=this._xPosition,p=this._xOffset,v=this._overlayRef.getConfig().direction==="rtl",g="",w="",E="";l?E="flex-start":d==="center"?(E="center",v?w=p:g=p):v?d==="left"||d==="end"?(E="flex-end",g=p):(d==="right"||d==="start")&&(E="flex-start",w=p):d==="left"||d==="start"?(E="flex-start",g=p):(d==="right"||d==="end")&&(E="flex-end",w=p),t.position=this._cssPosition,t.marginLeft=l?"0":g,t.marginTop=c?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=l?"0":w,e.justifyContent=E,e.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(Rf),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},dw=(()=>{class i{constructor(e,n,r,o){this._viewportRuler=e,this._document=n,this._platform=r,this._overlayContainer=o}global(){return new Id}flexibleConnectedTo(e){return new Ed(e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static{this.\u0275fac=function(n){return new(n||i)(U(Yo),U(Le),U(lt),U(Nf))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),pw=0,An=(()=>{class i{constructor(e,n,r,o,a,s,l,c,d,p,v,g){this.scrollStrategies=e,this._overlayContainer=n,this._componentFactoryResolver=r,this._positionBuilder=o,this._keyboardDispatcher=a,this._injector=s,this._ngZone=l,this._document=c,this._directionality=d,this._location=p,this._outsideClickDispatcher=v,this._animationsModuleType=g}create(e){let n=this._createHostElement(),r=this._createPaneElement(n),o=this._createPortalOutlet(r),a=new Xo(e);return a.direction=a.direction||this._directionality.value,new Pd(o,n,r,a,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,this._animationsModuleType==="NoopAnimations",this._injector.get(sm))}position(){return this._positionBuilder}_createPaneElement(e){let n=this._document.createElement("div");return n.id=`cdk-overlay-${pw++}`,n.classList.add("cdk-overlay-pane"),e.appendChild(n),n}_createHostElement(){let e=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(e),e}_createPortalOutlet(e){return this._appRef||(this._appRef=this._injector.get(hm)),new Xs(e,this._componentFactoryResolver,this._appRef,this._injector,this._document)}static{this.\u0275fac=function(n){return new(n||i)(U(ow),U(Nf),U(bs),U(dw),U(aw),U(Ye),U(We),U(Le),U(On),U(ws),U(sw),U(Ir,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var uw=new Ge("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=O(An);return()=>i.scrollStrategies.reposition()}});function hw(i){return()=>i.scrollStrategies.reposition()}var mw={provide:uw,deps:[An],useFactory:hw},zf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({providers:[An,mw],imports:[ki,qr,_d,_d]})}}return i})();var Dd=new Ge("MatFormField");var Qo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,et,sf,rt]})}}return i})();var gw=["panel"],bw=["*"];function vw(i,t){if(i&1){let e=Se();h(0,"div",1,0),N("@panelAnimation.done",function(r){X(e);let o=S();return K(o._animationDone.next(r))}),At(2),m()}if(i&2){let e=t.id,n=S();rn(n._classList),Ze("mat-mdc-autocomplete-visible",n.showPanel)("mat-mdc-autocomplete-hidden",!n.showPanel)("mat-primary",n._color==="primary")("mat-accent",n._color==="accent")("mat-warn",n._color==="warn"),C("id",n.id)("@panelAnimation",n.isOpen?"visible":"hidden"),qe("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(e))}}var _w=Ro("panelAnimation",[sn("void, hidden",Ii({opacity:0,transform:"scaleY(0.8)"})),Nr(":enter, hidden => visible",[Bo([$n("0.03s linear",Ii({opacity:1})),$n("0.12s cubic-bezier(0, 0, 0.2, 1)",Ii({transform:"scaleY(1)"}))])]),Nr(":leave, visible => hidden",[$n("0.075s linear",Ii({opacity:0}))])]),yw=0,kd=class{constructor(t,e){this.source=t,this.option=e}},jf=new Ge("mat-autocomplete-default-options",{providedIn:"root",factory:ww});function ww(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var Hf=(()=>{class i{get isOpen(){return this._isOpen&&this.showPanel}_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}set classList(e){this._classList=e,this._elementRef.nativeElement.className=""}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}constructor(e,n,r,o){this._changeDetectorRef=e,this._elementRef=n,this._defaults=r,this._activeOptionChanges=ei.EMPTY,this._animationDone=new He,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new He,this.opened=new He,this.closed=new He,this.optionActivated=new He,this.id=`mat-autocomplete-${yw++}`,this.inertGroups=o?.SAFARI||!1,this.autoActiveFirstOption=!!r.autoActiveFirstOption,this.autoSelectActiveOption=!!r.autoSelectActiveOption,this.requireSelection=!!r.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new nl(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(e){let n=new kd(this,e);this.optionSelected.emit(n)}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let n=e?e+" ":"";return this.ariaLabelledby?n+this.ariaLabelledby:e}_skipPredicate(){return!1}static{this.\u0275fac=function(n){return new(n||i)(W(It),W(Ce),W(jf),W(lt))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(n,r,o){if(n&1&&(Et(o,sl,5),Et(o,bd,5)),n&2){let a;Fe(a=Ae())&&(r.options=a),Fe(a=Ae())&&(r.optionGroups=a)}},viewQuery:function(n,r){if(n&1&&(ut(ci,7),ut(gw,5)),n&2){let o;Fe(o=Ae())&&(r.template=o.first),Fe(o=Ae())&&(r.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",xt],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",xt],requireSelection:[2,"requireSelection","requireSelection",xt],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",xt],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",xt]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],standalone:!0,features:[di([{provide:gd,useExisting:i}]),Lt,fe],ngContentSelectors:bw,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(n,r){n&1&&(jt(),H(0,vw,3,16,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-app-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color, var(--mat-app-surface-container))}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],encapsulation:2,data:{animation:[_w]},changeDetection:0})}}return i})();var xw={provide:wm,useExisting:Er(()=>Td),multi:!0};var Vf=new Ge("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=O(An);return()=>i.scrollStrategies.reposition()}});function Cw(i){return()=>i.scrollStrategies.reposition()}var Sw={provide:Vf,deps:[An],useFactory:Cw},Td=(()=>{class i{constructor(e,n,r,o,a,s,l,c,d,p,v){this._element=e,this._overlay=n,this._viewContainerRef=r,this._zone=o,this._changeDetectorRef=a,this._dir=l,this._formField=c,this._document=d,this._viewportRuler=p,this._defaults=v,this._componentDestroyed=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=ei.EMPTY,this._breakpointObserver=O(Js),this._handsetLandscapeSubscription=ei.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new Te,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._initialized=new Te,this._injector=O(Ye),this._aboveClass="mat-mdc-autocomplete-panel-above",this._overlayAttached=!1,this.optionSelections=nm(()=>{let g=this.autocomplete?this.autocomplete.options:null;return g?g.changes.pipe(Ai(g),Ri(()=>Vn(...g.map(w=>w.onSelectionChange)))):this._initialized.pipe(Ri(()=>this.optionSelections))}),this._handlePanelKeydown=g=>{(g.keyCode===27&&!Yi(g)||g.keyCode===38&&Yi(g,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),g.stopPropagation(),g.preventDefault())},this._trackedModal=null,this._scrollStrategy=s}ngAfterViewInit(){this._initialized.next(),this._initialized.complete();let e=this._getWindow();typeof e<"u"&&this._zone.runOutsideAngular(()=>e.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){let e=this._getWindow();typeof e<"u"&&e.removeEventListener("blur",this._windowBlurHandler),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&al(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Vn(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(st(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(st(()=>this._overlayAttached)):wt()).pipe(Ve(e=>e instanceof Wo?e:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Vn(Hn(this._document,"click"),Hn(this._document,"auxclick"),Hn(this._document,"touchend")).pipe(st(e=>{let n=ui(e),r=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,o=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&n!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!r||!r.contains(n))&&(!o||!o.contains(n))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(n)}))}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){let n=e.keyCode,r=Yi(e);if(n===27&&!r&&e.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&n===13&&this.panelOpen&&!r)this.activeOption._selectViaInteraction(),this._resetActiveItem(),e.preventDefault();else if(this.autocomplete){let o=this.autocomplete._keyManager.activeItem,a=n===38||n===40;n===9||a&&!r&&this.panelOpen?this.autocomplete._keyManager.onKeydown(e):a&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(a||this.autocomplete._keyManager.activeItem!==o)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let n=e.target,r=n.value;if(n.type==="number"&&(r=r==""?null:parseFloat(r)),this._previousValue!==r){if(this._previousValue=r,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(r),!r)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(a=>a.selected);if(o){let a=this._getDisplayValue(o.value);r!==a&&o.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===e.target){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_floatLabel(e=!1){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let e=new Ft(r=>{Oo(()=>{r.next()},{injector:this._injector})}),n=this.autocomplete.options.changes.pipe(Ee(()=>this._positionStrategy.reapplyLastPosition()),rm(0));return Vn(e,n).pipe(Ri(()=>this._zone.run(()=>{let r=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),r!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),In(1)).subscribe(r=>this._setValueAndClose(r))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){let n=this.autocomplete;return n&&n.displayWith?n.displayWith(e):e}_assignOptionValue(e){let n=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(n??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){let n=this.autocomplete,r=e?e.source:this._pendingAutoselectedOption;r?(this._clearPreviousSelectedOption(r),this._assignOptionValue(r.value),this._onChange(r.value),n._emitSelectEvent(r),this._element.nativeElement.focus()):n.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),n._animationDone?n._animationDone.pipe(In(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,n){this.autocomplete?.options?.forEach(r=>{r!==e&&r.selected&&r.deselect(n)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let n=this.autocomplete.id;ld(this._trackedModal,"aria-owns",n)}}_attachOverlay(e){this.autocomplete;let n=this._overlayRef;n?(this._positionStrategy.setOrigin(this._getConnectedElement()),n.updateSize({width:this._getPanelWidth()})):(this._portal=new Fn(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),n=this._overlay.create(this._getOverlayConfig()),this._overlayRef=n,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&n&&n.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(df.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),n&&!n.hasAttached()&&(n.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let r=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&r!==this.panelOpen&&this._emitOpened()}_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Xo({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let e=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let n=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],r=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:r},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:r}],a;this.position==="above"?a=o:this.position==="below"?a=n:a=[...n,...o],e.withPositions(a)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let n=-1;for(let r=0;r<e.options.length;r++)if(!e.options.get(r).disabled){n=r;break}e._keyManager.setActiveItem(n)}else e._keyManager.setActiveItem(-1)}_canOpen(){let e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_getWindow(){return this._document?.defaultView||window}_scrollToOption(e){let n=this.autocomplete,r=Sf(e,n.options,n.optionGroups);if(e===0&&r===1)n._setScrollTop(0);else if(n.panel){let o=n.options.toArray()[e];if(o){let a=o._getHostElement(),s=Pf(a.offsetTop,a.offsetHeight,n._getScrollTop(),n.panel.nativeElement.offsetHeight);n._setScrollTop(s)}}}_applyModalPanelOwnership(){let e=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let n=this.autocomplete.id;this._trackedModal&&al(this._trackedModal,"aria-owns",n),ld(e,"aria-owns",n),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;al(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static{this.\u0275fac=function(n){return new(n||i)(W(Ce),W(An),W(kn),W(We),W(It),W(Vf),W(On,8),W(Dd,9),W(Le,8),W(Yo),W(jf,8))}}static{this.\u0275dir=Ue({type:i,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(n,r){n&1&&N("focusin",function(){return r._handleFocus()})("blur",function(){return r._onTouched()})("input",function(a){return r._handleInput(a)})("keydown",function(a){return r._handleKeydown(a)})("click",function(){return r._handleClick()}),n&2&&qe("autocomplete",r.autocompleteAttribute)("role",r.autocompleteDisabled?null:"combobox")("aria-autocomplete",r.autocompleteDisabled?null:"list")("aria-activedescendant",r.panelOpen&&r.activeOption?r.activeOption.id:null)("aria-expanded",r.autocompleteDisabled?null:r.panelOpen.toString())("aria-controls",r.autocompleteDisabled||!r.panelOpen||r.autocomplete==null?null:r.autocomplete.id)("aria-haspopup",r.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",xt]},exportAs:["matAutocompleteTrigger"],standalone:!0,features:[di([xw]),Lt,$t]})}}return i})(),Uf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({providers:[Sw],imports:[zf,vd,rt,et,ll,vd,rt]})}}return i})();var Md={dashboard:{View:"DashV"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Void:"ShiftVo"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetail:"ContD",ContactImageEditor:"ContE",ContactSensitiveField:"ConSF",Supplier:"Supp"},sell:{Create:"Sell",PricebookSelector:"PricebS",Edit:"SellE",Delete:"SellD",Number:"NumE",SalesPerson:"SalesmanE",Return:"Return",Discount:"Disc",UnitPriceEditor:"UnitPE",Commission:"Comms",Tax:"Tax",CustomerInputLock:"CustL",Payment:"PayR",PriceVisible:"PriceV",PriceMinimum:"PriceM",Email:"Email",DeleteItem:"DelItm",Shipping:"Ship",PaymentCodeLock:"PayCL",EraseVoidOrd:"EraseVO",RestoreVoidOrd:"RestVO",RetrieveR:"RetrieveR",BundlingPrice:"BundlP",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CredSL",CouponInputLock:"CouponInputLock",Park:"Park"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",Print:"OrdRpr",NoteEditor:"OrdNe",Invoice:"OrdIr",Erase:"EraseVO"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrinting:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense",CommissionView:"CommV",ProductSensitiveField:"ProdSF",Price:"PriceV"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",ShippingRestriction:"BuySh",Approval:"PurA",Report:"BuyR"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UseG",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export",Number:"NumE",Date:"DateE"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"},developer:{Api:"API",View:"Dev",Edit:"DevE"}};var Wf=(()=>{class i{constructor(){this._roles=[],this.parseJWTRoles()}parseJWTRoles(){let e=localStorage.getItem("Token");if(e){var n=qc(e);this._roles=n["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"],console.log(this._roles)}}isInRole(e,n){let r={};return n.forEach((o,a)=>r[e[a]]=typeof o=="string"?this._roles.includes(o):o(this._roles)),r}isUserHasRole(e){return this._roles.includes(e)}get product(){return this._product||(this._product=this.setBulkRole("product")),this._product}get contact(){return this._contact||(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return this._promotion||(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return this._accounting||(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return this._users||(this._users=this.setBulkRole("users")),this._users}get outlets(){return this._outlets||(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return this._setup||(this._setup=this.setBulkRole("setup")),this._setup}get service(){return this._service||(this._service=this.setBulkRole("service")),this._service}get profile(){return this._profile||(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return this._customerDisplay||(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return this._orderDisplay||(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return this._global||(this._global=this.setBulkRole("global")),this._global}get apps(){return this._apps||(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return this._fulfillment||(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return this._manufacture||(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return this._inventory||(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return this._sell||(this._sell=this.setBulkRole("sell")),this._sell}get report(){return this._report||(this._report=this.setBulkRole("report")),this._report}get buy(){return this._buy||(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return this._adjustment||(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return this._debt||(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return this._payment||(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return this._prepaidPackage||(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return this._order||(this._order=this.setBulkRole("orders")),this._order}get logistic(){return this._logistic||(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return this._estimate||(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return this._shift||(this._shift=this.setBulkRole("shift")),this._shift}get developer(){return this._developer||(this._developer=this.setBulkRole("developer")),this._developer}get dashboard(){return this._dashboard||(this._dashboard=this.setBulkRole("dashboard")),this._dashboard}setBulkRole(e){let n={};for(let r in Md[e])n[r]=this.isUserHasRole(Md[e][r]);return n}get isSystemUser(){let e=localStorage.getItem("Token");return qc(e).Type=="System"}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null,this._developer=null,this._dashboard=null}toJSON(){return{product:this.product,contact:this.contact,promotion:this.promotion,accounting:this.accounting,users:this.users,outlets:this.outlets,setup:this.setup,service:this.service,profile:this.profile,customerDisplay:this.customerDisplay,orderDisplay:this.orderDisplay,global:this.global,apps:this.apps,fulfillment:this.fulfillment,manufacture:this.manufacture,inventory:this.inventory,sell:this.sell,report:this.report,buy:this.buy,adjustment:this.adjustment,debt:this.debt,payment:this.payment,prepaidPackage:this.prepaidPackage,order:this.order,logistic:this.logistic,estimate:this.estimate,shift:this.shift,developer:this.developer,dashboard:this.dashboard}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var dl=()=>{let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16;return e=(i+e)%16|0,i=Math.floor(i/16),(t==="x"?e:e&3|8).toString(16)})};var $f=(i,t)=>t.PromotionID;function Ew(i,t){if(i&1&&(h(0,"mat-option",19)(1,"div",20)(2,"span",21),b(3),m(),h(4,"span",22),b(5),m()()()),i&2){let e=t.$implicit;C("value",e),f(3),P(e.Value),f(2),P(e.Code)}}function Iw(i,t){if(i&1&&St(0,Ew,6,3,"mat-option",19,kr),i&2){let e=S();Pt(e.variantSuggestion())}}function Dw(i,t){i&1&&(h(0,"mat-option",12),b(1,"No items found"),m()),i&2&&C("disabled",!0)}function kw(i,t){if(i&1){let e=Se();h(0,"div",23)(1,"img",24),N("error",function(r){X(e);let o=S();return K(o.onErrorImage(r))}),m(),h(2,"div",25)(3,"ngb-highlight",26),b(4),m(),h(5,"span"),b(6),m()()()}if(i&2){let e=t.result,n=t.term;f(),C("src",e.ImgUrl,Un)("alt",e.Value),f(2),C("result",e.Value)("term",n),f(),P(e.Value),f(2),P(e.Code)}}function Tw(i,t){if(i&1&&(h(0,"ng-option",28),b(1),m()),i&2){let e=t.$implicit;C("value",e.PromotionID),f(),P(e.Name)}}function Mw(i,t){if(i&1&&(h(0,"ng-select",27),St(1,Tw,2,2,"ng-option",28,$f),m()),i&2){let e=S(2);f(),Pt(e.promotionPrice())}}function Ow(i,t){if(i&1&&(h(0,"ng-option",28),b(1),m()),i&2){let e=t.$implicit;C("value",e),f(),P(e.Name)}}function Fw(i,t){if(i&1&&(h(0,"ng-select",27),St(1,Ow,2,2,"ng-option",28,$f),m()),i&2){let e=S(2);f(),Pt(e.promotionPrice())}}function Aw(i,t){if(i&1&&(h(0,"div",13)(1,"label",9),b(2,"Promotion Price"),m(),H(3,Mw,3,0,"ng-select",27)(4,Fw,3,0,"ng-select",27),m()),i&2){let e=S();f(3),ae(e.isEditProduct()?3:4)}}function Rw(i,t){if(i&1){let e=Se();h(0,"button",29),N("click",function(){X(e);let r=S();return K(r.resetForm())}),b(1," Cancel "),m()}}var ul=(()=>{class i{displayFn(e){return e?e.Value:""}constructor(){this.productSelected=cm(null),this.isEditProduct=B(!1),this.variant=B(null),this.promotionPrice=B([]),this.domain="",this.printMode=B("barcode"),this.httpService=O($i),this.fb=O(Wi),this.router=O(Ei),this.storeService=O(Re),this.roleService=O(Wf),this.route=O(Ui),this.location=O(ws),this.maskitoOptions=$r({precision:2,thousandSeparator:","}),this.variantSuggestion=B([]),an(()=>{let e=this.productSelected();if(this.isEditProduct.set(!!e),!e){this.resetForm();return}this.loadVariantAndPromotion(e)},{allowSignalWrites:!0})}ngOnInit(){this.initForm(),this.setupPromotionPriceWatcher(),this.setupVariantSuggestion()}ngAfterViewInit(){this.domain=`https://${localStorage.getItem("Domain")}`,this.printMode.set(localStorage.getItem("PrintMode")??"barcode")}initForm(){this.form=this.fb.group({name:new kt("",mt.required),quantity:new kt("",mt.required),promotionPrice:new kt(null),price:new kt("",mt.required)})}patchFormFromVariant(e,n,r){if(!r)return;let o=n?.find(a=>a.PromotionID.toLowerCase()===r.Promotions?.PromotionID?.toLowerCase())??null;this.form.patchValue({name:{Value:e.Name},quantity:r.Quantity,price:r.UnitPrice??e.UnitPrice,promotionPrice:o?o.PromotionID:null}),this.form.get("name")?.disable(),o&&this.form.get("price")?.disable()}setupVariantSuggestion(){this.form.get("name").valueChanges.pipe(Pr(200),ko(),Ri(e=>e?.length>2?this.httpService.post("/API/AC/GetVariantSuggestionByCodeNName",{count:100,prefix:e},void 0,`https://${localStorage.getItem("Domain")}`):wt([]))).subscribe(e=>this.variantSuggestion.set(e))}setupPromotionPriceWatcher(){this.form.get("promotionPrice")?.valueChanges.pipe().subscribe(e=>{this.variant()?.UnitPrice&&(e?(this.form.patchValue({price:+this.variant().UnitPrice}),this.form.get("price")?.disable()):this.form.get("price")?.enable())})}loadVariantAndPromotion(e){let n=this.storeService.productItems().find(a=>a.Uuid===e);if(!n)return;let r={EntityID:"00000000-0000-0000-0000-000000000000",ID:n.VariantID??n.ID},o={VariantID:r.ID};this.httpService.post("/API/V3/Variant/ID",r,void 0,this.domain).subscribe(a=>{this.variant.set(a),this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",o,void 0,this.domain).pipe(En(()=>wt([]))).subscribe(s=>{this.promotionPrice.set(s),this.patchFormFromVariant(a,s,n)})})}onOptionSelected(e){if(!e.option.value?.Key)return;let n=e.option.value.Key;if(this.printMode()==="barcode")this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",{VariantID:n},void 0,this.domain).pipe(En(()=>wt([]))).subscribe(r=>this.promotionPrice.set(r)):this.promotionPrice.set([]);else{let r={headers:new Pi({"Content-Type":"application/json",promotions_field_include:"true"})};this.httpService.post("/api/v3/Variant/ID",{ID:n},r,this.domain).pipe(Ve(o=>o.Promotions),En(()=>wt([]))).subscribe(o=>this.promotionPrice.set(o))}this.httpService.post("/API/V3/Variant/ID",{EntityID:"00000000-0000-0000-0000-000000000000",ID:n},void 0,this.domain).subscribe(r=>{this.variant.set(k(_({},r),{Uuid:dl()})),this.form.patchValue({price:r.UnitPrice,quantity:1,promotionPrice:null})})}onSubmit(){let{quantity:e,promotionPrice:n,price:r}=this.form.getRawValue(),o=+e.toString().replace(/,/g,""),a=+r.toString().replace(/,/g,"");if(this.isEditProduct()){let s=this.promotionPrice();if(!this.variant())return;let c=[...this.storeService.productItems()],d=c.findIndex(v=>v.Uuid===this.productSelected());if(d===-1)return;let p=s?.find(v=>v.PromotionID.toLowerCase()===n?.toLowerCase())??null;c[d]=k(_({},c[d]),{Quantity:o,Promotions:p??n,UnitPrice:a,checked:!1}),this.storeService.onChangeProductItems(c),this.resetForm()}else{let s=this.variant();if(!s)return;let l=k(_({},s),{Quantity:o,Promotions:n,UnitPrice:a}),c=[...this.storeService.productItems(),l];this.storeService.onChangeProductItems(c),this.resetForm()}}resetForm(){this.form.reset(),this.form.enable(),this.promotionPrice.set([]),this.variant.set(null),this.productSelected.set(null),this.router.navigate([],{relativeTo:this.route,queryParams:{id:null},queryParamsHandling:"merge"})}onErrorImage(e){e.target.src="assets/images/image-404.svg"}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["modal-choose-product"]],inputs:{productSelected:[1,"productSelected"]},outputs:{productSelected:"productSelectedChange"},standalone:!0,features:[fe],decls:30,vars:10,consts:[["auto","matAutocomplete"],["rt",""],[1,"card","mb-3","w-100","p-0"],[1,"card-header","px-0"],[1,"text-dark","fw-medium","font-robotoslab",2,"margin","0.6rem 0","font-size","16px"],[1,"card-body","px-0","py-0","pt-4"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"form-group","d-flex","flex-column","position-relative"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["type","text","formControlName","name",1,"form-control","form-control-lg","fs-3",3,"matAutocomplete"],["autoActiveFirstOption","",3,"optionSelected","displayWith"],[1,"fs-2",3,"disabled"],[1,"form-group"],["type","text","formControlName","quantity",1,"form-control","form-control-lg","fs-3",3,"maskito"],["type","text","formControlName","price",1,"form-control","form-control-lg","fs-3",3,"maskito"],[1,"d-flex","gap-4"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary"],["type","button",1,"flex","flex-grow-1","btn","btn-success",3,"click","disabled"],[1,"fs-2",3,"value"],[1,"d-flex","flex-column"],[1,"fs-2"],[1,"opacity-75",2,"font-size","11px"],[1,"d-flex","w-100","overflow-x-hidden","gap-2"],[1,"me-1",2,"width","42px","height","42px",3,"error","src","alt"],[1,"flex-grow-1","d-flex","flex-column","flex-wrap"],[3,"result","term"],["formControlName","promotionPrice","placeholder","Select Promotion Price",1,"custom","fs-3"],[1,"fs-3",3,"value"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary",3,"click"]],template:function(n,r){if(n&1){let o=Se();h(0,"div",2)(1,"div",3)(2,"span",4),b(3),m()(),h(4,"div",5)(5,"div",6)(6,"form",7)(7,"div",8)(8,"label",9),b(9,"Name"),m(),J(10,"input",10),h(11,"mat-autocomplete",11,0),N("optionSelected",function(s){return X(o),K(r.onOptionSelected(s))}),H(13,Iw,2,0)(14,Dw,2,1,"mat-option",12),m(),H(15,kw,7,6,"ng-template",null,1,we),m(),h(17,"div",13)(18,"label",9),b(19,"Quantity"),m(),J(20,"input",14),m(),h(21,"div",13)(22,"label",9),b(23,"Price"),m(),J(24,"input",15),m(),H(25,Aw,5,1,"div",13),h(26,"div",16),H(27,Rw,2,0,"button",17),h(28,"button",18),N("click",function(){return X(o),K(r.onSubmit())}),b(29," Submit "),m()()()()()()}if(n&2){let o=Wn(12);f(3),Ht("",r.productSelected()?"Update":"Add"," Product"),f(3),C("formGroup",r.form),f(4),C("matAutocomplete",o),f(),C("displayWith",r.displayFn),f(2),ae(r.variantSuggestion().length>0?13:14),f(7),C("maskito",r.maskitoOptions),f(4),C("maskito",r.maskitoOptions),f(),ae(r.promotionPrice().length?25:-1),f(2),ae(r.isEditProduct()?27:-1),f(),C("disabled",r.form.invalid)}},dependencies:[Ps,Di,qi,Hs,bt,Is,ht,ft,Es,Ds,ks,Em,Gi,Zs,Uf,Hf,sl,Td],styles:[".mat-mdc-autocomplete-panel{background-color:#fff!important} .mat-mdc-autocomplete-panel>.mat-mdc-option.mdc-list-item--disabled{min-height:34px}"]})}}return i})();var qf=(()=>{class i{constructor(){this.transactionType=B([{title:"Supplier Bill",type:0},{title:"Transfer Order",type:1}]),this.storeService=O(Re),this.fb=O(Wi),this.activeModal=O(Ls)}get outlets(){return this.storeService.paperConfig().Outlets}initForm(){this.form=this.fb.group({type:new kt("",[mt.required]),outlet:new kt("",[mt.required]),number:new kt("",[mt.required])})}ngOnInit(){this.initForm()}onOK(){this.activeModal.close({role:"ok",data:this.form.value})}onClose(){this.activeModal.dismiss({role:"close",data:null})}onPaste(e){e.preventDefault();let n=e.clipboardData;if(n){let r=n.getData("text").trim(),o=e.target;o.value=r,this.form.patchValue({number:o.value})}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-dialog-load-transaction"]],standalone:!0,features:[fe],decls:14,vars:4,consts:[["title","Choose your transaction",3,"onOK","onClose","hasValid"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"form-group"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["formControlName","type","bindLabel","title","bindValue","type","placeholder","Choose Type",1,"custom","fs-2",3,"items"],["formControlName","outlet","bindLabel","Name","bindValue","Name","placeholder","Choose Outlet",1,"custom","fs-2",3,"items"],["formControlName","number","type","text",1,"form-control","fs-2",2,"height","32px",3,"paste"]],template:function(n,r){n&1&&(h(0,"app-base-modal",0),N("onOK",function(){return r.onOK()})("onClose",function(){return r.onClose()}),h(1,"form",1)(2,"div",2)(3,"label",3),b(4,"Choose Type"),m(),J(5,"ng-select",4),m(),h(6,"div",2)(7,"label",3),b(8,"Choose Outlet"),m(),J(9,"ng-select",5),m(),h(10,"div",2)(11,"label",3),b(12,"Invoice Number"),m(),h(13,"input",6),N("paste",function(a){return r.onPaste(a)}),m()()()()),n&2&&(C("hasValid",r.form.valid),f(),C("formGroup",r.form),f(4),C("items",r.transactionType()),f(4),C("items",r.outlets))},dependencies:[js,Di,qi,gt,Is,ht,ft,Es,bt,Ds,ks],changeDetection:0})}}return i})();var Bw=(()=>{class i{constructor(e){this.document=e,this.width=this.getWidth()}getWidth(){let e=this.document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",this.document.body.appendChild(e);let n=e.offsetWidth;e.style.overflow="scroll";let r=this.document.createElement("div");r.style.width="100%",e.appendChild(r);let o=r.offsetWidth;return e.parentNode.removeChild(e),n-o}}return i.\u0275fac=function(e){return new(e||i)(U(Le))},i.\u0275prov=be({token:i,factory:i.\u0275fac}),i})(),Nw=(()=>{class i{getDimensions(e){return e.getBoundingClientRect()}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275prov=be({token:i,factory:i.\u0275fac}),i})(),zw=(()=>{class i{constructor(){this.columnInputChanges=new Te}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275prov=be({token:i,factory:i.\u0275fac}),i})();function Lw(i){return i=i.replace(/[^a-zA-Z0-9 ]/g," "),i=i.replace(/([a-z](?=[A-Z]))/g,"$1 "),i=i.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase(),i=i.replace(/([ 0-9]+)([a-zA-Z])/g,function(t,e,n){return e.trim()+n.toUpperCase()}),i}var hl={},Gf=typeof document<"u"?document.createElement("div").style:void 0,Od=function(){let i=typeof window<"u"?window.getComputedStyle(document.documentElement,""):void 0,t=typeof i<"u"?Array.prototype.slice.call(i).join("").match(/-(moz|webkit|ms)-/):null,e=t!==null?t[1]:void 0,n=typeof e<"u"?"WebKit|Moz|MS|O".match(new RegExp("("+e+")","i"))[1]:void 0;return n?{dom:n,lowercase:e,css:`-${e}-`,js:e[0].toUpperCase()+e.substr(1)}:void 0}();function ml(i){let t=Lw(i);return hl[t]||(Od!==void 0&&Gf[Od.css+i]!==void 0?hl[t]=Od.css+i:Gf[i]!==void 0&&(hl[t]=i)),hl[t]}var iB=typeof window<"u"?ml("transform"):void 0,nB=typeof window<"u"?ml("backfaceVisibility"):void 0,rB=typeof window<"u"?!!ml("transform"):void 0,oB=typeof window<"u"?!!ml("perspective"):void 0,Yf=typeof window<"u"?window.navigator.userAgent:"Chrome",aB=/Safari\//.test(Yf)&&!/Chrome\//.test(Yf);var Xf=(()=>{class i{static forRoot(e){return{ngModule:i,providers:[{provide:"configuration",useValue:e}]}}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ve({providers:[Bw,Nw,zw],imports:[[et]]}),i})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=jw);function jw(i,t){let e=[],n=[],r,o,a;for(;(r=document.elementFromPoint(i,t))&&e.indexOf(r)===-1&&r!=null;)e.push(r),n.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(o=n.length;a=n[--o];)e[o].style.setProperty("pointer-events",a.value?a.value:"",a.priority);return e}var Kf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var Qf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,Qo,Qo,Kf,rt]})}}return i})();var Hw=["*"];function Vw(i,t){i&1&&At(0)}var Fd=(()=>{class i{constructor(e){this._elementRef=e}focus(){this._elementRef.nativeElement.focus()}static{this.\u0275fac=function(n){return new(n||i)(W(Ce))}}static{this.\u0275dir=Ue({type:i,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"],standalone:!0})}}return i})(),Ad=(()=>{class i{constructor(e){this.template=e}static{this.\u0275fac=function(n){return new(n||i)(W(ci))}}static{this.\u0275dir=Ue({type:i,selectors:[["","cdkStepLabel",""]],standalone:!0})}}return i})(),Uw=0;var dn={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},Rd=new Ge("STEPPER_GLOBAL_OPTIONS"),fl=(()=>{class i{get completed(){return this._completedOverride==null?this._getDefaultCompleted():this._completedOverride}set completed(e){this._completedOverride=e}_getDefaultCompleted(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted}get hasError(){return this._customError==null?this._getDefaultError():this._customError}set hasError(e){this._customError=e}_getDefaultError(){return this.stepControl&&this.stepControl.invalid&&this.interacted}constructor(e,n){this._stepper=e,this.interacted=!1,this.interactedStream=new He,this.editable=!0,this.optional=!1,this._completedOverride=null,this._customError=null,this._stepperOptions=n||{},this._displayDefaultIndicatorType=this._stepperOptions.displayDefaultIndicatorType!==!1}select(){this._stepper.selected=this}reset(){this.interacted=!1,this._completedOverride!=null&&(this._completedOverride=!1),this._customError!=null&&(this._customError=!1),this.stepControl&&(this._childForms?.forEach(e=>e.resetForm?.()),this.stepControl.reset())}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this.interacted||(this.interacted=!0,this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??this._customError!=null}static{this.\u0275fac=function(n){return new(n||i)(W(Er(()=>gl)),W(Rd,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["cdk-step"]],contentQueries:function(n,r,o){if(n&1&&(Et(o,Ad,5),Et(o,xm,5)),n&2){let a;Fe(a=Ae())&&(r.stepLabel=a.first),Fe(a=Ae())&&(r._childForms=a)}},viewQuery:function(n,r){if(n&1&&ut(ci,7),n&2){let o;Fe(o=Ae())&&(r.content=o.first)}},inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],state:"state",editable:[2,"editable","editable",xt],optional:[2,"optional","optional",xt],completed:[2,"completed","completed",xt],hasError:[2,"hasError","hasError",xt]},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],standalone:!0,features:[Lt,$t,fe],ngContentSelectors:Hw,decls:1,vars:0,template:function(n,r){n&1&&(jt(),H(0,Vw,1,0,"ng-template"))},encapsulation:2,changeDetection:0})}}return i})(),gl=(()=>{class i{get selectedIndex(){return this._selectedIndex}set selectedIndex(e){this.steps&&this._steps?(this._isValidIndex(e),this.selected?._markAsInteracted(),this._selectedIndex!==e&&!this._anyControlsInvalidOrPending(e)&&(e>=this._selectedIndex||this.steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e)):this._selectedIndex=e}get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=e&&this.steps?this.steps.toArray().indexOf(e):-1}get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._keyManager&&this._keyManager.withVerticalOrientation(e==="vertical")}constructor(e,n,r){this._dir=e,this._changeDetectorRef=n,this._elementRef=r,this._destroyed=new Te,this.steps=new Dn,this._sortedHeaders=new Dn,this.linear=!1,this._selectedIndex=0,this.selectionChange=new He,this.selectedIndexChange=new He,this._orientation="horizontal",this._groupId=Uw++}ngAfterContentInit(){this._steps.changes.pipe(Ai(this._steps),ti(this._destroyed)).subscribe(e=>{this.steps.reset(e.filter(n=>n._stepper===this)),this.steps.notifyOnChanges()})}ngAfterViewInit(){this._stepHeader.changes.pipe(Ai(this._stepHeader),ti(this._destroyed)).subscribe(e=>{this._sortedHeaders.reset(e.toArray().sort((n,r)=>n._elementRef.nativeElement.compareDocumentPosition(r._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new rl(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation(this._orientation==="vertical"),(this._dir?this._dir.change:wt()).pipe(Ai(this._layoutDirection()),ti(this._destroyed)).subscribe(e=>this._keyManager.withHorizontalOrientation(e)),this._keyManager.updateActiveItem(this._selectedIndex),this.steps.changes.subscribe(()=>{this.selected||(this._selectedIndex=Math.max(this._selectedIndex-1,0))}),this._isValidIndex(this._selectedIndex)||(this._selectedIndex=0)}ngOnDestroy(){this._keyManager?.destroy(),this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(e=>e.reset()),this._stateChanged()}_getStepLabelId(e){return`cdk-step-label-${this._groupId}-${e}`}_getStepContentId(e){return`cdk-step-content-${this._groupId}-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){let n=e-this._selectedIndex;return n<0?this._layoutDirection()==="rtl"?"next":"previous":n>0?this._layoutDirection()==="rtl"?"previous":"next":"current"}_getIndicatorType(e,n=dn.NUMBER){let r=this.steps.toArray()[e],o=this._isCurrentStep(e);return r._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(r,o):this._getGuidelineLogic(r,o,n)}_getDefaultIndicatorLogic(e,n){return e._showError()&&e.hasError&&!n?dn.ERROR:!e.completed||n?dn.NUMBER:e.editable?dn.EDIT:dn.DONE}_getGuidelineLogic(e,n,r=dn.NUMBER){return e._showError()&&e.hasError&&!n?dn.ERROR:e.completed&&!n?dn.DONE:e.completed&&n?r:e.editable&&n?dn.EDIT:r}_isCurrentStep(e){return this._selectedIndex===e}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex}_updateSelectedItemIndex(e){let n=this.steps.toArray();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:this._selectedIndex,selectedStep:n[e],previouslySelectedStep:n[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItem(e),this._selectedIndex=e,this.selectedIndexChange.emit(this._selectedIndex),this._stateChanged()}_onKeydown(e){let n=Yi(e),r=e.keyCode,o=this._keyManager;o.activeItemIndex!=null&&!n&&(r===32||r===13)?(this.selectedIndex=o.activeItemIndex,e.preventDefault()):o.setFocusOrigin("keyboard").onKeydown(e)}_anyControlsInvalidOrPending(e){return this.linear&&e>=0?this.steps.toArray().slice(0,e).some(n=>{let r=n.stepControl;return(r?r.invalid||r.pending||!n.interacted:!n.completed)&&!n.optional&&!n._completedOverride}):!1}_layoutDirection(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}_containsFocus(){let e=this._elementRef.nativeElement,n=nd();return e===n||e.contains(n)}_isValidIndex(e){return e>-1&&(!this.steps||e<this.steps.length)}static{this.\u0275fac=function(n){return new(n||i)(W(On,8),W(It),W(Ce))}}static{this.\u0275dir=Ue({type:i,selectors:[["","cdkStepper",""]],contentQueries:function(n,r,o){if(n&1&&(Et(o,fl,5),Et(o,Fd,5)),n&2){let a;Fe(a=Ae())&&(r._steps=a),Fe(a=Ae())&&(r._stepHeader=a)}},inputs:{linear:[2,"linear","linear",xt],selectedIndex:[2,"selectedIndex","selectedIndex",mm],selected:"selected",orientation:"orientation"},outputs:{selectionChange:"selectionChange",selectedIndexChange:"selectedIndexChange"},exportAs:["cdkStepper"],standalone:!0,features:[Lt]})}}return i})();var Zf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[ki]})}}return i})();var $w=["*"],bl;function qw(){if(bl===void 0&&(bl=null,typeof window<"u")){let i=window;i.trustedTypes!==void 0&&(bl=i.trustedTypes.createPolicy("angular#components",{createHTML:t=>t}))}return bl}function Zo(i){return qw()?.createHTML(i)||i}function Jf(i){return Error(`Unable to find icon with the name "${i}"`)}function Gw(){return Error("Could not find HttpClient for use with Angular Material icons. Please add provideHttpClient() to your providers.")}function eg(i){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${i}".`)}function tg(i){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${i}".`)}var pn=class{constructor(t,e,n){this.url=t,this.svgText=e,this.options=n}},Yw=(()=>{class i{constructor(e,n,r,o){this._httpClient=e,this._sanitizer=n,this._errorHandler=o,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass=["material-icons","mat-ligature-font"],this._document=r}addSvgIcon(e,n,r){return this.addSvgIconInNamespace("",e,n,r)}addSvgIconLiteral(e,n,r){return this.addSvgIconLiteralInNamespace("",e,n,r)}addSvgIconInNamespace(e,n,r,o){return this._addSvgIconConfig(e,n,new pn(r,null,o))}addSvgIconResolver(e){return this._resolvers.push(e),this}addSvgIconLiteralInNamespace(e,n,r,o){let a=this._sanitizer.sanitize(Dr.HTML,r);if(!a)throw tg(r);let s=Zo(a);return this._addSvgIconConfig(e,n,new pn("",s,o))}addSvgIconSet(e,n){return this.addSvgIconSetInNamespace("",e,n)}addSvgIconSetLiteral(e,n){return this.addSvgIconSetLiteralInNamespace("",e,n)}addSvgIconSetInNamespace(e,n,r){return this._addSvgIconSetConfig(e,new pn(n,null,r))}addSvgIconSetLiteralInNamespace(e,n,r){let o=this._sanitizer.sanitize(Dr.HTML,n);if(!o)throw tg(n);let a=Zo(o);return this._addSvgIconSetConfig(e,new pn("",a,r))}registerFontClassAlias(e,n=e){return this._fontCssClassesByAlias.set(e,n),this}classNameForFontAlias(e){return this._fontCssClassesByAlias.get(e)||e}setDefaultFontSetClass(...e){return this._defaultFontSetClass=e,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(e){let n=this._sanitizer.sanitize(Dr.RESOURCE_URL,e);if(!n)throw eg(e);let r=this._cachedIconsByUrl.get(n);return r?wt(vl(r)):this._loadSvgIconFromConfig(new pn(e,null)).pipe(Ee(o=>this._cachedIconsByUrl.set(n,o)),Ve(o=>vl(o)))}getNamedSvgIcon(e,n=""){let r=ig(n,e),o=this._svgIconConfigs.get(r);if(o)return this._getSvgFromConfig(o);if(o=this._getIconConfigFromResolvers(n,e),o)return this._svgIconConfigs.set(r,o),this._getSvgFromConfig(o);let a=this._iconSetConfigs.get(n);return a?this._getSvgFromIconSetConfigs(e,a):us(Jf(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(e){return e.svgText?wt(vl(this._svgElementFromConfig(e))):this._loadSvgIconFromConfig(e).pipe(Ve(n=>vl(n)))}_getSvgFromIconSetConfigs(e,n){let r=this._extractIconWithNameFromAnySet(e,n);if(r)return wt(r);let o=n.filter(a=>!a.svgText).map(a=>this._loadSvgIconSetFromConfig(a).pipe(En(s=>{let c=`Loading icon set URL: ${this._sanitizer.sanitize(Dr.RESOURCE_URL,a.url)} failed: ${s.message}`;return this._errorHandler.handleError(new Error(c)),wt(null)})));return hs(o).pipe(Ve(()=>{let a=this._extractIconWithNameFromAnySet(e,n);if(!a)throw Jf(e);return a}))}_extractIconWithNameFromAnySet(e,n){for(let r=n.length-1;r>=0;r--){let o=n[r];if(o.svgText&&o.svgText.toString().indexOf(e)>-1){let a=this._svgElementFromConfig(o),s=this._extractSvgIconFromSet(a,e,o.options);if(s)return s}}return null}_loadSvgIconFromConfig(e){return this._fetchIcon(e).pipe(Ee(n=>e.svgText=n),Ve(()=>this._svgElementFromConfig(e)))}_loadSvgIconSetFromConfig(e){return e.svgText?wt(null):this._fetchIcon(e).pipe(Ee(n=>e.svgText=n))}_extractSvgIconFromSet(e,n,r){let o=e.querySelector(`[id="${n}"]`);if(!o)return null;let a=o.cloneNode(!0);if(a.removeAttribute("id"),a.nodeName.toLowerCase()==="svg")return this._setSvgAttributes(a,r);if(a.nodeName.toLowerCase()==="symbol")return this._setSvgAttributes(this._toSvgElement(a),r);let s=this._svgElementFromString(Zo("<svg></svg>"));return s.appendChild(a),this._setSvgAttributes(s,r)}_svgElementFromString(e){let n=this._document.createElement("DIV");n.innerHTML=e;let r=n.querySelector("svg");if(!r)throw Error("<svg> tag not found");return r}_toSvgElement(e){let n=this._svgElementFromString(Zo("<svg></svg>")),r=e.attributes;for(let o=0;o<r.length;o++){let{name:a,value:s}=r[o];a!=="id"&&n.setAttribute(a,s)}for(let o=0;o<e.childNodes.length;o++)e.childNodes[o].nodeType===this._document.ELEMENT_NODE&&n.appendChild(e.childNodes[o].cloneNode(!0));return n}_setSvgAttributes(e,n){return e.setAttribute("fit",""),e.setAttribute("height","100%"),e.setAttribute("width","100%"),e.setAttribute("preserveAspectRatio","xMidYMid meet"),e.setAttribute("focusable","false"),n&&n.viewBox&&e.setAttribute("viewBox",n.viewBox),e}_fetchIcon(e){let{url:n,options:r}=e,o=r?.withCredentials??!1;if(!this._httpClient)throw Gw();if(n==null)throw Error(`Cannot fetch icon from URL "${n}".`);let a=this._sanitizer.sanitize(Dr.RESOURCE_URL,n);if(!a)throw eg(n);let s=this._inProgressUrlFetches.get(a);if(s)return s;let l=this._httpClient.get(a,{responseType:"text",withCredentials:o}).pipe(Ve(c=>Zo(c)),om(()=>this._inProgressUrlFetches.delete(a)),am());return this._inProgressUrlFetches.set(a,l),l}_addSvgIconConfig(e,n,r){return this._svgIconConfigs.set(ig(e,n),r),this}_addSvgIconSetConfig(e,n){let r=this._iconSetConfigs.get(e);return r?r.push(n):this._iconSetConfigs.set(e,[n]),this}_svgElementFromConfig(e){if(!e.svgElement){let n=this._svgElementFromString(e.svgText);this._setSvgAttributes(n,e.options),e.svgElement=n}return e.svgElement}_getIconConfigFromResolvers(e,n){for(let r=0;r<this._resolvers.length;r++){let o=this._resolvers[r](n,e);if(o)return Xw(o)?new pn(o.url,null,o.options):new pn(o,null)}}static{this.\u0275fac=function(n){return new(n||i)(U(Ss,8),U(vm),U(Le,8),U(gs))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function vl(i){return i.cloneNode(!0)}function ig(i,t){return i+":"+t}function Xw(i){return!!(i.url&&i.options)}var Kw=new Ge("MAT_ICON_DEFAULT_OPTIONS"),Qw=new Ge("mat-icon-location",{providedIn:"root",factory:Zw});function Zw(){let i=O(Le),t=i?i.location:null;return{getPathname:()=>t?t.pathname+t.search:""}}var ng=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Jw=ng.map(i=>`[${i}]`).join(", "),ex=/^url\(['"]?#(.*?)['"]?\)$/,rg=(()=>{class i{get color(){return this._color||this._defaultColor}set color(e){this._color=e}get svgIcon(){return this._svgIcon}set svgIcon(e){e!==this._svgIcon&&(e?this._updateSvgIcon(e):this._svgIcon&&this._clearSvgElement(),this._svgIcon=e)}get fontSet(){return this._fontSet}set fontSet(e){let n=this._cleanupFontValue(e);n!==this._fontSet&&(this._fontSet=n,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(e){let n=this._cleanupFontValue(e);n!==this._fontIcon&&(this._fontIcon=n,this._updateFontIconClasses())}constructor(e,n,r,o,a,s){this._elementRef=e,this._iconRegistry=n,this._location=o,this._errorHandler=a,this.inline=!1,this._previousFontSetClass=[],this._currentIconFetch=ei.EMPTY,s&&(s.color&&(this.color=this._defaultColor=s.color),s.fontSet&&(this.fontSet=s.fontSet)),r||e.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(e){if(!e)return["",""];let n=e.split(":");switch(n.length){case 1:return["",n[0]];case 2:return n;default:throw Error(`Invalid icon name: "${e}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){let e=this._elementsWithExternalReferences;if(e&&e.size){let n=this._location.getPathname();n!==this._previousPath&&(this._previousPath=n,this._prependPathToReferences(n))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(e){this._clearSvgElement();let n=this._location.getPathname();this._previousPath=n,this._cacheChildrenWithExternalReferences(e),this._prependPathToReferences(n),this._elementRef.nativeElement.appendChild(e)}_clearSvgElement(){let e=this._elementRef.nativeElement,n=e.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();n--;){let r=e.childNodes[n];(r.nodeType!==1||r.nodeName.toLowerCase()==="svg")&&r.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;let e=this._elementRef.nativeElement,n=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(r=>r.length>0);this._previousFontSetClass.forEach(r=>e.classList.remove(r)),n.forEach(r=>e.classList.add(r)),this._previousFontSetClass=n,this.fontIcon!==this._previousFontIconClass&&!n.includes("mat-ligature-font")&&(this._previousFontIconClass&&e.classList.remove(this._previousFontIconClass),this.fontIcon&&e.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(e){return typeof e=="string"?e.trim().split(" ")[0]:e}_prependPathToReferences(e){let n=this._elementsWithExternalReferences;n&&n.forEach((r,o)=>{r.forEach(a=>{o.setAttribute(a.name,`url('${e}#${a.value}')`)})})}_cacheChildrenWithExternalReferences(e){let n=e.querySelectorAll(Jw),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let o=0;o<n.length;o++)ng.forEach(a=>{let s=n[o],l=s.getAttribute(a),c=l?l.match(ex):null;if(c){let d=r.get(s);d||(d=[],r.set(s,d)),d.push({name:a,value:c[1]})}})}_updateSvgIcon(e){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),e){let[n,r]=this._splitIconName(e);n&&(this._svgNamespace=n),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,n).pipe(In(1)).subscribe(o=>this._setSvgElement(o),o=>{let a=`Error retrieving icon ${n}:${r}! ${o.message}`;this._errorHandler.handleError(new Error(a))})}}static{this.\u0275fac=function(n){return new(n||i)(W(Ce),W(Yw),Nc("aria-hidden"),W(Qw),W(gs),W(Kw,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:10,hostBindings:function(n,r){n&2&&(qe("data-mat-icon-type",r._usingFontIcon()?"font":"svg")("data-mat-icon-name",r._svgName||r.fontIcon)("data-mat-icon-namespace",r._svgNamespace||r.fontSet)("fontIcon",r._usingFontIcon()?r.fontIcon:null),rn(r.color?"mat-"+r.color:""),Ze("mat-icon-inline",r.inline)("mat-icon-no-color",r.color!=="primary"&&r.color!=="accent"&&r.color!=="warn"))},inputs:{color:"color",inline:[2,"inline","inline",xt],svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],standalone:!0,features:[Lt,fe],ngContentSelectors:$w,decls:1,vars:0,template:function(n,r){n&1&&(jt(),At(0))},styles:["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],encapsulation:2,changeDetection:0})}}return i})(),og=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,rt]})}}return i})();function tx(i,t){if(i&1&&on(0,2),i&2){let e=S();C("ngTemplateOutlet",e.iconOverrides[e.state])("ngTemplateOutletContext",e._getIconContext())}}function ix(i,t){if(i&1&&(h(0,"span",7),b(1),m()),i&2){let e=S(2);f(),P(e._getDefaultTextForState(e.state))}}function nx(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S(3);f(),P(e._intl.completedLabel)}}function rx(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S(3);f(),P(e._intl.editableLabel)}}function ox(i,t){if(i&1&&(H(0,nx,2,1,"span",8)(1,rx,2,1,"span",8),h(2,"mat-icon",7),b(3),m()),i&2){let e=S(2);ae(e.state==="done"?0:e.state==="edit"?1:-1),f(3),P(e._getDefaultTextForState(e.state))}}function ax(i,t){if(i&1&&H(0,ix,2,1,"span",7)(1,ox,4,2,"mat-icon",7),i&2){let e,n=S();ae((e=n.state)==="number"?0:1)}}function sx(i,t){i&1&&(h(0,"div",4),on(1,9),m()),i&2&&(f(),C("ngTemplateOutlet",t.template))}function lx(i,t){if(i&1&&(h(0,"div",4),b(1),m()),i&2){let e=S();f(),P(e.label)}}function cx(i,t){if(i&1&&(h(0,"div",5),b(1),m()),i&2){let e=S();f(),P(e._intl.optionalLabel)}}function dx(i,t){if(i&1&&(h(0,"div",6),b(1),m()),i&2){let e=S();f(),P(e.errorMessage)}}var sg=["*"];function px(i,t){}function ux(i,t){if(i&1&&(At(0),H(1,px,0,0,"ng-template",0)),i&2){let e=S();f(),C("cdkPortalOutlet",e._portal)}}var lg=(i,t)=>({step:i,i:t}),cg=i=>({animationDuration:i}),dg=(i,t)=>({value:i,params:t});function hx(i,t){i&1&&At(0)}function mx(i,t){i&1&&J(0,"div",6)}function fx(i,t){if(i&1&&(on(0,5),H(1,mx,1,0,"div",6)),i&2){let e=t.$implicit,n=t.$index,r=t.$count;S(2);let o=Wn(4);C("ngTemplateOutlet",o)("ngTemplateOutletContext",Ao(3,lg,e,n)),f(),ae(n!==r-1?1:-1)}}function gx(i,t){if(i&1){let e=Se();h(0,"div",7),N("@horizontalStepTransition.done",function(r){X(e);let o=S(2);return K(o._animationDone.next(r))}),on(1,8),m()}if(i&2){let e=t.$implicit,n=t.$index,r=S(2);Ze("mat-horizontal-stepper-content-inactive",r.selectedIndex!==n),C("@horizontalStepTransition",Ao(8,dg,r._getAnimationDirection(n),ze(6,cg,r._getAnimationDuration())))("id",r._getStepContentId(n)),qe("aria-labelledby",r._getStepLabelId(n)),f(),C("ngTemplateOutlet",e.content)}}function bx(i,t){if(i&1&&(h(0,"div",1)(1,"div",2),St(2,fx,2,6,null,null,Tn),m(),h(4,"div",3),St(5,gx,2,11,"div",4,Tn),m()()),i&2){let e=S();f(2),Pt(e.steps),f(3),Pt(e.steps)}}function vx(i,t){if(i&1){let e=Se();h(0,"div",9),on(1,5),h(2,"div",10)(3,"div",11),N("@verticalStepTransition.done",function(r){X(e);let o=S(2);return K(o._animationDone.next(r))}),h(4,"div",12),on(5,8),m()()()()}if(i&2){let e=t.$implicit,n=t.$index,r=t.$count,o=S(2),a=Wn(4);f(),C("ngTemplateOutlet",a)("ngTemplateOutletContext",Ao(10,lg,e,n)),f(),Ze("mat-stepper-vertical-line",n!==r-1),f(),Ze("mat-vertical-stepper-content-inactive",o.selectedIndex!==n),C("@verticalStepTransition",Ao(15,dg,o._getAnimationDirection(n),ze(13,cg,o._getAnimationDuration())))("id",o._getStepContentId(n)),qe("aria-labelledby",o._getStepLabelId(n)),f(2),C("ngTemplateOutlet",e.content)}}function _x(i,t){if(i&1&&St(0,vx,6,18,"div",9,Tn),i&2){let e=S();Pt(e.steps)}}function yx(i,t){if(i&1){let e=Se();h(0,"mat-step-header",13),N("click",function(){let r=X(e).step;return K(r.select())})("keydown",function(r){X(e);let o=S();return K(o._onKeydown(r))}),m()}if(i&2){let e=t.step,n=t.i,r=S();Ze("mat-horizontal-stepper-header",r.orientation==="horizontal")("mat-vertical-stepper-header",r.orientation==="vertical"),C("tabIndex",r._getFocusIndex()===n?0:-1)("id",r._getStepLabelId(n))("index",n)("state",r._getIndicatorType(n,e.state))("label",e.stepLabel||e.label)("selected",r.selectedIndex===n)("active",r._stepIsNavigable(n,e))("optional",e.optional)("errorMessage",e.errorMessage)("iconOverrides",r._iconOverrides)("disableRipple",r.disableRipple||!r._stepIsNavigable(n,e))("color",e.color||r.color),qe("aria-posinset",n+1)("aria-setsize",r.steps.length)("aria-controls",r._getStepContentId(n))("aria-selected",r.selectedIndex==n)("aria-label",e.ariaLabel||null)("aria-labelledby",!e.ariaLabel&&e.ariaLabelledby?e.ariaLabelledby:null)("aria-disabled",r._stepIsNavigable(n,e)?null:!0)}}var Jo=(()=>{class i extends Ad{static{this.\u0275fac=(()=>{let e;return function(r){return(e||(e=Bc(i)))(r||i)}})()}static{this.\u0275dir=Ue({type:i,selectors:[["","matStepLabel",""]],standalone:!0,features:[Ci]})}}return i})(),_l=(()=>{class i{constructor(){this.changes=new Te,this.optionalLabel="Optional",this.completedLabel="Completed",this.editableLabel="Editable"}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function wx(i){return i||new _l}var xx={provide:_l,deps:[[new Ac,new Rc,_l]],useFactory:wx},Bd=(()=>{class i extends Fd{constructor(e,n,r,o){super(r),this._intl=e,this._focusMonitor=n,this._intlSubscription=e.changes.subscribe(()=>o.markForCheck())}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(e,n){e?this._focusMonitor.focusVia(this._elementRef,e,n):this._elementRef.nativeElement.focus(n)}_stringLabel(){return this.label instanceof Jo?null:this.label}_templateLabel(){return this.label instanceof Jo?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getIconContext(){return{index:this.index,active:this.active,optional:this.optional}}_getDefaultTextForState(e){return e=="number"?`${this.index+1}`:e=="edit"?"create":e=="error"?"warning":e}static{this.\u0275fac=function(n){return new(n||i)(W(_l),W(gf),W(Ce),W(It))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-step-header"]],hostAttrs:["role","tab",1,"mat-step-header"],hostVars:2,hostBindings:function(n,r){n&2&&rn("mat-"+(r.color||"primary"))},inputs:{state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple",color:"color"},standalone:!0,features:[Ci,fe],decls:10,vars:17,consts:[["matRipple","",1,"mat-step-header-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-step-icon-content"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-step-label"],[1,"mat-step-text-label"],[1,"mat-step-optional"],[1,"mat-step-sub-label-error"],["aria-hidden","true"],[1,"cdk-visually-hidden"],[3,"ngTemplateOutlet"]],template:function(n,r){if(n&1&&(J(0,"div",0),h(1,"div")(2,"div",1),H(3,tx,1,2,"ng-container",2)(4,ax,2,1),m()(),h(5,"div",3),H(6,sx,2,1,"div",4)(7,lx,2,1,"div",4)(8,cx,2,1,"div",5)(9,dx,2,1,"div",6),m()),n&2){let o;C("matRippleTrigger",r._getHostElement())("matRippleDisabled",r.disableRipple),f(),vs("mat-step-icon-state-",r.state," mat-step-icon"),Ze("mat-step-icon-selected",r.selected),f(2),ae(r.iconOverrides&&r.iconOverrides[r.state]?3:4),f(2),Ze("mat-step-label-active",r.active)("mat-step-label-selected",r.selected)("mat-step-label-error",r.state=="error"),f(),ae((o=r._templateLabel())?6:r._stringLabel()?7:-1,o),f(2),ae(r.optional&&r.state!="error"?8:-1),f(),ae(r.state==="error"?9:-1)}},dependencies:[fd,Fr,rg],styles:['.mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus .mat-focus-indicator::before{content:""}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color);border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-app-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color);border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-app-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}.cdk-high-contrast-active .mat-step-header{outline:solid 1px}.cdk-high-contrast-active .mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.cdk-high-contrast-active .mat-step-header[aria-disabled=true]{outline-color:GrayText}.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-label,.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-icon,.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-app-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-app-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-app-error))}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle;font-family:var(--mat-stepper-header-label-text-font, var(--mat-app-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-app-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-app-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-app-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-app-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-app-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-app-title-small-weight))}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-app-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-app-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color);color:var(--mat-stepper-header-done-state-icon-foreground-color)}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-app-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-app-on-primary))}'],encapsulation:2,changeDetection:0})}}return i})(),pg="500ms",ug="225ms",ag={horizontalStepTransition:Ro("horizontalStepTransition",[sn("previous",Ii({transform:"translate3d(-100%, 0, 0)",visibility:"hidden"})),sn("current",Ii({transform:"none",visibility:"inherit"})),sn("next",Ii({transform:"translate3d(100%, 0, 0)",visibility:"hidden"})),Nr("* => *",Bo([$n("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)"),$c("@*",Wc(),{optional:!0})]),{params:{animationDuration:pg}})]),verticalStepTransition:Ro("verticalStepTransition",[sn("previous",Ii({height:"0px",visibility:"hidden"})),sn("next",Ii({height:"0px",visibility:"hidden"})),sn("current",Ii({height:"*",visibility:"inherit"})),Nr("* <=> current",Bo([$n("{{animationDuration}} cubic-bezier(0.4, 0.0, 0.2, 1)"),$c("@*",Wc(),{optional:!0})]),{params:{animationDuration:ug}})])},Nd=(()=>{class i{constructor(e){this.templateRef=e}static{this.\u0275fac=function(n){return new(n||i)(W(ci))}}static{this.\u0275dir=Ue({type:i,selectors:[["ng-template","matStepperIcon",""]],inputs:{name:[0,"matStepperIcon","name"]},standalone:!0})}}return i})(),zd=(()=>{class i{constructor(e){this._template=e}static{this.\u0275fac=function(n){return new(n||i)(W(ci))}}static{this.\u0275dir=Ue({type:i,selectors:[["ng-template","matStepContent",""]],standalone:!0})}}return i})(),Ld=(()=>{class i extends fl{constructor(e,n,r,o){super(e,o),this._errorStateMatcher=n,this._viewContainerRef=r,this._isSelected=ei.EMPTY,this.stepLabel=void 0}ngAfterContentInit(){this._isSelected=this._stepper.steps.changes.pipe(Ri(()=>this._stepper.selectionChange.pipe(Ve(e=>e.selectedStep===this),Ai(this._stepper.selected===this)))).subscribe(e=>{e&&this._lazyContent&&!this._portal&&(this._portal=new Fn(this._lazyContent._template,this._viewContainerRef))})}ngOnDestroy(){this._isSelected.unsubscribe()}isErrorState(e,n){let r=this._errorStateMatcher.isErrorState(e,n),o=!!(e&&e.invalid&&this.interacted);return r||o}static{this.\u0275fac=function(n){return new(n||i)(W(Er(()=>yl)),W(qo,4),W(kn),W(Rd,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-step"]],contentQueries:function(n,r,o){if(n&1&&(Et(o,Jo,5),Et(o,zd,5)),n&2){let a;Fe(a=Ae())&&(r.stepLabel=a.first),Fe(a=Ae())&&(r._lazyContent=a.first)}},hostAttrs:["hidden",""],inputs:{color:"color"},exportAs:["matStep"],standalone:!0,features:[di([{provide:qo,useExisting:i},{provide:fl,useExisting:i}]),Ci,fe],ngContentSelectors:sg,decls:1,vars:0,consts:[[3,"cdkPortalOutlet"]],template:function(n,r){n&1&&(jt(),H(0,ux,2,1,"ng-template"))},dependencies:[Xm],encapsulation:2,changeDetection:0})}}return i})(),yl=(()=>{class i extends gl{get animationDuration(){return this._animationDuration}set animationDuration(e){this._animationDuration=/^\d+$/.test(e)?e+"ms":e}constructor(e,n,r){super(e,n,r),this._stepHeader=void 0,this._steps=void 0,this.steps=new Dn,this.animationDone=new He,this.labelPosition="end",this.headerPosition="top",this._iconOverrides={},this._animationDone=new Te,this._animationDuration="",this._isServer=!O(lt).isBrowser;let o=r.nativeElement.nodeName.toLowerCase();this.orientation=o==="mat-vertical-stepper"?"vertical":"horizontal"}ngAfterContentInit(){super.ngAfterContentInit(),this._icons.forEach(({name:e,templateRef:n})=>this._iconOverrides[e]=n),this.steps.changes.pipe(ti(this._destroyed)).subscribe(()=>{this._stateChanged()}),this._animationDone.pipe(ti(this._destroyed)).subscribe(e=>{e.toState==="current"&&this.animationDone.emit()})}_stepIsNavigable(e,n){return n.completed||this.selectedIndex===e||!this.linear}_getAnimationDuration(){return this.animationDuration?this.animationDuration:this.orientation==="horizontal"?pg:ug}static{this.\u0275fac=function(n){return new(n||i)(W(On,8),W(It),W(Ce))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-stepper"],["mat-vertical-stepper"],["mat-horizontal-stepper"],["","matStepper",""]],contentQueries:function(n,r,o){if(n&1&&(Et(o,Ld,5),Et(o,Nd,5)),n&2){let a;Fe(a=Ae())&&(r._steps=a),Fe(a=Ae())&&(r._icons=a)}},viewQuery:function(n,r){if(n&1&&ut(Bd,5),n&2){let o;Fe(o=Ae())&&(r._stepHeader=o)}},hostAttrs:["role","tablist"],hostVars:11,hostBindings:function(n,r){n&2&&(qe("aria-orientation",r.orientation),Ze("mat-stepper-horizontal",r.orientation==="horizontal")("mat-stepper-vertical",r.orientation==="vertical")("mat-stepper-label-position-end",r.orientation==="horizontal"&&r.labelPosition=="end")("mat-stepper-label-position-bottom",r.orientation==="horizontal"&&r.labelPosition=="bottom")("mat-stepper-header-position-bottom",r.headerPosition==="bottom"))},inputs:{disableRipple:"disableRipple",color:"color",labelPosition:"labelPosition",headerPosition:"headerPosition",animationDuration:"animationDuration"},outputs:{animationDone:"animationDone"},exportAs:["matStepper","matVerticalStepper","matHorizontalStepper"],standalone:!0,features:[di([{provide:gl,useExisting:i}]),Ci,fe],ngContentSelectors:sg,decls:5,vars:2,consts:[["stepTemplate",""],[1,"mat-horizontal-stepper-wrapper"],[1,"mat-horizontal-stepper-header-container"],[1,"mat-horizontal-content-container"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id","mat-horizontal-stepper-content-inactive"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-stepper-horizontal-line"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id"],[3,"ngTemplateOutlet"],[1,"mat-step"],[1,"mat-vertical-content-container"],["role","tabpanel",1,"mat-vertical-stepper-content",3,"id"],[1,"mat-vertical-content"],[3,"click","keydown","tabIndex","id","index","state","label","selected","active","optional","errorMessage","iconOverrides","disableRipple","color"]],template:function(n,r){if(n&1&&(jt(),H(0,hx,1,0)(1,bx,7,0,"div",1)(2,_x,2,0)(3,yx,1,23,"ng-template",null,0,we)),n&2){let o;ae(r._isServer?0:-1),f(),ae((o=r.orientation)==="horizontal"?1:o==="vertical"?2:-1)}},dependencies:[Fr,Bd],styles:['.mat-stepper-vertical,.mat-stepper-horizontal{display:block;font-family:var(--mat-stepper-container-text-font, var(--mat-app-body-medium-font));background:var(--mat-stepper-container-color, var(--mat-app-surface))}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px;border-top-color:var(--mat-stepper-line-color, var(--mat-app-outline))}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:calc(calc((var(--mat-stepper-header-height) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:"";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px;height:var(--mat-stepper-header-height)}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-horizontal-stepper-header::before,.mat-horizontal-stepper-header::after{border-top-color:var(--mat-stepper-line-color, var(--mat-app-outline))}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:calc((var(--mat-stepper-header-height) - 24px) / 2) 24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::after{top:calc(calc((var(--mat-stepper-header-height) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px;padding:calc((var(--mat-stepper-header-height) - 24px) / 2) 24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-inactive{height:0;overflow:hidden}.mat-horizontal-stepper-content:not(.mat-horizontal-stepper-content-inactive){visibility:inherit !important}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.cdk-high-contrast-active .mat-horizontal-content-container{outline:solid 1px}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}.cdk-high-contrast-active .mat-vertical-content-container{outline:solid 1px}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:"";position:absolute;left:0;border-left-width:1px;border-left-style:solid;border-left-color:var(--mat-stepper-line-color, var(--mat-app-outline));top:calc(8px - calc((var(--mat-stepper-header-height) - 24px) / 2));bottom:calc(8px - calc((var(--mat-stepper-header-height) - 24px) / 2))}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-stepper-content:not(.mat-vertical-stepper-content-inactive){visibility:inherit !important}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}'],encapsulation:2,data:{animation:[ag.horizontalStepTransition,ag.verticalStepTransition]},changeDetection:0})}}return i})();var hg=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({providers:[xx,qo],imports:[rt,et,qr,Zf,og,Go,yl,Bd,rt]})}}return i})();var mg=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,Go,rt]})}}return i})();var fg=[{path:"",title:"Choose Product",icon:"fas fa-shopping-cart",class:"",label:"",labelClass:"side-badge badge bg-success",extralink:!1,submenu:[]},{path:"",title:"Customize Label",icon:"fas fa-tag",class:"",label:"",labelClass:"",extralink:!1,submenu:[]},{path:"",title:"Print Preview",icon:"fas fa-print",class:"",label:"",labelClass:"",extralink:!1,submenu:[]}];var gg=(()=>{class i{constructor(){this.collapseSidebar=!1,this.fullScreen=!1,this.MENUITEMS=fg,this.items=new Do(this.MENUITEMS)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ex=["stepper"];function Ix(i,t){if(i&1&&(h(0,"div",2)(1,"span",12),b(2),m()()),i&2){let e=S();f(2),P(e.sidebarTitle())}}function Dx(i,t){i&1&&(h(0,"div",3)(1,"span",13),b(2,"BA"),m()())}function kx(i,t){i&1&&b(0,"Choose Product")}function Tx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Mx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Ox(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Fx(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Select the product that you want to print "),m()())}function Ax(i,t){i&1&&b(0,"Customize Label")}function Rx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Bx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Nx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function zx(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Configure sticker label layout and visibility"),m()())}function Lx(i,t){i&1&&b(0,"Print Preview")}function jx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Hx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Vx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Ux(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Select the paper type, "),m(),h(3,"span",22),b(4,"then configure adjust the position and margins to ensure accurate sticker placement"),m()())}function Wx(i,t){if(i&1){let e=Se();h(0,"mat-stepper",14,0),N("selectedIndexChange",function(r){X(e);let o=S();return K(o.onStepperSelectionChange(r))}),h(2,"mat-step",15),H(3,kx,1,0,"ng-template",16)(4,Tx,1,1,"ng-template",17)(5,Mx,1,1,"ng-template",18)(6,Ox,1,1,"ng-template",19)(7,Fx,3,0,"ng-template",20),m(),h(8,"mat-step",15),H(9,Ax,1,0,"ng-template",16)(10,Rx,1,1,"ng-template",17)(11,Bx,1,1,"ng-template",18)(12,Nx,1,1,"ng-template",19)(13,zx,3,0,"ng-template",20),m(),h(14,"mat-step",15),H(15,Lx,1,0,"ng-template",16)(16,jx,1,1,"ng-template",17)(17,Hx,1,1,"ng-template",18)(18,Vx,1,1,"ng-template",19)(19,Ux,5,0,"ng-template",20),m()()}if(i&2){let e=S();C("selectedIndex",e.step())("linear",!1),f(2),C("completed",!1),f(6),C("completed",!1),f(6),C("completed",!1)}}function $x(i,t){i&1&&b(0,"Choose Product")}function qx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Gx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Yx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Xx(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Select the product that you want to print "),m()())}function Kx(i,t){i&1&&b(0,"Print Preview")}function Qx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Zx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Jx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function eC(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Select the paper type, "),m(),h(3,"span",22),b(4,"then configure adjust the position and margins to ensure accurate sticker placement"),m()())}function tC(i,t){if(i&1){let e=Se();h(0,"mat-stepper",14,0),N("selectedIndexChange",function(r){X(e);let o=S();return K(o.onStepperSelectionChange(r))}),h(2,"mat-step",15),H(3,$x,1,0,"ng-template",16)(4,qx,1,1,"ng-template",17)(5,Gx,1,1,"ng-template",18)(6,Yx,1,1,"ng-template",19)(7,Xx,3,0,"ng-template",20),m(),h(8,"mat-step",15),H(9,Kx,1,0,"ng-template",16)(10,Qx,1,1,"ng-template",17)(11,Zx,1,1,"ng-template",18)(12,Jx,1,1,"ng-template",19)(13,eC,5,0,"ng-template",20),m()()}if(i&2){let e=S();C("selectedIndex",e.step())("linear",!1),f(2),C("completed",!1),f(6),C("completed",!1)}}function iC(i,t){if(i&1){let e=Se();h(0,"div",8)(1,"h6",23)(2,"button",24),b(3," Switch Barcode Mode "),m()(),h(4,"a",25),J(5,"img",26),h(6,"strong",27),b(7),m()(),h(8,"ul",28)(9,"li")(10,"a",29),b(11),m()(),h(12,"li")(13,"a",30),N("click",function(){X(e);let r=S();return K(r.authService.logout())}),J(14,"i",31),h(15,"span"),b(16,"Sign out"),m()()()()()}if(i&2){let e=S();f(7),P(e.username),f(3),C("href","https://"+e.domain(),Un),f(),P(e.domain())}}function nC(i,t){if(i&1){let e=Se();h(0,"div",9)(1,"a",25),J(2,"img",26),m(),h(3,"ul",28)(4,"li")(5,"a",29),b(6),m()(),h(7,"li")(8,"a",30),N("click",function(){X(e);let r=S();return K(r.authService.logout())}),J(9,"i",31),h(10,"span"),b(11,"Sign out"),m()()()()()}if(i&2){let e=S();f(5),C("href","https://"+e.domain(),Un),f(),P(e.domain())}}var bg=(()=>{class i{handleNotify(){this.notify.emit(!this.showClass)}constructor(e,n){this.menuServise=e,this.router=n,this._formBuilder=O(Wi),this.step=B(0),this.printMode=B(1),this.sidebarTitle=B(""),this.firstFormGroup=this._formBuilder.group({firstCtrl:["",mt.required]}),this.secondFormGroup=this._formBuilder.group({secondCtrl:["",mt.required]}),this.showMenu="",this.showSubMenu="",this.sidebarnavItems=[],this.path="",this.authService=O(Dm),this.username="",this.domain=B(""),this.brand=B(""),this.showClass=!1,this.notify=new He,this.cdr=O(It),this.storeService=O(Re),this.route=O(Ui),this.stepperRef=null,this.injector=O(Ye),this.storeSevice=O(Re),this.menuServise.items.subscribe(r=>{this.sidebarnavItems=r,this.sidebarnavItems.filter(o=>o.submenu.filter(a=>{a.path===this.router.url&&(this.path=o.title)})),this.addExpandClass(this.path)})}addExpandClass(e){e===this.showMenu?this.showMenu="0":this.showMenu=e}ngOnInit(){Dt(this.storeService.productItems,{injector:this.injector}).pipe(st(e=>e.length<=0),Ee(()=>this.stepperRef?.steps.forEach(e=>e.completed=!1))).subscribe(),this.route.queryParamMap.pipe(st(e=>e.has("step")),Ve(e=>+e.get("step")),Ee(e=>this.step.set(e))).subscribe()}addActiveClass(e){e===this.showSubMenu?this.showSubMenu="0":this.showSubMenu=e,window.scroll({top:0,left:0,behavior:"smooth"})}ngAfterViewInit(){this.username=localStorage.getItem("Username"),this.brand.set(localStorage.getItem("Brand")),this.domain.set(localStorage.getItem("Domain")),(localStorage.getItem("PrintMode")||"barcode")==="barcode"?(this.printMode.set(1),this.sidebarTitle.set("Barcode Apps")):(this.printMode.set(2),this.sidebarTitle.set("Price Label")),this.storeService.onChangeStepperRef(this.stepperRef),this.cdr.detectChanges()}onGotoStepper(e){this.storeSevice.onGotoStepper(e)}onStepperSelectionChange(e){let n=[...this.storeService.productItems()];this.storeService.onChangeProductItems(n.map(r=>k(_({},r),{isSelected:!1}))),console.log("event",e),this.storeService.onGotoStepper(e),this.stepperRef.steps.forEach((r,o)=>{o>e&&(r.completed=!1),o<=e&&(o===0&&this.storeService.productItems().length<=0?r.completed=!1:r.completed=!0)}),console.log("completed",this.stepperRef.steps.toArray().map(r=>r.completed))}onSwitchMode(){this.router.navigate(["/pages/v2/print-mode"]),localStorage.removeItem("printMode")}static{this.\u0275fac=function(n){return new(n||i)(W(gg),W(Ei))}}static{this.\u0275cmp=pe({type:i,selectors:[["app-vertical-sidebar"]],viewQuery:function(n,r){if(n&1&&ut(Ex,5),n&2){let o;Fe(o=Ae())&&(r.stepperRef=o.first)}},inputs:{showClass:"showClass"},outputs:{notify:"notify"},standalone:!0,features:[fe],decls:14,vars:3,consts:[["stepper",""],[1,"d-flex","flex-column","h-100","position-relative"],[1,"d-flex","align-items-center",2,"height","61px","border-bottom","1px solid #ddd","padding","0 2rem"],[1,"d-flex","align-items-center","justify-content-center",2,"height","61px","border-bottom","1px solid #ddd"],[1,"sidebar-nav","flex-grow-1"],["id","sidebarnav"],["orientation","vertical",3,"selectedIndex","linear"],[1,"d-flex","flex-column","px-2","py-2"],["ngbDropdown","",1,"dropdown",2,"margin","0 1.5rem"],["ngbDropdown","",1,"dropdown"],[1,"collapse__icon","z-1",3,"click"],[1,"fas","fa-caret-left"],[1,"hide-menu","fs-6","fw-normal","text-capitalize"],[1,"fs-6","fw-normal","text-capitalize"],["orientation","vertical",3,"selectedIndexChange","selectedIndex","linear"],[3,"completed"],["matStepLabel",""],["matStepperIcon","done"],["matStepperIcon","create"],["matStepperIcon","edit"],["matStepContent",""],[1,"d-flex","flex-column","form-text","fw-normal","fs-2","my-0"],[1,""],[1,"text-muted","fw-bolder"],["routerLink","/pages/v2/print-mode","rel","noopener noreferrer","target","_blank",1,"btn","btn-link","text-primary","text-decoration-none","px-0"],["aria-expanded","false","data-bs-toggle","dropdown","href","javascript:void(0)","ngbDropdownToggle","",1,"hide-menu","d-flex","align-items-center","link-body-emphasis","text-decoration-none","dropdown-toggle",2,"margin-right","0"],["alt","","height","32","src","assets/images/users/user4.jpg","width","32",1,"rounded-circle","me-2"],[1,"hide-menu","m-0"],["ngbDropdownMenu","",1,"dropdown-menu","text-small","shadow","hide-menu"],["rel","noopener noreferrer","target","_blank",1,"dropdown-item",3,"href"],["href","javascript:void(0)",1,"dropdown-item","text-dark","d-flex","gap-2","align-items-center","fs-3",3,"click"],[1,"fas","fa-sign-out-alt"]],template:function(n,r){if(n&1&&(h(0,"div",1),H(1,Ix,3,1,"div",2)(2,Dx,3,0,"div",3),h(3,"nav",4)(4,"ul",5),J(5,"br"),H(6,Wx,20,5,"mat-stepper",6)(7,tC,14,4,"mat-stepper",6),m()(),h(8,"div",7),J(9,"hr"),H(10,iC,17,3,"div",8)(11,nC,12,2,"div",9),m(),h(12,"div",10),N("click",function(){return r.storeService.onToggleSidebarType()}),J(13,"i",11),m()()),n&2){let o,a;f(),ae((o=r.storeSevice.options().sidebartype)==="full"?1:o==="mini-sidebar"?2:-1),f(5),ae(r.printMode()===1?6:7),f(4),ae((a=r.storeSevice.options().sidebartype)==="full"?10:a==="mini-sidebar"?11:-1)}},dependencies:[Im,et,ym,_m,Ps,zs,Ns,Bs,mg,hg,Ld,Jo,yl,Nd,zd,gt,bt,Qo,Qf],styles:[".collapse__icon[_ngcontent-%COMP%]{border:1px solid black;border-radius:50%;padding:.5rem;transition:all .5s ease-in-out;position:absolute;top:17px;right:-10px;opacity:0;display:flex;justify-content:center;align-items:center;width:25px;height:25px}.collapse__icon[_ngcontent-%COMP%]:hover{opacity:1}.sidebar-item[_ngcontent-%COMP%]{margin:0 1rem}.sidebar-item.active[_ngcontent-%COMP%]{background:#2075d0;border-radius:4px}.sidebar-item[_ngcontent-%COMP%] .sidebar-link[_ngcontent-%COMP%]{padding:.5rem;font-weight:400}.sidebar-item[_ngcontent-%COMP%], .sidebar-link.active[_ngcontent-%COMP%], .sidebar-link.active[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff!important}.sidebar-item[_ngcontent-%COMP%] .user-profile[_ngcontent-%COMP%] .sidebar-link[_ngcontent-%COMP%]{margin-left:.5rem}.sidebar-item[_ngcontent-%COMP%] .sidebar-link[_ngcontent-%COMP%]:hover:not(.active), .sidebar-item[_ngcontent-%COMP%] .sidebar-link[_ngcontent-%COMP%]:hover:not(.active) i[_ngcontent-%COMP%]{background:#ebf3f5;color:#000!important}.sidebar-item[_ngcontent-%COMP%] .sidebar-link.active[_ngcontent-%COMP%], .sidebar-item[_ngcontent-%COMP%] .sidebar-link.active[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{background:initial;color:initial} .mat-stepper-vertical .mat-step-header{padding:15px 32px} .mat-stepper-vertical .mat-vertical-content{padding:0 24px} .mat-stepper-vertical .mat-vertical-content-container{margin-left:44px}"]})}}return i})();var vg=(()=>{class i{constructor(){this.subject$=new Te}onFileLoad(e){let r=e.target.result,o=!1,a=[],s=[],l=0;for(let c of r.split(/[\r\n]+/))if(o){let d={};for(let p=0;p<l;p++)d[s[p]]=c.split(",")[p];a.push(d)}else{for(let d=0;d<c.split(",").length;d++)l=c.split(",").length,s.push(c.split(",")[d].replace(/ /g,""));o=!0}return a.splice(-1),a}convertFile(e){let n=e,r=new FileReader;return r.onload=o=>{let a=this.onFileLoad(o);this.subject$.next(a)},r.readAsText(n,"UTF-8"),this.subject$.asObservable()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var _g=(()=>{class i{constructor(e,n,r){this.http=e,this.toastr=n,this.router=r}PostToUrlEncode(e,n,r=1e5){let o=new Pi;return o=o.set("Content-Type","application/x-www-form-urlencoded"),new Ft(a=>{this.http.post(e,n,{headers:o}).pipe(Vi(r)).subscribe(s=>{a.next(s),a.complete()})})}GetText(e=1e5){let n=localStorage.getItem("Token"),o={responseType:"text",headers:new Pi({Authorization:"Bearer "+n})};return new Ft(a=>{this.http.get("/API/Token/GetZendeskJWT",o).pipe(Vi(e)).subscribe(s=>{a.next(s),a.complete()})})}POSText(e,n,r=1e5){let o=localStorage.getItem("Token"),s={responseType:"text",headers:new Pi({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+o})};return new Ft(l=>{this.http.post(e,n,s).pipe(Vi(r)).subscribe(c=>{l.next(c),l.complete()})})}get(e){let n=localStorage.getItem("Token"),r=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});n&&(r=r.append("Authorization","Bearer "+n));let o={headers:r};return this.http.get(e,o).pipe(En(a=>{if(!this.unauthorizedErrorHandling(a)){let l=this.errorMessageHandling(a);this.toastr.error(l.Message!=""?l.Message:"An unknown error has occured!",l.header),this.paymentErrorHandling(a)}return us(()=>a)}))}getNews(e){return this.http.get(e)}paymentErrorHandling(e){e.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(e,n,r=1e5){return new Ft(o=>{let a=localStorage.getItem("Token"),s=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+c(this.getMonth()+1)+"-"+c(this.getDate())+"T"+c(this.getHours())+":"+c(this.getMinutes())+":"+c(this.getSeconds())+".000"};function c(d){return d<10?"0"+d:d}this.http.post(e,n,l).pipe(Vi(r)).subscribe({next:d=>{o.next(d),o.complete()},error:d=>{if(d.status==200)o.next(d.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(d)){let v=this.errorMessageHandling(d);this.toastr.error(v.Message!=""?v.Message:"An unknown error has occured!",v.header,{enableHtml:!0})}o.error(d)}}})})}postFile(e,n,r=1e5){return new Ft(o=>{let a=localStorage.getItem("Token"),s=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a)),this.http.post(e,n,{headers:s,observe:"response",responseType:"blob"}).pipe(Vi(r)).subscribe({next:l=>{o.next({title:l.headers.get("Content-Disposition"),file:l.body}),o.complete()},error:l=>{if(l.headers.get("Content-Type")==="application/json; charset=utf-8"){let c=new FileReader;c.addEventListener("loadend",d=>{let p=JSON.parse(d.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(l)){let g=this.errorMessageHandling(l);this.toastr.error(p??"An unknown error has occured!",g.header,{enableHtml:!0})}}),c.readAsText(l.error)}o.error(l)}})})}put(e,n,r=1e5){return new Ft(o=>{let a=localStorage.getItem("Token"),s=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s};this.http.put(e,n,l).pipe(Vi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}delete(e,n,r=1e5){return new Ft(o=>{let a=localStorage.getItem("Token"),s=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s,body:n};this.http.delete(e,l).pipe(Vi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}unauthorizedErrorHandling(e){let n=!1;return(e.status==401||e.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",n=!0),n}errorMessageHandling(e){let n="API Error",r="Exception Message";return e.error?(n="API Error - "+e.status,e.status==451&&(n="Error"),e.error&&(r=e.error.Message)):e.Message&&(n="API Error - "+e.name,r=e.Message),{header:n,Message:r}}postFormDataWithoutBearer(e,n){return new Ft(r=>{this.http.post(e,n).pipe(Vi(1e5)).subscribe({next:o=>{r.next(o),r.complete()},error:o=>{o.status==200&&(r.next(o.error.text),r.complete()),r.error(o)}})})}postFormData(e,n,r=!0){return new Ft(o=>{let a=localStorage.getItem("Token"),l={headers:new Pi({Authorization:"Bearer "+a})};this.http.post(e,n,l).pipe(Vi(1e5)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)&&r){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}static{this.\u0275fac=function(n){return new(n||i)(U(Ss),U(zr),U(Ei))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function wl(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var rC=0;function wg(i){return"__private_"+rC+++"_"+i}function oC(i,t,e){let n=[];return i.forEach(r=>typeof r!="string"?n.push(r):t[Symbol.split](r).forEach((o,a,s)=>{o!==""&&n.push(o),a<s.length-1&&n.push(e)})),n}function yg(i,t){let e=/\$/g,n="$$$$",r=[i];if(t==null)return r;for(let o of Object.keys(t))if(o!=="_"){let a=t[o];typeof a=="string"&&(a=e[Symbol.replace](a,n)),r=oC(r,new RegExp(`%\\{${o}\\}`,"g"),a)}return r}var aC=i=>{throw new Error(`missing string: ${i}`)},ea=wg("onMissingKey"),ta=wg("apply"),Qr=class{constructor(t,e){let{onMissingKey:n=aC}=e===void 0?{}:e;Object.defineProperty(this,ta,{value:sC}),Object.defineProperty(this,ea,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(t)?t.forEach(wl(this,ta)[ta],this):wl(this,ta)[ta](t),wl(this,ea)[ea]=n}translate(t,e){return this.translateArray(t,e).join("")}translateArray(t,e){let n=this.locale.strings[t];if(n==null&&(wl(this,ea)[ea](t),n=t),typeof n=="object"){if(e&&typeof e.smart_count<"u"){let o=this.locale.pluralize(e.smart_count);return yg(n[o],e)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof n!="string")throw new Error("string was not a string");return yg(n,e)}};function sC(i){if(!(i!=null&&i.strings))return;let t=this.locale;Object.assign(this.locale,{strings:_(_({},t.strings),i.strings),pluralize:i.pluralize||t.pluralize})}var v0=Ne(Cg(),1);var lC="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Rn=(i=21)=>{let t="",e=i|0;for(;e--;)t+=lC[Math.random()*64|0];return t};var _0=Ne(i0(),1);function Cl(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var tS=0;function n0(i){return"__private_"+tS+++"_"+i}var iS={version:"4.2.0"},Qn=n0("callbacks"),Wd=n0("publish"),Sl=class{constructor(){Object.defineProperty(this,Wd,{value:nS}),this.state={},Object.defineProperty(this,Qn,{writable:!0,value:new Set})}getState(){return this.state}setState(t){let e=_({},this.state),n=_(_({},this.state),t);this.state=n,Cl(this,Wd)[Wd](e,n,t)}subscribe(t){return Cl(this,Qn)[Qn].add(t),()=>{Cl(this,Qn)[Qn].delete(t)}}};function nS(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];Cl(this,Qn)[Qn].forEach(n=>{n(...t)})}Sl.VERSION=iS.version;var r0=Sl;function Xi(i){let t=i.lastIndexOf(".");return t===-1||t===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,t),extension:i.slice(t+1)}}var $d={__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 na(i){var t;if(i.type)return i.type;let e=i.name?(t=Xi(i.name).extension)==null?void 0:t.toLowerCase():null;return e&&e in $d?$d[e]:"application/octet-stream"}function rS(i){return i.charCodeAt(0).toString(32)}function o0(i){let t="";return i.replace(/[^A-Z0-9]/gi,e=>(t+=`-${rS(e)}`,"/"))+t}function a0(i,t){let e=t||"uppy";return typeof i.name=="string"&&(e+=`-${o0(i.name.toLowerCase())}`),i.type!==void 0&&(e+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(e+=`-${o0(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(e+=`-${i.data.size}`),i.data.lastModified!==void 0&&(e+=`-${i.data.lastModified}`),e}function oS(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Pl(i,t){if(oS(i))return i.id;let e=na(i);return a0(k(_({},i),{type:e}),t)}function qd(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let t=/Edge\/(\d+\.\d+)/.exec(i);if(!t)return!0;let n=t[1].split(".",2),r=parseInt(n[0],10),o=parseInt(n[1],10);return r<15||r===15&&o<15063||r>18||r===18&&o>=18218}function Gd(i,t){return t.name?t.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Yd(i){return i<10?`0${i}`:i.toString()}function Zr(){let i=new Date,t=Yd(i.getHours()),e=Yd(i.getMinutes()),n=Yd(i.getSeconds());return`${t}:${e}:${n}`}var s0={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.error(`[Uppy] [${Zr()}]`,...t)}},l0={debug:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.debug(`[Uppy] [${Zr()}]`,...t)},warn:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.warn(`[Uppy] [${Zr()}]`,...t)},error:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.error(`[Uppy] [${Zr()}]`,...t)}};var oa=Ne(ra(),1),f0=Ne(m0(),1),g0={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},ii=class extends Error{constructor(t,e){var n;super(t),this.isRestriction=!0,this.isUserFacing=(n=e?.isUserFacing)!=null?n:!0,e!=null&&e.file&&(this.file=e.file)}},El=class{constructor(t,e){this.getI18n=e,this.getOpts=()=>{var n;let r=t();if(((n=r.restrictions)==null?void 0:n.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(t,e){let{maxTotalFileSize:n,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&t.filter(a=>!a.isGhost).length+e.length>r)throw new ii(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(n){let o=[...t,...e].reduce((a,s)=>{var l;return a+((l=s.size)!=null?l:0)},0);if(o>n)throw new ii(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,oa.default)(n),size:(0,oa.default)(o)}))}}validateSingleFile(t){let{maxFileSize:e,minFileSize:n,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(s=>s.includes("/")?t.type?(0,f0.default)(t.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&t.extension?t.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){let s=r.join(", ");throw new ii(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:t})}if(e&&t.size!=null&&t.size>e){var o;throw new ii(this.getI18n()("exceedsSize",{size:(0,oa.default)(e),file:(o=t.name)!=null?o:this.getI18n()("unnamed")}),{file:t})}if(n&&t.size!=null&&t.size<n)throw new ii(this.getI18n()("inferiorSize",{size:(0,oa.default)(n)}),{file:t})}validate(t,e){e.forEach(n=>{this.validateSingleFile(n)}),this.validateAggregateRestrictions(t,e)}validateMinNumberOfFiles(t){let{minNumberOfFiles:e}=this.getOpts().restrictions;if(e&&Object.keys(t).length<e)throw new ii(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:e}))}getMissingRequiredMetaFields(t){var e;let n=new ii(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(e=t.name)!=null?e:this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,o=[];for(let a of r)(!Object.hasOwn(t.meta,a)||t.meta[a]==="")&&o.push(a);return{missingFields:o,error:n}}};var b0={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",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",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",pleaseWait:"Please wait"}};function $(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var lS=0;function Qe(i){return"__private_"+lS+++"_"+i}var cS={version:"4.4.1"},Il={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},Bt=Qe("plugins"),Nt=Qe("restricter"),aa=Qe("storeUnsubscribe"),un=Qe("emitter"),Zn=Qe("preProcessors"),Jn=Qe("uploaders"),fn=Qe("postProcessors"),hi=Qe("informAndEmit"),ua=Qe("checkRequiredMetaFieldsOnFile"),Xd=Qe("checkRequiredMetaFields"),sa=Qe("assertNewUploadAllowed"),Zd=Qe("transformFile"),la=Qe("startIfAutoProceed"),ca=Qe("checkAndUpdateFileState"),Jd=Qe("handleUploadProgress"),da=Qe("updateTotalProgress"),gn=Qe("updateTotalProgressThrottled"),ep=Qe("calculateTotalProgress"),Kd=Qe("addListeners"),zi=Qe("updateOnlineStatus"),pa=Qe("requestClientById"),hn=Qe("createUpload"),Qd=Qe("getUpload"),er=Qe("removeUpload"),mn=Qe("runUpload"),Dl=class i{constructor(t){Object.defineProperty(this,mn,{value:CS}),Object.defineProperty(this,er,{value:xS}),Object.defineProperty(this,Qd,{value:wS}),Object.defineProperty(this,hn,{value:yS}),Object.defineProperty(this,Kd,{value:_S}),Object.defineProperty(this,ep,{value:vS}),Object.defineProperty(this,da,{value:bS}),Object.defineProperty(this,ca,{value:gS}),Object.defineProperty(this,la,{value:fS}),Object.defineProperty(this,Zd,{value:mS}),Object.defineProperty(this,sa,{value:hS}),Object.defineProperty(this,Xd,{value:uS}),Object.defineProperty(this,ua,{value:pS}),Object.defineProperty(this,hi,{value:dS}),Object.defineProperty(this,Bt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Nt,{writable:!0,value:void 0}),Object.defineProperty(this,aa,{writable:!0,value:void 0}),Object.defineProperty(this,un,{writable:!0,value:(0,v0.default)()}),Object.defineProperty(this,Zn,{writable:!0,value:new Set}),Object.defineProperty(this,Jn,{writable:!0,value:new Set}),Object.defineProperty(this,fn,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Jd,{writable:!0,value:(r,o)=>{let a=r?this.getFile(r.id):void 0;if(r==null||!a){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}let s={bytesTotal:o.bytesTotal,percentage:o.bytesTotal!=null&&Number.isFinite(o.bytesTotal)&&o.bytesTotal>0?Math.round(o.bytesUploaded/o.bytesTotal*100):void 0};a.progress.uploadStarted!=null?this.setFileState(r.id,{progress:k(_(_({},a.progress),s),{bytesUploaded:o.bytesUploaded})}):this.setFileState(r.id,{progress:_(_({},a.progress),s)}),$(this,gn)[gn]()}}),Object.defineProperty(this,gn,{writable:!0,value:(0,_0.default)(()=>$(this,da)[da](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,zi,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,pa,{writable:!0,value:new Map}),this.defaultLocale=b0;let e={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:g0,meta:{},onBeforeFileAdded:(r,o)=>!Object.hasOwn(o,r.id),onBeforeUpload:r=>r,store:new r0,logger:s0,infoTimeout:5e3},n=_(_({},e),t);this.opts=k(_({},n),{restrictions:_(_({},e.restrictions),t&&t.restrictions)}),t&&t.logger&&t.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"):t&&t.debug&&(this.opts.logger=l0),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(k(_({},Il),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:qd(),individualCancellation:!0,resumableUploads:!1},meta:_({},this.opts.meta),info:[]})),$(this,Nt)[Nt]=new El(()=>this.opts,()=>this.i18n),$(this,aa)[aa]=this.store.subscribe((r,o,a)=>{this.emit("state-update",r,o,a),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),$(this,Kd)[Kd]()}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];$(this,un)[un].emit(t,...n)}on(t,e){return $(this,un)[un].on(t,e),this}once(t,e){return $(this,un)[un].once(t,e),this}off(t,e){return $(this,un)[un].off(t,e),this}updateAll(t){this.iteratePlugins(e=>{e.update(t)})}setState(t){this.store.setState(t)}getState(){return this.store.getState()}patchFilesState(t){let e=this.getState().files;this.setState({files:_(_({},e),Object.fromEntries(Object.entries(t).map(n=>{let[r,o]=n;return[r,_(_({},e[r]),o)]})))})}setFileState(t,e){if(!this.getState().files[t])throw new Error(`Can\u2019t set state for ${t} (the file could have been removed)`);this.patchFilesState({[t]:e})}i18nInit(){let t=n=>this.log(`Missing i18n string: ${n}`,"error"),e=new Qr([this.defaultLocale,this.opts.locale],{onMissingKey:t});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(t){this.opts=k(_(_({},this.opts),t),{restrictions:_(_({},this.opts.restrictions),t?.restrictions)}),t.meta&&this.setMeta(t.meta),this.i18nInit(),t.locale&&this.iteratePlugins(e=>{e.setOptions(t)}),this.setState(void 0)}resetProgress(){let t={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},e=_({},this.getState().files),n=Object.create(null);Object.keys(e).forEach(r=>{n[r]=k(_({},e[r]),{progress:_(_({},e[r].progress),t),tus:void 0,transloadit:void 0})}),this.setState(_({files:n},Il))}clear(){let{capabilities:t,currentUploads:e}=this.getState();if(Object.keys(e).length>0&&!t.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(k(_({},Il),{files:{}}))}addPreProcessor(t){$(this,Zn)[Zn].add(t)}removePreProcessor(t){return $(this,Zn)[Zn].delete(t)}addPostProcessor(t){$(this,fn)[fn].add(t)}removePostProcessor(t){return $(this,fn)[fn].delete(t)}addUploader(t){$(this,Jn)[Jn].add(t)}removeUploader(t){return $(this,Jn)[Jn].delete(t)}setMeta(t){let e=_(_({},this.getState().meta),t),n=_({},this.getState().files);Object.keys(n).forEach(r=>{n[r]=k(_({},n[r]),{meta:_(_({},n[r].meta),t)})}),this.log("Adding metadata:"),this.log(t),this.setState({meta:e,files:n})}setFileMeta(t,e){let n=_({},this.getState().files);if(!n[t]){this.log(`Was trying to set metadata for a file that has been removed: ${t}`);return}let r=_(_({},n[t].meta),e);n[t]=k(_({},n[t]),{meta:r}),this.setState({files:n})}getFile(t){return this.getState().files[t]}getFiles(){let{files:t}=this.getState();return Object.values(t)}getFilesByIds(t){return t.map(e=>this.getFile(e))}getObjectOfFilesPerState(){let{files:t,totalProgress:e,error:n}=this.getState(),r=Object.values(t),o=[],a=[],s=[],l=[],c=[],d=[],p=[],v=[],g=[];for(let w of r){let{progress:E}=w;!E.uploadComplete&&E.uploadStarted&&(o.push(w),w.isPaused||v.push(w)),E.uploadStarted||a.push(w),(E.uploadStarted||E.preprocess||E.postprocess)&&s.push(w),E.uploadStarted&&l.push(w),w.isPaused&&c.push(w),E.uploadComplete&&d.push(w),w.error&&p.push(w),(E.preprocess||E.postprocess)&&g.push(w)}return{newFiles:a,startedFiles:s,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:p,inProgressFiles:o,inProgressNotPausedFiles:v,processingFiles:g,isUploadStarted:l.length>0,isAllComplete:e===100&&d.length===r.length&&g.length===0,isAllErrored:!!n&&p.length===r.length,isAllPaused:o.length!==0&&c.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(w=>w.isGhost)}}validateRestrictions(t,e){e===void 0&&(e=this.getFiles());try{$(this,Nt)[Nt].validate(e,[t])}catch(n){return n}return null}validateSingleFile(t){try{$(this,Nt)[Nt].validateSingleFile(t)}catch(e){return e.message}return null}validateAggregateRestrictions(t){let e=this.getFiles();try{$(this,Nt)[Nt].validateAggregateRestrictions(e,t)}catch(n){return n.message}return null}checkIfFileAlreadyExists(t){let{files:e}=this.getState();return!!(e[t]&&!e[t].isGhost)}addFile(t){$(this,sa)[sa](t);let{nextFilesState:e,validFilesToAdd:n,errors:r}=$(this,ca)[ca]([t]),o=r.filter(s=>s.isRestriction);if($(this,hi)[hi](o),r.length>0)throw r[0];this.setState({files:e});let[a]=n;return this.emit("file-added",a),this.emit("files-added",n),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),$(this,la)[la](),a.id}addFiles(t){$(this,sa)[sa]();let{nextFilesState:e,validFilesToAdd:n,errors:r}=$(this,ca)[ca](t),o=r.filter(s=>s.isRestriction);$(this,hi)[hi](o);let a=r.filter(s=>!s.isRestriction);if(a.length>0){let s=`Multiple errors occurred while adding files:
15
+ `)+1;return[e?n:o,e?o:r]}function Py({value:i,selection:t},e){let[n,r]=t;return n!==r?[n,r]:(e?[n,r+1]:[n-1,r]).map(a=>Math.min(Math.max(a,0),i.length))}var Ey=/\s+$/g,Iy=/^\s+/g,Am=/\s/;function Dy({value:i,selection:t},e){let[n,r]=t;if(n!==r)return[n,r];if(e){let l=i.slice(n),[c]=l.match(Iy)||[""],d=l.trimStart().search(Am);return[n,d!==-1?n+c.length+d:i.length]}let o=i.slice(0,r),[a]=o.match(Ey)||[""],s=o.trimEnd().split("").reverse().findIndex(l=>Am.exec(l));return[s!==-1?r-a.length-s:0,r]}function Ws(i=[]){return(t,...e)=>i.reduce((n,r)=>Object.assign(Object.assign({},n),r(n,...e)),t)}function Gn(i,t){let e=Object.assign(Object.assign({},jr),t),n=Ws(e.preprocessors),r=Ws(e.postprocessors),o=typeof i=="string"?{value:i,selection:[0,0]}:i,{elementState:a}=n({elementState:o,data:""},"validation"),s=new jo(a,e),{value:l,selection:c}=r(s,o);return typeof i=="string"?l:{value:l,selection:c}}var $s=class extends Yc{constructor(t,e){super(),this.element=t,this.maskitoOptions=e,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new Xc(this.element),this.options=Object.assign(Object.assign({},jr),this.maskitoOptions),this.upcomingElementState=null,this.preprocessor=Ws(this.options.preprocessors),this.postprocessor=Ws(this.options.postprocessors),this.teardowns=this.options.plugins.map(n=>n(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",n=>{if(xy(n))return n.preventDefault(),this.redo();if(Cy(n))return n.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",n=>{var r,o,a;let s=n.inputType.includes("Forward");switch(this.updateHistory(this.elementState),n.inputType){case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:n,isForward:s,selection:Py(this.elementState,s)});case"deleteHardLineBackward":case"deleteHardLineForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":return this.handleDelete({event:n,isForward:s,selection:Sy(this.elementState,s),force:!0});case"deleteWordBackward":case"deleteWordForward":return this.handleDelete({event:n,isForward:s,selection:Dy(this.elementState,s),force:!0});case"historyRedo":return n.preventDefault(),this.redo();case"historyUndo":return n.preventDefault(),this.undo();case"insertCompositionText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(n);case"insertReplacementText":return;case"insertFromDrop":case"insertFromPaste":case"insertText":default:return this.handleInsert(n,(a=(r=n.data)!==null&&r!==void 0?r:(o=n.dataTransfer)===null||o===void 0?void 0:o.getData("text/plain"))!==null&&a!==void 0?a:"")}}),this.eventListener.listen("input",()=>{this.upcomingElementState&&(this.updateElementState(this.upcomingElementState),this.upcomingElementState=null)},{capture:!0}),this.eventListener.listen("input",({inputType:n})=>{n!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}destroy(){this.eventListener.destroy(),this.teardowns.forEach(t=>t?.())}updateElementState({value:t,selection:e},n){let r=this.elementState.value;this.updateValue(t),this.updateSelectionRange(e),n&&r!==t&&this.dispatchInputEvent(n)}get elementState(){let{value:t,selectionStart:e,selectionEnd:n}=this.element;return{value:t,selection:[e??0,n??0]}}get maxLength(){let{maxLength:t}=this.element;return t===-1?1/0:t}updateSelectionRange([t,e]){var n;let{element:r}=this;r.matches(":focus")&&(r.selectionStart!==t||r.selectionEnd!==e)&&((n=r.setSelectionRange)===null||n===void 0||n.call(r,t,e))}updateValue(t){this.element.value=t}ensureValueFitsMask(){this.updateElementState(Gn(this.elementState,this.options),{inputType:"insertText",data:null})}dispatchInputEvent(t={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},t),{bubbles:!0,cancelable:!1})))}handleDelete({event:t,selection:e,isForward:n,force:r=!1}){let o={value:this.elementState.value,selection:e},[a,s]=o.selection,{elementState:l}=this.preprocessor({elementState:o,data:""},n?"deleteForward":"deleteBackward"),c=new jo(l,this.options),[d,p]=l.selection;c.deleteCharacters([d,p]);let v=this.postprocessor(c,o);if(!(o.value.slice(0,a)+o.value.slice(s)===v.value&&!r&&!this.element.isContentEditable)){if(by(o,l,c,v))return t.preventDefault(),this.updateSelectionRange(n?[p,p]:[d,d]);this.upcomingElementState=v}}handleInsert(t,e){let{options:n,maxLength:r,element:o,elementState:a}=this,{elementState:s,data:l=e}=this.preprocessor({data:e,elementState:a},"insert"),c=new jo(s,n);try{c.addCharacters(s.selection,l)}catch{return t.preventDefault()}let[d,p]=s.selection,v=a.value.slice(0,d)+e+a.value.slice(p),g=this.postprocessor(c,a);if(g.value.length>r)return t.preventDefault();(v!==g.value||o.isContentEditable)&&(this.upcomingElementState=g,n.overwriteMode==="replace"&&v.length>r&&this.dispatchInputEvent({inputType:"insertText",data:e}))}handleEnter(t){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(t,`
16
+ `)}};function Vr(i,t,e){let n=Math.min(Number(e),Math.max(Number(t),Number(i)));return i instanceof Date?new Date(n):n}var ky=[".",",","\u0431","\u044E"];var Qc="\xA0",Ty="\u200B",Hm="\u2013",Vm="\u2014",Gs="-",Kc="\u2212",Um="\u30FC";var kF=new RegExp(`[${Qc}APM]+$`,"g"),TF=new RegExp(`${Qc}[AP]M$`,"g"),My=[":","."];function Ur(i){return i}function Oy(){}var Wm=/[\\^$.*+?()[\]{}|]/g,Fy=new RegExp(Wm.source);function qt(i){return i&&Fy.test(i)?i.replaceAll(Wm,String.raw`\$&`):i}function Ni(i,{prefix:t,postfix:e}){var n,r;let o=new RegExp(`^${qt(t)}`),a=new RegExp(`${qt(e)}$`),[s=""]=(n=i.match(o))!==null&&n!==void 0?n:[],[l=""]=(r=i.match(a))!==null&&r!==void 0?r:[];return{extractedPrefix:s,extractedPostfix:l,cleanValue:s||l?i.slice(s.length,l.length?-l.length:1/0):i}}function Ay(i,t){let e="";for(let n=0;n<i.length;n++){if(i[n]!==t[n])return e;e+=i[n]}return e}function Nm(i){return i.replaceAll(/[0-9]/g,t=>String.fromCharCode(t.charCodeAt(0)-65248))}function Ry(){return({elementState:i,data:t})=>{let{value:e,selection:n}=i;return{elementState:{selection:n,value:Nm(e)},data:Nm(t)}}}var MF=new RegExp(`[${My.map(qt).join("")}]$`);function By(i){let t=new RegExp(`${qt(i)}$`);return i?({value:e,selection:n},r)=>{if(!e&&!r.value.endsWith(i))return{value:e,selection:n};if(!e.endsWith(i)&&!r.value.endsWith(i))return{selection:n,value:e+i};let o=r.value.replace(t,""),a=r.selection[1]>o.length,s=Ay(o,e);return{selection:n,value:Array.from(i).reverse().reduce((l,c,d)=>{let p=l.length-1-d,v=s[p]===c&&a;return l[p]!==c||v?l.slice(0,p+1)+c+l.slice(p+1):l},e)}}:Ur}function Ny(i){return i?({value:t,selection:e},n)=>{if(t.startsWith(i)||!t&&!n.value.startsWith(i))return{value:t,selection:e};let[r,o]=e,a=Array.from(i).reduce((l,c,d)=>l[d]===c?l:l.slice(0,d)+c+l.slice(d),t),s=a.length-t.length;return{selection:[r+s,o+s],value:a}}:Ur}function Wr(i,t,e){return(n,r)=>{let o=()=>t(n,r);return n.addEventListener(i,o,e),()=>n.removeEventListener(i,o,e)}}function zy(i){return(t,e)=>{let n=t.ownerDocument,r=0,o=()=>r++,a=()=>{r=Math.max(--r,0)},s=()=>{if(t.matches(":focus")){if(r)return n.addEventListener("mouseup",s,{once:!0,passive:!0});i(t,e)}};return n.addEventListener("selectionchange",s,{passive:!0}),t.addEventListener("mousedown",o,{passive:!0}),n.addEventListener("mouseup",a,{passive:!0}),()=>{n.removeEventListener("selectionchange",s),n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",a)}}}function $m(i){return zy(t=>{var e,n;let r=(e=t.selectionStart)!==null&&e!==void 0?e:0,o=(n=t.selectionEnd)!==null&&n!==void 0?n:0,[a,s]=i(t.value,[r,o]);(a>r||s<o)&&t.setSelectionRange(Vr(r,a,s),Vr(o,a,s))})}function Ly({prefix:i,postfix:t}){return({elementState:e,data:n})=>{let{cleanValue:r}=Ni(n,{prefix:i,postfix:t});return{elementState:e,data:r}}}function qm({decimalSeparator:i,isNegativeAllowed:t,precision:e,thousandSeparator:n,prefix:r,postfix:o,decimalPseudoSeparators:a=[],pseudoMinuses:s=[],minusSign:l}){let c=zm(r),d=String.raw`\d`,p=t?`[${l}${s.map(L=>`\\${L}`).join("")}]?`:"",v=n?`[${d}${qt(n).replaceAll(/\s/g,String.raw`\s`)}]*`:`[${d}]*`,g=Number.isFinite(e)?e:"",w=e>0?`([${qt(i)}${a.map(qt).join("")}]${d}{0,${g}})?`:"",E=zm(o);return new RegExp(`^${c}${p}${v}${w}${E}$`)}function zm(i){return i?`${i.split("").map(t=>`${qt(t)}?`).join("")}`:""}function Zc(i,t="."){let e=!!new RegExp(`^\\D*[${Kc}\\${Gs}${Hm}${Vm}${Um}]`).exec(i),n=qt(t),r=i.replaceAll(new RegExp(`${n}(?!\\d)`,"g"),"").replaceAll(new RegExp(`[^\\d${n}]`,"g"),"").replace(t,t&&".");return r?+`${e?Gs:""}${r}`:NaN}function jy(i){var t;let e=String(i),[n="",r]=e.split("e-"),o=e;if(r){let[,a]=n.split("."),s=Number(r)+((t=a?.length)!==null&&t!==void 0?t:0);o=i.toFixed(s)}return o}function Gm(i,{decimalSeparator:t,minusSign:e}){let[n="",r=""]=t?i.split(t):[i],o=qt(e),[,a="",s=""]=new RegExp(`^(?:[^\\d${o}])?(${o})?(.*)`).exec(n)||[];return{minus:a,integerPart:s,decimalPart:r}}function Hy({decimalSeparator:i,thousandSeparator:t,decimalPseudoSeparators:e=ky}){return e.filter(n=>n!==t&&n!==i)}function Vy({decimalSeparator:i,precision:t,decimalZeroPadding:e,prefix:n,postfix:r}){return t<=0||!e?Ur:({value:o,selection:a})=>{let{cleanValue:s,extractedPrefix:l,extractedPostfix:c}=Ni(o,{prefix:n,postfix:r});if(Number.isNaN(Zc(s,i)))return{value:o,selection:a};let[d,p=""]=s.split(i);return{value:l+d+i+p.padEnd(t,"0")+c,selection:a}}}function Uy({prefix:i,postfix:t,decimalSeparator:e,minusSign:n}){return({value:r,selection:o})=>{let[a]=o,{cleanValue:s,extractedPrefix:l,extractedPostfix:c}=Ni(r,{prefix:i,postfix:t}),{minus:d,integerPart:p,decimalPart:v}=Gm(s,{decimalSeparator:e,minusSign:n}),g=!p&&!v&&!!e&&s.includes(e);return!p&&!Number(v)&&a===(d+l).length||g?{selection:o,value:l+d+c}:{value:r,selection:o}}}function Wy({decimalSeparator:i,decimalPseudoSeparators:t,pseudoMinuses:e,prefix:n,postfix:r,minusSign:o}){let a=!0,s=qm({decimalSeparator:i,decimalPseudoSeparators:t,pseudoMinuses:e,prefix:"",postfix:"",thousandSeparator:"",precision:1/0,isNegativeAllowed:!0,minusSign:o});return({elementState:l,data:c})=>{if(!a)return{elementState:l,data:c};a=!1;let{value:d,selection:p}=l,[v,g]=p,{extractedPrefix:w,cleanValue:E,extractedPostfix:L}=Ni(d,{prefix:n,postfix:r}),F=Gn({selection:[Math.max(v-w.length,0),Vr(g-w.length,0,E.length)],value:E},{mask:s}),[G,he]=F.selection;return{elementState:{selection:[G+w.length,he+w.length],value:w+F.value+L},data:c}}}function $y({decimalSeparator:i,thousandSeparator:t,prefix:e,postfix:n}){let r=a=>{let s=qt(t);return a.replace(new RegExp(`^(\\D+)?[0${s}]+(?=0)`),"$1").replace(new RegExp(`^(\\D+)?[0${s}]+(?=[1-9])`),"$1")},o=(a,s)=>{let l=a.slice(0,s),c=a.slice(s).startsWith("0");return l.length-r(l).length+(c?1:0)};return({value:a,selection:s})=>{let[l,c]=s,{cleanValue:d,extractedPrefix:p,extractedPostfix:v}=Ni(a,{prefix:e,postfix:n}),g=!!i&&d.includes(i),[w="",E=""]=i?d.split(i):[d],L=r(w);if(w===L)return{value:a,selection:s};let F=l-o(a,l),G=c-o(a,c);return{value:p+L+(g?i:"")+E+v,selection:[Math.max(F,0),Math.max(G,0)]}}}function qy({min:i,max:t,decimalSeparator:e,minusSign:n}){return({value:r,selection:o})=>{let a=Zc(r,e),s=a>0?Math.min(a,t):Math.max(a,i);if(a&&s!==a){let l=`${s}`.replace(".",e).replace(Gs,n);return{value:l,selection:[l.length,l.length]}}return{value:r,selection:o}}}function Gy({decimalSeparator:i,thousandSeparator:t,decimalZeroPadding:e}){return({elementState:n,data:r},o)=>{let{value:a,selection:s}=n,[l,c]=s,d=a.slice(l,c),p=e?[i,t]:[t],v=e&&l>a.indexOf(i)&&!!d.match(/^0+$/gi);return o!=="deleteBackward"&&o!=="deleteForward"||!p.includes(d)&&!v?{elementState:n,data:r}:{elementState:{value:a,selection:o==="deleteForward"?[c,c]:[l,l]},data:r}}}function Yy({decimalSeparator:i,precision:t,prefix:e,postfix:n}){let r=new RegExp(`^\\D*${qt(i)}`);return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPrefix:d}=Ni(s,{prefix:e,postfix:n}),[p,v]=l,g=Vr(p-d.length,0,c.length),w=Vr(v-d.length,0,c.length);if(t<=0||c.slice(0,g).includes(i)||c.slice(w).includes(i)||!a.match(r))return{elementState:o,data:a};let E=/\d+/.exec(c.slice(0,g));return{elementState:o,data:E?a:`0${a}`}}}function Lm({validCharacter:i,pseudoCharacters:t,prefix:e,postfix:n}){let r=new RegExp(`[${t.join("")}]`,"gi");return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPostfix:d,extractedPrefix:p}=Ni(s,{prefix:e,postfix:n});return{elementState:{selection:l,value:p+c.replace(r,i)+d},data:a.replace(r,i)}}}function Xy({decimalSeparator:i,prefix:t,postfix:e}){return i?({elementState:n,data:r})=>{let{value:o,selection:a}=n,[s,l]=a,{cleanValue:c}=Ni(o,{prefix:t,postfix:e});return{elementState:n,data:!c.includes(i)||o.slice(s,l+1).includes(i)?r:r.replaceAll(new RegExp(qt(i),"gi"),"")}}:Ur}function Ky({thousandSeparator:i,decimalSeparator:t,prefix:e,postfix:n,minusSign:r}){if(!i)return Ur;let o=(...a)=>a.every(s=>/\s/.test(s));return({value:a,selection:s})=>{let[l,c]=s,[d,p]=s,{cleanValue:v,extractedPostfix:g,extractedPrefix:w}=Ni(a,{prefix:e,postfix:n}),{minus:E,integerPart:L,decimalPart:F}=Gm(v,{decimalSeparator:t,minusSign:r}),G=t&&v.includes(t),he=v.length-(E+L+(G?t+F:"")).length;he>0&&l&&l<=he&&(d-=he),he>0&&c&&c<=he&&(p-=he);let me=Array.from(L).reduceRight((se,y,x)=>{let z=!(!x&&y===i)&&!!se.length&&(se.length+1)%4===0,V=y===i||o(y,i);return z&&V?i+se:!z&&V?(x&&x<=l&&d--,x&&x<=c&&p--,se):z?(x<l&&d++,x<c&&p++,y+i+se):y+se},"");return{value:w+E+me+(G?t:"")+F+g,selection:[d,p]}}}function Qy({precision:i,decimalSeparator:t,prefix:e,postfix:n}){if(i>0||!t)return Ur;let r=new RegExp(`${qt(t)}.*$`,"g");return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPrefix:d,extractedPostfix:p}=Ni(s,{prefix:e,postfix:n}),[v,g]=l,w=d+c.replace(r,"")+p;return{elementState:{selection:[Math.min(v,w.length),Math.min(g,w.length)],value:w},data:a.replace(r,"")}}}var jm=[0,0];function Zy({decimalSeparator:i,thousandSeparator:t,prefix:e,postfix:n}){let r=$y({decimalSeparator:i,thousandSeparator:t,prefix:e,postfix:n});return Wr("blur",o=>{let a=r({value:o.value,selection:jm},{value:"",selection:jm}).value;Hr(o,a)},{capture:!0})}function Jy({min:i,max:t,decimalSeparator:e}){return Wr("blur",(n,r)=>{let o=Zc(n.value,e),a=Vr(o,i,t);!Number.isNaN(o)&&o!==a&&Hr(n,Gn(jy(a),r))},{capture:!0})}function e1({decimalSeparator:i,prefix:t,postfix:e}){return i?Wr("blur",n=>{let{cleanValue:r,extractedPostfix:o,extractedPrefix:a}=Ni(n.value,{prefix:t,postfix:e}),s=a+r.replace(new RegExp(`^(\\D+)?${qt(i)}`),`$10${i}`)+o;Hr(n,s)},{capture:!0}):Oy}function $r({max:i=Number.MAX_SAFE_INTEGER,min:t=Number.MIN_SAFE_INTEGER,precision:e=0,thousandSeparator:n=Qc,decimalSeparator:r=".",decimalPseudoSeparators:o,decimalZeroPadding:a=!1,prefix:s="",postfix:l="",minusSign:c=Kc}={}){let d=[Gs,Hm,Vm,Um,Kc].filter(w=>w!==n&&w!==r&&w!==c),p=Hy({decimalSeparator:r,thousandSeparator:n,decimalPseudoSeparators:o}),v=s.endsWith(r)&&e>0?`${s}${Ty}`:s,g=Wy({decimalSeparator:r,decimalPseudoSeparators:p,pseudoMinuses:d,prefix:v,postfix:l,minusSign:c});return r=e<=0&&r===n?"":r,Object.assign(Object.assign({},jr),{mask:qm({decimalSeparator:r,precision:e,thousandSeparator:n,prefix:v,postfix:l,isNegativeAllowed:t<0,minusSign:c}),preprocessors:[Ry(),g,Ly({prefix:v,postfix:l}),Lm({validCharacter:c,pseudoCharacters:d,prefix:v,postfix:l}),Lm({validCharacter:r,pseudoCharacters:p,prefix:v,postfix:l}),Yy({decimalSeparator:r,precision:e,prefix:v,postfix:l}),Gy({decimalSeparator:r,decimalZeroPadding:a,thousandSeparator:n}),Qy({precision:e,decimalSeparator:r,prefix:v,postfix:l}),Xy({decimalSeparator:r,prefix:v,postfix:l})],postprocessors:[qy({decimalSeparator:r,min:t,max:i,minusSign:c}),Ny(v),By(l),Ky({decimalSeparator:r,thousandSeparator:n,prefix:v,postfix:l,minusSign:c}),Vy({decimalSeparator:r,decimalZeroPadding:a,precision:e,prefix:v,postfix:l}),Uy({prefix:v,postfix:l,decimalSeparator:r,minusSign:c})],plugins:[Zy({decimalSeparator:r,thousandSeparator:n,prefix:v,postfix:l}),e1({decimalSeparator:r,prefix:v,postfix:l}),Jy({min:t,max:i,decimalSeparator:r})],overwriteMode:a?({value:w,selection:[E]})=>E<=w.indexOf(r)?"shift":"replace":"shift"})}var Gi=(()=>{class i{constructor(){this.elementRef=O(Ce).nativeElement,this.ngZone=O(We),this.maskedElement=null,this.options=null,this.elementPredicate=Rm;let e=O(ht,{self:!0,optional:!0});if(e){let n=e.writeValue.bind(e);e.writeValue=r=>{n(this.options?Gn(String(r??""),this.options):r)}}}ngOnChanges(){return j(this,null,function*(){let{elementPredicate:e,options:n,maskedElement:r,elementRef:o,ngZone:a}=this;if(r?.destroy(),!n)return;let s=yield e(o);this.elementPredicate!==e||this.options!==n||a.runOutsideAngular(()=>{this.maskedElement=new $s(s,n)})})}ngOnDestroy(){this.maskedElement?.destroy()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=Ue({type:i,selectors:[["","maskito",""]],inputs:{options:[0,"maskito","options"],elementPredicate:[0,"maskitoElement","elementPredicate"]},standalone:!0,features:[$t]})}}return i})(),Ym=(()=>{class i{transform(e,n){return Gn(String(e??""),n??jr)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=gs({name:"maskito",type:i,pure:!0,standalone:!0})}}return i})();var t1=new Ge("cdk-dir-doc",{providedIn:"root",factory:i1});function i1(){return O(Le)}var n1=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;function r1(i){let t=i?.toLowerCase()||"";return t==="auto"&&typeof navigator<"u"&&navigator?.language?n1.test(navigator.language)?"rtl":"ltr":t==="rtl"?"rtl":"ltr"}var Fn=(()=>{class i{constructor(e){if(this.value="ltr",this.change=new He,e){let n=e.body?e.body.dir:null,r=e.documentElement?e.documentElement.dir:null;this.value=r1(n||r||"ltr")}}ngOnDestroy(){this.change.complete()}static{this.\u0275fac=function(n){return new(n||i)(U(t1,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ki=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var Ho=class{attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},Jc=class extends Ho{constructor(t,e,n,r,o){super(),this.component=t,this.viewContainerRef=e,this.injector=n,this.componentFactoryResolver=r,this.projectableNodes=o}},An=class extends Ho{constructor(t,e,n,r){super(),this.templateRef=t,this.viewContainerRef=e,this.context=n,this.injector=r}get origin(){return this.templateRef.elementRef}attach(t,e=this.context){return this.context=e,super.attach(t)}detach(){return this.context=void 0,super.detach()}},ed=class extends Ho{constructor(t){super(),this.element=t instanceof Ce?t.nativeElement:t}},Xs=class{constructor(){this._isDisposed=!1,this.attachDomPortal=null}hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof Jc)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof An)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof ed)return this._attachedPortal=t,this.attachDomPortal(t)}detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}};var Ks=class extends Xs{constructor(t,e,n,r,o){super(),this.outletElement=t,this._componentFactoryResolver=e,this._appRef=n,this._defaultInjector=r,this.attachDomPortal=a=>{this._document;let s=a.element;s.parentNode;let l=this._document.createComment("dom-portal");s.parentNode.insertBefore(l,s),this.outletElement.appendChild(s),this._attachedPortal=a,super.setDisposeFn(()=>{l.parentNode&&l.parentNode.replaceChild(s,l)})},this._document=o}attachComponentPortal(t){let n=(t.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(t.component),r;return t.viewContainerRef?(r=t.viewContainerRef.createComponent(n,t.viewContainerRef.length,t.injector||t.viewContainerRef.injector,t.projectableNodes||void 0),this.setDisposeFn(()=>r.destroy())):(r=n.create(t.injector||this._defaultInjector||Ye.NULL),this._appRef.attachView(r.hostView),this.setDisposeFn(()=>{this._appRef.viewCount>0&&this._appRef.detachView(r.hostView),r.destroy()})),this.outletElement.appendChild(this._getComponentRootNode(r)),this._attachedPortal=t,r}attachTemplatePortal(t){let e=t.viewContainerRef,n=e.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return n.rootNodes.forEach(r=>this.outletElement.appendChild(r)),n.detectChanges(),this.setDisposeFn(()=>{let r=e.indexOf(n);r!==-1&&e.remove(r)}),this._attachedPortal=t,n}dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var Xm=(()=>{class i extends Xs{constructor(e,n,r){super(),this._componentFactoryResolver=e,this._viewContainerRef=n,this._isInitialized=!1,this.attached=new He,this.attachDomPortal=o=>{this._document;let a=o.element;a.parentNode;let s=this._document.createComment("dom-portal");o.setAttachedHost(this),a.parentNode.insertBefore(s,a),this._getRootNode().appendChild(a),this._attachedPortal=o,super.setDisposeFn(()=>{s.parentNode&&s.parentNode.replaceChild(a,s)})},this._document=r}get portal(){return this._attachedPortal}set portal(e){this.hasAttached()&&!e&&!this._isInitialized||(this.hasAttached()&&super.detach(),e&&super.attach(e),this._attachedPortal=e||null)}get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(e){e.setAttachedHost(this);let n=e.viewContainerRef!=null?e.viewContainerRef:this._viewContainerRef,o=(e.componentFactoryResolver||this._componentFactoryResolver).resolveComponentFactory(e.component),a=n.createComponent(o,n.length,e.injector||n.injector,e.projectableNodes||void 0);return n!==this._viewContainerRef&&this._getRootNode().appendChild(a.hostView.rootNodes[0]),super.setDisposeFn(()=>a.destroy()),this._attachedPortal=e,this._attachedRef=a,this.attached.emit(a),a}attachTemplatePortal(e){e.setAttachedHost(this);let n=this._viewContainerRef.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=e,this._attachedRef=n,this.attached.emit(n),n}_getRootNode(){let e=this._viewContainerRef.element.nativeElement;return e.nodeType===e.ELEMENT_NODE?e:e.parentNode}static{this.\u0275fac=function(n){return new(n||i)(W(vs),W(kn),W(Le))}}static{this.\u0275dir=Ue({type:i,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],standalone:!0,features:[Ci]})}}return i})();var qr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var id;try{id=typeof Intl<"u"&&Intl.v8BreakIterator}catch{id=!1}var lt=(()=>{class i{constructor(e){this._platformId=e,this.isBrowser=this._platformId?bm(this._platformId):typeof document=="object"&&!!document,this.EDGE=this.isBrowser&&/(edge)/i.test(navigator.userAgent),this.TRIDENT=this.isBrowser&&/(msie|trident)/i.test(navigator.userAgent),this.BLINK=this.isBrowser&&!!(window.chrome||id)&&typeof CSS<"u"&&!this.EDGE&&!this.TRIDENT,this.WEBKIT=this.isBrowser&&/AppleWebKit/i.test(navigator.userAgent)&&!this.BLINK&&!this.EDGE&&!this.TRIDENT,this.IOS=this.isBrowser&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!("MSStream"in window),this.FIREFOX=this.isBrowser&&/(firefox|minefield)/i.test(navigator.userAgent),this.ANDROID=this.isBrowser&&/android/i.test(navigator.userAgent)&&!this.TRIDENT,this.SAFARI=this.isBrowser&&/safari/i.test(navigator.userAgent)&&this.WEBKIT}static{this.\u0275fac=function(n){return new(n||i)(U(zc))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Km=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var Vo;function o1(){if(Vo==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Vo=!0}))}finally{Vo=Vo||!1}return Vo}function Gr(i){return o1()?i:!!i.capture}var Yn;function Qm(){if(Yn==null){if(typeof document!="object"||!document||typeof Element!="function"||!Element)return Yn=!1,Yn;if("scrollBehavior"in document.documentElement.style)Yn=!0;else{let i=Element.prototype.scrollTo;i?Yn=!/\{\s*\[native code\]\s*\}/.test(i.toString()):Yn=!1}}return Yn}var td;function a1(){if(td==null){let i=typeof document<"u"?document.head:null;td=!!(i&&(i.createShadowRoot||i.attachShadow))}return td}function Zm(i){if(a1()){let t=i.getRootNode?i.getRootNode():null;if(typeof ShadowRoot<"u"&&ShadowRoot&&t instanceof ShadowRoot)return t}return null}function nd(){let i=typeof document<"u"&&document?document.activeElement:null;for(;i&&i.shadowRoot;){let t=i.shadowRoot.activeElement;if(t===i)break;i=t}return i}function ui(i){return i.composedPath?i.composedPath()[0]:i.target}function Uo(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}function Xr(i){return Array.isArray(i)?i:[i]}function ct(i){return i==null?"":typeof i=="string"?i:`${i}px`}function ln(i){return i instanceof Ce?i.nativeElement:i}var f1=Ne(of(),1);var _A=new Ge("SMOOTH_SCROLL_OPTIONS");var af=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ve({}),i})();var g1=new Ge("NG_SCROLLBAR_OPTIONS");var Js=(()=>{class i{static withConfig(e){return{ngModule:i,providers:[{provide:g1,useValue:e}]}}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ve({imports:[et,ki,qr,Km,af]}),i})();function Yi(i,...t){return t.length?t.some(e=>i[e]):i.altKey||i.shiftKey||i.ctrlKey||i.metaKey}var b1=(()=>{class i{create(e){return typeof MutationObserver>"u"?null:new MutationObserver(e)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var sf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({providers:[b1]})}}return i})();var lf=new Set,Xn,v1=(()=>{class i{constructor(e,n){this._platform=e,this._nonce=n,this._matchMedia=this._platform.isBrowser&&window.matchMedia?window.matchMedia.bind(window):y1}matchMedia(e){return(this._platform.WEBKIT||this._platform.BLINK)&&_1(e,this._nonce),this._matchMedia(e)}static{this.\u0275fac=function(n){return new(n||i)(U(lt),U(lm,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function _1(i,t){if(!lf.has(i))try{Xn||(Xn=document.createElement("style"),t&&Xn.setAttribute("nonce",t),Xn.setAttribute("type","text/css"),document.head.appendChild(Xn)),Xn.sheet&&(Xn.sheet.insertRule(`@media ${i} {body{ }}`,0),lf.add(i))}catch(e){console.error(e)}}function y1(i){return{matches:i==="all"||i==="",media:i,addListener:()=>{},removeListener:()=>{}}}var el=(()=>{class i{constructor(e,n){this._mediaMatcher=e,this._zone=n,this._queries=new Map,this._destroySubject=new Te}ngOnDestroy(){this._destroySubject.next(),this._destroySubject.complete()}isMatched(e){return cf(Xr(e)).some(r=>this._registerQuery(r).mql.matches)}observe(e){let r=cf(Xr(e)).map(a=>this._registerQuery(a).observable),o=tm(r);return o=im(o.pipe(In(1)),o.pipe(fs(1),Er(0))),o.pipe(Ve(a=>{let s={matches:!1,breakpoints:{}};return a.forEach(({matches:l,query:c})=>{s.matches=s.matches||l,s.breakpoints[c]=l}),s}))}_registerQuery(e){if(this._queries.has(e))return this._queries.get(e);let n=this._mediaMatcher.matchMedia(e),o={observable:new Ft(a=>{let s=l=>this._zone.run(()=>a.next(l));return n.addListener(s),()=>{n.removeListener(s)}}).pipe(Ai(n),Ve(({matches:a})=>({query:e,matches:a})),ti(this._destroySubject)),mql:n};return this._queries.set(e,o),o}static{this.\u0275fac=function(n){return new(n||i)(U(v1),U(We))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function cf(i){return i.map(t=>t.split(",")).reduce((t,e)=>t.concat(e)).map(t=>t.trim())}var df={XSmall:"(max-width: 599.98px)",Small:"(min-width: 600px) and (max-width: 959.98px)",Medium:"(min-width: 960px) and (max-width: 1279.98px)",Large:"(min-width: 1280px) and (max-width: 1919.98px)",XLarge:"(min-width: 1920px)",Handset:"(max-width: 599.98px) and (orientation: portrait), (max-width: 959.98px) and (orientation: landscape)",Tablet:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), (min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",Web:"(min-width: 840px) and (orientation: portrait), (min-width: 1280px) and (orientation: landscape)",HandsetPortrait:"(max-width: 599.98px) and (orientation: portrait)",TabletPortrait:"(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)",WebPortrait:"(min-width: 840px) and (orientation: portrait)",HandsetLandscape:"(max-width: 959.98px) and (orientation: landscape)",TabletLandscape:"(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)",WebLandscape:"(min-width: 1280px) and (orientation: landscape)"};var hf=" ";function ld(i,t,e){let n=mf(i,t);e=e.trim(),!n.some(r=>r.trim()===e)&&(n.push(e),i.setAttribute(t,n.join(hf)))}function sl(i,t,e){let n=mf(i,t);e=e.trim();let r=n.filter(o=>o!==e);r.length?i.setAttribute(t,r.join(hf)):i.removeAttribute(t)}function mf(i,t){return i.getAttribute(t)?.match(/\S+/g)??[]}var N1=200,od=class{constructor(t,e){this._letterKeyStream=new Te,this._items=[],this._selectedItemIndex=-1,this._pressedLetters=[],this._selectedItem=new Te,this.selectedItem=this._selectedItem;let n=typeof e?.debounceInterval=="number"?e.debounceInterval:N1;e?.skipPredicate&&(this._skipPredicateFn=e.skipPredicate),this.setItems(t),this._setupKeyHandler(n)}destroy(){this._pressedLetters=[],this._letterKeyStream.complete(),this._selectedItem.complete()}setCurrentSelectedItemIndex(t){this._selectedItemIndex=t}setItems(t){this._items=t}handleKey(t){let e=t.keyCode;t.key&&t.key.length===1?this._letterKeyStream.next(t.key.toLocaleUpperCase()):(e>=65&&e<=90||e>=48&&e<=57)&&this._letterKeyStream.next(String.fromCharCode(e))}isTyping(){return this._pressedLetters.length>0}reset(){this._pressedLetters=[]}_setupKeyHandler(t){this._letterKeyStream.pipe(Ee(e=>this._pressedLetters.push(e)),Er(t),st(()=>this._pressedLetters.length>0),Ve(()=>this._pressedLetters.join("").toLocaleUpperCase())).subscribe(e=>{for(let n=1;n<this._items.length+1;n++){let r=(this._selectedItemIndex+n)%this._items.length,o=this._items[r];if(!this._skipPredicateFn?.(o)&&o.getLabel?.().toLocaleUpperCase().trim().indexOf(e)===0){this._selectedItem.next(o);break}}this._pressedLetters=[]})}},nl=class{constructor(t,e){this._items=t,this._activeItemIndex=-1,this._activeItem=B(null),this._wrap=!1,this._typeaheadSubscription=ei.EMPTY,this._vertical=!0,this._allowedModifierKeys=[],this._homeAndEnd=!1,this._pageUpAndDown={enabled:!1,delta:10},this._skipPredicateFn=n=>n.disabled,this.tabOut=new Te,this.change=new Te,t instanceof Dn?this._itemChangesSubscription=t.changes.subscribe(n=>this._itemsChanged(n.toArray())):Lc(t)&&(this._effectRef=an(()=>this._itemsChanged(t()),{injector:e}))}skipPredicate(t){return this._skipPredicateFn=t,this}withWrap(t=!0){return this._wrap=t,this}withVerticalOrientation(t=!0){return this._vertical=t,this}withHorizontalOrientation(t){return this._horizontal=t,this}withAllowedModifierKeys(t){return this._allowedModifierKeys=t,this}withTypeAhead(t=200){this._typeaheadSubscription.unsubscribe();let e=this._getItemsArray();return this._typeahead=new od(e,{debounceInterval:typeof t=="number"?t:void 0,skipPredicate:n=>this._skipPredicateFn(n)}),this._typeaheadSubscription=this._typeahead.selectedItem.subscribe(n=>{this.setActiveItem(n)}),this}cancelTypeahead(){return this._typeahead?.reset(),this}withHomeAndEnd(t=!0){return this._homeAndEnd=t,this}withPageUpDown(t=!0,e=10){return this._pageUpAndDown={enabled:t,delta:e},this}setActiveItem(t){let e=this._activeItem();this.updateActiveItem(t),this._activeItem()!==e&&this.change.next(this._activeItemIndex)}onKeydown(t){let e=t.keyCode,r=["altKey","ctrlKey","metaKey","shiftKey"].every(o=>!t[o]||this._allowedModifierKeys.indexOf(o)>-1);switch(e){case 9:this.tabOut.next();return;case 40:if(this._vertical&&r){this.setNextItemActive();break}else return;case 38:if(this._vertical&&r){this.setPreviousItemActive();break}else return;case 39:if(this._horizontal&&r){this._horizontal==="rtl"?this.setPreviousItemActive():this.setNextItemActive();break}else return;case 37:if(this._horizontal&&r){this._horizontal==="rtl"?this.setNextItemActive():this.setPreviousItemActive();break}else return;case 36:if(this._homeAndEnd&&r){this.setFirstItemActive();break}else return;case 35:if(this._homeAndEnd&&r){this.setLastItemActive();break}else return;case 33:if(this._pageUpAndDown.enabled&&r){let o=this._activeItemIndex-this._pageUpAndDown.delta;this._setActiveItemByIndex(o>0?o:0,1);break}else return;case 34:if(this._pageUpAndDown.enabled&&r){let o=this._activeItemIndex+this._pageUpAndDown.delta,a=this._getItemsArray().length;this._setActiveItemByIndex(o<a?o:a-1,-1);break}else return;default:(r||Yi(t,"shiftKey"))&&this._typeahead?.handleKey(t);return}this._typeahead?.reset(),t.preventDefault()}get activeItemIndex(){return this._activeItemIndex}get activeItem(){return this._activeItem()}isTyping(){return!!this._typeahead&&this._typeahead.isTyping()}setFirstItemActive(){this._setActiveItemByIndex(0,1)}setLastItemActive(){this._setActiveItemByIndex(this._getItemsArray().length-1,-1)}setNextItemActive(){this._activeItemIndex<0?this.setFirstItemActive():this._setActiveItemByDelta(1)}setPreviousItemActive(){this._activeItemIndex<0&&this._wrap?this.setLastItemActive():this._setActiveItemByDelta(-1)}updateActiveItem(t){let e=this._getItemsArray(),n=typeof t=="number"?t:e.indexOf(t),r=e[n];this._activeItem.set(r??null),this._activeItemIndex=n,this._typeahead?.setCurrentSelectedItemIndex(n)}destroy(){this._typeaheadSubscription.unsubscribe(),this._itemChangesSubscription?.unsubscribe(),this._effectRef?.destroy(),this._typeahead?.destroy(),this.tabOut.complete(),this.change.complete()}_setActiveItemByDelta(t){this._wrap?this._setActiveInWrapMode(t):this._setActiveInDefaultMode(t)}_setActiveInWrapMode(t){let e=this._getItemsArray();for(let n=1;n<=e.length;n++){let r=(this._activeItemIndex+t*n+e.length)%e.length,o=e[r];if(!this._skipPredicateFn(o)){this.setActiveItem(r);return}}}_setActiveInDefaultMode(t){this._setActiveItemByIndex(this._activeItemIndex+t,t)}_setActiveItemByIndex(t,e){let n=this._getItemsArray();if(n[t]){for(;this._skipPredicateFn(n[t]);)if(t+=e,!n[t])return;this.setActiveItem(t)}}_getItemsArray(){return Lc(this._items)?this._items():this._items instanceof Dn?this._items.toArray():this._items}_itemsChanged(t){this._typeahead?.setItems(t);let e=this._activeItem();if(e){let n=t.indexOf(e);n>-1&&n!==this._activeItemIndex&&(this._activeItemIndex=n,this._typeahead?.setCurrentSelectedItemIndex(n))}}},rl=class extends nl{setActiveItem(t){this.activeItem&&this.activeItem.setInactiveStyles(),super.setActiveItem(t),this.activeItem&&this.activeItem.setActiveStyles()}},ol=class extends nl{constructor(){super(...arguments),this._origin="program"}setFocusOrigin(t){return this._origin=t,this}setActiveItem(t){super.setActiveItem(t),this.activeItem&&this.activeItem.focus(this._origin)}};function cd(i){return i.buttons===0||i.detail===0}function dd(i){let t=i.touches&&i.touches[0]||i.changedTouches&&i.changedTouches[0];return!!t&&t.identifier===-1&&(t.radiusX==null||t.radiusX===1)&&(t.radiusY==null||t.radiusY===1)}var z1=new Ge("cdk-input-modality-detector-options"),L1={ignoreKeys:[18,17,224,91,16]},ff=650,Kr=Gr({passive:!0,capture:!0}),j1=(()=>{class i{get mostRecentModality(){return this._modality.value}constructor(e,n,r,o){this._platform=e,this._mostRecentTarget=null,this._modality=new ko(null),this._lastTouchMs=0,this._onKeydown=a=>{this._options?.ignoreKeys?.some(s=>s===a.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ui(a))},this._onMousedown=a=>{Date.now()-this._lastTouchMs<ff||(this._modality.next(cd(a)?"keyboard":"mouse"),this._mostRecentTarget=ui(a))},this._onTouchstart=a=>{if(dd(a)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ui(a)},this._options=_(_({},L1),o),this.modalityDetected=this._modality.pipe(fs(1)),this.modalityChanged=this.modalityDetected.pipe(To()),e.isBrowser&&n.runOutsideAngular(()=>{r.addEventListener("keydown",this._onKeydown,Kr),r.addEventListener("mousedown",this._onMousedown,Kr),r.addEventListener("touchstart",this._onTouchstart,Kr)})}ngOnDestroy(){this._modality.complete(),this._platform.isBrowser&&(document.removeEventListener("keydown",this._onKeydown,Kr),document.removeEventListener("mousedown",this._onMousedown,Kr),document.removeEventListener("touchstart",this._onTouchstart,Kr))}static{this.\u0275fac=function(n){return new(n||i)(U(lt),U(We),U(Le),U(z1,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var il=function(i){return i[i.IMMEDIATE=0]="IMMEDIATE",i[i.EVENTUAL=1]="EVENTUAL",i}(il||{}),H1=new Ge("cdk-focus-monitor-default-options"),tl=Gr({passive:!0,capture:!0}),gf=(()=>{class i{constructor(e,n,r,o,a){this._ngZone=e,this._platform=n,this._inputModalityDetector=r,this._origin=null,this._windowFocused=!1,this._originFromTouchInteraction=!1,this._elementInfo=new Map,this._monitoredElementCount=0,this._rootNodeFocusListenerCount=new Map,this._windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=window.setTimeout(()=>this._windowFocused=!1)},this._stopInputModalityDetector=new Te,this._rootNodeFocusAndBlurListener=s=>{let l=ui(s);for(let c=l;c;c=c.parentElement)s.type==="focus"?this._onFocus(s,c):this._onBlur(s,c)},this._document=o,this._detectionMode=a?.detectionMode||il.IMMEDIATE}monitor(e,n=!1){let r=ln(e);if(!this._platform.isBrowser||r.nodeType!==1)return wt();let o=Zm(r)||this._getDocument(),a=this._elementInfo.get(r);if(a)return n&&(a.checkChildren=!0),a.subject;let s={checkChildren:n,subject:new Te,rootNode:o};return this._elementInfo.set(r,s),this._registerGlobalListeners(s),s.subject}stopMonitoring(e){let n=ln(e),r=this._elementInfo.get(n);r&&(r.subject.complete(),this._setClasses(n),this._elementInfo.delete(n),this._removeGlobalListeners(r))}focusVia(e,n,r){let o=ln(e),a=this._getDocument().activeElement;o===a?this._getClosestElementsInfo(o).forEach(([s,l])=>this._originChanged(s,n,l)):(this._setOrigin(n),typeof o.focus=="function"&&o.focus(r))}ngOnDestroy(){this._elementInfo.forEach((e,n)=>this.stopMonitoring(n))}_getDocument(){return this._document||document}_getWindow(){return this._getDocument().defaultView||window}_getFocusOrigin(e){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(e)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:e&&this._isLastInteractionFromInputLabel(e)?"mouse":"program"}_shouldBeAttributedToTouch(e){return this._detectionMode===il.EVENTUAL||!!e?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(e,n){e.classList.toggle("cdk-focused",!!n),e.classList.toggle("cdk-touch-focused",n==="touch"),e.classList.toggle("cdk-keyboard-focused",n==="keyboard"),e.classList.toggle("cdk-mouse-focused",n==="mouse"),e.classList.toggle("cdk-program-focused",n==="program")}_setOrigin(e,n=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=e,this._originFromTouchInteraction=e==="touch"&&n,this._detectionMode===il.IMMEDIATE){clearTimeout(this._originTimeoutId);let r=this._originFromTouchInteraction?ff:1;this._originTimeoutId=setTimeout(()=>this._origin=null,r)}})}_onFocus(e,n){let r=this._elementInfo.get(n),o=ui(e);!r||!r.checkChildren&&n!==o||this._originChanged(n,this._getFocusOrigin(o),r)}_onBlur(e,n){let r=this._elementInfo.get(n);!r||r.checkChildren&&e.relatedTarget instanceof Node&&n.contains(e.relatedTarget)||(this._setClasses(n),this._emitOrigin(r,null))}_emitOrigin(e,n){e.subject.observers.length&&this._ngZone.run(()=>e.subject.next(n))}_registerGlobalListeners(e){if(!this._platform.isBrowser)return;let n=e.rootNode,r=this._rootNodeFocusListenerCount.get(n)||0;r||this._ngZone.runOutsideAngular(()=>{n.addEventListener("focus",this._rootNodeFocusAndBlurListener,tl),n.addEventListener("blur",this._rootNodeFocusAndBlurListener,tl)}),this._rootNodeFocusListenerCount.set(n,r+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(ti(this._stopInputModalityDetector)).subscribe(o=>{this._setOrigin(o,!0)}))}_removeGlobalListeners(e){let n=e.rootNode;if(this._rootNodeFocusListenerCount.has(n)){let r=this._rootNodeFocusListenerCount.get(n);r>1?this._rootNodeFocusListenerCount.set(n,r-1):(n.removeEventListener("focus",this._rootNodeFocusAndBlurListener,tl),n.removeEventListener("blur",this._rootNodeFocusAndBlurListener,tl),this._rootNodeFocusListenerCount.delete(n))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(e,n,r){this._setClasses(e,n),this._emitOrigin(r,n),this._lastFocusOrigin=n}_getClosestElementsInfo(e){let n=[];return this._elementInfo.forEach((r,o)=>{(o===e||r.checkChildren&&o.contains(e))&&n.push([o,r])}),n}_isLastInteractionFromInputLabel(e){let{_mostRecentTarget:n,mostRecentModality:r}=this._inputModalityDetector;if(r!=="mouse"||!n||n===e||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA"||e.disabled)return!1;let o=e.labels;if(o){for(let a=0;a<o.length;a++)if(o[a].contains(n))return!0}return!1}static{this.\u0275fac=function(n){return new(n||i)(U(We),U(lt),U(j1),U(Le,8),U(H1,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Kn=function(i){return i[i.NONE=0]="NONE",i[i.BLACK_ON_WHITE=1]="BLACK_ON_WHITE",i[i.WHITE_ON_BLACK=2]="WHITE_ON_BLACK",i}(Kn||{}),pf="cdk-high-contrast-black-on-white",uf="cdk-high-contrast-white-on-black",rd="cdk-high-contrast-active",bf=(()=>{class i{constructor(e,n){this._platform=e,this._document=n,this._breakpointSubscription=O(el).observe("(forced-colors: active)").subscribe(()=>{this._hasCheckedHighContrastMode&&(this._hasCheckedHighContrastMode=!1,this._applyBodyHighContrastModeCssClasses())})}getHighContrastMode(){if(!this._platform.isBrowser)return Kn.NONE;let e=this._document.createElement("div");e.style.backgroundColor="rgb(1,2,3)",e.style.position="absolute",this._document.body.appendChild(e);let n=this._document.defaultView||window,r=n&&n.getComputedStyle?n.getComputedStyle(e):null,o=(r&&r.backgroundColor||"").replace(/ /g,"");switch(e.remove(),o){case"rgb(0,0,0)":case"rgb(45,50,54)":case"rgb(32,32,32)":return Kn.WHITE_ON_BLACK;case"rgb(255,255,255)":case"rgb(255,250,239)":return Kn.BLACK_ON_WHITE}return Kn.NONE}ngOnDestroy(){this._breakpointSubscription.unsubscribe()}_applyBodyHighContrastModeCssClasses(){if(!this._hasCheckedHighContrastMode&&this._platform.isBrowser&&this._document.body){let e=this._document.body.classList;e.remove(rd,pf,uf),this._hasCheckedHighContrastMode=!0;let n=this.getHighContrastMode();n===Kn.BLACK_ON_WHITE?e.add(rd,pf):n===Kn.WHITE_ON_BLACK&&e.add(rd,uf)}}static{this.\u0275fac=function(n){return new(n||i)(U(lt),U(Le))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var U1=["text"],W1=[[["mat-icon"]],"*"],$1=["mat-icon","*"];function q1(i,t){if(i&1&&J(0,"mat-pseudo-checkbox",1),i&2){let e=S();C("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function G1(i,t){if(i&1&&J(0,"mat-pseudo-checkbox",3),i&2){let e=S();C("disabled",e.disabled)}}function Y1(i,t){if(i&1&&(h(0,"span",4),b(1),m()),i&2){let e=S();f(),Ht("(",e.group.label,")")}}function X1(){return!0}var K1=new Ge("mat-sanity-checks",{providedIn:"root",factory:X1}),rt=(()=>{class i{constructor(e,n,r){this._sanityChecks=n,this._document=r,this._hasDoneGlobalChecks=!1,e._applyBodyHighContrastModeCssClasses(),this._hasDoneGlobalChecks||(this._hasDoneGlobalChecks=!0)}_checkIsEnabled(e){return Uo()?!1:typeof this._sanityChecks=="boolean"?this._sanityChecks:!!this._sanityChecks[e]}static{this.\u0275fac=function(n){return new(n||i)(U(bf),U(K1,8),U(Le))}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[ki,ki]})}}return i})();var Go=(()=>{class i{isErrorState(e,n){return!!(e&&e.invalid&&(e.touched||n&&n.submitted))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ti=function(i){return i[i.FADING_IN=0]="FADING_IN",i[i.VISIBLE=1]="VISIBLE",i[i.FADING_OUT=2]="FADING_OUT",i[i.HIDDEN=3]="HIDDEN",i}(Ti||{}),pd=class{constructor(t,e,n,r=!1){this._renderer=t,this.element=e,this.config=n,this._animationForciblyDisabledThroughCss=r,this.state=Ti.HIDDEN}fadeOut(){this._renderer.fadeOutRipple(this)}},_f=Gr({passive:!0,capture:!0}),ud=class{constructor(){this._events=new Map,this._delegateEventHandler=t=>{let e=ui(t);e&&this._events.get(t.type)?.forEach((n,r)=>{(r===e||r.contains(e))&&n.forEach(o=>o.handleEvent(t))})}}addHandler(t,e,n,r){let o=this._events.get(e);if(o){let a=o.get(n);a?a.add(r):o.set(n,new Set([r]))}else this._events.set(e,new Map([[n,new Set([r])]])),t.runOutsideAngular(()=>{document.addEventListener(e,this._delegateEventHandler,_f)})}removeHandler(t,e,n){let r=this._events.get(t);if(!r)return;let o=r.get(e);o&&(o.delete(n),o.size===0&&r.delete(e),r.size===0&&(this._events.delete(t),document.removeEventListener(t,this._delegateEventHandler,_f)))}},yf={enterDuration:225,exitDuration:150},Q1=800,wf=Gr({passive:!0,capture:!0}),xf=["mousedown","touchstart"],Cf=["mouseup","mouseleave","touchend","touchcancel"],hd=class i{static{this._eventManager=new ud}constructor(t,e,n,r){this._target=t,this._ngZone=e,this._platform=r,this._isPointerDown=!1,this._activeRipples=new Map,this._pointerUpEventsRegistered=!1,r.isBrowser&&(this._containerElement=ln(n))}fadeInRipple(t,e,n={}){let r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o=_(_({},yf),n.animation);n.centered&&(t=r.left+r.width/2,e=r.top+r.height/2);let a=n.radius||Z1(t,e,r),s=t-r.left,l=e-r.top,c=o.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=`${s-a}px`,d.style.top=`${l-a}px`,d.style.height=`${a*2}px`,d.style.width=`${a*2}px`,n.color!=null&&(d.style.backgroundColor=n.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d);let p=window.getComputedStyle(d),v=p.transitionProperty,g=p.transitionDuration,w=v==="none"||g==="0s"||g==="0s, 0s"||r.width===0&&r.height===0,E=new pd(this,d,n,w);d.style.transform="scale3d(1, 1, 1)",E.state=Ti.FADING_IN,n.persistent||(this._mostRecentTransientRipple=E);let L=null;return!w&&(c||o.exitDuration)&&this._ngZone.runOutsideAngular(()=>{let F=()=>{L&&(L.fallbackTimer=null),clearTimeout(he),this._finishRippleTransition(E)},G=()=>this._destroyRipple(E),he=setTimeout(G,c+100);d.addEventListener("transitionend",F),d.addEventListener("transitioncancel",G),L={onTransitionEnd:F,onTransitionCancel:G,fallbackTimer:he}}),this._activeRipples.set(E,L),(w||!c)&&this._finishRippleTransition(E),E}fadeOutRipple(t){if(t.state===Ti.FADING_OUT||t.state===Ti.HIDDEN)return;let e=t.element,n=_(_({},yf),t.config.animation);e.style.transitionDuration=`${n.exitDuration}ms`,e.style.opacity="0",t.state=Ti.FADING_OUT,(t._animationForciblyDisabledThroughCss||!n.exitDuration)&&this._finishRippleTransition(t)}fadeOutAll(){this._getActiveRipples().forEach(t=>t.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(t=>{t.config.persistent||t.fadeOut()})}setupTriggerEvents(t){let e=ln(t);!this._platform.isBrowser||!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,xf.forEach(n=>{i._eventManager.addHandler(this._ngZone,n,e,this)}))}handleEvent(t){t.type==="mousedown"?this._onMousedown(t):t.type==="touchstart"?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{Cf.forEach(e=>{this._triggerElement.addEventListener(e,this,wf)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(t){t.state===Ti.FADING_IN?this._startFadeOutTransition(t):t.state===Ti.FADING_OUT&&this._destroyRipple(t)}_startFadeOutTransition(t){let e=t===this._mostRecentTransientRipple,{persistent:n}=t.config;t.state=Ti.VISIBLE,!n&&(!e||!this._isPointerDown)&&t.fadeOut()}_destroyRipple(t){let e=this._activeRipples.get(t)??null;this._activeRipples.delete(t),this._activeRipples.size||(this._containerRect=null),t===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),t.state=Ti.HIDDEN,e!==null&&(t.element.removeEventListener("transitionend",e.onTransitionEnd),t.element.removeEventListener("transitioncancel",e.onTransitionCancel),e.fallbackTimer!==null&&clearTimeout(e.fallbackTimer)),t.element.remove()}_onMousedown(t){let e=cd(t),n=this._lastTouchStartEvent&&Date.now()<this._lastTouchStartEvent+Q1;!this._target.rippleDisabled&&!e&&!n&&(this._isPointerDown=!0,this.fadeInRipple(t.clientX,t.clientY,this._target.rippleConfig))}_onTouchStart(t){if(!this._target.rippleDisabled&&!dd(t)){this._lastTouchStartEvent=Date.now(),this._isPointerDown=!0;let e=t.changedTouches;if(e)for(let n=0;n<e.length;n++)this.fadeInRipple(e[n].clientX,e[n].clientY,this._target.rippleConfig)}}_onPointerUp(){this._isPointerDown&&(this._isPointerDown=!1,this._getActiveRipples().forEach(t=>{let e=t.state===Ti.VISIBLE||t.config.terminateOnPointerUp&&t.state===Ti.FADING_IN;!t.config.persistent&&e&&t.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){let t=this._triggerElement;t&&(xf.forEach(e=>i._eventManager.removeHandler(e,t,this)),this._pointerUpEventsRegistered&&(Cf.forEach(e=>t.removeEventListener(e,this,wf)),this._pointerUpEventsRegistered=!1))}};function Z1(i,t,e){let n=Math.max(Math.abs(i-e.left),Math.abs(i-e.right)),r=Math.max(Math.abs(t-e.top),Math.abs(t-e.bottom));return Math.sqrt(n*n+r*r)}var J1=new Ge("mat-ripple-global-options"),fd=(()=>{class i{get disabled(){return this._disabled}set disabled(e){e&&this.fadeOutAllNonPersistent(),this._disabled=e,this._setupTriggerEventsIfEnabled()}get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(e){this._trigger=e,this._setupTriggerEventsIfEnabled()}constructor(e,n,r,o,a){this._elementRef=e,this._animationMode=a,this.radius=0,this._disabled=!1,this._isInitialized=!1,this._globalOptions=o||{},this._rippleRenderer=new hd(this,n,e,r)}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:_(_(_({},this._globalOptions.animation),this._animationMode==="NoopAnimations"?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(e,n=0,r){return typeof e=="number"?this._rippleRenderer.fadeInRipple(e,n,_(_({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,_(_({},this.rippleConfig),e))}static{this.\u0275fac=function(n){return new(n||i)(W(Ce),W(We),W(lt),W(J1,8),W(Dr,8))}}static{this.\u0275dir=Ue({type:i,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(n,r){n&2&&Ze("mat-ripple-unbounded",r.unbounded)},inputs:{color:[0,"matRippleColor","color"],unbounded:[0,"matRippleUnbounded","unbounded"],centered:[0,"matRippleCentered","centered"],radius:[0,"matRippleRadius","radius"],animation:[0,"matRippleAnimation","animation"],disabled:[0,"matRippleDisabled","disabled"],trigger:[0,"matRippleTrigger","trigger"]},exportAs:["matRipple"],standalone:!0})}}return i})(),Yo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,rt]})}}return i})(),ew=(()=>{class i{constructor(e){this._animationMode=e,this.state="unchecked",this.disabled=!1,this.appearance="full"}static{this.\u0275fac=function(n){return new(n||i)(W(Dr,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(n,r){n&2&&Ze("mat-pseudo-checkbox-indeterminate",r.state==="indeterminate")("mat-pseudo-checkbox-checked",r.state==="checked")("mat-pseudo-checkbox-disabled",r.disabled)("mat-pseudo-checkbox-minimal",r.appearance==="minimal")("mat-pseudo-checkbox-full",r.appearance==="full")("_mat-animation-noopable",r._animationMode==="NoopAnimations")},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},standalone:!0,features:[fe],decls:0,vars:0,template:function(n,r){},styles:['.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-minimal-pseudo-checkbox-selected-checkmark-color, var(--mat-app-primary))}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-minimal-pseudo-checkbox-disabled-selected-checkmark-color)}.mat-pseudo-checkbox-full{border-color:var(--mat-full-pseudo-checkbox-unselected-icon-color, var(--mat-app-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-full-pseudo-checkbox-disabled-unselected-icon-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-full-pseudo-checkbox-selected-icon-color, var(--mat-app-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-full-pseudo-checkbox-selected-checkmark-color, var(--mat-app-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-full-pseudo-checkbox-disabled-selected-icon-color)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after{color:var(--mat-full-pseudo-checkbox-disabled-selected-checkmark-color, var(--mat-app-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}'],encapsulation:2,changeDetection:0})}}return i})(),tw=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt]})}}return i})(),gd=new Ge("MAT_OPTION_PARENT_COMPONENT");var bd=new Ge("MatOptgroup");var iw=0,$o=class{constructor(t,e=!1){this.source=t,this.isUserInput=e}},ll=(()=>{class i{get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}get disabled(){return this.group&&this.group.disabled||this._disabled}set disabled(e){this._disabled=e}get disableRipple(){return!!(this._parent&&this._parent.disableRipple)}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}constructor(e,n,r,o){this._element=e,this._changeDetectorRef=n,this._parent=r,this.group=o,this._selected=!1,this._active=!1,this._disabled=!1,this._mostRecentViewValue="",this.id=`mat-option-${iw++}`,this.onSelectionChange=new He,this._stateChanges=new Te}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,n){let r=this._getHostElement();typeof r.focus=="function"&&r.focus(n)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!Yi(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new $o(this,e))}static{this.\u0275fac=function(n){return new(n||i)(W(Ce),W(It),W(gd,8),W(bd,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-option"]],viewQuery:function(n,r){if(n&1&&ut(U1,7),n&2){let o;Fe(o=Ae())&&(r._text=o.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(n,r){n&1&&N("click",function(){return r._selectViaInteraction()})("keydown",function(a){return r._handleKeydown(a)}),n&2&&(Tr("id",r.id),qe("aria-selected",r.selected)("aria-disabled",r.disabled.toString()),Ze("mdc-list-item--selected",r.selected)("mat-mdc-option-multiple",r.multiple)("mat-mdc-option-active",r.active)("mdc-list-item--disabled",r.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",xt]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],standalone:!0,features:[Lt,fe],ngContentSelectors:$1,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-mdc-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(n,r){n&1&&(jt(W1),H(0,q1,1,2,"mat-pseudo-checkbox",1),At(1),h(2,"span",2,0),At(4,1),m(),H(5,G1,1,1,"mat-pseudo-checkbox",3)(6,Y1,2,1,"span",4),J(7,"div",5)),n&2&&(ae(r.multiple?0:-1),f(5),ae(!r.multiple&&r.selected&&!r.hideSingleSelectionIndicator?5:-1),f(),ae(r.group&&r.group._inert?6:-1),f(),C("matRippleTrigger",r._getHostElement())("matRippleDisabled",r.disabled||r.disableRipple))},dependencies:[ew,fd],styles:['.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-app-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-app-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-app-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-app-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-app-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-app-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color)}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color);outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-app-on-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-multiple){background-color:var(--mat-option-selected-state-layer-color, var(--mat-app-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-minimal-pseudo-checkbox-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-app-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}.cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .cdk-high-contrast-active .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple)::after{right:auto;left:16px}.mat-mdc-option-multiple{--mdc-list-list-item-selected-container-color:var(--mdc-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-mdc-focus-indicator::before{content:""}'],encapsulation:2,changeDetection:0})}}return i})();function Sf(i,t,e){if(e.length){let n=t.toArray(),r=e.toArray(),o=0;for(let a=0;a<i+1;a++)n[a].group&&n[a].group===r[o]&&o++;return o}return 0}function Pf(i,t,e,n){return i<e?i:i+t>e+n?Math.max(0,i-n+t):e}var vd=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[Yo,rt,tw]})}}return i})();var nw=20,If=(()=>{class i{constructor(e,n,r){this._ngZone=e,this._platform=n,this._scrolled=new Te,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(e){this.scrollContainers.has(e)||this.scrollContainers.set(e,e.elementScrolled().subscribe(()=>this._scrolled.next(e)))}deregister(e){let n=this.scrollContainers.get(e);n&&(n.unsubscribe(),this.scrollContainers.delete(e))}scrolled(e=nw){return this._platform.isBrowser?new Ft(n=>{this._globalSubscription||this._addGlobalListener();let r=e>0?this._scrolled.pipe(Oc(e)).subscribe(n):this._scrolled.subscribe(n);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):wt()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((e,n)=>this.deregister(n)),this._scrolled.complete()}ancestorScrolled(e,n){let r=this.getAncestorScrollContainers(e);return this.scrolled(n).pipe(st(o=>!o||r.indexOf(o)>-1))}getAncestorScrollContainers(e){let n=[];return this.scrollContainers.forEach((r,o)=>{this._scrollableContainsElement(o,e)&&n.push(o)}),n}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(e,n){let r=ln(n),o=e.getElementRef().nativeElement;do if(r==o)return!0;while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>{let e=this._getWindow();return Vn(e.document,"scroll").subscribe(()=>this._scrolled.next())})}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}static{this.\u0275fac=function(n){return new(n||i)(U(We),U(lt),U(Le,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var rw=20,Xo=(()=>{class i{constructor(e,n,r){this._platform=e,this._change=new Te,this._changeListener=o=>{this._change.next(o)},this._document=r,n.runOutsideAngular(()=>{if(e.isBrowser){let o=this._getWindow();o.addEventListener("resize",this._changeListener),o.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let e=this._getWindow();e.removeEventListener("resize",this._changeListener),e.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let e={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),e}getViewportRect(){let e=this.getViewportScrollPosition(),{width:n,height:r}=this.getViewportSize();return{top:e.top,left:e.left,bottom:e.top+r,right:e.left+n,height:r,width:n}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let e=this._document,n=this._getWindow(),r=e.documentElement,o=r.getBoundingClientRect(),a=-o.top||e.body.scrollTop||n.scrollY||r.scrollTop||0,s=-o.left||e.body.scrollLeft||n.scrollX||r.scrollLeft||0;return{top:a,left:s}}change(e=rw){return e>0?this._change.pipe(Oc(e)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let e=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:e.innerWidth,height:e.innerHeight}:{width:0,height:0}}static{this.\u0275fac=function(n){return new(n||i)(U(lt),U(We),U(Le,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var cl=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})(),_d=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[ki,cl,ki,cl]})}}return i})();var kf=Qm(),yd=class{constructor(t,e){this._viewportRuler=t,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=e}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=ct(-this._previousScrollPosition.left),t.style.top=ct(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,e=this._document.body,n=t.style,r=e.style,o=n.scrollBehavior||"",a=r.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),kf&&(n.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),kf&&(n.scrollBehavior=o,r.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let e=this._document.body,n=this._viewportRuler.getViewportSize();return e.scrollHeight>n.height||e.scrollWidth>n.width}};var wd=class{constructor(t,e,n,r){this._scrollDispatcher=t,this._ngZone=e,this._viewportRuler=n,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(this._scrollSubscription)return;let t=this._scrollDispatcher.scrolled(0).pipe(st(e=>!e||!this._overlayRef.overlayElement.contains(e.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=t.subscribe(()=>{let e=this._viewportRuler.getViewportScrollPosition().top;Math.abs(e-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=t.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},dl=class{enable(){}disable(){}attach(){}};function xd(i,t){return t.some(e=>{let n=i.bottom<e.top,r=i.top>e.bottom,o=i.right<e.left,a=i.left>e.right;return n||r||o||a})}function Tf(i,t){return t.some(e=>{let n=i.top<e.top,r=i.bottom>e.bottom,o=i.left<e.left,a=i.right>e.right;return n||r||o||a})}var Cd=class{constructor(t,e,n,r){this._scrollDispatcher=t,this._viewportRuler=e,this._ngZone=n,this._config=r,this._scrollSubscription=null}attach(t){this._overlayRef,this._overlayRef=t}enable(){if(!this._scrollSubscription){let t=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(t).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let e=this._overlayRef.overlayElement.getBoundingClientRect(),{width:n,height:r}=this._viewportRuler.getViewportSize();xd(e,[{width:n,height:r,bottom:r,right:n,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},ow=(()=>{class i{constructor(e,n,r,o){this._scrollDispatcher=e,this._viewportRuler=n,this._ngZone=r,this.noop=()=>new dl,this.close=a=>new wd(this._scrollDispatcher,this._ngZone,this._viewportRuler,a),this.block=()=>new yd(this._viewportRuler,this._document),this.reposition=a=>new Cd(this._scrollDispatcher,this._viewportRuler,this._ngZone,a),this._document=o}static{this.\u0275fac=function(n){return new(n||i)(U(If),U(Xo),U(We),U(Le))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Ko=class{constructor(t){if(this.scrollStrategy=new dl,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,t){let e=Object.keys(t);for(let n of e)t[n]!==void 0&&(this[n]=t[n])}}};var Sd=class{constructor(t,e){this.connectionPair=t,this.scrollableViewProperties=e}};var Bf=(()=>{class i{constructor(e){this._attachedOverlays=[],this._document=e}ngOnDestroy(){this.detach()}add(e){this.remove(e),this._attachedOverlays.push(e)}remove(e){let n=this._attachedOverlays.indexOf(e);n>-1&&this._attachedOverlays.splice(n,1),this._attachedOverlays.length===0&&this.detach()}static{this.\u0275fac=function(n){return new(n||i)(U(Le))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),aw=(()=>{class i extends Bf{constructor(e,n){super(e),this._ngZone=n,this._keydownListener=r=>{let o=this._attachedOverlays;for(let a=o.length-1;a>-1;a--)if(o[a]._keydownEvents.observers.length>0){let s=o[a]._keydownEvents;this._ngZone?this._ngZone.run(()=>s.next(r)):s.next(r);break}}}add(e){super.add(e),this._isAttached||(this._ngZone?this._ngZone.runOutsideAngular(()=>this._document.body.addEventListener("keydown",this._keydownListener)):this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}static{this.\u0275fac=function(n){return new(n||i)(U(Le),U(We,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),sw=(()=>{class i extends Bf{constructor(e,n,r){super(e),this._platform=n,this._ngZone=r,this._cursorStyleIsSet=!1,this._pointerDownListener=o=>{this._pointerDownEventTarget=ui(o)},this._clickListener=o=>{let a=ui(o),s=o.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:a;this._pointerDownEventTarget=null;let l=this._attachedOverlays.slice();for(let c=l.length-1;c>-1;c--){let d=l[c];if(d._outsidePointerEvents.observers.length<1||!d.hasAttached())continue;if(Mf(d.overlayElement,a)||Mf(d.overlayElement,s))break;let p=d._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>p.next(o)):p.next(o)}}}add(e){if(super.add(e),!this._isAttached){let n=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(n)):this._addEventListeners(n),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){let e=this._document.body;e.removeEventListener("pointerdown",this._pointerDownListener,!0),e.removeEventListener("click",this._clickListener,!0),e.removeEventListener("auxclick",this._clickListener,!0),e.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(e.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(e){e.addEventListener("pointerdown",this._pointerDownListener,!0),e.addEventListener("click",this._clickListener,!0),e.addEventListener("auxclick",this._clickListener,!0),e.addEventListener("contextmenu",this._clickListener,!0)}static{this.\u0275fac=function(n){return new(n||i)(U(Le),U(lt),U(We,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function Mf(i,t){let e=typeof ShadowRoot<"u"&&ShadowRoot,n=t;for(;n;){if(n===i)return!0;n=e&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}var Nf=(()=>{class i{constructor(e,n){this._platform=n,this._document=e}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let e="cdk-overlay-container";if(this._platform.isBrowser||Uo()){let r=this._document.querySelectorAll(`.${e}[platform="server"], .${e}[platform="test"]`);for(let o=0;o<r.length;o++)r[o].remove()}let n=this._document.createElement("div");n.classList.add(e),Uo()?n.setAttribute("platform","test"):this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._containerElement=n}static{this.\u0275fac=function(n){return new(n||i)(U(Le),U(lt))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Pd=class{constructor(t,e,n,r,o,a,s,l,c,d=!1,p){this._portalOutlet=t,this._host=e,this._pane=n,this._config=r,this._ngZone=o,this._keyboardDispatcher=a,this._document=s,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=d,this._injector=p,this._backdropElement=null,this._backdropClick=new Te,this._attachments=new Te,this._detachments=new Te,this._locationChanges=ei.EMPTY,this._backdropClickHandler=v=>this._backdropClick.next(v),this._backdropTransitionendHandler=v=>{this._disposeBackdrop(v.target)},this._keydownEvents=new Te,this._outsidePointerEvents=new Te,this._renders=new Te,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy,this._afterRenderRef=fm(()=>jc(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let e=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=Fo(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof e?.onDestroy=="function"&&e.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),e}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._disposeBackdrop(this._backdropElement),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=null,t&&this._detachments.next(),this._detachments.complete(),this._afterRenderRef.destroy(),this._renders.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=_(_({},this._config),t),this._updateElementSize()}setDirection(t){this._config=k(_({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=ct(this._config.width),t.height=ct(this._config.height),t.minWidth=ct(this._config.minWidth),t.minHeight=ct(this._config.minHeight),t.maxWidth=ct(this._config.maxWidth),t.maxHeight=ct(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._animationsDisabled&&this._backdropElement.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(t)})}):this._backdropElement.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let t=this._backdropElement;if(t){if(this._animationsDisabled){this._disposeBackdrop(t);return}t.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{t.addEventListener("transitionend",this._backdropTransitionendHandler)}),t.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(()=>{this._disposeBackdrop(t)},500))}}_toggleClasses(t,e,n){let r=Xr(e||[]).filter(o=>!!o);r.length&&(n?t.classList.add(...r):t.classList.remove(...r))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{let t=this._renders.pipe(ti(Un(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),t.unsubscribe())})})}_disposeScrollStrategy(){let t=this._scrollStrategy;t&&(t.disable(),t.detach&&t.detach())}_disposeBackdrop(t){t&&(t.removeEventListener("click",this._backdropClickHandler),t.removeEventListener("transitionend",this._backdropTransitionendHandler),t.remove(),this._backdropElement===t&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}},Of="cdk-overlay-connected-position-bounding-box",lw=/([A-Za-z%]+)$/,Ed=class{get positions(){return this._preferredPositions}constructor(t,e,n,r,o){this._viewportRuler=e,this._document=n,this._platform=r,this._overlayContainer=o,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new Te,this._resizeSubscription=ei.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(t)}attach(t){this._overlayRef&&this._overlayRef,this._validatePositions(),t.hostElement.classList.add(Of),this._overlayRef=t,this._boundingBox=t.hostElement,this._pane=t.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._originRect,e=this._overlayRect,n=this._viewportRect,r=this._containerRect,o=[],a;for(let s of this._preferredPositions){let l=this._getOriginPoint(t,r,s),c=this._getOverlayPoint(l,e,s),d=this._getOverlayFit(c,e,n,s);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(s,l);return}if(this._canFitWithFlexibleDimensions(d,c,n)){o.push({position:s,origin:l,overlayRect:e,boundingBoxRect:this._calculateBoundingBoxRect(l,s)});continue}(!a||a.overlayFit.visibleArea<d.visibleArea)&&(a={overlayFit:d,overlayPoint:c,originPoint:l,position:s,overlayRect:e})}if(o.length){let s=null,l=-1;for(let c of o){let d=c.boundingBoxRect.width*c.boundingBoxRect.height*(c.position.weight||1);d>l&&(l=d,s=c)}this._isPushed=!1,this._applyPosition(s.position,s.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&Qn(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Of),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let t=this._lastPosition;if(t){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._getOriginPoint(this._originRect,this._containerRect,t);this._applyPosition(t,e)}else this.apply()}withScrollableContainers(t){return this._scrollables=t,this}withPositions(t){return this._preferredPositions=t,t.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(t){return this._viewportMargin=t,this}withFlexibleDimensions(t=!0){return this._hasFlexibleDimensions=t,this}withGrowAfterOpen(t=!0){return this._growAfterOpen=t,this}withPush(t=!0){return this._canPush=t,this}withLockedPosition(t=!0){return this._positionLocked=t,this}setOrigin(t){return this._origin=t,this}withDefaultOffsetX(t){return this._offsetX=t,this}withDefaultOffsetY(t){return this._offsetY=t,this}withTransformOriginOn(t){return this._transformOriginSelector=t,this}_getOriginPoint(t,e,n){let r;if(n.originX=="center")r=t.left+t.width/2;else{let a=this._isRtl()?t.right:t.left,s=this._isRtl()?t.left:t.right;r=n.originX=="start"?a:s}e.left<0&&(r-=e.left);let o;return n.originY=="center"?o=t.top+t.height/2:o=n.originY=="top"?t.top:t.bottom,e.top<0&&(o-=e.top),{x:r,y:o}}_getOverlayPoint(t,e,n){let r;n.overlayX=="center"?r=-e.width/2:n.overlayX==="start"?r=this._isRtl()?-e.width:0:r=this._isRtl()?0:-e.width;let o;return n.overlayY=="center"?o=-e.height/2:o=n.overlayY=="top"?0:-e.height,{x:t.x+r,y:t.y+o}}_getOverlayFit(t,e,n,r){let o=Af(e),{x:a,y:s}=t,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(a+=l),c&&(s+=c);let d=0-a,p=a+o.width-n.width,v=0-s,g=s+o.height-n.height,w=this._subtractOverflows(o.width,d,p),E=this._subtractOverflows(o.height,v,g),L=w*E;return{visibleArea:L,isCompletelyWithinViewport:o.width*o.height===L,fitsInViewportVertically:E===o.height,fitsInViewportHorizontally:w==o.width}}_canFitWithFlexibleDimensions(t,e,n){if(this._hasFlexibleDimensions){let r=n.bottom-e.y,o=n.right-e.x,a=Ff(this._overlayRef.getConfig().minHeight),s=Ff(this._overlayRef.getConfig().minWidth),l=t.fitsInViewportVertically||a!=null&&a<=r,c=t.fitsInViewportHorizontally||s!=null&&s<=o;return l&&c}return!1}_pushOverlayOnScreen(t,e,n){if(this._previousPushAmount&&this._positionLocked)return{x:t.x+this._previousPushAmount.x,y:t.y+this._previousPushAmount.y};let r=Af(e),o=this._viewportRect,a=Math.max(t.x+r.width-o.width,0),s=Math.max(t.y+r.height-o.height,0),l=Math.max(o.top-n.top-t.y,0),c=Math.max(o.left-n.left-t.x,0),d=0,p=0;return r.width<=o.width?d=c||-a:d=t.x<this._viewportMargin?o.left-n.left-t.x:0,r.height<=o.height?p=l||-s:p=t.y<this._viewportMargin?o.top-n.top-t.y:0,this._previousPushAmount={x:d,y:p},{x:t.x+d,y:t.y+p}}_applyPosition(t,e){if(this._setTransformOrigin(t),this._setOverlayElementStyles(e,t),this._setBoundingBoxStyles(e,t),t.panelClass&&this._addPanelClasses(t.panelClass),this._positionChanges.observers.length){let n=this._getScrollVisibility();if(t!==this._lastPosition||!this._lastScrollVisibility||!cw(this._lastScrollVisibility,n)){let r=new Sd(t,n);this._positionChanges.next(r)}this._lastScrollVisibility=n}this._lastPosition=t,this._isInitialRender=!1}_setTransformOrigin(t){if(!this._transformOriginSelector)return;let e=this._boundingBox.querySelectorAll(this._transformOriginSelector),n,r=t.overlayY;t.overlayX==="center"?n="center":this._isRtl()?n=t.overlayX==="start"?"right":"left":n=t.overlayX==="start"?"left":"right";for(let o=0;o<e.length;o++)e[o].style.transformOrigin=`${n} ${r}`}_calculateBoundingBoxRect(t,e){let n=this._viewportRect,r=this._isRtl(),o,a,s;if(e.overlayY==="top")a=t.y,o=n.height-a+this._viewportMargin;else if(e.overlayY==="bottom")s=n.height-t.y+this._viewportMargin*2,o=n.height-s+this._viewportMargin;else{let g=Math.min(n.bottom-t.y+n.top,t.y),w=this._lastBoundingBoxSize.height;o=g*2,a=t.y-g,o>w&&!this._isInitialRender&&!this._growAfterOpen&&(a=t.y-w/2)}let l=e.overlayX==="start"&&!r||e.overlayX==="end"&&r,c=e.overlayX==="end"&&!r||e.overlayX==="start"&&r,d,p,v;if(c)v=n.width-t.x+this._viewportMargin*2,d=t.x-this._viewportMargin;else if(l)p=t.x,d=n.right-t.x;else{let g=Math.min(n.right-t.x+n.left,t.x),w=this._lastBoundingBoxSize.width;d=g*2,p=t.x-g,d>w&&!this._isInitialRender&&!this._growAfterOpen&&(p=t.x-w/2)}return{top:a,left:p,bottom:s,right:v,width:d,height:o}}_setBoundingBoxStyles(t,e){let n=this._calculateBoundingBoxRect(t,e);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));let r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{let o=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;r.height=ct(n.height),r.top=ct(n.top),r.bottom=ct(n.bottom),r.width=ct(n.width),r.left=ct(n.left),r.right=ct(n.right),e.overlayX==="center"?r.alignItems="center":r.alignItems=e.overlayX==="end"?"flex-end":"flex-start",e.overlayY==="center"?r.justifyContent="center":r.justifyContent=e.overlayY==="bottom"?"flex-end":"flex-start",o&&(r.maxHeight=ct(o)),a&&(r.maxWidth=ct(a))}this._lastBoundingBoxSize=n,Qn(this._boundingBox.style,r)}_resetBoundingBoxStyles(){Qn(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){Qn(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(t,e){let n={},r=this._hasExactPosition(),o=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(r){let d=this._viewportRuler.getViewportScrollPosition();Qn(n,this._getExactOverlayY(e,t,d)),Qn(n,this._getExactOverlayX(e,t,d))}else n.position="static";let s="",l=this._getOffset(e,"x"),c=this._getOffset(e,"y");l&&(s+=`translateX(${l}px) `),c&&(s+=`translateY(${c}px)`),n.transform=s.trim(),a.maxHeight&&(r?n.maxHeight=ct(a.maxHeight):o&&(n.maxHeight="")),a.maxWidth&&(r?n.maxWidth=ct(a.maxWidth):o&&(n.maxWidth="")),Qn(this._pane.style,n)}_getExactOverlayY(t,e,n){let r={top:"",bottom:""},o=this._getOverlayPoint(e,this._overlayRect,t);if(this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n)),t.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;r.bottom=`${a-(o.y+this._overlayRect.height)}px`}else r.top=ct(o.y);return r}_getExactOverlayX(t,e,n){let r={left:"",right:""},o=this._getOverlayPoint(e,this._overlayRect,t);this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n));let a;if(this._isRtl()?a=t.overlayX==="end"?"left":"right":a=t.overlayX==="end"?"right":"left",a==="right"){let s=this._document.documentElement.clientWidth;r.right=`${s-(o.x+this._overlayRect.width)}px`}else r.left=ct(o.x);return r}_getScrollVisibility(){let t=this._getOriginRect(),e=this._pane.getBoundingClientRect(),n=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Tf(t,n),isOriginOutsideView:xd(t,n),isOverlayClipped:Tf(e,n),isOverlayOutsideView:xd(e,n)}}_subtractOverflows(t,...e){return e.reduce((n,r)=>n-Math.max(r,0),t)}_getNarrowedViewportRect(){let t=this._document.documentElement.clientWidth,e=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+t-this._viewportMargin,bottom:n.top+e-this._viewportMargin,width:t-2*this._viewportMargin,height:e-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(t,e){return e==="x"?t.offsetX==null?this._offsetX:t.offsetX:t.offsetY==null?this._offsetY:t.offsetY}_validatePositions(){}_addPanelClasses(t){this._pane&&Xr(t).forEach(e=>{e!==""&&this._appliedPanelClasses.indexOf(e)===-1&&(this._appliedPanelClasses.push(e),this._pane.classList.add(e))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(t=>{this._pane.classList.remove(t)}),this._appliedPanelClasses=[])}_getOriginRect(){let t=this._origin;if(t instanceof Ce)return t.nativeElement.getBoundingClientRect();if(t instanceof Element)return t.getBoundingClientRect();let e=t.width||0,n=t.height||0;return{top:t.y,bottom:t.y+n,left:t.x,right:t.x+e,height:n,width:e}}};function Qn(i,t){for(let e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return i}function Ff(i){if(typeof i!="number"&&i!=null){let[t,e]=i.split(lw);return!e||e==="px"?parseFloat(t):null}return i||null}function Af(i){return{top:Math.floor(i.top),right:Math.floor(i.right),bottom:Math.floor(i.bottom),left:Math.floor(i.left),width:Math.floor(i.width),height:Math.floor(i.height)}}function cw(i,t){return i===t?!0:i.isOriginClipped===t.isOriginClipped&&i.isOriginOutsideView===t.isOriginOutsideView&&i.isOverlayClipped===t.isOverlayClipped&&i.isOverlayOutsideView===t.isOverlayOutsideView}var Rf="cdk-global-overlay-wrapper",Id=class{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(t){let e=t.getConfig();this._overlayRef=t,this._width&&!e.width&&t.updateSize({width:this._width}),this._height&&!e.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Rf),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:r,height:o,maxWidth:a,maxHeight:s}=n,l=(r==="100%"||r==="100vw")&&(!a||a==="100%"||a==="100vw"),c=(o==="100%"||o==="100vh")&&(!s||s==="100%"||s==="100vh"),d=this._xPosition,p=this._xOffset,v=this._overlayRef.getConfig().direction==="rtl",g="",w="",E="";l?E="flex-start":d==="center"?(E="center",v?w=p:g=p):v?d==="left"||d==="end"?(E="flex-end",g=p):(d==="right"||d==="start")&&(E="flex-start",w=p):d==="left"||d==="start"?(E="flex-start",g=p):(d==="right"||d==="end")&&(E="flex-end",w=p),t.position=this._cssPosition,t.marginLeft=l?"0":g,t.marginTop=c?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=l?"0":w,e.justifyContent=E,e.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,e=this._overlayRef.hostElement,n=e.style;e.classList.remove(Rf),n.justifyContent=n.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}},dw=(()=>{class i{constructor(e,n,r,o){this._viewportRuler=e,this._document=n,this._platform=r,this._overlayContainer=o}global(){return new Id}flexibleConnectedTo(e){return new Ed(e,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static{this.\u0275fac=function(n){return new(n||i)(U(Xo),U(Le),U(lt),U(Nf))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),pw=0,Rn=(()=>{class i{constructor(e,n,r,o,a,s,l,c,d,p,v,g){this.scrollStrategies=e,this._overlayContainer=n,this._componentFactoryResolver=r,this._positionBuilder=o,this._keyboardDispatcher=a,this._injector=s,this._ngZone=l,this._document=c,this._directionality=d,this._location=p,this._outsideClickDispatcher=v,this._animationsModuleType=g}create(e){let n=this._createHostElement(),r=this._createPaneElement(n),o=this._createPortalOutlet(r),a=new Ko(e);return a.direction=a.direction||this._directionality.value,new Pd(o,n,r,a,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,this._animationsModuleType==="NoopAnimations",this._injector.get(sm))}position(){return this._positionBuilder}_createPaneElement(e){let n=this._document.createElement("div");return n.id=`cdk-overlay-${pw++}`,n.classList.add("cdk-overlay-pane"),e.appendChild(n),n}_createHostElement(){let e=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(e),e}_createPortalOutlet(e){return this._appRef||(this._appRef=this._injector.get(hm)),new Ks(e,this._componentFactoryResolver,this._appRef,this._injector,this._document)}static{this.\u0275fac=function(n){return new(n||i)(U(ow),U(Nf),U(vs),U(dw),U(aw),U(Ye),U(We),U(Le),U(Fn),U(xs),U(sw),U(Dr,8))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var uw=new Ge("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=O(Rn);return()=>i.scrollStrategies.reposition()}});function hw(i){return()=>i.scrollStrategies.reposition()}var mw={provide:uw,deps:[Rn],useFactory:hw},zf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({providers:[Rn,mw],imports:[ki,qr,_d,_d]})}}return i})();var Dd=new Ge("MatFormField");var Zo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,et,sf,rt]})}}return i})();var gw=["panel"],bw=["*"];function vw(i,t){if(i&1){let e=Se();h(0,"div",1,0),N("@panelAnimation.done",function(r){X(e);let o=S();return K(o._animationDone.next(r))}),At(2),m()}if(i&2){let e=t.id,n=S();rn(n._classList),Ze("mat-mdc-autocomplete-visible",n.showPanel)("mat-mdc-autocomplete-hidden",!n.showPanel)("mat-primary",n._color==="primary")("mat-accent",n._color==="accent")("mat-warn",n._color==="warn"),C("id",n.id)("@panelAnimation",n.isOpen?"visible":"hidden"),qe("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(e))}}var _w=Bo("panelAnimation",[sn("void, hidden",Ii({opacity:0,transform:"scaleY(0.8)"})),Nr(":enter, hidden => visible",[No([qn("0.03s linear",Ii({opacity:1})),qn("0.12s cubic-bezier(0, 0, 0.2, 1)",Ii({transform:"scaleY(1)"}))])]),Nr(":leave, visible => hidden",[qn("0.075s linear",Ii({opacity:0}))])]),yw=0,kd=class{constructor(t,e){this.source=t,this.option=e}},jf=new Ge("mat-autocomplete-default-options",{providedIn:"root",factory:ww});function ww(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var Hf=(()=>{class i{get isOpen(){return this._isOpen&&this.showPanel}_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}set classList(e){this._classList=e,this._elementRef.nativeElement.className=""}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}constructor(e,n,r,o){this._changeDetectorRef=e,this._elementRef=n,this._defaults=r,this._activeOptionChanges=ei.EMPTY,this._animationDone=new He,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new He,this.opened=new He,this.closed=new He,this.optionActivated=new He,this.id=`mat-autocomplete-${yw++}`,this.inertGroups=o?.SAFARI||!1,this.autoActiveFirstOption=!!r.autoActiveFirstOption,this.autoSelectActiveOption=!!r.autoSelectActiveOption,this.requireSelection=!!r.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new rl(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(e){let n=new kd(this,e);this.optionSelected.emit(n)}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let n=e?e+" ":"";return this.ariaLabelledby?n+this.ariaLabelledby:e}_skipPredicate(){return!1}static{this.\u0275fac=function(n){return new(n||i)(W(It),W(Ce),W(jf),W(lt))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(n,r,o){if(n&1&&(Et(o,ll,5),Et(o,bd,5)),n&2){let a;Fe(a=Ae())&&(r.options=a),Fe(a=Ae())&&(r.optionGroups=a)}},viewQuery:function(n,r){if(n&1&&(ut(ci,7),ut(gw,5)),n&2){let o;Fe(o=Ae())&&(r.template=o.first),Fe(o=Ae())&&(r.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",xt],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",xt],requireSelection:[2,"requireSelection","requireSelection",xt],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",xt],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",xt]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],standalone:!0,features:[di([{provide:gd,useExisting:i}]),Lt,fe],ngContentSelectors:bw,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(n,r){n&1&&(jt(),H(0,vw,3,16,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-app-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color, var(--mat-app-surface-container))}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],encapsulation:2,data:{animation:[_w]},changeDetection:0})}}return i})();var xw={provide:wm,useExisting:Ir(()=>Td),multi:!0};var Vf=new Ge("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=O(Rn);return()=>i.scrollStrategies.reposition()}});function Cw(i){return()=>i.scrollStrategies.reposition()}var Sw={provide:Vf,deps:[Rn],useFactory:Cw},Td=(()=>{class i{constructor(e,n,r,o,a,s,l,c,d,p,v){this._element=e,this._overlay=n,this._viewContainerRef=r,this._zone=o,this._changeDetectorRef=a,this._dir=l,this._formField=c,this._document=d,this._viewportRuler=p,this._defaults=v,this._componentDestroyed=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=ei.EMPTY,this._breakpointObserver=O(el),this._handsetLandscapeSubscription=ei.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new Te,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._initialized=new Te,this._injector=O(Ye),this._aboveClass="mat-mdc-autocomplete-panel-above",this._overlayAttached=!1,this.optionSelections=nm(()=>{let g=this.autocomplete?this.autocomplete.options:null;return g?g.changes.pipe(Ai(g),Ri(()=>Un(...g.map(w=>w.onSelectionChange)))):this._initialized.pipe(Ri(()=>this.optionSelections))}),this._handlePanelKeydown=g=>{(g.keyCode===27&&!Yi(g)||g.keyCode===38&&Yi(g,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),g.stopPropagation(),g.preventDefault())},this._trackedModal=null,this._scrollStrategy=s}ngAfterViewInit(){this._initialized.next(),this._initialized.complete();let e=this._getWindow();typeof e<"u"&&this._zone.runOutsideAngular(()=>e.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){let e=this._getWindow();typeof e<"u"&&e.removeEventListener("blur",this._windowBlurHandler),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&sl(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Un(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(st(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(st(()=>this._overlayAttached)):wt()).pipe(Ve(e=>e instanceof $o?e:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Un(Vn(this._document,"click"),Vn(this._document,"auxclick"),Vn(this._document,"touchend")).pipe(st(e=>{let n=ui(e),r=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,o=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&n!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!r||!r.contains(n))&&(!o||!o.contains(n))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(n)}))}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){let n=e.keyCode,r=Yi(e);if(n===27&&!r&&e.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&n===13&&this.panelOpen&&!r)this.activeOption._selectViaInteraction(),this._resetActiveItem(),e.preventDefault();else if(this.autocomplete){let o=this.autocomplete._keyManager.activeItem,a=n===38||n===40;n===9||a&&!r&&this.panelOpen?this.autocomplete._keyManager.onKeydown(e):a&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(a||this.autocomplete._keyManager.activeItem!==o)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let n=e.target,r=n.value;if(n.type==="number"&&(r=r==""?null:parseFloat(r)),this._previousValue!==r){if(this._previousValue=r,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(r),!r)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(a=>a.selected);if(o){let a=this._getDisplayValue(o.value);r!==a&&o.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===e.target){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_floatLabel(e=!1){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let e=new Ft(r=>{Fo(()=>{r.next()},{injector:this._injector})}),n=this.autocomplete.options.changes.pipe(Ee(()=>this._positionStrategy.reapplyLastPosition()),rm(0));return Un(e,n).pipe(Ri(()=>this._zone.run(()=>{let r=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),r!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),In(1)).subscribe(r=>this._setValueAndClose(r))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){let n=this.autocomplete;return n&&n.displayWith?n.displayWith(e):e}_assignOptionValue(e){let n=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(n??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){let n=this.autocomplete,r=e?e.source:this._pendingAutoselectedOption;r?(this._clearPreviousSelectedOption(r),this._assignOptionValue(r.value),this._onChange(r.value),n._emitSelectEvent(r),this._element.nativeElement.focus()):n.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),n._animationDone?n._animationDone.pipe(In(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,n){this.autocomplete?.options?.forEach(r=>{r!==e&&r.selected&&r.deselect(n)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let n=this.autocomplete.id;ld(this._trackedModal,"aria-owns",n)}}_attachOverlay(e){this.autocomplete;let n=this._overlayRef;n?(this._positionStrategy.setOrigin(this._getConnectedElement()),n.updateSize({width:this._getPanelWidth()})):(this._portal=new An(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),n=this._overlay.create(this._getOverlayConfig()),this._overlayRef=n,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&n&&n.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(df.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),n&&!n.hasAttached()&&(n.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let r=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&r!==this.panelOpen&&this._emitOpened()}_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Ko({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let e=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let n=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],r=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:r},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:r}],a;this.position==="above"?a=o:this.position==="below"?a=n:a=[...n,...o],e.withPositions(a)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let n=-1;for(let r=0;r<e.options.length;r++)if(!e.options.get(r).disabled){n=r;break}e._keyManager.setActiveItem(n)}else e._keyManager.setActiveItem(-1)}_canOpen(){let e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_getWindow(){return this._document?.defaultView||window}_scrollToOption(e){let n=this.autocomplete,r=Sf(e,n.options,n.optionGroups);if(e===0&&r===1)n._setScrollTop(0);else if(n.panel){let o=n.options.toArray()[e];if(o){let a=o._getHostElement(),s=Pf(a.offsetTop,a.offsetHeight,n._getScrollTop(),n.panel.nativeElement.offsetHeight);n._setScrollTop(s)}}}_applyModalPanelOwnership(){let e=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let n=this.autocomplete.id;this._trackedModal&&sl(this._trackedModal,"aria-owns",n),ld(e,"aria-owns",n),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;sl(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static{this.\u0275fac=function(n){return new(n||i)(W(Ce),W(Rn),W(kn),W(We),W(It),W(Vf),W(Fn,8),W(Dd,9),W(Le,8),W(Xo),W(jf,8))}}static{this.\u0275dir=Ue({type:i,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(n,r){n&1&&N("focusin",function(){return r._handleFocus()})("blur",function(){return r._onTouched()})("input",function(a){return r._handleInput(a)})("keydown",function(a){return r._handleKeydown(a)})("click",function(){return r._handleClick()}),n&2&&qe("autocomplete",r.autocompleteAttribute)("role",r.autocompleteDisabled?null:"combobox")("aria-autocomplete",r.autocompleteDisabled?null:"list")("aria-activedescendant",r.panelOpen&&r.activeOption?r.activeOption.id:null)("aria-expanded",r.autocompleteDisabled?null:r.panelOpen.toString())("aria-controls",r.autocompleteDisabled||!r.panelOpen||r.autocomplete==null?null:r.autocomplete.id)("aria-haspopup",r.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",xt]},exportAs:["matAutocompleteTrigger"],standalone:!0,features:[di([xw]),Lt,$t]})}}return i})(),Uf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({providers:[Sw],imports:[zf,vd,rt,et,cl,vd,rt]})}}return i})();var Md={dashboard:{View:"DashV"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Void:"ShiftVo"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetail:"ContD",ContactImageEditor:"ContE",ContactSensitiveField:"ConSF",Supplier:"Supp"},sell:{Create:"Sell",PricebookSelector:"PricebS",Edit:"SellE",Delete:"SellD",Number:"NumE",SalesPerson:"SalesmanE",Return:"Return",Discount:"Disc",UnitPriceEditor:"UnitPE",Commission:"Comms",Tax:"Tax",CustomerInputLock:"CustL",Payment:"PayR",PriceVisible:"PriceV",PriceMinimum:"PriceM",Email:"Email",DeleteItem:"DelItm",Shipping:"Ship",PaymentCodeLock:"PayCL",EraseVoidOrd:"EraseVO",RestoreVoidOrd:"RestVO",RetrieveR:"RetrieveR",BundlingPrice:"BundlP",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CredSL",CouponInputLock:"CouponInputLock",Park:"Park"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",Print:"OrdRpr",NoteEditor:"OrdNe",Invoice:"OrdIr",Erase:"EraseVO"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrinting:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense",CommissionView:"CommV",ProductSensitiveField:"ProdSF",Price:"PriceV"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",ShippingRestriction:"BuySh",Approval:"PurA",Report:"BuyR"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UseG",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export",Number:"NumE",Date:"DateE"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"},developer:{Api:"API",View:"Dev",Edit:"DevE"}};var Wf=(()=>{class i{constructor(){this._roles=[],this.parseJWTRoles()}parseJWTRoles(){let e=localStorage.getItem("Token");if(e){var n=qc(e);this._roles=n["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"],console.log(this._roles)}}isInRole(e,n){let r={};return n.forEach((o,a)=>r[e[a]]=typeof o=="string"?this._roles.includes(o):o(this._roles)),r}isUserHasRole(e){return this._roles.includes(e)}get product(){return this._product||(this._product=this.setBulkRole("product")),this._product}get contact(){return this._contact||(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return this._promotion||(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return this._accounting||(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return this._users||(this._users=this.setBulkRole("users")),this._users}get outlets(){return this._outlets||(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return this._setup||(this._setup=this.setBulkRole("setup")),this._setup}get service(){return this._service||(this._service=this.setBulkRole("service")),this._service}get profile(){return this._profile||(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return this._customerDisplay||(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return this._orderDisplay||(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return this._global||(this._global=this.setBulkRole("global")),this._global}get apps(){return this._apps||(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return this._fulfillment||(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return this._manufacture||(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return this._inventory||(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return this._sell||(this._sell=this.setBulkRole("sell")),this._sell}get report(){return this._report||(this._report=this.setBulkRole("report")),this._report}get buy(){return this._buy||(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return this._adjustment||(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return this._debt||(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return this._payment||(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return this._prepaidPackage||(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return this._order||(this._order=this.setBulkRole("orders")),this._order}get logistic(){return this._logistic||(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return this._estimate||(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return this._shift||(this._shift=this.setBulkRole("shift")),this._shift}get developer(){return this._developer||(this._developer=this.setBulkRole("developer")),this._developer}get dashboard(){return this._dashboard||(this._dashboard=this.setBulkRole("dashboard")),this._dashboard}setBulkRole(e){let n={};for(let r in Md[e])n[r]=this.isUserHasRole(Md[e][r]);return n}get isSystemUser(){let e=localStorage.getItem("Token");return qc(e).Type=="System"}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null,this._developer=null,this._dashboard=null}toJSON(){return{product:this.product,contact:this.contact,promotion:this.promotion,accounting:this.accounting,users:this.users,outlets:this.outlets,setup:this.setup,service:this.service,profile:this.profile,customerDisplay:this.customerDisplay,orderDisplay:this.orderDisplay,global:this.global,apps:this.apps,fulfillment:this.fulfillment,manufacture:this.manufacture,inventory:this.inventory,sell:this.sell,report:this.report,buy:this.buy,adjustment:this.adjustment,debt:this.debt,payment:this.payment,prepaidPackage:this.prepaidPackage,order:this.order,logistic:this.logistic,estimate:this.estimate,shift:this.shift,developer:this.developer,dashboard:this.dashboard}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Qr=()=>{let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16;return e=(i+e)%16|0,i=Math.floor(i/16),(t==="x"?e:e&3|8).toString(16)})};var $f=(i,t)=>t.PromotionID;function Ew(i,t){if(i&1&&(h(0,"mat-option",19)(1,"div",20)(2,"span",21),b(3),m(),h(4,"span",22),b(5),m()()()),i&2){let e=t.$implicit;C("value",e),f(3),P(e.Value),f(2),P(e.Code)}}function Iw(i,t){if(i&1&&St(0,Ew,6,3,"mat-option",19,Tn),i&2){let e=S();Pt(e.variantSuggestion())}}function Dw(i,t){i&1&&(h(0,"mat-option",12),b(1,"No items found"),m()),i&2&&C("disabled",!0)}function kw(i,t){if(i&1){let e=Se();h(0,"div",23)(1,"img",24),N("error",function(r){X(e);let o=S();return K(o.onErrorImage(r))}),m(),h(2,"div",25)(3,"ngb-highlight",26),b(4),m(),h(5,"span"),b(6),m()()()}if(i&2){let e=t.result,n=t.term;f(),C("src",e.ImgUrl,Wn)("alt",e.Value),f(2),C("result",e.Value)("term",n),f(),P(e.Value),f(2),P(e.Code)}}function Tw(i,t){if(i&1&&(h(0,"ng-option",28),b(1),m()),i&2){let e=t.$implicit;C("value",e.PromotionID),f(),P(e.Name)}}function Mw(i,t){if(i&1&&(h(0,"ng-select",27),St(1,Tw,2,2,"ng-option",28,$f),m()),i&2){let e=S(2);f(),Pt(e.promotionPrice())}}function Ow(i,t){if(i&1&&(h(0,"ng-option",28),b(1),m()),i&2){let e=t.$implicit;C("value",e),f(),P(e.Name)}}function Fw(i,t){if(i&1&&(h(0,"ng-select",27),St(1,Ow,2,2,"ng-option",28,$f),m()),i&2){let e=S(2);f(),Pt(e.promotionPrice())}}function Aw(i,t){if(i&1&&(h(0,"div",13)(1,"label",9),b(2,"Promotion Price"),m(),H(3,Mw,3,0,"ng-select",27)(4,Fw,3,0,"ng-select",27),m()),i&2){let e=S();f(3),ae(e.isEditProduct()?3:4)}}function Rw(i,t){if(i&1){let e=Se();h(0,"button",29),N("click",function(){X(e);let r=S();return K(r.resetForm())}),b(1," Cancel "),m()}}var ul=(()=>{class i{displayFn(e){return e?e.Value:""}constructor(){this.productSelected=cm(null),this.isEditProduct=B(!1),this.variant=B(null),this.promotionPrice=B([]),this.domain="",this.printMode=B("barcode"),this.httpService=O($i),this.fb=O(Wi),this.router=O(Ei),this.storeService=O(Re),this.roleService=O(Wf),this.route=O(Ui),this.location=O(xs),this.maskitoOptions=$r({precision:2,thousandSeparator:","}),this.variantSuggestion=B([]),an(()=>{let e=this.productSelected();if(this.isEditProduct.set(!!e),!e){this.resetForm();return}this.loadVariantAndPromotion(e)},{allowSignalWrites:!0})}ngOnInit(){this.initForm(),this.setupPromotionPriceWatcher(),this.setupVariantSuggestion()}ngAfterViewInit(){this.domain=`https://${localStorage.getItem("Domain")}`,this.printMode.set(localStorage.getItem("PrintMode")??"barcode")}initForm(){this.form=this.fb.group({name:new kt("",mt.required),quantity:new kt("",mt.required),promotionPrice:new kt(null),price:new kt("",mt.required)})}patchFormFromVariant(e,n,r){if(!r)return;let o=n?.find(a=>a.PromotionID.toLowerCase()===r.Promotions?.PromotionID?.toLowerCase())??null;this.form.patchValue({name:{Value:e.Name},quantity:r.Quantity,price:r.UnitPrice??e.UnitPrice,promotionPrice:o?o.PromotionID:null}),this.form.get("name")?.disable(),o&&this.form.get("price")?.disable()}setupVariantSuggestion(){this.form.get("name").valueChanges.pipe(Er(200),To(),Ri(e=>e?.length>2?this.httpService.post("/API/AC/GetVariantSuggestionByCodeNName",{count:100,prefix:e},void 0,`https://${localStorage.getItem("Domain")}`):wt([]))).subscribe(e=>this.variantSuggestion.set(e))}setupPromotionPriceWatcher(){this.form.get("promotionPrice")?.valueChanges.pipe().subscribe(e=>{this.variant()?.UnitPrice&&(e?(this.form.patchValue({price:+this.variant().UnitPrice}),this.form.get("price")?.disable()):this.form.get("price")?.enable())})}loadVariantAndPromotion(e){let n=this.storeService.productItems().find(a=>a.Uuid===e);if(!n)return;let r={EntityID:"00000000-0000-0000-0000-000000000000",ID:n.VariantID??n.ID},o={VariantID:r.ID};this.httpService.post("/API/V3/Variant/ID",r,void 0,this.domain).subscribe(a=>{this.variant.set(a),this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",o,void 0,this.domain).pipe(En(()=>wt([]))).subscribe(s=>{this.promotionPrice.set(s),this.patchFormFromVariant(a,s,n)})})}onOptionSelected(e){if(!e.option.value?.Key)return;let n=e.option.value.Key;if(this.printMode()==="barcode")this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",{VariantID:n},void 0,this.domain).pipe(En(()=>wt([]))).subscribe(r=>this.promotionPrice.set(r)):this.promotionPrice.set([]);else{let r={headers:new Pi({"Content-Type":"application/json",promotions_field_include:"true"})};this.httpService.post("/api/v3/Variant/ID",{ID:n},r,this.domain).pipe(Ve(o=>o.Promotions),En(()=>wt([]))).subscribe(o=>this.promotionPrice.set(o))}this.httpService.post("/API/V3/Variant/ID",{EntityID:"00000000-0000-0000-0000-000000000000",ID:n},void 0,this.domain).subscribe(r=>{this.variant.set(k(_({},r),{Uuid:Qr()})),this.form.patchValue({price:r.UnitPrice,quantity:1,promotionPrice:null})})}onSubmit(){let{quantity:e,promotionPrice:n,price:r}=this.form.getRawValue(),o=+e.toString().replace(/,/g,""),a=+r.toString().replace(/,/g,"");if(this.isEditProduct()){let s=this.promotionPrice();if(!this.variant())return;let c=[...this.storeService.productItems()],d=c.findIndex(v=>v.Uuid===this.productSelected());if(d===-1)return;let p=s?.find(v=>v.PromotionID.toLowerCase()===n?.toLowerCase())??null;c[d]=k(_({},c[d]),{Quantity:o,Promotions:p??n,UnitPrice:a,checked:!1}),this.storeService.onChangeProductItems(c),this.resetForm()}else{let s=this.variant();if(!s)return;let l=k(_({},s),{Quantity:o,Promotions:n,UnitPrice:a}),c=[...this.storeService.productItems(),l];this.storeService.onChangeProductItems(c),this.resetForm()}}resetForm(){this.form.reset(),this.form.enable(),this.promotionPrice.set([]),this.variant.set(null),this.productSelected.set(null),this.router.navigate([],{relativeTo:this.route,queryParams:{id:null},queryParamsHandling:"merge"})}onErrorImage(e){e.target.src="assets/images/image-404.svg"}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["modal-choose-product"]],inputs:{productSelected:[1,"productSelected"]},outputs:{productSelected:"productSelectedChange"},standalone:!0,features:[fe],decls:30,vars:10,consts:[["auto","matAutocomplete"],["rt",""],[1,"card","mb-3","w-100","p-0"],[1,"card-header","px-0"],[1,"text-dark","fw-medium","font-robotoslab",2,"margin","0.6rem 0","font-size","16px"],[1,"card-body","px-0","py-0","pt-4"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"form-group","d-flex","flex-column","position-relative"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["type","text","formControlName","name",1,"form-control","form-control-lg","fs-3",3,"matAutocomplete"],["autoActiveFirstOption","",3,"optionSelected","displayWith"],[1,"fs-2",3,"disabled"],[1,"form-group"],["type","text","formControlName","quantity",1,"form-control","form-control-lg","fs-3",3,"maskito"],["type","text","formControlName","price",1,"form-control","form-control-lg","fs-3",3,"maskito"],[1,"d-flex","gap-4"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary"],["type","button",1,"flex","flex-grow-1","btn","btn-success",3,"click","disabled"],[1,"fs-2",3,"value"],[1,"d-flex","flex-column"],[1,"fs-2"],[1,"opacity-75",2,"font-size","11px"],[1,"d-flex","w-100","overflow-x-hidden","gap-2"],[1,"me-1",2,"width","42px","height","42px",3,"error","src","alt"],[1,"flex-grow-1","d-flex","flex-column","flex-wrap"],[3,"result","term"],["formControlName","promotionPrice","placeholder","Select Promotion Price",1,"custom","fs-3"],[1,"fs-3",3,"value"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary",3,"click"]],template:function(n,r){if(n&1){let o=Se();h(0,"div",2)(1,"div",3)(2,"span",4),b(3),m()(),h(4,"div",5)(5,"div",6)(6,"form",7)(7,"div",8)(8,"label",9),b(9,"Name"),m(),J(10,"input",10),h(11,"mat-autocomplete",11,0),N("optionSelected",function(s){return X(o),K(r.onOptionSelected(s))}),H(13,Iw,2,0)(14,Dw,2,1,"mat-option",12),m(),H(15,kw,7,6,"ng-template",null,1,we),m(),h(17,"div",13)(18,"label",9),b(19,"Quantity"),m(),J(20,"input",14),m(),h(21,"div",13)(22,"label",9),b(23,"Price"),m(),J(24,"input",15),m(),H(25,Aw,5,1,"div",13),h(26,"div",16),H(27,Rw,2,0,"button",17),h(28,"button",18),N("click",function(){return X(o),K(r.onSubmit())}),b(29," Submit "),m()()()()()()}if(n&2){let o=$n(12);f(3),Ht("",r.productSelected()?"Update":"Add"," Product"),f(3),C("formGroup",r.form),f(4),C("matAutocomplete",o),f(),C("displayWith",r.displayFn),f(2),ae(r.variantSuggestion().length>0?13:14),f(7),C("maskito",r.maskitoOptions),f(4),C("maskito",r.maskitoOptions),f(),ae(r.promotionPrice().length?25:-1),f(2),ae(r.isEditProduct()?27:-1),f(),C("disabled",r.form.invalid)}},dependencies:[Es,Di,qi,Vs,bt,Ds,ht,ft,Is,ks,Ts,Em,Gi,Js,Uf,Hf,ll,Td],styles:[".mat-mdc-autocomplete-panel{background-color:#fff!important} .mat-mdc-autocomplete-panel>.mat-mdc-option.mdc-list-item--disabled{min-height:34px}"]})}}return i})();var qf=(()=>{class i{constructor(){this.transactionType=B([{title:"Supplier Bill",type:0},{title:"Transfer Order",type:1}]),this.storeService=O(Re),this.fb=O(Wi),this.activeModal=O(js)}get outlets(){return this.storeService.paperConfig().Outlets}initForm(){this.form=this.fb.group({type:new kt("",[mt.required]),outlet:new kt("",[mt.required]),number:new kt("",[mt.required])})}ngOnInit(){this.initForm()}onOK(){this.activeModal.close({role:"ok",data:this.form.value})}onClose(){this.activeModal.dismiss({role:"close",data:null})}onPaste(e){e.preventDefault();let n=e.clipboardData;if(n){let r=n.getData("text").trim(),o=e.target;o.value=r,this.form.patchValue({number:o.value})}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-dialog-load-transaction"]],standalone:!0,features:[fe],decls:14,vars:4,consts:[["title","Choose your transaction",3,"onOK","onClose","hasValid"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"form-group"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["formControlName","type","bindLabel","title","bindValue","type","placeholder","Choose Type",1,"custom","fs-2",3,"items"],["formControlName","outlet","bindLabel","Name","bindValue","Name","placeholder","Choose Outlet",1,"custom","fs-2",3,"items"],["formControlName","number","type","text",1,"form-control","fs-2",2,"height","32px",3,"paste"]],template:function(n,r){n&1&&(h(0,"app-base-modal",0),N("onOK",function(){return r.onOK()})("onClose",function(){return r.onClose()}),h(1,"form",1)(2,"div",2)(3,"label",3),b(4,"Choose Type"),m(),J(5,"ng-select",4),m(),h(6,"div",2)(7,"label",3),b(8,"Choose Outlet"),m(),J(9,"ng-select",5),m(),h(10,"div",2)(11,"label",3),b(12,"Invoice Number"),m(),h(13,"input",6),N("paste",function(a){return r.onPaste(a)}),m()()()()),n&2&&(C("hasValid",r.form.valid),f(),C("formGroup",r.form),f(4),C("items",r.transactionType()),f(4),C("items",r.outlets))},dependencies:[Hs,Di,qi,gt,Ds,ht,ft,Is,bt,ks,Ts],changeDetection:0})}}return i})();var Bw=(()=>{class i{constructor(e){this.document=e,this.width=this.getWidth()}getWidth(){let e=this.document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",this.document.body.appendChild(e);let n=e.offsetWidth;e.style.overflow="scroll";let r=this.document.createElement("div");r.style.width="100%",e.appendChild(r);let o=r.offsetWidth;return e.parentNode.removeChild(e),n-o}}return i.\u0275fac=function(e){return new(e||i)(U(Le))},i.\u0275prov=be({token:i,factory:i.\u0275fac}),i})(),Nw=(()=>{class i{getDimensions(e){return e.getBoundingClientRect()}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275prov=be({token:i,factory:i.\u0275fac}),i})(),zw=(()=>{class i{constructor(){this.columnInputChanges=new Te}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275prov=be({token:i,factory:i.\u0275fac}),i})();function Lw(i){return i=i.replace(/[^a-zA-Z0-9 ]/g," "),i=i.replace(/([a-z](?=[A-Z]))/g,"$1 "),i=i.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase(),i=i.replace(/([ 0-9]+)([a-zA-Z])/g,function(t,e,n){return e.trim()+n.toUpperCase()}),i}var hl={},Gf=typeof document<"u"?document.createElement("div").style:void 0,Od=function(){let i=typeof window<"u"?window.getComputedStyle(document.documentElement,""):void 0,t=typeof i<"u"?Array.prototype.slice.call(i).join("").match(/-(moz|webkit|ms)-/):null,e=t!==null?t[1]:void 0,n=typeof e<"u"?"WebKit|Moz|MS|O".match(new RegExp("("+e+")","i"))[1]:void 0;return n?{dom:n,lowercase:e,css:`-${e}-`,js:e[0].toUpperCase()+e.substr(1)}:void 0}();function ml(i){let t=Lw(i);return hl[t]||(Od!==void 0&&Gf[Od.css+i]!==void 0?hl[t]=Od.css+i:Gf[i]!==void 0&&(hl[t]=i)),hl[t]}var tB=typeof window<"u"?ml("transform"):void 0,iB=typeof window<"u"?ml("backfaceVisibility"):void 0,nB=typeof window<"u"?!!ml("transform"):void 0,rB=typeof window<"u"?!!ml("perspective"):void 0,Yf=typeof window<"u"?window.navigator.userAgent:"Chrome",oB=/Safari\//.test(Yf)&&!/Chrome\//.test(Yf);var Xf=(()=>{class i{static forRoot(e){return{ngModule:i,providers:[{provide:"configuration",useValue:e}]}}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=_e({type:i}),i.\u0275inj=ve({providers:[Bw,Nw,zw],imports:[[et]]}),i})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=jw);function jw(i,t){let e=[],n=[],r,o,a;for(;(r=document.elementFromPoint(i,t))&&e.indexOf(r)===-1&&r!=null;)e.push(r),n.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(o=n.length;a=n[--o];)e[o].style.setProperty("pointer-events",a.value?a.value:"",a.priority);return e}var Kf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var Qf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,Zo,Zo,Kf,rt]})}}return i})();var Hw=["*"];function Vw(i,t){i&1&&At(0)}var Fd=(()=>{class i{constructor(e){this._elementRef=e}focus(){this._elementRef.nativeElement.focus()}static{this.\u0275fac=function(n){return new(n||i)(W(Ce))}}static{this.\u0275dir=Ue({type:i,selectors:[["","cdkStepHeader",""]],hostAttrs:["role","tab"],standalone:!0})}}return i})(),Ad=(()=>{class i{constructor(e){this.template=e}static{this.\u0275fac=function(n){return new(n||i)(W(ci))}}static{this.\u0275dir=Ue({type:i,selectors:[["","cdkStepLabel",""]],standalone:!0})}}return i})(),Uw=0;var dn={NUMBER:"number",EDIT:"edit",DONE:"done",ERROR:"error"},Rd=new Ge("STEPPER_GLOBAL_OPTIONS"),fl=(()=>{class i{get completed(){return this._completedOverride==null?this._getDefaultCompleted():this._completedOverride}set completed(e){this._completedOverride=e}_getDefaultCompleted(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted}get hasError(){return this._customError==null?this._getDefaultError():this._customError}set hasError(e){this._customError=e}_getDefaultError(){return this.stepControl&&this.stepControl.invalid&&this.interacted}constructor(e,n){this._stepper=e,this.interacted=!1,this.interactedStream=new He,this.editable=!0,this.optional=!1,this._completedOverride=null,this._customError=null,this._stepperOptions=n||{},this._displayDefaultIndicatorType=this._stepperOptions.displayDefaultIndicatorType!==!1}select(){this._stepper.selected=this}reset(){this.interacted=!1,this._completedOverride!=null&&(this._completedOverride=!1),this._customError!=null&&(this._customError=!1),this.stepControl&&(this._childForms?.forEach(e=>e.resetForm?.()),this.stepControl.reset())}ngOnChanges(){this._stepper._stateChanged()}_markAsInteracted(){this.interacted||(this.interacted=!0,this.interactedStream.emit(this))}_showError(){return this._stepperOptions.showError??this._customError!=null}static{this.\u0275fac=function(n){return new(n||i)(W(Ir(()=>gl)),W(Rd,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["cdk-step"]],contentQueries:function(n,r,o){if(n&1&&(Et(o,Ad,5),Et(o,xm,5)),n&2){let a;Fe(a=Ae())&&(r.stepLabel=a.first),Fe(a=Ae())&&(r._childForms=a)}},viewQuery:function(n,r){if(n&1&&ut(ci,7),n&2){let o;Fe(o=Ae())&&(r.content=o.first)}},inputs:{stepControl:"stepControl",label:"label",errorMessage:"errorMessage",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],state:"state",editable:[2,"editable","editable",xt],optional:[2,"optional","optional",xt],completed:[2,"completed","completed",xt],hasError:[2,"hasError","hasError",xt]},outputs:{interactedStream:"interacted"},exportAs:["cdkStep"],standalone:!0,features:[Lt,$t,fe],ngContentSelectors:Hw,decls:1,vars:0,template:function(n,r){n&1&&(jt(),H(0,Vw,1,0,"ng-template"))},encapsulation:2,changeDetection:0})}}return i})(),gl=(()=>{class i{get selectedIndex(){return this._selectedIndex}set selectedIndex(e){this.steps&&this._steps?(this._isValidIndex(e),this.selected?._markAsInteracted(),this._selectedIndex!==e&&!this._anyControlsInvalidOrPending(e)&&(e>=this._selectedIndex||this.steps.toArray()[e].editable)&&this._updateSelectedItemIndex(e)):this._selectedIndex=e}get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=e&&this.steps?this.steps.toArray().indexOf(e):-1}get orientation(){return this._orientation}set orientation(e){this._orientation=e,this._keyManager&&this._keyManager.withVerticalOrientation(e==="vertical")}constructor(e,n,r){this._dir=e,this._changeDetectorRef=n,this._elementRef=r,this._destroyed=new Te,this.steps=new Dn,this._sortedHeaders=new Dn,this.linear=!1,this._selectedIndex=0,this.selectionChange=new He,this.selectedIndexChange=new He,this._orientation="horizontal",this._groupId=Uw++}ngAfterContentInit(){this._steps.changes.pipe(Ai(this._steps),ti(this._destroyed)).subscribe(e=>{this.steps.reset(e.filter(n=>n._stepper===this)),this.steps.notifyOnChanges()})}ngAfterViewInit(){this._stepHeader.changes.pipe(Ai(this._stepHeader),ti(this._destroyed)).subscribe(e=>{this._sortedHeaders.reset(e.toArray().sort((n,r)=>n._elementRef.nativeElement.compareDocumentPosition(r._elementRef.nativeElement)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)),this._sortedHeaders.notifyOnChanges()}),this._keyManager=new ol(this._sortedHeaders).withWrap().withHomeAndEnd().withVerticalOrientation(this._orientation==="vertical"),(this._dir?this._dir.change:wt()).pipe(Ai(this._layoutDirection()),ti(this._destroyed)).subscribe(e=>this._keyManager.withHorizontalOrientation(e)),this._keyManager.updateActiveItem(this._selectedIndex),this.steps.changes.subscribe(()=>{this.selected||(this._selectedIndex=Math.max(this._selectedIndex-1,0))}),this._isValidIndex(this._selectedIndex)||(this._selectedIndex=0)}ngOnDestroy(){this._keyManager?.destroy(),this.steps.destroy(),this._sortedHeaders.destroy(),this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(e=>e.reset()),this._stateChanged()}_getStepLabelId(e){return`cdk-step-label-${this._groupId}-${e}`}_getStepContentId(e){return`cdk-step-content-${this._groupId}-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){let n=e-this._selectedIndex;return n<0?this._layoutDirection()==="rtl"?"next":"previous":n>0?this._layoutDirection()==="rtl"?"previous":"next":"current"}_getIndicatorType(e,n=dn.NUMBER){let r=this.steps.toArray()[e],o=this._isCurrentStep(e);return r._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(r,o):this._getGuidelineLogic(r,o,n)}_getDefaultIndicatorLogic(e,n){return e._showError()&&e.hasError&&!n?dn.ERROR:!e.completed||n?dn.NUMBER:e.editable?dn.EDIT:dn.DONE}_getGuidelineLogic(e,n,r=dn.NUMBER){return e._showError()&&e.hasError&&!n?dn.ERROR:e.completed&&!n?dn.DONE:e.completed&&n?r:e.editable&&n?dn.EDIT:r}_isCurrentStep(e){return this._selectedIndex===e}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex}_updateSelectedItemIndex(e){let n=this.steps.toArray();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:this._selectedIndex,selectedStep:n[e],previouslySelectedStep:n[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItem(e),this._selectedIndex=e,this.selectedIndexChange.emit(this._selectedIndex),this._stateChanged()}_onKeydown(e){let n=Yi(e),r=e.keyCode,o=this._keyManager;o.activeItemIndex!=null&&!n&&(r===32||r===13)?(this.selectedIndex=o.activeItemIndex,e.preventDefault()):o.setFocusOrigin("keyboard").onKeydown(e)}_anyControlsInvalidOrPending(e){return this.linear&&e>=0?this.steps.toArray().slice(0,e).some(n=>{let r=n.stepControl;return(r?r.invalid||r.pending||!n.interacted:!n.completed)&&!n.optional&&!n._completedOverride}):!1}_layoutDirection(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}_containsFocus(){let e=this._elementRef.nativeElement,n=nd();return e===n||e.contains(n)}_isValidIndex(e){return e>-1&&(!this.steps||e<this.steps.length)}static{this.\u0275fac=function(n){return new(n||i)(W(Fn,8),W(It),W(Ce))}}static{this.\u0275dir=Ue({type:i,selectors:[["","cdkStepper",""]],contentQueries:function(n,r,o){if(n&1&&(Et(o,fl,5),Et(o,Fd,5)),n&2){let a;Fe(a=Ae())&&(r._steps=a),Fe(a=Ae())&&(r._stepHeader=a)}},inputs:{linear:[2,"linear","linear",xt],selectedIndex:[2,"selectedIndex","selectedIndex",mm],selected:"selected",orientation:"orientation"},outputs:{selectionChange:"selectionChange",selectedIndexChange:"selectedIndexChange"},exportAs:["cdkStepper"],standalone:!0,features:[Lt]})}}return i})();var Zf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[ki]})}}return i})();var $w=["*"],bl;function qw(){if(bl===void 0&&(bl=null,typeof window<"u")){let i=window;i.trustedTypes!==void 0&&(bl=i.trustedTypes.createPolicy("angular#components",{createHTML:t=>t}))}return bl}function Jo(i){return qw()?.createHTML(i)||i}function Jf(i){return Error(`Unable to find icon with the name "${i}"`)}function Gw(){return Error("Could not find HttpClient for use with Angular Material icons. Please add provideHttpClient() to your providers.")}function eg(i){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${i}".`)}function tg(i){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${i}".`)}var pn=class{constructor(t,e,n){this.url=t,this.svgText=e,this.options=n}},Yw=(()=>{class i{constructor(e,n,r,o){this._httpClient=e,this._sanitizer=n,this._errorHandler=o,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._resolvers=[],this._defaultFontSetClass=["material-icons","mat-ligature-font"],this._document=r}addSvgIcon(e,n,r){return this.addSvgIconInNamespace("",e,n,r)}addSvgIconLiteral(e,n,r){return this.addSvgIconLiteralInNamespace("",e,n,r)}addSvgIconInNamespace(e,n,r,o){return this._addSvgIconConfig(e,n,new pn(r,null,o))}addSvgIconResolver(e){return this._resolvers.push(e),this}addSvgIconLiteralInNamespace(e,n,r,o){let a=this._sanitizer.sanitize(kr.HTML,r);if(!a)throw tg(r);let s=Jo(a);return this._addSvgIconConfig(e,n,new pn("",s,o))}addSvgIconSet(e,n){return this.addSvgIconSetInNamespace("",e,n)}addSvgIconSetLiteral(e,n){return this.addSvgIconSetLiteralInNamespace("",e,n)}addSvgIconSetInNamespace(e,n,r){return this._addSvgIconSetConfig(e,new pn(n,null,r))}addSvgIconSetLiteralInNamespace(e,n,r){let o=this._sanitizer.sanitize(kr.HTML,n);if(!o)throw tg(n);let a=Jo(o);return this._addSvgIconSetConfig(e,new pn("",a,r))}registerFontClassAlias(e,n=e){return this._fontCssClassesByAlias.set(e,n),this}classNameForFontAlias(e){return this._fontCssClassesByAlias.get(e)||e}setDefaultFontSetClass(...e){return this._defaultFontSetClass=e,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(e){let n=this._sanitizer.sanitize(kr.RESOURCE_URL,e);if(!n)throw eg(e);let r=this._cachedIconsByUrl.get(n);return r?wt(vl(r)):this._loadSvgIconFromConfig(new pn(e,null)).pipe(Ee(o=>this._cachedIconsByUrl.set(n,o)),Ve(o=>vl(o)))}getNamedSvgIcon(e,n=""){let r=ig(n,e),o=this._svgIconConfigs.get(r);if(o)return this._getSvgFromConfig(o);if(o=this._getIconConfigFromResolvers(n,e),o)return this._svgIconConfigs.set(r,o),this._getSvgFromConfig(o);let a=this._iconSetConfigs.get(n);return a?this._getSvgFromIconSetConfigs(e,a):hs(Jf(r))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(e){return e.svgText?wt(vl(this._svgElementFromConfig(e))):this._loadSvgIconFromConfig(e).pipe(Ve(n=>vl(n)))}_getSvgFromIconSetConfigs(e,n){let r=this._extractIconWithNameFromAnySet(e,n);if(r)return wt(r);let o=n.filter(a=>!a.svgText).map(a=>this._loadSvgIconSetFromConfig(a).pipe(En(s=>{let c=`Loading icon set URL: ${this._sanitizer.sanitize(kr.RESOURCE_URL,a.url)} failed: ${s.message}`;return this._errorHandler.handleError(new Error(c)),wt(null)})));return ms(o).pipe(Ve(()=>{let a=this._extractIconWithNameFromAnySet(e,n);if(!a)throw Jf(e);return a}))}_extractIconWithNameFromAnySet(e,n){for(let r=n.length-1;r>=0;r--){let o=n[r];if(o.svgText&&o.svgText.toString().indexOf(e)>-1){let a=this._svgElementFromConfig(o),s=this._extractSvgIconFromSet(a,e,o.options);if(s)return s}}return null}_loadSvgIconFromConfig(e){return this._fetchIcon(e).pipe(Ee(n=>e.svgText=n),Ve(()=>this._svgElementFromConfig(e)))}_loadSvgIconSetFromConfig(e){return e.svgText?wt(null):this._fetchIcon(e).pipe(Ee(n=>e.svgText=n))}_extractSvgIconFromSet(e,n,r){let o=e.querySelector(`[id="${n}"]`);if(!o)return null;let a=o.cloneNode(!0);if(a.removeAttribute("id"),a.nodeName.toLowerCase()==="svg")return this._setSvgAttributes(a,r);if(a.nodeName.toLowerCase()==="symbol")return this._setSvgAttributes(this._toSvgElement(a),r);let s=this._svgElementFromString(Jo("<svg></svg>"));return s.appendChild(a),this._setSvgAttributes(s,r)}_svgElementFromString(e){let n=this._document.createElement("DIV");n.innerHTML=e;let r=n.querySelector("svg");if(!r)throw Error("<svg> tag not found");return r}_toSvgElement(e){let n=this._svgElementFromString(Jo("<svg></svg>")),r=e.attributes;for(let o=0;o<r.length;o++){let{name:a,value:s}=r[o];a!=="id"&&n.setAttribute(a,s)}for(let o=0;o<e.childNodes.length;o++)e.childNodes[o].nodeType===this._document.ELEMENT_NODE&&n.appendChild(e.childNodes[o].cloneNode(!0));return n}_setSvgAttributes(e,n){return e.setAttribute("fit",""),e.setAttribute("height","100%"),e.setAttribute("width","100%"),e.setAttribute("preserveAspectRatio","xMidYMid meet"),e.setAttribute("focusable","false"),n&&n.viewBox&&e.setAttribute("viewBox",n.viewBox),e}_fetchIcon(e){let{url:n,options:r}=e,o=r?.withCredentials??!1;if(!this._httpClient)throw Gw();if(n==null)throw Error(`Cannot fetch icon from URL "${n}".`);let a=this._sanitizer.sanitize(kr.RESOURCE_URL,n);if(!a)throw eg(n);let s=this._inProgressUrlFetches.get(a);if(s)return s;let l=this._httpClient.get(a,{responseType:"text",withCredentials:o}).pipe(Ve(c=>Jo(c)),om(()=>this._inProgressUrlFetches.delete(a)),am());return this._inProgressUrlFetches.set(a,l),l}_addSvgIconConfig(e,n,r){return this._svgIconConfigs.set(ig(e,n),r),this}_addSvgIconSetConfig(e,n){let r=this._iconSetConfigs.get(e);return r?r.push(n):this._iconSetConfigs.set(e,[n]),this}_svgElementFromConfig(e){if(!e.svgElement){let n=this._svgElementFromString(e.svgText);this._setSvgAttributes(n,e.options),e.svgElement=n}return e.svgElement}_getIconConfigFromResolvers(e,n){for(let r=0;r<this._resolvers.length;r++){let o=this._resolvers[r](n,e);if(o)return Xw(o)?new pn(o.url,null,o.options):new pn(o,null)}}static{this.\u0275fac=function(n){return new(n||i)(U(Ps,8),U(vm),U(Le,8),U(bs))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function vl(i){return i.cloneNode(!0)}function ig(i,t){return i+":"+t}function Xw(i){return!!(i.url&&i.options)}var Kw=new Ge("MAT_ICON_DEFAULT_OPTIONS"),Qw=new Ge("mat-icon-location",{providedIn:"root",factory:Zw});function Zw(){let i=O(Le),t=i?i.location:null;return{getPathname:()=>t?t.pathname+t.search:""}}var ng=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],Jw=ng.map(i=>`[${i}]`).join(", "),ex=/^url\(['"]?#(.*?)['"]?\)$/,rg=(()=>{class i{get color(){return this._color||this._defaultColor}set color(e){this._color=e}get svgIcon(){return this._svgIcon}set svgIcon(e){e!==this._svgIcon&&(e?this._updateSvgIcon(e):this._svgIcon&&this._clearSvgElement(),this._svgIcon=e)}get fontSet(){return this._fontSet}set fontSet(e){let n=this._cleanupFontValue(e);n!==this._fontSet&&(this._fontSet=n,this._updateFontIconClasses())}get fontIcon(){return this._fontIcon}set fontIcon(e){let n=this._cleanupFontValue(e);n!==this._fontIcon&&(this._fontIcon=n,this._updateFontIconClasses())}constructor(e,n,r,o,a,s){this._elementRef=e,this._iconRegistry=n,this._location=o,this._errorHandler=a,this.inline=!1,this._previousFontSetClass=[],this._currentIconFetch=ei.EMPTY,s&&(s.color&&(this.color=this._defaultColor=s.color),s.fontSet&&(this.fontSet=s.fontSet)),r||e.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(e){if(!e)return["",""];let n=e.split(":");switch(n.length){case 1:return["",n[0]];case 2:return n;default:throw Error(`Invalid icon name: "${e}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){let e=this._elementsWithExternalReferences;if(e&&e.size){let n=this._location.getPathname();n!==this._previousPath&&(this._previousPath=n,this._prependPathToReferences(n))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(e){this._clearSvgElement();let n=this._location.getPathname();this._previousPath=n,this._cacheChildrenWithExternalReferences(e),this._prependPathToReferences(n),this._elementRef.nativeElement.appendChild(e)}_clearSvgElement(){let e=this._elementRef.nativeElement,n=e.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();n--;){let r=e.childNodes[n];(r.nodeType!==1||r.nodeName.toLowerCase()==="svg")&&r.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;let e=this._elementRef.nativeElement,n=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(r=>r.length>0);this._previousFontSetClass.forEach(r=>e.classList.remove(r)),n.forEach(r=>e.classList.add(r)),this._previousFontSetClass=n,this.fontIcon!==this._previousFontIconClass&&!n.includes("mat-ligature-font")&&(this._previousFontIconClass&&e.classList.remove(this._previousFontIconClass),this.fontIcon&&e.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(e){return typeof e=="string"?e.trim().split(" ")[0]:e}_prependPathToReferences(e){let n=this._elementsWithExternalReferences;n&&n.forEach((r,o)=>{r.forEach(a=>{o.setAttribute(a.name,`url('${e}#${a.value}')`)})})}_cacheChildrenWithExternalReferences(e){let n=e.querySelectorAll(Jw),r=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let o=0;o<n.length;o++)ng.forEach(a=>{let s=n[o],l=s.getAttribute(a),c=l?l.match(ex):null;if(c){let d=r.get(s);d||(d=[],r.set(s,d)),d.push({name:a,value:c[1]})}})}_updateSvgIcon(e){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),e){let[n,r]=this._splitIconName(e);n&&(this._svgNamespace=n),r&&(this._svgName=r),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(r,n).pipe(In(1)).subscribe(o=>this._setSvgElement(o),o=>{let a=`Error retrieving icon ${n}:${r}! ${o.message}`;this._errorHandler.handleError(new Error(a))})}}static{this.\u0275fac=function(n){return new(n||i)(W(Ce),W(Yw),Nc("aria-hidden"),W(Qw),W(bs),W(Kw,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:10,hostBindings:function(n,r){n&2&&(qe("data-mat-icon-type",r._usingFontIcon()?"font":"svg")("data-mat-icon-name",r._svgName||r.fontIcon)("data-mat-icon-namespace",r._svgNamespace||r.fontSet)("fontIcon",r._usingFontIcon()?r.fontIcon:null),rn(r.color?"mat-"+r.color:""),Ze("mat-icon-inline",r.inline)("mat-icon-no-color",r.color!=="primary"&&r.color!=="accent"&&r.color!=="warn"))},inputs:{color:"color",inline:[2,"inline","inline",xt],svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],standalone:!0,features:[Lt,fe],ngContentSelectors:$w,decls:1,vars:0,template:function(n,r){n&1&&(jt(),At(0))},styles:["mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}"],encapsulation:2,changeDetection:0})}}return i})(),og=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,rt]})}}return i})();function tx(i,t){if(i&1&&on(0,2),i&2){let e=S();C("ngTemplateOutlet",e.iconOverrides[e.state])("ngTemplateOutletContext",e._getIconContext())}}function ix(i,t){if(i&1&&(h(0,"span",7),b(1),m()),i&2){let e=S(2);f(),P(e._getDefaultTextForState(e.state))}}function nx(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S(3);f(),P(e._intl.completedLabel)}}function rx(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S(3);f(),P(e._intl.editableLabel)}}function ox(i,t){if(i&1&&(H(0,nx,2,1,"span",8)(1,rx,2,1,"span",8),h(2,"mat-icon",7),b(3),m()),i&2){let e=S(2);ae(e.state==="done"?0:e.state==="edit"?1:-1),f(3),P(e._getDefaultTextForState(e.state))}}function ax(i,t){if(i&1&&H(0,ix,2,1,"span",7)(1,ox,4,2,"mat-icon",7),i&2){let e,n=S();ae((e=n.state)==="number"?0:1)}}function sx(i,t){i&1&&(h(0,"div",4),on(1,9),m()),i&2&&(f(),C("ngTemplateOutlet",t.template))}function lx(i,t){if(i&1&&(h(0,"div",4),b(1),m()),i&2){let e=S();f(),P(e.label)}}function cx(i,t){if(i&1&&(h(0,"div",5),b(1),m()),i&2){let e=S();f(),P(e._intl.optionalLabel)}}function dx(i,t){if(i&1&&(h(0,"div",6),b(1),m()),i&2){let e=S();f(),P(e.errorMessage)}}var sg=["*"];function px(i,t){}function ux(i,t){if(i&1&&(At(0),H(1,px,0,0,"ng-template",0)),i&2){let e=S();f(),C("cdkPortalOutlet",e._portal)}}var lg=(i,t)=>({step:i,i:t}),cg=i=>({animationDuration:i}),dg=(i,t)=>({value:i,params:t});function hx(i,t){i&1&&At(0)}function mx(i,t){i&1&&J(0,"div",6)}function fx(i,t){if(i&1&&(on(0,5),H(1,mx,1,0,"div",6)),i&2){let e=t.$implicit,n=t.$index,r=t.$count;S(2);let o=$n(4);C("ngTemplateOutlet",o)("ngTemplateOutletContext",Ro(3,lg,e,n)),f(),ae(n!==r-1?1:-1)}}function gx(i,t){if(i&1){let e=Se();h(0,"div",7),N("@horizontalStepTransition.done",function(r){X(e);let o=S(2);return K(o._animationDone.next(r))}),on(1,8),m()}if(i&2){let e=t.$implicit,n=t.$index,r=S(2);Ze("mat-horizontal-stepper-content-inactive",r.selectedIndex!==n),C("@horizontalStepTransition",Ro(8,dg,r._getAnimationDirection(n),ze(6,cg,r._getAnimationDuration())))("id",r._getStepContentId(n)),qe("aria-labelledby",r._getStepLabelId(n)),f(),C("ngTemplateOutlet",e.content)}}function bx(i,t){if(i&1&&(h(0,"div",1)(1,"div",2),St(2,fx,2,6,null,null,Mn),m(),h(4,"div",3),St(5,gx,2,11,"div",4,Mn),m()()),i&2){let e=S();f(2),Pt(e.steps),f(3),Pt(e.steps)}}function vx(i,t){if(i&1){let e=Se();h(0,"div",9),on(1,5),h(2,"div",10)(3,"div",11),N("@verticalStepTransition.done",function(r){X(e);let o=S(2);return K(o._animationDone.next(r))}),h(4,"div",12),on(5,8),m()()()()}if(i&2){let e=t.$implicit,n=t.$index,r=t.$count,o=S(2),a=$n(4);f(),C("ngTemplateOutlet",a)("ngTemplateOutletContext",Ro(10,lg,e,n)),f(),Ze("mat-stepper-vertical-line",n!==r-1),f(),Ze("mat-vertical-stepper-content-inactive",o.selectedIndex!==n),C("@verticalStepTransition",Ro(15,dg,o._getAnimationDirection(n),ze(13,cg,o._getAnimationDuration())))("id",o._getStepContentId(n)),qe("aria-labelledby",o._getStepLabelId(n)),f(2),C("ngTemplateOutlet",e.content)}}function _x(i,t){if(i&1&&St(0,vx,6,18,"div",9,Mn),i&2){let e=S();Pt(e.steps)}}function yx(i,t){if(i&1){let e=Se();h(0,"mat-step-header",13),N("click",function(){let r=X(e).step;return K(r.select())})("keydown",function(r){X(e);let o=S();return K(o._onKeydown(r))}),m()}if(i&2){let e=t.step,n=t.i,r=S();Ze("mat-horizontal-stepper-header",r.orientation==="horizontal")("mat-vertical-stepper-header",r.orientation==="vertical"),C("tabIndex",r._getFocusIndex()===n?0:-1)("id",r._getStepLabelId(n))("index",n)("state",r._getIndicatorType(n,e.state))("label",e.stepLabel||e.label)("selected",r.selectedIndex===n)("active",r._stepIsNavigable(n,e))("optional",e.optional)("errorMessage",e.errorMessage)("iconOverrides",r._iconOverrides)("disableRipple",r.disableRipple||!r._stepIsNavigable(n,e))("color",e.color||r.color),qe("aria-posinset",n+1)("aria-setsize",r.steps.length)("aria-controls",r._getStepContentId(n))("aria-selected",r.selectedIndex==n)("aria-label",e.ariaLabel||null)("aria-labelledby",!e.ariaLabel&&e.ariaLabelledby?e.ariaLabelledby:null)("aria-disabled",r._stepIsNavigable(n,e)?null:!0)}}var ea=(()=>{class i extends Ad{static{this.\u0275fac=(()=>{let e;return function(r){return(e||(e=Bc(i)))(r||i)}})()}static{this.\u0275dir=Ue({type:i,selectors:[["","matStepLabel",""]],standalone:!0,features:[Ci]})}}return i})(),_l=(()=>{class i{constructor(){this.changes=new Te,this.optionalLabel="Optional",this.completedLabel="Completed",this.editableLabel="Editable"}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function wx(i){return i||new _l}var xx={provide:_l,deps:[[new Ac,new Rc,_l]],useFactory:wx},Bd=(()=>{class i extends Fd{constructor(e,n,r,o){super(r),this._intl=e,this._focusMonitor=n,this._intlSubscription=e.changes.subscribe(()=>o.markForCheck())}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(e,n){e?this._focusMonitor.focusVia(this._elementRef,e,n):this._elementRef.nativeElement.focus(n)}_stringLabel(){return this.label instanceof ea?null:this.label}_templateLabel(){return this.label instanceof ea?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getIconContext(){return{index:this.index,active:this.active,optional:this.optional}}_getDefaultTextForState(e){return e=="number"?`${this.index+1}`:e=="edit"?"create":e=="error"?"warning":e}static{this.\u0275fac=function(n){return new(n||i)(W(_l),W(gf),W(Ce),W(It))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-step-header"]],hostAttrs:["role","tab",1,"mat-step-header"],hostVars:2,hostBindings:function(n,r){n&2&&rn("mat-"+(r.color||"primary"))},inputs:{state:"state",label:"label",errorMessage:"errorMessage",iconOverrides:"iconOverrides",index:"index",selected:"selected",active:"active",optional:"optional",disableRipple:"disableRipple",color:"color"},standalone:!0,features:[Ci,fe],decls:10,vars:17,consts:[["matRipple","",1,"mat-step-header-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"],[1,"mat-step-icon-content"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-step-label"],[1,"mat-step-text-label"],[1,"mat-step-optional"],[1,"mat-step-sub-label-error"],["aria-hidden","true"],[1,"cdk-visually-hidden"],[3,"ngTemplateOutlet"]],template:function(n,r){if(n&1&&(J(0,"div",0),h(1,"div")(2,"div",1),H(3,tx,1,2,"ng-container",2)(4,ax,2,1),m()(),h(5,"div",3),H(6,sx,2,1,"div",4)(7,lx,2,1,"div",4)(8,cx,2,1,"div",5)(9,dx,2,1,"div",6),m()),n&2){let o;C("matRippleTrigger",r._getHostElement())("matRippleDisabled",r.disableRipple),f(),_s("mat-step-icon-state-",r.state," mat-step-icon"),Ze("mat-step-icon-selected",r.selected),f(2),ae(r.iconOverrides&&r.iconOverrides[r.state]?3:4),f(2),Ze("mat-step-label-active",r.active)("mat-step-label-selected",r.selected)("mat-step-label-error",r.state=="error"),f(),ae((o=r._templateLabel())?6:r._stringLabel()?7:-1,o),f(2),ae(r.optional&&r.state!="error"?8:-1),f(),ae(r.state==="error"?9:-1)}},dependencies:[fd,Fr,rg],styles:['.mat-step-header{overflow:hidden;outline:none;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-step-header:focus .mat-focus-indicator::before{content:""}.mat-step-header:hover[aria-disabled=true]{cursor:default}.mat-step-header:hover:not([aria-disabled]),.mat-step-header:hover[aria-disabled=false]{background-color:var(--mat-stepper-header-hover-state-layer-color);border-radius:var(--mat-stepper-header-hover-state-layer-shape, var(--mat-app-corner-medium))}.mat-step-header.cdk-keyboard-focused,.mat-step-header.cdk-program-focused{background-color:var(--mat-stepper-header-focus-state-layer-color);border-radius:var(--mat-stepper-header-focus-state-layer-shape, var(--mat-app-corner-medium))}@media(hover: none){.mat-step-header:hover{background:none}}.cdk-high-contrast-active .mat-step-header{outline:solid 1px}.cdk-high-contrast-active .mat-step-header[aria-selected=true] .mat-step-label{text-decoration:underline}.cdk-high-contrast-active .mat-step-header[aria-disabled=true]{outline-color:GrayText}.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-label,.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-icon,.cdk-high-contrast-active .mat-step-header[aria-disabled=true] .mat-step-optional{color:GrayText}.mat-step-optional{font-size:12px;color:var(--mat-stepper-header-optional-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-sub-label-error{font-size:12px;font-weight:normal}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative;color:var(--mat-stepper-header-icon-foreground-color, var(--mat-app-surface));background-color:var(--mat-stepper-header-icon-background-color, var(--mat-app-on-surface-variant))}.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);display:flex}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error{background-color:var(--mat-stepper-header-error-state-icon-background-color);color:var(--mat-stepper-header-error-state-icon-foreground-color, var(--mat-app-error))}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle;font-family:var(--mat-stepper-header-label-text-font, var(--mat-app-title-small-font));font-size:var(--mat-stepper-header-label-text-size, var(--mat-app-title-small-size));font-weight:var(--mat-stepper-header-label-text-weight, var(--mat-app-title-small-weight));color:var(--mat-stepper-header-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-label.mat-step-label-active{color:var(--mat-stepper-header-selected-state-label-text-color, var(--mat-app-on-surface-variant))}.mat-step-label.mat-step-label-error{color:var(--mat-stepper-header-error-state-label-text-color, var(--mat-app-error));font-size:var(--mat-stepper-header-error-state-label-text-size, var(--mat-app-title-small-size))}.mat-step-label.mat-step-label-selected{font-size:var(--mat-stepper-header-selected-state-label-text-size, var(--mat-app-title-small-size));font-weight:var(--mat-stepper-header-selected-state-label-text-weight, var(--mat-app-title-small-weight))}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-step-icon-selected{background-color:var(--mat-stepper-header-selected-state-icon-background-color, var(--mat-app-primary));color:var(--mat-stepper-header-selected-state-icon-foreground-color, var(--mat-app-on-primary))}.mat-step-icon-state-done{background-color:var(--mat-stepper-header-done-state-icon-background-color);color:var(--mat-stepper-header-done-state-icon-foreground-color)}.mat-step-icon-state-edit{background-color:var(--mat-stepper-header-edit-state-icon-background-color, var(--mat-app-primary));color:var(--mat-stepper-header-edit-state-icon-foreground-color, var(--mat-app-on-primary))}'],encapsulation:2,changeDetection:0})}}return i})(),pg="500ms",ug="225ms",ag={horizontalStepTransition:Bo("horizontalStepTransition",[sn("previous",Ii({transform:"translate3d(-100%, 0, 0)",visibility:"hidden"})),sn("current",Ii({transform:"none",visibility:"inherit"})),sn("next",Ii({transform:"translate3d(100%, 0, 0)",visibility:"hidden"})),Nr("* => *",No([qn("{{animationDuration}} cubic-bezier(0.35, 0, 0.25, 1)"),$c("@*",Wc(),{optional:!0})]),{params:{animationDuration:pg}})]),verticalStepTransition:Bo("verticalStepTransition",[sn("previous",Ii({height:"0px",visibility:"hidden"})),sn("next",Ii({height:"0px",visibility:"hidden"})),sn("current",Ii({height:"*",visibility:"inherit"})),Nr("* <=> current",No([qn("{{animationDuration}} cubic-bezier(0.4, 0.0, 0.2, 1)"),$c("@*",Wc(),{optional:!0})]),{params:{animationDuration:ug}})])},Nd=(()=>{class i{constructor(e){this.templateRef=e}static{this.\u0275fac=function(n){return new(n||i)(W(ci))}}static{this.\u0275dir=Ue({type:i,selectors:[["ng-template","matStepperIcon",""]],inputs:{name:[0,"matStepperIcon","name"]},standalone:!0})}}return i})(),zd=(()=>{class i{constructor(e){this._template=e}static{this.\u0275fac=function(n){return new(n||i)(W(ci))}}static{this.\u0275dir=Ue({type:i,selectors:[["ng-template","matStepContent",""]],standalone:!0})}}return i})(),Ld=(()=>{class i extends fl{constructor(e,n,r,o){super(e,o),this._errorStateMatcher=n,this._viewContainerRef=r,this._isSelected=ei.EMPTY,this.stepLabel=void 0}ngAfterContentInit(){this._isSelected=this._stepper.steps.changes.pipe(Ri(()=>this._stepper.selectionChange.pipe(Ve(e=>e.selectedStep===this),Ai(this._stepper.selected===this)))).subscribe(e=>{e&&this._lazyContent&&!this._portal&&(this._portal=new An(this._lazyContent._template,this._viewContainerRef))})}ngOnDestroy(){this._isSelected.unsubscribe()}isErrorState(e,n){let r=this._errorStateMatcher.isErrorState(e,n),o=!!(e&&e.invalid&&this.interacted);return r||o}static{this.\u0275fac=function(n){return new(n||i)(W(Ir(()=>yl)),W(Go,4),W(kn),W(Rd,8))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-step"]],contentQueries:function(n,r,o){if(n&1&&(Et(o,ea,5),Et(o,zd,5)),n&2){let a;Fe(a=Ae())&&(r.stepLabel=a.first),Fe(a=Ae())&&(r._lazyContent=a.first)}},hostAttrs:["hidden",""],inputs:{color:"color"},exportAs:["matStep"],standalone:!0,features:[di([{provide:Go,useExisting:i},{provide:fl,useExisting:i}]),Ci,fe],ngContentSelectors:sg,decls:1,vars:0,consts:[[3,"cdkPortalOutlet"]],template:function(n,r){n&1&&(jt(),H(0,ux,2,1,"ng-template"))},dependencies:[Xm],encapsulation:2,changeDetection:0})}}return i})(),yl=(()=>{class i extends gl{get animationDuration(){return this._animationDuration}set animationDuration(e){this._animationDuration=/^\d+$/.test(e)?e+"ms":e}constructor(e,n,r){super(e,n,r),this._stepHeader=void 0,this._steps=void 0,this.steps=new Dn,this.animationDone=new He,this.labelPosition="end",this.headerPosition="top",this._iconOverrides={},this._animationDone=new Te,this._animationDuration="",this._isServer=!O(lt).isBrowser;let o=r.nativeElement.nodeName.toLowerCase();this.orientation=o==="mat-vertical-stepper"?"vertical":"horizontal"}ngAfterContentInit(){super.ngAfterContentInit(),this._icons.forEach(({name:e,templateRef:n})=>this._iconOverrides[e]=n),this.steps.changes.pipe(ti(this._destroyed)).subscribe(()=>{this._stateChanged()}),this._animationDone.pipe(ti(this._destroyed)).subscribe(e=>{e.toState==="current"&&this.animationDone.emit()})}_stepIsNavigable(e,n){return n.completed||this.selectedIndex===e||!this.linear}_getAnimationDuration(){return this.animationDuration?this.animationDuration:this.orientation==="horizontal"?pg:ug}static{this.\u0275fac=function(n){return new(n||i)(W(Fn,8),W(It),W(Ce))}}static{this.\u0275cmp=pe({type:i,selectors:[["mat-stepper"],["mat-vertical-stepper"],["mat-horizontal-stepper"],["","matStepper",""]],contentQueries:function(n,r,o){if(n&1&&(Et(o,Ld,5),Et(o,Nd,5)),n&2){let a;Fe(a=Ae())&&(r._steps=a),Fe(a=Ae())&&(r._icons=a)}},viewQuery:function(n,r){if(n&1&&ut(Bd,5),n&2){let o;Fe(o=Ae())&&(r._stepHeader=o)}},hostAttrs:["role","tablist"],hostVars:11,hostBindings:function(n,r){n&2&&(qe("aria-orientation",r.orientation),Ze("mat-stepper-horizontal",r.orientation==="horizontal")("mat-stepper-vertical",r.orientation==="vertical")("mat-stepper-label-position-end",r.orientation==="horizontal"&&r.labelPosition=="end")("mat-stepper-label-position-bottom",r.orientation==="horizontal"&&r.labelPosition=="bottom")("mat-stepper-header-position-bottom",r.headerPosition==="bottom"))},inputs:{disableRipple:"disableRipple",color:"color",labelPosition:"labelPosition",headerPosition:"headerPosition",animationDuration:"animationDuration"},outputs:{animationDone:"animationDone"},exportAs:["matStepper","matVerticalStepper","matHorizontalStepper"],standalone:!0,features:[di([{provide:gl,useExisting:i}]),Ci,fe],ngContentSelectors:sg,decls:5,vars:2,consts:[["stepTemplate",""],[1,"mat-horizontal-stepper-wrapper"],[1,"mat-horizontal-stepper-header-container"],[1,"mat-horizontal-content-container"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id","mat-horizontal-stepper-content-inactive"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"mat-stepper-horizontal-line"],["role","tabpanel",1,"mat-horizontal-stepper-content",3,"id"],[3,"ngTemplateOutlet"],[1,"mat-step"],[1,"mat-vertical-content-container"],["role","tabpanel",1,"mat-vertical-stepper-content",3,"id"],[1,"mat-vertical-content"],[3,"click","keydown","tabIndex","id","index","state","label","selected","active","optional","errorMessage","iconOverrides","disableRipple","color"]],template:function(n,r){if(n&1&&(jt(),H(0,hx,1,0)(1,bx,7,0,"div",1)(2,_x,2,0)(3,yx,1,23,"ng-template",null,0,we)),n&2){let o;ae(r._isServer?0:-1),f(),ae((o=r.orientation)==="horizontal"?1:o==="vertical"?2:-1)}},dependencies:[Fr,Bd],styles:['.mat-stepper-vertical,.mat-stepper-horizontal{display:block;font-family:var(--mat-stepper-container-text-font, var(--mat-app-body-medium-font));background:var(--mat-stepper-container-color, var(--mat-app-surface))}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-header-position-bottom .mat-horizontal-stepper-header-container{order:1}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px;border-top-color:var(--mat-stepper-line-color, var(--mat-app-outline))}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:calc(calc((var(--mat-stepper-header-height) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{border-top-width:1px;border-top-style:solid;content:"";display:inline-block;height:0;position:absolute;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px;height:var(--mat-stepper-header-height)}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-horizontal-stepper-header::before,.mat-horizontal-stepper-header::after{border-top-color:var(--mat-stepper-line-color, var(--mat-app-outline))}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{padding:calc((var(--mat-stepper-header-height) - 24px) / 2) 24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header::after{top:calc(calc((var(--mat-stepper-header-height) - 24px) / 2) + 12px)}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;height:24px;padding:calc((var(--mat-stepper-header-height) - 24px) / 2) 24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-wrapper{display:flex;flex-direction:column}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content.mat-horizontal-stepper-content-inactive{height:0;overflow:hidden}.mat-horizontal-stepper-content:not(.mat-horizontal-stepper-content-inactive){visibility:inherit !important}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.cdk-high-contrast-active .mat-horizontal-content-container{outline:solid 1px}.mat-stepper-header-position-bottom .mat-horizontal-content-container{padding:24px 24px 0 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}.cdk-high-contrast-active .mat-vertical-content-container{outline:solid 1px}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:"";position:absolute;left:0;border-left-width:1px;border-left-style:solid;border-left-color:var(--mat-stepper-line-color, var(--mat-app-outline));top:calc(8px - calc((var(--mat-stepper-header-height) - 24px) / 2));bottom:calc(8px - calc((var(--mat-stepper-header-height) - 24px) / 2))}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-stepper-content:not(.mat-vertical-stepper-content-inactive){visibility:inherit !important}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}'],encapsulation:2,data:{animation:[ag.horizontalStepTransition,ag.verticalStepTransition]},changeDetection:0})}}return i})();var hg=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({providers:[xx,Go],imports:[rt,et,qr,Zf,og,Yo,yl,Bd,rt]})}}return i})();var mg=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({imports:[rt,Yo,rt]})}}return i})();var fg=[{path:"",title:"Choose Product",icon:"fas fa-shopping-cart",class:"",label:"",labelClass:"side-badge badge bg-success",extralink:!1,submenu:[]},{path:"",title:"Customize Label",icon:"fas fa-tag",class:"",label:"",labelClass:"",extralink:!1,submenu:[]},{path:"",title:"Print Preview",icon:"fas fa-print",class:"",label:"",labelClass:"",extralink:!1,submenu:[]}];var gg=(()=>{class i{constructor(){this.collapseSidebar=!1,this.fullScreen=!1,this.MENUITEMS=fg,this.items=new ko(this.MENUITEMS)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ex=["stepper"];function Ix(i,t){if(i&1&&(h(0,"div",2)(1,"span",12),b(2),m()()),i&2){let e=S();f(2),P(e.sidebarTitle())}}function Dx(i,t){i&1&&(h(0,"div",3)(1,"span",13),b(2,"BA"),m()())}function kx(i,t){i&1&&b(0,"Choose Product")}function Tx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Mx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Ox(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Fx(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Select the product that you want to print "),m()())}function Ax(i,t){i&1&&b(0,"Customize Label")}function Rx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Bx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Nx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function zx(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Configure sticker label layout and visibility"),m()())}function Lx(i,t){i&1&&b(0,"Print Preview")}function jx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Hx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Vx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Ux(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Select the paper type, "),m(),h(3,"span",22),b(4,"then configure adjust the position and margins to ensure accurate sticker placement"),m()())}function Wx(i,t){if(i&1){let e=Se();h(0,"mat-stepper",14,0),N("selectedIndexChange",function(r){X(e);let o=S();return K(o.onStepperSelectionChange(r))}),h(2,"mat-step",15),H(3,kx,1,0,"ng-template",16)(4,Tx,1,1,"ng-template",17)(5,Mx,1,1,"ng-template",18)(6,Ox,1,1,"ng-template",19)(7,Fx,3,0,"ng-template",20),m(),h(8,"mat-step",15),H(9,Ax,1,0,"ng-template",16)(10,Rx,1,1,"ng-template",17)(11,Bx,1,1,"ng-template",18)(12,Nx,1,1,"ng-template",19)(13,zx,3,0,"ng-template",20),m(),h(14,"mat-step",15),H(15,Lx,1,0,"ng-template",16)(16,jx,1,1,"ng-template",17)(17,Hx,1,1,"ng-template",18)(18,Vx,1,1,"ng-template",19)(19,Ux,5,0,"ng-template",20),m()()}if(i&2){let e=S();C("selectedIndex",e.step())("linear",!1),f(2),C("completed",!1),f(6),C("completed",!1),f(6),C("completed",!1)}}function $x(i,t){i&1&&b(0,"Choose Product")}function qx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Gx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Yx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Xx(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Select the product that you want to print "),m()())}function Kx(i,t){i&1&&b(0,"Print Preview")}function Qx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Zx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function Jx(i,t){if(i&1&&b(0),i&2){let e=t.index;P(e+1)}}function eC(i,t){i&1&&(h(0,"div",21)(1,"span",22),b(2,"Select the paper type, "),m(),h(3,"span",22),b(4,"then configure adjust the position and margins to ensure accurate sticker placement"),m()())}function tC(i,t){if(i&1){let e=Se();h(0,"mat-stepper",14,0),N("selectedIndexChange",function(r){X(e);let o=S();return K(o.onStepperSelectionChange(r))}),h(2,"mat-step",15),H(3,$x,1,0,"ng-template",16)(4,qx,1,1,"ng-template",17)(5,Gx,1,1,"ng-template",18)(6,Yx,1,1,"ng-template",19)(7,Xx,3,0,"ng-template",20),m(),h(8,"mat-step",15),H(9,Kx,1,0,"ng-template",16)(10,Qx,1,1,"ng-template",17)(11,Zx,1,1,"ng-template",18)(12,Jx,1,1,"ng-template",19)(13,eC,5,0,"ng-template",20),m()()}if(i&2){let e=S();C("selectedIndex",e.step())("linear",!1),f(2),C("completed",!1),f(6),C("completed",!1)}}function iC(i,t){if(i&1){let e=Se();h(0,"div",8)(1,"h6",23)(2,"button",24),b(3," Switch Barcode Mode "),m()(),h(4,"a",25),J(5,"img",26),h(6,"strong",27),b(7),m()(),h(8,"ul",28)(9,"li")(10,"a",29),b(11),m()(),h(12,"li")(13,"a",30),N("click",function(){X(e);let r=S();return K(r.authService.logout())}),J(14,"i",31),h(15,"span"),b(16,"Sign out"),m()()()()()}if(i&2){let e=S();f(7),P(e.username),f(3),C("href","https://"+e.domain(),Wn),f(),P(e.domain())}}function nC(i,t){if(i&1){let e=Se();h(0,"div",9)(1,"a",25),J(2,"img",26),m(),h(3,"ul",28)(4,"li")(5,"a",29),b(6),m()(),h(7,"li")(8,"a",30),N("click",function(){X(e);let r=S();return K(r.authService.logout())}),J(9,"i",31),h(10,"span"),b(11,"Sign out"),m()()()()()}if(i&2){let e=S();f(5),C("href","https://"+e.domain(),Wn),f(),P(e.domain())}}var bg=(()=>{class i{handleNotify(){this.notify.emit(!this.showClass)}constructor(e,n){this.menuServise=e,this.router=n,this._formBuilder=O(Wi),this.step=B(0),this.printMode=B(1),this.sidebarTitle=B(""),this.firstFormGroup=this._formBuilder.group({firstCtrl:["",mt.required]}),this.secondFormGroup=this._formBuilder.group({secondCtrl:["",mt.required]}),this.showMenu="",this.showSubMenu="",this.sidebarnavItems=[],this.path="",this.authService=O(Dm),this.username="",this.domain=B(""),this.brand=B(""),this.showClass=!1,this.notify=new He,this.cdr=O(It),this.storeService=O(Re),this.route=O(Ui),this.stepperRef=null,this.injector=O(Ye),this.storeSevice=O(Re),this.menuServise.items.subscribe(r=>{this.sidebarnavItems=r,this.sidebarnavItems.filter(o=>o.submenu.filter(a=>{a.path===this.router.url&&(this.path=o.title)})),this.addExpandClass(this.path)})}addExpandClass(e){e===this.showMenu?this.showMenu="0":this.showMenu=e}ngOnInit(){Dt(this.storeService.productItems,{injector:this.injector}).pipe(st(e=>e.length<=0),Ee(()=>this.stepperRef?.steps.forEach(e=>e.completed=!1))).subscribe(),this.route.queryParamMap.pipe(st(e=>e.has("step")),Ve(e=>+e.get("step")),Ee(e=>this.step.set(e))).subscribe()}addActiveClass(e){e===this.showSubMenu?this.showSubMenu="0":this.showSubMenu=e,window.scroll({top:0,left:0,behavior:"smooth"})}ngAfterViewInit(){this.username=localStorage.getItem("Username"),this.brand.set(localStorage.getItem("Brand")),this.domain.set(localStorage.getItem("Domain")),(localStorage.getItem("PrintMode")||"barcode")==="barcode"?(this.printMode.set(1),this.sidebarTitle.set("Barcode Apps")):(this.printMode.set(2),this.sidebarTitle.set("Price Label")),this.storeService.onChangeStepperRef(this.stepperRef),this.cdr.detectChanges()}onGotoStepper(e){this.storeSevice.onGotoStepper(e)}onStepperSelectionChange(e){let n=[...this.storeService.productItems()];this.storeService.onChangeProductItems(n.map(r=>k(_({},r),{isSelected:!1}))),console.log("event",e),this.storeService.onGotoStepper(e),this.stepperRef.steps.forEach((r,o)=>{o>e&&(r.completed=!1),o<=e&&(o===0&&this.storeService.productItems().length<=0?r.completed=!1:r.completed=!0)}),console.log("completed",this.stepperRef.steps.toArray().map(r=>r.completed))}onSwitchMode(){this.router.navigate(["/pages/v2/print-mode"]),localStorage.removeItem("printMode")}static{this.\u0275fac=function(n){return new(n||i)(W(gg),W(Ei))}}static{this.\u0275cmp=pe({type:i,selectors:[["app-vertical-sidebar"]],viewQuery:function(n,r){if(n&1&&ut(Ex,5),n&2){let o;Fe(o=Ae())&&(r.stepperRef=o.first)}},inputs:{showClass:"showClass"},outputs:{notify:"notify"},standalone:!0,features:[fe],decls:14,vars:3,consts:[["stepper",""],[1,"d-flex","flex-column","h-100","position-relative"],[1,"d-flex","align-items-center",2,"height","61px","border-bottom","1px solid #ddd","padding","0 2rem"],[1,"d-flex","align-items-center","justify-content-center",2,"height","61px","border-bottom","1px solid #ddd"],[1,"sidebar-nav","flex-grow-1"],["id","sidebarnav"],["orientation","vertical",3,"selectedIndex","linear"],[1,"d-flex","flex-column","px-2","py-2"],["ngbDropdown","",1,"dropdown",2,"margin","0 1.5rem"],["ngbDropdown","",1,"dropdown"],[1,"collapse__icon","z-1",3,"click"],[1,"fas","fa-caret-left"],[1,"hide-menu","fs-6","fw-normal","text-capitalize"],[1,"fs-6","fw-normal","text-capitalize"],["orientation","vertical",3,"selectedIndexChange","selectedIndex","linear"],[3,"completed"],["matStepLabel",""],["matStepperIcon","done"],["matStepperIcon","create"],["matStepperIcon","edit"],["matStepContent",""],[1,"d-flex","flex-column","form-text","fw-normal","fs-2","my-0"],[1,""],[1,"text-muted","fw-bolder"],["routerLink","/pages/v2/print-mode","rel","noopener noreferrer","target","_blank",1,"btn","btn-link","text-primary","text-decoration-none","px-0"],["aria-expanded","false","data-bs-toggle","dropdown","href","javascript:void(0)","ngbDropdownToggle","",1,"hide-menu","d-flex","align-items-center","link-body-emphasis","text-decoration-none","dropdown-toggle",2,"margin-right","0"],["alt","","height","32","src","assets/images/users/user4.jpg","width","32",1,"rounded-circle","me-2"],[1,"hide-menu","m-0"],["ngbDropdownMenu","",1,"dropdown-menu","text-small","shadow","hide-menu"],["rel","noopener noreferrer","target","_blank",1,"dropdown-item",3,"href"],["href","javascript:void(0)",1,"dropdown-item","text-dark","d-flex","gap-2","align-items-center","fs-3",3,"click"],[1,"fas","fa-sign-out-alt"]],template:function(n,r){if(n&1&&(h(0,"div",1),H(1,Ix,3,1,"div",2)(2,Dx,3,0,"div",3),h(3,"nav",4)(4,"ul",5),J(5,"br"),H(6,Wx,20,5,"mat-stepper",6)(7,tC,14,4,"mat-stepper",6),m()(),h(8,"div",7),J(9,"hr"),H(10,iC,17,3,"div",8)(11,nC,12,2,"div",9),m(),h(12,"div",10),N("click",function(){return r.storeService.onToggleSidebarType()}),J(13,"i",11),m()()),n&2){let o,a;f(),ae((o=r.storeSevice.options().sidebartype)==="full"?1:o==="mini-sidebar"?2:-1),f(5),ae(r.printMode()===1?6:7),f(4),ae((a=r.storeSevice.options().sidebartype)==="full"?10:a==="mini-sidebar"?11:-1)}},dependencies:[Im,et,ym,_m,Es,Ls,zs,Ns,mg,hg,Ld,ea,yl,Nd,zd,gt,bt,Zo,Qf],styles:[".collapse__icon[_ngcontent-%COMP%]{border:1px solid black;border-radius:50%;padding:.5rem;transition:all .5s ease-in-out;position:absolute;top:17px;right:-10px;opacity:0;display:flex;justify-content:center;align-items:center;width:25px;height:25px}.collapse__icon[_ngcontent-%COMP%]:hover{opacity:1}.sidebar-item[_ngcontent-%COMP%]{margin:0 1rem}.sidebar-item.active[_ngcontent-%COMP%]{background:#2075d0;border-radius:4px}.sidebar-item[_ngcontent-%COMP%] .sidebar-link[_ngcontent-%COMP%]{padding:.5rem;font-weight:400}.sidebar-item[_ngcontent-%COMP%], .sidebar-link.active[_ngcontent-%COMP%], .sidebar-link.active[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff!important}.sidebar-item[_ngcontent-%COMP%] .user-profile[_ngcontent-%COMP%] .sidebar-link[_ngcontent-%COMP%]{margin-left:.5rem}.sidebar-item[_ngcontent-%COMP%] .sidebar-link[_ngcontent-%COMP%]:hover:not(.active), .sidebar-item[_ngcontent-%COMP%] .sidebar-link[_ngcontent-%COMP%]:hover:not(.active) i[_ngcontent-%COMP%]{background:#ebf3f5;color:#000!important}.sidebar-item[_ngcontent-%COMP%] .sidebar-link.active[_ngcontent-%COMP%], .sidebar-item[_ngcontent-%COMP%] .sidebar-link.active[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{background:initial;color:initial} .mat-stepper-vertical .mat-step-header{padding:15px 32px} .mat-stepper-vertical .mat-vertical-content{padding:0 24px} .mat-stepper-vertical .mat-vertical-content-container{margin-left:44px}"]})}}return i})();var vg=(()=>{class i{constructor(){this.subject$=new Te}onFileLoad(e){let r=e.target.result,o=!1,a=[],s=[],l=0;for(let c of r.split(/[\r\n]+/))if(o){let d={};for(let p=0;p<l;p++)d[s[p]]=c.split(",")[p];a.push(d)}else{for(let d=0;d<c.split(",").length;d++)l=c.split(",").length,s.push(c.split(",")[d].replace(/ /g,""));o=!0}return a.splice(-1),a}convertFile(e){let n=e,r=new FileReader;return r.onload=o=>{let a=this.onFileLoad(o);this.subject$.next(a)},r.readAsText(n,"UTF-8"),this.subject$.asObservable()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var _g=(()=>{class i{constructor(e,n,r){this.http=e,this.toastr=n,this.router=r}PostToUrlEncode(e,n,r=1e5){let o=new Pi;return o=o.set("Content-Type","application/x-www-form-urlencoded"),new Ft(a=>{this.http.post(e,n,{headers:o}).pipe(Vi(r)).subscribe(s=>{a.next(s),a.complete()})})}GetText(e=1e5){let n=localStorage.getItem("Token"),o={responseType:"text",headers:new Pi({Authorization:"Bearer "+n})};return new Ft(a=>{this.http.get("/API/Token/GetZendeskJWT",o).pipe(Vi(e)).subscribe(s=>{a.next(s),a.complete()})})}POSText(e,n,r=1e5){let o=localStorage.getItem("Token"),s={responseType:"text",headers:new Pi({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+o})};return new Ft(l=>{this.http.post(e,n,s).pipe(Vi(r)).subscribe(c=>{l.next(c),l.complete()})})}get(e){let n=localStorage.getItem("Token"),r=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});n&&(r=r.append("Authorization","Bearer "+n));let o={headers:r};return this.http.get(e,o).pipe(En(a=>{if(!this.unauthorizedErrorHandling(a)){let l=this.errorMessageHandling(a);this.toastr.error(l.Message!=""?l.Message:"An unknown error has occured!",l.header),this.paymentErrorHandling(a)}return hs(()=>a)}))}getNews(e){return this.http.get(e)}paymentErrorHandling(e){e.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(e,n,r=1e5){return new Ft(o=>{let a=localStorage.getItem("Token"),s=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+c(this.getMonth()+1)+"-"+c(this.getDate())+"T"+c(this.getHours())+":"+c(this.getMinutes())+":"+c(this.getSeconds())+".000"};function c(d){return d<10?"0"+d:d}this.http.post(e,n,l).pipe(Vi(r)).subscribe({next:d=>{o.next(d),o.complete()},error:d=>{if(d.status==200)o.next(d.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(d)){let v=this.errorMessageHandling(d);this.toastr.error(v.Message!=""?v.Message:"An unknown error has occured!",v.header,{enableHtml:!0})}o.error(d)}}})})}postFile(e,n,r=1e5){return new Ft(o=>{let a=localStorage.getItem("Token"),s=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a)),this.http.post(e,n,{headers:s,observe:"response",responseType:"blob"}).pipe(Vi(r)).subscribe({next:l=>{o.next({title:l.headers.get("Content-Disposition"),file:l.body}),o.complete()},error:l=>{if(l.headers.get("Content-Type")==="application/json; charset=utf-8"){let c=new FileReader;c.addEventListener("loadend",d=>{let p=JSON.parse(d.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(l)){let g=this.errorMessageHandling(l);this.toastr.error(p??"An unknown error has occured!",g.header,{enableHtml:!0})}}),c.readAsText(l.error)}o.error(l)}})})}put(e,n,r=1e5){return new Ft(o=>{let a=localStorage.getItem("Token"),s=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s};this.http.put(e,n,l).pipe(Vi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}delete(e,n,r=1e5){return new Ft(o=>{let a=localStorage.getItem("Token"),s=new Pi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s,body:n};this.http.delete(e,l).pipe(Vi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}unauthorizedErrorHandling(e){let n=!1;return(e.status==401||e.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",n=!0),n}errorMessageHandling(e){let n="API Error",r="Exception Message";return e.error?(n="API Error - "+e.status,e.status==451&&(n="Error"),e.error&&(r=e.error.Message)):e.Message&&(n="API Error - "+e.name,r=e.Message),{header:n,Message:r}}postFormDataWithoutBearer(e,n){return new Ft(r=>{this.http.post(e,n).pipe(Vi(1e5)).subscribe({next:o=>{r.next(o),r.complete()},error:o=>{o.status==200&&(r.next(o.error.text),r.complete()),r.error(o)}})})}postFormData(e,n,r=!0){return new Ft(o=>{let a=localStorage.getItem("Token"),l={headers:new Pi({Authorization:"Bearer "+a})};this.http.post(e,n,l).pipe(Vi(1e5)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)&&r){let p=this.errorMessageHandling(c);this.toastr.error(p.Message!=""?p.Message:"An unknown error has occured!",p.header)}o.error(c)}}})})}static{this.\u0275fac=function(n){return new(n||i)(U(Ps),U(zr),U(Ei))}}static{this.\u0275prov=be({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function wl(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var rC=0;function wg(i){return"__private_"+rC+++"_"+i}function oC(i,t,e){let n=[];return i.forEach(r=>typeof r!="string"?n.push(r):t[Symbol.split](r).forEach((o,a,s)=>{o!==""&&n.push(o),a<s.length-1&&n.push(e)})),n}function yg(i,t){let e=/\$/g,n="$$$$",r=[i];if(t==null)return r;for(let o of Object.keys(t))if(o!=="_"){let a=t[o];typeof a=="string"&&(a=e[Symbol.replace](a,n)),r=oC(r,new RegExp(`%\\{${o}\\}`,"g"),a)}return r}var aC=i=>{throw new Error(`missing string: ${i}`)},ta=wg("onMissingKey"),ia=wg("apply"),Zr=class{constructor(t,e){let{onMissingKey:n=aC}=e===void 0?{}:e;Object.defineProperty(this,ia,{value:sC}),Object.defineProperty(this,ta,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(t)?t.forEach(wl(this,ia)[ia],this):wl(this,ia)[ia](t),wl(this,ta)[ta]=n}translate(t,e){return this.translateArray(t,e).join("")}translateArray(t,e){let n=this.locale.strings[t];if(n==null&&(wl(this,ta)[ta](t),n=t),typeof n=="object"){if(e&&typeof e.smart_count<"u"){let o=this.locale.pluralize(e.smart_count);return yg(n[o],e)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof n!="string")throw new Error("string was not a string");return yg(n,e)}};function sC(i){if(!(i!=null&&i.strings))return;let t=this.locale;Object.assign(this.locale,{strings:_(_({},t.strings),i.strings),pluralize:i.pluralize||t.pluralize})}var v0=Ne(Cg(),1);var lC="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Bn=(i=21)=>{let t="",e=i|0;for(;e--;)t+=lC[Math.random()*64|0];return t};var _0=Ne(i0(),1);function Cl(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var tS=0;function n0(i){return"__private_"+tS+++"_"+i}var iS={version:"4.2.0"},Zn=n0("callbacks"),Wd=n0("publish"),Sl=class{constructor(){Object.defineProperty(this,Wd,{value:nS}),this.state={},Object.defineProperty(this,Zn,{writable:!0,value:new Set})}getState(){return this.state}setState(t){let e=_({},this.state),n=_(_({},this.state),t);this.state=n,Cl(this,Wd)[Wd](e,n,t)}subscribe(t){return Cl(this,Zn)[Zn].add(t),()=>{Cl(this,Zn)[Zn].delete(t)}}};function nS(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];Cl(this,Zn)[Zn].forEach(n=>{n(...t)})}Sl.VERSION=iS.version;var r0=Sl;function Xi(i){let t=i.lastIndexOf(".");return t===-1||t===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,t),extension:i.slice(t+1)}}var $d={__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 ra(i){var t;if(i.type)return i.type;let e=i.name?(t=Xi(i.name).extension)==null?void 0:t.toLowerCase():null;return e&&e in $d?$d[e]:"application/octet-stream"}function rS(i){return i.charCodeAt(0).toString(32)}function o0(i){let t="";return i.replace(/[^A-Z0-9]/gi,e=>(t+=`-${rS(e)}`,"/"))+t}function a0(i,t){let e=t||"uppy";return typeof i.name=="string"&&(e+=`-${o0(i.name.toLowerCase())}`),i.type!==void 0&&(e+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(e+=`-${o0(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(e+=`-${i.data.size}`),i.data.lastModified!==void 0&&(e+=`-${i.data.lastModified}`),e}function oS(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Pl(i,t){if(oS(i))return i.id;let e=ra(i);return a0(k(_({},i),{type:e}),t)}function qd(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let t=/Edge\/(\d+\.\d+)/.exec(i);if(!t)return!0;let n=t[1].split(".",2),r=parseInt(n[0],10),o=parseInt(n[1],10);return r<15||r===15&&o<15063||r>18||r===18&&o>=18218}function Gd(i,t){return t.name?t.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Yd(i){return i<10?`0${i}`:i.toString()}function Jr(){let i=new Date,t=Yd(i.getHours()),e=Yd(i.getMinutes()),n=Yd(i.getSeconds());return`${t}:${e}:${n}`}var s0={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.error(`[Uppy] [${Jr()}]`,...t)}},l0={debug:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.debug(`[Uppy] [${Jr()}]`,...t)},warn:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.warn(`[Uppy] [${Jr()}]`,...t)},error:function(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return console.error(`[Uppy] [${Jr()}]`,...t)}};var aa=Ne(oa(),1),f0=Ne(m0(),1),g0={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},ii=class extends Error{constructor(t,e){var n;super(t),this.isRestriction=!0,this.isUserFacing=(n=e?.isUserFacing)!=null?n:!0,e!=null&&e.file&&(this.file=e.file)}},El=class{constructor(t,e){this.getI18n=e,this.getOpts=()=>{var n;let r=t();if(((n=r.restrictions)==null?void 0:n.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(t,e){let{maxTotalFileSize:n,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&t.filter(a=>!a.isGhost).length+e.length>r)throw new ii(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(n){let o=[...t,...e].reduce((a,s)=>{var l;return a+((l=s.size)!=null?l:0)},0);if(o>n)throw new ii(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,aa.default)(n),size:(0,aa.default)(o)}))}}validateSingleFile(t){let{maxFileSize:e,minFileSize:n,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(s=>s.includes("/")?t.type?(0,f0.default)(t.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&t.extension?t.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){let s=r.join(", ");throw new ii(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:t})}if(e&&t.size!=null&&t.size>e){var o;throw new ii(this.getI18n()("exceedsSize",{size:(0,aa.default)(e),file:(o=t.name)!=null?o:this.getI18n()("unnamed")}),{file:t})}if(n&&t.size!=null&&t.size<n)throw new ii(this.getI18n()("inferiorSize",{size:(0,aa.default)(n)}),{file:t})}validate(t,e){e.forEach(n=>{this.validateSingleFile(n)}),this.validateAggregateRestrictions(t,e)}validateMinNumberOfFiles(t){let{minNumberOfFiles:e}=this.getOpts().restrictions;if(e&&Object.keys(t).length<e)throw new ii(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:e}))}getMissingRequiredMetaFields(t){var e;let n=new ii(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(e=t.name)!=null?e:this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,o=[];for(let a of r)(!Object.hasOwn(t.meta,a)||t.meta[a]==="")&&o.push(a);return{missingFields:o,error:n}}};var b0={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",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",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",pleaseWait:"Please wait"}};function $(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var lS=0;function Qe(i){return"__private_"+lS+++"_"+i}var cS={version:"4.4.1"},Il={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},Bt=Qe("plugins"),Nt=Qe("restricter"),sa=Qe("storeUnsubscribe"),un=Qe("emitter"),Jn=Qe("preProcessors"),er=Qe("uploaders"),fn=Qe("postProcessors"),hi=Qe("informAndEmit"),ha=Qe("checkRequiredMetaFieldsOnFile"),Xd=Qe("checkRequiredMetaFields"),la=Qe("assertNewUploadAllowed"),Zd=Qe("transformFile"),ca=Qe("startIfAutoProceed"),da=Qe("checkAndUpdateFileState"),Jd=Qe("handleUploadProgress"),pa=Qe("updateTotalProgress"),gn=Qe("updateTotalProgressThrottled"),ep=Qe("calculateTotalProgress"),Kd=Qe("addListeners"),zi=Qe("updateOnlineStatus"),ua=Qe("requestClientById"),hn=Qe("createUpload"),Qd=Qe("getUpload"),tr=Qe("removeUpload"),mn=Qe("runUpload"),Dl=class i{constructor(t){Object.defineProperty(this,mn,{value:CS}),Object.defineProperty(this,tr,{value:xS}),Object.defineProperty(this,Qd,{value:wS}),Object.defineProperty(this,hn,{value:yS}),Object.defineProperty(this,Kd,{value:_S}),Object.defineProperty(this,ep,{value:vS}),Object.defineProperty(this,pa,{value:bS}),Object.defineProperty(this,da,{value:gS}),Object.defineProperty(this,ca,{value:fS}),Object.defineProperty(this,Zd,{value:mS}),Object.defineProperty(this,la,{value:hS}),Object.defineProperty(this,Xd,{value:uS}),Object.defineProperty(this,ha,{value:pS}),Object.defineProperty(this,hi,{value:dS}),Object.defineProperty(this,Bt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Nt,{writable:!0,value:void 0}),Object.defineProperty(this,sa,{writable:!0,value:void 0}),Object.defineProperty(this,un,{writable:!0,value:(0,v0.default)()}),Object.defineProperty(this,Jn,{writable:!0,value:new Set}),Object.defineProperty(this,er,{writable:!0,value:new Set}),Object.defineProperty(this,fn,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Jd,{writable:!0,value:(r,o)=>{let a=r?this.getFile(r.id):void 0;if(r==null||!a){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}let s={bytesTotal:o.bytesTotal,percentage:o.bytesTotal!=null&&Number.isFinite(o.bytesTotal)&&o.bytesTotal>0?Math.round(o.bytesUploaded/o.bytesTotal*100):void 0};a.progress.uploadStarted!=null?this.setFileState(r.id,{progress:k(_(_({},a.progress),s),{bytesUploaded:o.bytesUploaded})}):this.setFileState(r.id,{progress:_(_({},a.progress),s)}),$(this,gn)[gn]()}}),Object.defineProperty(this,gn,{writable:!0,value:(0,_0.default)(()=>$(this,pa)[pa](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,zi,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,ua,{writable:!0,value:new Map}),this.defaultLocale=b0;let e={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:g0,meta:{},onBeforeFileAdded:(r,o)=>!Object.hasOwn(o,r.id),onBeforeUpload:r=>r,store:new r0,logger:s0,infoTimeout:5e3},n=_(_({},e),t);this.opts=k(_({},n),{restrictions:_(_({},e.restrictions),t&&t.restrictions)}),t&&t.logger&&t.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"):t&&t.debug&&(this.opts.logger=l0),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(k(_({},Il),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:qd(),individualCancellation:!0,resumableUploads:!1},meta:_({},this.opts.meta),info:[]})),$(this,Nt)[Nt]=new El(()=>this.opts,()=>this.i18n),$(this,sa)[sa]=this.store.subscribe((r,o,a)=>{this.emit("state-update",r,o,a),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),$(this,Kd)[Kd]()}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];$(this,un)[un].emit(t,...n)}on(t,e){return $(this,un)[un].on(t,e),this}once(t,e){return $(this,un)[un].once(t,e),this}off(t,e){return $(this,un)[un].off(t,e),this}updateAll(t){this.iteratePlugins(e=>{e.update(t)})}setState(t){this.store.setState(t)}getState(){return this.store.getState()}patchFilesState(t){let e=this.getState().files;this.setState({files:_(_({},e),Object.fromEntries(Object.entries(t).map(n=>{let[r,o]=n;return[r,_(_({},e[r]),o)]})))})}setFileState(t,e){if(!this.getState().files[t])throw new Error(`Can\u2019t set state for ${t} (the file could have been removed)`);this.patchFilesState({[t]:e})}i18nInit(){let t=n=>this.log(`Missing i18n string: ${n}`,"error"),e=new Zr([this.defaultLocale,this.opts.locale],{onMissingKey:t});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(t){this.opts=k(_(_({},this.opts),t),{restrictions:_(_({},this.opts.restrictions),t?.restrictions)}),t.meta&&this.setMeta(t.meta),this.i18nInit(),t.locale&&this.iteratePlugins(e=>{e.setOptions(t)}),this.setState(void 0)}resetProgress(){let t={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},e=_({},this.getState().files),n=Object.create(null);Object.keys(e).forEach(r=>{n[r]=k(_({},e[r]),{progress:_(_({},e[r].progress),t),tus:void 0,transloadit:void 0})}),this.setState(_({files:n},Il))}clear(){let{capabilities:t,currentUploads:e}=this.getState();if(Object.keys(e).length>0&&!t.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(k(_({},Il),{files:{}}))}addPreProcessor(t){$(this,Jn)[Jn].add(t)}removePreProcessor(t){return $(this,Jn)[Jn].delete(t)}addPostProcessor(t){$(this,fn)[fn].add(t)}removePostProcessor(t){return $(this,fn)[fn].delete(t)}addUploader(t){$(this,er)[er].add(t)}removeUploader(t){return $(this,er)[er].delete(t)}setMeta(t){let e=_(_({},this.getState().meta),t),n=_({},this.getState().files);Object.keys(n).forEach(r=>{n[r]=k(_({},n[r]),{meta:_(_({},n[r].meta),t)})}),this.log("Adding metadata:"),this.log(t),this.setState({meta:e,files:n})}setFileMeta(t,e){let n=_({},this.getState().files);if(!n[t]){this.log(`Was trying to set metadata for a file that has been removed: ${t}`);return}let r=_(_({},n[t].meta),e);n[t]=k(_({},n[t]),{meta:r}),this.setState({files:n})}getFile(t){return this.getState().files[t]}getFiles(){let{files:t}=this.getState();return Object.values(t)}getFilesByIds(t){return t.map(e=>this.getFile(e))}getObjectOfFilesPerState(){let{files:t,totalProgress:e,error:n}=this.getState(),r=Object.values(t),o=[],a=[],s=[],l=[],c=[],d=[],p=[],v=[],g=[];for(let w of r){let{progress:E}=w;!E.uploadComplete&&E.uploadStarted&&(o.push(w),w.isPaused||v.push(w)),E.uploadStarted||a.push(w),(E.uploadStarted||E.preprocess||E.postprocess)&&s.push(w),E.uploadStarted&&l.push(w),w.isPaused&&c.push(w),E.uploadComplete&&d.push(w),w.error&&p.push(w),(E.preprocess||E.postprocess)&&g.push(w)}return{newFiles:a,startedFiles:s,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:p,inProgressFiles:o,inProgressNotPausedFiles:v,processingFiles:g,isUploadStarted:l.length>0,isAllComplete:e===100&&d.length===r.length&&g.length===0,isAllErrored:!!n&&p.length===r.length,isAllPaused:o.length!==0&&c.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(w=>w.isGhost)}}validateRestrictions(t,e){e===void 0&&(e=this.getFiles());try{$(this,Nt)[Nt].validate(e,[t])}catch(n){return n}return null}validateSingleFile(t){try{$(this,Nt)[Nt].validateSingleFile(t)}catch(e){return e.message}return null}validateAggregateRestrictions(t){let e=this.getFiles();try{$(this,Nt)[Nt].validateAggregateRestrictions(e,t)}catch(n){return n.message}return null}checkIfFileAlreadyExists(t){let{files:e}=this.getState();return!!(e[t]&&!e[t].isGhost)}addFile(t){$(this,la)[la](t);let{nextFilesState:e,validFilesToAdd:n,errors:r}=$(this,da)[da]([t]),o=r.filter(s=>s.isRestriction);if($(this,hi)[hi](o),r.length>0)throw r[0];this.setState({files:e});let[a]=n;return this.emit("file-added",a),this.emit("files-added",n),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),$(this,ca)[ca](),a.id}addFiles(t){$(this,la)[la]();let{nextFilesState:e,validFilesToAdd:n,errors:r}=$(this,da)[da](t),o=r.filter(s=>s.isRestriction);$(this,hi)[hi](o);let a=r.filter(s=>!s.isRestriction);if(a.length>0){let s=`Multiple errors occurred while adding files:
17
17
  `;if(a.forEach(l=>{s+=`
18
18
  * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:s},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,s);{let l=new Error(s);throw l.errors=a,l}}this.setState({files:e}),n.forEach(s=>{this.emit("file-added",s)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.values(n).forEach(s=>{this.log(`Added file: ${s.name}
19
19
  id: ${s.id}
20
- type: ${s.type}`)}),n.length>0&&$(this,la)[la]()}removeFiles(t){let{files:e,currentUploads:n}=this.getState(),r=_({},e),o=_({},n),a=Object.create(null);t.forEach(d=>{e[d]&&(a[d]=e[d],delete r[d])});function s(d){return a[d]===void 0}Object.keys(o).forEach(d=>{let p=n[d].fileIDs.filter(s);if(p.length===0){delete o[d];return}let{capabilities:v}=this.getState();if(p.length!==n[d].fileIDs.length&&!v.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[d]=k(_({},n[d]),{fileIDs:p})});let l={currentUploads:o,files:r};Object.keys(r).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),$(this,gn)[gn]();let c=Object.keys(a);c.forEach(d=>{this.emit("file-removed",a[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(t){this.removeFiles([t])}pauseResume(t){if(!this.getState().capabilities.resumableUploads||this.getFile(t).progress.uploadComplete)return;let e=this.getFile(t),r=!(e.isPaused||!1);return this.setFileState(t,{isPaused:r}),this.emit("upload-pause",e,r),r}pauseAll(){let t=_({},this.getState().files);Object.keys(t).filter(n=>!t[n].progress.uploadComplete&&t[n].progress.uploadStarted).forEach(n=>{let r=k(_({},t[n]),{isPaused:!0});t[n]=r}),this.setState({files:t}),this.emit("pause-all")}resumeAll(){let t=_({},this.getState().files);Object.keys(t).filter(n=>!t[n].progress.uploadComplete&&t[n].progress.uploadStarted).forEach(n=>{let r=k(_({},t[n]),{isPaused:!1,error:null});t[n]=r}),this.setState({files:t}),this.emit("resume-all")}retryAll(){let t=_({},this.getState().files),e=Object.keys(t).filter(r=>t[r].error);if(e.forEach(r=>{let o=k(_({},t[r]),{isPaused:!1,error:null});t[r]=o}),this.setState({files:t,error:null}),this.emit("retry-all",Object.values(t)),e.length===0)return Promise.resolve({successful:[],failed:[]});let n=$(this,hn)[hn](e,{forceAllowNewUpload:!0});return $(this,mn)[mn](n)}cancelAll(){this.emit("cancel-all");let{files:t}=this.getState(),e=Object.keys(t);e.length&&this.removeFiles(e),this.setState(Il)}retryUpload(t){this.setFileState(t,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(t));let e=$(this,hn)[hn]([t],{forceAllowNewUpload:!0});return $(this,mn)[mn](e)}logout(){this.iteratePlugins(t=>{var e;(e=t.provider)==null||e.logout==null||e.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return $(this,da)[da]()}updateOnlineStatus(){var t;((t=window.navigator.onLine)!=null?t:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(t){if(typeof t!="function"){let l=`Expected a plugin class, but got ${t===null?"null":typeof t}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let o=new t(this,...n),a=o.id;if(!a)throw new Error("Your plugin must have an id");if(!o.type)throw new Error("Your plugin must have a type");let s=this.getPlugin(a);if(s){let l=`Already found a plugin named '${s.id}'. Tried to use: '${a}'.
21
- Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return t.VERSION&&this.log(`Using ${a} v${t.VERSION}`),o.type in $(this,Bt)[Bt]?$(this,Bt)[Bt][o.type].push(o):$(this,Bt)[Bt][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(t){for(let e of Object.values($(this,Bt)[Bt])){let n=e.find(r=>r.id===t);if(n!=null)return n}}[Symbol.for("uppy test: getPlugins")](t){return $(this,Bt)[Bt][t]}iteratePlugins(t){Object.values($(this,Bt)[Bt]).flat(1).forEach(t)}removePlugin(t){this.log(`Removing plugin ${t.id}`),this.emit("plugin-remove",t),t.uninstall&&t.uninstall();let e=$(this,Bt)[Bt][t.type],n=e.findIndex(a=>a.id===t.id);n!==-1&&e.splice(n,1);let r=this.getState(),o={plugins:k(_({},r.plugins),{[t.id]:void 0})};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),$(this,aa)[aa](),this.iteratePlugins(t=>{this.removePlugin(t)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",$(this,zi)[zi]),window.removeEventListener("offline",$(this,zi)[zi]))}hideInfo(){let{info:t}=this.getState();this.setState({info:t.slice(1)}),this.emit("info-hidden")}info(t,e,n){e===void 0&&(e="info"),n===void 0&&(n=3e3);let r=typeof t=="object";this.setState({info:[...this.getState().info,{type:e,message:r?t.message:t,details:r?t.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(t,e){let{logger:n}=this.opts;switch(e){case"error":n.error(t);break;case"warning":n.warn(t);break;default:n.debug(t);break}}registerRequestClient(t,e){$(this,pa)[pa].set(t,e)}getRequestClientForFile(t){if(!t.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${t.id}`);let e=$(this,pa)[pa].get(t.remote.requestClientId);if(e==null)throw new Error(`requestClientId "${t.remote.requestClientId}" not registered for file "${t.id}"`);return e}restore(t){return this.log(`Core: attempting to restore upload "${t}"`),this.getState().currentUploads[t]?$(this,mn)[mn](t):($(this,er)[er](t),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return $(this,hn)[hn](...arguments)}addResultData(t,e){if(!$(this,Qd)[Qd](t)){this.log(`Not setting result for an upload that has been removed: ${t}`);return}let{currentUploads:n}=this.getState(),r=k(_({},n[t]),{result:_(_({},n[t].result),e)});this.setState({currentUploads:k(_({},n),{[t]:r})})}upload(){var t;(t=$(this,Bt)[Bt].uploader)!=null&&t.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState(),n=this.opts.onBeforeUpload(e);return n===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&typeof n=="object"&&(e=n,this.setState({files:e})),Promise.resolve().then(()=>$(this,Nt)[Nt].validateMinNumberOfFiles(e)).catch(r=>{throw $(this,hi)[hi]([r]),r}).then(()=>{if(!$(this,Xd)[Xd](e))throw new ii(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{let{currentUploads:r}=this.getState(),o=Object.values(r).flatMap(l=>l.fileIDs),a=[];Object.keys(e).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&o.indexOf(l)===-1&&a.push(c.id)});let s=$(this,hn)[hn](a);return $(this,mn)[mn](s)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}};function dS(i){for(let o of i)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");let t=i.filter(o=>o.isUserFacing),e=4,n=t.slice(0,e),r=t.slice(e);n.forEach(o=>{let{message:a,details:s=""}=o;this.info({message:a,details:s},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function pS(i){let{missingFields:t,error:e}=$(this,Nt)[Nt].getMissingRequiredMetaFields(i);return t.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:t}),this.log(e.message),this.emit("restriction-failed",i,e),!1):!0}function uS(i){let t=!0;for(let e of Object.values(i))$(this,ua)[ua](e)||(t=!1);return t}function hS(i){let{allowNewUpload:t}=this.getState();if(t===!1){let e=new ii(this.i18n("noMoreFilesAllowed"),{file:i});throw $(this,hi)[hi]([e]),e}}function mS(i){let t=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,e=na(t),n=Gd(e,t),r=Xi(n).extension,o=Pl(t,this.getID()),a=t.meta||{};a.name=n,a.type=e;let s=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:o,name:n,extension:r||"",meta:_(_({},this.getState().meta),a),type:e,data:t.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:s,uploadComplete:!1,uploadStarted:null},size:s,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote,preview:t.preview}}function fS(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function gS(i){let{files:t}=this.getState(),e=_({},t),n=[],r=[];for(let s of i)try{var o;let l=$(this,Zd)[Zd](s),c=(o=t[l.id])==null?void 0:o.isGhost;if(c){let p=t[l.id];l=k(_({},p),{isGhost:!1,data:s.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let d=this.opts.onBeforeFileAdded(l,e);if(!d&&this.checkIfFileAlreadyExists(l.id)){var a;throw new ii(this.i18n("noDuplicates",{fileName:(a=l.name)!=null?a:this.i18n("unnamed")}),{file:s})}if(d===!1&&!c)throw new ii("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:s});typeof d=="object"&&d!==null&&(l=d),$(this,Nt)[Nt].validateSingleFile(l),e[l.id]=l,n.push(l)}catch(l){r.push(l)}try{$(this,Nt)[Nt].validateAggregateRestrictions(Object.values(t),n)}catch(s){return r.push(s),{nextFilesState:t,validFilesToAdd:[],errors:r}}return{nextFilesState:e,validFilesToAdd:n,errors:r}}function bS(){var i,t;let e=$(this,ep)[ep](),n=null;e!=null&&(n=Math.round(e*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",(i=n)!=null?i:0),this.setState({totalProgress:(t=n)!=null?t:0})}function vS(){let t=this.getFiles().filter(s=>s.progress.uploadStarted||s.progress.preprocess||s.progress.postprocess);if(t.length===0)return 0;if(t.every(s=>s.progress.uploadComplete))return 1;let e=s=>s.progress.bytesTotal!=null&&s.progress.bytesTotal!==0,n=t.filter(e),r=t.filter(s=>!e(s));if(n.every(s=>s.progress.uploadComplete)&&r.length>0&&!r.every(s=>s.progress.uploadComplete))return null;let o=n.reduce((s,l)=>{var c;return s+((c=l.progress.bytesTotal)!=null?c:0)},0),a=n.reduce((s,l)=>s+(l.progress.bytesUploaded||0),0);return o===0?0:a/o}function _S(){let i=(n,r,o)=>{let a=n.message||"Unknown error";n.details&&(a+=` ${n.details}`),this.setState({error:a}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:a,response:o})};this.on("error",i),this.on("upload-error",(n,r,o)=>{if(i(r,n,o),typeof r=="object"&&r.message){var a;this.log(r.message,"error");let s=new Error(this.i18n("failedToUpload",{file:(a=n?.name)!=null?a:""}));s.isUserFacing=!0,s.details=r.message,r.details&&(s.details+=` ${r.details}`),$(this,hi)[hi]([s])}else $(this,hi)[hi]([r])});let t=null;this.on("upload-stalled",(n,r)=>{let{message:o}=n,a=r.map(s=>s.meta.name).join(", ");t||(this.info({message:o,details:a},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${o} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let e=n=>{let r=n.filter(a=>{let s=a!=null&&this.getFile(a.id);return s||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),s}),o=Object.fromEntries(r.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(o)};this.on("upload-start",e),this.on("upload-progress",$(this,Jd)[Jd]),this.on("upload-success",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let o=this.getFile(n.id).progress;this.setFileState(n.id,{progress:k(_({},o),{postprocess:$(this,fn)[fn].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:r.bytesUploaded||o.bytesTotal}),$(this,gn)[gn]()}),this.on("preprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:k(_({},this.getFile(n.id).progress),{preprocess:r})})}),this.on("preprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=_({},this.getState().files);r[n.id]=k(_({},r[n.id]),{progress:_({},r[n.id].progress)}),delete r[n.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:k(_({},this.getState().files[n.id].progress),{postprocess:r})})}),this.on("postprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=_({},this.getState().files);r[n.id]=k(_({},r[n.id]),{progress:_({},r[n.id].progress)}),delete r[n.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{$(this,gn)[gn]()}),this.on("dashboard:file-edit-complete",n=>{n&&$(this,ua)[ua](n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",$(this,zi)[zi]),window.addEventListener("offline",$(this,zi)[zi]),setTimeout($(this,zi)[zi],3e3))}function yS(i,t){t===void 0&&(t={});let{forceAllowNewUpload:e=!1}=t,{allowNewUpload:n,currentUploads:r}=this.getState();if(!n&&!e)throw new Error("Cannot create a new upload: already uploading.");let o=Rn();return this.emit("upload",o,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:k(_({},r),{[o]:{fileIDs:i,step:0,result:{}}})}),o}function wS(i){let{currentUploads:t}=this.getState();return t[i]}function xS(i){let t=_({},this.getState().currentUploads);delete t[i],this.setState({currentUploads:t})}function CS(i){return j(this,null,function*(){let t=()=>{let{currentUploads:o}=this.getState();return o[i]},e=t(),n=[...$(this,Zn)[Zn],...$(this,Jn)[Jn],...$(this,fn)[fn]];try{for(let o=e.step||0;o<n.length&&e;o++){let a=n[o];this.setState({currentUploads:k(_({},this.getState().currentUploads),{[i]:k(_({},e),{step:o})})});let{fileIDs:s}=e;yield a(s,i),e=t()}}catch(o){throw $(this,er)[er](i),o}if(e){e.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let o=e.fileIDs.map(l=>this.getFile(l)),a=o.filter(l=>!l.error),s=o.filter(l=>l.error);this.addResultData(i,{successful:a,failed:s,uploadID:i}),e=t()}let r;return e&&(r=e.result,this.emit("complete",r),$(this,er)[er](i)),r==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),r})}Dl.VERSION=cS.version;var Jr=Dl;var fa,Xe,S0,SS,tr,y0,P0,tp,E0,rp,ip,np,PS,ma={},I0=[],ES=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ml=Array.isArray;function bn(i,t){for(var e in t)i[e]=t[e];return i}function op(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function u(i,t,e){var n,r,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?fa.call(arguments,2):e),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)a[o]===void 0&&(a[o]=i.defaultProps[o]);return ha(i,a,n,r,null)}function ha(i,t,e,n,r){var o={type:i,props:t,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++S0,__i:-1,__u:0};return r==null&&Xe.vnode!=null&&Xe.vnode(o),o}function D0(){return{current:null}}function mi(i){return i.children}function ni(i,t){this.props=i,this.context=t}function eo(i,t){if(t==null)return i.__?eo(i.__,i.__i+1):null;for(var e;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null)return e.__e;return typeof i.type=="function"?eo(i):null}function k0(i){var t,e;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,t=0;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null){i.__e=i.__c.base=e.__e;break}return k0(i)}}function w0(i){(!i.__d&&(i.__d=!0)&&tr.push(i)&&!Tl.__r++||y0!==Xe.debounceRendering)&&((y0=Xe.debounceRendering)||P0)(Tl)}function Tl(){var i,t,e,n,r,o,a,s;for(tr.sort(tp);i=tr.shift();)i.__d&&(t=tr.length,n=void 0,o=(r=(e=i).__v).__e,a=[],s=[],e.__P&&((n=bn({},r)).__v=r.__v+1,Xe.vnode&&Xe.vnode(n),ap(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[o]:null,a,o??eo(r),!!(32&r.__u),s),n.__v=r.__v,n.__.__k[n.__i]=n,O0(a,n,s),n.__e!=o&&k0(n)),tr.length>t&&tr.sort(tp));Tl.__r=0}function T0(i,t,e,n,r,o,a,s,l,c,d){var p,v,g,w,E,L,F=n&&n.__k||I0,G=t.length;for(l=IS(e,t,F,l,G),p=0;p<G;p++)(g=e.__k[p])!=null&&(v=g.__i===-1?ma:F[g.__i]||ma,g.__i=p,L=ap(i,g,v,r,o,a,s,l,c,d),w=g.__e,g.ref&&v.ref!=g.ref&&(v.ref&&sp(v.ref,null,g),d.push(g.ref,g.__c||w,g)),E==null&&w!=null&&(E=w),4&g.__u||v.__k===g.__k?l=M0(g,l,i):typeof g.type=="function"&&L!==void 0?l=L:w&&(l=w.nextSibling),g.__u&=-7);return e.__e=E,l}function IS(i,t,e,n,r){var o,a,s,l,c,d=e.length,p=d,v=0;for(i.__k=new Array(r),o=0;o<r;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=o+v,(a=i.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?ha(null,a,null,null,null):Ml(a)?ha(mi,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?ha(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,s=null,(c=a.__i=DS(a,e,l,p))!==-1&&(p--,(s=e[c])&&(s.__u|=2)),s==null||s.__v===null?(c==-1&&v--,typeof a.type!="function"&&(a.__u|=4)):c!=l&&(c==l-1?v--:c==l+1?v++:(c>l?v--:v++,a.__u|=4))):i.__k[o]=null;if(p)for(o=0;o<d;o++)(s=e[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=eo(s)),F0(s,s));return n}function M0(i,t,e){var n,r;if(typeof i.type=="function"){for(n=i.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=i,t=M0(n[r],t,e));return t}i.__e!=t&&(t&&i.type&&!e.contains(t)&&(t=eo(i)),e.insertBefore(i.__e,t||null),t=i.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ki(i,t){return t=t||[],i==null||typeof i=="boolean"||(Ml(i)?i.some(function(e){Ki(e,t)}):t.push(i)),t}function DS(i,t,e,n){var r,o,a=i.key,s=i.type,l=t[e];if(l===null||l&&a==l.key&&s===l.type&&!(2&l.__u))return e;if(n>(l!=null&&!(2&l.__u)?1:0))for(r=e-1,o=e+1;r>=0||o<t.length;){if(r>=0){if((l=t[r])&&!(2&l.__u)&&a==l.key&&s===l.type)return r;r--}if(o<t.length){if((l=t[o])&&!(2&l.__u)&&a==l.key&&s===l.type)return o;o++}}return-1}function x0(i,t,e){t[0]=="-"?i.setProperty(t,e??""):i[t]=e==null?"":typeof e!="number"||ES.test(t)?e:e+"px"}function kl(i,t,e,n,r){var o;e:if(t=="style")if(typeof e=="string")i.style.cssText=e;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(t in n)e&&t in e||x0(i.style,t,"");if(e)for(t in e)n&&e[t]===n[t]||x0(i.style,t,e[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(E0,"$1")),t=t.toLowerCase()in i||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),i.l||(i.l={}),i.l[t+o]=e,e?n?e.u=n.u:(e.u=rp,i.addEventListener(t,o?np:ip,o)):i.removeEventListener(t,o?np:ip,o);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in i)try{i[t]=e??"";break e}catch{}typeof e=="function"||(e==null||e===!1&&t[4]!="-"?i.removeAttribute(t):i.setAttribute(t,t=="popover"&&e==1?"":e))}}function C0(i){return function(t){if(this.l){var e=this.l[t.type+i];if(t.t==null)t.t=rp++;else if(t.t<e.u)return;return e(Xe.event?Xe.event(t):t)}}}function ap(i,t,e,n,r,o,a,s,l,c){var d,p,v,g,w,E,L,F,G,he,me,se,y,x,D,z,V,ie=t.type;if(t.constructor!==void 0)return null;128&e.__u&&(l=!!(32&e.__u),o=[s=t.__e=e.__e]),(d=Xe.__b)&&d(t);e:if(typeof ie=="function")try{if(F=t.props,G="prototype"in ie&&ie.prototype.render,he=(d=ie.contextType)&&n[d.__c],me=d?he?he.props.value:d.__:n,e.__c?L=(p=t.__c=e.__c).__=p.__E:(G?t.__c=p=new ie(F,me):(t.__c=p=new ni(F,me),p.constructor=ie,p.render=TS),he&&he.sub(p),p.props=F,p.state||(p.state={}),p.context=me,p.__n=n,v=p.__d=!0,p.__h=[],p._sb=[]),G&&p.__s==null&&(p.__s=p.state),G&&ie.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=bn({},p.__s)),bn(p.__s,ie.getDerivedStateFromProps(F,p.__s))),g=p.props,w=p.state,p.__v=t,v)G&&ie.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),G&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(G&&ie.getDerivedStateFromProps==null&&F!==g&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(F,me),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(F,p.__s,me)===!1||t.__v==e.__v)){for(t.__v!=e.__v&&(p.props=F,p.state=p.__s,p.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(Ie){Ie&&(Ie.__=t)}),se=0;se<p._sb.length;se++)p.__h.push(p._sb[se]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(F,p.__s,me),G&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(g,w,E)})}if(p.context=me,p.props=F,p.__P=i,p.__e=!1,y=Xe.__r,x=0,G){for(p.state=p.__s,p.__d=!1,y&&y(t),d=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[]}else do p.__d=!1,y&&y(t),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++x<25);p.state=p.__s,p.getChildContext!=null&&(n=bn(bn({},n),p.getChildContext())),G&&!v&&p.getSnapshotBeforeUpdate!=null&&(E=p.getSnapshotBeforeUpdate(g,w)),s=T0(i,Ml(z=d!=null&&d.type===mi&&d.key==null?d.props.children:d)?z:[z],t,e,n,r,o,a,s,l,c),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),L&&(p.__E=p.__=null)}catch(Ie){if(t.__v=null,l||o!=null)if(Ie.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(V=o.length;V--;)op(o[V]);else t.__e=e.__e,t.__k=e.__k;Xe.__e(Ie,t,e)}else o==null&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):s=t.__e=kS(e.__e,t,e,n,r,o,a,l,c);return(d=Xe.diffed)&&d(t),128&t.__u?void 0:s}function O0(i,t,e){for(var n=0;n<e.length;n++)sp(e[n],e[++n],e[++n]);Xe.__c&&Xe.__c(t,i),i.some(function(r){try{i=r.__h,r.__h=[],i.some(function(o){o.call(r)})}catch(o){Xe.__e(o,r.__v)}})}function kS(i,t,e,n,r,o,a,s,l){var c,d,p,v,g,w,E,L=e.props,F=t.props,G=t.type;if(G=="svg"?r="http://www.w3.org/2000/svg":G=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((g=o[c])&&"setAttribute"in g==!!G&&(G?g.localName==G:g.nodeType==3)){i=g,o[c]=null;break}}if(i==null){if(G==null)return document.createTextNode(F);i=document.createElementNS(r,G,F.is&&F),s&&(Xe.__m&&Xe.__m(t,o),s=!1),o=null}if(G===null)L===F||s&&i.data===F||(i.data=F);else{if(o=o&&fa.call(i.childNodes),L=e.props||ma,!s&&o!=null)for(L={},c=0;c<i.attributes.length;c++)L[(g=i.attributes[c]).name]=g.value;for(c in L)if(g=L[c],c!="children"){if(c=="dangerouslySetInnerHTML")p=g;else if(!(c in F)){if(c=="value"&&"defaultValue"in F||c=="checked"&&"defaultChecked"in F)continue;kl(i,c,null,g,r)}}for(c in F)g=F[c],c=="children"?v=g:c=="dangerouslySetInnerHTML"?d=g:c=="value"?w=g:c=="checked"?E=g:s&&typeof g!="function"||L[c]===g||kl(i,c,g,L[c],r);if(d)s||p&&(d.__html===p.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),t.__k=[];else if(p&&(i.innerHTML=""),T0(i,Ml(v)?v:[v],t,e,n,G=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:e.__k&&eo(e,0),s,l),o!=null)for(c=o.length;c--;)op(o[c]);s||(c="value",G=="progress"&&w==null?i.removeAttribute("value"):w!==void 0&&(w!==i[c]||G=="progress"&&!w||G=="option"&&w!==L[c])&&kl(i,c,w,L[c],r),c="checked",E!==void 0&&E!==i[c]&&kl(i,c,E,L[c],r))}return i}function sp(i,t,e){try{if(typeof i=="function"){var n=typeof i.__u=="function";n&&i.__u(),n&&t==null||(i.__u=i(t))}else i.current=t}catch(r){Xe.__e(r,e)}}function F0(i,t,e){var n,r;if(Xe.unmount&&Xe.unmount(i),(n=i.ref)&&(n.current&&n.current!==i.__e||sp(n,null,t)),(n=i.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){Xe.__e(o,t)}n.base=n.__P=null}if(n=i.__k)for(r=0;r<n.length;r++)n[r]&&F0(n[r],t,e||typeof i.type!="function");e||op(i.__e),i.__c=i.__=i.__e=void 0}function TS(i,t,e){return this.constructor(i,e)}function lp(i,t,e){var n,r,o,a;t==document&&(t=document.documentElement),Xe.__&&Xe.__(i,t),r=(n=typeof e=="function")?null:e&&e.__k||t.__k,o=[],a=[],ap(t,i=(!n&&e||t).__k=u(mi,null,[i]),r||ma,ma,t.namespaceURI,!n&&e?[e]:r?null:t.firstChild?fa.call(t.childNodes):null,o,!n&&e?e:r?r.__e:t.firstChild,n,a),O0(o,i,a)}function Ol(i,t,e){var n,r,o,a,s=bn({},i.props);for(o in i.type&&i.type.defaultProps&&(a=i.type.defaultProps),t)o=="key"?n=t[o]:o=="ref"?r=t[o]:s[o]=t[o]===void 0&&a!==void 0?a[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?fa.call(arguments,2):e),ha(i.type,s,n||i.key,r||i.ref,null)}fa=I0.slice,Xe={__e:function(i,t,e,n){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(i)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(i,n||{}),a=r.__d),a)return r.__E=r}catch(s){i=s}throw i}},S0=0,SS=function(i){return i!=null&&i.constructor==null},ni.prototype.setState=function(i,t){var e;e=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=bn({},this.state),typeof i=="function"&&(i=i(bn({},e),this.props)),i&&bn(e,i),i!=null&&this.__v&&(t&&this._sb.push(t),w0(this))},ni.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),w0(this))},ni.prototype.render=mi,tr=[],P0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,tp=function(i,t){return i.__v.__b-t.__v.__b},Tl.__r=0,E0=/(PointerCapture)$|Capture$/i,rp=0,ip=C0(!1),np=C0(!0),PS=0;function ga(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function MS(i,t){return t===void 0&&(t=document),typeof i=="string"?t.querySelector(i):ga(i)?i:null}var A0=MS;function OS(i){for(var t;i&&!i.dir;)i=i.parentNode;return(t=i)==null?void 0:t.dir}var Fl=OS;var ir=class{constructor(t,e){this.uppy=t,this.opts=e??{}}getPluginState(){let{plugins:t}=this.uppy.getState();return t?.[this.id]||{}}setPluginState(t){let{plugins:e}=this.uppy.getState();this.uppy.setState({plugins:k(_({},e),{[this.id]:_(_({},e[this.id]),t)})})}setOptions(t){this.opts=_(_({},this.opts),t),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let t=new Qr([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState(void 0)}addTarget(t){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(t){}afterUpdate(){}};function R0(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var FS=0;function AS(i){return"__private_"+FS+++"_"+i}function RS(i){let t=null,e;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=r,t||(t=Promise.resolve().then(()=>(t=null,i(...e)))),t}}var ba=AS("updateUI"),cp=class i extends ir{constructor(){super(...arguments),Object.defineProperty(this,ba,{writable:!0,value:void 0})}getTargetPlugin(t){let e;if(typeof t?.addTarget=="function")e=t,e instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:e,UIPlugin:i}}));else if(typeof t=="function"){let n=t;this.uppy.iteratePlugins(r=>{r instanceof n&&(e=r)})}return e}mount(t,e){let n=e.id,r=A0(t);if(r){this.isTargetDOMEl=!0;let s=document.createElement("div");return s.classList.add("uppy-Root"),R0(this,ba)[ba]=RS(l=>{this.uppy.getPlugin(this.id)&&(lp(this.render(l,s),s),this.afterUpdate())}),this.uppy.log(`Installing ${n} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),lp(this.render(this.uppy.getState(),s),s),this.el=s,r.appendChild(s),s.dir=this.opts.direction||Fl(s)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(t);if(o)return this.uppy.log(`Installing ${n} to ${o.id}`),this.parent=o,this.el=o.addTarget(e),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let a=`Invalid target option given to ${n}.`;throw typeof t=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(a)}render(t,e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(t){if(this.el!=null){var e,n;(e=(n=R0(this,ba))[ba])==null||e.call(n,t)}}unmount(){if(this.isTargetDOMEl){var t;(t=this.el)==null||t.remove()}this.onUnmount()}onMount(){}onUnmount(){}},fi=cp;function Al(i,t,e,n){return e===0||i===t?i:n===0?t:i+(t-i)*2**(-n/e)}var gi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var gp=Ne(Gt(),1);function va(i){let t=[],e="indeterminate",n;for(let{progress:o}of Object.values(i)){let{preprocess:a,postprocess:s}=o;n==null&&(a||s)&&({mode:e,message:n}=a||s),a?.mode==="determinate"&&t.push(a.value),s?.mode==="determinate"&&t.push(s.value)}let r=t.reduce((o,a)=>o+a/t.length,0);return{mode:e,message:n,value:r}}var hp=Ne(Gt(),1),up=Ne(ra(),1);function dp(i){let t=Math.floor(i/3600)%24,e=Math.floor(i/60)%60,n=Math.floor(i%60);return{hours:t,minutes:e,seconds:n}}function pp(i){let t=dp(i),e=t.hours===0?"":`${t.hours}h`,n=t.minutes===0?"":`${t.hours===0?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`,r=t.hours!==0?"":`${t.minutes===0?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`;return`${e}${n}${r}`}var BS="\xB7",B0=()=>` ${BS} `;function N0(i){let{newFiles:t,isUploadStarted:e,recoveredState:n,i18n:r,uploadState:o,isSomeGhost:a,startUpload:s}=i,l=(0,hp.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===gi.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),c=t&&e&&!n?r("uploadXNewFiles",{smart_count:t}):r("uploadXFiles",{smart_count:t});return u("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:t}),onClick:s,disabled:a,"data-uppy-super-focusable":!0},c)}function z0(i){let{i18n:t,uppy:e}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>e.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},u("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),t("retry"))}function L0(i){let{i18n:t,uppy:e}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>e.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function j0(i){let{isAllPaused:t,i18n:e,isAllComplete:n,resumableUploads:r,uppy:o}=i,a=e(t?"resume":"pause");function s(){if(!n){if(!r){o.cancelAll();return}if(t){o.resumeAll();return}o.pauseAll()}}return u("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:s,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function H0(i){let{i18n:t,doneButtonHandler:e}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:e,"data-uppy-super-focusable":!0},t("done"))}function V0(){return u("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},u("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function U0(i){let{progress:t}=i,{value:e,mode:n,message:r}=t;return u("div",{className:"uppy-StatusBar-content"},u(V0,null),n==="determinate"?`${Math.round(e*100)}% \xB7 `:"",r)}function NS(i){let{numUploads:t,complete:e,totalUploadedSize:n,totalSize:r,totalETA:o,i18n:a}=i,s=t>1,l=(0,up.default)(n);return u("div",{className:"uppy-StatusBar-statusSecondary"},s&&a("filesUploadedOfTotal",{complete:e,smart_count:t}),u("span",{className:"uppy-StatusBar-additionalInfo"},s&&B0(),r!=null?a("dataUploadedOfTotal",{complete:l,total:(0,up.default)(r)}):a("dataUploadedOfUnknown",{complete:l}),B0(),o!=null&&a("xTimeLeft",{time:pp(o)})))}function W0(i){let{i18n:t,complete:e,numUploads:n}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:e,smart_count:n}))}function zS(i){let{i18n:t,newFiles:e,startUpload:n}=i,r=(0,hp.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return u("div",{className:"uppy-StatusBar-statusSecondary"},u("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:e})),u("button",{type:"button",className:r,"aria-label":t("uploadXFiles",{smart_count:e}),onClick:n},t("upload")))}function $0(i){let{i18n:t,supportsUploadProgress:e,totalProgress:n,showProgressDetails:r,isUploadStarted:o,isAllComplete:a,isAllPaused:s,newFiles:l,numUploads:c,complete:d,totalUploadedSize:p,totalSize:v,totalETA:g,startUpload:w}=i,E=l&&o;if(!o||a)return null;let L=t(s?"paused":"uploading");function F(){return!s&&!E&&r?e?u(NS,{numUploads:c,complete:d,totalUploadedSize:p,totalSize:v,totalETA:g,i18n:t}):u(W0,{i18n:t,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":L,title:L},s?null:u(V0,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},e&&n!==0?`${L}: ${n}%`:L),F(),E?u(zS,{i18n:t,newFiles:l,startUpload:w}):null))}function q0(i){let{i18n:t}=i;return u("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},u("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))}function G0(i){let{error:t,i18n:e,complete:n,numUploads:r}=i;function o(){let a=`${e("uploadFailed")}
20
+ type: ${s.type}`)}),n.length>0&&$(this,ca)[ca]()}removeFiles(t){let{files:e,currentUploads:n}=this.getState(),r=_({},e),o=_({},n),a=Object.create(null);t.forEach(d=>{e[d]&&(a[d]=e[d],delete r[d])});function s(d){return a[d]===void 0}Object.keys(o).forEach(d=>{let p=n[d].fileIDs.filter(s);if(p.length===0){delete o[d];return}let{capabilities:v}=this.getState();if(p.length!==n[d].fileIDs.length&&!v.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[d]=k(_({},n[d]),{fileIDs:p})});let l={currentUploads:o,files:r};Object.keys(r).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),$(this,gn)[gn]();let c=Object.keys(a);c.forEach(d=>{this.emit("file-removed",a[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(t){this.removeFiles([t])}pauseResume(t){if(!this.getState().capabilities.resumableUploads||this.getFile(t).progress.uploadComplete)return;let e=this.getFile(t),r=!(e.isPaused||!1);return this.setFileState(t,{isPaused:r}),this.emit("upload-pause",e,r),r}pauseAll(){let t=_({},this.getState().files);Object.keys(t).filter(n=>!t[n].progress.uploadComplete&&t[n].progress.uploadStarted).forEach(n=>{let r=k(_({},t[n]),{isPaused:!0});t[n]=r}),this.setState({files:t}),this.emit("pause-all")}resumeAll(){let t=_({},this.getState().files);Object.keys(t).filter(n=>!t[n].progress.uploadComplete&&t[n].progress.uploadStarted).forEach(n=>{let r=k(_({},t[n]),{isPaused:!1,error:null});t[n]=r}),this.setState({files:t}),this.emit("resume-all")}retryAll(){let t=_({},this.getState().files),e=Object.keys(t).filter(r=>t[r].error);if(e.forEach(r=>{let o=k(_({},t[r]),{isPaused:!1,error:null});t[r]=o}),this.setState({files:t,error:null}),this.emit("retry-all",Object.values(t)),e.length===0)return Promise.resolve({successful:[],failed:[]});let n=$(this,hn)[hn](e,{forceAllowNewUpload:!0});return $(this,mn)[mn](n)}cancelAll(){this.emit("cancel-all");let{files:t}=this.getState(),e=Object.keys(t);e.length&&this.removeFiles(e),this.setState(Il)}retryUpload(t){this.setFileState(t,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(t));let e=$(this,hn)[hn]([t],{forceAllowNewUpload:!0});return $(this,mn)[mn](e)}logout(){this.iteratePlugins(t=>{var e;(e=t.provider)==null||e.logout==null||e.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return $(this,pa)[pa]()}updateOnlineStatus(){var t;((t=window.navigator.onLine)!=null?t:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(t){if(typeof t!="function"){let l=`Expected a plugin class, but got ${t===null?"null":typeof t}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];let o=new t(this,...n),a=o.id;if(!a)throw new Error("Your plugin must have an id");if(!o.type)throw new Error("Your plugin must have a type");let s=this.getPlugin(a);if(s){let l=`Already found a plugin named '${s.id}'. Tried to use: '${a}'.
21
+ Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return t.VERSION&&this.log(`Using ${a} v${t.VERSION}`),o.type in $(this,Bt)[Bt]?$(this,Bt)[Bt][o.type].push(o):$(this,Bt)[Bt][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(t){for(let e of Object.values($(this,Bt)[Bt])){let n=e.find(r=>r.id===t);if(n!=null)return n}}[Symbol.for("uppy test: getPlugins")](t){return $(this,Bt)[Bt][t]}iteratePlugins(t){Object.values($(this,Bt)[Bt]).flat(1).forEach(t)}removePlugin(t){this.log(`Removing plugin ${t.id}`),this.emit("plugin-remove",t),t.uninstall&&t.uninstall();let e=$(this,Bt)[Bt][t.type],n=e.findIndex(a=>a.id===t.id);n!==-1&&e.splice(n,1);let r=this.getState(),o={plugins:k(_({},r.plugins),{[t.id]:void 0})};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),$(this,sa)[sa](),this.iteratePlugins(t=>{this.removePlugin(t)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",$(this,zi)[zi]),window.removeEventListener("offline",$(this,zi)[zi]))}hideInfo(){let{info:t}=this.getState();this.setState({info:t.slice(1)}),this.emit("info-hidden")}info(t,e,n){e===void 0&&(e="info"),n===void 0&&(n=3e3);let r=typeof t=="object";this.setState({info:[...this.getState().info,{type:e,message:r?t.message:t,details:r?t.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(t,e){let{logger:n}=this.opts;switch(e){case"error":n.error(t);break;case"warning":n.warn(t);break;default:n.debug(t);break}}registerRequestClient(t,e){$(this,ua)[ua].set(t,e)}getRequestClientForFile(t){if(!t.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${t.id}`);let e=$(this,ua)[ua].get(t.remote.requestClientId);if(e==null)throw new Error(`requestClientId "${t.remote.requestClientId}" not registered for file "${t.id}"`);return e}restore(t){return this.log(`Core: attempting to restore upload "${t}"`),this.getState().currentUploads[t]?$(this,mn)[mn](t):($(this,tr)[tr](t),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return $(this,hn)[hn](...arguments)}addResultData(t,e){if(!$(this,Qd)[Qd](t)){this.log(`Not setting result for an upload that has been removed: ${t}`);return}let{currentUploads:n}=this.getState(),r=k(_({},n[t]),{result:_(_({},n[t].result),e)});this.setState({currentUploads:k(_({},n),{[t]:r})})}upload(){var t;(t=$(this,Bt)[Bt].uploader)!=null&&t.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState(),n=this.opts.onBeforeUpload(e);return n===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&typeof n=="object"&&(e=n,this.setState({files:e})),Promise.resolve().then(()=>$(this,Nt)[Nt].validateMinNumberOfFiles(e)).catch(r=>{throw $(this,hi)[hi]([r]),r}).then(()=>{if(!$(this,Xd)[Xd](e))throw new ii(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{let{currentUploads:r}=this.getState(),o=Object.values(r).flatMap(l=>l.fileIDs),a=[];Object.keys(e).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&o.indexOf(l)===-1&&a.push(c.id)});let s=$(this,hn)[hn](a);return $(this,mn)[mn](s)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}};function dS(i){for(let o of i)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");let t=i.filter(o=>o.isUserFacing),e=4,n=t.slice(0,e),r=t.slice(e);n.forEach(o=>{let{message:a,details:s=""}=o;this.info({message:a,details:s},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function pS(i){let{missingFields:t,error:e}=$(this,Nt)[Nt].getMissingRequiredMetaFields(i);return t.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:t}),this.log(e.message),this.emit("restriction-failed",i,e),!1):!0}function uS(i){let t=!0;for(let e of Object.values(i))$(this,ha)[ha](e)||(t=!1);return t}function hS(i){let{allowNewUpload:t}=this.getState();if(t===!1){let e=new ii(this.i18n("noMoreFilesAllowed"),{file:i});throw $(this,hi)[hi]([e]),e}}function mS(i){let t=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,e=ra(t),n=Gd(e,t),r=Xi(n).extension,o=Pl(t,this.getID()),a=t.meta||{};a.name=n,a.type=e;let s=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:o,name:n,extension:r||"",meta:_(_({},this.getState().meta),a),type:e,data:t.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:s,uploadComplete:!1,uploadStarted:null},size:s,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote,preview:t.preview}}function fS(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function gS(i){let{files:t}=this.getState(),e=_({},t),n=[],r=[];for(let s of i)try{var o;let l=$(this,Zd)[Zd](s),c=(o=t[l.id])==null?void 0:o.isGhost;if(c){let p=t[l.id];l=k(_({},p),{isGhost:!1,data:s.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let d=this.opts.onBeforeFileAdded(l,e);if(!d&&this.checkIfFileAlreadyExists(l.id)){var a;throw new ii(this.i18n("noDuplicates",{fileName:(a=l.name)!=null?a:this.i18n("unnamed")}),{file:s})}if(d===!1&&!c)throw new ii("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:s});typeof d=="object"&&d!==null&&(l=d),$(this,Nt)[Nt].validateSingleFile(l),e[l.id]=l,n.push(l)}catch(l){r.push(l)}try{$(this,Nt)[Nt].validateAggregateRestrictions(Object.values(t),n)}catch(s){return r.push(s),{nextFilesState:t,validFilesToAdd:[],errors:r}}return{nextFilesState:e,validFilesToAdd:n,errors:r}}function bS(){var i,t;let e=$(this,ep)[ep](),n=null;e!=null&&(n=Math.round(e*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",(i=n)!=null?i:0),this.setState({totalProgress:(t=n)!=null?t:0})}function vS(){let t=this.getFiles().filter(s=>s.progress.uploadStarted||s.progress.preprocess||s.progress.postprocess);if(t.length===0)return 0;if(t.every(s=>s.progress.uploadComplete))return 1;let e=s=>s.progress.bytesTotal!=null&&s.progress.bytesTotal!==0,n=t.filter(e),r=t.filter(s=>!e(s));if(n.every(s=>s.progress.uploadComplete)&&r.length>0&&!r.every(s=>s.progress.uploadComplete))return null;let o=n.reduce((s,l)=>{var c;return s+((c=l.progress.bytesTotal)!=null?c:0)},0),a=n.reduce((s,l)=>s+(l.progress.bytesUploaded||0),0);return o===0?0:a/o}function _S(){let i=(n,r,o)=>{let a=n.message||"Unknown error";n.details&&(a+=` ${n.details}`),this.setState({error:a}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:a,response:o})};this.on("error",i),this.on("upload-error",(n,r,o)=>{if(i(r,n,o),typeof r=="object"&&r.message){var a;this.log(r.message,"error");let s=new Error(this.i18n("failedToUpload",{file:(a=n?.name)!=null?a:""}));s.isUserFacing=!0,s.details=r.message,r.details&&(s.details+=` ${r.details}`),$(this,hi)[hi]([s])}else $(this,hi)[hi]([r])});let t=null;this.on("upload-stalled",(n,r)=>{let{message:o}=n,a=r.map(s=>s.meta.name).join(", ");t||(this.info({message:o,details:a},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${o} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let e=n=>{let r=n.filter(a=>{let s=a!=null&&this.getFile(a.id);return s||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),s}),o=Object.fromEntries(r.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(o)};this.on("upload-start",e),this.on("upload-progress",$(this,Jd)[Jd]),this.on("upload-success",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let o=this.getFile(n.id).progress;this.setFileState(n.id,{progress:k(_({},o),{postprocess:$(this,fn)[fn].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:r.bytesUploaded||o.bytesTotal}),$(this,gn)[gn]()}),this.on("preprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:k(_({},this.getFile(n.id).progress),{preprocess:r})})}),this.on("preprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=_({},this.getState().files);r[n.id]=k(_({},r[n.id]),{progress:_({},r[n.id].progress)}),delete r[n.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:k(_({},this.getState().files[n.id].progress),{postprocess:r})})}),this.on("postprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=_({},this.getState().files);r[n.id]=k(_({},r[n.id]),{progress:_({},r[n.id].progress)}),delete r[n.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{$(this,gn)[gn]()}),this.on("dashboard:file-edit-complete",n=>{n&&$(this,ha)[ha](n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",$(this,zi)[zi]),window.addEventListener("offline",$(this,zi)[zi]),setTimeout($(this,zi)[zi],3e3))}function yS(i,t){t===void 0&&(t={});let{forceAllowNewUpload:e=!1}=t,{allowNewUpload:n,currentUploads:r}=this.getState();if(!n&&!e)throw new Error("Cannot create a new upload: already uploading.");let o=Bn();return this.emit("upload",o,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:k(_({},r),{[o]:{fileIDs:i,step:0,result:{}}})}),o}function wS(i){let{currentUploads:t}=this.getState();return t[i]}function xS(i){let t=_({},this.getState().currentUploads);delete t[i],this.setState({currentUploads:t})}function CS(i){return j(this,null,function*(){let t=()=>{let{currentUploads:o}=this.getState();return o[i]},e=t(),n=[...$(this,Jn)[Jn],...$(this,er)[er],...$(this,fn)[fn]];try{for(let o=e.step||0;o<n.length&&e;o++){let a=n[o];this.setState({currentUploads:k(_({},this.getState().currentUploads),{[i]:k(_({},e),{step:o})})});let{fileIDs:s}=e;yield a(s,i),e=t()}}catch(o){throw $(this,tr)[tr](i),o}if(e){e.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let o=e.fileIDs.map(l=>this.getFile(l)),a=o.filter(l=>!l.error),s=o.filter(l=>l.error);this.addResultData(i,{successful:a,failed:s,uploadID:i}),e=t()}let r;return e&&(r=e.result,this.emit("complete",r),$(this,tr)[tr](i)),r==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),r})}Dl.VERSION=cS.version;var eo=Dl;var ga,Xe,S0,SS,ir,y0,P0,tp,E0,rp,ip,np,PS,fa={},I0=[],ES=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ml=Array.isArray;function bn(i,t){for(var e in t)i[e]=t[e];return i}function op(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function u(i,t,e){var n,r,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?ga.call(arguments,2):e),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)a[o]===void 0&&(a[o]=i.defaultProps[o]);return ma(i,a,n,r,null)}function ma(i,t,e,n,r){var o={type:i,props:t,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++S0,__i:-1,__u:0};return r==null&&Xe.vnode!=null&&Xe.vnode(o),o}function D0(){return{current:null}}function mi(i){return i.children}function ni(i,t){this.props=i,this.context=t}function to(i,t){if(t==null)return i.__?to(i.__,i.__i+1):null;for(var e;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null)return e.__e;return typeof i.type=="function"?to(i):null}function k0(i){var t,e;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,t=0;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null){i.__e=i.__c.base=e.__e;break}return k0(i)}}function w0(i){(!i.__d&&(i.__d=!0)&&ir.push(i)&&!Tl.__r++||y0!==Xe.debounceRendering)&&((y0=Xe.debounceRendering)||P0)(Tl)}function Tl(){var i,t,e,n,r,o,a,s;for(ir.sort(tp);i=ir.shift();)i.__d&&(t=ir.length,n=void 0,o=(r=(e=i).__v).__e,a=[],s=[],e.__P&&((n=bn({},r)).__v=r.__v+1,Xe.vnode&&Xe.vnode(n),ap(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[o]:null,a,o??to(r),!!(32&r.__u),s),n.__v=r.__v,n.__.__k[n.__i]=n,O0(a,n,s),n.__e!=o&&k0(n)),ir.length>t&&ir.sort(tp));Tl.__r=0}function T0(i,t,e,n,r,o,a,s,l,c,d){var p,v,g,w,E,L,F=n&&n.__k||I0,G=t.length;for(l=IS(e,t,F,l,G),p=0;p<G;p++)(g=e.__k[p])!=null&&(v=g.__i===-1?fa:F[g.__i]||fa,g.__i=p,L=ap(i,g,v,r,o,a,s,l,c,d),w=g.__e,g.ref&&v.ref!=g.ref&&(v.ref&&sp(v.ref,null,g),d.push(g.ref,g.__c||w,g)),E==null&&w!=null&&(E=w),4&g.__u||v.__k===g.__k?l=M0(g,l,i):typeof g.type=="function"&&L!==void 0?l=L:w&&(l=w.nextSibling),g.__u&=-7);return e.__e=E,l}function IS(i,t,e,n,r){var o,a,s,l,c,d=e.length,p=d,v=0;for(i.__k=new Array(r),o=0;o<r;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=o+v,(a=i.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?ma(null,a,null,null,null):Ml(a)?ma(mi,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?ma(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,s=null,(c=a.__i=DS(a,e,l,p))!==-1&&(p--,(s=e[c])&&(s.__u|=2)),s==null||s.__v===null?(c==-1&&v--,typeof a.type!="function"&&(a.__u|=4)):c!=l&&(c==l-1?v--:c==l+1?v++:(c>l?v--:v++,a.__u|=4))):i.__k[o]=null;if(p)for(o=0;o<d;o++)(s=e[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=to(s)),F0(s,s));return n}function M0(i,t,e){var n,r;if(typeof i.type=="function"){for(n=i.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=i,t=M0(n[r],t,e));return t}i.__e!=t&&(t&&i.type&&!e.contains(t)&&(t=to(i)),e.insertBefore(i.__e,t||null),t=i.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ki(i,t){return t=t||[],i==null||typeof i=="boolean"||(Ml(i)?i.some(function(e){Ki(e,t)}):t.push(i)),t}function DS(i,t,e,n){var r,o,a=i.key,s=i.type,l=t[e];if(l===null||l&&a==l.key&&s===l.type&&!(2&l.__u))return e;if(n>(l!=null&&!(2&l.__u)?1:0))for(r=e-1,o=e+1;r>=0||o<t.length;){if(r>=0){if((l=t[r])&&!(2&l.__u)&&a==l.key&&s===l.type)return r;r--}if(o<t.length){if((l=t[o])&&!(2&l.__u)&&a==l.key&&s===l.type)return o;o++}}return-1}function x0(i,t,e){t[0]=="-"?i.setProperty(t,e??""):i[t]=e==null?"":typeof e!="number"||ES.test(t)?e:e+"px"}function kl(i,t,e,n,r){var o;e:if(t=="style")if(typeof e=="string")i.style.cssText=e;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(t in n)e&&t in e||x0(i.style,t,"");if(e)for(t in e)n&&e[t]===n[t]||x0(i.style,t,e[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(E0,"$1")),t=t.toLowerCase()in i||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),i.l||(i.l={}),i.l[t+o]=e,e?n?e.u=n.u:(e.u=rp,i.addEventListener(t,o?np:ip,o)):i.removeEventListener(t,o?np:ip,o);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in i)try{i[t]=e??"";break e}catch{}typeof e=="function"||(e==null||e===!1&&t[4]!="-"?i.removeAttribute(t):i.setAttribute(t,t=="popover"&&e==1?"":e))}}function C0(i){return function(t){if(this.l){var e=this.l[t.type+i];if(t.t==null)t.t=rp++;else if(t.t<e.u)return;return e(Xe.event?Xe.event(t):t)}}}function ap(i,t,e,n,r,o,a,s,l,c){var d,p,v,g,w,E,L,F,G,he,me,se,y,x,D,z,V,ie=t.type;if(t.constructor!==void 0)return null;128&e.__u&&(l=!!(32&e.__u),o=[s=t.__e=e.__e]),(d=Xe.__b)&&d(t);e:if(typeof ie=="function")try{if(F=t.props,G="prototype"in ie&&ie.prototype.render,he=(d=ie.contextType)&&n[d.__c],me=d?he?he.props.value:d.__:n,e.__c?L=(p=t.__c=e.__c).__=p.__E:(G?t.__c=p=new ie(F,me):(t.__c=p=new ni(F,me),p.constructor=ie,p.render=TS),he&&he.sub(p),p.props=F,p.state||(p.state={}),p.context=me,p.__n=n,v=p.__d=!0,p.__h=[],p._sb=[]),G&&p.__s==null&&(p.__s=p.state),G&&ie.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=bn({},p.__s)),bn(p.__s,ie.getDerivedStateFromProps(F,p.__s))),g=p.props,w=p.state,p.__v=t,v)G&&ie.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),G&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(G&&ie.getDerivedStateFromProps==null&&F!==g&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(F,me),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(F,p.__s,me)===!1||t.__v==e.__v)){for(t.__v!=e.__v&&(p.props=F,p.state=p.__s,p.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(Ie){Ie&&(Ie.__=t)}),se=0;se<p._sb.length;se++)p.__h.push(p._sb[se]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(F,p.__s,me),G&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(g,w,E)})}if(p.context=me,p.props=F,p.__P=i,p.__e=!1,y=Xe.__r,x=0,G){for(p.state=p.__s,p.__d=!1,y&&y(t),d=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[]}else do p.__d=!1,y&&y(t),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++x<25);p.state=p.__s,p.getChildContext!=null&&(n=bn(bn({},n),p.getChildContext())),G&&!v&&p.getSnapshotBeforeUpdate!=null&&(E=p.getSnapshotBeforeUpdate(g,w)),s=T0(i,Ml(z=d!=null&&d.type===mi&&d.key==null?d.props.children:d)?z:[z],t,e,n,r,o,a,s,l,c),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),L&&(p.__E=p.__=null)}catch(Ie){if(t.__v=null,l||o!=null)if(Ie.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(V=o.length;V--;)op(o[V]);else t.__e=e.__e,t.__k=e.__k;Xe.__e(Ie,t,e)}else o==null&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):s=t.__e=kS(e.__e,t,e,n,r,o,a,l,c);return(d=Xe.diffed)&&d(t),128&t.__u?void 0:s}function O0(i,t,e){for(var n=0;n<e.length;n++)sp(e[n],e[++n],e[++n]);Xe.__c&&Xe.__c(t,i),i.some(function(r){try{i=r.__h,r.__h=[],i.some(function(o){o.call(r)})}catch(o){Xe.__e(o,r.__v)}})}function kS(i,t,e,n,r,o,a,s,l){var c,d,p,v,g,w,E,L=e.props,F=t.props,G=t.type;if(G=="svg"?r="http://www.w3.org/2000/svg":G=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((g=o[c])&&"setAttribute"in g==!!G&&(G?g.localName==G:g.nodeType==3)){i=g,o[c]=null;break}}if(i==null){if(G==null)return document.createTextNode(F);i=document.createElementNS(r,G,F.is&&F),s&&(Xe.__m&&Xe.__m(t,o),s=!1),o=null}if(G===null)L===F||s&&i.data===F||(i.data=F);else{if(o=o&&ga.call(i.childNodes),L=e.props||fa,!s&&o!=null)for(L={},c=0;c<i.attributes.length;c++)L[(g=i.attributes[c]).name]=g.value;for(c in L)if(g=L[c],c!="children"){if(c=="dangerouslySetInnerHTML")p=g;else if(!(c in F)){if(c=="value"&&"defaultValue"in F||c=="checked"&&"defaultChecked"in F)continue;kl(i,c,null,g,r)}}for(c in F)g=F[c],c=="children"?v=g:c=="dangerouslySetInnerHTML"?d=g:c=="value"?w=g:c=="checked"?E=g:s&&typeof g!="function"||L[c]===g||kl(i,c,g,L[c],r);if(d)s||p&&(d.__html===p.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),t.__k=[];else if(p&&(i.innerHTML=""),T0(i,Ml(v)?v:[v],t,e,n,G=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:e.__k&&to(e,0),s,l),o!=null)for(c=o.length;c--;)op(o[c]);s||(c="value",G=="progress"&&w==null?i.removeAttribute("value"):w!==void 0&&(w!==i[c]||G=="progress"&&!w||G=="option"&&w!==L[c])&&kl(i,c,w,L[c],r),c="checked",E!==void 0&&E!==i[c]&&kl(i,c,E,L[c],r))}return i}function sp(i,t,e){try{if(typeof i=="function"){var n=typeof i.__u=="function";n&&i.__u(),n&&t==null||(i.__u=i(t))}else i.current=t}catch(r){Xe.__e(r,e)}}function F0(i,t,e){var n,r;if(Xe.unmount&&Xe.unmount(i),(n=i.ref)&&(n.current&&n.current!==i.__e||sp(n,null,t)),(n=i.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){Xe.__e(o,t)}n.base=n.__P=null}if(n=i.__k)for(r=0;r<n.length;r++)n[r]&&F0(n[r],t,e||typeof i.type!="function");e||op(i.__e),i.__c=i.__=i.__e=void 0}function TS(i,t,e){return this.constructor(i,e)}function lp(i,t,e){var n,r,o,a;t==document&&(t=document.documentElement),Xe.__&&Xe.__(i,t),r=(n=typeof e=="function")?null:e&&e.__k||t.__k,o=[],a=[],ap(t,i=(!n&&e||t).__k=u(mi,null,[i]),r||fa,fa,t.namespaceURI,!n&&e?[e]:r?null:t.firstChild?ga.call(t.childNodes):null,o,!n&&e?e:r?r.__e:t.firstChild,n,a),O0(o,i,a)}function Ol(i,t,e){var n,r,o,a,s=bn({},i.props);for(o in i.type&&i.type.defaultProps&&(a=i.type.defaultProps),t)o=="key"?n=t[o]:o=="ref"?r=t[o]:s[o]=t[o]===void 0&&a!==void 0?a[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?ga.call(arguments,2):e),ma(i.type,s,n||i.key,r||i.ref,null)}ga=I0.slice,Xe={__e:function(i,t,e,n){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(i)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(i,n||{}),a=r.__d),a)return r.__E=r}catch(s){i=s}throw i}},S0=0,SS=function(i){return i!=null&&i.constructor==null},ni.prototype.setState=function(i,t){var e;e=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=bn({},this.state),typeof i=="function"&&(i=i(bn({},e),this.props)),i&&bn(e,i),i!=null&&this.__v&&(t&&this._sb.push(t),w0(this))},ni.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),w0(this))},ni.prototype.render=mi,ir=[],P0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,tp=function(i,t){return i.__v.__b-t.__v.__b},Tl.__r=0,E0=/(PointerCapture)$|Capture$/i,rp=0,ip=C0(!1),np=C0(!0),PS=0;function ba(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function MS(i,t){return t===void 0&&(t=document),typeof i=="string"?t.querySelector(i):ba(i)?i:null}var A0=MS;function OS(i){for(var t;i&&!i.dir;)i=i.parentNode;return(t=i)==null?void 0:t.dir}var Fl=OS;var nr=class{constructor(t,e){this.uppy=t,this.opts=e??{}}getPluginState(){let{plugins:t}=this.uppy.getState();return t?.[this.id]||{}}setPluginState(t){let{plugins:e}=this.uppy.getState();this.uppy.setState({plugins:k(_({},e),{[this.id]:_(_({},e[this.id]),t)})})}setOptions(t){this.opts=_(_({},this.opts),t),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let t=new Zr([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState(void 0)}addTarget(t){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(t){}afterUpdate(){}};function R0(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var FS=0;function AS(i){return"__private_"+FS+++"_"+i}function RS(i){let t=null,e;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=r,t||(t=Promise.resolve().then(()=>(t=null,i(...e)))),t}}var va=AS("updateUI"),cp=class i extends nr{constructor(){super(...arguments),Object.defineProperty(this,va,{writable:!0,value:void 0})}getTargetPlugin(t){let e;if(typeof t?.addTarget=="function")e=t,e instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:e,UIPlugin:i}}));else if(typeof t=="function"){let n=t;this.uppy.iteratePlugins(r=>{r instanceof n&&(e=r)})}return e}mount(t,e){let n=e.id,r=A0(t);if(r){this.isTargetDOMEl=!0;let s=document.createElement("div");return s.classList.add("uppy-Root"),R0(this,va)[va]=RS(l=>{this.uppy.getPlugin(this.id)&&(lp(this.render(l,s),s),this.afterUpdate())}),this.uppy.log(`Installing ${n} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),lp(this.render(this.uppy.getState(),s),s),this.el=s,r.appendChild(s),s.dir=this.opts.direction||Fl(s)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(t);if(o)return this.uppy.log(`Installing ${n} to ${o.id}`),this.parent=o,this.el=o.addTarget(e),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let a=`Invalid target option given to ${n}.`;throw typeof t=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(a)}render(t,e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(t){if(this.el!=null){var e,n;(e=(n=R0(this,va))[va])==null||e.call(n,t)}}unmount(){if(this.isTargetDOMEl){var t;(t=this.el)==null||t.remove()}this.onUnmount()}onMount(){}onUnmount(){}},fi=cp;function Al(i,t,e,n){return e===0||i===t?i:n===0?t:i+(t-i)*2**(-n/e)}var gi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var gp=Ne(Gt(),1);function _a(i){let t=[],e="indeterminate",n;for(let{progress:o}of Object.values(i)){let{preprocess:a,postprocess:s}=o;n==null&&(a||s)&&({mode:e,message:n}=a||s),a?.mode==="determinate"&&t.push(a.value),s?.mode==="determinate"&&t.push(s.value)}let r=t.reduce((o,a)=>o+a/t.length,0);return{mode:e,message:n,value:r}}var hp=Ne(Gt(),1),up=Ne(oa(),1);function dp(i){let t=Math.floor(i/3600)%24,e=Math.floor(i/60)%60,n=Math.floor(i%60);return{hours:t,minutes:e,seconds:n}}function pp(i){let t=dp(i),e=t.hours===0?"":`${t.hours}h`,n=t.minutes===0?"":`${t.hours===0?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`,r=t.hours!==0?"":`${t.minutes===0?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`;return`${e}${n}${r}`}var BS="\xB7",B0=()=>` ${BS} `;function N0(i){let{newFiles:t,isUploadStarted:e,recoveredState:n,i18n:r,uploadState:o,isSomeGhost:a,startUpload:s}=i,l=(0,hp.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===gi.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),c=t&&e&&!n?r("uploadXNewFiles",{smart_count:t}):r("uploadXFiles",{smart_count:t});return u("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:t}),onClick:s,disabled:a,"data-uppy-super-focusable":!0},c)}function z0(i){let{i18n:t,uppy:e}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>e.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},u("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),t("retry"))}function L0(i){let{i18n:t,uppy:e}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>e.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function j0(i){let{isAllPaused:t,i18n:e,isAllComplete:n,resumableUploads:r,uppy:o}=i,a=e(t?"resume":"pause");function s(){if(!n){if(!r){o.cancelAll();return}if(t){o.resumeAll();return}o.pauseAll()}}return u("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:s,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function H0(i){let{i18n:t,doneButtonHandler:e}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:e,"data-uppy-super-focusable":!0},t("done"))}function V0(){return u("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},u("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function U0(i){let{progress:t}=i,{value:e,mode:n,message:r}=t;return u("div",{className:"uppy-StatusBar-content"},u(V0,null),n==="determinate"?`${Math.round(e*100)}% \xB7 `:"",r)}function NS(i){let{numUploads:t,complete:e,totalUploadedSize:n,totalSize:r,totalETA:o,i18n:a}=i,s=t>1,l=(0,up.default)(n);return u("div",{className:"uppy-StatusBar-statusSecondary"},s&&a("filesUploadedOfTotal",{complete:e,smart_count:t}),u("span",{className:"uppy-StatusBar-additionalInfo"},s&&B0(),r!=null?a("dataUploadedOfTotal",{complete:l,total:(0,up.default)(r)}):a("dataUploadedOfUnknown",{complete:l}),B0(),o!=null&&a("xTimeLeft",{time:pp(o)})))}function W0(i){let{i18n:t,complete:e,numUploads:n}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:e,smart_count:n}))}function zS(i){let{i18n:t,newFiles:e,startUpload:n}=i,r=(0,hp.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return u("div",{className:"uppy-StatusBar-statusSecondary"},u("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:e})),u("button",{type:"button",className:r,"aria-label":t("uploadXFiles",{smart_count:e}),onClick:n},t("upload")))}function $0(i){let{i18n:t,supportsUploadProgress:e,totalProgress:n,showProgressDetails:r,isUploadStarted:o,isAllComplete:a,isAllPaused:s,newFiles:l,numUploads:c,complete:d,totalUploadedSize:p,totalSize:v,totalETA:g,startUpload:w}=i,E=l&&o;if(!o||a)return null;let L=t(s?"paused":"uploading");function F(){return!s&&!E&&r?e?u(NS,{numUploads:c,complete:d,totalUploadedSize:p,totalSize:v,totalETA:g,i18n:t}):u(W0,{i18n:t,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":L,title:L},s?null:u(V0,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},e&&n!==0?`${L}: ${n}%`:L),F(),E?u(zS,{i18n:t,newFiles:l,startUpload:w}):null))}function q0(i){let{i18n:t}=i;return u("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},u("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))}function G0(i){let{error:t,i18n:e,complete:n,numUploads:r}=i;function o(){let a=`${e("uploadFailed")}
22
22
 
23
- ${t}`;alert(a)}return u("div",{className:"uppy-StatusBar-content",title:e("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},e("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":e("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:o,type:"button"},"?")),u(W0,{i18n:e,complete:n,numUploads:r})))}var{STATE_ERROR:Y0,STATE_WAITING:LS,STATE_PREPROCESSING:mp,STATE_UPLOADING:Bl,STATE_POSTPROCESSING:fp,STATE_COMPLETE:Nl}=gi;function bp(i){let{newFiles:t,allowNewUpload:e,isUploadInProgress:n,isAllPaused:r,resumableUploads:o,error:a,hideUploadButton:s=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:p,uploadState:v,totalProgress:g,files:w,supportsUploadProgress:E,hideAfterFinish:L=!1,isSomeGhost:F,doneButtonHandler:G=void 0,isUploadStarted:he,i18n:me,startUpload:se,uppy:y,isAllComplete:x,showProgressDetails:D=void 0,numUploads:z,complete:V,totalSize:ie,totalETA:Ie,totalUploadedSize:it}=i;function Be(){switch(v){case fp:case mp:{let Z=va(w);return Z.mode==="determinate"?Z.value*100:g}case Y0:return null;case Bl:return E?g:null;default:return g}}function Oe(){switch(v){case fp:case mp:{let{mode:Z}=va(w);return Z==="indeterminate"}case Bl:return!E;default:return!1}}let ne=Be(),nt=ne??100,le=!a&&t&&(!n&&!r||p)&&e&&!s,ai=!c&&v!==LS&&v!==Nl,xe=o&&!l&&v===Bl,ee=a&&!x&&!d,A=G&&v===Nl,I=(0,gp.default)("uppy-StatusBar-progress",{"is-indeterminate":Oe()}),T=(0,gp.default)("uppy-StatusBar",`is-${v}`,{"has-ghosts":F}),M=(()=>{switch(v){case mp:case fp:return u(U0,{progress:va(w)});case Nl:return u(q0,{i18n:me});case Y0:return u(G0,{error:a,i18n:me,numUploads:z,complete:V});case Bl:return u($0,{i18n:me,supportsUploadProgress:E,totalProgress:g,showProgressDetails:D,isUploadStarted:he,isAllComplete:x,isAllPaused:r,newFiles:t,numUploads:z,complete:V,totalUploadedSize:it,totalSize:ie,totalETA:Ie,startUpload:se});default:return null}})();return u("div",{className:T,"aria-hidden":!(le||ee||xe||ai||A)&&!M||v===Nl&&L},u("div",{className:I,style:{width:`${nt}%`},role:"progressbar","aria-label":`${nt}%`,"aria-valuetext":`${nt}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":ne}),M,u("div",{className:"uppy-StatusBar-actions"},le?u(N0,{newFiles:t,isUploadStarted:he,recoveredState:p,i18n:me,isSomeGhost:F,startUpload:se,uploadState:v}):null,ee?u(z0,{i18n:me,uppy:y}):null,xe?u(j0,{isAllPaused:r,i18n:me,isAllComplete:x,resumableUploads:o,uppy:y}):null,ai?u(L0,{i18n:me,uppy:y}):null,A?u(H0,{i18n:me,doneButtonHandler:G}):null))}var X0={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function tt(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var jS=0;function to(i){return"__private_"+jS+++"_"+i}var HS={version:"4.1.1"},VS=2e3,US=2e3;function WS(i,t,e,n){if(i)return gi.STATE_ERROR;if(t)return gi.STATE_COMPLETE;if(e)return gi.STATE_WAITING;let r=gi.STATE_WAITING,o=Object.keys(n);for(let a=0;a<o.length;a++){let{progress:s}=n[o[a]];if(s.uploadStarted&&!s.uploadComplete)return gi.STATE_UPLOADING;s.preprocess&&(r=gi.STATE_PREPROCESSING),s.postprocess&&r!==gi.STATE_PREPROCESSING&&(r=gi.STATE_POSTPROCESSING)}return r}var $S={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Mi=to("lastUpdateTime"),Li=to("previousUploadedBytes"),vn=to("previousSpeed"),bi=to("previousETA"),vp=to("computeSmoothETA"),_a=to("onUploadStart"),nr=class extends fi{constructor(t,e){super(t,_(_({},$S),e)),Object.defineProperty(this,vp,{value:qS}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Li,{writable:!0,value:void 0}),Object.defineProperty(this,vn,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,_a,{writable:!0,value:()=>{let{recoveredState:n}=this.uppy.getState();if(tt(this,vn)[vn]=null,tt(this,bi)[bi]=null,n){tt(this,Li)[Li]=Object.values(n.files).reduce((r,o)=>{let{progress:a}=o;return r+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}tt(this,Mi)[Mi]=performance.now(),tt(this,Li)[Li]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=X0,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(t){let{capabilities:e,files:n,allowNewUpload:r,totalProgress:o,error:a,recoveredState:s}=t,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:p,isAllComplete:v,isAllPaused:g,isUploadInProgress:w,isSomeGhost:E}=this.uppy.getObjectOfFilesPerState(),L=s?Object.values(n):l,F=!!e.resumableUploads,G=e.uploadProgress!==!1,he=null,me=0;c.every(y=>y.progress.bytesTotal!=null&&y.progress.bytesTotal!==0)?(he=0,c.forEach(y=>{he+=y.progress.bytesTotal||0,me+=y.progress.bytesUploaded||0})):c.forEach(y=>{me+=y.progress.bytesUploaded||0});let se=tt(this,vp)[vp]({uploaded:me,total:he});return bp({error:a,uploadState:WS(a,v,s,t.files||{}),allowNewUpload:r,totalProgress:o,totalSize:he,totalUploadedSize:me,isAllComplete:!1,isAllPaused:g,isUploadStarted:p,isUploadInProgress:w,isSomeGhost:E,recoveredState:s,complete:d.length,newFiles:L.length,numUploads:c.length,totalETA:se,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:F,supportsUploadProgress:G,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let t=this.el;Fl(t)||(t.dir="ltr")}install(){let{target:t}=this.opts;t&&this.mount(t,this),this.uppy.on("upload",tt(this,_a)[_a]),tt(this,Mi)[Mi]=performance.now(),tt(this,Li)[Li]=this.uppy.getFiles().reduce((e,n)=>e+n.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",tt(this,_a)[_a])}};function qS(i){var t,e;if(i.total==null||i.total===0)return null;let n=i.total-i.uploaded;if(n<=0)return null;(e=(t=tt(this,Mi))[Mi])!=null||(t[Mi]=performance.now());let r=performance.now()-tt(this,Mi)[Mi];if(r===0){var o;return Math.round(((o=tt(this,bi)[bi])!=null?o:0)/100)/10}let a=i.uploaded-tt(this,Li)[Li];if(tt(this,Li)[Li]=i.uploaded,a<=0){var s;return Math.round(((s=tt(this,bi)[bi])!=null?s:0)/100)/10}let l=a/r,c=tt(this,vn)[vn]==null?l:Al(l,tt(this,vn)[vn],VS,r);tt(this,vn)[vn]=c;let d=n/c,p=Math.max(tt(this,bi)[bi]-r,0),v=tt(this,bi)[bi]==null?d:Al(d,p,US,r);return tt(this,bi)[bi]=v,tt(this,Mi)[Mi]=performance.now(),Math.round(v/100)/10}nr.VERSION=HS.version;var K0=300,zl=class extends ni{constructor(){super(...arguments),this.ref=D0()}componentWillEnter(t){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(t,K0)}componentWillLeave(t){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(t,K0)}render(){let{children:t}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},t)}};function GS(i,t){return Object.assign(i,t)}function YS(i,t){var e;return(e=i?.key)!=null?e:t}function XS(i,t){let e=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return e[t]||(e[t]=n=>{i.refs[t]=n})}function ya(i){let t={};for(let e=0;e<i.length;e++)if(i[e]!=null){let n=YS(i[e],e.toString(36));t[n]=i[e]}return t}function KS(i,t){i=i||{},t=t||{};let e=a=>t.hasOwnProperty(a)?t[a]:i[a],n={},r=[];for(let a in i)t.hasOwnProperty(a)?r.length&&(n[a]=r,r=[]):r.push(a);let o={};for(let a in t){if(n.hasOwnProperty(a))for(let s=0;s<n[a].length;s++){let l=n[a][s];o[n[a][s]]=e(l)}o[a]=e(a)}for(let a=0;a<r.length;a++)o[r[a]]=e(r[a]);return o}var QS=i=>i,ZS=(()=>{class i extends ni{constructor(e,n){super(e,n),this.refs={},this.state={children:ya(Ki(Ki(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let n in e)e[n]&&this.performAppear(n)}componentWillReceiveProps(e){let n=ya(Ki(e.children)||[]),r=this.state.children;this.setState(a=>({children:KS(a.children,n)}));let o;for(o in n)if(n.hasOwnProperty(o)){let a=r&&r.hasOwnProperty(o);n[o]&&a&&this.currentlyTransitioningKeys[o]?(this.keysToEnter.push(o),this.keysToAbortLeave.push(o)):n[o]&&!a&&!this.currentlyTransitioningKeys[o]&&this.keysToEnter.push(o)}for(o in r)if(r.hasOwnProperty(o)){let a=n&&n.hasOwnProperty(o);r[o]&&!a&&!this.currentlyTransitioningKeys[o]&&this.keysToLeave.push(o)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:n}=this;this.keysToLeave=[],n.forEach(this.performLeave)}_finishAbort(e){let n=this.keysToAbortLeave.indexOf(e);n!==-1&&this.keysToAbortLeave.splice(n,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let n=this.refs[e];n!=null&&n.componentWillAppear?n.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let n=this.refs[e];n!=null&&n.componentDidAppear&&n.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=ya(Ki(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let n=this.refs[e];n!=null&&n.componentWillEnter?n.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let n=this.refs[e];n!=null&&n.componentDidEnter&&n.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=ya(Ki(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let r=this.refs[e];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let o=ya(Ki(this.props.children)||[]);if(o&&o.hasOwnProperty(e))this.performEnter(e);else{let a=GS({},this.state.children);delete a[e],this.setState({children:a})}}render(e,n){let L=e,{childFactory:r,transitionLeave:o,transitionName:a,transitionAppear:s,transitionEnter:l,transitionLeaveTimeout:c,transitionEnterTimeout:d,transitionAppearTimeout:p,component:v}=L,g=Cr(L,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:w}=n,E=Object.entries(w).map(F=>{let[G,he]=F;if(!he)return;let me=XS(this,G);return Ol(r(he),{ref:me,key:G})}).filter(Boolean);return u(v,g,E)}}return i.defaultProps={component:"span",childFactory:QS},i})(),Q0=ZS;var JS={version:"4.2.1"},rr=class extends fi{constructor(t,e){super(t,e),this.render=n=>u("div",{className:"uppy uppy-Informer"},u(Q0,null,n.info.map(r=>u(zl,{key:r.message},u("p",{role:"alert"},r.message," ",r.details&&u("span",{"aria-label":r.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${r.message}
23
+ ${t}`;alert(a)}return u("div",{className:"uppy-StatusBar-content",title:e("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},e("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":e("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:o,type:"button"},"?")),u(W0,{i18n:e,complete:n,numUploads:r})))}var{STATE_ERROR:Y0,STATE_WAITING:LS,STATE_PREPROCESSING:mp,STATE_UPLOADING:Bl,STATE_POSTPROCESSING:fp,STATE_COMPLETE:Nl}=gi;function bp(i){let{newFiles:t,allowNewUpload:e,isUploadInProgress:n,isAllPaused:r,resumableUploads:o,error:a,hideUploadButton:s=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:p,uploadState:v,totalProgress:g,files:w,supportsUploadProgress:E,hideAfterFinish:L=!1,isSomeGhost:F,doneButtonHandler:G=void 0,isUploadStarted:he,i18n:me,startUpload:se,uppy:y,isAllComplete:x,showProgressDetails:D=void 0,numUploads:z,complete:V,totalSize:ie,totalETA:Ie,totalUploadedSize:it}=i;function Be(){switch(v){case fp:case mp:{let Z=_a(w);return Z.mode==="determinate"?Z.value*100:g}case Y0:return null;case Bl:return E?g:null;default:return g}}function Oe(){switch(v){case fp:case mp:{let{mode:Z}=_a(w);return Z==="indeterminate"}case Bl:return!E;default:return!1}}let ne=Be(),nt=ne??100,le=!a&&t&&(!n&&!r||p)&&e&&!s,ai=!c&&v!==LS&&v!==Nl,xe=o&&!l&&v===Bl,ee=a&&!x&&!d,A=G&&v===Nl,I=(0,gp.default)("uppy-StatusBar-progress",{"is-indeterminate":Oe()}),T=(0,gp.default)("uppy-StatusBar",`is-${v}`,{"has-ghosts":F}),M=(()=>{switch(v){case mp:case fp:return u(U0,{progress:_a(w)});case Nl:return u(q0,{i18n:me});case Y0:return u(G0,{error:a,i18n:me,numUploads:z,complete:V});case Bl:return u($0,{i18n:me,supportsUploadProgress:E,totalProgress:g,showProgressDetails:D,isUploadStarted:he,isAllComplete:x,isAllPaused:r,newFiles:t,numUploads:z,complete:V,totalUploadedSize:it,totalSize:ie,totalETA:Ie,startUpload:se});default:return null}})();return u("div",{className:T,"aria-hidden":!(le||ee||xe||ai||A)&&!M||v===Nl&&L},u("div",{className:I,style:{width:`${nt}%`},role:"progressbar","aria-label":`${nt}%`,"aria-valuetext":`${nt}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":ne}),M,u("div",{className:"uppy-StatusBar-actions"},le?u(N0,{newFiles:t,isUploadStarted:he,recoveredState:p,i18n:me,isSomeGhost:F,startUpload:se,uploadState:v}):null,ee?u(z0,{i18n:me,uppy:y}):null,xe?u(j0,{isAllPaused:r,i18n:me,isAllComplete:x,resumableUploads:o,uppy:y}):null,ai?u(L0,{i18n:me,uppy:y}):null,A?u(H0,{i18n:me,doneButtonHandler:G}):null))}var X0={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function tt(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var jS=0;function io(i){return"__private_"+jS+++"_"+i}var HS={version:"4.1.1"},VS=2e3,US=2e3;function WS(i,t,e,n){if(i)return gi.STATE_ERROR;if(t)return gi.STATE_COMPLETE;if(e)return gi.STATE_WAITING;let r=gi.STATE_WAITING,o=Object.keys(n);for(let a=0;a<o.length;a++){let{progress:s}=n[o[a]];if(s.uploadStarted&&!s.uploadComplete)return gi.STATE_UPLOADING;s.preprocess&&(r=gi.STATE_PREPROCESSING),s.postprocess&&r!==gi.STATE_PREPROCESSING&&(r=gi.STATE_POSTPROCESSING)}return r}var $S={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Mi=io("lastUpdateTime"),Li=io("previousUploadedBytes"),vn=io("previousSpeed"),bi=io("previousETA"),vp=io("computeSmoothETA"),ya=io("onUploadStart"),rr=class extends fi{constructor(t,e){super(t,_(_({},$S),e)),Object.defineProperty(this,vp,{value:qS}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,Li,{writable:!0,value:void 0}),Object.defineProperty(this,vn,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,ya,{writable:!0,value:()=>{let{recoveredState:n}=this.uppy.getState();if(tt(this,vn)[vn]=null,tt(this,bi)[bi]=null,n){tt(this,Li)[Li]=Object.values(n.files).reduce((r,o)=>{let{progress:a}=o;return r+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}tt(this,Mi)[Mi]=performance.now(),tt(this,Li)[Li]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=X0,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(t){let{capabilities:e,files:n,allowNewUpload:r,totalProgress:o,error:a,recoveredState:s}=t,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:p,isAllComplete:v,isAllPaused:g,isUploadInProgress:w,isSomeGhost:E}=this.uppy.getObjectOfFilesPerState(),L=s?Object.values(n):l,F=!!e.resumableUploads,G=e.uploadProgress!==!1,he=null,me=0;c.every(y=>y.progress.bytesTotal!=null&&y.progress.bytesTotal!==0)?(he=0,c.forEach(y=>{he+=y.progress.bytesTotal||0,me+=y.progress.bytesUploaded||0})):c.forEach(y=>{me+=y.progress.bytesUploaded||0});let se=tt(this,vp)[vp]({uploaded:me,total:he});return bp({error:a,uploadState:WS(a,v,s,t.files||{}),allowNewUpload:r,totalProgress:o,totalSize:he,totalUploadedSize:me,isAllComplete:!1,isAllPaused:g,isUploadStarted:p,isUploadInProgress:w,isSomeGhost:E,recoveredState:s,complete:d.length,newFiles:L.length,numUploads:c.length,totalETA:se,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:F,supportsUploadProgress:G,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let t=this.el;Fl(t)||(t.dir="ltr")}install(){let{target:t}=this.opts;t&&this.mount(t,this),this.uppy.on("upload",tt(this,ya)[ya]),tt(this,Mi)[Mi]=performance.now(),tt(this,Li)[Li]=this.uppy.getFiles().reduce((e,n)=>e+n.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",tt(this,ya)[ya])}};function qS(i){var t,e;if(i.total==null||i.total===0)return null;let n=i.total-i.uploaded;if(n<=0)return null;(e=(t=tt(this,Mi))[Mi])!=null||(t[Mi]=performance.now());let r=performance.now()-tt(this,Mi)[Mi];if(r===0){var o;return Math.round(((o=tt(this,bi)[bi])!=null?o:0)/100)/10}let a=i.uploaded-tt(this,Li)[Li];if(tt(this,Li)[Li]=i.uploaded,a<=0){var s;return Math.round(((s=tt(this,bi)[bi])!=null?s:0)/100)/10}let l=a/r,c=tt(this,vn)[vn]==null?l:Al(l,tt(this,vn)[vn],VS,r);tt(this,vn)[vn]=c;let d=n/c,p=Math.max(tt(this,bi)[bi]-r,0),v=tt(this,bi)[bi]==null?d:Al(d,p,US,r);return tt(this,bi)[bi]=v,tt(this,Mi)[Mi]=performance.now(),Math.round(v/100)/10}rr.VERSION=HS.version;var K0=300,zl=class extends ni{constructor(){super(...arguments),this.ref=D0()}componentWillEnter(t){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(t,K0)}componentWillLeave(t){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(t,K0)}render(){let{children:t}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},t)}};function GS(i,t){return Object.assign(i,t)}function YS(i,t){var e;return(e=i?.key)!=null?e:t}function XS(i,t){let e=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return e[t]||(e[t]=n=>{i.refs[t]=n})}function wa(i){let t={};for(let e=0;e<i.length;e++)if(i[e]!=null){let n=YS(i[e],e.toString(36));t[n]=i[e]}return t}function KS(i,t){i=i||{},t=t||{};let e=a=>t.hasOwnProperty(a)?t[a]:i[a],n={},r=[];for(let a in i)t.hasOwnProperty(a)?r.length&&(n[a]=r,r=[]):r.push(a);let o={};for(let a in t){if(n.hasOwnProperty(a))for(let s=0;s<n[a].length;s++){let l=n[a][s];o[n[a][s]]=e(l)}o[a]=e(a)}for(let a=0;a<r.length;a++)o[r[a]]=e(r[a]);return o}var QS=i=>i,ZS=(()=>{class i extends ni{constructor(e,n){super(e,n),this.refs={},this.state={children:wa(Ki(Ki(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let n in e)e[n]&&this.performAppear(n)}componentWillReceiveProps(e){let n=wa(Ki(e.children)||[]),r=this.state.children;this.setState(a=>({children:KS(a.children,n)}));let o;for(o in n)if(n.hasOwnProperty(o)){let a=r&&r.hasOwnProperty(o);n[o]&&a&&this.currentlyTransitioningKeys[o]?(this.keysToEnter.push(o),this.keysToAbortLeave.push(o)):n[o]&&!a&&!this.currentlyTransitioningKeys[o]&&this.keysToEnter.push(o)}for(o in r)if(r.hasOwnProperty(o)){let a=n&&n.hasOwnProperty(o);r[o]&&!a&&!this.currentlyTransitioningKeys[o]&&this.keysToLeave.push(o)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:n}=this;this.keysToLeave=[],n.forEach(this.performLeave)}_finishAbort(e){let n=this.keysToAbortLeave.indexOf(e);n!==-1&&this.keysToAbortLeave.splice(n,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let n=this.refs[e];n!=null&&n.componentWillAppear?n.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let n=this.refs[e];n!=null&&n.componentDidAppear&&n.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=wa(Ki(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let n=this.refs[e];n!=null&&n.componentWillEnter?n.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let n=this.refs[e];n!=null&&n.componentDidEnter&&n.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=wa(Ki(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let r=this.refs[e];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let o=wa(Ki(this.props.children)||[]);if(o&&o.hasOwnProperty(e))this.performEnter(e);else{let a=GS({},this.state.children);delete a[e],this.setState({children:a})}}render(e,n){let L=e,{childFactory:r,transitionLeave:o,transitionName:a,transitionAppear:s,transitionEnter:l,transitionLeaveTimeout:c,transitionEnterTimeout:d,transitionAppearTimeout:p,component:v}=L,g=Sr(L,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:w}=n,E=Object.entries(w).map(F=>{let[G,he]=F;if(!he)return;let me=XS(this,G);return Ol(r(he),{ref:me,key:G})}).filter(Boolean);return u(v,g,E)}}return i.defaultProps={component:"span",childFactory:QS},i})(),Q0=ZS;var JS={version:"4.2.1"},or=class extends fi{constructor(t,e){super(t,e),this.render=n=>u("div",{className:"uppy uppy-Informer"},u(Q0,null,n.info.map(r=>u(zl,{key:r.message},u("p",{role:"alert"},r.message," ",r.details&&u("span",{"aria-label":r.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${r.message}
24
24
 
25
- ${r.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:t}=this.opts;t&&this.mount(t,this)}};rr.VERSION=JS.version;var eP=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function tP(i,t,e){var n,r;let o=eP.exec(i),a=(n=(r=t.mimeType)!=null?r:o?.[1])!=null?n:"plain/text",s;if(o?.[2]!=null){let l=atob(decodeURIComponent(o[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);s=[c]}else o?.[3]!=null&&(s=[decodeURIComponent(o[3])]);return e?new File(s,t.name||"",{type:a}):new Blob(s,{type:a})}var Z0=tP;function Ll(i){return i.startsWith("blob:")}function jl(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function je(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var sb=typeof self<"u"?self:global,Sa=typeof navigator<"u",iP=Sa&&typeof HTMLImageElement>"u",J0=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),lb=sb.Buffer,cb=!!lb,nP=i=>i!==void 0;function db(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(nP).length===0)}function Tt(i){let t=new Error(i);throw delete t.stack,t}function eb(i){let t=function(e){let n=0;return e.ifd0.enabled&&(n+=1024),e.exif.enabled&&(n+=2048),e.makerNote&&(n+=2048),e.userComment&&(n+=1024),e.gps.enabled&&(n+=512),e.interop.enabled&&(n+=100),e.ifd1.enabled&&(n+=1024),n+2048}(i);return i.jfif.enabled&&(t+=50),i.xmp.enabled&&(t+=2e4),i.iptc.enabled&&(t+=14e3),i.icc.enabled&&(t+=6e3),t}var _p=i=>String.fromCharCode.apply(null,i),tb=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,ar=class i{static from(t,e){return t instanceof this&&t.le===e?t:new i(t,void 0,void 0,e)}constructor(t,e=0,n,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(t)&&(t=new Uint8Array(t)),t===0)this.byteOffset=0,this.byteLength=0;else if(t instanceof ArrayBuffer){n===void 0&&(n=t.byteLength-e);let o=new DataView(t,e,n);this._swapDataView(o)}else if(t instanceof Uint8Array||t instanceof DataView||t instanceof i){n===void 0&&(n=t.byteLength-e),(e+=t.byteOffset)+n>t.byteOffset+t.byteLength&&Tt("Creating view outside of available memory in ArrayBuffer");let o=new DataView(t.buffer,e,n);this._swapDataView(o)}else if(typeof t=="number"){let o=new DataView(new ArrayBuffer(t));this._swapDataView(o)}else Tt("Invalid input argument for BufferView: "+t)}_swapArrayBuffer(t){this._swapDataView(new DataView(t))}_swapBuffer(t){this._swapDataView(new DataView(t.buffer,t.byteOffset,t.byteLength))}_swapDataView(t){this.dataView=t,this.buffer=t.buffer,this.byteOffset=t.byteOffset,this.byteLength=t.byteLength}_lengthToEnd(t){return this.byteLength-t}set(t,e,n=i){return t instanceof DataView||t instanceof i?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array||Tt("BufferView.set(): Invalid data argument."),this.toUint8().set(t,e),new n(this,e,t.byteLength)}subarray(t,e){return e=e||this._lengthToEnd(t),new i(this,t,e)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(t,e){return new Uint8Array(this.buffer,this.byteOffset+t,e)}getString(t=0,e=this.byteLength){return r=this.getUint8Array(t,e),tb?tb.decode(r):cb?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(_p(r)));var r}getLatin1String(t=0,e=this.byteLength){let n=this.getUint8Array(t,e);return _p(n)}getUnicodeString(t=0,e=this.byteLength){let n=[];for(let r=0;r<e&&t+r<this.byteLength;r+=2)n.push(this.getUint16(t+r));return _p(n)}getInt8(t){return this.dataView.getInt8(t)}getUint8(t){return this.dataView.getUint8(t)}getInt16(t,e=this.le){return this.dataView.getInt16(t,e)}getInt32(t,e=this.le){return this.dataView.getInt32(t,e)}getUint16(t,e=this.le){return this.dataView.getUint16(t,e)}getUint32(t,e=this.le){return this.dataView.getUint32(t,e)}getFloat32(t,e=this.le){return this.dataView.getFloat32(t,e)}getFloat64(t,e=this.le){return this.dataView.getFloat64(t,e)}getFloat(t,e=this.le){return this.dataView.getFloat32(t,e)}getDouble(t,e=this.le){return this.dataView.getFloat64(t,e)}getUintBytes(t,e,n){switch(e){case 1:return this.getUint8(t,n);case 2:return this.getUint16(t,n);case 4:return this.getUint32(t,n);case 8:return this.getUint64&&this.getUint64(t,n)}}getUint(t,e,n){switch(e){case 8:return this.getUint8(t,n);case 16:return this.getUint16(t,n);case 32:return this.getUint32(t,n);case 64:return this.getUint64&&this.getUint64(t,n)}}toString(t){return this.dataView.toString(t,this.constructor.name)}ensureChunk(){}};function wp(i,t){Tt(`${i} '${t}' was not loaded, try using full build of exifr.`)}var Pa=class extends Map{constructor(t){super(),this.kind=t}get(t,e){return this.has(t)||wp(this.kind,t),e&&(t in e||function(n,r){Tt(`Unknown ${n} '${r}'.`)}(this.kind,t),e[t].enabled||wp(this.kind,t)),super.get(t)}keyList(){return Array.from(this.keys())}},$l=new Pa("file parser"),vi=new Pa("segment parser"),Da=new Pa("file reader"),rP=sb.fetch;function ib(i,t){return(e=i).startsWith("data:")||e.length>1e4?Cp(i,t,"base64"):J0&&i.includes("://")?xp(i,t,"url",Hl):J0?Cp(i,t,"fs"):Sa?xp(i,t,"url",Hl):void Tt("Invalid input argument");var e}function xp(i,t,e,n){return j(this,null,function*(){return Da.has(e)?Cp(i,t,e):n?function(r,o){return j(this,null,function*(){let a=yield o(r);return new ar(a)})}(i,n):void Tt(`Parser ${e} is not loaded`)})}function Cp(i,t,e){return j(this,null,function*(){let n=new(Da.get(e))(i,t);return yield n.read(),n})}var Hl=i=>rP(i).then(t=>t.arrayBuffer()),Ea=i=>new Promise((t,e)=>{let n=new FileReader;n.onloadend=()=>t(n.result||new ArrayBuffer),n.onerror=e,n.readAsArrayBuffer(i)}),Sp=class 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 pb(i,t,e){let n=new Sp;for(let[r,o]of e)n.set(r,o);if(Array.isArray(t))for(let r of t)i.set(r,n);else i.set(t,n);return n}function ub(i,t,e){let n,r=i.get(t);for(n of e)r.set(n[0],n[1])}var ka=new Map,kp=new Map,Tp=new Map,io=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],ql=["jfif","xmp","icc","iptc","ihdr"],Ia=["tiff",...ql],vt=["ifd0","ifd1","exif","gps","interop"],no=[...Ia,...vt],ro=["makerNote","userComment"],Gl=["translateKeys","translateValues","reviveValues","multiSegment"],oo=[...Gl,"sanitize","mergeOutput","silentErrors"],Vl=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},or=class extends Vl{get needed(){return this.enabled||this.deps.size>0}constructor(t,e,n,r){if(super(),je(this,"enabled",!1),je(this,"skip",new Set),je(this,"pick",new Set),je(this,"deps",new Set),je(this,"translateKeys",!1),je(this,"translateValues",!1),je(this,"reviveValues",!1),this.key=t,this.enabled=e,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=vt.includes(t),this.canBeFiltered&&(this.dict=ka.get(t)),n!==void 0)if(Array.isArray(n))this.parse=this.enabled=!0,this.canBeFiltered&&n.length>0&&this.translateTagSet(n,this.pick);else if(typeof n=="object"){if(this.enabled=!0,this.parse=n.parse!==!1,this.canBeFiltered){let{pick:o,skip:a}=n;o&&o.length>0&&this.translateTagSet(o,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(n)}else n===!0||n===!1?this.parse=this.enabled=n:Tt(`Invalid options argument: ${n}`)}applyInheritables(t){let e,n;for(e of Gl)n=t[e],n!==void 0&&(this[e]=n)}translateTagSet(t,e){if(this.dict){let n,r,{tagKeys:o,tagValues:a}=this.dict;for(n of t)typeof n=="string"?(r=a.indexOf(n),r===-1&&(r=o.indexOf(Number(n))),r!==-1&&e.add(Number(o[r]))):e.add(n)}else for(let n of t)e.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ul(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ul(this.pick,this.deps)}},Yt={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},nb=new Map,sr=class extends Vl{static useCached(t){let e=nb.get(t);return e!==void 0||(e=new this(t),nb.set(t,e)),e}constructor(t){super(),t===!0?this.setupFromTrue():t===void 0?this.setupFromUndefined():Array.isArray(t)?this.setupFromArray(t):typeof t=="object"?this.setupFromObject(t):Tt(`Invalid options argument ${t}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Sa?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let t;for(t of io)this[t]=Yt[t];for(t of oo)this[t]=Yt[t];for(t of ro)this[t]=Yt[t];for(t of no)this[t]=new or(t,Yt[t],void 0,this)}setupFromTrue(){let t;for(t of io)this[t]=Yt[t];for(t of oo)this[t]=Yt[t];for(t of ro)this[t]=!0;for(t of no)this[t]=new or(t,!0,void 0,this)}setupFromArray(t){let e;for(e of io)this[e]=Yt[e];for(e of oo)this[e]=Yt[e];for(e of ro)this[e]=Yt[e];for(e of no)this[e]=new or(e,!1,void 0,this);this.setupGlobalFilters(t,void 0,vt)}setupFromObject(t){let e;for(e of(vt.ifd0=vt.ifd0||vt.image,vt.ifd1=vt.ifd1||vt.thumbnail,Object.assign(this,t),io))this[e]=yp(t[e],Yt[e]);for(e of oo)this[e]=yp(t[e],Yt[e]);for(e of ro)this[e]=yp(t[e],Yt[e]);for(e of Ia)this[e]=new or(e,Yt[e],t[e],this);for(e of vt)this[e]=new or(e,Yt[e],t[e],this.tiff);this.setupGlobalFilters(t.pick,t.skip,vt,no),t.tiff===!0?this.batchEnableWithBool(vt,!0):t.tiff===!1?this.batchEnableWithUserValue(vt,t):Array.isArray(t.tiff)?this.setupGlobalFilters(t.tiff,void 0,vt):typeof t.tiff=="object"&&this.setupGlobalFilters(t.tiff.pick,t.tiff.skip,vt)}batchEnableWithBool(t,e){for(let n of t)this[n].enabled=e}batchEnableWithUserValue(t,e){for(let n of t){let r=e[n];this[n].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(t,e,n,r=n){if(t&&t.length){for(let a of r)this[a].enabled=!1;let o=rb(t,n);for(let[a,s]of o)Ul(this[a].pick,s),this[a].enabled=!0}else if(e&&e.length){let o=rb(e,n);for(let[a,s]of o)Ul(this[a].skip,s)}}filterNestedSegmentTags(){let{ifd0:t,exif:e,xmp:n,iptc:r,icc:o}=this;this.makerNote?e.deps.add(37500):e.skip.add(37500),this.userComment?e.deps.add(37510):e.skip.add(37510),n.enabled||t.skip.add(700),r.enabled||t.skip.add(33723),o.enabled||t.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:t,exif:e,gps:n,interop:r}=this;r.needed&&(e.deps.add(40965),t.deps.add(40965)),e.needed&&t.deps.add(34665),n.needed&&t.deps.add(34853),this.tiff.enabled=vt.some(o=>this[o].enabled===!0)||this.makerNote||this.userComment;for(let o of vt)this[o].finalizeFilters()}get onlyTiff(){return!ql.map(t=>this[t].enabled).some(t=>t===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let t of Ia)this[t].enabled&&!vi.has(t)&&wp("segment parser",t)}};function rb(i,t){let e,n,r,o,a=[];for(r of t){for(o of(e=ka.get(r),n=[],e))(i.includes(o[0])||i.includes(o[1]))&&n.push(o[0]);n.length&&a.push([r,n])}return a}function yp(i,t){return i!==void 0?i:t!==void 0?t:void 0}function Ul(i,t){for(let e of t)i.add(e)}je(sr,"default",Yt);var ao=class{constructor(t){je(this,"parsers",{}),je(this,"output",{}),je(this,"errors",[]),je(this,"pushToErrors",e=>this.errors.push(e)),this.options=sr.useCached(t)}read(t){return j(this,null,function*(){this.file=yield function(e,n){return typeof e=="string"?ib(e,n):Sa&&!iP&&e instanceof HTMLImageElement?ib(e.src,n):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new ar(e):Sa&&e instanceof Blob?xp(e,n,"blob",Ea):void Tt("Invalid input argument")}(t,this.options)})}setup(){if(this.fileParser)return;let{file:t}=this,e=t.getUint16(0);for(let[n,r]of $l)if(r.canHandle(t,e))return this.fileParser=new r(this.options,this.file,this.parsers),t[n]=!0;this.file.close&&this.file.close(),Tt("Unknown file format")}parse(){return j(this,null,function*(){let{output:t,errors:e}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),e.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&e.length>0&&(t.errors=e),db(n=t)?void 0:n;var n})}executeParsers(){return j(this,null,function*(){let{output:t}=this;yield this.fileParser.parse();let e=Object.values(this.parsers).map(n=>j(this,null,function*(){let r=yield n.parse();n.assignToOutput(t,r)}));this.options.silentErrors&&(e=e.map(n=>n.catch(this.pushToErrors))),yield Promise.all(e)})}extractThumbnail(){return j(this,null,function*(){this.setup();let{options:t,file:e}=this,n=vi.get("tiff",t);var r;if(e.tiff?r={start:0,type:"tiff"}:e.jpeg&&(r=yield this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let o=yield this.fileParser.ensureSegmentChunk(r),a=this.parsers.tiff=new n(o,t,e),s=yield a.extractThumbnail();return e.close&&e.close(),s})}};function hb(i,t){return j(this,null,function*(){let e=new ao(t);return yield e.read(i),e.parse()})}var oP=Object.freeze({__proto__:null,parse:hb,Exifr:ao,fileParsers:$l,segmentParsers:vi,fileReaders:Da,tagKeys:ka,tagValues:kp,tagRevivers:Tp,createDictionary:pb,extendDictionary:ub,fetchUrlAsArrayBuffer:Hl,readBlobAsArrayBuffer:Ea,chunkedProps:io,otherSegments:ql,segments:Ia,tiffBlocks:vt,segmentsAndBlocks:no,tiffExtractables:ro,inheritables:Gl,allFormatters:oo,Options:sr}),Bn=class{static findPosition(t,e){let n=t.getUint16(e+2)+2,r=typeof this.headerLength=="function"?this.headerLength(t,e,n):this.headerLength,o=e+r,a=n-r;return{offset:e,length:n,headerLength:r,start:o,size:a,end:o+a}}static parse(t,e={}){return new this(t,new sr({[this.type]:e}),t).parse()}normalizeInput(t){return t instanceof ar?t:new ar(t)}constructor(t,e={},n){je(this,"errors",[]),je(this,"raw",new Map),je(this,"handleError",r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)}),this.chunk=this.normalizeInput(t),this.file=n,this.type=this.constructor.type,this.globalOptions=this.options=e,this.localOptions=e[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(t,e){let n=Tp.get(e),r=kp.get(e),o=ka.get(e),a=this.options[e],s=a.reviveValues&&!!n,l=a.translateValues&&!!r,c=a.translateKeys&&!!o,d={};for(let[p,v]of t)s&&n.has(p)?v=n.get(p)(v):l&&r.has(p)&&(v=this.translateValue(v,r.get(p))),c&&o.has(p)&&(p=o.get(p)||p),d[p]=v;return d}translateValue(t,e){return e[t]||e.DEFAULT||t}assignToOutput(t,e){this.assignObjectToOutput(t,this.constructor.type,e)}assignObjectToOutput(t,e,n){if(this.globalOptions.mergeOutput)return Object.assign(t,n);t[e]?Object.assign(t[e],n):t[e]=n}};je(Bn,"headerLength",4),je(Bn,"type",void 0),je(Bn,"multiSegment",!1),je(Bn,"canHandle",()=>!1);function aP(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function sP(i){return i>=224&&i<=239}function lP(i,t,e){for(let[n,r]of vi)if(r.canHandle(i,t,e))return n}var Wl=class extends class{constructor(t,e,n){je(this,"errors",[]),je(this,"ensureSegmentChunk",r=>j(this,null,function*(){let o=r.start,a=r.size||65536;if(this.file.chunked)if(this.file.available(o,a))r.chunk=this.file.subarray(o,a);else try{r.chunk=yield this.file.readChunk(o,a)}catch(s){Tt(`Couldn't read segment: ${JSON.stringify(r)}. ${s.message}`)}else this.file.byteLength>o+a?r.chunk=this.file.subarray(o,a):r.size===void 0?r.chunk=this.file.subarray(o):Tt("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(t),this.options=t,this.file=e,this.parsers=n}injectSegment(t,e){this.options[t].enabled&&this.createParser(t,e)}createParser(t,e){let n=new(vi.get(t))(e,this.options,this.file);return this.parsers[t]=n}createParsers(t){for(let e of t){let{type:n,chunk:r}=e,o=this.options[n];if(o&&o.enabled){let a=this.parsers[n];a&&a.append||a||this.createParser(n,r)}}}readSegments(t){return j(this,null,function*(){let e=t.map(this.ensureSegmentChunk);yield Promise.all(e)})}}{constructor(...t){super(...t),je(this,"appSegments",[]),je(this,"jpegSegments",[]),je(this,"unknownSegments",[])}static canHandle(t,e){return e===65496}parse(){return j(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(t){t===!0?(this.findAll=!0,this.wanted=new Set(vi.keyList())):(t=t===void 0?vi.keyList().filter(e=>this.options[e].enabled):t.filter(e=>this.options[e].enabled&&vi.has(e)),this.findAll=!1,this.remaining=new Set(t),this.wanted=new Set(t)),this.unfinishedMultiSegment=!1}findAppSegments(t=0,e){return j(this,null,function*(){this.setupSegmentFinderArgs(e);let{file:n,findAll:r,wanted:o,remaining:a}=this;if(!r&&this.file.chunked&&(r=Array.from(o).some(s=>{let l=vi.get(s),c=this.options[s];return l.multiSegment&&c.multiSegment}),r&&(yield this.file.readWhole())),t=this.findAppSegmentsInRange(t,n.byteLength),!this.options.onlyTiff&&n.chunked){let s=!1;for(;a.size>0&&!s&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=n,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(s=t>l&&!c?!(yield n.readNextChunk(t)):!(yield n.readNextChunk(l)),(t=this.findAppSegmentsInRange(t,n.byteLength))===void 0)return}}})}findAppSegmentsInRange(t,e){e-=2;let n,r,o,a,s,l,{file:c,findAll:d,wanted:p,remaining:v,options:g}=this;for(;t<e;t++)if(c.getUint8(t)===255){if(n=c.getUint8(t+1),sP(n)){if(r=c.getUint16(t+2),o=lP(c,t,r),o&&p.has(o)&&(a=vi.get(o),s=a.findPosition(c,t),l=g[o],s.type=o,this.appSegments.push(s),!d&&(a.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||v.delete(o)):v.delete(o),v.size===0)))break;g.recordUnknownSegments&&(s=Bn.findPosition(c,t),s.marker=n,this.unknownSegments.push(s)),t+=r+1}else if(aP(n)){if(r=c.getUint16(t+2),n===218&&g.stopAfterSos!==!1)return;g.recordJpegSegments&&this.jpegSegments.push({offset:t,length:r,marker:n}),t+=r+1}}return t}mergeMultiSegments(){if(!this.appSegments.some(e=>e.multiSegment))return;let t=function(e,n){let r,o,a,s=new Map;for(let l=0;l<e.length;l++)r=e[l],o=r[n],s.has(o)?a=s.get(o):s.set(o,a=[]),a.push(r);return Array.from(s)}(this.appSegments,"type");this.mergedAppSegments=t.map(([e,n])=>{let r=vi.get(e,this.options);return r.handleMultiSegments?{type:e,chunk:r.handleMultiSegments(n)}:n[0]})}getSegment(t){return this.appSegments.find(e=>e.type===t)}getOrFindSegment(t){return j(this,null,function*(){let e=this.getSegment(t);return e===void 0&&(yield this.findAppSegments(0,[t]),e=this.getSegment(t)),e})}};je(Wl,"type","jpeg"),$l.set("jpeg",Wl);var cP=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Pp=class extends Bn{parseHeader(){var t=this.chunk.getUint16();t===18761?this.le=!0:t===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(t,e,n=new Map){let{pick:r,skip:o}=this.options[e];r=new Set(r);let a=r.size>0,s=o.size===0,l=this.chunk.getUint16(t);t+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(t);if(a){if(r.has(d)&&(n.set(d,this.parseTag(t,d,e)),r.delete(d),r.size===0))break}else!s&&o.has(d)||n.set(d,this.parseTag(t,d,e));t+=12}return n}parseTag(t,e,n){let{chunk:r}=this,o=r.getUint16(t+2),a=r.getUint32(t+4),s=cP[o];if(s*a<=4?t+=8:t=r.getUint32(t+8),(o<1||o>13)&&Tt(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${e.toString(16)}, type: ${o}, offset ${t}`),t>r.byteLength&&Tt(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${e.toString(16)}, type: ${o}, offset ${t} is outside of chunk size ${r.byteLength}`),o===1)return r.getUint8Array(t,a);if(o===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=r.getString(t,a)).trim())===""?void 0:l;var l;if(o===7)return r.getUint8Array(t,a);if(a===1)return this.parseTagValue(o,t);{let c=new(function(p){switch(p){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}}(o))(a),d=s;for(let p=0;p<a;p++)c[p]=this.parseTagValue(o,t),t+=d;return c}}parseTagValue(t,e){let{chunk:n}=this;switch(t){case 1:return n.getUint8(e);case 3:return n.getUint16(e);case 4:return n.getUint32(e);case 5:return n.getUint32(e)/n.getUint32(e+4);case 6:return n.getInt8(e);case 8:return n.getInt16(e);case 9:return n.getInt32(e);case 10:return n.getInt32(e)/n.getInt32(e+4);case 11:return n.getFloat(e);case 12:return n.getDouble(e);case 13:return n.getUint32(e);default:Tt(`Invalid tiff type ${t}`)}}},Ca=class extends Pp{static canHandle(t,e){return t.getUint8(e+1)===225&&t.getUint32(e+4)===1165519206&&t.getUint16(e+8)===0}parse(){return j(this,null,function*(){this.parseHeader();let{options:t}=this;return t.ifd0.enabled&&(yield this.parseIfd0Block()),t.exif.enabled&&(yield this.safeParse("parseExifBlock")),t.gps.enabled&&(yield this.safeParse("parseGpsBlock")),t.interop.enabled&&(yield this.safeParse("parseInteropBlock")),t.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(t){let e=this[t]();return e.catch!==void 0&&(e=e.catch(this.handleError)),e}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let t=this.chunk.getUint16(this.ifd0Offset),e=this.ifd0Offset+2+12*t;this.ifd1Offset=this.chunk.getUint32(e)}}parseBlock(t,e){let n=new Map;return this[e]=n,this.parseTags(t,e,n),n}parseIfd0Block(){return j(this,null,function*(){if(this.ifd0)return;let{file:t}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Tt("Malformed EXIF data"),!t.chunked&&this.ifd0Offset>t.byteLength&&Tt(`IFD0 offset points to outside of file.
26
- this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${t.byteLength}`),t.tiff&&(yield t.ensureChunk(this.ifd0Offset,eb(this.options)));let e=this.parseBlock(this.ifd0Offset,"ifd0");return e.size!==0?(this.exifOffset=e.get(34665),this.interopOffset=e.get(40965),this.gpsOffset=e.get(34853),this.xmp=e.get(700),this.iptc=e.get(33723),this.icc=e.get(34675),this.options.sanitize&&(e.delete(34665),e.delete(40965),e.delete(34853),e.delete(700),e.delete(33723),e.delete(34675)),e):void 0})}parseExifBlock(){return j(this,null,function*(){if(this.exif||(this.ifd0||(yield this.parseIfd0Block()),this.exifOffset===void 0))return;this.file.tiff&&(yield this.file.ensureChunk(this.exifOffset,eb(this.options)));let t=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=t.get(40965)),this.makerNote=t.get(37500),this.userComment=t.get(37510),this.options.sanitize&&(t.delete(40965),t.delete(37500),t.delete(37510)),this.unpack(t,41728),this.unpack(t,41729),t})}unpack(t,e){let n=t.get(e);n&&n.length===1&&t.set(e,n[0])}parseGpsBlock(){return j(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let t=this.parseBlock(this.gpsOffset,"gps");return t&&t.has(2)&&t.has(4)&&(t.set("latitude",ob(...t.get(2),t.get(1))),t.set("longitude",ob(...t.get(4),t.get(3)))),t})}parseInteropBlock(){return j(this,null,function*(){if(!this.interop&&(this.ifd0||(yield this.parseIfd0Block()),this.interopOffset!==void 0||this.exif||(yield this.parseExifBlock()),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")})}parseThumbnailBlock(t=!1){return j(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||t))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return j(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let t=this.ifd1.get(513),e=this.ifd1.get(514);return this.chunk.getUint8Array(t,e)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let t,e,n,r={};for(e of vt)if(t=this[e],!db(t))if(n=this.canTranslate?this.translateBlock(t,e):Object.fromEntries(t),this.options.mergeOutput){if(e==="ifd1")continue;Object.assign(r,n)}else r[e]=n;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(t,e){if(this.globalOptions.mergeOutput)Object.assign(t,e);else for(let[n,r]of Object.entries(e))this.assignObjectToOutput(t,n,r)}};function ob(i,t,e,n){var r=i+t/60+e/3600;return n!=="S"&&n!=="W"||(r*=-1),r}je(Ca,"type","tiff"),je(Ca,"headerLength",10),vi.set("tiff",Ca);var aL=Object.freeze({__proto__:null,default:oP,Exifr:ao,fileParsers:$l,segmentParsers:vi,fileReaders:Da,tagKeys:ka,tagValues:kp,tagRevivers:Tp,createDictionary:pb,extendDictionary:ub,fetchUrlAsArrayBuffer:Hl,readBlobAsArrayBuffer:Ea,chunkedProps:io,otherSegments:ql,segments:Ia,tiffBlocks:vt,segmentsAndBlocks:no,tiffExtractables:ro,inheritables:Gl,allFormatters:oo,Options:sr,parse:hb}),Mp={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},sL=Object.assign({},Mp,{firstChunkSize:4e4,gps:[1,2,3,4]});var lL=Object.assign({},Mp,{tiff:!1,ifd1:!0,mergeOutput:!1});var dP=Object.assign({},Mp,{firstChunkSize:4e4,ifd0:[274]});function pP(i){return j(this,null,function*(){let t=new ao(dP);yield t.read(i);let e=yield t.parse();if(e&&e.ifd0)return e.ifd0[274]})}var uP=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}}),wa=!0,xa=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let t=i.match(/OS (\d+)_(\d+)/);if(t){let[,e,n]=t;wa=Number(e)+.1*Number(n)<13.4,xa=!1}}else if(i.includes("OS X 10")){let[,t]=i.match(/OS X 10[_.](\d+)/);wa=xa=Number(t)<15}if(i.includes("Chrome/")){let[,t]=i.match(/Chrome\/(\d+)/);wa=xa=Number(t)<81}else if(i.includes("Firefox/")){let[,t]=i.match(/Firefox\/(\d+)/);wa=xa=Number(t)<77}}function mb(i){return j(this,null,function*(){let t=yield pP(i);return Object.assign({canvas:wa,css:xa},uP[t])})}var Ep=class extends ar{constructor(...t){super(...t),je(this,"ranges",new Ip),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(t,e,n){if(t===0&&this.byteLength===0&&n){let r=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(r)}else{let r=t+e;if(r>this.byteLength){let{dataView:o}=this._extend(r);this._swapDataView(o)}}}_extend(t){let e;e=cb?lb.allocUnsafe(t):new Uint8Array(t);let n=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:e,dataView:n}}subarray(t,e,n=!1){return e=e||this._lengthToEnd(t),n&&this._tryExtend(t,e),this.ranges.add(t,e),super.subarray(t,e)}set(t,e,n=!1){n&&this._tryExtend(e,t.byteLength,t);let r=super.set(t,e);return this.ranges.add(e,r.byteLength),r}ensureChunk(t,e){return j(this,null,function*(){this.chunked&&(this.ranges.available(t,e)||(yield this.readChunk(t,e)))})}available(t,e){return this.ranges.available(t,e)}},Ip=class{constructor(){je(this,"list",[])}get length(){return this.list.length}add(t,e,n=0){let r=t+e,o=this.list.filter(a=>ab(t,a.offset,r)||ab(t,a.end,r));if(o.length>0){t=Math.min(t,...o.map(s=>s.offset)),r=Math.max(r,...o.map(s=>s.end)),e=r-t;let a=o.shift();a.offset=t,a.length=e,a.end=r,this.list=this.list.filter(s=>!o.includes(s))}else this.list.push({offset:t,length:e,end:r})}available(t,e){let n=t+e;return this.list.some(r=>r.offset<=t&&n<=r.end)}};function ab(i,t,e){return i<=t&&t<=e}var Dp=class extends Ep{constructor(t,e){super(0),je(this,"chunksRead",0),this.input=t,this.options=e}readWhole(){return j(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return j(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return j(this,arguments,function*(t=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let e=this.options.chunkSize,n=yield this.readChunk(t,e);return!!n&&n.byteLength===e})}readChunk(t,e){return j(this,null,function*(){if(this.chunksRead++,(e=this.safeWrapAddress(t,e))!==0)return this._readChunk(t,e)})}safeWrapAddress(t,e){return this.size!==void 0&&t+e>this.size?Math.max(0,this.size-t):e}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(){}};Da.set("blob",class extends Dp{readWhole(){return j(this,null,function*(){this.chunked=!1;let i=yield Ea(this.input);this._swapArrayBuffer(i)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(i,t){return j(this,null,function*(){let e=t?i+t:void 0,n=this.input.slice(i,e),r=yield Ea(n);return this.set(r,i,!0)})}});var fb={strings:{generatingThumbnails:"Generating thumbnails..."}};var hP={version:"4.1.1"};function mP(i,t,e){try{i.getContext("2d").getImageData(0,0,1,1)}catch(n){if(n.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(n=>{i.toBlob(n,t,e)}).then(n=>{if(n===null)throw new Error("cannot read image, probably an svg with external resources");return n}):Promise.resolve().then(()=>Z0(i.toDataURL(t,e),{})).then(n=>{if(n===null)throw new Error("could not extract blob, probably an old browser");return n})}function fP(i,t){let e=i.width,n=i.height;(t.deg===90||t.deg===270)&&(e=i.height,n=i.width);let r=document.createElement("canvas");r.width=e,r.height=n;let o=r.getContext("2d");return o.translate(e/2,n/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),r}function gP(i){let t=i.width/i.height,e=5e6,n=4096,r=Math.floor(Math.sqrt(e*t)),o=Math.floor(e/Math.sqrt(e*t));if(r>n&&(r=n,o=Math.round(r/t)),o>n&&(o=n,r=Math.round(t*o)),i.width>r){let a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(i,0,0,r,o),a}return i}var bP={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},so=class extends fi{constructor(t,e){if(super(t,_(_({},bP),e)),this.onFileAdded=n=>{!n.preview&&n.data&&jl(n.type)&&!n.isRemote&&this.addToQueue(n.id)},this.onCancelRequest=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1),n.preview&&Ll(n.preview)&&URL.revokeObjectURL(n.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||Ll(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=n=>{n.forEach(o=>{let a=this.uppy.getFile(o);this.uppy.emit("preprocess-progress",a,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let r=()=>{n.forEach(o=>{let a=this.uppy.getFile(o);this.uppy.emit("preprocess-complete",a)})};return new Promise(o=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{r(),o()}):(r(),o())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=fb,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(t,e,n){let r=URL.createObjectURL(t.data),o=new Promise((s,l)=>{let c=new Image;c.src=r,c.addEventListener("load",()=>{URL.revokeObjectURL(r),s(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(r),l(d.error||new Error("Could not create thumbnail"))})}),a=mb(t.data).catch(()=>1);return Promise.all([o,a]).then(s=>{let[l,c]=s,d=this.getProportionalDimensions(l,e,n,c.deg),p=fP(l,c),v=this.resizeImage(p,d.width,d.height);return mP(v,this.thumbnailType,80)}).then(s=>URL.createObjectURL(s))}getProportionalDimensions(t,e,n,r){let o=t.width/t.height;return(r===90||r===270)&&(o=t.height/t.width),e!=null?{width:e,height:Math.round(e/o)}:n!=null?{width:Math.round(n*o),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}}resizeImage(t,e,n){let r=gP(t),o=Math.ceil(Math.log2(r.width/e));o<1&&(o=1);let a=e*2**(o-1),s=n*2**(o-1),l=2;for(;o--;){let c=document.createElement("canvas");c.width=a,c.height=s,c.getContext("2d").drawImage(r,0,0,a,s),r=c,a=Math.round(a/l),s=Math.round(s/l)}return r}setPreviewURL(t,e){this.uppy.setFileState(t,{preview:e})}addToQueue(t){this.queue.push(t),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let t=this.uppy.getFile(this.queue.shift());return t?this.requestThumbnail(t).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(t){return jl(t.type)&&!t.isRemote?this.createThumbnail(t,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(e=>{this.setPreviewURL(t.id,e),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${t.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(t.id),e)}).catch(e=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${t.id}:`,"warning"),this.uppy.log(e,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(t.id),e)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};so.VERSION=hP.version;function vP(i){if(typeof i=="string"){let t=document.querySelectorAll(i);return t.length===0?null:Array.from(t)}return typeof i=="object"&&ga(i)?[i]:null}var Op=vP;var Qi=Array.from;function Yl(i,t,e,n){let{onSuccess:r}=n;i.readEntries(o=>{let a=[...t,...o];o.length?queueMicrotask(()=>{Yl(i,a,e,{onSuccess:r})}):r(a)},o=>{e(o),r(t)})}function gb(i,t){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((n,r)=>i.file(n,r))},values(){return cs(this,null,function*(){let n=i.createReader(),r=yield new Sr(new Promise(o=>{Yl(n,[],t,{onSuccess:a=>o(a.map(s=>gb(s,t)))})}));yield*ds(r)})},isSameEntry:void 0}}function bb(i,t,e){try{return e===void 0&&(e=void 0),function(){return cs(this,null,function*(){let n=()=>`${t}/${i.name}`;if(i.kind==="file"){let l=yield new Sr(i.getFile());l!=null?(l.relativePath=t?n():null,yield l):e!=null&&(yield e)}else if(i.kind==="directory")try{for(var r=ps(i.values()),o,a,s;o=!(a=yield new Sr(r.next())).done;o=!1){let l=a.value;yield*ds(bb(l,t?n():i.name))}}catch{s=[a]}finally{try{o&&(a=r.return)&&(yield new Sr(a.call(r)))}finally{if(s)throw s[0]}}else e!=null&&(yield e)})}()}catch(n){return Promise.reject(n)}}function Fp(i,t){return cs(this,null,function*(){let e=yield new Sr(Promise.all(Array.from(i.items,n=>j(this,null,function*(){var r;let o,a=()=>typeof n.getAsEntry=="function"?n.getAsEntry():n.webkitGetAsEntry();return(r=o)!=null||(o=gb(a(),t)),{fileSystemHandle:o,lastResortFile:n.getAsFile()}}))));for(let{lastResortFile:n,fileSystemHandle:r}of e)if(r!=null)try{yield*ds(bb(r,"",n))}catch(o){n!=null?yield n:t(o)}else n!=null&&(yield n)})}function Ap(i){let t=Qi(i.files);return Promise.resolve(t)}function Ta(i,t){return j(this,null,function*(){var e;let n=(e=t?.logDropError)!=null?e:Function.prototype;try{let l=[];try{for(var r=ps(Fp(i,n)),o,a,s;o=!(a=yield r.next()).done;o=!1){let c=a.value;l.push(c)}}catch{s=[a]}finally{try{o&&(a=r.return)&&(yield a.call(r))}finally{if(s)throw s[0]}}return l}catch{return Ap(i)}})}var Gb=Ne(Gt(),1);function Ma(i){return k(_({},i),{type:i.mimeType,extension:i.name?Xi(i.name).extension:null})}var Oa,dt,Rp,vb,Fa=0,Eb=[],_t=Xe,_b=_t.__b,yb=_t.__r,wb=_t.diffed,xb=_t.__c,Cb=_t.unmount,Sb=_t.__;function Np(i,t){_t.__h&&_t.__h(dt,i,Fa||t),Fa=0;var e=dt.__H||(dt.__H={__:[],__h:[]});return i>=e.__.length&&e.__.push({}),e.__[i]}function ji(i){return Fa=1,_P(Db,i)}function _P(i,t,e){var n=Np(Oa++,2);if(n.t=i,!n.__c&&(n.__=[e?e(t):Db(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=dt,!dt.u)){var r=function(s,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(v){return!!v.__c});if(d.every(function(v){return!v.__N}))return!o||o.call(this,s,l,c);var p=n.__c.props!==s;return d.forEach(function(v){if(v.__N){var g=v.__[0];v.__=v.__N,v.__N=void 0,g!==v.__[0]&&(p=!0)}}),o&&o.call(this,s,l,c)||p};dt.u=!0;var o=dt.shouldComponentUpdate,a=dt.componentWillUpdate;dt.componentWillUpdate=function(s,l,c){if(this.__e){var d=o;o=void 0,r(s,l,c),o=d}a&&a.call(this,s,l,c)},dt.shouldComponentUpdate=r}return n.__N||n.__}function Zi(i,t){var e=Np(Oa++,3);!_t.__s&&Ib(e.__H,t)&&(e.__=i,e.i=t,dt.__H.__h.push(e))}function lr(i){return Fa=5,cr(function(){return{current:i}},[])}function cr(i,t){var e=Np(Oa++,7);return Ib(e.__H,t)&&(e.__=i(),e.__H=t,e.__h=i),e.__}function dr(i,t){return Fa=8,cr(function(){return i},t)}function yP(){for(var i;i=Eb.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Xl),i.__H.__h.forEach(Bp),i.__H.__h=[]}catch(t){i.__H.__h=[],_t.__e(t,i.__v)}}_t.__b=function(i){dt=null,_b&&_b(i)},_t.__=function(i,t){i&&t.__k&&t.__k.__m&&(i.__m=t.__k.__m),Sb&&Sb(i,t)},_t.__r=function(i){yb&&yb(i),Oa=0;var t=(dt=i.__c).__H;t&&(Rp===dt?(t.__h=[],dt.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(Xl),t.__h.forEach(Bp),t.__h=[],Oa=0)),Rp=dt},_t.diffed=function(i){wb&&wb(i);var t=i.__c;t&&t.__H&&(t.__H.__h.length&&(Eb.push(t)!==1&&vb===_t.requestAnimationFrame||((vb=_t.requestAnimationFrame)||wP)(yP)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),Rp=dt=null},_t.__c=function(i,t){t.some(function(e){try{e.__h.forEach(Xl),e.__h=e.__h.filter(function(n){return!n.__||Bp(n)})}catch(n){t.some(function(r){r.__h&&(r.__h=[])}),t=[],_t.__e(n,e.__v)}}),xb&&xb(i,t)},_t.unmount=function(i){Cb&&Cb(i);var t,e=i.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{Xl(n)}catch(r){t=r}}),e.__H=void 0,t&&_t.__e(t,e.__v))};var Pb=typeof requestAnimationFrame=="function";function wP(i){var t,e=function(){clearTimeout(n),Pb&&cancelAnimationFrame(t),setTimeout(i)},n=setTimeout(e,100);Pb&&(t=requestAnimationFrame(e))}function Xl(i){var t=dt,e=i.__c;typeof e=="function"&&(i.__c=void 0,e()),dt=t}function Bp(i){var t=dt;i.__c=i.__(),dt=t}function Ib(i,t){return!i||i.length!==t.length||t.some(function(e,n){return e!==i[n]})}function Db(i,t){return typeof t=="function"?t(i):t}function xP(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),u("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),u("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),u("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),u("path",{d:"M4 4h18v18H4z"})))}function CP(i){let{pluginName:t,i18n:e,onAuth:n}=i,r=t==="Google Drive",o=dr(a=>{a.preventDefault(),n()},[n]);return u("form",{onSubmit:o},r?u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},u(xP,null),e("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},e("authenticateWith",{pluginName:t})))}var SP=i=>{let{pluginName:t,i18n:e,onAuth:n}=i;return u(CP,{pluginName:t,i18n:e,onAuth:n})};function Kl(i){let{loading:t,pluginName:e,pluginIcon:n,i18n:r,handleAuth:o,renderForm:a=SP}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},n()),u("div",{className:"uppy-Provider-authTitle"},r("authenticateWithTitle",{pluginName:e})),a({pluginName:e,i18n:r,loading:t,onAuth:o}))}var kb=Ne(Gt(),1);function zp(i){let{i18n:t,logout:e,username:n}=i;return u(mi,null,n&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},n),u("button",{type:"button",onClick:e,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},t("logOut")))}function Lp(i){let{openFolder:t,title:e,breadcrumbsIcon:n,breadcrumbs:r,i18n:o}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},n),r.map((a,s)=>{var l;return u(mi,null,u("button",{key:a.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(a.id)},a.type==="root"?e:(l=a.data.name)!=null?l:o("unnamed")),r.length===s+1?"":" / ")}))}function jp(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,kb.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(Lp,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(zp,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Hp(){return Hp=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Hp.apply(null,arguments)}var PP={position:"relative",width:"100%",minHeight:"100%"},EP={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Vp=class extends ni{constructor(t){super(t),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:t}=this.state;t!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(t){let E=t,{data:e,rowHeight:n,renderRow:r,overscanCount:o=10}=E,a=Cr(E,["data","rowHeight","renderRow","overscanCount"]),{offset:s,height:l}=this.state,c=Math.floor(s/n),d=Math.floor(l/n);o&&(c=Math.max(0,c-c%o),d+=o);let p=c+d+4,v=e.slice(c,p),g=k(_({},PP),{height:e.length*n}),w=k(_({},EP),{top:c*n});return u("div",Hp({onScroll:this.handleScroll},a),u("div",{role:"presentation",style:g},u("div",{role:"presentation",style:w},v.map(r))))}},Ql=Vp;var Tb=Ne(Gt(),1);function IP(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function DP(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function kP(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),u("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function lo(i){let{itemIconString:t,alt:e=void 0}=i;if(t===null)return null;switch(t){case"file":return u(IP,null);case"folder":return u(DP,null);case"video":return u(kP,null);default:return u("img",{src:t,alt:e,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function TP(i){var t,e;let{file:n,toggleCheckbox:r,className:o,isDisabled:a,restrictionError:s,showTitles:l,children:c=null,i18n:d}=i;return u("li",{className:o,title:a&&s?s:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:r,name:"listitem",id:n.id,checked:n.status==="checked",disabled:a,"data-uppy-super-focusable":!0}),u("label",{htmlFor:n.id,"aria-label":(t=n.data.name)!=null?t:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(lo,{itemIconString:n.data.thumbnail||n.data.icon}),l&&((e=n.data.name)!=null?e:d("unnamed")),c))}var Up=TP;function Wp(i){var t,e,n;let{file:r,openFolder:o,className:a,isDisabled:s,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:p}=i;return u("li",{className:a,title:r.status!=="checked"&&l?l:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:r.id,checked:r.status==="checked","aria-label":r.data.isFolder?p("allFilesFromFolderNamed",{name:(t=r.data.name)!=null?t:p("unnamed")}):null,disabled:s,"data-uppy-super-focusable":!0}),r.data.isFolder?u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>o(r.id),"aria-label":p("openFolderNamed",{name:(e=r.data.name)!=null?e:p("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(lo,{itemIconString:r.data.icon})),d&&r.data.name?u("span",null,r.data.name):p("unnamed")):u("label",{htmlFor:r.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(lo,{itemIconString:r.data.icon})),d&&((n=r.data.name)!=null?n:p("unnamed"))))}function $p(i){let{viewType:t,toggleCheckbox:e,showTitles:n,i18n:r,openFolder:o,file:a,utmSource:s}=i,l=a.type==="folder"?null:a.restrictionError,c=!!l&&a.status!=="checked",d={file:a,openFolder:o,toggleCheckbox:e,utmSource:s,i18n:r,viewType:t,showTitles:n,className:(0,Tb.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":c},{"uppy-ProviderBrowserItem--noPreview":a.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":a.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":a.status==="partial"}),isDisabled:c,restrictionError:l};switch(t){case"grid":return u(Up,d);case"list":return u(Wp,d);case"unsplash":return u(Up,d,u("a",{href:`${a.data.author.url}?utm_source=${s}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},a.data.author.name));default:throw new Error(`There is no such type ${t}`)}}function MP(i){let{displayedPartialTree:t,viewType:e,toggleCheckbox:n,handleScroll:r,showTitles:o,i18n:a,isLoading:s,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:p}=i,[v,g]=ji(!1);if(Zi(()=>{let E=F=>{F.key==="Shift"&&g(!1)},L=F=>{F.key==="Shift"&&g(!0)};return document.addEventListener("keyup",E),document.addEventListener("keydown",L),()=>{document.removeEventListener("keyup",E),document.removeEventListener("keydown",L)}},[]),s)return u("div",{className:"uppy-Provider-loading"},typeof s=="string"?s:a("loading"));if(t.length===0)return u("div",{className:"uppy-Provider-empty"},c);let w=E=>u($p,{viewType:e,toggleCheckbox:L=>{var F;L.stopPropagation(),L.preventDefault(),(F=document.getSelection())==null||F.removeAllRanges(),n(E,v)},showTitles:o,i18n:a,openFolder:l,file:E,utmSource:p});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(Ql,{data:t,renderRow:w,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,role:"listbox",tabIndex:-1},t.map(w)))}var Zl=MP;var OP=(i,t,e,n,r)=>{let o=t.filter(g=>g.isFolder===!0),a=t.filter(g=>g.isFolder===!1),s=e.type==="folder"&&e.status==="checked",l=o.map(g=>({type:"folder",id:g.requestPath,cached:!1,nextPagePath:null,status:s?"checked":"unchecked",parentId:e.id,data:g})),c=a.map(g=>{let w=r(g);return{type:"file",id:g.requestPath,restrictionError:w,status:s&&!w?"checked":"unchecked",parentId:e.id,data:g}}),d=k(_({},e),{cached:!0,nextPagePath:n});return[...i.map(g=>g.id===d.id?d:g),...l,...c]},Mb=OP;var FP=(i,t,e,n,r)=>{let o=i.find(w=>w.id===t),a=e.filter(w=>w.isFolder===!0),s=e.filter(w=>w.isFolder===!1),l=k(_({},o),{nextPagePath:n}),c=i.map(w=>w.id===l.id?l:w),d=l.type==="folder"&&l.status==="checked",p=a.map(w=>({type:"folder",id:w.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:w})),v=s.map(w=>{let E=r(w);return{type:"file",id:w.requestPath,restrictionError:E,status:d&&!E?"checked":"unchecked",parentId:l.id,data:w}});return[...c,...p,...v]},Ob=FP;var AP=i=>i.map(t=>_({},t)),Jl=AP;var qp=(i,t,e)=>{i.filter(r=>r.type!=="root"&&r.parentId===t).forEach(r=>{r.status=e&&!(r.type==="file"&&r.restrictionError)?"checked":"unchecked",qp(i,r.id,e)})},Gp=(i,t)=>{let e=i.find(a=>a.id===t);if(e.type==="root")return;let n=i.filter(a=>a.type!=="root"&&a.parentId===e.id&&!(a.type==="file"&&a.restrictionError)),r=n.every(a=>a.status==="checked"),o=n.every(a=>a.status==="unchecked");r?e.status="checked":o?e.status="unchecked":e.status="partial",Gp(i,e.parentId)},RP=(i,t)=>{let e=Jl(i);if(t.length>=2){let n=e.filter(r=>r.type!=="root"&&t.includes(r.id));n.forEach(r=>{r.type==="file"?r.status=r.restrictionError?"unchecked":"checked":r.status="checked"}),n.forEach(r=>{qp(e,r.id,!0)}),Gp(e,n[0].parentId)}else{let n=e.find(r=>r.id===t[0]);n.status=n.status==="checked"?"unchecked":"checked",qp(e,n.id,n.status==="checked"),Gp(e,n.parentId)}return e},Fb=RP;var Xp=Ne(Rb(),1);var Ra=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},Kp=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},Bb=i=>globalThis.DOMException===void 0?new Kp(i):new DOMException(i),Nb=i=>{let t=i.reason===void 0?Bb("This operation was aborted."):i.reason;return t instanceof Error?t:Bb(t)};function Qp(i,t){let{milliseconds:e,fallback:n,message:r,customTimers:o={setTimeout,clearTimeout}}=t,a,s,c=new Promise((d,p)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(t.signal){let{signal:g}=t;g.aborted&&p(Nb(g)),s=()=>{p(Nb(g))},g.addEventListener("abort",s,{once:!0})}if(e===Number.POSITIVE_INFINITY){i.then(d,p);return}let v=new Ra;a=o.setTimeout.call(void 0,()=>{if(n){try{d(n())}catch(g){p(g)}return}typeof i.cancel=="function"&&i.cancel(),r===!1?d():r instanceof Error?p(r):(v.message=r??`Promise timed out after ${e} milliseconds`,p(v))},e),j(this,null,function*(){try{d(yield i)}catch(g){p(g)}})}).finally(()=>{c.clear(),s&&t.signal&&t.signal.removeEventListener("abort",s)});return c.clear=()=>{o.clearTimeout.call(void 0,a),a=void 0},c}function Zp(i,t,e){let n=0,r=i.length;for(;r>0;){let o=Math.trunc(r/2),a=n+o;e(i[a],t)<=0?(n=++a,r-=o+1):r=o}return n}var tc=class{#e=[];enqueue(t,e){e=_({priority:0},e);let n={priority:e.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=e.priority){this.#e.push(n);return}let r=Zp(this.#e,n,(o,a)=>a.priority-o.priority);this.#e.splice(r,0,n)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(e=>e.priority===t.priority).map(e=>e.run)}get size(){return this.#e.length}};var ic=class extends Xp.default{#e;#a;#o=0;#h;#s;#m=0;#i;#l;#t;#f;#n=0;#c;#r;#g;timeout;constructor(t){if(super(),t=_({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:tc},t),!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#a=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#h=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#f=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#g=t.throwOnTimeout===!0,this.#r=t.autoStart===!1}get#_(){return this.#a||this.#o<this.#h}get#y(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#x(){this.#v(),this.#b(),this.#l=void 0}get#C(){let t=Date.now();if(this.#i===void 0){let e=this.#m-t;if(e<0)this.#o=this.#e?this.#n:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#x()},e)),!0}return!1}#d(){if(this.#t.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#r){let t=!this.#C;if(this.#_&&this.#y){let e=this.#t.dequeue();return e?(this.emit("active"),e(),t&&this.#b(),!0):!1}}return!1}#b(){this.#a||this.#i!==void 0||(this.#i=setInterval(()=>{this.#v()},this.#s),this.#m=Date.now()+this.#s)}#v(){this.#o===0&&this.#n===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#o=this.#e?this.#n:0,this.#p()}#p(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#c=t,this.#p()}#S(t){return j(this,null,function*(){return new Promise((e,n)=>{t.addEventListener("abort",()=>{n(t.reason)},{once:!0})})})}add(n){return j(this,arguments,function*(t,e={}){return e=_({timeout:this.timeout,throwOnTimeout:this.#g},e),new Promise((r,o)=>{this.#t.enqueue(()=>j(this,null,function*(){this.#n++,this.#o++;try{e.signal?.throwIfAborted();let a=t({signal:e.signal});e.timeout&&(a=Qp(Promise.resolve(a),{milliseconds:e.timeout})),e.signal&&(a=Promise.race([a,this.#S(e.signal)]));let s=yield a;r(s),this.emit("completed",s)}catch(a){if(a instanceof Ra&&!e.throwOnTimeout){r();return}o(a),this.emit("error",a)}finally{this.#w()}}),e),this.emit("add"),this.#d()})})}addAll(t,e){return j(this,null,function*(){return Promise.all(t.map(n=>j(this,null,function*(){return this.add(n,e)})))})}start(){return this.#r?(this.#r=!1,this.#p(),this):this}pause(){this.#r=!0}clear(){this.#t=new this.#f}onEmpty(){return j(this,null,function*(){this.#t.size!==0&&(yield this.#u("empty"))})}onSizeLessThan(t){return j(this,null,function*(){this.#t.size<t||(yield this.#u("next",()=>this.#t.size<t))})}onIdle(){return j(this,null,function*(){this.#n===0&&this.#t.size===0||(yield this.#u("idle"))})}#u(t,e){return j(this,null,function*(){return new Promise(n=>{let r=()=>{e&&!e()||(this.off(t,r),n())};this.on(t,r)})})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#n}get isPaused(){return this.#r}};var zb=(i,t,e,n,r)=>j(void 0,null,function*(){let o=[],a=e.cached?e.nextPagePath:e.id;for(;a;){let p=yield n(a);o=o.concat(p.items),a=p.nextPagePath}let s=o.filter(p=>p.isFolder===!0),l=o.filter(p=>p.isFolder===!1),c=s.map(p=>({type:"folder",id:p.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:e.id,data:p})),d=l.map(p=>{let v=r(p);return{type:"file",id:p.requestPath,restrictionError:v,status:v?"unchecked":"checked",parentId:e.id,data:p}});e.cached=!0,e.nextPagePath=null,t.push(...d,...c),c.forEach(p=>j(void 0,null,function*(){i.add(()=>zb(i,t,p,n,r))}))}),zP=(i,t,e,n)=>j(void 0,null,function*(){let r=new ic({concurrency:6}),o=Jl(i);return o.filter(s=>s.type==="folder"&&s.status==="checked"&&(s.cached===!1||s.nextPagePath)).forEach(s=>{r.add(()=>zb(r,o,s,t,e))}),r.on("completed",()=>{let s=o.filter(l=>l.type==="file"&&l.status==="checked").length;n(s)}),yield r.onIdle(),o}),Lb=zP;var pr={afterOpenFolder:Mb,afterScrollFolder:Ob,afterToggleCheckbox:Fb,afterFill:Lb};var LP=i=>{let{scrollHeight:t,scrollTop:e,offsetHeight:n}=i.target;return t-(e+n)<50},nc=LP;var jP=i=>t=>{if(!t.isAuthError){if(t.name==="AbortError"){i.log("Aborting request","warning");return}i.log(t,"error"),t.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(t.message)},"warning",5e3)}},_n=jP;var HP=(i,t,e,n)=>{let r=t.findIndex(o=>o.id===n);if(r!==-1&&e){let o=t.findIndex(s=>s.id===i);return t.slice(Math.min(r,o),Math.max(r,o)+1).map(s=>s.id)}return[i]},rc=HP;function VP(i){let{searchString:t,setSearchString:e,submitSearchString:n,wrapperClassName:r,inputClassName:o,inputLabel:a,clearSearchLabel:s="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,p=w=>{e(w.target.value)},v=dr(w=>{w.preventDefault(),n()},[n]),[g]=ji(()=>{let w=document.createElement("form");return w.setAttribute("tabindex","-1"),w.id=Rn(),w});return Zi(()=>(document.body.appendChild(g),g.addEventListener("submit",v),()=>{g.removeEventListener("submit",v),document.body.removeChild(g)}),[g,v]),u("section",{className:r},u("input",{className:`uppy-u-reset ${o}`,type:"search","aria-label":a,placeholder:a,value:t,onInput:p,form:g.id,"data-uppy-super-focusable":!0}),!l&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&t&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":s,title:s,onClick:()=>e("")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:g.id},c))}var co=VP;var Hb=Ne(Gt(),1);var UP=i=>i.filter(e=>e.type==="file"&&e.status==="checked"?!0:e.type==="folder"&&e.status==="checked"?!i.some(r=>r.type!=="root"&&r.parentId===e.id):!1).length,jb=UP;function Ba(i){let{cancelSelection:t,donePicking:e,i18n:n,partialTree:r,validateAggregateRestrictions:o}=i,a=cr(()=>o(r),[r,o]),s=cr(()=>jb(r),[r]);return s===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,Hb.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":a}),disabled:!!a,onClick:e,type:"button"},n("selectX",{smart_count:s})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:t,type:"button"},n("cancel"))),a&&u("div",{className:"uppy-ProviderBrowser-footer-error"},a))}var WP=(i,t,e)=>{var n,r;return{id:i.id,source:t.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(n=i.author)==null?void 0:n.name,authorUrl:(r=i.author)==null?void 0:r.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:t.opts.companionUrl,url:`${e.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:e.name,provider:e.provider,requestClientId:e.provider}}},Vb=WP;var $P=(i,t,e)=>{let n=i.map(a=>Vb(a,t,e)),r=[],o=[];n.forEach(a=>{t.uppy.checkIfFileAlreadyExists(Pl(a,t.uppy.getID()))?o.push(a):r.push(a)}),r.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:r.length})),o.length>0&&t.uppy.info(`Not adding ${o.length} files because they already exist`),t.uppy.addFiles(r)},oc=$P;var Ub=(i,t,e)=>{let n=t===null?"null":t;if(e[n])return e[n];let r=i.find(a=>a.id===t);if(r.type==="root")return[];let o=[...Ub(i,r.parentId,e),r];return e[n]=o,o},qP=i=>{let t=Object.create(null);return i.filter(r=>r.type==="file"&&r.status==="checked").map(r=>{let o=Ub(i,r.id,t),a=o.findIndex(d=>d.type==="folder"&&d.status==="checked"),s=o.slice(a),l=`/${o.map(d=>d.data.name).join("/")}`,c=s.length===1?void 0:s.map(d=>d.data.name).join("/");return k(_({},r.data),{absDirPath:l,relDirPath:c})})},ac=qP;var GP=(i,t)=>{let e=i.find(r=>r.id===t),n=[];for(;n=[e,...n],e.type!=="root";){let r=e.parentId;e=i.find(o=>o.id===r)}return n},Wb=GP;function Nn(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var YP=0;function qb(i){return"__private_"+YP+++"_"+i}var XP={version:"4.4.1"};function za(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var $b=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),ur=qb("abortController"),Hi=qb("withAbort"),Na=class{constructor(t,e){Object.defineProperty(this,Hi,{value:KP}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,ur,{writable:!0,value:void 0}),this.validateSingleFile=r=>{let o=Ma(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r,currentFolderId:o,searchString:a}=this.plugin.getPluginState(),s=r.filter(c=>c.type!=="root"&&c.parentId===o);return a===""?s:s.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(a.toLowerCase())!==-1})},this.validateAggregateRestrictions=r=>{let a=r.filter(s=>s.type==="file"&&s.status==="checked").map(s=>s.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=t,this.provider=e.provider;let n={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=_(_({},n),e),this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState($b(this.plugin.rootFolderId))}tearDown(){}setLoading(t){this.plugin.setPluginState({loading:t})}cancelSelection(){let{partialTree:t}=this.plugin.getPluginState(),e=t.map(n=>n.type==="root"?n:k(_({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:e})}openFolder(t){return j(this,null,function*(){this.lastCheckbox=null;let{partialTree:e}=this.plugin.getPluginState(),n=e.find(r=>r.id===t);if(n.cached){this.plugin.setPluginState({currentFolderId:t,searchString:""});return}this.setLoading(!0),yield Nn(this,Hi)[Hi](r=>j(this,null,function*(){let o=t,a=[];do{let{username:l,nextPagePath:c,items:d}=yield this.provider.list(o,{signal:r});this.plugin.setPluginState({username:l}),o=c,a=a.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:a.length}))}while(this.opts.loadAllFiles&&o);let s=pr.afterOpenFolder(e,a,n,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:s,currentFolderId:t,searchString:""})})).catch(_n(this.plugin.uppy)),this.setLoading(!1)})}logout(){return j(this,null,function*(){yield Nn(this,Hi)[Hi](t=>j(this,null,function*(){let e=yield this.provider.logout({signal:t});if(e.ok){if(!e.revoked){let n=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:e.manual_revoke_url});this.plugin.uppy.info(n,"info",7e3)}this.plugin.setPluginState(k(_({},$b(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(_n(this.plugin.uppy))})}handleAuth(t){return j(this,null,function*(){yield Nn(this,Hi)[Hi](e=>j(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:t,signal:e}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(_n(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(t){return j(this,null,function*(){let{partialTree:e,currentFolderId:n}=this.plugin.getPluginState(),r=e.find(o=>o.id===n);nc(t)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,yield Nn(this,Hi)[Hi](o=>j(this,null,function*(){let{nextPagePath:a,items:s}=yield this.provider.list(r.nextPagePath,{signal:o}),l=pr.afterScrollFolder(e,n,s,a,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(_n(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return j(this,null,function*(){let{partialTree:t}=this.plugin.getPluginState();this.setLoading(!0),yield Nn(this,Hi)[Hi](e=>j(this,null,function*(){let n=yield pr.afterFill(t,a=>this.provider.list(a,{signal:e}),this.validateSingleFile,a=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:a}))});if(this.validateAggregateRestrictions(n)){this.plugin.setPluginState({partialTree:n});return}let o=ac(n);oc(o,this.plugin,this.provider),this.resetPluginState()})).catch(_n(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(t,e){let{partialTree:n}=this.plugin.getPluginState(),r=rc(t.id,this.getDisplayedPartialTree(),e,this.lastCheckbox),o=pr.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=t.id}render(t,e){e===void 0&&(e={});let{didFirstRender:n}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;n||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let o=_(_({},this.opts),e),{authenticated:a,loading:s}=this.plugin.getPluginState(),l=this.plugin.icon||za;if(a===!1)return u(Kl,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:o.renderAuthForm,loading:s});let{partialTree:c,currentFolderId:d,username:p,searchString:v}=this.plugin.getPluginState(),g=Wb(c,d);return u("div",{className:(0,Gb.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`)},u(jp,{showBreadcrumbs:o.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:g,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:p,i18n:r}),o.showFilter&&u(co,{searchString:v,setSearchString:w=>{this.plugin.setPluginState({searchString:w})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Zl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:o.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:o.viewType,showTitles:o.showTitles,i18n:this.plugin.uppy.i18n,isLoading:s,utmSource:"Companion"}),u(Ba,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function KP(i){return j(this,null,function*(){var t;(t=Nn(this,ur)[ur])==null||t.abort();let e=new AbortController;Nn(this,ur)[ur]=e;let n=()=>{e.abort()};try{this.plugin.uppy.on("dashboard:close-panel",n),this.plugin.uppy.on("cancel-all",n),yield i(e.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",n),this.plugin.uppy.off("cancel-all",n),Nn(this,ur)[ur]=void 0}})}Na.VERSION=XP.version;var Yb=Ne(Gt(),1);var QP={version:"4.4.1"},ZP={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},JP={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},po=class{constructor(t,e){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=n=>{let r=Ma(n);return this.plugin.uppy.validateSingleFile(r)},this.getDisplayedPartialTree=()=>{let{partialTree:n}=this.plugin.getPluginState();return n.filter(r=>r.type!=="root")},this.setSearchString=n=>{this.plugin.setPluginState({searchString:n}),n===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=n=>{let o=n.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=t,this.provider=e.provider,this.opts=_(_({},JP),e),this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(t){this.plugin.setPluginState({loading:t})}resetPluginState(){this.plugin.setPluginState(ZP)}cancelSelection(){let{partialTree:t}=this.plugin.getPluginState(),e=t.map(n=>n.type==="root"?n:k(_({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:e})}search(){return j(this,null,function*(){let{searchString:t}=this.plugin.getPluginState();if(t!==""){this.setLoading(!0);try{let e=yield this.provider.search(t),n=[{type:"root",id:null,cached:!1,nextPagePath:e.nextPageQuery},...e.items.map(r=>({type:"file",id:r.requestPath,status:"unchecked",parentId:null,data:r}))];this.plugin.setPluginState({partialTree:n,isInputMode:!1})}catch(e){_n(this.plugin.uppy)(e)}this.setLoading(!1)}})}handleScroll(t){return j(this,null,function*(){let{partialTree:e,searchString:n}=this.plugin.getPluginState(),r=e.find(o=>o.type==="root");if(nc(t)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let o=yield this.provider.search(n,r.nextPagePath),a=k(_({},r),{nextPagePath:o.nextPageQuery}),s=e.filter(c=>c.type!=="root"),l=[a,...s,...o.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(o){_n(this.plugin.uppy)(o)}this.isHandlingScroll=!1}})}donePicking(){return j(this,null,function*(){let{partialTree:t}=this.plugin.getPluginState(),e=ac(t);oc(e,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(t,e){let{partialTree:n}=this.plugin.getPluginState(),r=rc(t.id,this.getDisplayedPartialTree(),e,this.lastCheckbox),o=pr.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=t.id}render(t,e){e===void 0&&(e={});let{isInputMode:n,searchString:r,loading:o,partialTree:a}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy,l=_(_({},this.opts),e);return n?u(co,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("enterTextToSearch"),buttonLabel:s("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,Yb.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(co,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("search"),clearSearchLabel:s("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Zl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>j(this,null,function*(){}),noResultsLabel:s("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:o,i18n:s,virtualList:!1,utmSource:this.opts.utmSource}),u(Ba,{partialTree:a,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};po.VERSION=QP.version;var Xb=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function eE(i,t){return!!(i===t||Xb(i)&&Xb(t))}function tE(i,t){if(i.length!==t.length)return!1;for(var e=0;e<i.length;e++)if(!eE(i[e],t[e]))return!1;return!0}function Jp(i,t){t===void 0&&(t=tE);var e=null;function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(e&&e.lastThis===this&&t(r,e.lastArgs))return e.lastResult;var a=i.apply(this,r);return e={lastResult:a,lastArgs:r,lastThis:this},a}return n.clear=function(){e=null},n}var sc=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function La(i,t){if(t){let e=i.querySelector(`[data-uppy-paneltype="${t}"]`);if(e)return e}return i}function Kb(i,t){let e=t[0];e&&(e.focus(),i.preventDefault())}function iE(i,t){let e=t[t.length-1];e&&(e.focus(),i.preventDefault())}function nE(i){return i.contains(document.activeElement)}function eu(i,t,e){let n=La(e,t),r=Qi(n.querySelectorAll(sc)),o=r.indexOf(document.activeElement);nE(n)?i.shiftKey&&o===0?iE(i,r):!i.shiftKey&&o===r.length-1&&Kb(i,r):Kb(i,r)}function Qb(i,t,e){t===null||eu(i,t,e)}var Zb=Ne(Ud(),1);function tu(){let i=!1;return(0,Zb.default)((e,n)=>{let r=La(e,n),o=r.contains(document.activeElement);if(o&&i)return;let a=r.querySelector("[data-uppy-super-focusable]");if(!(o&&!a))if(a)a.focus({preventScroll:!0}),i=!0;else{let s=r.querySelector(sc);s?.focus({preventScroll:!0}),i=!1}},260)}var gv=Ne(Gt(),1);function ja(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var iv=Ne(Gt(),1);function Jb(i,t){if(i===t)return!0;if(!i||!t)return!1;let e=Object.keys(i),n=Object.keys(t),r=e.length;if(n.length!==r)return!1;for(let o=0;o<r;o++){let a=e[o];if(i[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function oE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),u("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function aE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function sE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function lE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function cE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function dE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function pE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function hr(i){let t={color:"#838999",icon:dE()};if(!i)return t;let e=i.split("/")[0],n=i.split("/")[1];return e==="text"?{color:"#5a5e69",icon:pE()}:e==="image"?{color:"#686de0",icon:oE()}:e==="audio"?{color:"#068dbb",icon:aE()}:e==="video"?{color:"#19af67",icon:sE()}:e==="application"&&n==="pdf"?{color:"#e25149",icon:lE()}:e==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(n)!==-1?{color:"#00C469",icon:cE()}:t}function Ha(i){let{file:t}=i;if(t.preview)return u("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});let{color:e,icon:n}=hr(t.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:e}},n),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var uE=(i,t)=>(typeof t=="function"?t():t).filter(r=>r.id===i)[0].name;function Va(i){let{file:t,toggleFileCard:e,i18n:n,metaFields:r}=i,{missingRequiredMetaFields:o}=t;if(!(o!=null&&o.length))return null;let a=o.map(s=>uE(s,r)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},n("missingRequiredMetaFields",{smart_count:o.length,fields:a})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>e(!0,t.id)},n("editFile")))}function iu(i){let{file:t,i18n:e,toggleFileCard:n,metaFields:r,showLinkToFileUploadResult:o}=i,s=t.preview?"rgba(255, 255, 255, 0.5)":hr(t.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:s}},o&&t.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name},u("span",{hidden:!0},t.meta.name)),u(Ha,{file:t}),u(Va,{file:t,i18n:e,toggleFileCard:n,metaFields:r}))}function hE(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function ev(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function nu(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":ev(i),title:ev(i),onClick:()=>hE(i)},i.children))}function lc(i){let{children:t}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function ru(i){let{progress:t}=i,e=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":e,"stroke-dashoffset":e-e/100*t}))}function ou(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(lc,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?u(nu,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(nu,i,u(lc,null,u(ru,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(nu,i,u(lc,null,u(ru,{progress:i.file.progress.percentage}),u("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(lc,null,u(ru,{progress:i.file.progress.percentage}))))}var tv=Ne(ra(),1);var au="...";function cc(i,t){if(t===0)return"";if(i.length<=t)return i;if(t<=au.length+1)return`${i.slice(0,t-1)}\u2026`;let e=t-au.length,n=Math.ceil(e/2),r=Math.floor(e/2);return i.slice(0,n)+au+i.slice(-r)}var mE=i=>{let{author:t,name:e}=i.file.meta;function n(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:t?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:e},cc(e,n()))},fE=i=>{var t;let{author:e}=i.file.meta,n=(t=i.file.remote)==null?void 0:t.providerName,r="\xB7";return e?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},cc(e.name,13)),n?u(Fragment,null,` ${r} `,n,` ${r} `):null):null},gE=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,tv.default)(i.file.size)),bE=i=>i.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),vE=i=>{let{file:t,onClick:e}=i;return t.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:e,type:"button"},"?"):null};function su(i){let{file:t,i18n:e,toggleFileCard:n,metaFields:r,toggleAddFilesPanel:o,isSingleFile:a,containerHeight:s,containerWidth:l}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},u("div",{className:"uppy-Dashboard-Item-fileName"},mE({file:t,isSingleFile:a,containerHeight:s,containerWidth:l}),u(vE,{file:t,onClick:()=>alert(t.error)})),u("div",{className:"uppy-Dashboard-Item-status"},fE({file:t}),gE({file:t}),bE({file:t,toggleAddFilesPanel:o,i18n:e})),u(Va,{file:t,i18n:e,toggleFileCard:n,metaFields:r}))}function lu(i,t){return t===void 0&&(t="Copy the URL below"),new Promise(e=>{let n=document.createElement("textarea");n.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),n.value=i,document.body.appendChild(n),n.select();let r=()=>{document.body.removeChild(n),window.prompt(t,i),e()};try{return document.execCommand("copy")?(document.body.removeChild(n),e()):r()}catch{return document.body.removeChild(n),r()}})}function _E(i){let{file:t,uploadInProgressOrComplete:e,metaFields:n,canEditFile:r,i18n:o,onClick:a}=i;return!e&&n&&n.length>0||!e&&r(t)?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:t.meta.name}),title:o("editFileWithFilename",{file:t.meta.name}),onClick:()=>a()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function yE(i){let{i18n:t,onClick:e,file:n}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:n.meta.name}),title:t("removeFile",{file:n.meta.name}),onClick:()=>e()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),u("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function wE(i){let{file:t,uppy:e,i18n:n}=i,r=o=>{lu(t.uploadURL,n("copyLinkToClipboardFallback")).then(()=>{e.log("Link copied to clipboard."),e.info(n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.log).then(()=>o.target.focus({preventScroll:!0}))};return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":n("copyLink"),title:n("copyLink"),onClick:o=>r(o)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function cu(i){let{uppy:t,file:e,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,showLinkToFileUploadResult:a,showRemoveButton:s,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(_E,{i18n:l,file:e,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,e.id):d(e)}}),a&&e.uploadURL?u(wE,{file:e,uppy:t,i18n:l}):null,s?u(yE,{i18n:l,file:e,onClick:()=>t.removeFile(e.id)}):null)}var dc=class extends ni{componentDidMount(){let{file:t}=this.props;t.preview||this.props.handleRequestThumbnail(t)}shouldComponentUpdate(t){return!Jb(this.props,t)}componentDidUpdate(){let{file:t}=this.props;t.preview||this.props.handleRequestThumbnail(t)}componentWillUnmount(){let{file:t}=this.props;t.preview||this.props.handleCancelThumbnail(t)}render(){let{file:t}=this.props,e=t.progress.preprocess||t.progress.postprocess,n=!!t.progress.uploadComplete&&!e&&!t.error,r=!!t.progress.uploadStarted||!!e,o=t.progress.uploadStarted&&!t.progress.uploadComplete||e,a=t.error||!1,{isGhost:s}=t,l=(this.props.individualCancellation||!o)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,iv.default)({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":e,"is-complete":n,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return u("div",{className:c,id:`uppy_${t.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(iu,{file:t,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(ou,{uppy:this.props.uppy,file:t,error:a,isUploaded:n,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(su,{file:t,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),u(cu,{file:t,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function xE(i,t){let e=[],n=[];return i.forEach(r=>{n.length<t?n.push(r):(e.push(n),n=[r])}),n.length&&e.push(n),e}function du(i){let{id:t,i18n:e,uppy:n,files:r,resumableUploads:o,hideRetryButton:a,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,isSingleFile:v,toggleFileCard:g,handleRequestThumbnail:w,handleCancelThumbnail:E,recoveredState:L,individualCancellation:F,itemsPerRow:G,openFileEditor:he,canEditFile:me,toggleAddFilesPanel:se,containerWidth:y,containerHeight:x}=i,D=G===1?71:200,z=cr(()=>{let ie=(it,Be)=>Number(r[Be].isGhost)-Number(r[it].isGhost),Ie=Object.keys(r);return L&&Ie.sort(ie),xE(Ie,G)},[r,G,L]),V=ie=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:ie[0]},ie.map(Ie=>u(dc,{key:Ie,uppy:n,id:t,i18n:e,resumableUploads:o,individualCancellation:F,hideRetryButton:a,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,recoveredState:L,isSingleFile:v,containerWidth:y,containerHeight:x,toggleFileCard:g,handleRequestThumbnail:w,handleCancelThumbnail:E,role:"listitem",openFileEditor:he,canEditFile:me,toggleAddFilesPanel:se,file:r[Ie]})));return v?u("div",{class:"uppy-Dashboard-files"},V(z[0])):u(Ql,{class:"uppy-Dashboard-files",role:"list",data:z,renderRow:V,rowHeight:D})}var pu=class extends ni{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var t;(t=this.fileInput)==null||t.click()},this.triggerFolderInputClick=()=>{var t;(t=this.folderInput)==null||t.click()},this.triggerVideoCameraInputClick=()=>{var t;(t=this.mobileVideoFileInput)==null||t.click()},this.triggerPhotoCameraInputClick=()=>{var t;(t=this.mobilePhotoFileInput)==null||t.click()},this.onFileInputChange=t=>{this.props.handleInputChange(t),t.currentTarget.value=""},this.renderHiddenInput=(t,e)=>{var n;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:t,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(n=this.props.allowedFileTypes)==null?void 0:n.join(", "),ref:e})},this.renderHiddenCameraInput=(t,e,n)=>{let o={photo:"image/*",video:"video/*"}[t];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${t}`,onChange:this.onFileInputChange,capture:e,accept:o,ref:n})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(t,e)=>{let n=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:e,"data-uppy-super-focusable":n===0},t)},this.renderDropPasteBrowseTagline=t=>{let e=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,o=r.charAt(0).toUpperCase()+r.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):t>0?this.props.i18nArray(`dropPasteImport${o}`,{browseFiles:e,browseFolders:n,browse:e}):this.props.i18nArray(`dropPaste${o}`,{browseFiles:e,browseFolders:n,browse:e}))},this.renderAcquirer=t=>{var e;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":t.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":t.id,"aria-controls":`uppy-DashboardContent-panel--${t.id}`,"aria-selected":((e=this.props.activePickerPanel)==null?void 0:e.id)===t.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(t.id)},u("div",{className:"uppy-DashboardTab-inner"},t.icon()),u("div",{className:"uppy-DashboardTab-name"},t.name)))},this.renderAcquirers=t=>{let e=[...t],n=e.splice(t.length-2,t.length);return u(mi,null,e.map(r=>this.renderAcquirer(r)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},n.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(t,e)=>{let{showNativePhotoCameraButton:n,showNativeVideoCameraButton:r}=this.props,o=[],a="myDevice";e||o.push({key:a,elements:this.renderMyDeviceAcquirer()}),n&&o.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&o.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),o.push(...t.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),o.length===1&&o[0].key===a&&(o=[]);let l=[...o],c=l.splice(o.length-2,o.length);return u(mi,null,this.renderDropPasteBrowseTagline(o.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:p,elements:v}=d;return u(mi,{key:p},v)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:p,elements:v}=d;return u(mi,{key:p},v)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:t}=this.props,e=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),n=t("poweredBy",{uppy:e});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},n)}render(){let{showNativePhotoCameraButton:t,showNativeVideoCameraButton:e,nativeCameraFacingMode:n}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),t&&this.renderHiddenCameraInput("photo",n,r=>{this.mobilePhotoFileInput=r}),e&&this.renderHiddenCameraInput("video",n,r=>{this.mobileVideoFileInput=r}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},pc=pu;var nv=Ne(Gt(),1);var CE=i=>u("div",{className:(0,nv.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(pc,i)),rv=CE;var ov=Ne(Gt(),1);function SE(i){let{tagName:t}=i.target;if(t==="INPUT"||t==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ji=SE;function PE(i){let{activePickerPanel:t,className:e,hideAllPanels:n,i18n:r,state:o,uppy:a}=i,s=lr(null);return u("div",{className:(0,ov.default)("uppy-DashboardContent-panel",e),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:Ji,onDragLeave:Ji,onDrop:Ji,onPaste:Ji},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:t.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:n},r("cancel"))),u("div",{ref:s,className:"uppy-DashboardContent-panelBody"},a.getPlugin(t.id).render(o,s.current)))}var av=PE;var sv=Ne(Gt(),1);function EE(i){let t=i.files[i.fileCardFor],e=()=>{i.uppy.emit("file-editor:cancel",t),i.closeFileEditor()};return u("div",{className:(0,sv.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(n=>i.uppy.getPlugin(n.id).render(i.state))))}var lv=EE;var en={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function IE(i,t,e,n){if(n===void 0&&(n={}),i)return en.STATE_ERROR;if(t)return en.STATE_COMPLETE;if(e)return en.STATE_PAUSED;let r=en.STATE_WAITING,o=Object.keys(n);for(let a=0;a<o.length;a++){let{progress:s}=n[o[a]];if(s.uploadStarted&&!s.uploadComplete)return en.STATE_UPLOADING;s.preprocess&&r!==en.STATE_UPLOADING&&(r=en.STATE_PREPROCESSING),s.postprocess&&r!==en.STATE_UPLOADING&&r!==en.STATE_PREPROCESSING&&(r=en.STATE_POSTPROCESSING)}return r}function DE(i){let{files:t,i18n:e,isAllComplete:n,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:a,newFiles:s,processingFiles:l}=i;switch(IE(r,n,o,t)){case"uploading":return e("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return e("processingXFiles",{smart_count:l.length});case"paused":return e("uploadPaused");case"waiting":return e("xFilesSelected",{smart_count:s.length});case"complete":return e("uploadComplete");case"error":return e("error");default:}}function kE(i){let{i18n:t,isAllComplete:e,hideCancelButton:n,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:a}=i,{allowNewUpload:s}=i;return s&&r&&(s=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!e&&!n?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},t("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(DE,i)),s?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>o(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):u("div",null))}var cv=kE;var dv=Ne(Gt(),1);function uu(i){let{computedMetaFields:t,requiredMetaFields:e,updateMeta:n,form:r,formState:o}=i,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map(s=>{let l=`uppy-Dashboard-FileCard-input-${s.id}`,c=e.includes(s.id);return u("fieldset",{key:s.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},s.name),s.render!==void 0?s.render({value:o[s.id],onChange:d=>n(d,s.id),fieldCSSClasses:a,required:c,form:r.id},u):u("input",{className:a.text,id:l,form:r.id,type:s.type||"text",required:c,value:o[s.id],placeholder:s.placeholder,onInput:d=>n(d.target.value,s.id),"data-uppy-super-focusable":!0}))})}function hu(i){var t;let{files:e,fileCardFor:n,toggleFileCard:r,saveFileCard:o,metaFields:a,requiredMetaFields:s,openFileEditor:l,i18n:c,i18nArray:d,className:p,canEditFile:v}=i,g=()=>typeof a=="function"?a(e[n]):a,w=e[n],E=(t=g())!=null?t:[],L=v(w),F={};E.forEach(D=>{var z;F[D.id]=(z=w.meta[D.id])!=null?z:""});let[G,he]=ji(F),me=dr(D=>{D.preventDefault(),o(G,n)},[o,G,n]),se=(D,z)=>{he(k(_({},G),{[z]:D}))},y=()=>{r(!1)},[x]=ji(()=>{let D=document.createElement("form");return D.setAttribute("tabindex","-1"),D.id=Rn(),D});return Zi(()=>(document.body.appendChild(x),x.addEventListener("submit",me),()=>{x.removeEventListener("submit",me),document.body.removeChild(x)}),[x,me]),u("div",{className:(0,dv.default)("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:Ji,onDragLeave:Ji,onDrop:Ji,onPaste:Ji},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},w.meta?w.meta.name:w.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:x.id,title:c("finishEditingFile"),onClick:y},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:hr(w.type).color}},u(Ha,{file:w}),L&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:D=>{me(D),l(w)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(uu,{computedMetaFields:E,requiredMetaFields:s,updateMeta:se,form:x,formState:G})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:x.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:y,form:x.id},c("cancel")))))}var uv=Ne(Gt(),1),uo="uppy-transition-slideDownUp",pv=250;function TE(i){let{children:t}=i,[e,n]=ji(null),[r,o]=ji(""),a=lr(),s=lr(),l=lr(),c=()=>{o(`${uo}-enter`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{o(`${uo}-enter ${uo}-enter-active`),a.current=setTimeout(()=>{o("")},pv)})},d=()=>{o(`${uo}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{o(`${uo}-leave ${uo}-leave-active`),s.current=setTimeout(()=>{n(null),o("")},pv)})};return Zi(()=>{let p=Ki(t)[0];e!==p&&(p&&!e?c():e&&!p&&!s.current&&d(),n(p))},[t,e]),Zi(()=>()=>{clearTimeout(a.current),clearTimeout(s.current),cancelAnimationFrame(l.current)},[]),e?Ol(e,{className:(0,uv.default)(r,e.props.className)}):null}var Ua=TE;function ho(){return ho=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ho.apply(null,arguments)}var hv=900,mv=700,mu=576,fv=330;function fu(i){let t=i.totalFileCount===0,e=i.totalFileCount===1,n=i.containerWidth>mu,r=i.containerHeight>fv,o=(0,gv.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>mu,"uppy-size--lg":i.containerWidth>mv,"uppy-size--xl":i.containerWidth>hv,"uppy-size--height-md":i.containerHeight>fv,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&e&&r}),a=1;i.containerWidth>hv?a=5:i.containerWidth>mv?a=4:i.containerWidth>mu&&(a=3);let s=i.showSelectedFiles&&!t,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(v=>i.files[v].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:o,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&ja(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),s&&u(cv,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),s?u(du,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:e,itemsPerRow:a,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):u(pc,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),u(Ua,null,i.showAddFilesPanel?u(rv,ho({key:"AddFiles"},i,{isSizeMD:n})):null),u(Ua,null,i.fileCardFor?u(hu,ho({key:"FileCard"},i)):null),u(Ua,null,i.activePickerPanel?u(av,ho({key:"Picker"},i)):null),u(Ua,null,i.showFileEditor?u(lv,ho({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(v=>i.uppy.getPlugin(v.id).render(i.state))))))}var bv={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function Me(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var ME=0;function zt(i){return"__private_"+ME+++"_"+i}var OE={version:"4.3.1"},gu=Jp.default||Jp,vv=9,FE=27;function _v(){let i={};return i.promise=new Promise((t,e)=>{i.resolve=t,i.reject=e}),i}var AE={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:za,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},mr=zt("disabledNodes"),yn=zt("generateLargeThumbnailIfSingleFile"),Wa=zt("openFileEditorWhenFilesAdded"),fr=zt("attachRenderFunctionToTarget"),bu=zt("isTargetSupported"),vu=zt("getAcquirers"),_u=zt("getProgressIndicators"),wn=zt("getEditors"),yu=zt("addSpecifiedPluginsFromOptions"),wu=zt("autoDiscoverPlugins"),gr=zt("addSupportedPluginIfNoTarget"),$a=zt("getStatusBarOpts"),qa=zt("getThumbnailGeneratorOpts"),xu=zt("getInformerOpts"),Ga=zt("getStatusBarId"),Ya=zt("getThumbnailGeneratorId"),Cu=zt("getInformerId"),br=class extends fi{constructor(t,e){var n,r,o;let a=(n=e?.autoOpen)!=null?n:null;super(t,k(_(_({},AE),e),{autoOpen:a})),Object.defineProperty(this,Cu,{value:jE}),Object.defineProperty(this,Ya,{value:LE}),Object.defineProperty(this,Ga,{value:zE}),Object.defineProperty(this,xu,{value:NE}),Object.defineProperty(this,qa,{value:BE}),Object.defineProperty(this,$a,{value:RE}),Object.defineProperty(this,mr,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Rn()}`,this.superFocus=tu(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=s=>{let c=this.getPluginState().targets.filter(d=>d.id!==s.id);this.setPluginState({targets:c})},this.addTarget=s=>{let l=s.id||s.constructor.name,c=s.title||l,d=s.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let p={id:l,name:c,type:d},g=this.getPluginState().targets.slice();return g.push(p),this.setPluginState({targets:g}),this.el},this.hideAllPanels=()=>{var s;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(s=l.activePickerPanel)==null?void 0:s.id))},this.showPanel=s=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===s);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",s)},this.canEditFile=s=>{let{targets:l}=this.getPluginState();return Me(this,wn)[wn](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(s))},this.openFileEditor=s=>{let{targets:l}=this.getPluginState(),c=Me(this,wn)[wn](l);this.setPluginState({showFileEditor:!0,fileCardFor:s.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(s)})},this.closeFileEditor=()=>{let{metaFields:s}=this.getPluginState();s&&s.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:s}=this.getPluginState();Me(this,wn)[wn](s).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:s,resolve:l}=_v();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),s},this.closeModal=s=>{var l;let c=(l=s?.manualClose)!=null?l:!0,{isHidden:d,isClosing:p}=this.getPluginState();if(d||p)return;let{promise:v,resolve:g}=_v();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let E=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",E,!1),g()};this.el.addEventListener("animationend",E,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),g();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var w;(w=history.state)!=null&&w[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),v},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=s=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:k(_({},l),{darkMode:s})})},this.handleSystemDarkModeChange=s=>{let l=s.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(s,l)=>{let c=this.uppy.getFile(l);s?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:s?l:null,activeOverlayType:s?"FileCard":null})},this.toggleAddFilesPanel=s=>{this.setPluginState({showAddFilesPanel:s,activeOverlayType:s?"AddFiles":null})},this.addFiles=s=>{let l=s.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(s=>{let l=s[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let s=this.getPluginState(),l=!this.opts.inline&&s.isHidden;!s.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=s=>{this.el.contains(s.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=s=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=Me(this,mr)[mr])!=null?l:Qi(this.el.querySelectorAll(c)).filter(p=>!p.classList.contains("uppy-Dashboard-close"));for(let p of d)p.tagName==="A"?p.setAttribute("aria-disabled",s):p.disabled=s;s?Me(this,mr)[mr]=d:Me(this,mr)[mr]=null,this.dashboardIsDisabled=s},this.updateBrowserHistory=()=>{var s;(s=history.state)!=null&&s[this.modalName]||history.pushState(k(_({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=s=>{var l;this.isModalOpen()&&(!s.state||!s.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=s.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=s=>{s.keyCode===FE&&this.requestCloseModal(),s.keyCode===vv&&eu(s,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=s=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(s))});let l=Qi(s.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=s=>{s.preventDefault();let l=Qi(s.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=s=>{s.preventDefault(),s.stopPropagation();let l=()=>{let v=!0;return this.uppy.iteratePlugins(g=>{g.canHandleRootDrop!=null&&g.canHandleRootDrop(s)&&(v=!0)}),v},c=()=>{let{types:v}=s.dataTransfer;return v.some(g=>g==="Files")},d=l(),p=c();if(!d&&!p||this.opts.disabled||this.opts.disableLocalFiles&&(p||!d)||!this.uppy.getState().allowNewUpload){s.dataTransfer.dropEffect="none";return}s.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(s)},this.handleDragLeave=s=>{s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(s)},this.handleDrop=s=>j(this,null,function*(){s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(p=>{p.type==="acquirer"&&(p.handleRootDrop==null||p.handleRootDrop(s))});let l=!1,c=p=>{this.uppy.log(p,"error"),l||(this.uppy.info(p.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=yield Ta(s.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(s)}),this.handleRequestThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",s)},this.handleCancelThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",s)},this.handleKeyDownInInline=s=>{s.keyCode===vv&&Qb(s,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=s=>{this.el.contains(document.activeElement)&&this.handlePaste(s)},this.handleComplete=s=>{let{failed:l}=s;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,yn,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let s=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:s});let d=k(_({},l[0]),{preview:void 0});c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Wa,{writable:!0,value:s=>{let l=s[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,p=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):p&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let s=Op(this.opts.trigger);s?s.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",Me(this,gr)[gr]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",Me(this,yn)[yn]),this.uppy.on("file-removed",Me(this,yn)[yn]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",Me(this,Wa)[Wa])},this.removeEvents=()=>{let s=Op(this.opts.trigger);!this.opts.inline&&s&&s.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",Me(this,gr)[gr]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",Me(this,yn)[yn]),this.uppy.off("file-removed",Me(this,yn)[yn]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",Me(this,Wa)[Wa])},this.superFocusOnEachUpdate=()=>{let s=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||s||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(s,l)=>{this.uppy.setFileMeta(l,s),this.toggleFileCard(!1,l)},Object.defineProperty(this,fr,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return k(_({},s),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,bu,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,vu,{writable:!0,value:gu(s=>s.filter(l=>l.type==="acquirer"&&Me(this,bu)[bu](l)).map(Me(this,fr)[fr]))}),Object.defineProperty(this,_u,{writable:!0,value:gu(s=>s.filter(l=>l.type==="progressindicator").map(Me(this,fr)[fr]))}),Object.defineProperty(this,wn,{writable:!0,value:gu(s=>s.filter(l=>l.type==="editor").map(Me(this,fr)[fr]))}),this.render=s=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:p}=s,{newFiles:v,uploadStartedFiles:g,completeFiles:w,erroredFiles:E,inProgressFiles:L,inProgressNotPausedFiles:F,processingFiles:G,isUploadStarted:he,isAllComplete:me,isAllPaused:se}=this.uppy.getObjectOfFilesPerState(),y=Me(this,vu)[vu](l.targets),x=Me(this,_u)[_u](l.targets),D=Me(this,wn)[wn](l.targets),z;return this.opts.theme==="auto"?z=d.darkMode?"dark":"light":z=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),fu({state:s,isHidden:l.isHidden,files:c,newFiles:v,uploadStartedFiles:g,completeFiles:w,erroredFiles:E,inProgressFiles:L,inProgressNotPausedFiles:F,processingFiles:G,isUploadStarted:he,isAllComplete:me,isAllPaused:se,totalFileCount:Object.keys(c).length,totalProgress:s.totalProgress,allowNewUpload:p,acquirers:y,theme:z,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:x,editors:D,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:s.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,yu,{writable:!0,value:()=>{let{plugins:s}=this.opts;s.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,wu,{writable:!0,value:()=>{this.uppy.iteratePlugins(Me(this,gr)[gr])}}),Object.defineProperty(this,gr,{writable:!0,value:s=>{var l;let c=["acquirer","editor"];s&&!((l=s.opts)!=null&&l.target)&&c.includes(s.type)&&(this.getPluginState().targets.some(p=>s.id===p.id)||s.mount(this,s))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:s,closeAfterFinish:l}=this.opts;if(s&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:p}=this.opts;p&&this.mount(p,this),this.opts.disableStatusBar||this.uppy.use(nr,_({id:Me(this,Ga)[Ga](),target:this},Me(this,$a)[$a]())),this.opts.disableInformer||this.uppy.use(rr,_({id:Me(this,Cu)[Cu](),target:this},Me(this,xu)[xu]())),this.opts.disableThumbnailGenerator||this.uppy.use(so,_({id:Me(this,Ya)[Ya]()},Me(this,qa)[qa]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let v=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${v?"on":"off"}`),this.setDarkModeCapability(v),this.opts.theme==="auto"){var g;(g=this.darkModeMediaQuery)==null||g.addListener(this.handleSystemDarkModeChange)}Me(this,yu)[yu](),Me(this,wu)[wu](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:s}=this.opts;if(s.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=bv,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(o=(r=this.opts).onRequestCloseModal)!=null||(r.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(t){var e,n;super.setOptions(t),(e=this.uppy.getPlugin(Me(this,Ga)[Ga]()))==null||e.setOptions(Me(this,$a)[$a]()),(n=this.uppy.getPlugin(Me(this,Ya)[Ya]()))==null||n.setOptions(Me(this,qa)[qa]())}};function RE(){let{hideUploadButton:i,hideRetryButton:t,hidePauseResumeButton:e,hideCancelButton:n,showProgressDetails:r,hideProgressAfterFinish:o,locale:a,doneButtonHandler:s}=this.opts;return{hideUploadButton:i,hideRetryButton:t,hidePauseResumeButton:e,hideCancelButton:n,showProgressDetails:r,hideAfterFinish:o,locale:a,doneButtonHandler:s}}function BE(){let{thumbnailWidth:i,thumbnailHeight:t,thumbnailType:e,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:i,thumbnailHeight:t,thumbnailType:e,waitForThumbnailsBeforeUpload:n,lazy:!n}}function NE(){return{}}function zE(){return`${this.id}:StatusBar`}function LE(){return`${this.id}:ThumbnailGenerator`}function jE(){return`${this.id}:Informer`}br.VERSION=OE.version;var HE={version:"4.2.1"},VE={fixed:!1,hideAfterFinish:!0},mo=class extends fi{constructor(t,e){super(t,_(_({},VE),e)),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(t){let{totalProgress:e}=t,n=(e===0||e===100)&&this.opts.hideAfterFinish;return u("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},u("div",{className:"uppy-ProgressBar-inner",style:{width:`${e}%`}}),u("div",{className:"uppy-ProgressBar-percentage"},e))}install(){let{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount()}};mo.VERSION=HE.version;var yv={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var UE={version:"4.1.1"},WE={inputName:"files[]",width:"100%",height:"100%"},fo=class i extends fi{constructor(t,e){super(t,_(_({},WE),e)),this.isDragDropSupported=ja(),this.addFiles=n=>{let r=n.map(o=>({source:this.id,name:o.name,type:o.type,data:o,meta:{relativePath:o.relativePath||null}}));try{this.uppy.addFiles(r)}catch(o){this.uppy.log(o)}},this.onInputChange=n=>{let r=Qi(n.currentTarget.files||[]);r.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(r)),n.currentTarget.value=""},this.handleDragOver=n=>{var r,o;n.preventDefault(),n.stopPropagation();let{types:a}=n.dataTransfer,s=a.some(c=>c==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!s||!l){n.dataTransfer.dropEffect="none";return}n.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(r=(o=this.opts).onDragOver)==null||r.call(o,n)},this.handleDragLeave=n=>{var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(r=(o=this.opts).onDragLeave)==null||r.call(o,n)},this.handleDrop=n=>j(this,null,function*(){var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1});let a=l=>{this.uppy.log(l,"error")},s=yield Ta(n.dataTransfer,{logDropError:a});s.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(s)),(r=(o=this.opts).onDrop)==null||r.call(o,n)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=yv,this.i18nInit()}renderHiddenFileInput(){var t;let{restrictions:e}=this.uppy.opts;return u("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:n=>{this.fileInputRef=n},name:this.opts.inputName,multiple:e.maxNumberOfFiles!==1,accept:(t=e.allowedFileTypes)==null?void 0:t.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},u("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return u("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:u("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return u("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){let t=`uppy-u-reset
25
+ ${r.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:t}=this.opts;t&&this.mount(t,this)}};or.VERSION=JS.version;var eP=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function tP(i,t,e){var n,r;let o=eP.exec(i),a=(n=(r=t.mimeType)!=null?r:o?.[1])!=null?n:"plain/text",s;if(o?.[2]!=null){let l=atob(decodeURIComponent(o[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);s=[c]}else o?.[3]!=null&&(s=[decodeURIComponent(o[3])]);return e?new File(s,t.name||"",{type:a}):new Blob(s,{type:a})}var Z0=tP;function Ll(i){return i.startsWith("blob:")}function jl(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function je(i,t,e){return t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}var sb=typeof self<"u"?self:global,Pa=typeof navigator<"u",iP=Pa&&typeof HTMLImageElement>"u",J0=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),lb=sb.Buffer,cb=!!lb,nP=i=>i!==void 0;function db(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(nP).length===0)}function Tt(i){let t=new Error(i);throw delete t.stack,t}function eb(i){let t=function(e){let n=0;return e.ifd0.enabled&&(n+=1024),e.exif.enabled&&(n+=2048),e.makerNote&&(n+=2048),e.userComment&&(n+=1024),e.gps.enabled&&(n+=512),e.interop.enabled&&(n+=100),e.ifd1.enabled&&(n+=1024),n+2048}(i);return i.jfif.enabled&&(t+=50),i.xmp.enabled&&(t+=2e4),i.iptc.enabled&&(t+=14e3),i.icc.enabled&&(t+=6e3),t}var _p=i=>String.fromCharCode.apply(null,i),tb=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,sr=class i{static from(t,e){return t instanceof this&&t.le===e?t:new i(t,void 0,void 0,e)}constructor(t,e=0,n,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(t)&&(t=new Uint8Array(t)),t===0)this.byteOffset=0,this.byteLength=0;else if(t instanceof ArrayBuffer){n===void 0&&(n=t.byteLength-e);let o=new DataView(t,e,n);this._swapDataView(o)}else if(t instanceof Uint8Array||t instanceof DataView||t instanceof i){n===void 0&&(n=t.byteLength-e),(e+=t.byteOffset)+n>t.byteOffset+t.byteLength&&Tt("Creating view outside of available memory in ArrayBuffer");let o=new DataView(t.buffer,e,n);this._swapDataView(o)}else if(typeof t=="number"){let o=new DataView(new ArrayBuffer(t));this._swapDataView(o)}else Tt("Invalid input argument for BufferView: "+t)}_swapArrayBuffer(t){this._swapDataView(new DataView(t))}_swapBuffer(t){this._swapDataView(new DataView(t.buffer,t.byteOffset,t.byteLength))}_swapDataView(t){this.dataView=t,this.buffer=t.buffer,this.byteOffset=t.byteOffset,this.byteLength=t.byteLength}_lengthToEnd(t){return this.byteLength-t}set(t,e,n=i){return t instanceof DataView||t instanceof i?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array||Tt("BufferView.set(): Invalid data argument."),this.toUint8().set(t,e),new n(this,e,t.byteLength)}subarray(t,e){return e=e||this._lengthToEnd(t),new i(this,t,e)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(t,e){return new Uint8Array(this.buffer,this.byteOffset+t,e)}getString(t=0,e=this.byteLength){return r=this.getUint8Array(t,e),tb?tb.decode(r):cb?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(_p(r)));var r}getLatin1String(t=0,e=this.byteLength){let n=this.getUint8Array(t,e);return _p(n)}getUnicodeString(t=0,e=this.byteLength){let n=[];for(let r=0;r<e&&t+r<this.byteLength;r+=2)n.push(this.getUint16(t+r));return _p(n)}getInt8(t){return this.dataView.getInt8(t)}getUint8(t){return this.dataView.getUint8(t)}getInt16(t,e=this.le){return this.dataView.getInt16(t,e)}getInt32(t,e=this.le){return this.dataView.getInt32(t,e)}getUint16(t,e=this.le){return this.dataView.getUint16(t,e)}getUint32(t,e=this.le){return this.dataView.getUint32(t,e)}getFloat32(t,e=this.le){return this.dataView.getFloat32(t,e)}getFloat64(t,e=this.le){return this.dataView.getFloat64(t,e)}getFloat(t,e=this.le){return this.dataView.getFloat32(t,e)}getDouble(t,e=this.le){return this.dataView.getFloat64(t,e)}getUintBytes(t,e,n){switch(e){case 1:return this.getUint8(t,n);case 2:return this.getUint16(t,n);case 4:return this.getUint32(t,n);case 8:return this.getUint64&&this.getUint64(t,n)}}getUint(t,e,n){switch(e){case 8:return this.getUint8(t,n);case 16:return this.getUint16(t,n);case 32:return this.getUint32(t,n);case 64:return this.getUint64&&this.getUint64(t,n)}}toString(t){return this.dataView.toString(t,this.constructor.name)}ensureChunk(){}};function wp(i,t){Tt(`${i} '${t}' was not loaded, try using full build of exifr.`)}var Ea=class extends Map{constructor(t){super(),this.kind=t}get(t,e){return this.has(t)||wp(this.kind,t),e&&(t in e||function(n,r){Tt(`Unknown ${n} '${r}'.`)}(this.kind,t),e[t].enabled||wp(this.kind,t)),super.get(t)}keyList(){return Array.from(this.keys())}},$l=new Ea("file parser"),vi=new Ea("segment parser"),ka=new Ea("file reader"),rP=sb.fetch;function ib(i,t){return(e=i).startsWith("data:")||e.length>1e4?Cp(i,t,"base64"):J0&&i.includes("://")?xp(i,t,"url",Hl):J0?Cp(i,t,"fs"):Pa?xp(i,t,"url",Hl):void Tt("Invalid input argument");var e}function xp(i,t,e,n){return j(this,null,function*(){return ka.has(e)?Cp(i,t,e):n?function(r,o){return j(this,null,function*(){let a=yield o(r);return new sr(a)})}(i,n):void Tt(`Parser ${e} is not loaded`)})}function Cp(i,t,e){return j(this,null,function*(){let n=new(ka.get(e))(i,t);return yield n.read(),n})}var Hl=i=>rP(i).then(t=>t.arrayBuffer()),Ia=i=>new Promise((t,e)=>{let n=new FileReader;n.onloadend=()=>t(n.result||new ArrayBuffer),n.onerror=e,n.readAsArrayBuffer(i)}),Sp=class 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 pb(i,t,e){let n=new Sp;for(let[r,o]of e)n.set(r,o);if(Array.isArray(t))for(let r of t)i.set(r,n);else i.set(t,n);return n}function ub(i,t,e){let n,r=i.get(t);for(n of e)r.set(n[0],n[1])}var Ta=new Map,kp=new Map,Tp=new Map,no=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],ql=["jfif","xmp","icc","iptc","ihdr"],Da=["tiff",...ql],vt=["ifd0","ifd1","exif","gps","interop"],ro=[...Da,...vt],oo=["makerNote","userComment"],Gl=["translateKeys","translateValues","reviveValues","multiSegment"],ao=[...Gl,"sanitize","mergeOutput","silentErrors"],Vl=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},ar=class extends Vl{get needed(){return this.enabled||this.deps.size>0}constructor(t,e,n,r){if(super(),je(this,"enabled",!1),je(this,"skip",new Set),je(this,"pick",new Set),je(this,"deps",new Set),je(this,"translateKeys",!1),je(this,"translateValues",!1),je(this,"reviveValues",!1),this.key=t,this.enabled=e,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=vt.includes(t),this.canBeFiltered&&(this.dict=Ta.get(t)),n!==void 0)if(Array.isArray(n))this.parse=this.enabled=!0,this.canBeFiltered&&n.length>0&&this.translateTagSet(n,this.pick);else if(typeof n=="object"){if(this.enabled=!0,this.parse=n.parse!==!1,this.canBeFiltered){let{pick:o,skip:a}=n;o&&o.length>0&&this.translateTagSet(o,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(n)}else n===!0||n===!1?this.parse=this.enabled=n:Tt(`Invalid options argument: ${n}`)}applyInheritables(t){let e,n;for(e of Gl)n=t[e],n!==void 0&&(this[e]=n)}translateTagSet(t,e){if(this.dict){let n,r,{tagKeys:o,tagValues:a}=this.dict;for(n of t)typeof n=="string"?(r=a.indexOf(n),r===-1&&(r=o.indexOf(Number(n))),r!==-1&&e.add(Number(o[r]))):e.add(n)}else for(let n of t)e.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ul(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ul(this.pick,this.deps)}},Yt={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},nb=new Map,lr=class extends Vl{static useCached(t){let e=nb.get(t);return e!==void 0||(e=new this(t),nb.set(t,e)),e}constructor(t){super(),t===!0?this.setupFromTrue():t===void 0?this.setupFromUndefined():Array.isArray(t)?this.setupFromArray(t):typeof t=="object"?this.setupFromObject(t):Tt(`Invalid options argument ${t}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Pa?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let t;for(t of no)this[t]=Yt[t];for(t of ao)this[t]=Yt[t];for(t of oo)this[t]=Yt[t];for(t of ro)this[t]=new ar(t,Yt[t],void 0,this)}setupFromTrue(){let t;for(t of no)this[t]=Yt[t];for(t of ao)this[t]=Yt[t];for(t of oo)this[t]=!0;for(t of ro)this[t]=new ar(t,!0,void 0,this)}setupFromArray(t){let e;for(e of no)this[e]=Yt[e];for(e of ao)this[e]=Yt[e];for(e of oo)this[e]=Yt[e];for(e of ro)this[e]=new ar(e,!1,void 0,this);this.setupGlobalFilters(t,void 0,vt)}setupFromObject(t){let e;for(e of(vt.ifd0=vt.ifd0||vt.image,vt.ifd1=vt.ifd1||vt.thumbnail,Object.assign(this,t),no))this[e]=yp(t[e],Yt[e]);for(e of ao)this[e]=yp(t[e],Yt[e]);for(e of oo)this[e]=yp(t[e],Yt[e]);for(e of Da)this[e]=new ar(e,Yt[e],t[e],this);for(e of vt)this[e]=new ar(e,Yt[e],t[e],this.tiff);this.setupGlobalFilters(t.pick,t.skip,vt,ro),t.tiff===!0?this.batchEnableWithBool(vt,!0):t.tiff===!1?this.batchEnableWithUserValue(vt,t):Array.isArray(t.tiff)?this.setupGlobalFilters(t.tiff,void 0,vt):typeof t.tiff=="object"&&this.setupGlobalFilters(t.tiff.pick,t.tiff.skip,vt)}batchEnableWithBool(t,e){for(let n of t)this[n].enabled=e}batchEnableWithUserValue(t,e){for(let n of t){let r=e[n];this[n].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(t,e,n,r=n){if(t&&t.length){for(let a of r)this[a].enabled=!1;let o=rb(t,n);for(let[a,s]of o)Ul(this[a].pick,s),this[a].enabled=!0}else if(e&&e.length){let o=rb(e,n);for(let[a,s]of o)Ul(this[a].skip,s)}}filterNestedSegmentTags(){let{ifd0:t,exif:e,xmp:n,iptc:r,icc:o}=this;this.makerNote?e.deps.add(37500):e.skip.add(37500),this.userComment?e.deps.add(37510):e.skip.add(37510),n.enabled||t.skip.add(700),r.enabled||t.skip.add(33723),o.enabled||t.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:t,exif:e,gps:n,interop:r}=this;r.needed&&(e.deps.add(40965),t.deps.add(40965)),e.needed&&t.deps.add(34665),n.needed&&t.deps.add(34853),this.tiff.enabled=vt.some(o=>this[o].enabled===!0)||this.makerNote||this.userComment;for(let o of vt)this[o].finalizeFilters()}get onlyTiff(){return!ql.map(t=>this[t].enabled).some(t=>t===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let t of Da)this[t].enabled&&!vi.has(t)&&wp("segment parser",t)}};function rb(i,t){let e,n,r,o,a=[];for(r of t){for(o of(e=Ta.get(r),n=[],e))(i.includes(o[0])||i.includes(o[1]))&&n.push(o[0]);n.length&&a.push([r,n])}return a}function yp(i,t){return i!==void 0?i:t!==void 0?t:void 0}function Ul(i,t){for(let e of t)i.add(e)}je(lr,"default",Yt);var so=class{constructor(t){je(this,"parsers",{}),je(this,"output",{}),je(this,"errors",[]),je(this,"pushToErrors",e=>this.errors.push(e)),this.options=lr.useCached(t)}read(t){return j(this,null,function*(){this.file=yield function(e,n){return typeof e=="string"?ib(e,n):Pa&&!iP&&e instanceof HTMLImageElement?ib(e.src,n):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new sr(e):Pa&&e instanceof Blob?xp(e,n,"blob",Ia):void Tt("Invalid input argument")}(t,this.options)})}setup(){if(this.fileParser)return;let{file:t}=this,e=t.getUint16(0);for(let[n,r]of $l)if(r.canHandle(t,e))return this.fileParser=new r(this.options,this.file,this.parsers),t[n]=!0;this.file.close&&this.file.close(),Tt("Unknown file format")}parse(){return j(this,null,function*(){let{output:t,errors:e}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),e.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&e.length>0&&(t.errors=e),db(n=t)?void 0:n;var n})}executeParsers(){return j(this,null,function*(){let{output:t}=this;yield this.fileParser.parse();let e=Object.values(this.parsers).map(n=>j(this,null,function*(){let r=yield n.parse();n.assignToOutput(t,r)}));this.options.silentErrors&&(e=e.map(n=>n.catch(this.pushToErrors))),yield Promise.all(e)})}extractThumbnail(){return j(this,null,function*(){this.setup();let{options:t,file:e}=this,n=vi.get("tiff",t);var r;if(e.tiff?r={start:0,type:"tiff"}:e.jpeg&&(r=yield this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let o=yield this.fileParser.ensureSegmentChunk(r),a=this.parsers.tiff=new n(o,t,e),s=yield a.extractThumbnail();return e.close&&e.close(),s})}};function hb(i,t){return j(this,null,function*(){let e=new so(t);return yield e.read(i),e.parse()})}var oP=Object.freeze({__proto__:null,parse:hb,Exifr:so,fileParsers:$l,segmentParsers:vi,fileReaders:ka,tagKeys:Ta,tagValues:kp,tagRevivers:Tp,createDictionary:pb,extendDictionary:ub,fetchUrlAsArrayBuffer:Hl,readBlobAsArrayBuffer:Ia,chunkedProps:no,otherSegments:ql,segments:Da,tiffBlocks:vt,segmentsAndBlocks:ro,tiffExtractables:oo,inheritables:Gl,allFormatters:ao,Options:lr}),Nn=class{static findPosition(t,e){let n=t.getUint16(e+2)+2,r=typeof this.headerLength=="function"?this.headerLength(t,e,n):this.headerLength,o=e+r,a=n-r;return{offset:e,length:n,headerLength:r,start:o,size:a,end:o+a}}static parse(t,e={}){return new this(t,new lr({[this.type]:e}),t).parse()}normalizeInput(t){return t instanceof sr?t:new sr(t)}constructor(t,e={},n){je(this,"errors",[]),je(this,"raw",new Map),je(this,"handleError",r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)}),this.chunk=this.normalizeInput(t),this.file=n,this.type=this.constructor.type,this.globalOptions=this.options=e,this.localOptions=e[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(t,e){let n=Tp.get(e),r=kp.get(e),o=Ta.get(e),a=this.options[e],s=a.reviveValues&&!!n,l=a.translateValues&&!!r,c=a.translateKeys&&!!o,d={};for(let[p,v]of t)s&&n.has(p)?v=n.get(p)(v):l&&r.has(p)&&(v=this.translateValue(v,r.get(p))),c&&o.has(p)&&(p=o.get(p)||p),d[p]=v;return d}translateValue(t,e){return e[t]||e.DEFAULT||t}assignToOutput(t,e){this.assignObjectToOutput(t,this.constructor.type,e)}assignObjectToOutput(t,e,n){if(this.globalOptions.mergeOutput)return Object.assign(t,n);t[e]?Object.assign(t[e],n):t[e]=n}};je(Nn,"headerLength",4),je(Nn,"type",void 0),je(Nn,"multiSegment",!1),je(Nn,"canHandle",()=>!1);function aP(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function sP(i){return i>=224&&i<=239}function lP(i,t,e){for(let[n,r]of vi)if(r.canHandle(i,t,e))return n}var Wl=class extends class{constructor(t,e,n){je(this,"errors",[]),je(this,"ensureSegmentChunk",r=>j(this,null,function*(){let o=r.start,a=r.size||65536;if(this.file.chunked)if(this.file.available(o,a))r.chunk=this.file.subarray(o,a);else try{r.chunk=yield this.file.readChunk(o,a)}catch(s){Tt(`Couldn't read segment: ${JSON.stringify(r)}. ${s.message}`)}else this.file.byteLength>o+a?r.chunk=this.file.subarray(o,a):r.size===void 0?r.chunk=this.file.subarray(o):Tt("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(t),this.options=t,this.file=e,this.parsers=n}injectSegment(t,e){this.options[t].enabled&&this.createParser(t,e)}createParser(t,e){let n=new(vi.get(t))(e,this.options,this.file);return this.parsers[t]=n}createParsers(t){for(let e of t){let{type:n,chunk:r}=e,o=this.options[n];if(o&&o.enabled){let a=this.parsers[n];a&&a.append||a||this.createParser(n,r)}}}readSegments(t){return j(this,null,function*(){let e=t.map(this.ensureSegmentChunk);yield Promise.all(e)})}}{constructor(...t){super(...t),je(this,"appSegments",[]),je(this,"jpegSegments",[]),je(this,"unknownSegments",[])}static canHandle(t,e){return e===65496}parse(){return j(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(t){t===!0?(this.findAll=!0,this.wanted=new Set(vi.keyList())):(t=t===void 0?vi.keyList().filter(e=>this.options[e].enabled):t.filter(e=>this.options[e].enabled&&vi.has(e)),this.findAll=!1,this.remaining=new Set(t),this.wanted=new Set(t)),this.unfinishedMultiSegment=!1}findAppSegments(t=0,e){return j(this,null,function*(){this.setupSegmentFinderArgs(e);let{file:n,findAll:r,wanted:o,remaining:a}=this;if(!r&&this.file.chunked&&(r=Array.from(o).some(s=>{let l=vi.get(s),c=this.options[s];return l.multiSegment&&c.multiSegment}),r&&(yield this.file.readWhole())),t=this.findAppSegmentsInRange(t,n.byteLength),!this.options.onlyTiff&&n.chunked){let s=!1;for(;a.size>0&&!s&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=n,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(s=t>l&&!c?!(yield n.readNextChunk(t)):!(yield n.readNextChunk(l)),(t=this.findAppSegmentsInRange(t,n.byteLength))===void 0)return}}})}findAppSegmentsInRange(t,e){e-=2;let n,r,o,a,s,l,{file:c,findAll:d,wanted:p,remaining:v,options:g}=this;for(;t<e;t++)if(c.getUint8(t)===255){if(n=c.getUint8(t+1),sP(n)){if(r=c.getUint16(t+2),o=lP(c,t,r),o&&p.has(o)&&(a=vi.get(o),s=a.findPosition(c,t),l=g[o],s.type=o,this.appSegments.push(s),!d&&(a.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||v.delete(o)):v.delete(o),v.size===0)))break;g.recordUnknownSegments&&(s=Nn.findPosition(c,t),s.marker=n,this.unknownSegments.push(s)),t+=r+1}else if(aP(n)){if(r=c.getUint16(t+2),n===218&&g.stopAfterSos!==!1)return;g.recordJpegSegments&&this.jpegSegments.push({offset:t,length:r,marker:n}),t+=r+1}}return t}mergeMultiSegments(){if(!this.appSegments.some(e=>e.multiSegment))return;let t=function(e,n){let r,o,a,s=new Map;for(let l=0;l<e.length;l++)r=e[l],o=r[n],s.has(o)?a=s.get(o):s.set(o,a=[]),a.push(r);return Array.from(s)}(this.appSegments,"type");this.mergedAppSegments=t.map(([e,n])=>{let r=vi.get(e,this.options);return r.handleMultiSegments?{type:e,chunk:r.handleMultiSegments(n)}:n[0]})}getSegment(t){return this.appSegments.find(e=>e.type===t)}getOrFindSegment(t){return j(this,null,function*(){let e=this.getSegment(t);return e===void 0&&(yield this.findAppSegments(0,[t]),e=this.getSegment(t)),e})}};je(Wl,"type","jpeg"),$l.set("jpeg",Wl);var cP=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Pp=class extends Nn{parseHeader(){var t=this.chunk.getUint16();t===18761?this.le=!0:t===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(t,e,n=new Map){let{pick:r,skip:o}=this.options[e];r=new Set(r);let a=r.size>0,s=o.size===0,l=this.chunk.getUint16(t);t+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(t);if(a){if(r.has(d)&&(n.set(d,this.parseTag(t,d,e)),r.delete(d),r.size===0))break}else!s&&o.has(d)||n.set(d,this.parseTag(t,d,e));t+=12}return n}parseTag(t,e,n){let{chunk:r}=this,o=r.getUint16(t+2),a=r.getUint32(t+4),s=cP[o];if(s*a<=4?t+=8:t=r.getUint32(t+8),(o<1||o>13)&&Tt(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${e.toString(16)}, type: ${o}, offset ${t}`),t>r.byteLength&&Tt(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${e.toString(16)}, type: ${o}, offset ${t} is outside of chunk size ${r.byteLength}`),o===1)return r.getUint8Array(t,a);if(o===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=r.getString(t,a)).trim())===""?void 0:l;var l;if(o===7)return r.getUint8Array(t,a);if(a===1)return this.parseTagValue(o,t);{let c=new(function(p){switch(p){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}}(o))(a),d=s;for(let p=0;p<a;p++)c[p]=this.parseTagValue(o,t),t+=d;return c}}parseTagValue(t,e){let{chunk:n}=this;switch(t){case 1:return n.getUint8(e);case 3:return n.getUint16(e);case 4:return n.getUint32(e);case 5:return n.getUint32(e)/n.getUint32(e+4);case 6:return n.getInt8(e);case 8:return n.getInt16(e);case 9:return n.getInt32(e);case 10:return n.getInt32(e)/n.getInt32(e+4);case 11:return n.getFloat(e);case 12:return n.getDouble(e);case 13:return n.getUint32(e);default:Tt(`Invalid tiff type ${t}`)}}},Sa=class extends Pp{static canHandle(t,e){return t.getUint8(e+1)===225&&t.getUint32(e+4)===1165519206&&t.getUint16(e+8)===0}parse(){return j(this,null,function*(){this.parseHeader();let{options:t}=this;return t.ifd0.enabled&&(yield this.parseIfd0Block()),t.exif.enabled&&(yield this.safeParse("parseExifBlock")),t.gps.enabled&&(yield this.safeParse("parseGpsBlock")),t.interop.enabled&&(yield this.safeParse("parseInteropBlock")),t.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(t){let e=this[t]();return e.catch!==void 0&&(e=e.catch(this.handleError)),e}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let t=this.chunk.getUint16(this.ifd0Offset),e=this.ifd0Offset+2+12*t;this.ifd1Offset=this.chunk.getUint32(e)}}parseBlock(t,e){let n=new Map;return this[e]=n,this.parseTags(t,e,n),n}parseIfd0Block(){return j(this,null,function*(){if(this.ifd0)return;let{file:t}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Tt("Malformed EXIF data"),!t.chunked&&this.ifd0Offset>t.byteLength&&Tt(`IFD0 offset points to outside of file.
26
+ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${t.byteLength}`),t.tiff&&(yield t.ensureChunk(this.ifd0Offset,eb(this.options)));let e=this.parseBlock(this.ifd0Offset,"ifd0");return e.size!==0?(this.exifOffset=e.get(34665),this.interopOffset=e.get(40965),this.gpsOffset=e.get(34853),this.xmp=e.get(700),this.iptc=e.get(33723),this.icc=e.get(34675),this.options.sanitize&&(e.delete(34665),e.delete(40965),e.delete(34853),e.delete(700),e.delete(33723),e.delete(34675)),e):void 0})}parseExifBlock(){return j(this,null,function*(){if(this.exif||(this.ifd0||(yield this.parseIfd0Block()),this.exifOffset===void 0))return;this.file.tiff&&(yield this.file.ensureChunk(this.exifOffset,eb(this.options)));let t=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=t.get(40965)),this.makerNote=t.get(37500),this.userComment=t.get(37510),this.options.sanitize&&(t.delete(40965),t.delete(37500),t.delete(37510)),this.unpack(t,41728),this.unpack(t,41729),t})}unpack(t,e){let n=t.get(e);n&&n.length===1&&t.set(e,n[0])}parseGpsBlock(){return j(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let t=this.parseBlock(this.gpsOffset,"gps");return t&&t.has(2)&&t.has(4)&&(t.set("latitude",ob(...t.get(2),t.get(1))),t.set("longitude",ob(...t.get(4),t.get(3)))),t})}parseInteropBlock(){return j(this,null,function*(){if(!this.interop&&(this.ifd0||(yield this.parseIfd0Block()),this.interopOffset!==void 0||this.exif||(yield this.parseExifBlock()),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")})}parseThumbnailBlock(t=!1){return j(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||t))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return j(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let t=this.ifd1.get(513),e=this.ifd1.get(514);return this.chunk.getUint8Array(t,e)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let t,e,n,r={};for(e of vt)if(t=this[e],!db(t))if(n=this.canTranslate?this.translateBlock(t,e):Object.fromEntries(t),this.options.mergeOutput){if(e==="ifd1")continue;Object.assign(r,n)}else r[e]=n;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(t,e){if(this.globalOptions.mergeOutput)Object.assign(t,e);else for(let[n,r]of Object.entries(e))this.assignObjectToOutput(t,n,r)}};function ob(i,t,e,n){var r=i+t/60+e/3600;return n!=="S"&&n!=="W"||(r*=-1),r}je(Sa,"type","tiff"),je(Sa,"headerLength",10),vi.set("tiff",Sa);var oL=Object.freeze({__proto__:null,default:oP,Exifr:so,fileParsers:$l,segmentParsers:vi,fileReaders:ka,tagKeys:Ta,tagValues:kp,tagRevivers:Tp,createDictionary:pb,extendDictionary:ub,fetchUrlAsArrayBuffer:Hl,readBlobAsArrayBuffer:Ia,chunkedProps:no,otherSegments:ql,segments:Da,tiffBlocks:vt,segmentsAndBlocks:ro,tiffExtractables:oo,inheritables:Gl,allFormatters:ao,Options:lr,parse:hb}),Mp={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},aL=Object.assign({},Mp,{firstChunkSize:4e4,gps:[1,2,3,4]});var sL=Object.assign({},Mp,{tiff:!1,ifd1:!0,mergeOutput:!1});var dP=Object.assign({},Mp,{firstChunkSize:4e4,ifd0:[274]});function pP(i){return j(this,null,function*(){let t=new so(dP);yield t.read(i);let e=yield t.parse();if(e&&e.ifd0)return e.ifd0[274]})}var uP=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}}),xa=!0,Ca=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let t=i.match(/OS (\d+)_(\d+)/);if(t){let[,e,n]=t;xa=Number(e)+.1*Number(n)<13.4,Ca=!1}}else if(i.includes("OS X 10")){let[,t]=i.match(/OS X 10[_.](\d+)/);xa=Ca=Number(t)<15}if(i.includes("Chrome/")){let[,t]=i.match(/Chrome\/(\d+)/);xa=Ca=Number(t)<81}else if(i.includes("Firefox/")){let[,t]=i.match(/Firefox\/(\d+)/);xa=Ca=Number(t)<77}}function mb(i){return j(this,null,function*(){let t=yield pP(i);return Object.assign({canvas:xa,css:Ca},uP[t])})}var Ep=class extends sr{constructor(...t){super(...t),je(this,"ranges",new Ip),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(t,e,n){if(t===0&&this.byteLength===0&&n){let r=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(r)}else{let r=t+e;if(r>this.byteLength){let{dataView:o}=this._extend(r);this._swapDataView(o)}}}_extend(t){let e;e=cb?lb.allocUnsafe(t):new Uint8Array(t);let n=new DataView(e.buffer,e.byteOffset,e.byteLength);return e.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:e,dataView:n}}subarray(t,e,n=!1){return e=e||this._lengthToEnd(t),n&&this._tryExtend(t,e),this.ranges.add(t,e),super.subarray(t,e)}set(t,e,n=!1){n&&this._tryExtend(e,t.byteLength,t);let r=super.set(t,e);return this.ranges.add(e,r.byteLength),r}ensureChunk(t,e){return j(this,null,function*(){this.chunked&&(this.ranges.available(t,e)||(yield this.readChunk(t,e)))})}available(t,e){return this.ranges.available(t,e)}},Ip=class{constructor(){je(this,"list",[])}get length(){return this.list.length}add(t,e,n=0){let r=t+e,o=this.list.filter(a=>ab(t,a.offset,r)||ab(t,a.end,r));if(o.length>0){t=Math.min(t,...o.map(s=>s.offset)),r=Math.max(r,...o.map(s=>s.end)),e=r-t;let a=o.shift();a.offset=t,a.length=e,a.end=r,this.list=this.list.filter(s=>!o.includes(s))}else this.list.push({offset:t,length:e,end:r})}available(t,e){let n=t+e;return this.list.some(r=>r.offset<=t&&n<=r.end)}};function ab(i,t,e){return i<=t&&t<=e}var Dp=class extends Ep{constructor(t,e){super(0),je(this,"chunksRead",0),this.input=t,this.options=e}readWhole(){return j(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return j(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return j(this,arguments,function*(t=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let e=this.options.chunkSize,n=yield this.readChunk(t,e);return!!n&&n.byteLength===e})}readChunk(t,e){return j(this,null,function*(){if(this.chunksRead++,(e=this.safeWrapAddress(t,e))!==0)return this._readChunk(t,e)})}safeWrapAddress(t,e){return this.size!==void 0&&t+e>this.size?Math.max(0,this.size-t):e}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(){}};ka.set("blob",class extends Dp{readWhole(){return j(this,null,function*(){this.chunked=!1;let i=yield Ia(this.input);this._swapArrayBuffer(i)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(i,t){return j(this,null,function*(){let e=t?i+t:void 0,n=this.input.slice(i,e),r=yield Ia(n);return this.set(r,i,!0)})}});var fb={strings:{generatingThumbnails:"Generating thumbnails..."}};var hP={version:"4.1.1"};function mP(i,t,e){try{i.getContext("2d").getImageData(0,0,1,1)}catch(n){if(n.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(n=>{i.toBlob(n,t,e)}).then(n=>{if(n===null)throw new Error("cannot read image, probably an svg with external resources");return n}):Promise.resolve().then(()=>Z0(i.toDataURL(t,e),{})).then(n=>{if(n===null)throw new Error("could not extract blob, probably an old browser");return n})}function fP(i,t){let e=i.width,n=i.height;(t.deg===90||t.deg===270)&&(e=i.height,n=i.width);let r=document.createElement("canvas");r.width=e,r.height=n;let o=r.getContext("2d");return o.translate(e/2,n/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),r}function gP(i){let t=i.width/i.height,e=5e6,n=4096,r=Math.floor(Math.sqrt(e*t)),o=Math.floor(e/Math.sqrt(e*t));if(r>n&&(r=n,o=Math.round(r/t)),o>n&&(o=n,r=Math.round(t*o)),i.width>r){let a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(i,0,0,r,o),a}return i}var bP={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},lo=class extends fi{constructor(t,e){if(super(t,_(_({},bP),e)),this.onFileAdded=n=>{!n.preview&&n.data&&jl(n.type)&&!n.isRemote&&this.addToQueue(n.id)},this.onCancelRequest=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1),n.preview&&Ll(n.preview)&&URL.revokeObjectURL(n.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||Ll(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=n=>{n.forEach(o=>{let a=this.uppy.getFile(o);this.uppy.emit("preprocess-progress",a,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let r=()=>{n.forEach(o=>{let a=this.uppy.getFile(o);this.uppy.emit("preprocess-complete",a)})};return new Promise(o=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{r(),o()}):(r(),o())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=fb,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(t,e,n){let r=URL.createObjectURL(t.data),o=new Promise((s,l)=>{let c=new Image;c.src=r,c.addEventListener("load",()=>{URL.revokeObjectURL(r),s(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(r),l(d.error||new Error("Could not create thumbnail"))})}),a=mb(t.data).catch(()=>1);return Promise.all([o,a]).then(s=>{let[l,c]=s,d=this.getProportionalDimensions(l,e,n,c.deg),p=fP(l,c),v=this.resizeImage(p,d.width,d.height);return mP(v,this.thumbnailType,80)}).then(s=>URL.createObjectURL(s))}getProportionalDimensions(t,e,n,r){let o=t.width/t.height;return(r===90||r===270)&&(o=t.height/t.width),e!=null?{width:e,height:Math.round(e/o)}:n!=null?{width:Math.round(n*o),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}}resizeImage(t,e,n){let r=gP(t),o=Math.ceil(Math.log2(r.width/e));o<1&&(o=1);let a=e*2**(o-1),s=n*2**(o-1),l=2;for(;o--;){let c=document.createElement("canvas");c.width=a,c.height=s,c.getContext("2d").drawImage(r,0,0,a,s),r=c,a=Math.round(a/l),s=Math.round(s/l)}return r}setPreviewURL(t,e){this.uppy.setFileState(t,{preview:e})}addToQueue(t){this.queue.push(t),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let t=this.uppy.getFile(this.queue.shift());return t?this.requestThumbnail(t).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(t){return jl(t.type)&&!t.isRemote?this.createThumbnail(t,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(e=>{this.setPreviewURL(t.id,e),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${t.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(t.id),e)}).catch(e=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${t.id}:`,"warning"),this.uppy.log(e,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(t.id),e)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};lo.VERSION=hP.version;function vP(i){if(typeof i=="string"){let t=document.querySelectorAll(i);return t.length===0?null:Array.from(t)}return typeof i=="object"&&ba(i)?[i]:null}var Op=vP;var Qi=Array.from;function Yl(i,t,e,n){let{onSuccess:r}=n;i.readEntries(o=>{let a=[...t,...o];o.length?queueMicrotask(()=>{Yl(i,a,e,{onSuccess:r})}):r(a)},o=>{e(o),r(t)})}function gb(i,t){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((n,r)=>i.file(n,r))},values(){return ds(this,null,function*(){let n=i.createReader(),r=yield new Pr(new Promise(o=>{Yl(n,[],t,{onSuccess:a=>o(a.map(s=>gb(s,t)))})}));yield*ps(r)})},isSameEntry:void 0}}function bb(i,t,e){try{return e===void 0&&(e=void 0),function(){return ds(this,null,function*(){let n=()=>`${t}/${i.name}`;if(i.kind==="file"){let l=yield new Pr(i.getFile());l!=null?(l.relativePath=t?n():null,yield l):e!=null&&(yield e)}else if(i.kind==="directory")try{for(var r=us(i.values()),o,a,s;o=!(a=yield new Pr(r.next())).done;o=!1){let l=a.value;yield*ps(bb(l,t?n():i.name))}}catch{s=[a]}finally{try{o&&(a=r.return)&&(yield new Pr(a.call(r)))}finally{if(s)throw s[0]}}else e!=null&&(yield e)})}()}catch(n){return Promise.reject(n)}}function Fp(i,t){return ds(this,null,function*(){let e=yield new Pr(Promise.all(Array.from(i.items,n=>j(this,null,function*(){var r;let o,a=()=>typeof n.getAsEntry=="function"?n.getAsEntry():n.webkitGetAsEntry();return(r=o)!=null||(o=gb(a(),t)),{fileSystemHandle:o,lastResortFile:n.getAsFile()}}))));for(let{lastResortFile:n,fileSystemHandle:r}of e)if(r!=null)try{yield*ps(bb(r,"",n))}catch(o){n!=null?yield n:t(o)}else n!=null&&(yield n)})}function Ap(i){let t=Qi(i.files);return Promise.resolve(t)}function Ma(i,t){return j(this,null,function*(){var e;let n=(e=t?.logDropError)!=null?e:Function.prototype;try{let l=[];try{for(var r=us(Fp(i,n)),o,a,s;o=!(a=yield r.next()).done;o=!1){let c=a.value;l.push(c)}}catch{s=[a]}finally{try{o&&(a=r.return)&&(yield a.call(r))}finally{if(s)throw s[0]}}return l}catch{return Ap(i)}})}var Gb=Ne(Gt(),1);function Oa(i){return k(_({},i),{type:i.mimeType,extension:i.name?Xi(i.name).extension:null})}var Fa,dt,Rp,vb,Aa=0,Eb=[],_t=Xe,_b=_t.__b,yb=_t.__r,wb=_t.diffed,xb=_t.__c,Cb=_t.unmount,Sb=_t.__;function Np(i,t){_t.__h&&_t.__h(dt,i,Aa||t),Aa=0;var e=dt.__H||(dt.__H={__:[],__h:[]});return i>=e.__.length&&e.__.push({}),e.__[i]}function ji(i){return Aa=1,_P(Db,i)}function _P(i,t,e){var n=Np(Fa++,2);if(n.t=i,!n.__c&&(n.__=[e?e(t):Db(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=dt,!dt.u)){var r=function(s,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(v){return!!v.__c});if(d.every(function(v){return!v.__N}))return!o||o.call(this,s,l,c);var p=n.__c.props!==s;return d.forEach(function(v){if(v.__N){var g=v.__[0];v.__=v.__N,v.__N=void 0,g!==v.__[0]&&(p=!0)}}),o&&o.call(this,s,l,c)||p};dt.u=!0;var o=dt.shouldComponentUpdate,a=dt.componentWillUpdate;dt.componentWillUpdate=function(s,l,c){if(this.__e){var d=o;o=void 0,r(s,l,c),o=d}a&&a.call(this,s,l,c)},dt.shouldComponentUpdate=r}return n.__N||n.__}function Zi(i,t){var e=Np(Fa++,3);!_t.__s&&Ib(e.__H,t)&&(e.__=i,e.i=t,dt.__H.__h.push(e))}function cr(i){return Aa=5,dr(function(){return{current:i}},[])}function dr(i,t){var e=Np(Fa++,7);return Ib(e.__H,t)&&(e.__=i(),e.__H=t,e.__h=i),e.__}function pr(i,t){return Aa=8,dr(function(){return i},t)}function yP(){for(var i;i=Eb.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Xl),i.__H.__h.forEach(Bp),i.__H.__h=[]}catch(t){i.__H.__h=[],_t.__e(t,i.__v)}}_t.__b=function(i){dt=null,_b&&_b(i)},_t.__=function(i,t){i&&t.__k&&t.__k.__m&&(i.__m=t.__k.__m),Sb&&Sb(i,t)},_t.__r=function(i){yb&&yb(i),Fa=0;var t=(dt=i.__c).__H;t&&(Rp===dt?(t.__h=[],dt.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(Xl),t.__h.forEach(Bp),t.__h=[],Fa=0)),Rp=dt},_t.diffed=function(i){wb&&wb(i);var t=i.__c;t&&t.__H&&(t.__H.__h.length&&(Eb.push(t)!==1&&vb===_t.requestAnimationFrame||((vb=_t.requestAnimationFrame)||wP)(yP)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),Rp=dt=null},_t.__c=function(i,t){t.some(function(e){try{e.__h.forEach(Xl),e.__h=e.__h.filter(function(n){return!n.__||Bp(n)})}catch(n){t.some(function(r){r.__h&&(r.__h=[])}),t=[],_t.__e(n,e.__v)}}),xb&&xb(i,t)},_t.unmount=function(i){Cb&&Cb(i);var t,e=i.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{Xl(n)}catch(r){t=r}}),e.__H=void 0,t&&_t.__e(t,e.__v))};var Pb=typeof requestAnimationFrame=="function";function wP(i){var t,e=function(){clearTimeout(n),Pb&&cancelAnimationFrame(t),setTimeout(i)},n=setTimeout(e,100);Pb&&(t=requestAnimationFrame(e))}function Xl(i){var t=dt,e=i.__c;typeof e=="function"&&(i.__c=void 0,e()),dt=t}function Bp(i){var t=dt;i.__c=i.__(),dt=t}function Ib(i,t){return!i||i.length!==t.length||t.some(function(e,n){return e!==i[n]})}function Db(i,t){return typeof t=="function"?t(i):t}function xP(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),u("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),u("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),u("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),u("path",{d:"M4 4h18v18H4z"})))}function CP(i){let{pluginName:t,i18n:e,onAuth:n}=i,r=t==="Google Drive",o=pr(a=>{a.preventDefault(),n()},[n]);return u("form",{onSubmit:o},r?u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},u(xP,null),e("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},e("authenticateWith",{pluginName:t})))}var SP=i=>{let{pluginName:t,i18n:e,onAuth:n}=i;return u(CP,{pluginName:t,i18n:e,onAuth:n})};function Kl(i){let{loading:t,pluginName:e,pluginIcon:n,i18n:r,handleAuth:o,renderForm:a=SP}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},n()),u("div",{className:"uppy-Provider-authTitle"},r("authenticateWithTitle",{pluginName:e})),a({pluginName:e,i18n:r,loading:t,onAuth:o}))}var kb=Ne(Gt(),1);function zp(i){let{i18n:t,logout:e,username:n}=i;return u(mi,null,n&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},n),u("button",{type:"button",onClick:e,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},t("logOut")))}function Lp(i){let{openFolder:t,title:e,breadcrumbsIcon:n,breadcrumbs:r,i18n:o}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},n),r.map((a,s)=>{var l;return u(mi,null,u("button",{key:a.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(a.id)},a.type==="root"?e:(l=a.data.name)!=null?l:o("unnamed")),r.length===s+1?"":" / ")}))}function jp(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,kb.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(Lp,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(zp,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Hp(){return Hp=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Hp.apply(null,arguments)}var PP={position:"relative",width:"100%",minHeight:"100%"},EP={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Vp=class extends ni{constructor(t){super(t),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:t}=this.state;t!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(t){let E=t,{data:e,rowHeight:n,renderRow:r,overscanCount:o=10}=E,a=Sr(E,["data","rowHeight","renderRow","overscanCount"]),{offset:s,height:l}=this.state,c=Math.floor(s/n),d=Math.floor(l/n);o&&(c=Math.max(0,c-c%o),d+=o);let p=c+d+4,v=e.slice(c,p),g=k(_({},PP),{height:e.length*n}),w=k(_({},EP),{top:c*n});return u("div",Hp({onScroll:this.handleScroll},a),u("div",{role:"presentation",style:g},u("div",{role:"presentation",style:w},v.map(r))))}},Ql=Vp;var Tb=Ne(Gt(),1);function IP(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function DP(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function kP(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),u("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function co(i){let{itemIconString:t,alt:e=void 0}=i;if(t===null)return null;switch(t){case"file":return u(IP,null);case"folder":return u(DP,null);case"video":return u(kP,null);default:return u("img",{src:t,alt:e,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function TP(i){var t,e;let{file:n,toggleCheckbox:r,className:o,isDisabled:a,restrictionError:s,showTitles:l,children:c=null,i18n:d}=i;return u("li",{className:o,title:a&&s?s:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:r,name:"listitem",id:n.id,checked:n.status==="checked",disabled:a,"data-uppy-super-focusable":!0}),u("label",{htmlFor:n.id,"aria-label":(t=n.data.name)!=null?t:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(co,{itemIconString:n.data.thumbnail||n.data.icon}),l&&((e=n.data.name)!=null?e:d("unnamed")),c))}var Up=TP;function Wp(i){var t,e,n;let{file:r,openFolder:o,className:a,isDisabled:s,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:p}=i;return u("li",{className:a,title:r.status!=="checked"&&l?l:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:r.id,checked:r.status==="checked","aria-label":r.data.isFolder?p("allFilesFromFolderNamed",{name:(t=r.data.name)!=null?t:p("unnamed")}):null,disabled:s,"data-uppy-super-focusable":!0}),r.data.isFolder?u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>o(r.id),"aria-label":p("openFolderNamed",{name:(e=r.data.name)!=null?e:p("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(co,{itemIconString:r.data.icon})),d&&r.data.name?u("span",null,r.data.name):p("unnamed")):u("label",{htmlFor:r.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(co,{itemIconString:r.data.icon})),d&&((n=r.data.name)!=null?n:p("unnamed"))))}function $p(i){let{viewType:t,toggleCheckbox:e,showTitles:n,i18n:r,openFolder:o,file:a,utmSource:s}=i,l=a.type==="folder"?null:a.restrictionError,c=!!l&&a.status!=="checked",d={file:a,openFolder:o,toggleCheckbox:e,utmSource:s,i18n:r,viewType:t,showTitles:n,className:(0,Tb.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":c},{"uppy-ProviderBrowserItem--noPreview":a.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":a.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":a.status==="partial"}),isDisabled:c,restrictionError:l};switch(t){case"grid":return u(Up,d);case"list":return u(Wp,d);case"unsplash":return u(Up,d,u("a",{href:`${a.data.author.url}?utm_source=${s}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},a.data.author.name));default:throw new Error(`There is no such type ${t}`)}}function MP(i){let{displayedPartialTree:t,viewType:e,toggleCheckbox:n,handleScroll:r,showTitles:o,i18n:a,isLoading:s,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:p}=i,[v,g]=ji(!1);if(Zi(()=>{let E=F=>{F.key==="Shift"&&g(!1)},L=F=>{F.key==="Shift"&&g(!0)};return document.addEventListener("keyup",E),document.addEventListener("keydown",L),()=>{document.removeEventListener("keyup",E),document.removeEventListener("keydown",L)}},[]),s)return u("div",{className:"uppy-Provider-loading"},typeof s=="string"?s:a("loading"));if(t.length===0)return u("div",{className:"uppy-Provider-empty"},c);let w=E=>u($p,{viewType:e,toggleCheckbox:L=>{var F;L.stopPropagation(),L.preventDefault(),(F=document.getSelection())==null||F.removeAllRanges(),n(E,v)},showTitles:o,i18n:a,openFolder:l,file:E,utmSource:p});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(Ql,{data:t,renderRow:w,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,role:"listbox",tabIndex:-1},t.map(w)))}var Zl=MP;var OP=(i,t,e,n,r)=>{let o=t.filter(g=>g.isFolder===!0),a=t.filter(g=>g.isFolder===!1),s=e.type==="folder"&&e.status==="checked",l=o.map(g=>({type:"folder",id:g.requestPath,cached:!1,nextPagePath:null,status:s?"checked":"unchecked",parentId:e.id,data:g})),c=a.map(g=>{let w=r(g);return{type:"file",id:g.requestPath,restrictionError:w,status:s&&!w?"checked":"unchecked",parentId:e.id,data:g}}),d=k(_({},e),{cached:!0,nextPagePath:n});return[...i.map(g=>g.id===d.id?d:g),...l,...c]},Mb=OP;var FP=(i,t,e,n,r)=>{let o=i.find(w=>w.id===t),a=e.filter(w=>w.isFolder===!0),s=e.filter(w=>w.isFolder===!1),l=k(_({},o),{nextPagePath:n}),c=i.map(w=>w.id===l.id?l:w),d=l.type==="folder"&&l.status==="checked",p=a.map(w=>({type:"folder",id:w.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:w})),v=s.map(w=>{let E=r(w);return{type:"file",id:w.requestPath,restrictionError:E,status:d&&!E?"checked":"unchecked",parentId:l.id,data:w}});return[...c,...p,...v]},Ob=FP;var AP=i=>i.map(t=>_({},t)),Jl=AP;var qp=(i,t,e)=>{i.filter(r=>r.type!=="root"&&r.parentId===t).forEach(r=>{r.status=e&&!(r.type==="file"&&r.restrictionError)?"checked":"unchecked",qp(i,r.id,e)})},Gp=(i,t)=>{let e=i.find(a=>a.id===t);if(e.type==="root")return;let n=i.filter(a=>a.type!=="root"&&a.parentId===e.id&&!(a.type==="file"&&a.restrictionError)),r=n.every(a=>a.status==="checked"),o=n.every(a=>a.status==="unchecked");r?e.status="checked":o?e.status="unchecked":e.status="partial",Gp(i,e.parentId)},RP=(i,t)=>{let e=Jl(i);if(t.length>=2){let n=e.filter(r=>r.type!=="root"&&t.includes(r.id));n.forEach(r=>{r.type==="file"?r.status=r.restrictionError?"unchecked":"checked":r.status="checked"}),n.forEach(r=>{qp(e,r.id,!0)}),Gp(e,n[0].parentId)}else{let n=e.find(r=>r.id===t[0]);n.status=n.status==="checked"?"unchecked":"checked",qp(e,n.id,n.status==="checked"),Gp(e,n.parentId)}return e},Fb=RP;var Xp=Ne(Rb(),1);var Ba=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},Kp=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},Bb=i=>globalThis.DOMException===void 0?new Kp(i):new DOMException(i),Nb=i=>{let t=i.reason===void 0?Bb("This operation was aborted."):i.reason;return t instanceof Error?t:Bb(t)};function Qp(i,t){let{milliseconds:e,fallback:n,message:r,customTimers:o={setTimeout,clearTimeout}}=t,a,s,c=new Promise((d,p)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(t.signal){let{signal:g}=t;g.aborted&&p(Nb(g)),s=()=>{p(Nb(g))},g.addEventListener("abort",s,{once:!0})}if(e===Number.POSITIVE_INFINITY){i.then(d,p);return}let v=new Ba;a=o.setTimeout.call(void 0,()=>{if(n){try{d(n())}catch(g){p(g)}return}typeof i.cancel=="function"&&i.cancel(),r===!1?d():r instanceof Error?p(r):(v.message=r??`Promise timed out after ${e} milliseconds`,p(v))},e),j(this,null,function*(){try{d(yield i)}catch(g){p(g)}})}).finally(()=>{c.clear(),s&&t.signal&&t.signal.removeEventListener("abort",s)});return c.clear=()=>{o.clearTimeout.call(void 0,a),a=void 0},c}function Zp(i,t,e){let n=0,r=i.length;for(;r>0;){let o=Math.trunc(r/2),a=n+o;e(i[a],t)<=0?(n=++a,r-=o+1):r=o}return n}var tc=class{#e=[];enqueue(t,e){e=_({priority:0},e);let n={priority:e.priority,run:t};if(this.size&&this.#e[this.size-1].priority>=e.priority){this.#e.push(n);return}let r=Zp(this.#e,n,(o,a)=>a.priority-o.priority);this.#e.splice(r,0,n)}dequeue(){return this.#e.shift()?.run}filter(t){return this.#e.filter(e=>e.priority===t.priority).map(e=>e.run)}get size(){return this.#e.length}};var ic=class extends Xp.default{#e;#a;#o=0;#h;#s;#m=0;#i;#l;#t;#f;#n=0;#c;#r;#g;timeout;constructor(t){if(super(),t=_({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:tc},t),!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#e=t.carryoverConcurrencyCount,this.#a=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#h=t.intervalCap,this.#s=t.interval,this.#t=new t.queueClass,this.#f=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#g=t.throwOnTimeout===!0,this.#r=t.autoStart===!1}get#_(){return this.#a||this.#o<this.#h}get#y(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#x(){this.#v(),this.#b(),this.#l=void 0}get#C(){let t=Date.now();if(this.#i===void 0){let e=this.#m-t;if(e<0)this.#o=this.#e?this.#n:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#x()},e)),!0}return!1}#d(){if(this.#t.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#r){let t=!this.#C;if(this.#_&&this.#y){let e=this.#t.dequeue();return e?(this.emit("active"),e(),t&&this.#b(),!0):!1}}return!1}#b(){this.#a||this.#i!==void 0||(this.#i=setInterval(()=>{this.#v()},this.#s),this.#m=Date.now()+this.#s)}#v(){this.#o===0&&this.#n===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#o=this.#e?this.#n:0,this.#p()}#p(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#c=t,this.#p()}#S(t){return j(this,null,function*(){return new Promise((e,n)=>{t.addEventListener("abort",()=>{n(t.reason)},{once:!0})})})}add(n){return j(this,arguments,function*(t,e={}){return e=_({timeout:this.timeout,throwOnTimeout:this.#g},e),new Promise((r,o)=>{this.#t.enqueue(()=>j(this,null,function*(){this.#n++,this.#o++;try{e.signal?.throwIfAborted();let a=t({signal:e.signal});e.timeout&&(a=Qp(Promise.resolve(a),{milliseconds:e.timeout})),e.signal&&(a=Promise.race([a,this.#S(e.signal)]));let s=yield a;r(s),this.emit("completed",s)}catch(a){if(a instanceof Ba&&!e.throwOnTimeout){r();return}o(a),this.emit("error",a)}finally{this.#w()}}),e),this.emit("add"),this.#d()})})}addAll(t,e){return j(this,null,function*(){return Promise.all(t.map(n=>j(this,null,function*(){return this.add(n,e)})))})}start(){return this.#r?(this.#r=!1,this.#p(),this):this}pause(){this.#r=!0}clear(){this.#t=new this.#f}onEmpty(){return j(this,null,function*(){this.#t.size!==0&&(yield this.#u("empty"))})}onSizeLessThan(t){return j(this,null,function*(){this.#t.size<t||(yield this.#u("next",()=>this.#t.size<t))})}onIdle(){return j(this,null,function*(){this.#n===0&&this.#t.size===0||(yield this.#u("idle"))})}#u(t,e){return j(this,null,function*(){return new Promise(n=>{let r=()=>{e&&!e()||(this.off(t,r),n())};this.on(t,r)})})}get size(){return this.#t.size}sizeBy(t){return this.#t.filter(t).length}get pending(){return this.#n}get isPaused(){return this.#r}};var zb=(i,t,e,n,r)=>j(void 0,null,function*(){let o=[],a=e.cached?e.nextPagePath:e.id;for(;a;){let p=yield n(a);o=o.concat(p.items),a=p.nextPagePath}let s=o.filter(p=>p.isFolder===!0),l=o.filter(p=>p.isFolder===!1),c=s.map(p=>({type:"folder",id:p.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:e.id,data:p})),d=l.map(p=>{let v=r(p);return{type:"file",id:p.requestPath,restrictionError:v,status:v?"unchecked":"checked",parentId:e.id,data:p}});e.cached=!0,e.nextPagePath=null,t.push(...d,...c),c.forEach(p=>j(void 0,null,function*(){i.add(()=>zb(i,t,p,n,r))}))}),zP=(i,t,e,n)=>j(void 0,null,function*(){let r=new ic({concurrency:6}),o=Jl(i);return o.filter(s=>s.type==="folder"&&s.status==="checked"&&(s.cached===!1||s.nextPagePath)).forEach(s=>{r.add(()=>zb(r,o,s,t,e))}),r.on("completed",()=>{let s=o.filter(l=>l.type==="file"&&l.status==="checked").length;n(s)}),yield r.onIdle(),o}),Lb=zP;var ur={afterOpenFolder:Mb,afterScrollFolder:Ob,afterToggleCheckbox:Fb,afterFill:Lb};var LP=i=>{let{scrollHeight:t,scrollTop:e,offsetHeight:n}=i.target;return t-(e+n)<50},nc=LP;var jP=i=>t=>{if(!t.isAuthError){if(t.name==="AbortError"){i.log("Aborting request","warning");return}i.log(t,"error"),t.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(t.message)},"warning",5e3)}},_n=jP;var HP=(i,t,e,n)=>{let r=t.findIndex(o=>o.id===n);if(r!==-1&&e){let o=t.findIndex(s=>s.id===i);return t.slice(Math.min(r,o),Math.max(r,o)+1).map(s=>s.id)}return[i]},rc=HP;function VP(i){let{searchString:t,setSearchString:e,submitSearchString:n,wrapperClassName:r,inputClassName:o,inputLabel:a,clearSearchLabel:s="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,p=w=>{e(w.target.value)},v=pr(w=>{w.preventDefault(),n()},[n]),[g]=ji(()=>{let w=document.createElement("form");return w.setAttribute("tabindex","-1"),w.id=Bn(),w});return Zi(()=>(document.body.appendChild(g),g.addEventListener("submit",v),()=>{g.removeEventListener("submit",v),document.body.removeChild(g)}),[g,v]),u("section",{className:r},u("input",{className:`uppy-u-reset ${o}`,type:"search","aria-label":a,placeholder:a,value:t,onInput:p,form:g.id,"data-uppy-super-focusable":!0}),!l&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&t&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":s,title:s,onClick:()=>e("")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:g.id},c))}var po=VP;var Hb=Ne(Gt(),1);var UP=i=>i.filter(e=>e.type==="file"&&e.status==="checked"?!0:e.type==="folder"&&e.status==="checked"?!i.some(r=>r.type!=="root"&&r.parentId===e.id):!1).length,jb=UP;function Na(i){let{cancelSelection:t,donePicking:e,i18n:n,partialTree:r,validateAggregateRestrictions:o}=i,a=dr(()=>o(r),[r,o]),s=dr(()=>jb(r),[r]);return s===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,Hb.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":a}),disabled:!!a,onClick:e,type:"button"},n("selectX",{smart_count:s})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:t,type:"button"},n("cancel"))),a&&u("div",{className:"uppy-ProviderBrowser-footer-error"},a))}var WP=(i,t,e)=>{var n,r;return{id:i.id,source:t.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(n=i.author)==null?void 0:n.name,authorUrl:(r=i.author)==null?void 0:r.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:t.opts.companionUrl,url:`${e.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:e.name,provider:e.provider,requestClientId:e.provider}}},Vb=WP;var $P=(i,t,e)=>{let n=i.map(a=>Vb(a,t,e)),r=[],o=[];n.forEach(a=>{t.uppy.checkIfFileAlreadyExists(Pl(a,t.uppy.getID()))?o.push(a):r.push(a)}),r.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:r.length})),o.length>0&&t.uppy.info(`Not adding ${o.length} files because they already exist`),t.uppy.addFiles(r)},oc=$P;var Ub=(i,t,e)=>{let n=t===null?"null":t;if(e[n])return e[n];let r=i.find(a=>a.id===t);if(r.type==="root")return[];let o=[...Ub(i,r.parentId,e),r];return e[n]=o,o},qP=i=>{let t=Object.create(null);return i.filter(r=>r.type==="file"&&r.status==="checked").map(r=>{let o=Ub(i,r.id,t),a=o.findIndex(d=>d.type==="folder"&&d.status==="checked"),s=o.slice(a),l=`/${o.map(d=>d.data.name).join("/")}`,c=s.length===1?void 0:s.map(d=>d.data.name).join("/");return k(_({},r.data),{absDirPath:l,relDirPath:c})})},ac=qP;var GP=(i,t)=>{let e=i.find(r=>r.id===t),n=[];for(;n=[e,...n],e.type!=="root";){let r=e.parentId;e=i.find(o=>o.id===r)}return n},Wb=GP;function zn(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var YP=0;function qb(i){return"__private_"+YP+++"_"+i}var XP={version:"4.4.1"};function La(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var $b=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),hr=qb("abortController"),Hi=qb("withAbort"),za=class{constructor(t,e){Object.defineProperty(this,Hi,{value:KP}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,hr,{writable:!0,value:void 0}),this.validateSingleFile=r=>{let o=Oa(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r,currentFolderId:o,searchString:a}=this.plugin.getPluginState(),s=r.filter(c=>c.type!=="root"&&c.parentId===o);return a===""?s:s.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(a.toLowerCase())!==-1})},this.validateAggregateRestrictions=r=>{let a=r.filter(s=>s.type==="file"&&s.status==="checked").map(s=>s.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=t,this.provider=e.provider;let n={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=_(_({},n),e),this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState($b(this.plugin.rootFolderId))}tearDown(){}setLoading(t){this.plugin.setPluginState({loading:t})}cancelSelection(){let{partialTree:t}=this.plugin.getPluginState(),e=t.map(n=>n.type==="root"?n:k(_({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:e})}openFolder(t){return j(this,null,function*(){this.lastCheckbox=null;let{partialTree:e}=this.plugin.getPluginState(),n=e.find(r=>r.id===t);if(n.cached){this.plugin.setPluginState({currentFolderId:t,searchString:""});return}this.setLoading(!0),yield zn(this,Hi)[Hi](r=>j(this,null,function*(){let o=t,a=[];do{let{username:l,nextPagePath:c,items:d}=yield this.provider.list(o,{signal:r});this.plugin.setPluginState({username:l}),o=c,a=a.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:a.length}))}while(this.opts.loadAllFiles&&o);let s=ur.afterOpenFolder(e,a,n,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:s,currentFolderId:t,searchString:""})})).catch(_n(this.plugin.uppy)),this.setLoading(!1)})}logout(){return j(this,null,function*(){yield zn(this,Hi)[Hi](t=>j(this,null,function*(){let e=yield this.provider.logout({signal:t});if(e.ok){if(!e.revoked){let n=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:e.manual_revoke_url});this.plugin.uppy.info(n,"info",7e3)}this.plugin.setPluginState(k(_({},$b(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(_n(this.plugin.uppy))})}handleAuth(t){return j(this,null,function*(){yield zn(this,Hi)[Hi](e=>j(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:t,signal:e}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(_n(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(t){return j(this,null,function*(){let{partialTree:e,currentFolderId:n}=this.plugin.getPluginState(),r=e.find(o=>o.id===n);nc(t)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,yield zn(this,Hi)[Hi](o=>j(this,null,function*(){let{nextPagePath:a,items:s}=yield this.provider.list(r.nextPagePath,{signal:o}),l=ur.afterScrollFolder(e,n,s,a,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(_n(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return j(this,null,function*(){let{partialTree:t}=this.plugin.getPluginState();this.setLoading(!0),yield zn(this,Hi)[Hi](e=>j(this,null,function*(){let n=yield ur.afterFill(t,a=>this.provider.list(a,{signal:e}),this.validateSingleFile,a=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:a}))});if(this.validateAggregateRestrictions(n)){this.plugin.setPluginState({partialTree:n});return}let o=ac(n);oc(o,this.plugin,this.provider),this.resetPluginState()})).catch(_n(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(t,e){let{partialTree:n}=this.plugin.getPluginState(),r=rc(t.id,this.getDisplayedPartialTree(),e,this.lastCheckbox),o=ur.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=t.id}render(t,e){e===void 0&&(e={});let{didFirstRender:n}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;n||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let o=_(_({},this.opts),e),{authenticated:a,loading:s}=this.plugin.getPluginState(),l=this.plugin.icon||La;if(a===!1)return u(Kl,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:o.renderAuthForm,loading:s});let{partialTree:c,currentFolderId:d,username:p,searchString:v}=this.plugin.getPluginState(),g=Wb(c,d);return u("div",{className:(0,Gb.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`)},u(jp,{showBreadcrumbs:o.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:g,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:p,i18n:r}),o.showFilter&&u(po,{searchString:v,setSearchString:w=>{this.plugin.setPluginState({searchString:w})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Zl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:o.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:o.viewType,showTitles:o.showTitles,i18n:this.plugin.uppy.i18n,isLoading:s,utmSource:"Companion"}),u(Na,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function KP(i){return j(this,null,function*(){var t;(t=zn(this,hr)[hr])==null||t.abort();let e=new AbortController;zn(this,hr)[hr]=e;let n=()=>{e.abort()};try{this.plugin.uppy.on("dashboard:close-panel",n),this.plugin.uppy.on("cancel-all",n),yield i(e.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",n),this.plugin.uppy.off("cancel-all",n),zn(this,hr)[hr]=void 0}})}za.VERSION=XP.version;var Yb=Ne(Gt(),1);var QP={version:"4.4.1"},ZP={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},JP={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},uo=class{constructor(t,e){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=n=>{let r=Oa(n);return this.plugin.uppy.validateSingleFile(r)},this.getDisplayedPartialTree=()=>{let{partialTree:n}=this.plugin.getPluginState();return n.filter(r=>r.type!=="root")},this.setSearchString=n=>{this.plugin.setPluginState({searchString:n}),n===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=n=>{let o=n.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=t,this.provider=e.provider,this.opts=_(_({},JP),e),this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(t){this.plugin.setPluginState({loading:t})}resetPluginState(){this.plugin.setPluginState(ZP)}cancelSelection(){let{partialTree:t}=this.plugin.getPluginState(),e=t.map(n=>n.type==="root"?n:k(_({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:e})}search(){return j(this,null,function*(){let{searchString:t}=this.plugin.getPluginState();if(t!==""){this.setLoading(!0);try{let e=yield this.provider.search(t),n=[{type:"root",id:null,cached:!1,nextPagePath:e.nextPageQuery},...e.items.map(r=>({type:"file",id:r.requestPath,status:"unchecked",parentId:null,data:r}))];this.plugin.setPluginState({partialTree:n,isInputMode:!1})}catch(e){_n(this.plugin.uppy)(e)}this.setLoading(!1)}})}handleScroll(t){return j(this,null,function*(){let{partialTree:e,searchString:n}=this.plugin.getPluginState(),r=e.find(o=>o.type==="root");if(nc(t)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let o=yield this.provider.search(n,r.nextPagePath),a=k(_({},r),{nextPagePath:o.nextPageQuery}),s=e.filter(c=>c.type!=="root"),l=[a,...s,...o.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(o){_n(this.plugin.uppy)(o)}this.isHandlingScroll=!1}})}donePicking(){return j(this,null,function*(){let{partialTree:t}=this.plugin.getPluginState(),e=ac(t);oc(e,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(t,e){let{partialTree:n}=this.plugin.getPluginState(),r=rc(t.id,this.getDisplayedPartialTree(),e,this.lastCheckbox),o=ur.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=t.id}render(t,e){e===void 0&&(e={});let{isInputMode:n,searchString:r,loading:o,partialTree:a}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy,l=_(_({},this.opts),e);return n?u(po,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("enterTextToSearch"),buttonLabel:s("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,Yb.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(po,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("search"),clearSearchLabel:s("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Zl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>j(this,null,function*(){}),noResultsLabel:s("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:o,i18n:s,virtualList:!1,utmSource:this.opts.utmSource}),u(Na,{partialTree:a,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};uo.VERSION=QP.version;var Xb=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function eE(i,t){return!!(i===t||Xb(i)&&Xb(t))}function tE(i,t){if(i.length!==t.length)return!1;for(var e=0;e<i.length;e++)if(!eE(i[e],t[e]))return!1;return!0}function Jp(i,t){t===void 0&&(t=tE);var e=null;function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(e&&e.lastThis===this&&t(r,e.lastArgs))return e.lastResult;var a=i.apply(this,r);return e={lastResult:a,lastArgs:r,lastThis:this},a}return n.clear=function(){e=null},n}var sc=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function ja(i,t){if(t){let e=i.querySelector(`[data-uppy-paneltype="${t}"]`);if(e)return e}return i}function Kb(i,t){let e=t[0];e&&(e.focus(),i.preventDefault())}function iE(i,t){let e=t[t.length-1];e&&(e.focus(),i.preventDefault())}function nE(i){return i.contains(document.activeElement)}function eu(i,t,e){let n=ja(e,t),r=Qi(n.querySelectorAll(sc)),o=r.indexOf(document.activeElement);nE(n)?i.shiftKey&&o===0?iE(i,r):!i.shiftKey&&o===r.length-1&&Kb(i,r):Kb(i,r)}function Qb(i,t,e){t===null||eu(i,t,e)}var Zb=Ne(Ud(),1);function tu(){let i=!1;return(0,Zb.default)((e,n)=>{let r=ja(e,n),o=r.contains(document.activeElement);if(o&&i)return;let a=r.querySelector("[data-uppy-super-focusable]");if(!(o&&!a))if(a)a.focus({preventScroll:!0}),i=!0;else{let s=r.querySelector(sc);s?.focus({preventScroll:!0}),i=!1}},260)}var gv=Ne(Gt(),1);function Ha(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var iv=Ne(Gt(),1);function Jb(i,t){if(i===t)return!0;if(!i||!t)return!1;let e=Object.keys(i),n=Object.keys(t),r=e.length;if(n.length!==r)return!1;for(let o=0;o<r;o++){let a=e[o];if(i[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function oE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),u("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function aE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function sE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function lE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function cE(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function dE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function pE(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function mr(i){let t={color:"#838999",icon:dE()};if(!i)return t;let e=i.split("/")[0],n=i.split("/")[1];return e==="text"?{color:"#5a5e69",icon:pE()}:e==="image"?{color:"#686de0",icon:oE()}:e==="audio"?{color:"#068dbb",icon:aE()}:e==="video"?{color:"#19af67",icon:sE()}:e==="application"&&n==="pdf"?{color:"#e25149",icon:lE()}:e==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(n)!==-1?{color:"#00C469",icon:cE()}:t}function Va(i){let{file:t}=i;if(t.preview)return u("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});let{color:e,icon:n}=mr(t.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:e}},n),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var uE=(i,t)=>(typeof t=="function"?t():t).filter(r=>r.id===i)[0].name;function Ua(i){let{file:t,toggleFileCard:e,i18n:n,metaFields:r}=i,{missingRequiredMetaFields:o}=t;if(!(o!=null&&o.length))return null;let a=o.map(s=>uE(s,r)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},n("missingRequiredMetaFields",{smart_count:o.length,fields:a})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>e(!0,t.id)},n("editFile")))}function iu(i){let{file:t,i18n:e,toggleFileCard:n,metaFields:r,showLinkToFileUploadResult:o}=i,s=t.preview?"rgba(255, 255, 255, 0.5)":mr(t.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:s}},o&&t.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name},u("span",{hidden:!0},t.meta.name)),u(Va,{file:t}),u(Ua,{file:t,i18n:e,toggleFileCard:n,metaFields:r}))}function hE(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function ev(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function nu(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":ev(i),title:ev(i),onClick:()=>hE(i)},i.children))}function lc(i){let{children:t}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function ru(i){let{progress:t}=i,e=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":e,"stroke-dashoffset":e-e/100*t}))}function ou(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(lc,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?u(nu,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(nu,i,u(lc,null,u(ru,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(nu,i,u(lc,null,u(ru,{progress:i.file.progress.percentage}),u("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(lc,null,u(ru,{progress:i.file.progress.percentage}))))}var tv=Ne(oa(),1);var au="...";function cc(i,t){if(t===0)return"";if(i.length<=t)return i;if(t<=au.length+1)return`${i.slice(0,t-1)}\u2026`;let e=t-au.length,n=Math.ceil(e/2),r=Math.floor(e/2);return i.slice(0,n)+au+i.slice(-r)}var mE=i=>{let{author:t,name:e}=i.file.meta;function n(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:t?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:e},cc(e,n()))},fE=i=>{var t;let{author:e}=i.file.meta,n=(t=i.file.remote)==null?void 0:t.providerName,r="\xB7";return e?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},cc(e.name,13)),n?u(Fragment,null,` ${r} `,n,` ${r} `):null):null},gE=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,tv.default)(i.file.size)),bE=i=>i.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),vE=i=>{let{file:t,onClick:e}=i;return t.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:e,type:"button"},"?"):null};function su(i){let{file:t,i18n:e,toggleFileCard:n,metaFields:r,toggleAddFilesPanel:o,isSingleFile:a,containerHeight:s,containerWidth:l}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},u("div",{className:"uppy-Dashboard-Item-fileName"},mE({file:t,isSingleFile:a,containerHeight:s,containerWidth:l}),u(vE,{file:t,onClick:()=>alert(t.error)})),u("div",{className:"uppy-Dashboard-Item-status"},fE({file:t}),gE({file:t}),bE({file:t,toggleAddFilesPanel:o,i18n:e})),u(Ua,{file:t,i18n:e,toggleFileCard:n,metaFields:r}))}function lu(i,t){return t===void 0&&(t="Copy the URL below"),new Promise(e=>{let n=document.createElement("textarea");n.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),n.value=i,document.body.appendChild(n),n.select();let r=()=>{document.body.removeChild(n),window.prompt(t,i),e()};try{return document.execCommand("copy")?(document.body.removeChild(n),e()):r()}catch{return document.body.removeChild(n),r()}})}function _E(i){let{file:t,uploadInProgressOrComplete:e,metaFields:n,canEditFile:r,i18n:o,onClick:a}=i;return!e&&n&&n.length>0||!e&&r(t)?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:t.meta.name}),title:o("editFileWithFilename",{file:t.meta.name}),onClick:()=>a()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function yE(i){let{i18n:t,onClick:e,file:n}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:n.meta.name}),title:t("removeFile",{file:n.meta.name}),onClick:()=>e()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),u("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function wE(i){let{file:t,uppy:e,i18n:n}=i,r=o=>{lu(t.uploadURL,n("copyLinkToClipboardFallback")).then(()=>{e.log("Link copied to clipboard."),e.info(n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.log).then(()=>o.target.focus({preventScroll:!0}))};return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":n("copyLink"),title:n("copyLink"),onClick:o=>r(o)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function cu(i){let{uppy:t,file:e,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,showLinkToFileUploadResult:a,showRemoveButton:s,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(_E,{i18n:l,file:e,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,e.id):d(e)}}),a&&e.uploadURL?u(wE,{file:e,uppy:t,i18n:l}):null,s?u(yE,{i18n:l,file:e,onClick:()=>t.removeFile(e.id)}):null)}var dc=class extends ni{componentDidMount(){let{file:t}=this.props;t.preview||this.props.handleRequestThumbnail(t)}shouldComponentUpdate(t){return!Jb(this.props,t)}componentDidUpdate(){let{file:t}=this.props;t.preview||this.props.handleRequestThumbnail(t)}componentWillUnmount(){let{file:t}=this.props;t.preview||this.props.handleCancelThumbnail(t)}render(){let{file:t}=this.props,e=t.progress.preprocess||t.progress.postprocess,n=!!t.progress.uploadComplete&&!e&&!t.error,r=!!t.progress.uploadStarted||!!e,o=t.progress.uploadStarted&&!t.progress.uploadComplete||e,a=t.error||!1,{isGhost:s}=t,l=(this.props.individualCancellation||!o)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,iv.default)({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":e,"is-complete":n,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return u("div",{className:c,id:`uppy_${t.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(iu,{file:t,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(ou,{uppy:this.props.uppy,file:t,error:a,isUploaded:n,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(su,{file:t,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),u(cu,{file:t,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function xE(i,t){let e=[],n=[];return i.forEach(r=>{n.length<t?n.push(r):(e.push(n),n=[r])}),n.length&&e.push(n),e}function du(i){let{id:t,i18n:e,uppy:n,files:r,resumableUploads:o,hideRetryButton:a,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,isSingleFile:v,toggleFileCard:g,handleRequestThumbnail:w,handleCancelThumbnail:E,recoveredState:L,individualCancellation:F,itemsPerRow:G,openFileEditor:he,canEditFile:me,toggleAddFilesPanel:se,containerWidth:y,containerHeight:x}=i,D=G===1?71:200,z=dr(()=>{let ie=(it,Be)=>Number(r[Be].isGhost)-Number(r[it].isGhost),Ie=Object.keys(r);return L&&Ie.sort(ie),xE(Ie,G)},[r,G,L]),V=ie=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:ie[0]},ie.map(Ie=>u(dc,{key:Ie,uppy:n,id:t,i18n:e,resumableUploads:o,individualCancellation:F,hideRetryButton:a,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,recoveredState:L,isSingleFile:v,containerWidth:y,containerHeight:x,toggleFileCard:g,handleRequestThumbnail:w,handleCancelThumbnail:E,role:"listitem",openFileEditor:he,canEditFile:me,toggleAddFilesPanel:se,file:r[Ie]})));return v?u("div",{class:"uppy-Dashboard-files"},V(z[0])):u(Ql,{class:"uppy-Dashboard-files",role:"list",data:z,renderRow:V,rowHeight:D})}var pu=class extends ni{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var t;(t=this.fileInput)==null||t.click()},this.triggerFolderInputClick=()=>{var t;(t=this.folderInput)==null||t.click()},this.triggerVideoCameraInputClick=()=>{var t;(t=this.mobileVideoFileInput)==null||t.click()},this.triggerPhotoCameraInputClick=()=>{var t;(t=this.mobilePhotoFileInput)==null||t.click()},this.onFileInputChange=t=>{this.props.handleInputChange(t),t.currentTarget.value=""},this.renderHiddenInput=(t,e)=>{var n;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:t,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(n=this.props.allowedFileTypes)==null?void 0:n.join(", "),ref:e})},this.renderHiddenCameraInput=(t,e,n)=>{let o={photo:"image/*",video:"video/*"}[t];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${t}`,onChange:this.onFileInputChange,capture:e,accept:o,ref:n})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(t,e)=>{let n=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:e,"data-uppy-super-focusable":n===0},t)},this.renderDropPasteBrowseTagline=t=>{let e=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,o=r.charAt(0).toUpperCase()+r.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):t>0?this.props.i18nArray(`dropPasteImport${o}`,{browseFiles:e,browseFolders:n,browse:e}):this.props.i18nArray(`dropPaste${o}`,{browseFiles:e,browseFolders:n,browse:e}))},this.renderAcquirer=t=>{var e;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":t.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":t.id,"aria-controls":`uppy-DashboardContent-panel--${t.id}`,"aria-selected":((e=this.props.activePickerPanel)==null?void 0:e.id)===t.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(t.id)},u("div",{className:"uppy-DashboardTab-inner"},t.icon()),u("div",{className:"uppy-DashboardTab-name"},t.name)))},this.renderAcquirers=t=>{let e=[...t],n=e.splice(t.length-2,t.length);return u(mi,null,e.map(r=>this.renderAcquirer(r)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},n.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(t,e)=>{let{showNativePhotoCameraButton:n,showNativeVideoCameraButton:r}=this.props,o=[],a="myDevice";e||o.push({key:a,elements:this.renderMyDeviceAcquirer()}),n&&o.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&o.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),o.push(...t.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),o.length===1&&o[0].key===a&&(o=[]);let l=[...o],c=l.splice(o.length-2,o.length);return u(mi,null,this.renderDropPasteBrowseTagline(o.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:p,elements:v}=d;return u(mi,{key:p},v)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:p,elements:v}=d;return u(mi,{key:p},v)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:t}=this.props,e=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),n=t("poweredBy",{uppy:e});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},n)}render(){let{showNativePhotoCameraButton:t,showNativeVideoCameraButton:e,nativeCameraFacingMode:n}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),t&&this.renderHiddenCameraInput("photo",n,r=>{this.mobilePhotoFileInput=r}),e&&this.renderHiddenCameraInput("video",n,r=>{this.mobileVideoFileInput=r}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},pc=pu;var nv=Ne(Gt(),1);var CE=i=>u("div",{className:(0,nv.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(pc,i)),rv=CE;var ov=Ne(Gt(),1);function SE(i){let{tagName:t}=i.target;if(t==="INPUT"||t==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ji=SE;function PE(i){let{activePickerPanel:t,className:e,hideAllPanels:n,i18n:r,state:o,uppy:a}=i,s=cr(null);return u("div",{className:(0,ov.default)("uppy-DashboardContent-panel",e),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:Ji,onDragLeave:Ji,onDrop:Ji,onPaste:Ji},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:t.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:n},r("cancel"))),u("div",{ref:s,className:"uppy-DashboardContent-panelBody"},a.getPlugin(t.id).render(o,s.current)))}var av=PE;var sv=Ne(Gt(),1);function EE(i){let t=i.files[i.fileCardFor],e=()=>{i.uppy.emit("file-editor:cancel",t),i.closeFileEditor()};return u("div",{className:(0,sv.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(n=>i.uppy.getPlugin(n.id).render(i.state))))}var lv=EE;var en={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function IE(i,t,e,n){if(n===void 0&&(n={}),i)return en.STATE_ERROR;if(t)return en.STATE_COMPLETE;if(e)return en.STATE_PAUSED;let r=en.STATE_WAITING,o=Object.keys(n);for(let a=0;a<o.length;a++){let{progress:s}=n[o[a]];if(s.uploadStarted&&!s.uploadComplete)return en.STATE_UPLOADING;s.preprocess&&r!==en.STATE_UPLOADING&&(r=en.STATE_PREPROCESSING),s.postprocess&&r!==en.STATE_UPLOADING&&r!==en.STATE_PREPROCESSING&&(r=en.STATE_POSTPROCESSING)}return r}function DE(i){let{files:t,i18n:e,isAllComplete:n,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:a,newFiles:s,processingFiles:l}=i;switch(IE(r,n,o,t)){case"uploading":return e("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return e("processingXFiles",{smart_count:l.length});case"paused":return e("uploadPaused");case"waiting":return e("xFilesSelected",{smart_count:s.length});case"complete":return e("uploadComplete");case"error":return e("error");default:}}function kE(i){let{i18n:t,isAllComplete:e,hideCancelButton:n,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:a}=i,{allowNewUpload:s}=i;return s&&r&&(s=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!e&&!n?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},t("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(DE,i)),s?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>o(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):u("div",null))}var cv=kE;var dv=Ne(Gt(),1);function uu(i){let{computedMetaFields:t,requiredMetaFields:e,updateMeta:n,form:r,formState:o}=i,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map(s=>{let l=`uppy-Dashboard-FileCard-input-${s.id}`,c=e.includes(s.id);return u("fieldset",{key:s.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},s.name),s.render!==void 0?s.render({value:o[s.id],onChange:d=>n(d,s.id),fieldCSSClasses:a,required:c,form:r.id},u):u("input",{className:a.text,id:l,form:r.id,type:s.type||"text",required:c,value:o[s.id],placeholder:s.placeholder,onInput:d=>n(d.target.value,s.id),"data-uppy-super-focusable":!0}))})}function hu(i){var t;let{files:e,fileCardFor:n,toggleFileCard:r,saveFileCard:o,metaFields:a,requiredMetaFields:s,openFileEditor:l,i18n:c,i18nArray:d,className:p,canEditFile:v}=i,g=()=>typeof a=="function"?a(e[n]):a,w=e[n],E=(t=g())!=null?t:[],L=v(w),F={};E.forEach(D=>{var z;F[D.id]=(z=w.meta[D.id])!=null?z:""});let[G,he]=ji(F),me=pr(D=>{D.preventDefault(),o(G,n)},[o,G,n]),se=(D,z)=>{he(k(_({},G),{[z]:D}))},y=()=>{r(!1)},[x]=ji(()=>{let D=document.createElement("form");return D.setAttribute("tabindex","-1"),D.id=Bn(),D});return Zi(()=>(document.body.appendChild(x),x.addEventListener("submit",me),()=>{x.removeEventListener("submit",me),document.body.removeChild(x)}),[x,me]),u("div",{className:(0,dv.default)("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:Ji,onDragLeave:Ji,onDrop:Ji,onPaste:Ji},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},w.meta?w.meta.name:w.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:x.id,title:c("finishEditingFile"),onClick:y},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:mr(w.type).color}},u(Va,{file:w}),L&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:D=>{me(D),l(w)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(uu,{computedMetaFields:E,requiredMetaFields:s,updateMeta:se,form:x,formState:G})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:x.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:y,form:x.id},c("cancel")))))}var uv=Ne(Gt(),1),ho="uppy-transition-slideDownUp",pv=250;function TE(i){let{children:t}=i,[e,n]=ji(null),[r,o]=ji(""),a=cr(),s=cr(),l=cr(),c=()=>{o(`${ho}-enter`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{o(`${ho}-enter ${ho}-enter-active`),a.current=setTimeout(()=>{o("")},pv)})},d=()=>{o(`${ho}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{o(`${ho}-leave ${ho}-leave-active`),s.current=setTimeout(()=>{n(null),o("")},pv)})};return Zi(()=>{let p=Ki(t)[0];e!==p&&(p&&!e?c():e&&!p&&!s.current&&d(),n(p))},[t,e]),Zi(()=>()=>{clearTimeout(a.current),clearTimeout(s.current),cancelAnimationFrame(l.current)},[]),e?Ol(e,{className:(0,uv.default)(r,e.props.className)}):null}var Wa=TE;function mo(){return mo=Object.assign?Object.assign.bind():function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},mo.apply(null,arguments)}var hv=900,mv=700,mu=576,fv=330;function fu(i){let t=i.totalFileCount===0,e=i.totalFileCount===1,n=i.containerWidth>mu,r=i.containerHeight>fv,o=(0,gv.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>mu,"uppy-size--lg":i.containerWidth>mv,"uppy-size--xl":i.containerWidth>hv,"uppy-size--height-md":i.containerHeight>fv,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&e&&r}),a=1;i.containerWidth>hv?a=5:i.containerWidth>mv?a=4:i.containerWidth>mu&&(a=3);let s=i.showSelectedFiles&&!t,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(v=>i.files[v].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:o,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Ha(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),s&&u(cv,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),s?u(du,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:e,itemsPerRow:a,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):u(pc,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),u(Wa,null,i.showAddFilesPanel?u(rv,mo({key:"AddFiles"},i,{isSizeMD:n})):null),u(Wa,null,i.fileCardFor?u(hu,mo({key:"FileCard"},i)):null),u(Wa,null,i.activePickerPanel?u(av,mo({key:"Picker"},i)):null),u(Wa,null,i.showFileEditor?u(lv,mo({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(v=>i.uppy.getPlugin(v.id).render(i.state))))))}var bv={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function Me(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var ME=0;function zt(i){return"__private_"+ME+++"_"+i}var OE={version:"4.3.1"},gu=Jp.default||Jp,vv=9,FE=27;function _v(){let i={};return i.promise=new Promise((t,e)=>{i.resolve=t,i.reject=e}),i}var AE={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:La,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},fr=zt("disabledNodes"),yn=zt("generateLargeThumbnailIfSingleFile"),$a=zt("openFileEditorWhenFilesAdded"),gr=zt("attachRenderFunctionToTarget"),bu=zt("isTargetSupported"),vu=zt("getAcquirers"),_u=zt("getProgressIndicators"),wn=zt("getEditors"),yu=zt("addSpecifiedPluginsFromOptions"),wu=zt("autoDiscoverPlugins"),br=zt("addSupportedPluginIfNoTarget"),qa=zt("getStatusBarOpts"),Ga=zt("getThumbnailGeneratorOpts"),xu=zt("getInformerOpts"),Ya=zt("getStatusBarId"),Xa=zt("getThumbnailGeneratorId"),Cu=zt("getInformerId"),vr=class extends fi{constructor(t,e){var n,r,o;let a=(n=e?.autoOpen)!=null?n:null;super(t,k(_(_({},AE),e),{autoOpen:a})),Object.defineProperty(this,Cu,{value:jE}),Object.defineProperty(this,Xa,{value:LE}),Object.defineProperty(this,Ya,{value:zE}),Object.defineProperty(this,xu,{value:NE}),Object.defineProperty(this,Ga,{value:BE}),Object.defineProperty(this,qa,{value:RE}),Object.defineProperty(this,fr,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Bn()}`,this.superFocus=tu(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=s=>{let c=this.getPluginState().targets.filter(d=>d.id!==s.id);this.setPluginState({targets:c})},this.addTarget=s=>{let l=s.id||s.constructor.name,c=s.title||l,d=s.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let p={id:l,name:c,type:d},g=this.getPluginState().targets.slice();return g.push(p),this.setPluginState({targets:g}),this.el},this.hideAllPanels=()=>{var s;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(s=l.activePickerPanel)==null?void 0:s.id))},this.showPanel=s=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===s);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",s)},this.canEditFile=s=>{let{targets:l}=this.getPluginState();return Me(this,wn)[wn](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(s))},this.openFileEditor=s=>{let{targets:l}=this.getPluginState(),c=Me(this,wn)[wn](l);this.setPluginState({showFileEditor:!0,fileCardFor:s.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(s)})},this.closeFileEditor=()=>{let{metaFields:s}=this.getPluginState();s&&s.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:s}=this.getPluginState();Me(this,wn)[wn](s).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:s,resolve:l}=_v();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),s},this.closeModal=s=>{var l;let c=(l=s?.manualClose)!=null?l:!0,{isHidden:d,isClosing:p}=this.getPluginState();if(d||p)return;let{promise:v,resolve:g}=_v();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let E=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",E,!1),g()};this.el.addEventListener("animationend",E,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),g();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var w;(w=history.state)!=null&&w[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),v},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=s=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:k(_({},l),{darkMode:s})})},this.handleSystemDarkModeChange=s=>{let l=s.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(s,l)=>{let c=this.uppy.getFile(l);s?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:s?l:null,activeOverlayType:s?"FileCard":null})},this.toggleAddFilesPanel=s=>{this.setPluginState({showAddFilesPanel:s,activeOverlayType:s?"AddFiles":null})},this.addFiles=s=>{let l=s.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(s=>{let l=s[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let s=this.getPluginState(),l=!this.opts.inline&&s.isHidden;!s.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=s=>{this.el.contains(s.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=s=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=Me(this,fr)[fr])!=null?l:Qi(this.el.querySelectorAll(c)).filter(p=>!p.classList.contains("uppy-Dashboard-close"));for(let p of d)p.tagName==="A"?p.setAttribute("aria-disabled",s):p.disabled=s;s?Me(this,fr)[fr]=d:Me(this,fr)[fr]=null,this.dashboardIsDisabled=s},this.updateBrowserHistory=()=>{var s;(s=history.state)!=null&&s[this.modalName]||history.pushState(k(_({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=s=>{var l;this.isModalOpen()&&(!s.state||!s.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=s.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=s=>{s.keyCode===FE&&this.requestCloseModal(),s.keyCode===vv&&eu(s,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=s=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(s))});let l=Qi(s.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=s=>{s.preventDefault();let l=Qi(s.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=s=>{s.preventDefault(),s.stopPropagation();let l=()=>{let v=!0;return this.uppy.iteratePlugins(g=>{g.canHandleRootDrop!=null&&g.canHandleRootDrop(s)&&(v=!0)}),v},c=()=>{let{types:v}=s.dataTransfer;return v.some(g=>g==="Files")},d=l(),p=c();if(!d&&!p||this.opts.disabled||this.opts.disableLocalFiles&&(p||!d)||!this.uppy.getState().allowNewUpload){s.dataTransfer.dropEffect="none";return}s.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(s)},this.handleDragLeave=s=>{s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(s)},this.handleDrop=s=>j(this,null,function*(){s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(p=>{p.type==="acquirer"&&(p.handleRootDrop==null||p.handleRootDrop(s))});let l=!1,c=p=>{this.uppy.log(p,"error"),l||(this.uppy.info(p.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=yield Ma(s.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(s)}),this.handleRequestThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",s)},this.handleCancelThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",s)},this.handleKeyDownInInline=s=>{s.keyCode===vv&&Qb(s,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=s=>{this.el.contains(document.activeElement)&&this.handlePaste(s)},this.handleComplete=s=>{let{failed:l}=s;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,yn,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let s=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:s});let d=k(_({},l[0]),{preview:void 0});c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,$a,{writable:!0,value:s=>{let l=s[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,p=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):p&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let s=Op(this.opts.trigger);s?s.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",Me(this,br)[br]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",Me(this,yn)[yn]),this.uppy.on("file-removed",Me(this,yn)[yn]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",Me(this,$a)[$a])},this.removeEvents=()=>{let s=Op(this.opts.trigger);!this.opts.inline&&s&&s.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",Me(this,br)[br]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",Me(this,yn)[yn]),this.uppy.off("file-removed",Me(this,yn)[yn]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",Me(this,$a)[$a])},this.superFocusOnEachUpdate=()=>{let s=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||s||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(s,l)=>{this.uppy.setFileMeta(l,s),this.toggleFileCard(!1,l)},Object.defineProperty(this,gr,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return k(_({},s),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,bu,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,vu,{writable:!0,value:gu(s=>s.filter(l=>l.type==="acquirer"&&Me(this,bu)[bu](l)).map(Me(this,gr)[gr]))}),Object.defineProperty(this,_u,{writable:!0,value:gu(s=>s.filter(l=>l.type==="progressindicator").map(Me(this,gr)[gr]))}),Object.defineProperty(this,wn,{writable:!0,value:gu(s=>s.filter(l=>l.type==="editor").map(Me(this,gr)[gr]))}),this.render=s=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:p}=s,{newFiles:v,uploadStartedFiles:g,completeFiles:w,erroredFiles:E,inProgressFiles:L,inProgressNotPausedFiles:F,processingFiles:G,isUploadStarted:he,isAllComplete:me,isAllPaused:se}=this.uppy.getObjectOfFilesPerState(),y=Me(this,vu)[vu](l.targets),x=Me(this,_u)[_u](l.targets),D=Me(this,wn)[wn](l.targets),z;return this.opts.theme==="auto"?z=d.darkMode?"dark":"light":z=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),fu({state:s,isHidden:l.isHidden,files:c,newFiles:v,uploadStartedFiles:g,completeFiles:w,erroredFiles:E,inProgressFiles:L,inProgressNotPausedFiles:F,processingFiles:G,isUploadStarted:he,isAllComplete:me,isAllPaused:se,totalFileCount:Object.keys(c).length,totalProgress:s.totalProgress,allowNewUpload:p,acquirers:y,theme:z,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:x,editors:D,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:s.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,yu,{writable:!0,value:()=>{let{plugins:s}=this.opts;s.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,wu,{writable:!0,value:()=>{this.uppy.iteratePlugins(Me(this,br)[br])}}),Object.defineProperty(this,br,{writable:!0,value:s=>{var l;let c=["acquirer","editor"];s&&!((l=s.opts)!=null&&l.target)&&c.includes(s.type)&&(this.getPluginState().targets.some(p=>s.id===p.id)||s.mount(this,s))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:s,closeAfterFinish:l}=this.opts;if(s&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:p}=this.opts;p&&this.mount(p,this),this.opts.disableStatusBar||this.uppy.use(rr,_({id:Me(this,Ya)[Ya](),target:this},Me(this,qa)[qa]())),this.opts.disableInformer||this.uppy.use(or,_({id:Me(this,Cu)[Cu](),target:this},Me(this,xu)[xu]())),this.opts.disableThumbnailGenerator||this.uppy.use(lo,_({id:Me(this,Xa)[Xa]()},Me(this,Ga)[Ga]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let v=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${v?"on":"off"}`),this.setDarkModeCapability(v),this.opts.theme==="auto"){var g;(g=this.darkModeMediaQuery)==null||g.addListener(this.handleSystemDarkModeChange)}Me(this,yu)[yu](),Me(this,wu)[wu](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:s}=this.opts;if(s.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=bv,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(o=(r=this.opts).onRequestCloseModal)!=null||(r.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(t){var e,n;super.setOptions(t),(e=this.uppy.getPlugin(Me(this,Ya)[Ya]()))==null||e.setOptions(Me(this,qa)[qa]()),(n=this.uppy.getPlugin(Me(this,Xa)[Xa]()))==null||n.setOptions(Me(this,Ga)[Ga]())}};function RE(){let{hideUploadButton:i,hideRetryButton:t,hidePauseResumeButton:e,hideCancelButton:n,showProgressDetails:r,hideProgressAfterFinish:o,locale:a,doneButtonHandler:s}=this.opts;return{hideUploadButton:i,hideRetryButton:t,hidePauseResumeButton:e,hideCancelButton:n,showProgressDetails:r,hideAfterFinish:o,locale:a,doneButtonHandler:s}}function BE(){let{thumbnailWidth:i,thumbnailHeight:t,thumbnailType:e,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:i,thumbnailHeight:t,thumbnailType:e,waitForThumbnailsBeforeUpload:n,lazy:!n}}function NE(){return{}}function zE(){return`${this.id}:StatusBar`}function LE(){return`${this.id}:ThumbnailGenerator`}function jE(){return`${this.id}:Informer`}vr.VERSION=OE.version;var HE={version:"4.2.1"},VE={fixed:!1,hideAfterFinish:!0},fo=class extends fi{constructor(t,e){super(t,_(_({},VE),e)),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(t){let{totalProgress:e}=t,n=(e===0||e===100)&&this.opts.hideAfterFinish;return u("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},u("div",{className:"uppy-ProgressBar-inner",style:{width:`${e}%`}}),u("div",{className:"uppy-ProgressBar-percentage"},e))}install(){let{target:t}=this.opts;t&&this.mount(t,this)}uninstall(){this.unmount()}};fo.VERSION=HE.version;var yv={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var UE={version:"4.1.1"},WE={inputName:"files[]",width:"100%",height:"100%"},go=class i extends fi{constructor(t,e){super(t,_(_({},WE),e)),this.isDragDropSupported=Ha(),this.addFiles=n=>{let r=n.map(o=>({source:this.id,name:o.name,type:o.type,data:o,meta:{relativePath:o.relativePath||null}}));try{this.uppy.addFiles(r)}catch(o){this.uppy.log(o)}},this.onInputChange=n=>{let r=Qi(n.currentTarget.files||[]);r.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(r)),n.currentTarget.value=""},this.handleDragOver=n=>{var r,o;n.preventDefault(),n.stopPropagation();let{types:a}=n.dataTransfer,s=a.some(c=>c==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!s||!l){n.dataTransfer.dropEffect="none";return}n.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(r=(o=this.opts).onDragOver)==null||r.call(o,n)},this.handleDragLeave=n=>{var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(r=(o=this.opts).onDragLeave)==null||r.call(o,n)},this.handleDrop=n=>j(this,null,function*(){var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1});let a=l=>{this.uppy.log(l,"error")},s=yield Ma(n.dataTransfer,{logDropError:a});s.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(s)),(r=(o=this.opts).onDrop)==null||r.call(o,n)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=yv,this.i18nInit()}renderHiddenFileInput(){var t;let{restrictions:e}=this.uppy.opts;return u("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:n=>{this.fileInputRef=n},name:this.opts.inputName,multiple:e.maxNumberOfFiles!==1,accept:(t=e.allowedFileTypes)==null?void 0:t.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},u("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return u("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:u("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return u("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){let t=`uppy-u-reset
27
27
  uppy-DragDrop-container
28
28
  ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
29
29
  ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
30
- `,e={width:this.opts.width,height:this.opts.height};return u("button",{type:"button",className:t,style:e,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),u("div",{className:"uppy-DragDrop-inner"},i.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:t}=this.opts;this.setPluginState({isDraggingOver:!1}),t&&this.mount(t,this)}uninstall(){this.unmount()}};fo.VERSION=UE.version;var Su=class{onMount(t,e){this.options=_(_({},t),this.props),this.uppy.use(e,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(t,e){t.uppy&&this.uppy!==t.uppy.previousValue&&t.uppy.previousValue!==void 0&&(this.uninstall(t.uppy.previousValue),this.uppy.use(e,this.options)),this.options=_(_({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),t.props&&this.props!==t.props.previousValue&&t.props.previousValue!==void 0&&this.plugin.setOptions(_({},this.options))}uninstall(t=this.uppy){t.removePlugin(this.plugin)}},wv=(()=>{class i extends Su{constructor(e){super(),this.el=e,this.uppy=new Jr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},br)}ngOnChanges(e){this.handleChanges(e,br)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(n){return new(n||i)(W(Ce))}}static{this.\u0275cmp=pe({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[Ci,$t],decls:0,vars:0,template:function(n,r){},encapsulation:2,changeDetection:0})}}return i})();var xv=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();function ge(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var qE=0;function ri(i){return"__private_"+qE+++"_"+i}function GE(i){return new Error("Cancelled",{cause:i})}function Cv(i){if(i!=null){var t;let e=()=>this.abort(i.reason);i.addEventListener("abort",e,{once:!0});let n=()=>{i.removeEventListener("abort",e)};(t=this.then)==null||t.call(this,n,n)}return this}var yi=ri("activeRequests"),Qt=ri("queuedHandlers"),_i=ri("paused"),vr=ri("pauseTimer"),Kt=ri("downLimit"),_r=ri("upperLimit"),xn=ri("rateLimitingTimer"),Xa=ri("call"),Cn=ri("queueNext"),Iu=ri("next"),Pu=ri("queue"),Du=ri("dequeue"),Eu=ri("resume"),yr=ri("increaseLimit"),uc=class{constructor(t){Object.defineProperty(this,Du,{value:ZE}),Object.defineProperty(this,Pu,{value:QE}),Object.defineProperty(this,Iu,{value:KE}),Object.defineProperty(this,Cn,{value:XE}),Object.defineProperty(this,Xa,{value:YE}),Object.defineProperty(this,yi,{writable:!0,value:0}),Object.defineProperty(this,Qt,{writable:!0,value:[]}),Object.defineProperty(this,_i,{writable:!0,value:!1}),Object.defineProperty(this,vr,{writable:!0,value:void 0}),Object.defineProperty(this,Kt,{writable:!0,value:1}),Object.defineProperty(this,_r,{writable:!0,value:void 0}),Object.defineProperty(this,xn,{writable:!0,value:void 0}),Object.defineProperty(this,Eu,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,yr,{writable:!0,value:()=>{if(ge(this,_i)[_i]){ge(this,xn)[xn]=setTimeout(ge(this,yr)[yr],0);return}ge(this,Kt)[Kt]=this.limit,this.limit=Math.ceil((ge(this,_r)[_r]+ge(this,Kt)[Kt])/2);for(let e=ge(this,Kt)[Kt];e<=this.limit;e++)ge(this,Cn)[Cn]();ge(this,_r)[_r]-ge(this,Kt)[Kt]>3?ge(this,xn)[xn]=setTimeout(ge(this,yr)[yr],2e3):ge(this,Kt)[Kt]=Math.floor(ge(this,Kt)[Kt]/2)}}),typeof t!="number"||t===0?this.limit=1/0:this.limit=t}run(t,e){return!ge(this,_i)[_i]&&ge(this,yi)[yi]<this.limit?ge(this,Xa)[Xa](t):ge(this,Pu)[Pu](t,e)}wrapSyncFunction(t,e){var n=this;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];let s=n.run(()=>(t(...o),queueMicrotask(()=>s.done()),()=>{}),e);return{abortOn:Cv,abort(){s.abort()}}}}wrapPromiseFunction(t,e){var n=this;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];let s,l=new Promise((c,d)=>{s=n.run(()=>{let p,v;try{v=Promise.resolve(t(...o))}catch(g){v=Promise.reject(g)}return v.then(g=>{p?d(p):(s.done(),c(g))},g=>{p?d(p):(s.done(),d(g))}),g=>{p=GE(g)}},e)});return l.abort=c=>{s.abort(c)},l.abortOn=Cv,l}}resume(){ge(this,_i)[_i]=!1,clearTimeout(ge(this,vr)[vr]);for(let t=0;t<this.limit;t++)ge(this,Cn)[Cn]()}pause(t){t===void 0&&(t=null),ge(this,_i)[_i]=!0,clearTimeout(ge(this,vr)[vr]),t!=null&&(ge(this,vr)[vr]=setTimeout(ge(this,Eu)[Eu],t))}rateLimit(t){clearTimeout(ge(this,xn)[xn]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(ge(this,_r)[_r]=this.limit-1,this.limit=ge(this,Kt)[Kt],ge(this,xn)[xn]=setTimeout(ge(this,yr)[yr],t))}get isPaused(){return ge(this,_i)[_i]}};function YE(i){ge(this,yi)[yi]+=1;let t=!1,e;try{e=i()}catch(n){throw ge(this,yi)[yi]-=1,n}return{abort:n=>{t||(t=!0,ge(this,yi)[yi]-=1,e?.(n),ge(this,Cn)[Cn]())},done:()=>{t||(t=!0,ge(this,yi)[yi]-=1,ge(this,Cn)[Cn]())}}}function XE(){queueMicrotask(()=>ge(this,Iu)[Iu]())}function KE(){if(ge(this,_i)[_i]||ge(this,yi)[yi]>=this.limit||ge(this,Qt)[Qt].length===0)return;let i=ge(this,Qt)[Qt].shift();if(i==null)throw new Error("Invariant violation: next is null");let t=ge(this,Xa)[Xa](i.fn);i.abort=t.abort,i.done=t.done}function QE(i,t){let e={fn:i,priority:t?.priority||0,abort:()=>{ge(this,Du)[Du](e)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=ge(this,Qt)[Qt].findIndex(r=>e.priority>r.priority);return n===-1?ge(this,Qt)[Qt].push(e):ge(this,Qt)[Qt].splice(n,0,e),e}function ZE(i){let t=ge(this,Qt)[Qt].indexOf(i);t!==-1&&ge(this,Qt)[Qt].splice(t,1)}var R7=Symbol("__queue");var Mu=Ne(ra(),1),Iv=Ne(Sv(),1);var Pv={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function Ev(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var JE=0;function eI(i){return"__private_"+JE+++"_"+i}var tI={quality:.6,limit:10},Ka=eI("RateLimitedQueue"),hc=class extends ir{constructor(t,e){super(t,_(_({},tI),e)),Object.defineProperty(this,Ka,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=Pv,Ev(this,Ka)[Ka]=new uc(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(t){return new Promise((e,n)=>{new Iv.default(t,k(_({},this.opts),{success:e,error:n}))})}prepareUpload(t){return j(this,null,function*(){let e=0,n=[],r=Ev(this,Ka)[Ka].wrapPromiseFunction(a=>j(this,null,function*(){try{let s=yield this.compress(a.data),l=a.data.size-s.size;this.uppy.log(`[Image Compressor] Image ${a.id} compressed by ${(0,Mu.default)(l)}`),e+=l;let{name:c,type:d,size:p}=s,v=Xi(c),w=`${Xi(a.meta.name).name}.${v.extension}`;this.uppy.setFileState(a.id,k(_(_(_(_({},c&&{name:c}),v.extension&&{extension:v.extension}),d&&{type:d}),p&&{size:p}),{data:s,meta:k(_({},a.meta),{type:d,name:w})})),n.push(a)}catch(s){this.uppy.log(`[Image Compressor] Failed to compress ${a.id}:`,"warning"),this.uppy.log(s,"warning")}})),o=t.map(a=>{var s;let l=this.uppy.getFile(a);return this.uppy.emit("preprocess-progress",l,{mode:"indeterminate",message:this.i18n("compressingImages")}),l.isRemote||(l.data.type||(l.data=l.data.slice(0,l.data.size,l.type)),!((s=l.type)!=null&&s.startsWith("image/")))?Promise.resolve():r(l)});yield Promise.all(o),this.uppy.emit("compressor:complete",n),e>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Mu.default)(e)}),"info");for(let a of t){let s=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",s)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var kv=Ne(Dv(),1);function iI(i,t){if(i&1&&(h(0,"small",5),b(1),m()),i&2){let e=S();f(),P(e.subtitle)}}function nI(i,t){if(i&1&&(h(0,"a",6),J(1,"i",7),b(2," Download Template "),m()),i&2){let e=S();Ze("top-58",e.subtitle),C("href",e.sampleUrl,Un)}}function rI(i,t){if(i&1&&(_s(0),b(1),ys()),i&2){let e=S(2);f(),Ht("- ",e.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function oI(i,t){if(i&1&&(h(0,"div",4)(1,"h4",8),b(2,"CSV File Content Summary"),m(),J(3,"hr"),h(4,"p",9),b(5),H(6,rI,2,1,"ng-container",10),m()()),i&2){let e=S();f(5),Ht("",e.rowSummary().rowCount," rows found "),f(),C("ngIf",e.rowSummary().rowEmpty>0)}}var Tv=(()=>{class i{static{this.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]}static{this.kilobyte=1024}constructor(){this.sampleUrl="",this.subtitle="",this.showSample=!0,this.showSubtitle=!0,this.uppyCoreConfiguration=To(),this.dashboardPropsConfiguration=To(),this.fileUploaded=new He,this.fileUploadComplete=new He,this.fileRemoved=new He,this.onParser=new He,this.multipleFilesUploaded=new He,this.http=O(_g),this.csvParser=O(vg),this.rowSummary=B({rowCount:0,rowEmpty:0}),this.file=B(null),this.multipleFiles=B([]),this.uppy=new Jr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}).use(hc,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}),this.dashboardProps={hideUploadButton:!0,height:350},an(()=>this.uppy.setOptions(_({},this.uppyCoreConfiguration()))),an(()=>this.dashboardProps=_(_({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(e,n)=>{let r=n[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(e,n,r),this.fileUploaded.emit(r),this.file.set(n[0].data),kv.default.parse(r,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:o=>{let a=o.split(/\r?\n/).slice(1);return a[a.length-1]===""&&a.pop(),this.rowSummary.update(s=>k(_({},s),{rowCount:a.length})),a.forEach(s=>{s.split(",").every(c=>c==="")&&this.rowSummary.update(c=>k(_({},c),{rowEmpty:c.rowEmpty+1}))}),o},error(o,a){console.log("ERROR",o,a)},complete:(o,a)=>{this.onParser.emit(o.data)}})}),this.uppy.on("complete",e=>{let n=e.successful?.map(o=>({file:o.data,id:o.id}))??[],r=e.successful[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(r),this.fileUploadComplete.emit(r),this.multipleFilesUploaded.emit(n),this.file.set(r),this.multipleFiles.set(n)}),this.uppy.on("transloadit:upload",(e,n)=>{console.log(e,n)}),this.uppy.on("transloadit:result",(e,n)=>{console.log(e,n)}),this.uppy.on("file-removed",e=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let r=this.multipleFiles().filter(o=>o.id!=e.id);this.multipleFiles.set(r),this.fileRemoved.emit(e.id),this.rowSummary.set({rowCount:0,rowEmpty:0})})}formatFileSize(e,n=2){if(e===0)return"0 bytes";let r=Math.floor(Math.log(e)/Math.log(i.kilobyte));return`${(e/Math.pow(i.kilobyte,r)).toFixed(n)} ${i.sizes[r]}`}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["POS-uppy"]],inputs:{sampleUrl:"sampleUrl",subtitle:"subtitle",uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileUploadComplete:"fileUploadComplete",fileRemoved:"fileRemoved",onParser:"onParser",multipleFilesUploaded:"multipleFilesUploaded"},standalone:!0,features:[fe],decls:5,vars:5,consts:[[1,"position-relative"],[3,"uppy","props"],["class","subtitle position-absolute",4,"ngIf"],["class","sample position-absolute","role","button",3,"top-58","href",4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","flex-column","gap-2",2,"margin","1rem 0 0 0"],[1,"subtitle","position-absolute"],["role","button",1,"sample","position-absolute",3,"href"],[1,"fa-solid","fa-download","ms-3"],[1,"alert-heading"],[1,"fs-6","m-0"],[4,"ngIf"]],template:function(n,r){if(n&1&&(h(0,"div",0),J(1,"uppy-dashboard",1),H(2,iI,2,1,"small",2)(3,nI,3,3,"a",3)(4,oI,7,2,"div",4),m()),n&2){let o;f(),C("uppy",r.uppy)("props",r.dashboardProps),f(),C("ngIf",r.subtitle&&r.showSubtitle),f(),C("ngIf",r.sampleUrl&&r.showSample),f(),ae(r.file()&&((o=r.file())==null?null:o.type)==="text/csv"?4:-1)}},dependencies:[xv,wv,et,Mr],styles:[".uppy-Dashboard-AddFiles-info{display:none!important} .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;max-width:600px;margin-top:15px;padding-top:0;overflow-y:visible}.sample[_ngcontent-%COMP%], .subtitle[_ngcontent-%COMP%]{top:56%;width:100%;text-align:center}.top-58[_ngcontent-%COMP%]{top:61%}"]})}}return i})();var Mv=(()=>{class i{constructor(){this.file=null,this.sample_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",this.fb=O(Wi),this.httpService=O($i),this.destroyRef=O(Ct),this.activeModal=O(Ls)}ngOnInit(){this.form=this.fb.group({file:new kt("",[mt.required])})}onSelectFile(e){e instanceof File&&(this.file=e)}onOK(){let e=`https://${localStorage.getItem("Domain")}`;if(this.file){let n=new FormData;n.append("file",this.file,this.file.name),n.append("OutletID",""),this.httpService.postFormData("API/catalog/product/UploadCSVforBarcode",n,void 0,e).pipe(Rt(this.destroyRef),Ri(r=>{let o=r.map(a=>this.httpService.post("/API/V3/Variant/ID",{EntityID:"00000000-0000-0000-0000-000000000000",ID:a.VariantID},void 0,e).pipe(Ve(s=>k(_({},s),{Promotions:a.Print[0].IsDiscounted?k(_({},a.Print[0]),{UnitPrice:a.Print[0].UnitPriceDiscounted}):null,UnitPrice:a.Print[0].UnitPrice}))));return hs(o)}),Lr("response")).subscribe({next:r=>{this.activeModal.close(r)}})}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-dialog-import-product"]],standalone:!0,features:[fe],decls:2,vars:2,consts:[["title","Upload New Product Barcode?",3,"onOK","hasValid"],[3,"fileUploaded","sampleUrl"]],template:function(n,r){n&1&&(h(0,"app-base-modal",0),N("onOK",function(){return r.onOK()}),h(1,"POS-uppy",1),N("fileUploaded",function(a){return r.onSelectFile(a)}),m()()),n&2&&(C("hasValid",r.form.valid),f(),C("sampleUrl",r.sample_URL))},dependencies:[js,bt,Tv],styles:["pos-uppy div div h4{font-size:14px;margin:0} pos-uppy div div hr{margin:0!important} pos-uppy div div p.fs-6{font-size:1rem!important}"]})}}return i})();var aI=(i,t)=>t.VariantID;function sI(i,t){if(i&1&&(h(0,"span",46),b(1),Je(2,"maskito"),m()),i&2){let e=S(2).$implicit,n=S();f(),P(Si(2,1,n.promotionDiscount(e.Promotions),n.options))}}function lI(i,t){if(i&1&&(h(0,"div",38)(1,"span",44),b(2),Je(3,"maskito"),m(),H(4,sI,3,4,"span",45),m()),i&2){let e,n=S().$implicit,r=S();f(2),P(Si(3,2,(e=n.UnitPrice)!==null&&e!==void 0?e:n.Promotions.UnitPrice,r.options)),f(2),C("ngIf",n.Promotions)}}function cI(i,t){if(i&1&&(h(0,"div",38)(1,"span"),b(2),Je(3,"maskito"),m()()),i&2){let e=S(2).$implicit,n=S();f(2),P(Si(3,1,e.Print[0].UnitPrice,n.options))}}function dI(i,t){if(i&1&&(h(0,"div",38)(1,"span"),b(2),Je(3,"maskito"),m()()),i&2){let e=S(2).$implicit,n=S();f(2),P(Si(3,1,e.UnitPrice,n.options))}}function pI(i,t){if(i&1&&H(0,cI,4,4,"div",38)(1,dI,4,4,"div",38),i&2){let e=S().$implicit;ae(e.Print&&e.Print.length>0?0:1)}}function uI(i,t){i&1&&J(0,"i",41)}function hI(i,t){i&1&&J(0,"i",42)}function mI(i,t){if(i&1){let e=Se();h(0,"tr")(1,"td"),b(2),m(),h(3,"td"),b(4),m(),h(5,"td"),b(6),Je(7,"number"),m(),h(8,"td"),H(9,lI,5,5,"div",38)(10,pI,2,1),m(),h(11,"td")(12,"div",39)(13,"button",40),N("click",function(){let r=X(e).$implicit,o=S();return K(o.onToggleSelected(r))}),H(14,uI,1,0,"i",41)(15,hI,1,0,"i",42),m(),h(16,"button",40),N("click",function(){let r=X(e).$implicit,o=S();return K(o.onRemoveItem(r))}),J(17,"i",43),m()()()()}if(i&2){let e=t.$implicit,n=S();f(2),P(e.Name),f(2),P(e.Code),f(2),P(pi(7,5,e.Quantity)),f(3),ae(e.Promotions?9:10),f(5),ae(e.isSelected&&n.productEdit?14:15)}}var GV=(()=>{class i{constructor(){this.productItems=[],this.storeService=O(Re),this.Object=Object,this.options=$r({precision:2,thousandSeparator:","}),this.modalService=O(Pm),this.httpService=O($i),this.router=O(Ei),this.route=O(Ui),this.rowSelectedID=B(""),this.toggleState=B(!1),this.printMode=B(1),this.step=B(0),an(()=>{this.toggleState.update(e=>!e)},{allowSignalWrites:!0})}ngOnInit(){this.route.queryParamMap.pipe(st(e=>e.has("step")),Ve(e=>+e.get("step")),Ee(e=>this.step.set(e))).subscribe()}onNext(){this.storeService.onNextStep(),this.router.navigate([],{queryParams:{step:this.step()+1},queryParamsHandling:"merge",relativeTo:this.route})}onOpenModalChooseProduct(){return j(this,null,function*(){let n=yield this.modalService.open(ul,{centered:!0}).result;if(n){let r=[...this.storeService.productItems()],o=r.findIndex(s=>s.ID===n.ID);o!==-1?r[o].Quantity+=n.Quantity:r.push(n);let a=[...r];this.storeService.onChangeProductItems(a),Uc.production||localStorage.setItem("productItems",JSON.stringify(a))}})}onOpenModalEdit(e){return j(this,null,function*(){let n=this.modalService.open(ul,{centered:!0,scrollable:!0});n.componentInstance.data=e;try{let r=yield n.result;if(r){let o=[...this.storeService.productItems()],a=o.findIndex(l=>l.ID===r.ID);a!==-1?o[a]=r:o.push(r);let s=[...o];this.storeService.onChangeProductItems(s),Uc.production||localStorage.setItem("productItems",JSON.stringify(s))}}catch{}})}ngAfterViewInit(){this.productItems=this.storeService.productItems().map(e=>k(_({},e),{isSelected:!1})),this.printMode.set(localStorage.getItem("PrintMode")==="barcode"?1:2)}onToggleSelected(e){let n=[...this.storeService.productItems()],r=n.findIndex(o=>o.Uuid===e.Uuid);r!==-1?n[r].checked=!0:n.forEach(o=>o.checked=!1),this.toggleState()?this.rowSelectedID.set(e.Uuid):this.rowSelectedID.set("")}onOpenDialogImportProduct(){return j(this,null,function*(){let n=yield this.modalService.open(Mv,{scrollable:!0,centered:!0}).result;console.log("result",n);let r=[...this.storeService.productItems()];n.forEach(o=>{r.push(_({},o))}),this.storeService.onChangeProductItems(r),console.log("result",n)})}onOpenDialogLoadTransaction(){return j(this,null,function*(){let n=yield this.modalService.open(qf,{scrollable:!0,centered:!0}).result,o=`https://${localStorage.getItem("Domain")}`;if(console.log("result",n),n!==void 0)switch(n.role){case"ok":let a={Number:n.data.number,Outlet:n.data.outlet},s=n.data.type===0?"/api/v3/Barcode/ByBillNumber":"/api/v3/Barcode/ByOutletDeliveryNumber";this.httpService.post(s,a,void 0,o).pipe(Ve(l=>l.map(c=>k(_({},c),{Uuid:dl(),checked:!1}))),Ee(l=>{let c=[...this.storeService.productItems()];l.forEach(d=>{let p=c.findIndex(v=>v.VariantID===d.VariantID);p!==-1?c[p].Quantity+=d.Quantity:c.push(d)}),this.storeService.onChangeProductItems(c)})).subscribe();break}})}onRemoveItem(e){let r=[...this.storeService.productItems()].filter(o=>o.Uuid!==e.Uuid);this.storeService.onChangeProductItems(r)}onActivate(e){return j(this,null,function*(){e.type==="click"&&(yield this.onOpenModalEdit(e.row))})}promotionDiscount(e){try{return Object.keys(e).length?e.Discount&&e.Discount>0?e.UnitPrice-e.UnitPrice*e.Discount/100:e.UnitPrice:0}catch(n){throw new Error("error: "+(n instanceof Error?n.message:String(n)))}}onFinishUpdateHandler(){this.rowSelectedID=null}onClear(){this.storeService.onChangeProductItems([])}get productEdit(){return this.route.snapshot.queryParamMap.has("id")}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["choose-product"]],viewQuery:function(n,r){if(n&1&&ut(bg,5),n&2){let o;Fe(o=Ae())&&(r.verticalSidebar=o.first)}},standalone:!0,features:[fe],decls:58,vars:6,consts:[[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],[1,"btn-group"],["ngbDropdown","","placement","bottom-end",1,"btn-group"],["type","button",1,"btn","btn-outline-secondary","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-solid","fa-upload","fs-3"],[1,"fs-3"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-toggle-split"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1"],["ngbDropdownItem","",1,"dropdown-item","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-regular","fa-file-lines","fs-3"],[1,"fa-solid","fa-trash","fs-3"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click","disabled"],[1,"f","fas","fa-angle-right"],[1,"mx-3","flex-grow-1"],[1,"row"],[1,"col-8"],[1,"container",2,"padding-left","2px","padding-right","0px"],[1,"card","h-100"],[1,"card-body",2,"padding","0.8rem","height","calc(100vh - 100px)"],[1,"table-responsive",2,"max-height","100%","height","100%","overflow-y","auto"],[1,"table"],[2,"position","sticky","top","0","background-color","white","border","1px solid rgba(0, 0, 0, 0.12)","z-index","1"],["scope","col"],["scope","col",2,"width","10%"],["scope","col",1,"text-end",2,"width","10%"],[1,"col-4"],[1,"card"],[1,"card-body",2,"padding","0.8rem"],[3,"productSelectedChange","productSelected"],[1,"d-flex","flex-column","text-end"],[1,"w-100","d-flex","justify-content-end","align-items-center"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-check","fs-5","text-primary"],[1,"fa-solid","fa-pen-to-square","fs-5"],[1,"fas","fa-trash","me-1","text-danger","fs-5"],[1,"text-decoration-line-through","text-danger"],["class","text-dark",4,"ngIf"],[1,"text-dark"]],template:function(n,r){n&1&&(h(0,"div",0)(1,"header",1)(2,"nav",2)(3,"div",3)(4,"div",4)(5,"ul",5)(6,"li",6)(7,"h3",7),b(8,"Choose Product"),m()()(),h(9,"ul",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"button",12),N("click",function(){return r.onOpenDialogImportProduct()}),J(14,"i",13),h(15,"span",14),b(16,"Upload"),m()(),J(17,"button",15),h(18,"div",16)(19,"button",17),N("click",function(){return r.onOpenDialogLoadTransaction()}),J(20,"i",18),h(21,"span",14),b(22,"Load Transaction"),m()(),h(23,"button",17),N("click",function(){return r.onClear()}),J(24,"i",19),h(25,"span",14),b(26,"Clear"),m()()()()(),h(27,"button",20),N("click",function(){return r.onNext()}),h(28,"span",14),b(29,"Next"),m(),J(30,"i",21),m()()()()(),b(31,' " '),m()(),h(32,"div",22)(33,"div",23)(34,"div",24)(35,"div",25)(36,"div",26)(37,"div",27)(38,"div",28)(39,"table",29)(40,"thead",30)(41,"tr")(42,"th",31),b(43,"Name"),m(),h(44,"th",31),b(45,"Code"),m(),h(46,"th",32),b(47,"Qty"),m(),h(48,"th",33),b(49," Price "),m(),J(50,"th",32),m()(),h(51,"tbody"),St(52,mI,18,7,"tr",null,aI),m()()()()()()(),h(54,"div",34)(55,"div",35)(56,"div",36)(57,"modal-choose-product",37),um("productSelectedChange",function(a){return pm(r.rowSelectedID,a)||(r.rowSelectedID=a),a}),m()()()()()()()),n&2&&(f(),qe("data-navbarbg",r.storeService.options().navbarbg),f(),C("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),f(),C("ngbCollapse",!r.storeService.options().isCollapsed),qe("data-navbarbg",r.storeService.options().navbarbg),f(24),C("disabled",r.storeService.productItems().length<=0),f(25),Pt(r.storeService.productItems()),f(5),dm("productSelected",r.rowSelectedID))},dependencies:[et,Mn,Mr,Ar,zs,Sm,Cm,Bs,Ns,Br,Ym,Xf,ul],styles:[".dropdown-toggle:after{display:inline-block!important}[_nghost-%COMP%] .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}[_nghost-%COMP%] .ngx-datatable .datatable-body{border:none}[_nghost-%COMP%] .ngx-datatable.material{border:none}[_ngcontent-%COMP%]:hover .ngx-datatable.material .datatable-header{border:1px solid rgba(0,0,0,.12)}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{display:flex;align-items:center;font-size:12px}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell .datatable-body-cell-label{width:100%}[_nghost-%COMP%] .ngx-datatable.material .empty-row{font-size:12px}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12)}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{font-weight:400;font-size:12px;vertical-align:middle}.dropdown-item[_ngcontent-%COMP%]:hover{background-color:#ddd;color:#333}.dropdown-menu.show[_ngcontent-%COMP%]{padding:.5rem 0}"],changeDetection:0})}}return i})();var Ov=(()=>{class i{transform(e,...n){let r=Number(e),o=Number(n[0]);return r*o/100+r}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=fs({name:"taxs",type:i,pure:!0,standalone:!0})}}return i})();var Z_=Ne(Nh());var YM=["barcode"],XM=(i,t)=>t.VariantID,KM=i=>({"h-100":i}),ot=i=>({"font-size.px":i});function QM(i,t){if(i&1&&(h(0,"div",3),J(1,"canvas",11,0),m()),i&2){let e=S(2);f(),C("ngStyle",e.barcodeStyle)}}function ZM(i,t){if(i&1&&(h(0,"span",12),b(1),m()),i&2){let e=S(2).$implicit,n=S();C("ngStyle",ze(2,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.Description)}}function JM(i,t){if(i&1&&(h(0,"span",12),b(1),m()),i&2){let e=S(2).$implicit,n=S();C("ngStyle",ze(2,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.Code)}}function eO(i,t){if(i&1&&H(0,ZM,2,4,"span",12)(1,JM,2,4,"span",12),i&2){let e=S(2);ae(e.storeService.paperConfiguration().DescriptionAsCode?0:1)}}function tO(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.storeService.paperConfiguration().ProductNamePrefix)}}function iO(i,t){if(i&1&&(h(0,"div",5),H(1,tO,2,4,"span",13),h(2,"span",14),b(3),Je(4,"slice"),m()()),i&2){let e=S().$implicit,n=S();f(),C("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),f(),C("ngStyle",ze(7,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(Hc(4,3,e.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function nO(i,t){if(i&1&&(h(0,"span",25),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().PriceFontSize)),f(),P(e.storeService.paperConfiguration().CurrencySymbol)}}function rO(i,t){if(i&1&&(h(0,"span"),b(1),m()),i&2){let e=S(2).$implicit;f(),Ht("/",e.UOMName||"pcs","")}}function oO(i,t){if(i&1&&(h(0,"span",26),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().PriceFontSize)),f(),P(e.storeService.paperConfiguration().CurrencySymbol)}}function aO(i,t){if(i&1&&(h(0,"div",6)(1,"div",15)(2,"div",16),b(3),m(),h(4,"div",17),H(5,nO,2,4,"span",18),h(6,"span",19),b(7),Je(8,"number"),m(),H(9,rO,2,1,"span",20),m()(),h(10,"div",15)(11,"div",21),b(12),m(),h(13,"div",22),H(14,oO,2,4,"span",23),h(15,"span",24),b(16),Je(17,"number"),m()()()()),i&2){let e=S().$implicit,n=S();f(2),C("ngStyle",ze(15,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),Ht(" ",n.storeService.paperConfiguration().BasicPriceLabel," "),f(2),C("ngIf",n.storeService.paperConfiguration().CurrencySymbol),f(),C("ngStyle",ze(17,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),P(pi(8,11,e.UnitPrice)),f(2),C("ngIf",n.storeService.paperConfiguration().UOMNameVisible),f(2),C("ngStyle",ze(19,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),Ht(" ",n.storeService.paperConfiguration().PromotionPriceLabel," "),f(2),C("ngIf",n.storeService.paperConfiguration().CurrencySymbol),f(),C("ngStyle",ze(21,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),P(pi(17,13,n.promotionDiscount(e.Promotions)))}}function sO(i,t){if(i&1&&(h(0,"span",28),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().PriceFontSize)),f(),P(e.storeService.paperConfiguration().CurrencySymbol)}}function lO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S(2).$implicit,n=S();C("ngStyle",ze(2,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),Ht("/",e.UOMName||"pcs","")}}function cO(i,t){if(i&1&&(h(0,"div",7),H(1,sO,2,4,"span",27),h(2,"span",28),b(3),Je(4,"taxs"),Je(5,"number"),m(),H(6,lO,2,4,"span",29),m()),i&2){let e=S().$implicit,n=S();f(),C("ngIf",n.storeService.paperConfiguration().CurrencySymbol),f(),C("ngStyle",ze(9,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),P(pi(5,7,Si(4,4,e.UnitPrice,n.taxRate))),f(3),C("ngIf",n.storeService.paperConfiguration().UOMNameVisible)}}function dO(i,t){if(i&1&&(h(0,"span",28),b(1),m()),i&2){let e=S(5);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().PriceFontSize)),f(),P(e.storeService.paperConfiguration().CurrencySymbol)}}function pO(i,t){if(i&1&&(h(0,"div",9),H(1,dO,2,4,"span",27),h(2,"span",28),b(3),Je(4,"taxs"),Je(5,"number"),m()()),i&2){let e=S().$implicit,n=S(3);f(),C("ngIf",n.storeService.paperConfiguration().CurrencySymbol),f(),C("ngStyle",ze(8,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),P(pi(5,6,Si(4,3,e.Price,n.taxRate)))}}function uO(i,t){if(i&1&&H(0,pO,6,10,"div",9),i&2){let e=t.$implicit,n=S(3);ae(e.Outlet===n.storeService.outlet$().Name?0:-1)}}function hO(i,t){if(i&1&&St(0,uO,1,1,null,null,kr),i&2){let e=S().$implicit;Pt(e.OutletPrice)}}function mO(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.storeService.paperConfiguration().ProductNamePrefix)}}function fO(i,t){if(i&1&&(h(0,"div",8),H(1,mO,2,4,"span",13),h(2,"span",14),b(3),Je(4,"slice"),m()()),i&2){let e=S().$implicit,n=S();f(),C("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),f(),C("ngStyle",ze(7,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(Hc(4,3,e.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function gO(i,t){if(i&1&&(h(0,"div",31)(1,"span",14),b(2),m()()),i&2){let e=S(3);f(),C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.storeService.paperConfiguration().StoreName)}}function bO(i,t){if(i&1&&(h(0,"div",32)(1,"span",14),b(2),m()()),i&2){let e=S(3);f(),C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.storeService.paperConfiguration().StoreName)}}function vO(i,t){if(i&1&&H(0,gO,3,4,"div",31)(1,bO,3,4,"div",32),i&2){let e=S(2);ae(e.storeService.paperConfiguration().Orientation===0?0:1)}}function _O(i,t){if(i&1&&(h(0,"div",9)(1,"span",14),b(2),Je(3,"date"),m()()),i&2){let e=S().$implicit,n=S();f(),C("ngStyle",ze(5,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(Si(3,2,e.ReleasedDate,"dd MMM yyyy"))}}function yO(i,t){if(i&1&&(h(0,"div",9)(1,"span",14),b(2),m()()),i&2){let e=S().$implicit,n=S();f(),C("ngStyle",ze(2,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),Ht("",e.PriceDiscount,"% Off")}}function wO(i,t){if(i&1&&(h(0,"span"),b(1),m(),h(2,"span"),b(3,"-"),m(),h(4,"span"),b(5),m(),h(6,"span"),b(7,"-"),m(),h(8,"span"),b(9),Je(10,"number"),m()),i&2){let e=t.$implicit;f(),P(e.Name),f(4),P(e.MinimumQuantity),f(4),P(pi(10,3,e.UnitPrice))}}function xO(i,t){if(i&1&&(h(0,"div",10),St(1,wO,11,5,null,null,Tn),m()),i&2){let e=S().$implicit,n=S();C("ngStyle",ze(1,ot,n.storeService.paperConfiguration().PricebookFontSize)),f(),Pt(e.Pricebook)}}function CO(i,t){if(i&1&&(h(0,"div",2),H(1,QM,3,1,"div",3),h(2,"div",4),H(3,eO,2,1)(4,iO,5,9,"div",5)(5,aO,18,23,"div",6)(6,cO,7,11,"div",7)(7,hO,2,0)(8,fO,5,9,"div",8)(9,vO,2,1)(10,_O,4,7,"div",9)(11,yO,3,4,"div",9)(12,xO,3,3,"div",10),m()()),i&2){let e=t.$implicit,n=S();C("ngStyle",n.stickerStyles),f(),ae(n.storeService.paperConfiguration().BarcodeVisible?1:-1),f(),C("ngClass",ze(13,KM,!n.storeService.paperConfiguration().BarcodeVisible)),f(),ae(n.storeService.paperConfiguration().CodeVisible?3:-1),f(),ae(n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?4:-1),f(),ae(e.Promotions&&n.storeService.paperConfiguration().PriceVisible?5:-1),f(),ae(!e.Promotions&&!n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?6:-1),f(),ae(n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?7:-1),f(),ae(!n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?8:-1),f(),ae(n.storeService.paperConfiguration().StoreName?9:-1),f(),ae(n.storeService.paperConfiguration().ShowReleasedDate?10:-1),f(),ae(n.storeService.paperConfiguration().ShowPriceDiscount?11:-1),f(),ae(n.storeService.paperConfiguration().PricebookVisible?12:-1)}}var J_=(()=>{class i{constructor(){this.items=[],this.previewType="single",this.storeService=O(Re),this.Object=Object,this.cdr=O(It),this.renderer=O(Mo),this.elementsInitialized=!1,this.injector=O(Ye)}get barcodeContainerStyles(){let e=0;switch(this.storeService.paperSource()){case"Continuous - 3 Column":e=3;break;case"Continuous - 2 Column":e=2;break;case"Continuous - 1 Column":e=1;break;case"Tom & Jerry 107":e=3;break;case"Tom & Jerry 108":e=5;break}let n={display:"grid",gridTemplateColumns:`repeat(${e}, ${this.items.length===1?"1fr":this.storeService.paperConfiguration().StickerWidth}px)`,gridAutoRows:`${this.storeService.paperConfiguration().StickerHeight}px`,columnGap:`${this.storeService.paperConfiguration().ColumnSpacing}px`,rowGap:`${this.storeService.paperConfiguration().RowSpacing}px`,margin:`${this.storeService.paperConfiguration().MarginTop}px ${this.storeService.paperConfiguration().MarginLeft}px`,maxHeight:"100%",height:`${this.previewType==="single"?"90px":"100%"}`,width:`${this.previewType==="single"?"250px":this.storeService.paperConfiguration().PaperWidth+"px"}`};return console.log("style",n),n}get stickerStyles(){let e=this.storeService.paperConfiguration().StickerWidth,n=this.storeService.paperConfiguration().StickerHeight,r=this.items.length===1&&this.previewType==="single"?"250px":`${typeof e=="number"?e+"px":e}`,o=`${this.previewType==="single"?"90px":n+"px"}`;return{width:r,height:o,overflow:"hidden"}}get barcodeStyle(){return{width:"100%",height:`${this.previewType==="single"?"25px":this.storeService.paperConfiguration().BarcodeHeight+"px"}`}}get taxRate(){if(this.storeService.paperConfiguration().TaxType){let n=this.storeService.taxs().findIndex(r=>r.ID===this.storeService.paperConfiguration().TaxType.ID);if(n!==-1)return this.storeService.taxs()[n].Rate}return 0}get stickerStoreName(){let e={order:"4",lineHeight:"15px"},n={position:"absolute",right:"0",top:"0",transform:"translate(0%, 20%) rotate(270deg)"};return this.storeService.paperConfiguration().Orientation===0?e:n}ngOnInit(){}ngAfterViewInit(){this.elementsInitialized=!0}ngAfterViewChecked(){this.generateBarcodes(),this.elementsInitialized&&(this.generateBarcodes(),this.elementsInitialized=!1)}generateBarcodes(){this.storeService.expandProductItems().forEach((e,n)=>{let r=this.barcodeRef.get(n)?.nativeElement;r&&(0,Z_.default)(r,e.Code,{format:"CODE128",lineColor:"#000",width:20,displayValue:!1})})}promotionDiscount(e){try{return Object.keys(e).length?e.Discount&&e.Discount>0?e.UnitPrice-e.UnitPrice*e.Discount/100:e.UnitPrice:0}catch(n){throw new Error("error: ",n)}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-barcode-preview"]],viewQuery:function(n,r){if(n&1&&ut(YM,5,Ce),n&2){let o;Fe(o=Ae())&&(r.barcodeRef=o)}},inputs:{items:"items",previewType:"previewType"},standalone:!0,features:[fe],decls:3,vars:1,consts:[["barcode",""],["id","barcode-container",1,"barcode-container",3,"ngStyle"],[1,"sticker","position-relative","border","border-dark","d-flex","flex-column",3,"ngStyle"],[1,"sticker-header","d-flex","justify-content-center","px-1"],[1,"sticker-body","d-flex","flex-column","align-items-center","justify-content-center",3,"ngClass"],[2,"line-height","0.3","width","100%","text-align","center"],[1,"d-flex","flex-column",2,"line-height","1"],[1,"d-flex","align-items-baseline",2,"line-height","1"],[2,"line-height","0","width","100%","text-align","center"],[2,"line-height","1"],[1,"d-flex","gap-1",2,"line-height","1",3,"ngStyle"],["id","barcode",3,"ngStyle"],[1,"text-dark",2,"line-height","1",3,"ngStyle"],["class","text-dark",3,"ngStyle",4,"ngIf"],[1,"text-dark",3,"ngStyle"],[1,"d-flex","gap-2","align-items-center"],[1,"promotion__normalprice_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-1","align-items-baseline"],["class","promotion__normalprice text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__normalprice","text-decoration-line-through","text-danger",3,"ngStyle"],[4,"ngIf"],[1,"promotion__price_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-2"],["class","text-danger promotion__price text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__price","text-danger","text-dark",3,"ngStyle"],[1,"promotion__normalprice","text-dark",3,"ngStyle"],[1,"text-danger","promotion__price","text-dark",3,"ngStyle"],["class","price text-dark",3,"ngStyle",4,"ngIf"],[1,"price","text-dark",3,"ngStyle"],[3,"ngStyle",4,"ngIf"],[3,"ngStyle"],["id","store-name-horizontal",1,"",2,"line-height","1"],["id","store-name-vertical",1,"position-absolute",2,"line-height","1"]],template:function(n,r){n&1&&(h(0,"div",1),St(1,CO,13,15,"div",2,XM),m()),n&2&&(C("ngStyle",r.barcodeContainerStyles),f(),Pt(r.items))},dependencies:[Or,Ov,Mr,xs,et,Mn,gm,Ar],styles:["#barcode[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:100%}.storename[_ngcontent-%COMP%]{position:absolute;right:0;top:0;transform:translateY(20%) rotate(270deg)}#store-name-vertical[_ngcontent-%COMP%]{top:50%;right:0;transform:translateY(-50%) rotate(-90deg)}.sticker-body[_ngcontent-%COMP%]{width:100%;display:inline-flex}.sticker-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{line-height:.9!important}"],changeDetection:0})}}return i})();var SO=Ne(Nh(),1);var Ec=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var ls="px",ey=$r({postfix:ls,min:0,thousandSeparator:""}),{plugins:PO}=ey,EO=Cr(ey,["plugins"]),Wt=k(_({},EO),{plugins:[...PO,$m(i=>[0,i.length-ls.length]),Wr("focus",i=>{i.setSelectionRange(0,i.value.length-ls.length)}),Wr("blur",i=>{i.value===ls&&Hr(i,`0${ls}`)})]});function IO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.barcodeHeight)}}function DO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.fontSize)}}function kO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.barcode)}}function TO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.code)}}function MO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.price)}}function OO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.name)}}function FO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.moveProductName)}}function AO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.releaseDate)}}function RO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.discountVisible)}}function BO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.pricebookPrice)}}function NO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.pricebookFontSize)}}var ty=(()=>{class i{constructor(){this.options=Wt,this.barcodeHeight=B(0),this.fontSize=B(0),this.barcode=B(!1),this.code=B(!1),this.price=B(!1),this.name=B(!1),this.moveProductName=B(!1),this.releaseDate=B(!1),this.discountVisible=B(!1),this.pricebookPrice=B(!1),this.pricebookFontSize=B(0),this.UOMVisible=B(!1),this.tooltip={barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)",barcode:"Whether barcode is visible",code:"Whether variant code is visible",price:"Whether variant price is visible",name:"Whether variant name is visible",moveProductName:"Whether move variant name below variant code or below variant price",releaseDate:"Whether release data is visible",discountVisible:"Whether variant's sell price discount is visible",pricebookPrice:"Whether pricebook price is visible",pricebookFontSize:"Change font size for pricebook price",UOMVisible:"Whether UOM is visible"},this.storeService=O(Re),this.injector=O(Ye),this.destroyRef=O(Ct)}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.barcodeHeight.set(e.BarcodeHeight),this.fontSize.set(e.ProductNameFontSize),this.barcode.set(e.BarcodeVisible),this.code.set(e.CodeVisible),this.price.set(e.PriceVisible),this.name.set(e.NameVisible),this.moveProductName.set(e.MoveProductNameOnTop),this.releaseDate.set(e.ShowReleasedDate),this.discountVisible.set(e.ShowPriceDiscount),this.pricebookPrice.set(e.PricebookVisible),this.pricebookFontSize.set(e.PricebookFontSize),this.UOMVisible.set(e.UOMNameVisible)})).subscribe()}onInputHandler(e,n){switch(console.log("value",e),n){case"barcodeHeight":this.barcodeHeight.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"barcode":this.barcode.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{BarcodeVisible:this.barcode()}));break;case"code":this.code.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{CodeVisible:this.code()}));break;case"price":this.price.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PriceVisible:this.price()}));break;case"name":this.name.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{NameVisible:this.name()}));break;case"moveProductName":this.moveProductName.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{MoveProductNameOnTop:this.moveProductName()}));break;case"releaseDate":this.releaseDate.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ShowReleasedDate:this.releaseDate()}));break;case"discountVisible":this.discountVisible.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ShowPriceDiscount:this.discountVisible()}));break;case"pricebookPrice":this.pricebookPrice.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PricebookVisible:this.pricebookPrice()}));break;case"pricebookFontSize":this.pricebookFontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PricebookFontSize:this.pricebookFontSize()}));break;case"UOMVisible":this.UOMVisible.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{UOMNameVisible:this.UOMVisible()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-barcode-view"]],standalone:!0,features:[fe],decls:114,vars:20,consts:[["barcodeHeightTemplate",""],["fontSizeTemplate",""],["barcodeTemplate",""],["codeTemplate",""],["priceTemplate",""],["nameTemplate",""],["moveProductNameTemplate",""],["releaseDateTemplate",""],["discountVisibleTemplate",""],["pricebookPriceTemplate",""],["pricebookFontSizeTemplate",""],[1,"table","table-bordered"],["for","barcode",1,"fs-2"],[1,"form-check","form-switch"],["id","barcode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","code",1,"fs-2"],["id","code","name","code","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","price",1,"fs-2"],["id","price","name","price","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","name",1,"fs-2"],["id","name","name","name","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","moveProductName",1,"fs-2","d-inline-block","text-truncate"],["id","moveProductName","name","moveProductName","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","releaseDate",1,"fs-2"],["id","releaseDate","name","releaseDate","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","discountVisible",1,"fs-2"],["id","discountVisible","name","discountVisible","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","pricebookPrice",1,"fs-2"],["id","pricebookPrice","name","pricebookPrice","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",11)(1,"tbody")(2,"tr")(3,"td")(4,"label",12),b(5,"Barcode"),m()(),h(6,"td")(7,"div",13)(8,"input",14),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"barcode"))}),m()()(),h(9,"td")(10,"span",15),b(11),m()()(),h(12,"tr")(13,"td")(14,"label",16),b(15,"Code"),m()(),h(16,"td")(17,"div",13)(18,"input",17),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"code"))}),m()()(),h(19,"td")(20,"span",15),b(21),m()()(),h(22,"tr")(23,"th")(24,"label",18),b(25,"Price"),m()(),h(26,"td")(27,"div",13)(28,"input",19),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"price"))}),m()()(),h(29,"td")(30,"span",15),b(31),m()()(),h(32,"tr")(33,"td")(34,"label",20),b(35,"Name"),m()(),h(36,"td")(37,"div",13)(38,"input",21),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"name"))}),m()()(),h(39,"td")(40,"span",15),b(41),m()()(),h(42,"tr")(43,"td")(44,"label",22),b(45,"Move Product Name"),m()(),h(46,"td")(47,"div",13)(48,"input",23),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"moveProductName"))}),m()()(),h(49,"td")(50,"span",15),b(51),m()()(),h(52,"tr")(53,"td")(54,"label",24),b(55,"Release Date"),m()(),h(56,"td")(57,"div",13)(58,"input",25),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"releaseDate"))}),m()()(),h(59,"td")(60,"span",15),b(61),m()()(),h(62,"tr")(63,"td")(64,"label",26),b(65,"Discount Visible"),m()(),h(66,"td")(67,"div",13)(68,"input",27),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"discountVisible"))}),m()()(),h(69,"td")(70,"span",15),b(71),m()()(),h(72,"tr")(73,"td")(74,"label",26),b(75,"UOM Visible"),m()(),h(76,"td")(77,"div",13)(78,"input",27),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"UOMVisible"))}),m()()(),h(79,"td")(80,"span",15),b(81),m()()(),h(82,"tr")(83,"td")(84,"label",28),b(85,"Pricebook Price"),m()(),h(86,"td")(87,"div",13)(88,"input",29),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"pricebookPrice"))}),m()()(),h(89,"td")(90,"span",15),b(91),m()()()()(),H(92,IO,2,1,"ng-template",null,0,we)(94,DO,2,1,"ng-template",null,1,we)(96,kO,2,1,"ng-template",null,2,we)(98,TO,2,1,"ng-template",null,3,we)(100,MO,2,1,"ng-template",null,4,we)(102,OO,2,1,"ng-template",null,5,we)(104,FO,2,1,"ng-template",null,6,we)(106,AO,2,1,"ng-template",null,7,we)(108,RO,2,1,"ng-template",null,8,we)(110,BO,2,1,"ng-template",null,9,we)(112,NO,2,1,"ng-template",null,10,we)}n&2&&(f(8),C("checked",r.barcode())("ngModel",r.barcode()),f(3),P(r.tooltip.barcode),f(7),C("checked",r.code())("ngModel",r.code()),f(3),P(r.tooltip.code),f(7),C("ngModel",r.price()),f(3),P(r.tooltip.price),f(7),C("ngModel",r.name()),f(3),P(r.tooltip.name),f(7),C("ngModel",r.moveProductName()),f(3),P(r.tooltip.moveProductName),f(7),C("ngModel",r.releaseDate()),f(3),P(r.tooltip.releaseDate),f(7),C("ngModel",r.discountVisible()),f(3),P(r.tooltip.discountVisible),f(7),C("ngModel",r.UOMVisible()),f(3),P(r.tooltip.UOMVisible),f(7),C("ngModel",r.pricebookPrice()),f(3),P(r.tooltip.pricebookPrice))},dependencies:[gt,Rr,ft,Vt,bt,Zs],styles:[".col[_ngcontent-%COMP%]{padding:0!important}.fas[_ngcontent-%COMP%] .fa-info-circle[_ngcontent-%COMP%]{font-size:12px}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function zO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.priceWithTax)}}function LO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.selectedTax)}}function jO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.currency)}}function HO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.fontSize)}}function VO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.outletPrice)}}var iy=(()=>{class i{constructor(){this.options=Wt,this.hasPriceTax=B(!1),this.selectedTax=B(""),this.taxType=B({}),this.currency=B(""),this.fontSize=B(0),this.outletPrice=B(""),this.tooltip={priceWithTax:"Tax is added to the product base price true",selectedTax:"Applied Tax ex: 100 + 10% = 110",currency:"The default currency",fontSize:"Change font size for price",outletPrice:"Price will be set according to the outlet price assigned when selected the outlet"},this.storeService=O(Re),this.destroyRef=O(Ct),this.injector=O(Ye),this.outlets=B([])}get taxs(){return this.storeService.taxs()}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(o=>{this.hasPriceTax.set(o.PriceWithTax),this.selectedTax.set(o.TaxType&&o.TaxType.ID),this.currency.set(o.CurrencySymbol),this.fontSize.set(o.PriceFontSize),this.outletPrice.set(o.OutletID)})).subscribe();let e=this.storeService.paperConfig().Outlets,n=this.storeService.productItems(),r=e.filter(o=>n?n.some(a=>a.OutletPrice?.some(s=>s.Outlet===o.Name)):[]);this.outlets.set(r),Dt(this.storeService.productItems,{injector:this.injector}).pipe(Ee(o=>{let a=o.some(s=>s.Promotions);this.outletPrice.set(a?"":this.outletPrice())})).subscribe(),Dt(this.outletPrice,{injector:this.injector}).pipe(st(o=>!!o),Ee(()=>{let o=[...this.storeService.productItems().map(a=>k(_({},a),{Promotions:null}))];this.storeService.onChangeProductItems(o)})).subscribe()}onInputHandler(e,n){switch(n){case"hasPriceTax":this.hasPriceTax.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PriceWithTax:this.hasPriceTax()}));break;case"selectedTax":let r=this.storeService.taxs().findIndex(o=>o.ID===e);r!==-1&&(this.selectedTax.set(e),this.taxType.set(this.storeService.taxs()[r])),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{TaxType:this.taxType()}));break;case"currency":this.currency.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{CurrencySymbol:this.currency()}));break;case"fontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break;case"outletPrice":if(this.outletPrice.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{OutletID:this.outletPrice()})),this.storeService.paperConfiguration().OutletID){let o=[...this.storeService.productItems().map(a=>k(_({},a),{Promotions:null}))];this.storeService.onChangeProductItems(o)}break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-price"]],standalone:!0,features:[fe],decls:49,vars:11,consts:[["priceWithTaxTemplate",""],["selectedTaxTemplate",""],["currencyTemplate",""],["fontSizeTemplate",""],["outletPriceTemplate",""],[1,"table","table-bordered"],["for","hasPriceTax",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","hasPriceTax","name","hasPriceTax","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","selectedTax",1,"fs-2","d-inline-block","text-truncate"],["id","selectedTax","name","selectedTax","bindLabel","Name","bindValue","ID","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","currency",1,"fs-2","d-inline-block","text-truncate"],["id","currency","name","currency","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","outletPrice",1,"fs-2","d-inline-block","text-truncate"],["id","outletPrice","name","outletPrice","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",5)(1,"tbody")(2,"tr")(3,"td")(4,"label",6),b(5,"Price With Tax"),m()(),h(6,"td")(7,"div",7)(8,"input",8),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"hasPriceTax"))}),m()()(),h(9,"td")(10,"span",9),b(11),m()()(),h(12,"tr")(13,"td")(14,"label",10),b(15,"Selected Tax"),m()(),h(16,"td")(17,"ng-select",11),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"selectedTax"))}),m()(),h(18,"td")(19,"span",9),b(20),m()()(),h(21,"tr")(22,"td")(23,"label",12),b(24,"Currency"),m()(),h(25,"td")(26,"input",13),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"currency"))}),m()(),h(27,"td")(28,"span",9),b(29),m()()(),h(30,"tr")(31,"th")(32,"label",14),b(33,"Outlet Price"),m()(),h(34,"td")(35,"ng-select",15),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"outletPrice"))}),m()(),h(36,"td")(37,"span",9),b(38),m()()()()(),H(39,zO,2,1,"ng-template",null,0,we)(41,LO,2,1,"ng-template",null,1,we)(43,jO,2,1,"ng-template",null,2,we)(45,HO,2,1,"ng-template",null,3,we)(47,VO,2,1,"ng-template",null,4,we)}n&2&&(f(8),C("checked",r.hasPriceTax())("ngModel",r.hasPriceTax()),f(3),P(r.tooltip.priceWithTax),f(6),C("ngModel",r.selectedTax())("items",r.taxs),f(3),P(r.tooltip.selectedTax),f(6),C("ngModel",r.currency()),f(3),P(r.tooltip.currency),f(6),C("ngModel",r.outletPrice())("items",r.outlets()),f(3),P(r.tooltip.outletPrice))},dependencies:[gt,ht,Rr,ft,Vt,bt,Di,qi],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function UO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.maxCharacter)}}function WO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.namePrefix)}}function $O(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.storeName)}}function qO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.orientation)}}function GO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.useDescriptionAsCode)}}function YO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.removeDefault)}}var ny=(()=>{class i{constructor(){this.storeService=O(Re),this.fb=O(Wi),this.destroyRef=O(Ct),this.injector=O(Ye),this.tooltip={maxCharacter:"The max character of the product name",namePrefix:"A word, letter, or number placed before product name",storeName:"The name of the store",orientation:"Horizontal or vertical position store name label",useDescriptionAsCode:"Copy product description into product code",removeDefault:"Remove 'Default' label from product name"},this.maxCharacter=B(0),this.namePrefix=B(""),this.storeName=B(""),this.orientation=B(0),this.useDescriptionAsCode=B(!1),this.removeDefault=B(!1),this.options=Wt}ngOnInit(){this.initForm(),Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.maxCharacter.set(e.ProductNameMaxLength),this.namePrefix.set(e.ProductNamePrefix),this.storeName.set(e.StoreName),this.orientation.set(e.Orientation),this.useDescriptionAsCode.set(e.DescriptionAsCode),this.removeDefault.set(!1)})).subscribe(),this.form.valueChanges.pipe(Rt(this.destroyRef),Ee(e=>{let n=k(_({},this.storeService.paperConfiguration()),{ProductNameMaxLength:e.maxCharacter,ProductNamePrefix:e.namePrefix,StoreName:e.storeName,Orientation:e.orientation,DescriptionAsCode:!!e.useDescriptionAsCode});this.storeService.onChangePaperConfiguration(n);let o=["ProductNameMaxLength","ProductNamePrefix","StoreName","Orientation","DescriptionAsCode"].reduce((a,s)=>(s in this.storeService.paperConfiguration()&&(a[s]=this.storeService.paperConfiguration()[s]),a),{});console.log("filtered advanced",o)})).subscribe()}onInputHandler(e,n){switch(n){case"maxCharacter":this.maxCharacter.set(+e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNameMaxLength:this.maxCharacter()}));break;case"namePrefix":this.namePrefix.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNamePrefix:this.namePrefix()}));break;case"storeName":this.storeName.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{StoreName:this.storeName()}));break;case"orientation":this.orientation.set(+e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{Orientation:this.orientation()}));break;case"useDescriptionAsCode":this.useDescriptionAsCode.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{DescriptionAsCode:this.useDescriptionAsCode()}));break;case"removeDefault":this.removeDefault.set(!!e);break}}initForm(){this.form=this.fb.group({maxCharacter:new kt(this.storeService.paperConfiguration().ProductNameMaxLength,[mt.required]),namePrefix:new kt(null,[mt.required]),storeName:new kt(null,[mt.required]),orientation:new kt(null,[mt.required]),useDescriptionAsCode:new kt(null,[mt.required]),removeDefault:new kt("0",[mt.required])}),this.form.patchValue({maxCharacter:this.storeService.paperConfiguration().ProductNameMaxLength,namePrefix:this.storeService.paperConfiguration().ProductNamePrefix,storeName:this.storeService.paperConfiguration().StoreName,orientation:this.storeService.paperConfiguration().Orientation,useDescriptionAsCode:Number(this.storeService.paperConfiguration().DescriptionAsCode).toString()})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-advanced"]],standalone:!0,features:[fe],decls:70,vars:15,consts:[["maxCharacterTemplate",""],["namePrefixTemplate",""],["storeNameTemplate",""],["orientationTemplate",""],["useDescriptionAsCodeTemplate",""],["removeDefaultTemplate",""],[1,"table","table-bordered"],["for","MaxCharacter",1,"fs-2","d-inline-block","text-truncate"],["id","maxCharacter","name","maxCharacter","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fw-medium","fs-2"],["for","namePrefix",1,"fs-2","d-inline-block","text-truncate"],["name","namePrefix","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","storeName",1,"fs-2","d-inline-block","text-truncate"],["id","storeName","name","storeName","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","orientation",1,"fs-2","d-inline-block","text-truncate"],["id","orientation","name","orientation","bindLabel","Value","bindValue","Key","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","useDescriptionAsCode",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","useDescriptionAsCode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","removeDefault",1,"fs-2","d-inline-block","text-truncate"],["id","removeDefault","name","removeDefault","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",6)(1,"tbody")(2,"tr")(3,"td")(4,"label",7),b(5,"Max Character"),m()(),h(6,"td")(7,"input",8),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"maxCharacter"))}),m()(),h(8,"td")(9,"span",9),b(10),m()()(),h(11,"tr")(12,"td")(13,"label",10),b(14,"Name Prefix"),m()(),h(15,"td")(16,"input",11),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"namePrefix"))}),m()(),h(17,"td")(18,"span",9),b(19),m()()(),h(20,"tr")(21,"td")(22,"label",12),b(23,"Store Name"),m()(),h(24,"td")(25,"input",13),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"storeName"))}),m()(),h(26,"td")(27,"span",9),b(28),m()()(),h(29,"tr")(30,"th")(31,"label",14),b(32,"Orientation"),m()(),h(33,"td")(34,"ng-select",15),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"orientation"))}),m()(),h(35,"td")(36,"span",9),b(37),m()()(),h(38,"tr")(39,"td")(40,"label",16),b(41,"Use description as code"),m()(),h(42,"td")(43,"div",17)(44,"input",18),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"useDescriptionAsCode"))}),m()()(),h(45,"td")(46,"span",9),b(47),m()()(),h(48,"tr")(49,"td")(50,"label",19),b(51,'Remove "Default"'),m()(),h(52,"td")(53,"div",17)(54,"input",20),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"removeDefault"))}),m()()(),h(55,"td")(56,"span",9),b(57),m()()()()(),H(58,UO,2,1,"ng-template",null,0,we)(60,WO,2,1,"ng-template",null,1,we)(62,$O,2,1,"ng-template",null,2,we)(64,qO,2,1,"ng-template",null,3,we)(66,GO,2,1,"ng-template",null,4,we)(68,YO,2,1,"ng-template",null,5,we)}n&2&&(f(7),C("ngModel",r.maxCharacter()),f(3),P(r.tooltip.maxCharacter),f(6),C("ngModel",r.namePrefix()),f(3),P(r.tooltip.namePrefix),f(6),C("ngModel",r.storeName()),f(3),P(r.tooltip.storeName),f(6),C("ngModel",r.orientation())("items",r.storeService.paperConfiguration().OrientationChoice),f(3),P(r.tooltip.orientation),f(7),C("checked",r.useDescriptionAsCode())("ngModel",r.useDescriptionAsCode()),f(3),P(r.tooltip.useDescriptionAsCode),f(7),C("checked",r.removeDefault())("ngModel",r.removeDefault()),f(3),P(r.tooltip.removeDefault))},dependencies:[bt,ht,Rr,ft,Di,qi,gt,Vt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var ry=Ne(Lh());var XO=["content"],KO=i=>({$implicit:i});function QO(i,t){if(i&1){let e=Se();h(0,"button",11),N("click",function(){X(e);let r=S();return K(r.onNext())}),h(1,"span",13),b(2,"Next"),m(),J(3,"i",22),m()}}function ZO(i,t){if(i&1){let e=Se();h(0,"button",11),N("click",function(){X(e);let r=S();return K(r.onPrintShelfLabel())}),h(1,"span",13),b(2,"Print"),m()()}}function JO(i,t){i&1&&on(0)}function eF(i,t){i&1&&(h(0,"div",21)(1,"div",23)(2,"div",24)(3,"h4",25),b(4," Sticker Content "),m()(),h(5,"div",26)(6,"div",27)(7,"div",28)(8,"h2",29)(9,"button",30)(10,"span",31),b(11,"Barcode View"),m()()(),h(12,"div",32)(13,"div",33,0),J(15,"app-barcode-view"),m()()(),h(16,"div",28)(17,"h2",29)(18,"button",30)(19,"span",34),b(20,"Price"),m()()(),h(21,"div",32)(22,"div",33,0),J(24,"app-price"),m()()(),h(25,"div",28)(26,"h2",29)(27,"button",30)(28,"span",34),b(29,"Advanced"),m()()(),h(30,"div",32)(31,"div",33,0),J(33,"app-advanced"),m()()()()()()()),i&2&&(f(6),C("closeOthers",!0),f(),C("collapsed",!1),f(9),C("collapsed",!0),f(9),C("collapsed",!0))}function tF(i,t){if(i&1){let e=Se();h(0,"div",21)(1,"div",23)(2,"div",24)(3,"h4",25),b(4," Sticker Content "),m()(),h(5,"div",26)(6,"div",27)(7,"div",28)(8,"h2",29)(9,"button",30)(10,"span",31),b(11,"Price Label"),m()()(),h(12,"div",32)(13,"div",33,0)(15,"table",35)(16,"tbody")(17,"tr")(18,"td")(19,"label",36),b(20,"Price Font Size"),m()(),h(21,"td")(22,"div",37)(23,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("NormalFontSize",r))}),m()()(),h(24,"td")(25,"span",39),b(26),m()()(),h(27,"tr")(28,"td")(29,"label",36),b(30,"Currency Symbol Font Size"),m()(),h(31,"td")(32,"div",37)(33,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("CurrencySymbolFontSize",r))}),m()()(),h(34,"td")(35,"span",39),b(36),m()()(),h(37,"tr")(38,"td")(39,"label",40),b(40,"Original Price Font Size"),m()(),h(41,"td")(42,"div",37)(43,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("PromotionPriceFontSize",r))}),m()()(),h(44,"td")(45,"span",39),b(46),m()()(),h(47,"tr")(48,"td")(49,"label",41),b(50,"Promotion Date Font Size"),m()(),h(51,"td")(52,"div",37)(53,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("PromotionDateFontSize",r))}),m()()(),h(54,"td")(55,"span",39),b(56),m()()(),h(57,"tr")(58,"td")(59,"label",42),b(60,"Promotion Desc Font Size"),m()(),h(61,"td")(62,"div",37)(63,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("PromotionDescFontSize",r))}),m()()(),h(64,"td")(65,"span",39),b(66),m()()(),h(67,"tr")(68,"td")(69,"label",43),b(70,"Product Name Font Size"),m()(),h(71,"td")(72,"div",37)(73,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("ProductNameFontSize",r))}),m()()(),h(74,"td")(75,"span",39),b(76),m()()(),h(77,"tr")(78,"td")(79,"label",44),b(80,"Product Code Font Size"),m()(),h(81,"td")(82,"div",37)(83,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("ProductCodeFontSize",r))}),m()()(),h(84,"td")(85,"span",39),b(86),m()()(),h(87,"tr")(88,"td")(89,"label",45),b(90,"Print Date Font Size"),m()(),h(91,"td")(92,"div",37)(93,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("PrintDateFontSize",r))}),m()()(),h(94,"td")(95,"span",39),b(96),m()()(),h(97,"tr")(98,"td")(99,"label",46),b(100,"Store Name Font Size"),m()(),h(101,"td")(102,"div",37)(103,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("StoreNameFontSize",r))}),m()()(),h(104,"td")(105,"span",39),b(106),m()()(),h(107,"tr")(108,"td")(109,"label",47),b(110,"Company Name Label"),m()(),h(111,"td")(112,"div",37)(113,"input",48),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("CompanyNameLabel",r))}),m()()(),h(114,"td")(115,"span",39),b(116),m()()(),h(117,"tr")(118,"td")(119,"label",47),b(120,"Currency Symbol"),m()(),h(121,"td")(122,"div",37)(123,"input",48),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("CurrencySymbol",r))}),m()()(),h(124,"td")(125,"span",39),b(126),m()()()()()()()()()()()()}if(i&2){let e=S();f(6),C("closeOthers",!0),f(),C("collapsed",!1),f(16),C("ngModel",e.normalPriceFontSize())("maskito",e.options),f(3),P(e.tooltip.normalPriceFontSize),f(7),C("ngModel",e.currencySymbolFontSize())("maskito",e.options),f(3),P(e.tooltip.currencySymbolFontSize),f(7),C("ngModel",e.promotionPriceFontSize())("maskito",e.options),f(3),P(e.tooltip.promotionPriceFontSize),f(7),C("ngModel",e.promotionDateFontSize())("maskito",e.options),f(3),P(e.tooltip.promotionDateFontSize),f(7),C("ngModel",e.promotionDescFontSize())("maskito",e.options),f(3),P(e.tooltip.promotionDescFontSize),f(7),C("ngModel",e.productNameFontSize())("maskito",e.options),f(3),P(e.tooltip.productNameFontSize),f(7),C("ngModel",e.productCodeFontSize())("maskito",e.options),f(3),P(e.tooltip.productCodeFontSize),f(7),C("ngModel",e.printDateFontSize())("maskito",e.options),f(3),P(e.tooltip.printDateFontSize),f(7),C("ngModel",e.storeNameFontSize())("maskito",e.options),f(3),P(e.tooltip.storeNameFontSize),f(7),C("ngModel",e.companyNameLabel()),f(3),P(e.tooltip.companyNameLabel),f(7),C("ngModel",e.currencySymbol()),f(3),P(e.tooltip.currencySymbol)}}var HW=(()=>{class i{constructor(){this.storeService=O(Re),this.httpService=O($i),this.sidebarConfig=To("barcode"),this.toastr=O(zr),this.route=O(Ui),this.router=O(Ei),this.step=B(0),this.options=Wt,this.normalPriceFontSize=B(this.storeService.paperShelfLabelConfig().NormalFontSize),this.promotionPriceFontSize=B(this.storeService.paperShelfLabelConfig().PromotionPriceFontSize),this.promotionDateFontSize=B(this.storeService.paperShelfLabelConfig().PromotionDateFontSize),this.promotionDescFontSize=B(this.storeService.paperShelfLabelConfig().PromotionDescFontSize),this.productNameFontSize=B(this.storeService.paperShelfLabelConfig().ProductNameFontSize),this.productCodeFontSize=B(this.storeService.paperShelfLabelConfig().ProductCodeFontSize),this.printDateFontSize=B(this.storeService.paperShelfLabelConfig().PrintDateFontSize),this.storeNameFontSize=B(this.storeService.paperShelfLabelConfig().StoreNameFontSize),this.companyNameLabel=B(this.storeService.paperShelfLabelConfig().CompanyNameLabel),this.currencySymbol=B(this.storeService.paperShelfLabelConfig().CurrencySymbol),this.currencySymbolFontSize=B(this.storeService.paperShelfLabelConfig().CurrencySymbolFontSize),this.tooltip={normalPriceFontSize:"Font size for Unit Price and Promotion Event Price",promotionPriceFontSize:"Font size for Original Price",promotionDateFontSize:"Font size for end date promotion event",promotionDescFontSize:"Font size for promotion label",productNameFontSize:"Font size for product name",productCodeFontSize:"Font size for variant code",printDateFontSize:"Font size for print date label",storeNameFontSize:"Font size for company label name",companyNameLabel:"Label for custom company name",currencySymbol:"Currency Symbol",currencySymbolFontSize:"Font size for currency symbol"}}ngOnInit(){this.route.queryParamMap.pipe(st(e=>e.has("step")),Ve(e=>+e.get("step")),Ee(e=>this.step.set(e))).subscribe()}onUpdateConfig(e,n){let r=n.toString().replace("px",""),o=_({},this.storeService.paperShelfLabelConfig());o[e]=typeof n=="number"?+r:r,this.storeService.onChangeShelfLabelConfig(o)}onPrevious(){this.step.set(this.step()-1),this.router.navigate([],{queryParams:{step:this.step()},queryParamsHandling:"merge",relativeTo:this.route})}onNext(){this.step.set(this.step()+1),this.router.navigate([],{queryParams:{step:this.step()},queryParamsHandling:"merge",relativeTo:this.route})}onSaveConfig(){let e={observe:"response"};console.log("Saving config:",this.storeService.paperShelfLabelConfig());let n=Object.entries(this.storeService.paperShelfLabelConfig()).reduce((o,[a,s])=>(parseInt(s)?o[a]=parseInt(s):o[a]=s,o),{}),r=_({SubDomain:localStorage.getItem("Domain")},n);this.httpService.post("api/ConfigShelf/SaveConfig",r,e).pipe(Lr("response"),Ee(o=>{o instanceof Cs&&o.status===200&&this.toastr.success(o.body.Message,"success")})).subscribe()}pxToPt(e){return e*.75}onPrintShelfLabel(){let e=this.storeService.productItems().some(v=>v.Promotions),{NormalFontSize:n,PromotionPriceFontSize:r,PromotionDateFontSize:o,PromotionDescFontSize:a,ProductNameFontSize:s,ProductCodeFontSize:l,PrintDateFontSize:c,StoreNameFontSize:d,CurrencySymbolFontSize:p}=this.storeService.paperShelfLabelConfig();(0,ry.default)({printable:"print-wrapper",type:"html",scanStyles:!0,font_size:"",targetStyle:["*"],style:`
30
+ `,e={width:this.opts.width,height:this.opts.height};return u("button",{type:"button",className:t,style:e,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),u("div",{className:"uppy-DragDrop-inner"},i.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:t}=this.opts;this.setPluginState({isDraggingOver:!1}),t&&this.mount(t,this)}uninstall(){this.unmount()}};go.VERSION=UE.version;var Su=class{onMount(t,e){this.options=_(_({},t),this.props),this.uppy.use(e,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(t,e){t.uppy&&this.uppy!==t.uppy.previousValue&&t.uppy.previousValue!==void 0&&(this.uninstall(t.uppy.previousValue),this.uppy.use(e,this.options)),this.options=_(_({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),t.props&&this.props!==t.props.previousValue&&t.props.previousValue!==void 0&&this.plugin.setOptions(_({},this.options))}uninstall(t=this.uppy){t.removePlugin(this.plugin)}},wv=(()=>{class i extends Su{constructor(e){super(),this.el=e,this.uppy=new eo,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},vr)}ngOnChanges(e){this.handleChanges(e,vr)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(n){return new(n||i)(W(Ce))}}static{this.\u0275cmp=pe({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[Ci,$t],decls:0,vars:0,template:function(n,r){},encapsulation:2,changeDetection:0})}}return i})();var xv=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();function ge(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var qE=0;function ri(i){return"__private_"+qE+++"_"+i}function GE(i){return new Error("Cancelled",{cause:i})}function Cv(i){if(i!=null){var t;let e=()=>this.abort(i.reason);i.addEventListener("abort",e,{once:!0});let n=()=>{i.removeEventListener("abort",e)};(t=this.then)==null||t.call(this,n,n)}return this}var yi=ri("activeRequests"),Qt=ri("queuedHandlers"),_i=ri("paused"),_r=ri("pauseTimer"),Kt=ri("downLimit"),yr=ri("upperLimit"),xn=ri("rateLimitingTimer"),Ka=ri("call"),Cn=ri("queueNext"),Iu=ri("next"),Pu=ri("queue"),Du=ri("dequeue"),Eu=ri("resume"),wr=ri("increaseLimit"),uc=class{constructor(t){Object.defineProperty(this,Du,{value:ZE}),Object.defineProperty(this,Pu,{value:QE}),Object.defineProperty(this,Iu,{value:KE}),Object.defineProperty(this,Cn,{value:XE}),Object.defineProperty(this,Ka,{value:YE}),Object.defineProperty(this,yi,{writable:!0,value:0}),Object.defineProperty(this,Qt,{writable:!0,value:[]}),Object.defineProperty(this,_i,{writable:!0,value:!1}),Object.defineProperty(this,_r,{writable:!0,value:void 0}),Object.defineProperty(this,Kt,{writable:!0,value:1}),Object.defineProperty(this,yr,{writable:!0,value:void 0}),Object.defineProperty(this,xn,{writable:!0,value:void 0}),Object.defineProperty(this,Eu,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,wr,{writable:!0,value:()=>{if(ge(this,_i)[_i]){ge(this,xn)[xn]=setTimeout(ge(this,wr)[wr],0);return}ge(this,Kt)[Kt]=this.limit,this.limit=Math.ceil((ge(this,yr)[yr]+ge(this,Kt)[Kt])/2);for(let e=ge(this,Kt)[Kt];e<=this.limit;e++)ge(this,Cn)[Cn]();ge(this,yr)[yr]-ge(this,Kt)[Kt]>3?ge(this,xn)[xn]=setTimeout(ge(this,wr)[wr],2e3):ge(this,Kt)[Kt]=Math.floor(ge(this,Kt)[Kt]/2)}}),typeof t!="number"||t===0?this.limit=1/0:this.limit=t}run(t,e){return!ge(this,_i)[_i]&&ge(this,yi)[yi]<this.limit?ge(this,Ka)[Ka](t):ge(this,Pu)[Pu](t,e)}wrapSyncFunction(t,e){var n=this;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];let s=n.run(()=>(t(...o),queueMicrotask(()=>s.done()),()=>{}),e);return{abortOn:Cv,abort(){s.abort()}}}}wrapPromiseFunction(t,e){var n=this;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];let s,l=new Promise((c,d)=>{s=n.run(()=>{let p,v;try{v=Promise.resolve(t(...o))}catch(g){v=Promise.reject(g)}return v.then(g=>{p?d(p):(s.done(),c(g))},g=>{p?d(p):(s.done(),d(g))}),g=>{p=GE(g)}},e)});return l.abort=c=>{s.abort(c)},l.abortOn=Cv,l}}resume(){ge(this,_i)[_i]=!1,clearTimeout(ge(this,_r)[_r]);for(let t=0;t<this.limit;t++)ge(this,Cn)[Cn]()}pause(t){t===void 0&&(t=null),ge(this,_i)[_i]=!0,clearTimeout(ge(this,_r)[_r]),t!=null&&(ge(this,_r)[_r]=setTimeout(ge(this,Eu)[Eu],t))}rateLimit(t){clearTimeout(ge(this,xn)[xn]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(ge(this,yr)[yr]=this.limit-1,this.limit=ge(this,Kt)[Kt],ge(this,xn)[xn]=setTimeout(ge(this,wr)[wr],t))}get isPaused(){return ge(this,_i)[_i]}};function YE(i){ge(this,yi)[yi]+=1;let t=!1,e;try{e=i()}catch(n){throw ge(this,yi)[yi]-=1,n}return{abort:n=>{t||(t=!0,ge(this,yi)[yi]-=1,e?.(n),ge(this,Cn)[Cn]())},done:()=>{t||(t=!0,ge(this,yi)[yi]-=1,ge(this,Cn)[Cn]())}}}function XE(){queueMicrotask(()=>ge(this,Iu)[Iu]())}function KE(){if(ge(this,_i)[_i]||ge(this,yi)[yi]>=this.limit||ge(this,Qt)[Qt].length===0)return;let i=ge(this,Qt)[Qt].shift();if(i==null)throw new Error("Invariant violation: next is null");let t=ge(this,Ka)[Ka](i.fn);i.abort=t.abort,i.done=t.done}function QE(i,t){let e={fn:i,priority:t?.priority||0,abort:()=>{ge(this,Du)[Du](e)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=ge(this,Qt)[Qt].findIndex(r=>e.priority>r.priority);return n===-1?ge(this,Qt)[Qt].push(e):ge(this,Qt)[Qt].splice(n,0,e),e}function ZE(i){let t=ge(this,Qt)[Qt].indexOf(i);t!==-1&&ge(this,Qt)[Qt].splice(t,1)}var A7=Symbol("__queue");var Mu=Ne(oa(),1),Iv=Ne(Sv(),1);var Pv={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function Ev(i,t){if(!{}.hasOwnProperty.call(i,t))throw new TypeError("attempted to use private field on non-instance");return i}var JE=0;function eI(i){return"__private_"+JE+++"_"+i}var tI={quality:.6,limit:10},Qa=eI("RateLimitedQueue"),hc=class extends nr{constructor(t,e){super(t,_(_({},tI),e)),Object.defineProperty(this,Qa,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=Pv,Ev(this,Qa)[Qa]=new uc(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(t){return new Promise((e,n)=>{new Iv.default(t,k(_({},this.opts),{success:e,error:n}))})}prepareUpload(t){return j(this,null,function*(){let e=0,n=[],r=Ev(this,Qa)[Qa].wrapPromiseFunction(a=>j(this,null,function*(){try{let s=yield this.compress(a.data),l=a.data.size-s.size;this.uppy.log(`[Image Compressor] Image ${a.id} compressed by ${(0,Mu.default)(l)}`),e+=l;let{name:c,type:d,size:p}=s,v=Xi(c),w=`${Xi(a.meta.name).name}.${v.extension}`;this.uppy.setFileState(a.id,k(_(_(_(_({},c&&{name:c}),v.extension&&{extension:v.extension}),d&&{type:d}),p&&{size:p}),{data:s,meta:k(_({},a.meta),{type:d,name:w})})),n.push(a)}catch(s){this.uppy.log(`[Image Compressor] Failed to compress ${a.id}:`,"warning"),this.uppy.log(s,"warning")}})),o=t.map(a=>{var s;let l=this.uppy.getFile(a);return this.uppy.emit("preprocess-progress",l,{mode:"indeterminate",message:this.i18n("compressingImages")}),l.isRemote||(l.data.type||(l.data=l.data.slice(0,l.data.size,l.type)),!((s=l.type)!=null&&s.startsWith("image/")))?Promise.resolve():r(l)});yield Promise.all(o),this.uppy.emit("compressor:complete",n),e>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Mu.default)(e)}),"info");for(let a of t){let s=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",s)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var kv=Ne(Dv(),1);function iI(i,t){if(i&1&&(h(0,"small",5),b(1),m()),i&2){let e=S();f(),P(e.subtitle)}}function nI(i,t){if(i&1&&(h(0,"a",6),J(1,"i",7),b(2," Download Template "),m()),i&2){let e=S();Ze("top-58",e.subtitle),C("href",e.sampleUrl,Wn)}}function rI(i,t){if(i&1&&(ys(0),b(1),ws()),i&2){let e=S(2);f(),Ht("- ",e.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function oI(i,t){if(i&1&&(h(0,"div",4)(1,"h4",8),b(2,"CSV File Content Summary"),m(),J(3,"hr"),h(4,"p",9),b(5),H(6,rI,2,1,"ng-container",10),m()()),i&2){let e=S();f(5),Ht("",e.rowSummary().rowCount," rows found "),f(),C("ngIf",e.rowSummary().rowEmpty>0)}}var Tv=(()=>{class i{static{this.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]}static{this.kilobyte=1024}constructor(){this.sampleUrl="",this.subtitle="",this.showSample=!0,this.showSubtitle=!0,this.uppyCoreConfiguration=Mo(),this.dashboardPropsConfiguration=Mo(),this.fileUploaded=new He,this.fileUploadComplete=new He,this.fileRemoved=new He,this.onParser=new He,this.multipleFilesUploaded=new He,this.http=O(_g),this.csvParser=O(vg),this.rowSummary=B({rowCount:0,rowEmpty:0}),this.file=B(null),this.multipleFiles=B([]),this.uppy=new eo({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}).use(hc,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}),this.dashboardProps={hideUploadButton:!0,height:350},an(()=>this.uppy.setOptions(_({},this.uppyCoreConfiguration()))),an(()=>this.dashboardProps=_(_({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(e,n)=>{let r=n[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(e,n,r),this.fileUploaded.emit(r),this.file.set(n[0].data),kv.default.parse(r,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:o=>{let a=o.split(/\r?\n/).slice(1);return a[a.length-1]===""&&a.pop(),this.rowSummary.update(s=>k(_({},s),{rowCount:a.length})),a.forEach(s=>{s.split(",").every(c=>c==="")&&this.rowSummary.update(c=>k(_({},c),{rowEmpty:c.rowEmpty+1}))}),o},error(o,a){console.log("ERROR",o,a)},complete:(o,a)=>{this.onParser.emit(o.data)}})}),this.uppy.on("complete",e=>{let n=e.successful?.map(o=>({file:o.data,id:o.id}))??[],r=e.successful[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(r),this.fileUploadComplete.emit(r),this.multipleFilesUploaded.emit(n),this.file.set(r),this.multipleFiles.set(n)}),this.uppy.on("transloadit:upload",(e,n)=>{console.log(e,n)}),this.uppy.on("transloadit:result",(e,n)=>{console.log(e,n)}),this.uppy.on("file-removed",e=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let r=this.multipleFiles().filter(o=>o.id!=e.id);this.multipleFiles.set(r),this.fileRemoved.emit(e.id),this.rowSummary.set({rowCount:0,rowEmpty:0})})}formatFileSize(e,n=2){if(e===0)return"0 bytes";let r=Math.floor(Math.log(e)/Math.log(i.kilobyte));return`${(e/Math.pow(i.kilobyte,r)).toFixed(n)} ${i.sizes[r]}`}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["POS-uppy"]],inputs:{sampleUrl:"sampleUrl",subtitle:"subtitle",uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileUploadComplete:"fileUploadComplete",fileRemoved:"fileRemoved",onParser:"onParser",multipleFilesUploaded:"multipleFilesUploaded"},standalone:!0,features:[fe],decls:5,vars:5,consts:[[1,"position-relative"],[3,"uppy","props"],["class","subtitle position-absolute",4,"ngIf"],["class","sample position-absolute","role","button",3,"top-58","href",4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","flex-column","gap-2",2,"margin","1rem 0 0 0"],[1,"subtitle","position-absolute"],["role","button",1,"sample","position-absolute",3,"href"],[1,"fa-solid","fa-download","ms-3"],[1,"alert-heading"],[1,"fs-6","m-0"],[4,"ngIf"]],template:function(n,r){if(n&1&&(h(0,"div",0),J(1,"uppy-dashboard",1),H(2,iI,2,1,"small",2)(3,nI,3,3,"a",3)(4,oI,7,2,"div",4),m()),n&2){let o;f(),C("uppy",r.uppy)("props",r.dashboardProps),f(),C("ngIf",r.subtitle&&r.showSubtitle),f(),C("ngIf",r.sampleUrl&&r.showSample),f(),ae(r.file()&&((o=r.file())==null?null:o.type)==="text/csv"?4:-1)}},dependencies:[xv,wv,et,Mr],styles:[".uppy-Dashboard-AddFiles-info{display:none!important} .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;max-width:600px;margin-top:15px;padding-top:0;overflow-y:visible}.sample[_ngcontent-%COMP%], .subtitle[_ngcontent-%COMP%]{top:56%;width:100%;text-align:center}.top-58[_ngcontent-%COMP%]{top:61%}"]})}}return i})();var Mv=(()=>{class i{constructor(){this.file=null,this.sample_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",this.fb=O(Wi),this.httpService=O($i),this.destroyRef=O(Ct),this.activeModal=O(js)}ngOnInit(){this.form=this.fb.group({file:new kt("",[mt.required])})}onSelectFile(e){e instanceof File&&(this.file=e)}onOK(){let e=`https://${localStorage.getItem("Domain")}`;if(this.file){let n=new FormData;n.append("file",this.file,this.file.name),n.append("OutletID",""),this.httpService.postFormData("API/catalog/product/UploadCSVforBarcode",n,void 0,e).pipe(Rt(this.destroyRef),Ri(r=>{let o=r.map(a=>this.httpService.post("/API/V3/Variant/ID",{EntityID:"00000000-0000-0000-0000-000000000000",ID:a.VariantID},void 0,e).pipe(Ve(s=>k(_({},s),{Promotions:a.Print[0].IsDiscounted?k(_({},a.Print[0]),{UnitPrice:a.Print[0].UnitPriceDiscounted}):null,Quantity:a.Quantity,UnitPrice:a.Print[0].UnitPrice,Uuid:Qr()}))));return ms(o)}),Lr("response")).subscribe({next:r=>{this.activeModal.close(r)}})}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-dialog-import-product"]],standalone:!0,features:[fe],decls:2,vars:2,consts:[["title","Upload New Product Barcode?",3,"onOK","hasValid"],[3,"fileUploaded","sampleUrl"]],template:function(n,r){n&1&&(h(0,"app-base-modal",0),N("onOK",function(){return r.onOK()}),h(1,"POS-uppy",1),N("fileUploaded",function(a){return r.onSelectFile(a)}),m()()),n&2&&(C("hasValid",r.form.valid),f(),C("sampleUrl",r.sample_URL))},dependencies:[Hs,bt,Tv],styles:["pos-uppy div div h4{font-size:14px;margin:0} pos-uppy div div hr{margin:0!important} pos-uppy div div p.fs-6{font-size:1rem!important}"]})}}return i})();function aI(i,t){if(i&1&&(h(0,"span",46),b(1),Je(2,"maskito"),m()),i&2){let e=S(2).$implicit,n=S();f(),P(Si(2,1,n.promotionDiscount(e.Promotions),n.options))}}function sI(i,t){if(i&1&&(h(0,"div",38)(1,"span",44),b(2),Je(3,"maskito"),m(),H(4,aI,3,4,"span",45),m()),i&2){let e,n=S().$implicit,r=S();f(2),P(Si(3,2,(e=n.UnitPrice)!==null&&e!==void 0?e:n.Promotions.UnitPrice,r.options)),f(2),C("ngIf",n.Promotions)}}function lI(i,t){if(i&1&&(h(0,"div",38)(1,"span"),b(2),Je(3,"maskito"),m()()),i&2){let e=S(2).$implicit,n=S();f(2),P(Si(3,1,e.Print[0].UnitPrice,n.options))}}function cI(i,t){if(i&1&&(h(0,"div",38)(1,"span"),b(2),Je(3,"maskito"),m()()),i&2){let e=S(2).$implicit,n=S();f(2),P(Si(3,1,e.UnitPrice,n.options))}}function dI(i,t){if(i&1&&H(0,lI,4,4,"div",38)(1,cI,4,4,"div",38),i&2){let e=S().$implicit;ae(e.Print&&e.Print.length>0?0:1)}}function pI(i,t){i&1&&J(0,"i",41)}function uI(i,t){i&1&&J(0,"i",42)}function hI(i,t){if(i&1){let e=Se();h(0,"tr")(1,"td"),b(2),m(),h(3,"td"),b(4),m(),h(5,"td"),b(6),Je(7,"number"),m(),h(8,"td"),H(9,sI,5,5,"div",38)(10,dI,2,1),m(),h(11,"td")(12,"div",39)(13,"button",40),N("click",function(){let r=X(e).$implicit,o=S();return K(o.onToggleSelected(r))}),H(14,pI,1,0,"i",41)(15,uI,1,0,"i",42),m(),h(16,"button",40),N("click",function(){let r=X(e).$implicit,o=S();return K(o.onRemoveItem(r))}),J(17,"i",43),m()()()()}if(i&2){let e=t.$implicit,n=S();f(2),P(e.Name),f(2),P(e.Code),f(2),P(pi(7,5,e.Quantity)),f(3),ae(e.Promotions?9:10),f(5),ae(e.isSelected&&n.productEdit?14:15)}}var GV=(()=>{class i{constructor(){this.productItems=[],this.storeService=O(Re),this.Object=Object,this.options=$r({precision:2,thousandSeparator:","}),this.modalService=O(Pm),this.httpService=O($i),this.router=O(Ei),this.route=O(Ui),this.rowSelectedID=B(""),this.toggleState=B(!1),this.printMode=B(1),this.step=B(0),an(()=>{this.toggleState.update(e=>!e)},{allowSignalWrites:!0})}ngOnInit(){this.route.queryParamMap.pipe(st(e=>e.has("step")),Ve(e=>+e.get("step")),Ee(e=>this.step.set(e))).subscribe()}onNext(){this.storeService.onNextStep(),this.router.navigate([],{queryParams:{step:this.step()+1},queryParamsHandling:"merge",relativeTo:this.route})}onOpenModalChooseProduct(){return j(this,null,function*(){let n=yield this.modalService.open(ul,{centered:!0}).result;if(n){let r=[...this.storeService.productItems()],o=r.findIndex(s=>s.ID===n.ID);o!==-1?r[o].Quantity+=n.Quantity:r.push(n);let a=[...r];this.storeService.onChangeProductItems(a),Uc.production||localStorage.setItem("productItems",JSON.stringify(a))}})}onOpenModalEdit(e){return j(this,null,function*(){let n=this.modalService.open(ul,{centered:!0,scrollable:!0});n.componentInstance.data=e;try{let r=yield n.result;if(r){let o=[...this.storeService.productItems()],a=o.findIndex(l=>l.ID===r.ID);a!==-1?o[a]=r:o.push(r);let s=[...o];this.storeService.onChangeProductItems(s),Uc.production||localStorage.setItem("productItems",JSON.stringify(s))}}catch{}})}ngAfterViewInit(){this.productItems=this.storeService.productItems().map(e=>k(_({},e),{isSelected:!1})),this.printMode.set(localStorage.getItem("PrintMode")==="barcode"?1:2)}onToggleSelected(e){let n=[...this.storeService.productItems()],r=n.findIndex(o=>o.Uuid===e.Uuid);r!==-1?n[r].checked=!0:n.forEach(o=>o.checked=!1),this.toggleState()?this.rowSelectedID.set(e.Uuid):this.rowSelectedID.set("")}onOpenDialogImportProduct(){return j(this,null,function*(){let n=yield this.modalService.open(Mv,{scrollable:!0,centered:!0}).result;console.log("result",n);let r=[...this.storeService.productItems()];n.forEach(o=>{r.push(_({},o))}),this.storeService.onChangeProductItems(r),console.log("result",n)})}onOpenDialogLoadTransaction(){return j(this,null,function*(){let n=yield this.modalService.open(qf,{scrollable:!0,centered:!0}).result,o=`https://${localStorage.getItem("Domain")}`;if(console.log("result",n),n!==void 0)switch(n.role){case"ok":let a={Number:n.data.number,Outlet:n.data.outlet},s=n.data.type===0?"/api/v3/Barcode/ByBillNumber":"/api/v3/Barcode/ByOutletDeliveryNumber";this.httpService.post(s,a,void 0,o).pipe(Ve(l=>l.map(c=>k(_({},c),{Uuid:Qr(),checked:!1}))),Ee(l=>{let c=[...this.storeService.productItems()];l.forEach(d=>{let p=c.findIndex(v=>v.VariantID===d.VariantID);p!==-1?c[p].Quantity+=d.Quantity:c.push(d)}),this.storeService.onChangeProductItems(c)})).subscribe();break}})}onRemoveItem(e){let r=[...this.storeService.productItems()].filter(o=>o.Uuid!==e.Uuid);this.storeService.onChangeProductItems(r)}onActivate(e){return j(this,null,function*(){e.type==="click"&&(yield this.onOpenModalEdit(e.row))})}promotionDiscount(e){try{return Object.keys(e).length?e.Discount&&e.Discount>0?e.UnitPrice-e.UnitPrice*e.Discount/100:e.UnitPrice:0}catch(n){throw new Error("error: "+(n instanceof Error?n.message:String(n)))}}onFinishUpdateHandler(){this.rowSelectedID=null}onClear(){this.storeService.onChangeProductItems([])}get productEdit(){return this.route.snapshot.queryParamMap.has("id")}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["choose-product"]],viewQuery:function(n,r){if(n&1&&ut(bg,5),n&2){let o;Fe(o=Ae())&&(r.verticalSidebar=o.first)}},standalone:!0,features:[fe],decls:58,vars:6,consts:[[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],[1,"btn-group"],["ngbDropdown","","placement","bottom-end",1,"btn-group"],["type","button",1,"btn","btn-outline-secondary","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-solid","fa-upload","fs-3"],[1,"fs-3"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-toggle-split"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1"],["ngbDropdownItem","",1,"dropdown-item","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-regular","fa-file-lines","fs-3"],[1,"fa-solid","fa-trash","fs-3"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click","disabled"],[1,"f","fas","fa-angle-right"],[1,"mx-3","flex-grow-1"],[1,"row"],[1,"col-8"],[1,"container",2,"padding-left","2px","padding-right","0px"],[1,"card","h-100"],[1,"card-body",2,"padding","0.8rem","height","calc(100vh - 100px)"],[1,"table-responsive",2,"max-height","100%","height","100%","overflow-y","auto"],[1,"table"],[2,"position","sticky","top","0","background-color","white","border","1px solid rgba(0, 0, 0, 0.12)","z-index","1"],["scope","col"],["scope","col",2,"width","10%"],["scope","col",1,"text-end",2,"width","10%"],[1,"col-4"],[1,"card"],[1,"card-body",2,"padding","0.8rem"],[3,"productSelectedChange","productSelected"],[1,"d-flex","flex-column","text-end"],[1,"w-100","d-flex","justify-content-end","align-items-center"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-check","fs-5","text-primary"],[1,"fa-solid","fa-pen-to-square","fs-5"],[1,"fas","fa-trash","me-1","text-danger","fs-5"],[1,"text-decoration-line-through","text-danger"],["class","text-dark",4,"ngIf"],[1,"text-dark"]],template:function(n,r){n&1&&(h(0,"div",0)(1,"header",1)(2,"nav",2)(3,"div",3)(4,"div",4)(5,"ul",5)(6,"li",6)(7,"h3",7),b(8,"Choose Product"),m()()(),h(9,"ul",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"button",12),N("click",function(){return r.onOpenDialogImportProduct()}),J(14,"i",13),h(15,"span",14),b(16,"Upload"),m()(),J(17,"button",15),h(18,"div",16)(19,"button",17),N("click",function(){return r.onOpenDialogLoadTransaction()}),J(20,"i",18),h(21,"span",14),b(22,"Load Transaction"),m()(),h(23,"button",17),N("click",function(){return r.onClear()}),J(24,"i",19),h(25,"span",14),b(26,"Clear"),m()()()()(),h(27,"button",20),N("click",function(){return r.onNext()}),h(28,"span",14),b(29,"Next"),m(),J(30,"i",21),m()()()()(),b(31,' " '),m()(),h(32,"div",22)(33,"div",23)(34,"div",24)(35,"div",25)(36,"div",26)(37,"div",27)(38,"div",28)(39,"table",29)(40,"thead",30)(41,"tr")(42,"th",31),b(43,"Name"),m(),h(44,"th",31),b(45,"Code"),m(),h(46,"th",32),b(47,"Qty"),m(),h(48,"th",33),b(49," Price "),m(),J(50,"th",32),m()(),h(51,"tbody"),St(52,hI,18,7,"tr",null,Tn),m()()()()()()(),h(54,"div",34)(55,"div",35)(56,"div",36)(57,"modal-choose-product",37),um("productSelectedChange",function(a){return pm(r.rowSelectedID,a)||(r.rowSelectedID=a),a}),m()()()()()()()),n&2&&(f(),qe("data-navbarbg",r.storeService.options().navbarbg),f(),C("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),f(),C("ngbCollapse",!r.storeService.options().isCollapsed),qe("data-navbarbg",r.storeService.options().navbarbg),f(24),C("disabled",r.storeService.productItems().length<=0),f(25),Pt(r.storeService.productItems()),f(5),dm("productSelected",r.rowSelectedID))},dependencies:[et,On,Mr,Ar,Ls,Sm,Cm,Ns,zs,Br,Ym,Xf,ul],styles:[".dropdown-toggle:after{display:inline-block!important}[_nghost-%COMP%] .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}[_nghost-%COMP%] .ngx-datatable .datatable-body{border:none}[_nghost-%COMP%] .ngx-datatable.material{border:none}[_ngcontent-%COMP%]:hover .ngx-datatable.material .datatable-header{border:1px solid rgba(0,0,0,.12)}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{display:flex;align-items:center;font-size:12px}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell .datatable-body-cell-label{width:100%}[_nghost-%COMP%] .ngx-datatable.material .empty-row{font-size:12px}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12)}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{font-weight:400;font-size:12px;vertical-align:middle}.dropdown-item[_ngcontent-%COMP%]:hover{background-color:#ddd;color:#333}.dropdown-menu.show[_ngcontent-%COMP%]{padding:.5rem 0}"],changeDetection:0})}}return i})();var Ov=(()=>{class i{transform(e,...n){let r=Number(e),o=Number(n[0]);return r*o/100+r}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=gs({name:"taxs",type:i,pure:!0,standalone:!0})}}return i})();var Z_=Ne(Nh());var GM=["barcode"],YM=(i,t)=>t.VariantID,XM=i=>({"h-100":i}),ot=i=>({"font-size.px":i});function KM(i,t){if(i&1&&(h(0,"div",3),J(1,"canvas",11,0),m()),i&2){let e=S(2);f(),C("ngStyle",e.barcodeStyle)}}function QM(i,t){if(i&1&&(h(0,"span",12),b(1),m()),i&2){let e=S(2).$implicit,n=S();C("ngStyle",ze(2,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.Description)}}function ZM(i,t){if(i&1&&(h(0,"span",12),b(1),m()),i&2){let e=S(2).$implicit,n=S();C("ngStyle",ze(2,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.Code)}}function JM(i,t){if(i&1&&H(0,QM,2,4,"span",12)(1,ZM,2,4,"span",12),i&2){let e=S(2);ae(e.storeService.paperConfiguration().DescriptionAsCode?0:1)}}function eO(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.storeService.paperConfiguration().ProductNamePrefix)}}function tO(i,t){if(i&1&&(h(0,"div",5),H(1,eO,2,4,"span",13),h(2,"span",14),b(3),Je(4,"slice"),m()()),i&2){let e=S().$implicit,n=S();f(),C("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),f(),C("ngStyle",ze(7,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(Hc(4,3,e.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function iO(i,t){if(i&1&&(h(0,"span",25),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().PriceFontSize)),f(),P(e.storeService.paperConfiguration().CurrencySymbol)}}function nO(i,t){if(i&1&&(h(0,"span"),b(1),m()),i&2){let e=S(2).$implicit;f(),Ht("/",e.UOMName||"pcs","")}}function rO(i,t){if(i&1&&(h(0,"span",26),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().PriceFontSize)),f(),P(e.storeService.paperConfiguration().CurrencySymbol)}}function oO(i,t){if(i&1&&(h(0,"div",6)(1,"div",15)(2,"div",16),b(3),m(),h(4,"div",17),H(5,iO,2,4,"span",18),h(6,"span",19),b(7),Je(8,"number"),m(),H(9,nO,2,1,"span",20),m()(),h(10,"div",15)(11,"div",21),b(12),m(),h(13,"div",22),H(14,rO,2,4,"span",23),h(15,"span",24),b(16),Je(17,"number"),m()()()()),i&2){let e=S().$implicit,n=S();f(2),C("ngStyle",ze(15,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),Ht(" ",n.storeService.paperConfiguration().BasicPriceLabel," "),f(2),C("ngIf",n.storeService.paperConfiguration().CurrencySymbol),f(),C("ngStyle",ze(17,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),P(pi(8,11,e.UnitPrice)),f(2),C("ngIf",n.storeService.paperConfiguration().UOMNameVisible),f(2),C("ngStyle",ze(19,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),Ht(" ",n.storeService.paperConfiguration().PromotionPriceLabel," "),f(2),C("ngIf",n.storeService.paperConfiguration().CurrencySymbol),f(),C("ngStyle",ze(21,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),P(pi(17,13,n.promotionDiscount(e.Promotions)))}}function aO(i,t){if(i&1&&(h(0,"span",28),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().PriceFontSize)),f(),P(e.storeService.paperConfiguration().CurrencySymbol)}}function sO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S(2).$implicit,n=S();C("ngStyle",ze(2,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),Ht("/",e.UOMName||"pcs","")}}function lO(i,t){if(i&1&&(h(0,"div",7),H(1,aO,2,4,"span",27),h(2,"span",28),b(3),Je(4,"taxs"),Je(5,"number"),m(),H(6,sO,2,4,"span",29),m()),i&2){let e=S().$implicit,n=S();f(),C("ngIf",n.storeService.paperConfiguration().CurrencySymbol),f(),C("ngStyle",ze(9,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),P(pi(5,7,Si(4,4,e.UnitPrice,n.taxRate))),f(3),C("ngIf",n.storeService.paperConfiguration().UOMNameVisible)}}function cO(i,t){if(i&1&&(h(0,"span",28),b(1),m()),i&2){let e=S(5);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().PriceFontSize)),f(),P(e.storeService.paperConfiguration().CurrencySymbol)}}function dO(i,t){if(i&1&&(h(0,"div",9),H(1,cO,2,4,"span",27),h(2,"span",28),b(3),Je(4,"taxs"),Je(5,"number"),m()()),i&2){let e=S().$implicit,n=S(3);f(),C("ngIf",n.storeService.paperConfiguration().CurrencySymbol),f(),C("ngStyle",ze(8,ot,n.storeService.paperConfiguration().PriceFontSize)),f(),P(pi(5,6,Si(4,3,e.Price,n.taxRate)))}}function pO(i,t){if(i&1&&H(0,dO,6,10,"div",9),i&2){let e=t.$implicit,n=S(3);ae(e.Outlet===n.storeService.outlet$().Name?0:-1)}}function uO(i,t){if(i&1&&St(0,pO,1,1,null,null,Tn),i&2){let e=S().$implicit;Pt(e.OutletPrice)}}function hO(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S(3);C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.storeService.paperConfiguration().ProductNamePrefix)}}function mO(i,t){if(i&1&&(h(0,"div",8),H(1,hO,2,4,"span",13),h(2,"span",14),b(3),Je(4,"slice"),m()()),i&2){let e=S().$implicit,n=S();f(),C("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),f(),C("ngStyle",ze(7,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(Hc(4,3,e.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function fO(i,t){if(i&1&&(h(0,"div",31)(1,"span",14),b(2),m()()),i&2){let e=S(3);f(),C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.storeService.paperConfiguration().StoreName)}}function gO(i,t){if(i&1&&(h(0,"div",32)(1,"span",14),b(2),m()()),i&2){let e=S(3);f(),C("ngStyle",ze(2,ot,e.storeService.paperConfiguration().ProductNameFontSize)),f(),P(e.storeService.paperConfiguration().StoreName)}}function bO(i,t){if(i&1&&H(0,fO,3,4,"div",31)(1,gO,3,4,"div",32),i&2){let e=S(2);ae(e.storeService.paperConfiguration().Orientation===0?0:1)}}function vO(i,t){if(i&1&&(h(0,"div",9)(1,"span",14),b(2),Je(3,"date"),m()()),i&2){let e=S().$implicit,n=S();f(),C("ngStyle",ze(5,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),P(Si(3,2,e.ReleasedDate,"dd MMM yyyy"))}}function _O(i,t){if(i&1&&(h(0,"div",9)(1,"span",14),b(2),m()()),i&2){let e=S().$implicit,n=S();f(),C("ngStyle",ze(2,ot,n.storeService.paperConfiguration().ProductNameFontSize)),f(),Ht("",e.PriceDiscount,"% Off")}}function yO(i,t){if(i&1&&(h(0,"span"),b(1),m(),h(2,"span"),b(3,"-"),m(),h(4,"span"),b(5),m(),h(6,"span"),b(7,"-"),m(),h(8,"span"),b(9),Je(10,"number"),m()),i&2){let e=t.$implicit;f(),P(e.Name),f(4),P(e.MinimumQuantity),f(4),P(pi(10,3,e.UnitPrice))}}function wO(i,t){if(i&1&&(h(0,"div",10),St(1,yO,11,5,null,null,Mn),m()),i&2){let e=S().$implicit,n=S();C("ngStyle",ze(1,ot,n.storeService.paperConfiguration().PricebookFontSize)),f(),Pt(e.Pricebook)}}function xO(i,t){if(i&1&&(h(0,"div",2),H(1,KM,3,1,"div",3),h(2,"div",4),H(3,JM,2,1)(4,tO,5,9,"div",5)(5,oO,18,23,"div",6)(6,lO,7,11,"div",7)(7,uO,2,0)(8,mO,5,9,"div",8)(9,bO,2,1)(10,vO,4,7,"div",9)(11,_O,3,4,"div",9)(12,wO,3,3,"div",10),m()()),i&2){let e=t.$implicit,n=S();C("ngStyle",n.stickerStyles),f(),ae(n.storeService.paperConfiguration().BarcodeVisible?1:-1),f(),C("ngClass",ze(13,XM,!n.storeService.paperConfiguration().BarcodeVisible)),f(),ae(n.storeService.paperConfiguration().CodeVisible?3:-1),f(),ae(n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?4:-1),f(),ae(e.Promotions&&n.storeService.paperConfiguration().PriceVisible?5:-1),f(),ae(!e.Promotions&&!n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?6:-1),f(),ae(n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?7:-1),f(),ae(!n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?8:-1),f(),ae(n.storeService.paperConfiguration().StoreName?9:-1),f(),ae(n.storeService.paperConfiguration().ShowReleasedDate?10:-1),f(),ae(n.storeService.paperConfiguration().ShowPriceDiscount?11:-1),f(),ae(n.storeService.paperConfiguration().PricebookVisible?12:-1)}}var J_=(()=>{class i{constructor(){this.items=[],this.previewType="single",this.storeService=O(Re),this.Object=Object,this.cdr=O(It),this.renderer=O(Oo),this.elementsInitialized=!1,this.injector=O(Ye)}get barcodeContainerStyles(){let e=0;switch(this.storeService.paperSource()){case"Continuous - 3 Column":e=3;break;case"Continuous - 2 Column":e=2;break;case"Continuous - 1 Column":e=1;break;case"Tom & Jerry 107":e=3;break;case"Tom & Jerry 108":e=5;break}let n={display:"grid",gridTemplateColumns:`repeat(${e}, ${this.items.length===1?"1fr":this.storeService.paperConfiguration().StickerWidth}px)`,gridAutoRows:`${this.storeService.paperConfiguration().StickerHeight}px`,columnGap:`${this.storeService.paperConfiguration().ColumnSpacing}px`,rowGap:`${this.storeService.paperConfiguration().RowSpacing}px`,margin:`${this.storeService.paperConfiguration().MarginTop}px ${this.storeService.paperConfiguration().MarginLeft}px`,maxHeight:"100%",height:`${this.previewType==="single"?"90px":"100%"}`,width:`${this.previewType==="single"?"250px":this.storeService.paperConfiguration().PaperWidth+"px"}`};return console.log("style",n),n}get stickerStyles(){let e=this.storeService.paperConfiguration().StickerWidth,n=this.storeService.paperConfiguration().StickerHeight,r=this.items.length===1&&this.previewType==="single"?"250px":`${typeof e=="number"?e+"px":e}`,o=`${this.previewType==="single"?"90px":n+"px"}`;return{width:r,height:o,overflow:"hidden"}}get barcodeStyle(){return{width:"100%",height:`${this.previewType==="single"?"25px":this.storeService.paperConfiguration().BarcodeHeight+"px"}`}}get taxRate(){if(this.storeService.paperConfiguration().TaxType){let n=this.storeService.taxs().findIndex(r=>r.ID===this.storeService.paperConfiguration().TaxType.ID);if(n!==-1)return this.storeService.taxs()[n].Rate}return 0}get stickerStoreName(){let e={order:"4",lineHeight:"15px"},n={position:"absolute",right:"0",top:"0",transform:"translate(0%, 20%) rotate(270deg)"};return this.storeService.paperConfiguration().Orientation===0?e:n}ngOnInit(){}ngAfterViewInit(){this.elementsInitialized=!0}ngAfterViewChecked(){this.generateBarcodes(),this.elementsInitialized&&(this.generateBarcodes(),this.elementsInitialized=!1)}generateBarcodes(){this.storeService.expandProductItems().forEach((e,n)=>{let r=this.barcodeRef.get(n)?.nativeElement;r&&(0,Z_.default)(r,e.Code,{format:"CODE128",lineColor:"#000",width:20,displayValue:!1})})}promotionDiscount(e){try{return Object.keys(e).length?e.Discount&&e.Discount>0?e.UnitPrice-e.UnitPrice*e.Discount/100:e.UnitPrice:0}catch(n){throw new Error("error: ",n)}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-barcode-preview"]],viewQuery:function(n,r){if(n&1&&ut(GM,5,Ce),n&2){let o;Fe(o=Ae())&&(r.barcodeRef=o)}},inputs:{items:"items",previewType:"previewType"},standalone:!0,features:[fe],decls:3,vars:1,consts:[["barcode",""],["id","barcode-container",1,"barcode-container",3,"ngStyle"],[1,"sticker","position-relative","border","border-dark","d-flex","flex-column",3,"ngStyle"],[1,"sticker-header","d-flex","justify-content-center","px-1"],[1,"sticker-body","d-flex","flex-column","align-items-center","justify-content-center",3,"ngClass"],[2,"line-height","0.3","width","100%","text-align","center"],[1,"d-flex","flex-column",2,"line-height","1"],[1,"d-flex","align-items-baseline",2,"line-height","1"],[2,"line-height","0","width","100%","text-align","center"],[2,"line-height","1"],[1,"d-flex","gap-1",2,"line-height","1",3,"ngStyle"],["id","barcode",3,"ngStyle"],[1,"text-dark",2,"line-height","1",3,"ngStyle"],["class","text-dark",3,"ngStyle",4,"ngIf"],[1,"text-dark",3,"ngStyle"],[1,"d-flex","gap-2","align-items-center"],[1,"promotion__normalprice_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-1","align-items-baseline"],["class","promotion__normalprice text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__normalprice","text-decoration-line-through","text-danger",3,"ngStyle"],[4,"ngIf"],[1,"promotion__price_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-2"],["class","text-danger promotion__price text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__price","text-danger","text-dark",3,"ngStyle"],[1,"promotion__normalprice","text-dark",3,"ngStyle"],[1,"text-danger","promotion__price","text-dark",3,"ngStyle"],["class","price text-dark",3,"ngStyle",4,"ngIf"],[1,"price","text-dark",3,"ngStyle"],[3,"ngStyle",4,"ngIf"],[3,"ngStyle"],["id","store-name-horizontal",1,"",2,"line-height","1"],["id","store-name-vertical",1,"position-absolute",2,"line-height","1"]],template:function(n,r){n&1&&(h(0,"div",1),St(1,xO,13,15,"div",2,YM),m()),n&2&&(C("ngStyle",r.barcodeContainerStyles),f(),Pt(r.items))},dependencies:[Or,Ov,Mr,Cs,et,On,gm,Ar],styles:["#barcode[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:100%}.storename[_ngcontent-%COMP%]{position:absolute;right:0;top:0;transform:translateY(20%) rotate(270deg)}#store-name-vertical[_ngcontent-%COMP%]{top:50%;right:0;transform:translateY(-50%) rotate(-90deg)}.sticker-body[_ngcontent-%COMP%]{width:100%;display:inline-flex}.sticker-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{line-height:.9!important}"],changeDetection:0})}}return i})();var CO=Ne(Nh(),1);var Ec=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=_e({type:i})}static{this.\u0275inj=ve({})}}return i})();var cs="px",ey=$r({postfix:cs,min:0,thousandSeparator:""}),{plugins:SO}=ey,PO=Sr(ey,["plugins"]),Wt=k(_({},PO),{plugins:[...SO,$m(i=>[0,i.length-cs.length]),Wr("focus",i=>{i.setSelectionRange(0,i.value.length-cs.length)}),Wr("blur",i=>{i.value===cs&&Hr(i,`0${cs}`)})]});function EO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.barcodeHeight)}}function IO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.fontSize)}}function DO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.barcode)}}function kO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.code)}}function TO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.price)}}function MO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.name)}}function OO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.moveProductName)}}function FO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.releaseDate)}}function AO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.discountVisible)}}function RO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.pricebookPrice)}}function BO(i,t){if(i&1&&(h(0,"span",30),b(1),m()),i&2){let e=S();f(),P(e.tooltip.pricebookFontSize)}}var ty=(()=>{class i{constructor(){this.options=Wt,this.barcodeHeight=B(0),this.fontSize=B(0),this.barcode=B(!1),this.code=B(!1),this.price=B(!1),this.name=B(!1),this.moveProductName=B(!1),this.releaseDate=B(!1),this.discountVisible=B(!1),this.pricebookPrice=B(!1),this.pricebookFontSize=B(0),this.UOMVisible=B(!1),this.tooltip={barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)",barcode:"Whether barcode is visible",code:"Whether variant code is visible",price:"Whether variant price is visible",name:"Whether variant name is visible",moveProductName:"Whether move variant name below variant code or below variant price",releaseDate:"Whether release data is visible",discountVisible:"Whether variant's sell price discount is visible",pricebookPrice:"Whether pricebook price is visible",pricebookFontSize:"Change font size for pricebook price",UOMVisible:"Whether UOM is visible"},this.storeService=O(Re),this.injector=O(Ye),this.destroyRef=O(Ct)}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.barcodeHeight.set(e.BarcodeHeight),this.fontSize.set(e.ProductNameFontSize),this.barcode.set(e.BarcodeVisible),this.code.set(e.CodeVisible),this.price.set(e.PriceVisible),this.name.set(e.NameVisible),this.moveProductName.set(e.MoveProductNameOnTop),this.releaseDate.set(e.ShowReleasedDate),this.discountVisible.set(e.ShowPriceDiscount),this.pricebookPrice.set(e.PricebookVisible),this.pricebookFontSize.set(e.PricebookFontSize),this.UOMVisible.set(e.UOMNameVisible)})).subscribe()}onInputHandler(e,n){switch(console.log("value",e),n){case"barcodeHeight":this.barcodeHeight.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"barcode":this.barcode.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{BarcodeVisible:this.barcode()}));break;case"code":this.code.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{CodeVisible:this.code()}));break;case"price":this.price.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PriceVisible:this.price()}));break;case"name":this.name.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{NameVisible:this.name()}));break;case"moveProductName":this.moveProductName.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{MoveProductNameOnTop:this.moveProductName()}));break;case"releaseDate":this.releaseDate.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ShowReleasedDate:this.releaseDate()}));break;case"discountVisible":this.discountVisible.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ShowPriceDiscount:this.discountVisible()}));break;case"pricebookPrice":this.pricebookPrice.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PricebookVisible:this.pricebookPrice()}));break;case"pricebookFontSize":this.pricebookFontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PricebookFontSize:this.pricebookFontSize()}));break;case"UOMVisible":this.UOMVisible.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{UOMNameVisible:this.UOMVisible()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-barcode-view"]],standalone:!0,features:[fe],decls:114,vars:20,consts:[["barcodeHeightTemplate",""],["fontSizeTemplate",""],["barcodeTemplate",""],["codeTemplate",""],["priceTemplate",""],["nameTemplate",""],["moveProductNameTemplate",""],["releaseDateTemplate",""],["discountVisibleTemplate",""],["pricebookPriceTemplate",""],["pricebookFontSizeTemplate",""],[1,"table","table-bordered"],["for","barcode",1,"fs-2"],[1,"form-check","form-switch"],["id","barcode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","code",1,"fs-2"],["id","code","name","code","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","price",1,"fs-2"],["id","price","name","price","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","name",1,"fs-2"],["id","name","name","name","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","moveProductName",1,"fs-2","d-inline-block","text-truncate"],["id","moveProductName","name","moveProductName","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","releaseDate",1,"fs-2"],["id","releaseDate","name","releaseDate","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","discountVisible",1,"fs-2"],["id","discountVisible","name","discountVisible","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","pricebookPrice",1,"fs-2"],["id","pricebookPrice","name","pricebookPrice","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",11)(1,"tbody")(2,"tr")(3,"td")(4,"label",12),b(5,"Barcode"),m()(),h(6,"td")(7,"div",13)(8,"input",14),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"barcode"))}),m()()(),h(9,"td")(10,"span",15),b(11),m()()(),h(12,"tr")(13,"td")(14,"label",16),b(15,"Code"),m()(),h(16,"td")(17,"div",13)(18,"input",17),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"code"))}),m()()(),h(19,"td")(20,"span",15),b(21),m()()(),h(22,"tr")(23,"th")(24,"label",18),b(25,"Price"),m()(),h(26,"td")(27,"div",13)(28,"input",19),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"price"))}),m()()(),h(29,"td")(30,"span",15),b(31),m()()(),h(32,"tr")(33,"td")(34,"label",20),b(35,"Name"),m()(),h(36,"td")(37,"div",13)(38,"input",21),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"name"))}),m()()(),h(39,"td")(40,"span",15),b(41),m()()(),h(42,"tr")(43,"td")(44,"label",22),b(45,"Move Product Name"),m()(),h(46,"td")(47,"div",13)(48,"input",23),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"moveProductName"))}),m()()(),h(49,"td")(50,"span",15),b(51),m()()(),h(52,"tr")(53,"td")(54,"label",24),b(55,"Release Date"),m()(),h(56,"td")(57,"div",13)(58,"input",25),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"releaseDate"))}),m()()(),h(59,"td")(60,"span",15),b(61),m()()(),h(62,"tr")(63,"td")(64,"label",26),b(65,"Discount Visible"),m()(),h(66,"td")(67,"div",13)(68,"input",27),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"discountVisible"))}),m()()(),h(69,"td")(70,"span",15),b(71),m()()(),h(72,"tr")(73,"td")(74,"label",26),b(75,"UOM Visible"),m()(),h(76,"td")(77,"div",13)(78,"input",27),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"UOMVisible"))}),m()()(),h(79,"td")(80,"span",15),b(81),m()()(),h(82,"tr")(83,"td")(84,"label",28),b(85,"Pricebook Price"),m()(),h(86,"td")(87,"div",13)(88,"input",29),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"pricebookPrice"))}),m()()(),h(89,"td")(90,"span",15),b(91),m()()()()(),H(92,EO,2,1,"ng-template",null,0,we)(94,IO,2,1,"ng-template",null,1,we)(96,DO,2,1,"ng-template",null,2,we)(98,kO,2,1,"ng-template",null,3,we)(100,TO,2,1,"ng-template",null,4,we)(102,MO,2,1,"ng-template",null,5,we)(104,OO,2,1,"ng-template",null,6,we)(106,FO,2,1,"ng-template",null,7,we)(108,AO,2,1,"ng-template",null,8,we)(110,RO,2,1,"ng-template",null,9,we)(112,BO,2,1,"ng-template",null,10,we)}n&2&&(f(8),C("checked",r.barcode())("ngModel",r.barcode()),f(3),P(r.tooltip.barcode),f(7),C("checked",r.code())("ngModel",r.code()),f(3),P(r.tooltip.code),f(7),C("ngModel",r.price()),f(3),P(r.tooltip.price),f(7),C("ngModel",r.name()),f(3),P(r.tooltip.name),f(7),C("ngModel",r.moveProductName()),f(3),P(r.tooltip.moveProductName),f(7),C("ngModel",r.releaseDate()),f(3),P(r.tooltip.releaseDate),f(7),C("ngModel",r.discountVisible()),f(3),P(r.tooltip.discountVisible),f(7),C("ngModel",r.UOMVisible()),f(3),P(r.tooltip.UOMVisible),f(7),C("ngModel",r.pricebookPrice()),f(3),P(r.tooltip.pricebookPrice))},dependencies:[gt,Rr,ft,Vt,bt,Js],styles:[".col[_ngcontent-%COMP%]{padding:0!important}.fas[_ngcontent-%COMP%] .fa-info-circle[_ngcontent-%COMP%]{font-size:12px}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function NO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.priceWithTax)}}function zO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.selectedTax)}}function LO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.currency)}}function jO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.fontSize)}}function HO(i,t){if(i&1&&(h(0,"span",16),b(1),m()),i&2){let e=S();f(),P(e.tooltip.outletPrice)}}var iy=(()=>{class i{constructor(){this.options=Wt,this.hasPriceTax=B(!1),this.selectedTax=B(""),this.taxType=B({}),this.currency=B(""),this.fontSize=B(0),this.outletPrice=B(""),this.tooltip={priceWithTax:"Tax is added to the product base price true",selectedTax:"Applied Tax ex: 100 + 10% = 110",currency:"The default currency",fontSize:"Change font size for price",outletPrice:"Price will be set according to the outlet price assigned when selected the outlet"},this.storeService=O(Re),this.destroyRef=O(Ct),this.injector=O(Ye),this.outlets=B([])}get taxs(){return this.storeService.taxs()}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(o=>{this.hasPriceTax.set(o.PriceWithTax),this.selectedTax.set(o.TaxType&&o.TaxType.ID),this.currency.set(o.CurrencySymbol),this.fontSize.set(o.PriceFontSize),this.outletPrice.set(o.OutletID)})).subscribe();let e=this.storeService.paperConfig().Outlets,n=this.storeService.productItems(),r=e.filter(o=>n?n.some(a=>a.OutletPrice?.some(s=>s.Outlet===o.Name)):[]);this.outlets.set(r),Dt(this.storeService.productItems,{injector:this.injector}).pipe(Ee(o=>{let a=o.some(s=>s.Promotions);this.outletPrice.set(a?"":this.outletPrice())})).subscribe(),Dt(this.outletPrice,{injector:this.injector}).pipe(st(o=>!!o),Ee(()=>{let o=[...this.storeService.productItems().map(a=>k(_({},a),{Promotions:null}))];this.storeService.onChangeProductItems(o)})).subscribe()}onInputHandler(e,n){switch(n){case"hasPriceTax":this.hasPriceTax.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PriceWithTax:this.hasPriceTax()}));break;case"selectedTax":let r=this.storeService.taxs().findIndex(o=>o.ID===e);r!==-1&&(this.selectedTax.set(e),this.taxType.set(this.storeService.taxs()[r])),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{TaxType:this.taxType()}));break;case"currency":this.currency.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{CurrencySymbol:this.currency()}));break;case"fontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break;case"outletPrice":if(this.outletPrice.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{OutletID:this.outletPrice()})),this.storeService.paperConfiguration().OutletID){let o=[...this.storeService.productItems().map(a=>k(_({},a),{Promotions:null}))];this.storeService.onChangeProductItems(o)}break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-price"]],standalone:!0,features:[fe],decls:49,vars:11,consts:[["priceWithTaxTemplate",""],["selectedTaxTemplate",""],["currencyTemplate",""],["fontSizeTemplate",""],["outletPriceTemplate",""],[1,"table","table-bordered"],["for","hasPriceTax",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","hasPriceTax","name","hasPriceTax","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","selectedTax",1,"fs-2","d-inline-block","text-truncate"],["id","selectedTax","name","selectedTax","bindLabel","Name","bindValue","ID","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","currency",1,"fs-2","d-inline-block","text-truncate"],["id","currency","name","currency","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","outletPrice",1,"fs-2","d-inline-block","text-truncate"],["id","outletPrice","name","outletPrice","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",5)(1,"tbody")(2,"tr")(3,"td")(4,"label",6),b(5,"Price With Tax"),m()(),h(6,"td")(7,"div",7)(8,"input",8),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"hasPriceTax"))}),m()()(),h(9,"td")(10,"span",9),b(11),m()()(),h(12,"tr")(13,"td")(14,"label",10),b(15,"Selected Tax"),m()(),h(16,"td")(17,"ng-select",11),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"selectedTax"))}),m()(),h(18,"td")(19,"span",9),b(20),m()()(),h(21,"tr")(22,"td")(23,"label",12),b(24,"Currency"),m()(),h(25,"td")(26,"input",13),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"currency"))}),m()(),h(27,"td")(28,"span",9),b(29),m()()(),h(30,"tr")(31,"th")(32,"label",14),b(33,"Outlet Price"),m()(),h(34,"td")(35,"ng-select",15),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"outletPrice"))}),m()(),h(36,"td")(37,"span",9),b(38),m()()()()(),H(39,NO,2,1,"ng-template",null,0,we)(41,zO,2,1,"ng-template",null,1,we)(43,LO,2,1,"ng-template",null,2,we)(45,jO,2,1,"ng-template",null,3,we)(47,HO,2,1,"ng-template",null,4,we)}n&2&&(f(8),C("checked",r.hasPriceTax())("ngModel",r.hasPriceTax()),f(3),P(r.tooltip.priceWithTax),f(6),C("ngModel",r.selectedTax())("items",r.taxs),f(3),P(r.tooltip.selectedTax),f(6),C("ngModel",r.currency()),f(3),P(r.tooltip.currency),f(6),C("ngModel",r.outletPrice())("items",r.outlets()),f(3),P(r.tooltip.outletPrice))},dependencies:[gt,ht,Rr,ft,Vt,bt,Di,qi],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function VO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.maxCharacter)}}function UO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.namePrefix)}}function WO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.storeName)}}function $O(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.orientation)}}function qO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.useDescriptionAsCode)}}function GO(i,t){if(i&1&&(h(0,"span",21),b(1),m()),i&2){let e=S();f(),P(e.tooltip.removeDefault)}}var ny=(()=>{class i{constructor(){this.storeService=O(Re),this.fb=O(Wi),this.destroyRef=O(Ct),this.injector=O(Ye),this.tooltip={maxCharacter:"The max character of the product name",namePrefix:"A word, letter, or number placed before product name",storeName:"The name of the store",orientation:"Horizontal or vertical position store name label",useDescriptionAsCode:"Copy product description into product code",removeDefault:"Remove 'Default' label from product name"},this.maxCharacter=B(0),this.namePrefix=B(""),this.storeName=B(""),this.orientation=B(0),this.useDescriptionAsCode=B(!1),this.removeDefault=B(!1),this.options=Wt}ngOnInit(){this.initForm(),Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.maxCharacter.set(e.ProductNameMaxLength),this.namePrefix.set(e.ProductNamePrefix),this.storeName.set(e.StoreName),this.orientation.set(e.Orientation),this.useDescriptionAsCode.set(e.DescriptionAsCode),this.removeDefault.set(!1)})).subscribe(),this.form.valueChanges.pipe(Rt(this.destroyRef),Ee(e=>{let n=k(_({},this.storeService.paperConfiguration()),{ProductNameMaxLength:e.maxCharacter,ProductNamePrefix:e.namePrefix,StoreName:e.storeName,Orientation:e.orientation,DescriptionAsCode:!!e.useDescriptionAsCode});this.storeService.onChangePaperConfiguration(n);let o=["ProductNameMaxLength","ProductNamePrefix","StoreName","Orientation","DescriptionAsCode"].reduce((a,s)=>(s in this.storeService.paperConfiguration()&&(a[s]=this.storeService.paperConfiguration()[s]),a),{});console.log("filtered advanced",o)})).subscribe()}onInputHandler(e,n){switch(n){case"maxCharacter":this.maxCharacter.set(+e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNameMaxLength:this.maxCharacter()}));break;case"namePrefix":this.namePrefix.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNamePrefix:this.namePrefix()}));break;case"storeName":this.storeName.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{StoreName:this.storeName()}));break;case"orientation":this.orientation.set(+e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{Orientation:this.orientation()}));break;case"useDescriptionAsCode":this.useDescriptionAsCode.set(!!e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{DescriptionAsCode:this.useDescriptionAsCode()}));break;case"removeDefault":this.removeDefault.set(!!e);break}}initForm(){this.form=this.fb.group({maxCharacter:new kt(this.storeService.paperConfiguration().ProductNameMaxLength,[mt.required]),namePrefix:new kt(null,[mt.required]),storeName:new kt(null,[mt.required]),orientation:new kt(null,[mt.required]),useDescriptionAsCode:new kt(null,[mt.required]),removeDefault:new kt("0",[mt.required])}),this.form.patchValue({maxCharacter:this.storeService.paperConfiguration().ProductNameMaxLength,namePrefix:this.storeService.paperConfiguration().ProductNamePrefix,storeName:this.storeService.paperConfiguration().StoreName,orientation:this.storeService.paperConfiguration().Orientation,useDescriptionAsCode:Number(this.storeService.paperConfiguration().DescriptionAsCode).toString()})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-advanced"]],standalone:!0,features:[fe],decls:70,vars:15,consts:[["maxCharacterTemplate",""],["namePrefixTemplate",""],["storeNameTemplate",""],["orientationTemplate",""],["useDescriptionAsCodeTemplate",""],["removeDefaultTemplate",""],[1,"table","table-bordered"],["for","MaxCharacter",1,"fs-2","d-inline-block","text-truncate"],["id","maxCharacter","name","maxCharacter","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fw-medium","fs-2"],["for","namePrefix",1,"fs-2","d-inline-block","text-truncate"],["name","namePrefix","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","storeName",1,"fs-2","d-inline-block","text-truncate"],["id","storeName","name","storeName","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","orientation",1,"fs-2","d-inline-block","text-truncate"],["id","orientation","name","orientation","bindLabel","Value","bindValue","Key","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","useDescriptionAsCode",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","useDescriptionAsCode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","removeDefault",1,"fs-2","d-inline-block","text-truncate"],["id","removeDefault","name","removeDefault","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",6)(1,"tbody")(2,"tr")(3,"td")(4,"label",7),b(5,"Max Character"),m()(),h(6,"td")(7,"input",8),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"maxCharacter"))}),m()(),h(8,"td")(9,"span",9),b(10),m()()(),h(11,"tr")(12,"td")(13,"label",10),b(14,"Name Prefix"),m()(),h(15,"td")(16,"input",11),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"namePrefix"))}),m()(),h(17,"td")(18,"span",9),b(19),m()()(),h(20,"tr")(21,"td")(22,"label",12),b(23,"Store Name"),m()(),h(24,"td")(25,"input",13),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"storeName"))}),m()(),h(26,"td")(27,"span",9),b(28),m()()(),h(29,"tr")(30,"th")(31,"label",14),b(32,"Orientation"),m()(),h(33,"td")(34,"ng-select",15),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"orientation"))}),m()(),h(35,"td")(36,"span",9),b(37),m()()(),h(38,"tr")(39,"td")(40,"label",16),b(41,"Use description as code"),m()(),h(42,"td")(43,"div",17)(44,"input",18),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"useDescriptionAsCode"))}),m()()(),h(45,"td")(46,"span",9),b(47),m()()(),h(48,"tr")(49,"td")(50,"label",19),b(51,'Remove "Default"'),m()(),h(52,"td")(53,"div",17)(54,"input",20),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"removeDefault"))}),m()()(),h(55,"td")(56,"span",9),b(57),m()()()()(),H(58,VO,2,1,"ng-template",null,0,we)(60,UO,2,1,"ng-template",null,1,we)(62,WO,2,1,"ng-template",null,2,we)(64,$O,2,1,"ng-template",null,3,we)(66,qO,2,1,"ng-template",null,4,we)(68,GO,2,1,"ng-template",null,5,we)}n&2&&(f(7),C("ngModel",r.maxCharacter()),f(3),P(r.tooltip.maxCharacter),f(6),C("ngModel",r.namePrefix()),f(3),P(r.tooltip.namePrefix),f(6),C("ngModel",r.storeName()),f(3),P(r.tooltip.storeName),f(6),C("ngModel",r.orientation())("items",r.storeService.paperConfiguration().OrientationChoice),f(3),P(r.tooltip.orientation),f(7),C("checked",r.useDescriptionAsCode())("ngModel",r.useDescriptionAsCode()),f(3),P(r.tooltip.useDescriptionAsCode),f(7),C("checked",r.removeDefault())("ngModel",r.removeDefault()),f(3),P(r.tooltip.removeDefault))},dependencies:[bt,ht,Rr,ft,Di,qi,gt,Vt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var ry=Ne(Lh());var YO=["content"],XO=i=>({$implicit:i});function KO(i,t){if(i&1){let e=Se();h(0,"button",11),N("click",function(){X(e);let r=S();return K(r.onNext())}),h(1,"span",13),b(2,"Next"),m(),J(3,"i",22),m()}}function QO(i,t){if(i&1){let e=Se();h(0,"button",11),N("click",function(){X(e);let r=S();return K(r.onPrintShelfLabel())}),h(1,"span",13),b(2,"Print"),m()()}}function ZO(i,t){i&1&&on(0)}function JO(i,t){i&1&&(h(0,"div",21)(1,"div",23)(2,"div",24)(3,"h4",25),b(4," Sticker Content "),m()(),h(5,"div",26)(6,"div",27)(7,"div",28)(8,"h2",29)(9,"button",30)(10,"span",31),b(11,"Barcode View"),m()()(),h(12,"div",32)(13,"div",33,0),J(15,"app-barcode-view"),m()()(),h(16,"div",28)(17,"h2",29)(18,"button",30)(19,"span",34),b(20,"Price"),m()()(),h(21,"div",32)(22,"div",33,0),J(24,"app-price"),m()()(),h(25,"div",28)(26,"h2",29)(27,"button",30)(28,"span",34),b(29,"Advanced"),m()()(),h(30,"div",32)(31,"div",33,0),J(33,"app-advanced"),m()()()()()()()),i&2&&(f(6),C("closeOthers",!0),f(),C("collapsed",!1),f(9),C("collapsed",!0),f(9),C("collapsed",!0))}function eF(i,t){if(i&1){let e=Se();h(0,"div",21)(1,"div",23)(2,"div",24)(3,"h4",25),b(4," Sticker Content "),m()(),h(5,"div",26)(6,"div",27)(7,"div",28)(8,"h2",29)(9,"button",30)(10,"span",31),b(11,"Price Label"),m()()(),h(12,"div",32)(13,"div",33,0)(15,"table",35)(16,"tbody")(17,"tr")(18,"td")(19,"label",36),b(20,"Price Font Size"),m()(),h(21,"td")(22,"div",37)(23,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("NormalFontSize",r))}),m()()(),h(24,"td")(25,"span",39),b(26),m()()(),h(27,"tr")(28,"td")(29,"label",36),b(30,"Currency Symbol Font Size"),m()(),h(31,"td")(32,"div",37)(33,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("CurrencySymbolFontSize",r))}),m()()(),h(34,"td")(35,"span",39),b(36),m()()(),h(37,"tr")(38,"td")(39,"label",40),b(40,"Original Price Font Size"),m()(),h(41,"td")(42,"div",37)(43,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("PromotionPriceFontSize",r))}),m()()(),h(44,"td")(45,"span",39),b(46),m()()(),h(47,"tr")(48,"td")(49,"label",41),b(50,"Promotion Date Font Size"),m()(),h(51,"td")(52,"div",37)(53,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("PromotionDateFontSize",r))}),m()()(),h(54,"td")(55,"span",39),b(56),m()()(),h(57,"tr")(58,"td")(59,"label",42),b(60,"Promotion Desc Font Size"),m()(),h(61,"td")(62,"div",37)(63,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("PromotionDescFontSize",r))}),m()()(),h(64,"td")(65,"span",39),b(66),m()()(),h(67,"tr")(68,"td")(69,"label",43),b(70,"Product Name Font Size"),m()(),h(71,"td")(72,"div",37)(73,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("ProductNameFontSize",r))}),m()()(),h(74,"td")(75,"span",39),b(76),m()()(),h(77,"tr")(78,"td")(79,"label",44),b(80,"Product Code Font Size"),m()(),h(81,"td")(82,"div",37)(83,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("ProductCodeFontSize",r))}),m()()(),h(84,"td")(85,"span",39),b(86),m()()(),h(87,"tr")(88,"td")(89,"label",45),b(90,"Print Date Font Size"),m()(),h(91,"td")(92,"div",37)(93,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("PrintDateFontSize",r))}),m()()(),h(94,"td")(95,"span",39),b(96),m()()(),h(97,"tr")(98,"td")(99,"label",46),b(100,"Store Name Font Size"),m()(),h(101,"td")(102,"div",37)(103,"input",38),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("StoreNameFontSize",r))}),m()()(),h(104,"td")(105,"span",39),b(106),m()()(),h(107,"tr")(108,"td")(109,"label",47),b(110,"Company Name Label"),m()(),h(111,"td")(112,"div",37)(113,"input",48),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("CompanyNameLabel",r))}),m()()(),h(114,"td")(115,"span",39),b(116),m()()(),h(117,"tr")(118,"td")(119,"label",47),b(120,"Currency Symbol"),m()(),h(121,"td")(122,"div",37)(123,"input",48),N("ngModelChange",function(r){X(e);let o=S();return K(o.onUpdateConfig("CurrencySymbol",r))}),m()()(),h(124,"td")(125,"span",39),b(126),m()()()()()()()()()()()()}if(i&2){let e=S();f(6),C("closeOthers",!0),f(),C("collapsed",!1),f(16),C("ngModel",e.normalPriceFontSize())("maskito",e.options),f(3),P(e.tooltip.normalPriceFontSize),f(7),C("ngModel",e.currencySymbolFontSize())("maskito",e.options),f(3),P(e.tooltip.currencySymbolFontSize),f(7),C("ngModel",e.promotionPriceFontSize())("maskito",e.options),f(3),P(e.tooltip.promotionPriceFontSize),f(7),C("ngModel",e.promotionDateFontSize())("maskito",e.options),f(3),P(e.tooltip.promotionDateFontSize),f(7),C("ngModel",e.promotionDescFontSize())("maskito",e.options),f(3),P(e.tooltip.promotionDescFontSize),f(7),C("ngModel",e.productNameFontSize())("maskito",e.options),f(3),P(e.tooltip.productNameFontSize),f(7),C("ngModel",e.productCodeFontSize())("maskito",e.options),f(3),P(e.tooltip.productCodeFontSize),f(7),C("ngModel",e.printDateFontSize())("maskito",e.options),f(3),P(e.tooltip.printDateFontSize),f(7),C("ngModel",e.storeNameFontSize())("maskito",e.options),f(3),P(e.tooltip.storeNameFontSize),f(7),C("ngModel",e.companyNameLabel()),f(3),P(e.tooltip.companyNameLabel),f(7),C("ngModel",e.currencySymbol()),f(3),P(e.tooltip.currencySymbol)}}var HW=(()=>{class i{constructor(){this.storeService=O(Re),this.httpService=O($i),this.sidebarConfig=Mo("barcode"),this.toastr=O(zr),this.route=O(Ui),this.router=O(Ei),this.step=B(0),this.options=Wt,this.normalPriceFontSize=B(this.storeService.paperShelfLabelConfig().NormalFontSize),this.promotionPriceFontSize=B(this.storeService.paperShelfLabelConfig().PromotionPriceFontSize),this.promotionDateFontSize=B(this.storeService.paperShelfLabelConfig().PromotionDateFontSize),this.promotionDescFontSize=B(this.storeService.paperShelfLabelConfig().PromotionDescFontSize),this.productNameFontSize=B(this.storeService.paperShelfLabelConfig().ProductNameFontSize),this.productCodeFontSize=B(this.storeService.paperShelfLabelConfig().ProductCodeFontSize),this.printDateFontSize=B(this.storeService.paperShelfLabelConfig().PrintDateFontSize),this.storeNameFontSize=B(this.storeService.paperShelfLabelConfig().StoreNameFontSize),this.companyNameLabel=B(this.storeService.paperShelfLabelConfig().CompanyNameLabel),this.currencySymbol=B(this.storeService.paperShelfLabelConfig().CurrencySymbol),this.currencySymbolFontSize=B(this.storeService.paperShelfLabelConfig().CurrencySymbolFontSize),this.tooltip={normalPriceFontSize:"Font size for Unit Price and Promotion Event Price",promotionPriceFontSize:"Font size for Original Price",promotionDateFontSize:"Font size for end date promotion event",promotionDescFontSize:"Font size for promotion label",productNameFontSize:"Font size for product name",productCodeFontSize:"Font size for variant code",printDateFontSize:"Font size for print date label",storeNameFontSize:"Font size for company label name",companyNameLabel:"Label for custom company name",currencySymbol:"Currency Symbol",currencySymbolFontSize:"Font size for currency symbol"}}ngOnInit(){this.route.queryParamMap.pipe(st(e=>e.has("step")),Ve(e=>+e.get("step")),Ee(e=>this.step.set(e))).subscribe()}onUpdateConfig(e,n){let r=n.toString().replace("px",""),o=_({},this.storeService.paperShelfLabelConfig());o[e]=typeof n=="number"?+r:r,this.storeService.onChangeShelfLabelConfig(o)}onPrevious(){this.step.set(this.step()-1),this.router.navigate([],{queryParams:{step:this.step()},queryParamsHandling:"merge",relativeTo:this.route})}onNext(){this.step.set(this.step()+1),this.router.navigate([],{queryParams:{step:this.step()},queryParamsHandling:"merge",relativeTo:this.route})}onSaveConfig(){let e={observe:"response"};console.log("Saving config:",this.storeService.paperShelfLabelConfig());let n=Object.entries(this.storeService.paperShelfLabelConfig()).reduce((o,[a,s])=>(parseInt(s)?o[a]=parseInt(s):o[a]=s,o),{}),r=_({SubDomain:localStorage.getItem("Domain")},n);this.httpService.post("api/ConfigShelf/SaveConfig",r,e).pipe(Lr("response"),Ee(o=>{o instanceof Ss&&o.status===200&&this.toastr.success(o.body.Message,"success")})).subscribe()}pxToPt(e){return e*.75}onPrintShelfLabel(){let e=this.storeService.productItems().some(v=>v.Promotions),{NormalFontSize:n,PromotionPriceFontSize:r,PromotionDateFontSize:o,PromotionDescFontSize:a,ProductNameFontSize:s,ProductCodeFontSize:l,PrintDateFontSize:c,StoreNameFontSize:d,CurrencySymbolFontSize:p}=this.storeService.paperShelfLabelConfig();(0,ry.default)({printable:"print-wrapper",type:"html",scanStyles:!0,font_size:"",targetStyle:["*"],style:`
31
31
  @page {
32
32
  size: 80mm auto;
33
33
  margin: 0;
@@ -178,7 +178,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${t.byteLength}`),t.tiff&&
178
178
  margin: 0;
179
179
 
180
180
  }
181
- `,onLoadingEnd:()=>{this.onSaveConfig()}})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-customize-label"]],contentQueries:function(n,r,o){if(n&1&&Et(o,XO,7),n&2){let a;Fe(a=Ae())&&(r.contentTemplate=a.first)}},inputs:{sidebarConfig:[1,"sidebarConfig"]},standalone:!0,features:[fe],decls:25,vars:10,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-6","d-flex","justify-content-center"],[1,"card","sticky-md-top",2,"height","fit-content"],[1,"card-body","d-flex","justify-content-center","align-items-center"],["id","print-wrapper",1,"print-wrapper"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"col-lg-6","col-md-6"],[1,"f","fas","fa-angle-right"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0","font-robotoslab",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[1,"",2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[2,"font-size","14px"],[1,"table","table-bordered"],["for","hasPriceTax1",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["type","input",1,"form-control","fs-2",3,"ngModelChange","ngModel","maskito"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","hasPriceTax2",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax3",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax4",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax5",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax6",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax7",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax8",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax9",1,"fs-2","d-inline-block","text-truncate"],["type","input",1,"form-control","fs-2",3,"ngModelChange","ngModel"]],template:function(n,r){n&1&&(h(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),b(8,"Customize Label"),m()()(),h(9,"ul",9)(10,"div",10)(11,"button",11),N("click",function(){return r.onPrevious()}),J(12,"i",12),h(13,"span",13),b(14,"Back"),m()(),H(15,QO,4,0,"button",14)(16,ZO,3,0,"button",14),m()()()()()(),h(17,"div",15)(18,"div",16)(19,"div",17)(20,"div",18)(21,"div",19),H(22,JO,1,0,"ng-container",20),m()()()(),H(23,eF,34,4,"div",21)(24,tF,127,33,"div",21),m()()),n&2&&(f(),qe("data-navbarbg",r.storeService.options().navbarbg),f(),C("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),f(),C("ngbCollapse",!r.storeService.options().isCollapsed),qe("data-navbarbg",r.storeService.options().navbarbg),f(12),ae(r.sidebarConfig()==="barcode"?15:16),f(7),C("ngTemplateOutlet",r.contentTemplate)("ngTemplateOutletContext",ze(8,KO,r.sidebarConfig()==="barcode"?r.storeService.expandProductItem():r.storeService.expandProductItems())),f(),ae(r.sidebarConfig()==="barcode"?23:24))},dependencies:[Ts,Os,Ms,Rs,Fs,As,Ec,Br,Mn,ty,iy,ny,et,Fr,gt,ht,ft,Vt,Gi],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 200px)}.print-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%;gap:10px;overflow-y:auto;max-height:calc(100vh - 130px)}"],changeDetection:0})}}return i})();function iF(i,t){if(i&1&&(h(0,"div",2)(1,"span"),b(2),m(),h(3,"span"),b(4),Je(5,"number"),m()(),h(6,"span",2),b(7),Je(8,"date"),m()),i&2){let e=S();C("ngStyle",e.stickerHeaderDesc1Style),f(2),P(e.store.paperShelfLabelConfig().CurrencySymbol),f(2),P(pi(5,5,e.item.UnitPrice)),f(2),C("ngStyle",e.stickerHeaderDesc2Style),f(),Ht("sd ",Si(8,7,e.item.Promotions.ExpirationDate,"dd-MM-yyyy"),"")}}function nF(i,t){if(i&1&&(h(0,"span",2),b(1),m(),h(2,"span",2),b(3),Je(4,"number"),m()),i&2){let e=S();Fo("font-size",e.store.paperShelfLabelConfig().CurrencySymbolFontSize+"px"),C("ngStyle",e.stickerContentHeaderDesc1Style),f(),P(e.store.paperShelfLabelConfig().CurrencySymbol),f(),C("ngStyle",e.stickerContentHeaderDesc2Style),f(),P(pi(4,6,e.promotionDiscount(e.item.Promotions)))}}function rF(i,t){if(i&1&&(h(0,"span",2),b(1),m(),h(2,"span",2),b(3),Je(4,"number"),m()),i&2){let e=S();Fo("font-size",e.store.paperShelfLabelConfig().CurrencySymbolFontSize+"px"),C("ngStyle",e.stickerContentHeaderDesc1Style),f(),P(e.store.paperShelfLabelConfig().CurrencySymbol),f(),C("ngStyle",e.stickerContentHeaderDesc2Style),f(),P(pi(4,6,e.item.UnitPrice))}}function oF(i,t){i&1&&(h(0,"span"),b(1," PROMOSI "),m(),h(2,"span"),b(3," PROMOSI "),m())}var oy=(()=>{class i{constructor(){this.store=O(Re),this.item=null,this.printDate=new Date}get stickerContainerStyles(){return{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",width:"100%",height:"100%"}}get stickerStyle(){return{width:"71mm",overflow:"hidden",border:"1px solid #000",display:"flex",flexDirection:"column"}}get stickerHeaderStyle(){return{padding:"0 4px",display:"flex",justifyContent:"space-between",height:this.item.Promotions?"max-content":"20px"}}get stickerHeaderDesc1Style(){return{display:"flex",textDecoration:"line-through",fontSize:`${this.store.paperShelfLabelConfig().PromotionPriceFontSize}px`,fontWeight:"800"}}get stickerHeaderDesc2Style(){return{fontWeight:"600",fontSize:`${this.store.paperShelfLabelConfig().PromotionDateFontSize}px`}}get stickerContentStyle(){return{padding:"0 4px",display:"flex",flexDirection:"column",flex:"1 1 0"}}get stickerContentHeaderStyle(){return{display:"flex",justifyContent:"space-between",alignItems:"flex-start",lineHeight:".8"}}get stickerContentHeaderDesc1Style(){return{fontWeight:"800"}}get stickerContentHeaderDesc2Style(){return{fontSize:`${this.store.paperShelfLabelConfig().NormalFontSize}px`,margin:"0",padding:"0",fontWeight:"800"}}get stickerContentBodyStyle(){return{display:"flex",flexDirection:"column",justifyContent:"space-between",fontWeight:"600"}}get stickerContentBodyDesc1Style(){return{textAlign:"start",fontSize:`${this.store.paperShelfLabelConfig().ProductNameFontSize}px`}}get stickerContentBodyDesc2Style(){return{textAlign:"start",fontSize:`${this.store.paperShelfLabelConfig().ProductCodeFontSize}px`}}get stickerFooterStyle(){return{display:"flex",flexDirection:"column"}}get stickerFooterHeaderStyle(){return{display:"flex",justifyContent:"end",padding:"0 4px"}}get stickerFooterHeaderDesc1Style(){return{fontWeight:"600",textDecoration:"none",fontSize:`${this.store.paperShelfLabelConfig().PrintDateFontSize}px`}}get stickerFooterBodyStyle(){return{backgroundColor:"#000",color:"#fff",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 6px",fontWeight:"600"}}get stickerFooterBodyDesc1Style(){return{display:"flex",gap:"10px",fontSize:`${this.store.paperShelfLabelConfig().PromotionDescFontSize}px`}}get stickerFooterBodyDesc2Style(){return{fontSize:`${this.store.paperShelfLabelConfig().StoreNameFontSize}px`}}promotionDiscount(e){try{return Object.keys(e).length?e.Discount&&e.Discount>0?e.UnitPrice-e.UnitPrice*e.Discount/100:e.UnitPrice:0}catch(n){throw new Error("error: "+(n instanceof Error?n.message:String(n)))}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-label-preview"]],inputs:{item:"item"},standalone:!0,features:[fe],decls:22,vars:23,consts:[["id","sticker",1,"sticker",3,"ngStyle"],["id","sticker-header",3,"ngStyle"],[3,"ngStyle"]],template:function(n,r){n&1&&(h(0,"div",0)(1,"div",1),H(2,iF,9,10),m(),h(3,"div",2)(4,"div",2),H(5,nF,5,8)(6,rF,5,8),m(),h(7,"div",2)(8,"span",2),b(9),m(),h(10,"span",2),b(11),m()()(),h(12,"div",2)(13,"div",2)(14,"span",2),b(15),Je(16,"date"),m()(),h(17,"div",2)(18,"div",2),H(19,oF,4,0),m(),h(20,"span",2),b(21),m()()()()),n&2&&(C("ngStyle",r.stickerStyle),f(),C("ngStyle",r.stickerHeaderStyle),f(),ae(r.item.Promotions?2:-1),f(),C("ngStyle",r.stickerContentStyle),f(),C("ngStyle",r.stickerContentHeaderStyle),f(),ae(r.item.Promotions?5:6),f(2),C("ngStyle",r.stickerContentBodyStyle),f(),C("ngStyle",r.stickerContentBodyDesc1Style),f(),P(r.item.Name),f(),C("ngStyle",r.stickerContentBodyDesc2Style),f(),P(r.item.Code),f(),C("ngStyle",r.stickerFooterStyle),f(),C("ngStyle",r.stickerFooterHeaderStyle),f(),C("ngStyle",r.stickerFooterHeaderDesc1Style),f(),P(Si(16,20,r.printDate,"dd-MM-yyyy")),f(2),C("ngStyle",r.stickerFooterBodyStyle),f(),C("ngStyle",r.stickerFooterBodyDesc1Style),f(),ae(r.item.Promotions?19:-1),f(),C("ngStyle",r.stickerFooterBodyDesc2Style),f(),P(r.store.paperShelfLabelConfig().CompanyNameLabel))},dependencies:[et,Or,Ar,xs],changeDetection:0})}}return i})();function aF(i,t){if(i&1&&(h(0,"ng-option",3),b(1),m()),i&2){let e=t.$implicit;C("value",e.Name),f(),P(e.Name)}}var ay=(()=>{class i{onInputHandler(e,n){switch(n){case"paperWidth":this.paperWidth.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PaperWidth:this.paperWidth()}));break;case"stickerWidth":this.stickerWidth.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{StickerWidth:this.stickerWidth()}));break;case"stickerHeight":this.stickerHeight.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{StickerHeight:this.stickerHeight()}));break;case"barcodeHeight":this.barcodeHeight.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break}}constructor(){this.options=Wt,this.storeService=O(Re),this.destroyRef=O(Ct),this.injector=O(Ye),this.paperWidth=B(0),this.stickerWidth=B(0),this.stickerHeight=B(0),this.paperSource=B(""),this.barcodeHeight=B(0),this.fontSize=B(0),this.tooltip={paperWidth:"The width of the paper",stickerWidth:"The width of the sticker",stickerHeight:"The height of the sticker",barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)"}}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Ee(e=>{this.paperWidth.set(e.PaperWidth),this.stickerWidth.set(e.StickerWidth),this.stickerHeight.set(e.StickerHeight),this.barcodeHeight.set(e.BarcodeHeight),this.fontSize.set(e.ProductNameFontSize)})).subscribe(),this.paperWidth.set(this.storeService.paperConfiguration().PaperWidth),this.stickerWidth.set(this.storeService.paperConfiguration().StickerWidth),this.stickerHeight.set(this.storeService.paperConfiguration().StickerHeight),this.paperSource.set(this.storeService.paperConfig().PaperFormats[0].Name),this.storeService.paperSource().length==0&&this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[0].Name)}onChangePaperSource(e){let n=this.storeService.paperConfig().PaperFormats.findIndex(r=>r.Name===e);n!==-1&&(this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[n].Name),this.storeService.onChangePaperConfiguration(this.storeService.paperConfig().PaperFormats[n]))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-pp-paper"]],standalone:!0,features:[fe],decls:58,vars:17,consts:[[1,"table","table-bordered"],["for","paperSource",1,"fs-2","d-inline-block","text-truncate"],["searchable","false","clearable","false","id","paperSource","name","paperSource","selecte","",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel"],[3,"value"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","paperWidth",1,"fs-2","d-inline-block","text-truncate"],["id","paperWidth","name","paperWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerWidth",1,"fs-2","d-inline-block","text-truncate"],["name","stickerWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerHeight",1,"fs-2","d-inline-block","text-truncate"],["id","stickerHeight","name","stickerHeight","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","barcode",1,"fs-2"],["id","barcodeHeight","name","barcodeHeight","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"]],template:function(n,r){n&1&&(h(0,"table",0)(1,"tbody")(2,"tr")(3,"td")(4,"label",1),b(5,"Paper Source"),m()(),h(6,"td")(7,"ng-select",2),N("ngModelChange",function(a){return r.onChangePaperSource(a)}),St(8,aF,2,2,"ng-option",3,Tn),m()(),h(10,"td")(11,"span",4),b(12),m()()(),h(13,"tr")(14,"td")(15,"label",5),b(16,"Paper Width"),m()(),h(17,"td")(18,"input",6),N("ngModelChange",function(a){return r.onInputHandler(a,"paperWidth")}),m()(),h(19,"td")(20,"span",4),b(21),m()()(),h(22,"tr")(23,"td")(24,"label",7),b(25,"Sticker Width"),m()(),h(26,"td")(27,"input",8),N("ngModelChange",function(a){return r.onInputHandler(a,"stickerWidth")}),m()(),h(28,"td")(29,"span",4),b(30),m()()(),h(31,"tr")(32,"th")(33,"label",9),b(34,"Sticker Height"),m()(),h(35,"td")(36,"input",10),N("ngModelChange",function(a){return r.onInputHandler(a,"stickerHeight")}),m()(),h(37,"td")(38,"span",4),b(39),m()()(),h(40,"tr")(41,"td")(42,"label",11),b(43,"Barcode Height"),m()(),h(44,"td")(45,"input",12),N("ngModelChange",function(a){return r.onInputHandler(a,"barcodeHeight")}),m()(),h(46,"td")(47,"span",4),b(48),m()()(),h(49,"tr")(50,"td")(51,"label",13),b(52,"Font Size"),m()(),h(53,"td")(54,"input",14),N("ngModelChange",function(a){return r.onInputHandler(a,"fontSize")}),m()(),h(55,"td")(56,"span",4),b(57),m()()()()()),n&2&&(f(7),C("ngModel",r.storeService.paperSource()),f(),Pt(r.storeService.paperConfig().PaperFormats),f(4),P(r.tooltip.paperWidth),f(6),C("maskito",r.options)("ngModel",r.paperWidth()),f(3),P(r.tooltip.paperWidth),f(6),C("maskito",r.options)("ngModel",r.stickerWidth()),f(3),P(r.tooltip.stickerWidth),f(6),C("maskito",r.options)("ngModel",r.stickerHeight()),f(3),P(r.tooltip.stickerHeight),f(6),C("maskito",r.options)("ngModel",r.barcodeHeight()),f(3),P(r.tooltip.barcodeHeight),f(6),C("maskito",r.options)("ngModel",r.fontSize()),f(3),P(r.tooltip.fontSize))},dependencies:[gt,ht,ft,Vt,bt,Di,qi,Hs,Gi],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function sF(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S();f(),P(e.tooltip.leftIndent)}}function lF(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S();f(),P(e.tooltip.topIndent)}}function cF(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S();f(),P(e.tooltip.rowSpacing)}}function dF(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S();f(),P(e.tooltip.columnSpacing)}}var sy=(()=>{class i{constructor(){this.options=Wt,this.tooltip={leftIndent:"The number of pixels appended before the first COLUMN",topIndent:"The number of pixels appended after the first ROW",rowSpacing:"The number of pixels between each ROW",columnSpacing:"The number of pixels between each COLUMN"},this.leftIndent=B(0),this.topIndent=B(0),this.rowSpacing=B(0),this.columnSpacing=B(0),this.storeService=O(Re),this.destroyRef=O(Ct),this.injector=O(Ye)}onInputHandler(e,n){switch(n){case"marginLeft":this.leftIndent.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{MarginLeft:this.leftIndent()}));break;case"marginTop":this.topIndent.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{MarginTop:this.topIndent()}));break;case"rowSpacing":this.rowSpacing.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{RowSpacing:this.rowSpacing()}));break;case"columnSpacing":this.columnSpacing.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ColumnSpacing:this.columnSpacing()}));break}}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.leftIndent.set(e.MarginLeft),this.topIndent.set(e.MarginTop),this.rowSpacing.set(e.RowSpacing),this.columnSpacing.set(e.ColumnSpacing)})).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-pp-spacing"]],standalone:!0,features:[fe],decls:46,vars:12,consts:[["leftIndentTemplate",""],["topIndentTemplate",""],["rowSpacingTemplate",""],["columnSpacingTemplate",""],[1,"table","table-bordered"],["for","leftIndent",1,"fs-2","d-inline-block","text-truncate"],["id","leftIndent","name","leftIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","topIndent",1,"fs-2","d-inline-block","text-truncate"],["id","topIndent","name","topIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","rowSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","rowSpacing","name","rowSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","columnSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","columnSpacing","name","columnSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",4)(1,"tbody")(2,"tr")(3,"td")(4,"label",5),b(5,"Left Indent"),m()(),h(6,"td")(7,"input",6),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"marginLeft"))}),m()(),h(8,"td")(9,"span",7),b(10),m()()(),h(11,"tr")(12,"td")(13,"label",8),b(14,"Top Indent"),m()(),h(15,"td")(16,"input",9),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"marginTop"))}),m()(),h(17,"td")(18,"span",7),b(19),m()()(),h(20,"tr")(21,"td")(22,"label",10),b(23,"Row Spacing"),m()(),h(24,"td")(25,"input",11),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"rowSpacing"))}),m()(),h(26,"td")(27,"span",7),b(28),m()()(),h(29,"tr")(30,"th")(31,"label",12),b(32,"Column Spacing"),m()(),h(33,"td")(34,"input",13),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"columnSpacing"))}),m()(),h(35,"td")(36,"span",7),b(37),m()()()()(),H(38,sF,2,1,"ng-template",null,0,we)(40,lF,2,1,"ng-template",null,1,we)(42,cF,2,1,"ng-template",null,2,we)(44,dF,2,1,"ng-template",null,3,we)}n&2&&(f(7),C("maskito",r.options)("ngModel",r.leftIndent()),f(3),P(r.tooltip.leftIndent),f(6),C("maskito",r.options)("ngModel",r.topIndent()),f(3),P(r.tooltip.topIndent),f(6),C("maskito",r.options)("ngModel",r.rowSpacing()),f(3),P(r.tooltip.rowSpacing),f(6),C("maskito",r.options)("ngModel",r.columnSpacing()),f(3),P(r.tooltip.columnSpacing))},dependencies:[gt,ht,ft,Vt,bt,Gi,Di],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function pF(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S();f(),P(e.tooltip.basicPriceLabel)}}function uF(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S();f(),P(e.tooltip.promotionPriceLabel)}}var ly=(()=>{class i{constructor(){this.tooltip={basicPriceLabel:"Custom label normal price",promotionPriceLabel:"Custom label promotion price"},this.storeService=O(Re),this.destroyRef=O(Ct),this.injector=O(Ye),this.basicPriceLabel=B(""),this.promotionPriceLabel=B(""),this.options=Wt}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.basicPriceLabel.set(e.BasicPriceLabel),this.promotionPriceLabel.set(e.PromotionPriceLabel)})).subscribe()}onInputHandler(e,n){switch(n){case"basicPriceLabel":this.basicPriceLabel.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{BasicPriceLabel:this.basicPriceLabel()}));break;case"promotionPriceLabel":this.promotionPriceLabel.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PromotionPriceLabel:this.promotionPriceLabel()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-pp-label"]],standalone:!0,features:[fe],decls:24,vars:4,consts:[["basicPriceLabelTemplate",""],["promotionPriceLabelTemplate",""],[1,"table","table-bordered"],["for","normalPrice",1,"fs-2","d-inline-block","text-truncate"],["id","normalPrice","name","basicPriceLabel","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","promotionPrice",1,"fs-2","d-inline-block","text-truncate"],["id","promotionPrice","name","promotionPriceLabel","type","text",1,"form-control","fs-1",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"label",3),b(5,"Normal Price"),m()(),h(6,"td")(7,"input",4),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"basicPriceLabel"))}),m()(),h(8,"td")(9,"span",5),b(10),m()()(),h(11,"tr")(12,"td")(13,"label",6),b(14,"Promotion Price"),m()(),h(15,"td")(16,"input",7),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"promotionPriceLabel"))}),m()(),h(17,"td")(18,"span",5),b(19),m()()()()(),H(20,pF,2,1,"ng-template",null,0,we)(22,uF,2,1,"ng-template",null,1,we)}n&2&&(f(7),C("ngModel",r.basicPriceLabel()),f(3),P(r.tooltip.basicPriceLabel),f(6),C("ngModel",r.promotionPriceLabel()),f(3),P(r.tooltip.promotionPriceLabel))},dependencies:[gt,ht,ft,Vt,bt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var jh=Ne(Lh());function hF(i,t){if(i&1){let e=Se();h(0,"tr")(1,"td")(2,"label",6),b(3,"Pricebook Font Size"),m()(),h(4,"td")(5,"input",7),N("ngModelChange",function(r){X(e);let o=S();return K(o.onInputHandler(r,"pricebookFontSize"))}),m()(),h(6,"td")(7,"span",5),b(8),m()()()}if(i&2){let e=S();f(5),C("maskito",e.options)("ngModel",e.pricebookFontSize()),f(3),P(e.tooltip.pricebookFontSize)}}function mF(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S();f(),P(e.tooltip.pricebookFontSize)}}function fF(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S();f(),P(e.tooltip.fontSize)}}var cy=(()=>{class i{constructor(){this.options=Wt,this.barcodeHeight=B(0),this.fontSize=B(0),this.barcode=B(!1),this.code=B(!1),this.price=B(!1),this.name=B(!1),this.moveProductName=B(!1),this.releaseDate=B(!1),this.discountVisible=B(!1),this.pricebookPrice=B(!1),this.pricebookFontSize=B(0),this.tooltip={fontSize:"Change font size for price",pricebookFontSize:"Change font size for pricebook price"},this.storeService=O(Re),this.injector=O(Ye),this.destroyRef=O(Ct)}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.pricebookFontSize.set(e.PricebookFontSize),this.fontSize.set(e.PriceFontSize)})).subscribe()}onInputHandler(e,n){switch(console.log("value",e),n){case"pricebookFontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"fontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-price-fontsize"]],standalone:!0,features:[fe],decls:16,vars:4,consts:[["pricebookFontSizeTemplate",""],["fontSizeTemplate",""],[1,"table","table-bordered"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","pricebookFontSize",1,"fs-2","d-inline-block","text-truncate"],["id","pricebookFontSize","name","pricebookFontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",2)(1,"tbody"),H(2,hF,9,3,"tr"),h(3,"tr")(4,"td")(5,"label",3),b(6,"Font Size"),m()(),h(7,"td")(8,"input",4),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"fontSize"))}),m()(),h(9,"td")(10,"span",5),b(11),m()()()()(),H(12,mF,2,1,"ng-template",null,0,we)(14,fF,2,1,"ng-template",null,1,we)}n&2&&(f(2),ae(r.storeService.paperConfiguration().PricebookVisible?2:-1),f(6),C("maskito",r.options)("ngModel",r.fontSize()),f(3),P(r.tooltip.fontSize))},dependencies:[Gi,et,gt,ht,ft,Vt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"]})}}return i})();function gF(i,t){i&1&&(h(0,"button",14)(1,"span",13),b(2,"Next"),m(),J(3,"i",33),m())}function bF(i,t){if(i&1){let e=Se();h(0,"button",34),N("click",function(){X(e);let r=S();return K(r.printBarcodePreview())}),h(1,"span",13),b(2,"Print"),m()()}}function vF(i,t){if(i&1&&(h(0,"div",20),J(1,"app-barcode-preview",35),m()),i&2){let e=S();f(),C("items",e.storeService.expandProductItems())}}function _F(i,t){if(i&1&&J(0,"app-label-preview",36),i&2){let e=t.$implicit;C("item",e)}}function yF(i,t){if(i&1&&(h(0,"div",21),St(1,_F,1,1,"app-label-preview",36,kr),m()),i&2){let e=S();C("ngStyle",e.stickerContainerStyles),f(),Pt(e.storeService.expandProductItems())}}var mq=(()=>{class i{constructor(){this.storeService=O(Re),this.httpService=O($i),this.toastr=O(zr),this.destroyRef=O(Ct),this.route=O(Ui),this.router=O(Ei),this.step=B(0)}get stickerContainerStyles(){return{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${this.storeService.paperConfiguration().StickerWidth}px, 1fr))`,gridTemplateRows:"auto",gap:`${this.storeService.paperConfiguration().RowSpacing}px ${this.storeService.paperConfiguration().ColumnSpacing}px`,width:`${this.storeService.paperConfiguration().PaperWidth}px`,border:"1px dashed #000",alignItems:"self-start",overflowY:"auto"}}ngOnInit(){this.route.queryParamMap.pipe(st(e=>e.has("step")),Ve(e=>+e.get("step")),Ee(e=>this.step.set(e))).subscribe()}get printMode(){return localStorage.getItem("printMode")||"barcode"}onPrevious(){this.step.set(this.step()-1),this.router.navigate([],{queryParams:{step:this.step()},queryParamsHandling:"merge",relativeTo:this.route})}printPriceLabelPreview(){let e=this.storeService.paperConfiguration().StickerWidth,n=this.storeService.paperConfiguration().StickerHeight,r=this.storeService.paperConfiguration().RowSpacing,o=this.storeService.paperConfiguration().ColumnSpacing;(0,jh.default)({printable:"priceLabel-container",type:"html",style:`
181
+ `,onLoadingEnd:()=>{this.onSaveConfig()}})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-customize-label"]],contentQueries:function(n,r,o){if(n&1&&Et(o,YO,7),n&2){let a;Fe(a=Ae())&&(r.contentTemplate=a.first)}},inputs:{sidebarConfig:[1,"sidebarConfig"]},standalone:!0,features:[fe],decls:25,vars:10,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-6","d-flex","justify-content-center"],[1,"card","sticky-md-top",2,"height","fit-content"],[1,"card-body","d-flex","justify-content-center","align-items-center"],["id","print-wrapper",1,"print-wrapper"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"col-lg-6","col-md-6"],[1,"f","fas","fa-angle-right"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0","font-robotoslab",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[1,"",2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[2,"font-size","14px"],[1,"table","table-bordered"],["for","hasPriceTax1",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["type","input",1,"form-control","fs-2",3,"ngModelChange","ngModel","maskito"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","hasPriceTax2",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax3",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax4",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax5",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax6",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax7",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax8",1,"fs-2","d-inline-block","text-truncate"],["for","hasPriceTax9",1,"fs-2","d-inline-block","text-truncate"],["type","input",1,"form-control","fs-2",3,"ngModelChange","ngModel"]],template:function(n,r){n&1&&(h(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),b(8,"Customize Label"),m()()(),h(9,"ul",9)(10,"div",10)(11,"button",11),N("click",function(){return r.onPrevious()}),J(12,"i",12),h(13,"span",13),b(14,"Back"),m()(),H(15,KO,4,0,"button",14)(16,QO,3,0,"button",14),m()()()()()(),h(17,"div",15)(18,"div",16)(19,"div",17)(20,"div",18)(21,"div",19),H(22,ZO,1,0,"ng-container",20),m()()()(),H(23,JO,34,4,"div",21)(24,eF,127,33,"div",21),m()()),n&2&&(f(),qe("data-navbarbg",r.storeService.options().navbarbg),f(),C("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),f(),C("ngbCollapse",!r.storeService.options().isCollapsed),qe("data-navbarbg",r.storeService.options().navbarbg),f(12),ae(r.sidebarConfig()==="barcode"?15:16),f(7),C("ngTemplateOutlet",r.contentTemplate)("ngTemplateOutletContext",ze(8,XO,r.sidebarConfig()==="barcode"?r.storeService.expandProductItem():r.storeService.expandProductItems())),f(),ae(r.sidebarConfig()==="barcode"?23:24))},dependencies:[Ms,Fs,Os,Bs,As,Rs,Ec,Br,On,ty,iy,ny,et,Fr,gt,ht,ft,Vt,Gi],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 200px)}.print-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;height:100%;gap:10px;overflow-y:auto;max-height:calc(100vh - 130px)}"],changeDetection:0})}}return i})();function tF(i,t){if(i&1&&(h(0,"div",2)(1,"span"),b(2),m(),h(3,"span"),b(4),Je(5,"number"),m()(),h(6,"span",2),b(7),Je(8,"date"),m()),i&2){let e=S();C("ngStyle",e.stickerHeaderDesc1Style),f(2),P(e.store.paperShelfLabelConfig().CurrencySymbol),f(2),P(pi(5,5,e.item.UnitPrice)),f(2),C("ngStyle",e.stickerHeaderDesc2Style),f(),Ht("sd ",Si(8,7,e.item.Promotions.ExpirationDate,"dd-MM-yyyy"),"")}}function iF(i,t){if(i&1&&(h(0,"span",2),b(1),m(),h(2,"span",2),b(3),Je(4,"number"),m()),i&2){let e=S();Ao("font-size",e.store.paperShelfLabelConfig().CurrencySymbolFontSize+"px"),C("ngStyle",e.stickerContentHeaderDesc1Style),f(),P(e.store.paperShelfLabelConfig().CurrencySymbol),f(),C("ngStyle",e.stickerContentHeaderDesc2Style),f(),P(pi(4,6,e.promotionDiscount(e.item.Promotions)))}}function nF(i,t){if(i&1&&(h(0,"span",2),b(1),m(),h(2,"span",2),b(3),Je(4,"number"),m()),i&2){let e=S();Ao("font-size",e.store.paperShelfLabelConfig().CurrencySymbolFontSize+"px"),C("ngStyle",e.stickerContentHeaderDesc1Style),f(),P(e.store.paperShelfLabelConfig().CurrencySymbol),f(),C("ngStyle",e.stickerContentHeaderDesc2Style),f(),P(pi(4,6,e.item.UnitPrice))}}function rF(i,t){i&1&&(h(0,"span"),b(1," PROMOSI "),m(),h(2,"span"),b(3," PROMOSI "),m())}var oy=(()=>{class i{constructor(){this.store=O(Re),this.item=null,this.printDate=new Date}get stickerContainerStyles(){return{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",width:"100%",height:"100%"}}get stickerStyle(){return{width:"71mm",overflow:"hidden",border:"1px solid #000",display:"flex",flexDirection:"column"}}get stickerHeaderStyle(){return{padding:"0 4px",display:"flex",justifyContent:"space-between",height:this.item.Promotions?"max-content":"20px"}}get stickerHeaderDesc1Style(){return{display:"flex",textDecoration:"line-through",fontSize:`${this.store.paperShelfLabelConfig().PromotionPriceFontSize}px`,fontWeight:"800"}}get stickerHeaderDesc2Style(){return{fontWeight:"600",fontSize:`${this.store.paperShelfLabelConfig().PromotionDateFontSize}px`}}get stickerContentStyle(){return{padding:"0 4px",display:"flex",flexDirection:"column",flex:"1 1 0"}}get stickerContentHeaderStyle(){return{display:"flex",justifyContent:"space-between",alignItems:"flex-start",lineHeight:".8"}}get stickerContentHeaderDesc1Style(){return{fontWeight:"800"}}get stickerContentHeaderDesc2Style(){return{fontSize:`${this.store.paperShelfLabelConfig().NormalFontSize}px`,margin:"0",padding:"0",fontWeight:"800"}}get stickerContentBodyStyle(){return{display:"flex",flexDirection:"column",justifyContent:"space-between",fontWeight:"600"}}get stickerContentBodyDesc1Style(){return{textAlign:"start",fontSize:`${this.store.paperShelfLabelConfig().ProductNameFontSize}px`}}get stickerContentBodyDesc2Style(){return{textAlign:"start",fontSize:`${this.store.paperShelfLabelConfig().ProductCodeFontSize}px`}}get stickerFooterStyle(){return{display:"flex",flexDirection:"column"}}get stickerFooterHeaderStyle(){return{display:"flex",justifyContent:"end",padding:"0 4px"}}get stickerFooterHeaderDesc1Style(){return{fontWeight:"600",textDecoration:"none",fontSize:`${this.store.paperShelfLabelConfig().PrintDateFontSize}px`}}get stickerFooterBodyStyle(){return{backgroundColor:"#000",color:"#fff",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"2px 6px",fontWeight:"600"}}get stickerFooterBodyDesc1Style(){return{display:"flex",gap:"10px",fontSize:`${this.store.paperShelfLabelConfig().PromotionDescFontSize}px`}}get stickerFooterBodyDesc2Style(){return{fontSize:`${this.store.paperShelfLabelConfig().StoreNameFontSize}px`}}promotionDiscount(e){try{return Object.keys(e).length?e.Discount&&e.Discount>0?e.UnitPrice-e.UnitPrice*e.Discount/100:e.UnitPrice:0}catch(n){throw new Error("error: "+(n instanceof Error?n.message:String(n)))}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-label-preview"]],inputs:{item:"item"},standalone:!0,features:[fe],decls:22,vars:23,consts:[["id","sticker",1,"sticker",3,"ngStyle"],["id","sticker-header",3,"ngStyle"],[3,"ngStyle"]],template:function(n,r){n&1&&(h(0,"div",0)(1,"div",1),H(2,tF,9,10),m(),h(3,"div",2)(4,"div",2),H(5,iF,5,8)(6,nF,5,8),m(),h(7,"div",2)(8,"span",2),b(9),m(),h(10,"span",2),b(11),m()()(),h(12,"div",2)(13,"div",2)(14,"span",2),b(15),Je(16,"date"),m()(),h(17,"div",2)(18,"div",2),H(19,rF,4,0),m(),h(20,"span",2),b(21),m()()()()),n&2&&(C("ngStyle",r.stickerStyle),f(),C("ngStyle",r.stickerHeaderStyle),f(),ae(r.item.Promotions?2:-1),f(),C("ngStyle",r.stickerContentStyle),f(),C("ngStyle",r.stickerContentHeaderStyle),f(),ae(r.item.Promotions?5:6),f(2),C("ngStyle",r.stickerContentBodyStyle),f(),C("ngStyle",r.stickerContentBodyDesc1Style),f(),P(r.item.Name),f(),C("ngStyle",r.stickerContentBodyDesc2Style),f(),P(r.item.Code),f(),C("ngStyle",r.stickerFooterStyle),f(),C("ngStyle",r.stickerFooterHeaderStyle),f(),C("ngStyle",r.stickerFooterHeaderDesc1Style),f(),P(Si(16,20,r.printDate,"dd-MM-yyyy")),f(2),C("ngStyle",r.stickerFooterBodyStyle),f(),C("ngStyle",r.stickerFooterBodyDesc1Style),f(),ae(r.item.Promotions?19:-1),f(),C("ngStyle",r.stickerFooterBodyDesc2Style),f(),P(r.store.paperShelfLabelConfig().CompanyNameLabel))},dependencies:[et,Or,Ar,Cs],changeDetection:0})}}return i})();function oF(i,t){if(i&1&&(h(0,"ng-option",3),b(1),m()),i&2){let e=t.$implicit;C("value",e.Name),f(),P(e.Name)}}var ay=(()=>{class i{onInputHandler(e,n){switch(n){case"paperWidth":this.paperWidth.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PaperWidth:this.paperWidth()}));break;case"stickerWidth":this.stickerWidth.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{StickerWidth:this.stickerWidth()}));break;case"stickerHeight":this.stickerHeight.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{StickerHeight:this.stickerHeight()}));break;case"barcodeHeight":this.barcodeHeight.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break}}constructor(){this.options=Wt,this.storeService=O(Re),this.destroyRef=O(Ct),this.injector=O(Ye),this.paperWidth=B(0),this.stickerWidth=B(0),this.stickerHeight=B(0),this.paperSource=B(""),this.barcodeHeight=B(0),this.fontSize=B(0),this.tooltip={paperWidth:"The width of the paper",stickerWidth:"The width of the sticker",stickerHeight:"The height of the sticker",barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)"}}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Ee(e=>{this.paperWidth.set(e.PaperWidth),this.stickerWidth.set(e.StickerWidth),this.stickerHeight.set(e.StickerHeight),this.barcodeHeight.set(e.BarcodeHeight),this.fontSize.set(e.ProductNameFontSize)})).subscribe(),this.paperWidth.set(this.storeService.paperConfiguration().PaperWidth),this.stickerWidth.set(this.storeService.paperConfiguration().StickerWidth),this.stickerHeight.set(this.storeService.paperConfiguration().StickerHeight),this.paperSource.set(this.storeService.paperConfig().PaperFormats[0].Name),this.storeService.paperSource().length==0&&this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[0].Name)}onChangePaperSource(e){let n=this.storeService.paperConfig().PaperFormats.findIndex(r=>r.Name===e);n!==-1&&(this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[n].Name),this.storeService.onChangePaperConfiguration(this.storeService.paperConfig().PaperFormats[n]))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-pp-paper"]],standalone:!0,features:[fe],decls:58,vars:17,consts:[[1,"table","table-bordered"],["for","paperSource",1,"fs-2","d-inline-block","text-truncate"],["searchable","false","clearable","false","id","paperSource","name","paperSource","selecte","",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel"],[3,"value"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","paperWidth",1,"fs-2","d-inline-block","text-truncate"],["id","paperWidth","name","paperWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerWidth",1,"fs-2","d-inline-block","text-truncate"],["name","stickerWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerHeight",1,"fs-2","d-inline-block","text-truncate"],["id","stickerHeight","name","stickerHeight","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","barcode",1,"fs-2"],["id","barcodeHeight","name","barcodeHeight","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"]],template:function(n,r){n&1&&(h(0,"table",0)(1,"tbody")(2,"tr")(3,"td")(4,"label",1),b(5,"Paper Source"),m()(),h(6,"td")(7,"ng-select",2),N("ngModelChange",function(a){return r.onChangePaperSource(a)}),St(8,oF,2,2,"ng-option",3,Mn),m()(),h(10,"td")(11,"span",4),b(12),m()()(),h(13,"tr")(14,"td")(15,"label",5),b(16,"Paper Width"),m()(),h(17,"td")(18,"input",6),N("ngModelChange",function(a){return r.onInputHandler(a,"paperWidth")}),m()(),h(19,"td")(20,"span",4),b(21),m()()(),h(22,"tr")(23,"td")(24,"label",7),b(25,"Sticker Width"),m()(),h(26,"td")(27,"input",8),N("ngModelChange",function(a){return r.onInputHandler(a,"stickerWidth")}),m()(),h(28,"td")(29,"span",4),b(30),m()()(),h(31,"tr")(32,"th")(33,"label",9),b(34,"Sticker Height"),m()(),h(35,"td")(36,"input",10),N("ngModelChange",function(a){return r.onInputHandler(a,"stickerHeight")}),m()(),h(37,"td")(38,"span",4),b(39),m()()(),h(40,"tr")(41,"td")(42,"label",11),b(43,"Barcode Height"),m()(),h(44,"td")(45,"input",12),N("ngModelChange",function(a){return r.onInputHandler(a,"barcodeHeight")}),m()(),h(46,"td")(47,"span",4),b(48),m()()(),h(49,"tr")(50,"td")(51,"label",13),b(52,"Font Size"),m()(),h(53,"td")(54,"input",14),N("ngModelChange",function(a){return r.onInputHandler(a,"fontSize")}),m()(),h(55,"td")(56,"span",4),b(57),m()()()()()),n&2&&(f(7),C("ngModel",r.storeService.paperSource()),f(),Pt(r.storeService.paperConfig().PaperFormats),f(4),P(r.tooltip.paperWidth),f(6),C("maskito",r.options)("ngModel",r.paperWidth()),f(3),P(r.tooltip.paperWidth),f(6),C("maskito",r.options)("ngModel",r.stickerWidth()),f(3),P(r.tooltip.stickerWidth),f(6),C("maskito",r.options)("ngModel",r.stickerHeight()),f(3),P(r.tooltip.stickerHeight),f(6),C("maskito",r.options)("ngModel",r.barcodeHeight()),f(3),P(r.tooltip.barcodeHeight),f(6),C("maskito",r.options)("ngModel",r.fontSize()),f(3),P(r.tooltip.fontSize))},dependencies:[gt,ht,ft,Vt,bt,Di,qi,Vs,Gi],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function aF(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S();f(),P(e.tooltip.leftIndent)}}function sF(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S();f(),P(e.tooltip.topIndent)}}function lF(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S();f(),P(e.tooltip.rowSpacing)}}function cF(i,t){if(i&1&&(h(0,"span",14),b(1),m()),i&2){let e=S();f(),P(e.tooltip.columnSpacing)}}var sy=(()=>{class i{constructor(){this.options=Wt,this.tooltip={leftIndent:"The number of pixels appended before the first COLUMN",topIndent:"The number of pixels appended after the first ROW",rowSpacing:"The number of pixels between each ROW",columnSpacing:"The number of pixels between each COLUMN"},this.leftIndent=B(0),this.topIndent=B(0),this.rowSpacing=B(0),this.columnSpacing=B(0),this.storeService=O(Re),this.destroyRef=O(Ct),this.injector=O(Ye)}onInputHandler(e,n){switch(n){case"marginLeft":this.leftIndent.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{MarginLeft:this.leftIndent()}));break;case"marginTop":this.topIndent.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{MarginTop:this.topIndent()}));break;case"rowSpacing":this.rowSpacing.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{RowSpacing:this.rowSpacing()}));break;case"columnSpacing":this.columnSpacing.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ColumnSpacing:this.columnSpacing()}));break}}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.leftIndent.set(e.MarginLeft),this.topIndent.set(e.MarginTop),this.rowSpacing.set(e.RowSpacing),this.columnSpacing.set(e.ColumnSpacing)})).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-pp-spacing"]],standalone:!0,features:[fe],decls:46,vars:12,consts:[["leftIndentTemplate",""],["topIndentTemplate",""],["rowSpacingTemplate",""],["columnSpacingTemplate",""],[1,"table","table-bordered"],["for","leftIndent",1,"fs-2","d-inline-block","text-truncate"],["id","leftIndent","name","leftIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","topIndent",1,"fs-2","d-inline-block","text-truncate"],["id","topIndent","name","topIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","rowSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","rowSpacing","name","rowSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","columnSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","columnSpacing","name","columnSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",4)(1,"tbody")(2,"tr")(3,"td")(4,"label",5),b(5,"Left Indent"),m()(),h(6,"td")(7,"input",6),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"marginLeft"))}),m()(),h(8,"td")(9,"span",7),b(10),m()()(),h(11,"tr")(12,"td")(13,"label",8),b(14,"Top Indent"),m()(),h(15,"td")(16,"input",9),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"marginTop"))}),m()(),h(17,"td")(18,"span",7),b(19),m()()(),h(20,"tr")(21,"td")(22,"label",10),b(23,"Row Spacing"),m()(),h(24,"td")(25,"input",11),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"rowSpacing"))}),m()(),h(26,"td")(27,"span",7),b(28),m()()(),h(29,"tr")(30,"th")(31,"label",12),b(32,"Column Spacing"),m()(),h(33,"td")(34,"input",13),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"columnSpacing"))}),m()(),h(35,"td")(36,"span",7),b(37),m()()()()(),H(38,aF,2,1,"ng-template",null,0,we)(40,sF,2,1,"ng-template",null,1,we)(42,lF,2,1,"ng-template",null,2,we)(44,cF,2,1,"ng-template",null,3,we)}n&2&&(f(7),C("maskito",r.options)("ngModel",r.leftIndent()),f(3),P(r.tooltip.leftIndent),f(6),C("maskito",r.options)("ngModel",r.topIndent()),f(3),P(r.tooltip.topIndent),f(6),C("maskito",r.options)("ngModel",r.rowSpacing()),f(3),P(r.tooltip.rowSpacing),f(6),C("maskito",r.options)("ngModel",r.columnSpacing()),f(3),P(r.tooltip.columnSpacing))},dependencies:[gt,ht,ft,Vt,bt,Gi,Di],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function dF(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S();f(),P(e.tooltip.basicPriceLabel)}}function pF(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S();f(),P(e.tooltip.promotionPriceLabel)}}var ly=(()=>{class i{constructor(){this.tooltip={basicPriceLabel:"Custom label normal price",promotionPriceLabel:"Custom label promotion price"},this.storeService=O(Re),this.destroyRef=O(Ct),this.injector=O(Ye),this.basicPriceLabel=B(""),this.promotionPriceLabel=B(""),this.options=Wt}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.basicPriceLabel.set(e.BasicPriceLabel),this.promotionPriceLabel.set(e.PromotionPriceLabel)})).subscribe()}onInputHandler(e,n){switch(n){case"basicPriceLabel":this.basicPriceLabel.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{BasicPriceLabel:this.basicPriceLabel()}));break;case"promotionPriceLabel":this.promotionPriceLabel.set(e),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PromotionPriceLabel:this.promotionPriceLabel()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-pp-label"]],standalone:!0,features:[fe],decls:24,vars:4,consts:[["basicPriceLabelTemplate",""],["promotionPriceLabelTemplate",""],[1,"table","table-bordered"],["for","normalPrice",1,"fs-2","d-inline-block","text-truncate"],["id","normalPrice","name","basicPriceLabel","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","promotionPrice",1,"fs-2","d-inline-block","text-truncate"],["id","promotionPrice","name","promotionPriceLabel","type","text",1,"form-control","fs-1",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"label",3),b(5,"Normal Price"),m()(),h(6,"td")(7,"input",4),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"basicPriceLabel"))}),m()(),h(8,"td")(9,"span",5),b(10),m()()(),h(11,"tr")(12,"td")(13,"label",6),b(14,"Promotion Price"),m()(),h(15,"td")(16,"input",7),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"promotionPriceLabel"))}),m()(),h(17,"td")(18,"span",5),b(19),m()()()()(),H(20,dF,2,1,"ng-template",null,0,we)(22,pF,2,1,"ng-template",null,1,we)}n&2&&(f(7),C("ngModel",r.basicPriceLabel()),f(3),P(r.tooltip.basicPriceLabel),f(6),C("ngModel",r.promotionPriceLabel()),f(3),P(r.tooltip.promotionPriceLabel))},dependencies:[gt,ht,ft,Vt,bt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var jh=Ne(Lh());function uF(i,t){if(i&1){let e=Se();h(0,"tr")(1,"td")(2,"label",6),b(3,"Pricebook Font Size"),m()(),h(4,"td")(5,"input",7),N("ngModelChange",function(r){X(e);let o=S();return K(o.onInputHandler(r,"pricebookFontSize"))}),m()(),h(6,"td")(7,"span",5),b(8),m()()()}if(i&2){let e=S();f(5),C("maskito",e.options)("ngModel",e.pricebookFontSize()),f(3),P(e.tooltip.pricebookFontSize)}}function hF(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S();f(),P(e.tooltip.pricebookFontSize)}}function mF(i,t){if(i&1&&(h(0,"span",8),b(1),m()),i&2){let e=S();f(),P(e.tooltip.fontSize)}}var cy=(()=>{class i{constructor(){this.options=Wt,this.barcodeHeight=B(0),this.fontSize=B(0),this.barcode=B(!1),this.code=B(!1),this.price=B(!1),this.name=B(!1),this.moveProductName=B(!1),this.releaseDate=B(!1),this.discountVisible=B(!1),this.pricebookPrice=B(!1),this.pricebookFontSize=B(0),this.tooltip={fontSize:"Change font size for price",pricebookFontSize:"Change font size for pricebook price"},this.storeService=O(Re),this.injector=O(Ye),this.destroyRef=O(Ct)}ngOnInit(){Dt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Rt(this.destroyRef),Ee(e=>{this.pricebookFontSize.set(e.PricebookFontSize),this.fontSize.set(e.PriceFontSize)})).subscribe()}onInputHandler(e,n){switch(console.log("value",e),n){case"pricebookFontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"fontSize":this.fontSize.set(parseFloat(e.replace("px",""))),this.storeService.onChangePaperConfiguration(k(_({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-price-fontsize"]],standalone:!0,features:[fe],decls:16,vars:4,consts:[["pricebookFontSizeTemplate",""],["fontSizeTemplate",""],[1,"table","table-bordered"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","pricebookFontSize",1,"fs-2","d-inline-block","text-truncate"],["id","pricebookFontSize","name","pricebookFontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Se();h(0,"table",2)(1,"tbody"),H(2,uF,9,3,"tr"),h(3,"tr")(4,"td")(5,"label",3),b(6,"Font Size"),m()(),h(7,"td")(8,"input",4),N("ngModelChange",function(s){return X(o),K(r.onInputHandler(s,"fontSize"))}),m()(),h(9,"td")(10,"span",5),b(11),m()()()()(),H(12,hF,2,1,"ng-template",null,0,we)(14,mF,2,1,"ng-template",null,1,we)}n&2&&(f(2),ae(r.storeService.paperConfiguration().PricebookVisible?2:-1),f(6),C("maskito",r.options)("ngModel",r.fontSize()),f(3),P(r.tooltip.fontSize))},dependencies:[Gi,et,gt,ht,ft,Vt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"]})}}return i})();function fF(i,t){i&1&&(h(0,"button",14)(1,"span",13),b(2,"Next"),m(),J(3,"i",33),m())}function gF(i,t){if(i&1){let e=Se();h(0,"button",34),N("click",function(){X(e);let r=S();return K(r.printBarcodePreview())}),h(1,"span",13),b(2,"Print"),m()()}}function bF(i,t){if(i&1&&(h(0,"div",20),J(1,"app-barcode-preview",35),m()),i&2){let e=S();f(),C("items",e.storeService.expandProductItems())}}function vF(i,t){if(i&1&&J(0,"app-label-preview",36),i&2){let e=t.$implicit;C("item",e)}}function _F(i,t){if(i&1&&(h(0,"div",21),St(1,vF,1,1,"app-label-preview",36,Tn),m()),i&2){let e=S();C("ngStyle",e.stickerContainerStyles),f(),Pt(e.storeService.expandProductItems())}}var mq=(()=>{class i{constructor(){this.storeService=O(Re),this.httpService=O($i),this.toastr=O(zr),this.destroyRef=O(Ct),this.route=O(Ui),this.router=O(Ei),this.step=B(0)}get stickerContainerStyles(){return{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${this.storeService.paperConfiguration().StickerWidth}px, 1fr))`,gridTemplateRows:"auto",gap:`${this.storeService.paperConfiguration().RowSpacing}px ${this.storeService.paperConfiguration().ColumnSpacing}px`,width:`${this.storeService.paperConfiguration().PaperWidth}px`,border:"1px dashed #000",alignItems:"self-start",overflowY:"auto"}}ngOnInit(){this.route.queryParamMap.pipe(st(e=>e.has("step")),Ve(e=>+e.get("step")),Ee(e=>this.step.set(e))).subscribe()}get printMode(){return localStorage.getItem("printMode")||"barcode"}onPrevious(){this.step.set(this.step()-1),this.router.navigate([],{queryParams:{step:this.step()},queryParamsHandling:"merge",relativeTo:this.route})}printPriceLabelPreview(){let e=this.storeService.paperConfiguration().StickerWidth,n=this.storeService.paperConfiguration().StickerHeight,r=this.storeService.paperConfiguration().RowSpacing,o=this.storeService.paperConfiguration().ColumnSpacing;(0,jh.default)({printable:"priceLabel-container",type:"html",style:`
182
182
  @page {
183
183
  size: ${this.storeService.paperConfiguration().PaperWidth}px auto;
184
184
  margin: 0;
@@ -369,4 +369,4 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${t.byteLength}`),t.tiff&&
369
369
  color: #000 !important;
370
370
  }
371
371
  `,font_size:"",targetStyle:["*"],onError:n=>{console.error("printjs",n)},onLoadingEnd:()=>{this.onSaveConfig()}})}ngAfterViewInit(){}onSaveConfig(){let e=this.storeService.paperConfig().PaperFormats,n=e.findIndex(a=>a.Name===this.storeService.paperConfiguration().Name);n!==-1&&(e[n]=this.storeService.paperConfiguration());let r={PaperFormats:[...e],SubDomain:localStorage.getItem("Domain")};console.log("Debug \u{1F41E} ==> Class: PrintPreviewComponent, Function: onSaveConfig, Line 189 payload(): ",`
372
- `,r);let o={responseType:"text",observe:"response"};this.httpService.post("api/Config/SaveConfig",r,o).pipe(Rt(this.destroyRef),Lr("response"),Ee(a=>{a instanceof Cs&&a.status===200&&this.toastr.success(a.body,"success")}),Fc(1)).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-print-preview"]],standalone:!0,features:[fe],decls:66,vars:11,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-4","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],["type","button",1,"btn","btn-info","d-flex","gap-1","align-items-center"],["type","button",1,"btn","btn-success"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-12"],[1,"card","h-100"],[1,"card-body","d-flex","justify-content-center",2,"height","0"],["id","barcode-container",1,"scroll-container",2,"border","1px dashed black"],["id","priceLabel-container",3,"ngStyle"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[1,"f","fas","fa-angle-right"],["type","button",1,"btn","btn-success",3,"click"],["previewType","multiple",3,"items"],[3,"item"]],template:function(n,r){if(n&1){let o=Se();h(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),b(8,"Print Preview"),m()()(),h(9,"ul",9)(10,"div",10)(11,"button",11),N("click",function(){return X(o),K(r.onPrevious())}),J(12,"i",12),h(13,"span",13),b(14,"Back"),m()(),H(15,gF,4,0,"button",14)(16,bF,3,0,"button",15),m()()()()()(),h(17,"div",16)(18,"div",17)(19,"div",18)(20,"div",19),H(21,vF,2,1,"div",20)(22,yF,3,1,"div",21),m()()(),h(23,"div",17)(24,"div",22)(25,"div",23)(26,"h4",24),b(27,"Label Spacing"),m()(),h(28,"div",25)(29,"div",26)(30,"div",27)(31,"h2",28)(32,"button",29)(33,"span",30),b(34,"Paper"),m()()(),h(35,"div",31)(36,"div",32,0),J(38,"app-pp-paper"),m()()(),h(39,"div",27)(40,"h2",28)(41,"button",29)(42,"span",30),b(43,"Price Font Size"),m()()(),h(44,"div",31)(45,"div",32,0),J(47,"app-price-fontsize"),m()()(),h(48,"div",27)(49,"h2",28)(50,"button",29)(51,"span",30),b(52,"Spacing"),m()()(),h(53,"div",31)(54,"div",32,0),J(56,"app-pp-spacing"),m()()(),h(57,"div",27)(58,"h2",28)(59,"button",29)(60,"span",30),b(61,"Label"),m()()(),h(62,"div",31)(63,"div",32,0),J(65,"app-pp-label"),m()()()()()()()()()}if(n&2){let o;f(),qe("data-navbarbg",r.storeService.options().navbarbg),f(),C("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),f(),C("ngbCollapse",!r.storeService.options().isCollapsed),qe("data-navbarbg",r.storeService.options().navbarbg),f(12),ae(r.storeService.stepper$().state<2?15:16),f(6),ae((o=r.printMode)==="barcode"?21:o==="priceLabel"?22:-1),f(8),C("closeOthers",!0),f(),C("collapsed",!1),f(9),C("collapsed",!0),f(9),C("collapsed",!0),f(9),C("collapsed",!0)}},dependencies:[Ts,Os,Ms,Rs,Fs,As,Ec,Mn,Br,Or,ay,sy,ly,J_,cy,oy],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 200px);overflow-x:hidden}#barcode-container[_ngcontent-%COMP%] div[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0} .barcode{width:100%} .barcode img{width:inherit}#priceLabel-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));grid-template-rows:auto;gap:10px;align-items:center;justify-content:center;width:100%}"]})}}return i})();export{Ec as a,Re as b,Zs as c,bg as d,GV as e,J_ as f,HW as g,oy as h,mq as i};
372
+ `,r);let o={responseType:"text",observe:"response"};this.httpService.post("api/Config/SaveConfig",r,o).pipe(Rt(this.destroyRef),Lr("response"),Ee(a=>{a instanceof Ss&&a.status===200&&this.toastr.success(a.body,"success")}),Fc(1)).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=pe({type:i,selectors:[["app-print-preview"]],standalone:!0,features:[fe],decls:66,vars:11,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-4","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],["type","button",1,"btn","btn-info","d-flex","gap-1","align-items-center"],["type","button",1,"btn","btn-success"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-12"],[1,"card","h-100"],[1,"card-body","d-flex","justify-content-center",2,"height","0"],["id","barcode-container",1,"scroll-container",2,"border","1px dashed black"],["id","priceLabel-container",3,"ngStyle"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[1,"f","fas","fa-angle-right"],["type","button",1,"btn","btn-success",3,"click"],["previewType","multiple",3,"items"],[3,"item"]],template:function(n,r){if(n&1){let o=Se();h(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),b(8,"Print Preview"),m()()(),h(9,"ul",9)(10,"div",10)(11,"button",11),N("click",function(){return X(o),K(r.onPrevious())}),J(12,"i",12),h(13,"span",13),b(14,"Back"),m()(),H(15,fF,4,0,"button",14)(16,gF,3,0,"button",15),m()()()()()(),h(17,"div",16)(18,"div",17)(19,"div",18)(20,"div",19),H(21,bF,2,1,"div",20)(22,_F,3,1,"div",21),m()()(),h(23,"div",17)(24,"div",22)(25,"div",23)(26,"h4",24),b(27,"Label Spacing"),m()(),h(28,"div",25)(29,"div",26)(30,"div",27)(31,"h2",28)(32,"button",29)(33,"span",30),b(34,"Paper"),m()()(),h(35,"div",31)(36,"div",32,0),J(38,"app-pp-paper"),m()()(),h(39,"div",27)(40,"h2",28)(41,"button",29)(42,"span",30),b(43,"Price Font Size"),m()()(),h(44,"div",31)(45,"div",32,0),J(47,"app-price-fontsize"),m()()(),h(48,"div",27)(49,"h2",28)(50,"button",29)(51,"span",30),b(52,"Spacing"),m()()(),h(53,"div",31)(54,"div",32,0),J(56,"app-pp-spacing"),m()()(),h(57,"div",27)(58,"h2",28)(59,"button",29)(60,"span",30),b(61,"Label"),m()()(),h(62,"div",31)(63,"div",32,0),J(65,"app-pp-label"),m()()()()()()()()()}if(n&2){let o;f(),qe("data-navbarbg",r.storeService.options().navbarbg),f(),C("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),f(),C("ngbCollapse",!r.storeService.options().isCollapsed),qe("data-navbarbg",r.storeService.options().navbarbg),f(12),ae(r.storeService.stepper$().state<2?15:16),f(6),ae((o=r.printMode)==="barcode"?21:o==="priceLabel"?22:-1),f(8),C("closeOthers",!0),f(),C("collapsed",!1),f(9),C("collapsed",!0),f(9),C("collapsed",!0),f(9),C("collapsed",!0)}},dependencies:[Ms,Fs,Os,Bs,As,Rs,Ec,On,Br,Or,ay,sy,ly,J_,cy,oy],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 200px);overflow-x:hidden}#barcode-container[_ngcontent-%COMP%] div[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0} .barcode{width:100%} .barcode img{width:inherit}#priceLabel-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));grid-template-rows:auto;gap:10px;align-items:center;justify-content:center;width:100%}"]})}}return i})();export{Ec as a,Re as b,Js as c,bg as d,GV as e,J_ as f,HW as g,oy as h,mq as i};