dealposbarcode 1.7.1 → 1.7.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.
- package/{chunk-IDSEZUZN.js → chunk-DNK4VZLY.js} +1 -1
- package/{chunk-SZOOK4RX.js → chunk-PGAHC45C.js} +22 -21
- package/{chunk-WS54GKT5.js → chunk-TQSC5F5R.js} +1 -1
- package/{chunk-7IEKKSHA.js → chunk-XY3HB2QF.js} +2 -2
- package/{chunk-PQKI2EBV.js → chunk-ZXSD3XOK.js} +1 -1
- package/index.html +2 -2
- package/{main-OMVI2VJT.js → main-YQ2FYBHV.js} +2 -2
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import{A as fs,B as ep,C as tp,D as il,E as ip,F as np,a as Qo,c as ds,d as yr,e as Qa,f as Wu,g as $u,h as vi,i as qu,j as vr,k as Za,l as Ja,m as Te,n as Gu,o as us,p as ce,q as ps,r as Xu,s as Yu,t as el,u as hs,v as Ku,w as tl,x as Qu,y as Zu,z as Ju}from"./chunk-WS54GKT5.js";import{a as ms,b as li,c as Vt}from"./chunk-PQKI2EBV.js";import{$ as Uu,B as Ye,C as yt,D as ts,E as is,F as ns,G as Ni,H as nt,I as Ke,J as $e,K as rt,L as Fn,M as rs,N as os,O as ss,P as as,Q as ls,R as cs,T as Nu,U as zu,V as Lu,W as Hu,X as ju,Y as Rn,Z as Vu,a as si,aa as ai,b as Ou,c as Fu,l as Ko,n as In,q as Ya,r as Jo,u as Au,v as On,w as Ge,x as Je,y as Xe,z as es}from"./chunk-7IEKKSHA.js";import{$b as mr,Aa as pr,Ab as hr,Ac as xe,Ad as Ru,Bd as Zo,Ca as J,Cb as Cu,Cd as Mu,Da as F,Eb as jo,Ec as ke,Ed as gr,F as Ze,Fc as Ht,Fd as Bu,G as hu,Gb as gt,Gc as yi,Ha as ee,Hb as Su,Hc as Ga,Hd as Ka,Ia as Ct,Ib as Vo,Ic as te,Ja as Ki,Jb as Uo,K as ei,Ka as Lo,L as ti,Lb as H,M as fu,Mb as Ua,Oa as _u,Ob as fr,Pc as Pu,Q as mu,R as ur,Ra as ni,Rb as K,Rc as Qi,S as Xi,Sa as q,Sb as St,Ta as G,Tb as S,U as Yi,Uc as Bi,V as ii,Vb as En,Wa as Me,Wb as Wo,Xc as Eu,Ya as Be,Yc as Xa,Z as Aa,Za as Va,Zb as oe,_ as gu,_a as mt,_b as $o,a as b,ab as st,ac as At,b as E,ba as yu,bc as Nt,c as Sn,cc as f,cd as at,d as M,da as Na,dc as m,e as me,ec as X,fa as vu,fc as Wa,ga as za,gb as wu,gc as $a,hd as Xo,ic as pe,j as O,jd as Ai,k as Pn,l as Ao,lc as A,ld as Tn,m as No,mc as k,md as Du,n as zo,nc as Dn,o as Ri,oa as La,oc as kn,od as ku,pd as Tu,q as ft,qa as Ha,qc as qo,qd as Yo,ra as Mi,rc as ri,rd as Iu,sa as ja,sc as zt,sd as jt,t as qe,ta as re,tb as Ho,tc as Lt,uc as qa,vb as xu,vc as w,wa as bu,wc as D,xa as We,xb as y,xc as oi,ya as xt,yb as Se,yc as Go,zc as ie}from"./chunk-PLQP4Q76.js";var Pt=M(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});function z0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var L0=function t(e,n){z0(this,t),this.data=e,this.text=n.text||e,this.options=n};nl.default=L0});var sp=M(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.CODE39=void 0;var H0=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),j0=Pt(),V0=U0(j0);function U0(t){return t&&t.__esModule?t:{default:t}}function W0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $0(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function q0(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var G0=function(t){q0(e,t);function e(n,i){return W0(this,e),n=n.toUpperCase(),i.mod43&&(n+=K0(Q0(n))),$0(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return H0(e,[{key:"encode",value:function(){for(var i=rl("*"),r=0;r<this.data.length;r++)i+=rl(this.data[r])+"0";return i+=rl("*"),{data:i,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(V0.default),rp=["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","-","."," ","$","/","+","%","*"],X0=[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 rl(t){return Y0(op(t))}function Y0(t){return X0[t].toString(2)}function K0(t){return rp[t]}function op(t){return rp.indexOf(t)}function Q0(t){for(var e=0,n=0;n<t.length;n++)e+=op(t[n]);return e=e%43,e}gs.CODE39=G0});var Mn=M(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});var br;function ol(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ap=Ie.SET_A=0,lp=Ie.SET_B=1,cp=Ie.SET_C=2,aD=Ie.SHIFT=98,Z0=Ie.START_A=103,J0=Ie.START_B=104,ey=Ie.START_C=105,lD=Ie.MODULO=103,cD=Ie.STOP=106,dD=Ie.FNC1=207,uD=Ie.SET_BY_CODE=(br={},ol(br,Z0,ap),ol(br,J0,lp),ol(br,ey,cp),br),pD=Ie.SWAP={101:ap,100:lp,99:cp},hD=Ie.A_START_CHAR="\xD0",fD=Ie.B_START_CHAR="\xD1",mD=Ie.C_START_CHAR="\xD2",gD=Ie.A_CHARS="[\0-_\xC8-\xCF]",yD=Ie.B_CHARS="[ -\x7F\xC8-\xCF]",vD=Ie.C_CHARS="(\xCF*[0-9]{2}\xCF*)",bD=Ie.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 _r=M(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});var ty=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),iy=Pt(),ny=ry(iy),Et=Mn();function ry(t){return t&&t.__esModule?t:{default:t}}function oy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sy(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ay(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ly=function(t){ay(e,t);function e(n,i){oy(this,e);var r=sy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n.substring(1),i));return r.bytes=n.split("").map(function(o){return o.charCodeAt(0)}),r}return ty(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var i=this.bytes,r=i.shift()-105,o=Et.SET_BY_CODE[r];if(o===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&i.unshift(Et.FNC1);var s=e.next(i,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(r)+s.result+e.getBar((s.checksum+r)%Et.MODULO)+e.getBar(Et.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var i=this.options.ean128||!1;return typeof i=="string"&&(i=i.toLowerCase()==="true"),i}}],[{key:"getBar",value:function(i){return Et.BARS[i]?Et.BARS[i].toString():""}},{key:"correctIndex",value:function(i,r){if(r===Et.SET_A){var o=i.shift();return o<32?o+64:o-32}else return r===Et.SET_B?i.shift()-32:(i.shift()-48)*10+i.shift()-48}},{key:"next",value:function(i,r,o){if(!i.length)return{result:"",checksum:0};var s=void 0,a=void 0;if(i[0]>=200){a=i.shift()-105;var l=Et.SWAP[a];l!==void 0?s=e.next(i,r+1,l):((o===Et.SET_A||o===Et.SET_B)&&a===Et.SHIFT&&(i[0]=o===Et.SET_A?i[0]>95?i[0]-96:i[0]:i[0]<32?i[0]+96:i[0]),s=e.next(i,r+1,o))}else a=e.correctIndex(i,o),s=e.next(i,r+1,o);var c=e.getBar(a),d=a*r;return{result:c+s.result,checksum:d+s.checksum}}}]),e}(ny.default);sl.default=ly});var fp=M(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});var zi=Mn(),dp=function(e){return e.match(new RegExp("^"+zi.A_CHARS+"*"))[0].length},up=function(e){return e.match(new RegExp("^"+zi.B_CHARS+"*"))[0].length},pp=function(e){return e.match(new RegExp("^"+zi.C_CHARS+"*"))[0]};function al(t,e){var n=e?zi.A_CHARS:zi.B_CHARS,i=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(i)return i[1]+"\xCC"+hp(t.substring(i[1].length));var r=t.match(new RegExp("^"+n+"+"))[0];return r.length===t.length?t:r+String.fromCharCode(e?205:206)+al(t.substring(r.length),!e)}function hp(t){var e=pp(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var i=dp(t)>=up(t);return e+String.fromCharCode(i?206:205)+al(t,i)}ll.default=function(t){var e=void 0,n=pp(t).length;if(n>=2)e=zi.C_START_CHAR+hp(t);else{var i=dp(t)>up(t);e=(i?zi.A_START_CHAR:zi.B_START_CHAR)+al(t,i)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(r,o){return"\xCB"+o})}});var gp=M(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});var cy=_r(),dy=mp(cy),uy=fp(),py=mp(uy);function mp(t){return t&&t.__esModule?t:{default:t}}function hy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cl(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function fy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var my=function(t){fy(e,t);function e(n,i){if(hy(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var r=cl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,py.default)(n),i));else var r=cl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return cl(r)}return e}(dy.default);dl.default=my});var vp=M(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var gy=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),yy=_r(),vy=by(yy),yp=Mn();function by(t){return t&&t.__esModule?t:{default:t}}function _y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wy(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function xy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Cy=function(t){xy(e,t);function e(n,i){return _y(this,e),wy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,yp.A_START_CHAR+n,i))}return gy(e,[{key:"valid",value:function(){return new RegExp("^"+yp.A_CHARS+"+$").test(this.data)}}]),e}(vy.default);ul.default=Cy});var _p=M(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});var Sy=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Py=_r(),Ey=Dy(Py),bp=Mn();function Dy(t){return t&&t.__esModule?t:{default:t}}function ky(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ty(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Iy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Oy=function(t){Iy(e,t);function e(n,i){return ky(this,e),Ty(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,bp.B_START_CHAR+n,i))}return Sy(e,[{key:"valid",value:function(){return new RegExp("^"+bp.B_CHARS+"+$").test(this.data)}}]),e}(Ey.default);pl.default=Oy});var xp=M(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});var Fy=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Ry=_r(),My=By(Ry),wp=Mn();function By(t){return t&&t.__esModule?t:{default:t}}function Ay(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ny(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function zy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ly=function(t){zy(e,t);function e(n,i){return Ay(this,e),Ny(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,wp.C_START_CHAR+n,i))}return Fy(e,[{key:"valid",value:function(){return new RegExp("^"+wp.C_CHARS+"+$").test(this.data)}}]),e}(My.default);hl.default=Ly});var Cp=M(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.CODE128C=ci.CODE128B=ci.CODE128A=ci.CODE128=void 0;var Hy=gp(),jy=ys(Hy),Vy=vp(),Uy=ys(Vy),Wy=_p(),$y=ys(Wy),qy=xp(),Gy=ys(qy);function ys(t){return t&&t.__esModule?t:{default:t}}ci.CODE128=jy.default;ci.CODE128A=Uy.default;ci.CODE128B=$y.default;ci.CODE128C=Gy.default});var Bn=M(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});var kD=Li.SIDE_BIN="101",TD=Li.MIDDLE_BIN="01010",ID=Li.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"]},OD=Li.EAN2_STRUCTURE=["LL","LG","GL","GG"],FD=Li.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],RD=Li.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]});var An=M(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});var Xy=Bn(),Yy=function(e,n,i){var r=e.split("").map(function(s,a){return Xy.BINARIES[n[a]]}).map(function(s,a){return s?s[e[a]]:""});if(i){var o=e.length-1;r=r.map(function(s,a){return a<o?s+i:s})}return r.join("")};fl.default=Yy});var gl=M(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});var Ky=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Nn=Bn(),Qy=An(),Sp=Pp(Qy),Zy=Pt(),Jy=Pp(Zy);function Pp(t){return t&&t.__esModule?t:{default:t}}function ev(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function iv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var nv=function(t){iv(e,t);function e(n,i){ev(this,e);var r=tv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return r.fontSize=!i.flat&&i.fontSize>i.width*10?i.width*10:i.fontSize,r.guardHeight=i.height+r.fontSize/2+i.textMargin,r}return Ky(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(i,r){return this.text.substr(i,r)}},{key:"leftEncode",value:function(i,r){return(0,Sp.default)(i,r)}},{key:"rightText",value:function(i,r){return this.text.substr(i,r)}},{key:"rightEncode",value:function(i,r){return(0,Sp.default)(i,r)}},{key:"encodeGuarded",value:function(){var i={fontSize:this.fontSize},r={height:this.guardHeight};return[{data:Nn.SIDE_BIN,options:r},{data:this.leftEncode(),text:this.leftText(),options:i},{data:Nn.MIDDLE_BIN,options:r},{data:this.rightEncode(),text:this.rightText(),options:i},{data:Nn.SIDE_BIN,options:r}]}},{key:"encodeFlat",value:function(){var i=[Nn.SIDE_BIN,this.leftEncode(),Nn.MIDDLE_BIN,this.rightEncode(),Nn.SIDE_BIN];return{data:i.join(""),text:this.text}}}]),e}(Jy.default);ml.default=nv});var Dp=M(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});var rv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),wr=function t(e,n,i){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:t(o,n,i)}else{if("value"in r)return r.value;var s=r.get;return s===void 0?void 0:s.call(i)}},ov=Bn(),sv=gl(),av=lv(sv);function lv(t){return t&&t.__esModule?t:{default:t}}function cv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function uv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ep=function(e){var n=e.substr(0,12).split("").map(function(i){return+i}).reduce(function(i,r,o){return o%2?i+r*3:i+r},0);return(10-n%10)%10},pv=function(t){uv(e,t);function e(n,i){cv(this,e),n.search(/^[0-9]{12}$/)!==-1&&(n+=Ep(n));var r=dv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return r.lastChar=i.lastChar,r}return rv(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===Ep(this.data)}},{key:"leftText",value:function(){return wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var i=this.data.substr(1,6),r=ov.EAN13_STRUCTURE[this.data[0]];return wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,i,r)}},{key:"rightText",value:function(){return wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var i=this.data.substr(7,6);return wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,i,"RRRRRR")}},{key:"encodeGuarded",value:function(){var i=wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(i.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(i.push({data:"00"}),i.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),i}}]),e}(av.default);yl.default=pv});var Tp=M(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});var hv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),vs=function t(e,n,i){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:t(o,n,i)}else{if("value"in r)return r.value;var s=r.get;return s===void 0?void 0:s.call(i)}},fv=gl(),mv=gv(fv);function gv(t){return t&&t.__esModule?t:{default:t}}function yv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function bv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var kp=function(e){var n=e.substr(0,7).split("").map(function(i){return+i}).reduce(function(i,r,o){return o%2?i+r:i+r*3},0);return(10-n%10)%10},_v=function(t){bv(e,t);function e(n,i){return yv(this,e),n.search(/^[0-9]{7}$/)!==-1&&(n+=kp(n)),vv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return hv(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===kp(this.data)}},{key:"leftText",value:function(){return vs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var i=this.data.substr(0,4);return vs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,i,"LLLL")}},{key:"rightText",value:function(){return vs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var i=this.data.substr(4,4);return vs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,i,"RRRR")}}]),e}(mv.default);vl.default=_v});var Op=M(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});var wv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),xv=Bn(),Cv=An(),Sv=Ip(Cv),Pv=Pt(),Ev=Ip(Pv);function Ip(t){return t&&t.__esModule?t:{default:t}}function Dv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Tv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Iv=function(e){var n=e.split("").map(function(i){return+i}).reduce(function(i,r,o){return o%2?i+r*9:i+r*3},0);return n%10},Ov=function(t){Tv(e,t);function e(n,i){return Dv(this,e),kv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return wv(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var i=xv.EAN5_STRUCTURE[Iv(this.data)];return{data:"1011"+(0,Sv.default)(this.data,i,"01"),text:this.text}}}]),e}(Ev.default);bl.default=Ov});var Rp=M(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});var Fv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Rv=Bn(),Mv=An(),Bv=Fp(Mv),Av=Pt(),Nv=Fp(Av);function Fp(t){return t&&t.__esModule?t:{default:t}}function zv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Hv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var jv=function(t){Hv(e,t);function e(n,i){return zv(this,e),Lv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return Fv(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var i=Rv.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Bv.default)(this.data,i,"01"),text:this.text}}}]),e}(Nv.default);_l.default=jv});var xl=M(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});var Vv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();bs.checksum=wl;var Uv=An(),zn=Mp(Uv),Wv=Pt(),$v=Mp(Wv);function Mp(t){return t&&t.__esModule?t:{default:t}}function qv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Xv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Yv=function(t){Xv(e,t);function e(n,i){qv(this,e),n.search(/^[0-9]{11}$/)!==-1&&(n+=wl(n));var r=Gv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return r.displayValue=i.displayValue,i.fontSize>i.width*10?r.fontSize=i.width*10:r.fontSize=i.fontSize,r.guardHeight=i.height+r.fontSize/2+i.textMargin,r}return Vv(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==wl(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var i="";return i+="101",i+=(0,zn.default)(this.data.substr(0,6),"LLLLLL"),i+="01010",i+=(0,zn.default)(this.data.substr(6,6),"RRRRRR"),i+="101",{data:i,text:this.text}}},{key:"guardedEncoding",value:function(){var i=[];return this.displayValue&&i.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),i.push({data:"101"+(0,zn.default)(this.data[0],"L"),options:{height:this.guardHeight}}),i.push({data:(0,zn.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),i.push({data:"01010",options:{height:this.guardHeight}}),i.push({data:(0,zn.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),i.push({data:(0,zn.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&i.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),i}}]),e}($v.default);function wl(t){var e=0,n;for(n=1;n<11;n+=2)e+=parseInt(t[n]);for(n=0;n<11;n+=2)e+=parseInt(t[n])*3;return(10-e%10)%10}bs.default=Yv});var Np=M(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});var Kv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Qv=An(),Zv=Ap(Qv),Jv=Pt(),eb=Ap(Jv),tb=xl();function Ap(t){return t&&t.__esModule?t:{default:t}}function ib(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cl(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function nb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var rb=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],ob=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],sb=function(t){nb(e,t);function e(n,i){ib(this,e);var r=Cl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));if(r.isValid=!1,n.search(/^[0-9]{6}$/)!==-1)r.middleDigits=n,r.upcA=Bp(n,"0"),r.text=i.text||""+r.upcA[0]+n+r.upcA[r.upcA.length-1],r.isValid=!0;else if(n.search(/^[01][0-9]{7}$/)!==-1)if(r.middleDigits=n.substring(1,n.length-1),r.upcA=Bp(r.middleDigits,n[0]),r.upcA[r.upcA.length-1]===n[n.length-1])r.isValid=!0;else return Cl(r);else return Cl(r);return r.displayValue=i.displayValue,i.fontSize>i.width*10?r.fontSize=i.width*10:r.fontSize=i.fontSize,r.guardHeight=i.height+r.fontSize/2+i.textMargin,r}return Kv(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var i="";return i+="101",i+=this.encodeMiddleDigits(),i+="010101",{data:i,text:this.text}}},{key:"guardedEncoding",value:function(){var i=[];return this.displayValue&&i.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),i.push({data:"101",options:{height:this.guardHeight}}),i.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),i.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&i.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),i}},{key:"encodeMiddleDigits",value:function(){var i=this.upcA[0],r=this.upcA[this.upcA.length-1],o=ob[parseInt(r)][parseInt(i)];return(0,Zv.default)(this.middleDigits,o)}}]),e}(eb.default);function Bp(t,e){for(var n=parseInt(t[t.length-1]),i=rb[n],r="",o=0,s=0;s<i.length;s++){var a=i[s];a==="X"?r+=t[o++]:r+=a}return r=""+e+r,""+r+(0,tb.checksum)(r)}Sl.default=sb});var zp=M(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.UPCE=vt.UPC=vt.EAN2=vt.EAN5=vt.EAN8=vt.EAN13=void 0;var ab=Dp(),lb=Ln(ab),cb=Tp(),db=Ln(cb),ub=Op(),pb=Ln(ub),hb=Rp(),fb=Ln(hb),mb=xl(),gb=Ln(mb),yb=Np(),vb=Ln(yb);function Ln(t){return t&&t.__esModule?t:{default:t}}vt.EAN13=lb.default;vt.EAN8=db.default;vt.EAN5=pb.default;vt.EAN2=fb.default;vt.UPC=gb.default;vt.UPCE=vb.default});var Lp=M(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});var WD=xr.START_BIN="1010",$D=xr.END_BIN="11101",qD=xr.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]});var El=M(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var bb=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),_s=Lp(),_b=Pt(),wb=xb(_b);function xb(t){return t&&t.__esModule?t:{default:t}}function Cb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sb(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Pb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Eb=function(t){Pb(e,t);function e(){return Cb(this,e),Sb(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return bb(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var i=this,r=this.data.match(/.{2}/g).map(function(o){return i.encodePair(o)}).join("");return{data:_s.START_BIN+r+_s.END_BIN,text:this.text}}},{key:"encodePair",value:function(i){var r=_s.BINARIES[i[1]];return _s.BINARIES[i[0]].split("").map(function(o,s){return(o==="1"?"111":"1")+(r[s]==="1"?"000":"0")}).join("")}}]),e}(wb.default);Pl.default=Eb});var jp=M(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});var Db=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),kb=El(),Tb=Ib(kb);function Ib(t){return t&&t.__esModule?t:{default:t}}function Ob(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fb(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Rb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Hp=function(e){var n=e.substr(0,13).split("").map(function(i){return parseInt(i,10)}).reduce(function(i,r,o){return i+r*(3-o%2*2)},0);return Math.ceil(n/10)*10-n},Mb=function(t){Rb(e,t);function e(n,i){return Ob(this,e),n.search(/^[0-9]{13}$/)!==-1&&(n+=Hp(n)),Fb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return Db(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===Hp(this.data)}}]),e}(Tb.default);Dl.default=Mb});var Up=M(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ITF14=Hn.ITF=void 0;var Bb=El(),Ab=Vp(Bb),Nb=jp(),zb=Vp(Nb);function Vp(t){return t&&t.__esModule?t:{default:t}}Hn.ITF=Ab.default;Hn.ITF14=zb.default});var jn=M(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});var Lb=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Hb=Pt(),jb=Vb(Hb);function Vb(t){return t&&t.__esModule?t:{default:t}}function Ub(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wb(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function $b(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var qb=function(t){$b(e,t);function e(n,i){return Ub(this,e),Wb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return Lb(e,[{key:"encode",value:function(){for(var i="110",r=0;r<this.data.length;r++){var o=parseInt(this.data[r]),s=o.toString(2);s=Gb(s,4-s.length);for(var a=0;a<s.length;a++)i+=s[a]=="0"?"100":"110"}return i+="1001",{data:i,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(jb.default);function Gb(t,e){for(var n=0;n<e;n++)t="0"+t;return t}kl.default=qb});var Cr=M(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.mod10=Xb;ws.mod11=Yb;function Xb(t){for(var e=0,n=0;n<t.length;n++){var i=parseInt(t[n]);(n+t.length)%2===0?e+=i:e+=i*2%10+Math.floor(i*2/10)}return(10-e%10)%10}function Yb(t){for(var e=0,n=[2,3,4,5,6,7],i=0;i<t.length;i++){var r=parseInt(t[t.length-1-i]);e+=n[i%n.length]*r}return(11-e%11)%11}});var Wp=M(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});var Kb=jn(),Qb=Jb(Kb),Zb=Cr();function Jb(t){return t&&t.__esModule?t:{default:t}}function e1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function t1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function i1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var n1=function(t){i1(e,t);function e(n,i){return e1(this,e),t1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n+(0,Zb.mod10)(n),i))}return e}(Qb.default);Tl.default=n1});var $p=M(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});var r1=jn(),o1=a1(r1),s1=Cr();function a1(t){return t&&t.__esModule?t:{default:t}}function l1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function d1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var u1=function(t){d1(e,t);function e(n,i){return l1(this,e),c1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n+(0,s1.mod11)(n),i))}return e}(o1.default);Il.default=u1});var Gp=M(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});var p1=jn(),h1=f1(p1),qp=Cr();function f1(t){return t&&t.__esModule?t:{default:t}}function m1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function y1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var v1=function(t){y1(e,t);function e(n,i){return m1(this,e),n+=(0,qp.mod10)(n),n+=(0,qp.mod10)(n),g1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return e}(h1.default);Ol.default=v1});var Yp=M(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});var b1=jn(),_1=w1(b1),Xp=Cr();function w1(t){return t&&t.__esModule?t:{default:t}}function x1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function S1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var P1=function(t){S1(e,t);function e(n,i){return x1(this,e),n+=(0,Xp.mod11)(n),n+=(0,Xp.mod10)(n),C1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return e}(_1.default);Fl.default=P1});var Kp=M(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.MSI1110=Ut.MSI1010=Ut.MSI11=Ut.MSI10=Ut.MSI=void 0;var E1=jn(),D1=Sr(E1),k1=Wp(),T1=Sr(k1),I1=$p(),O1=Sr(I1),F1=Gp(),R1=Sr(F1),M1=Yp(),B1=Sr(M1);function Sr(t){return t&&t.__esModule?t:{default:t}}Ut.MSI=D1.default;Ut.MSI10=T1.default;Ut.MSI11=O1.default;Ut.MSI1010=R1.default;Ut.MSI1110=B1.default});var Qp=M(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.pharmacode=void 0;var A1=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),N1=Pt(),z1=L1(N1);function L1(t){return t&&t.__esModule?t:{default:t}}function H1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function V1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var U1=function(t){V1(e,t);function e(n,i){H1(this,e);var r=j1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return r.number=parseInt(n,10),r}return A1(e,[{key:"encode",value:function(){for(var i=this.number,r="";!isNaN(i)&&i!=0;)i%2===0?(r="11100"+r,i=(i-2)/2):(r="100"+r,i=(i-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(z1.default);xs.pharmacode=U1});var Zp=M(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.codabar=void 0;var W1=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),$1=Pt(),q1=G1($1);function G1(t){return t&&t.__esModule?t:{default:t}}function X1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function K1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Q1=function(t){K1(e,t);function e(n,i){X1(this,e),n.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(n="A"+n+"A");var r=Y1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n.toUpperCase(),i));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return W1(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var i=[],r=this.getEncodings(),o=0;o<this.data.length;o++)i.push(r[this.data.charAt(o)]),o!==this.data.length-1&&i.push("0");return{text:this.text,data:i.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"}}}]),e}(q1.default);Cs.codabar=Q1});var Jp=M(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.GenericBarcode=void 0;var Z1=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),J1=Pt(),e_=t_(J1);function t_(t){return t&&t.__esModule?t:{default:t}}function i_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n_(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function r_(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var o_=function(t){r_(e,t);function e(n,i){return i_(this,e),n_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return Z1(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(e_.default);Ss.GenericBarcode=o_});var th=M(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});var s_=sp(),Ps=Cp(),Vn=zp(),eh=Up(),Pr=Kp(),a_=Qp(),l_=Zp(),c_=Jp();Rl.default={CODE39:s_.CODE39,CODE128:Ps.CODE128,CODE128A:Ps.CODE128A,CODE128B:Ps.CODE128B,CODE128C:Ps.CODE128C,EAN13:Vn.EAN13,EAN8:Vn.EAN8,EAN5:Vn.EAN5,EAN2:Vn.EAN2,UPC:Vn.UPC,UPCE:Vn.UPCE,ITF14:eh.ITF14,ITF:eh.ITF,MSI:Pr.MSI,MSI10:Pr.MSI10,MSI11:Pr.MSI11,MSI1010:Pr.MSI1010,MSI1110:Pr.MSI1110,pharmacode:a_.pharmacode,codabar:l_.codabar,GenericBarcode:c_.GenericBarcode}});var Er=M(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var d_=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};Ml.default=function(t,e){return d_({},t,e)}});var ih=M(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});Bl.default=u_;function u_(t){var e=[];function n(i){if(Array.isArray(i))for(var r=0;r<i.length;r++)n(i[r]);else i.text=i.text||"",i.data=i.data||"",e.push(i)}return n(t),e}});var nh=M(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.default=p_;function p_(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}});var zl=M(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.default=h_;function h_(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&(n=e[n],typeof t[n]=="string"&&(t[n]=parseInt(t[n],10)));return typeof t.displayValue=="string"&&(t.displayValue=t.displayValue!="false"),t}});var Hl=M(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var f_={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(){}};Ll.default=f_});var sh=M(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var m_=zl(),g_=oh(m_),y_=Hl(),rh=oh(y_);function oh(t){return t&&t.__esModule?t:{default:t}}function v_(t){var e={};for(var n in rh.default)rh.default.hasOwnProperty(n)&&(t.hasAttribute("jsbarcode-"+n.toLowerCase())&&(e[n]=t.getAttribute("jsbarcode-"+n.toLowerCase())),t.hasAttribute("data-"+n.toLowerCase())&&(e[n]=t.getAttribute("data-"+n.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0,g_.default)(e),e}jl.default=v_});var Vl=M(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.getTotalWidthOfEncodings=Wt.calculateEncodingAttributes=Wt.getBarcodePadding=Wt.getEncodingHeight=Wt.getMaximumHeightOfEncodings=void 0;var b_=Er(),__=w_(b_);function w_(t){return t&&t.__esModule?t:{default:t}}function ah(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function lh(t,e,n){if(n.displayValue&&e<t){if(n.textAlign=="center")return Math.floor((t-e)/2);if(n.textAlign=="left")return 0;if(n.textAlign=="right")return Math.floor(t-e)}return 0}function x_(t,e,n){for(var i=0;i<t.length;i++){var r=t[i],o=(0,__.default)(e,r.options),s;o.displayValue?s=P_(r.text,o,n):s=0;var a=r.data.length*o.width;r.width=Math.ceil(Math.max(s,a)),r.height=ah(r,o),r.barcodePadding=lh(s,a,o)}}function C_(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e}function S_(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e}function P_(t,e,n){var i;if(n)i=n;else if(typeof document<"u")i=document.createElement("canvas").getContext("2d");else return 0;i.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var r=i.measureText(t);if(!r)return 0;var o=r.width;return o}Wt.getMaximumHeightOfEncodings=S_;Wt.getEncodingHeight=ah;Wt.getBarcodePadding=lh;Wt.calculateEncodingAttributes=x_;Wt.getTotalWidthOfEncodings=C_});var ch=M(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var E_=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),D_=Er(),k_=T_(D_),Ul=Vl();function T_(t){return t&&t.__esModule?t:{default:t}}function I_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var O_=function(){function t(e,n,i){I_(this,t),this.canvas=e,this.encodings=n,this.options=i}return E_(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var n=0;n<this.encodings.length;n++){var i=(0,k_.default)(this.options,this.encodings[n].options);this.drawCanvasBarcode(i,this.encodings[n]),this.drawCanvasText(i,this.encodings[n]),this.moveCanvasDrawing(this.encodings[n])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var n=this.canvas.getContext("2d");n.save(),(0,Ul.calculateEncodingAttributes)(this.encodings,this.options,n);var i=(0,Ul.getTotalWidthOfEncodings)(this.encodings),r=(0,Ul.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=i+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,n.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(n.fillStyle=this.options.background,n.fillRect(0,0,this.canvas.width,this.canvas.height)),n.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(n,i){var r=this.canvas.getContext("2d"),o=i.data,s;n.textPosition=="top"?s=n.marginTop+n.fontSize+n.textMargin:s=n.marginTop,r.fillStyle=n.lineColor;for(var a=0;a<o.length;a++){var l=a*n.width+i.barcodePadding;o[a]==="1"?r.fillRect(l,s,n.width,n.height):o[a]&&r.fillRect(l,s,n.width,n.height*o[a])}}},{key:"drawCanvasText",value:function(n,i){var r=this.canvas.getContext("2d"),o=n.fontOptions+" "+n.fontSize+"px "+n.font;if(n.displayValue){var s,a;n.textPosition=="top"?a=n.marginTop+n.fontSize-n.textMargin:a=n.height+n.textMargin+n.marginTop+n.fontSize,r.font=o,n.textAlign=="left"||i.barcodePadding>0?(s=0,r.textAlign="left"):n.textAlign=="right"?(s=i.width-1,r.textAlign="right"):(s=i.width/2,r.textAlign="center"),r.fillText(i.text,s,a)}}},{key:"moveCanvasDrawing",value:function(n){var i=this.canvas.getContext("2d");i.translate(n.width,0)}},{key:"restoreCanvas",value:function(){var n=this.canvas.getContext("2d");n.restore()}}]),t}();Wl.default=O_});var dh=M(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});var F_=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),R_=Er(),M_=B_(R_),$l=Vl();function B_(t){return t&&t.__esModule?t:{default:t}}function A_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Es="http://www.w3.org/2000/svg",N_=function(){function t(e,n,i){A_(this,t),this.svg=e,this.encodings=n,this.options=i,this.document=i.xmlDocument||document}return F_(t,[{key:"render",value:function(){var n=this.options.marginLeft;this.prepareSVG();for(var i=0;i<this.encodings.length;i++){var r=this.encodings[i],o=(0,M_.default)(this.options,r.options),s=this.createGroup(n,o.marginTop,this.svg);this.setGroupOptions(s,o),this.drawSvgBarcode(s,o,r),this.drawSVGText(s,o,r),n+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,$l.calculateEncodingAttributes)(this.encodings,this.options);var n=(0,$l.getTotalWidthOfEncodings)(this.encodings),i=(0,$l.getMaximumHeightOfEncodings)(this.encodings),r=n+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,i),this.options.background&&this.drawRect(0,0,r,i,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(n,i,r){var o=r.data,s;i.textPosition=="top"?s=i.fontSize+i.textMargin:s=0;for(var a=0,l=0,c=0;c<o.length;c++)l=c*i.width+r.barcodePadding,o[c]==="1"?a++:a>0&&(this.drawRect(l-i.width*a,s,i.width*a,i.height,n),a=0);a>0&&this.drawRect(l-i.width*(a-1),s,i.width*a,i.height,n)}},{key:"drawSVGText",value:function(n,i,r){var o=this.document.createElementNS(Es,"text");if(i.displayValue){var s,a;o.setAttribute("style","font:"+i.fontOptions+" "+i.fontSize+"px "+i.font),i.textPosition=="top"?a=i.fontSize-i.textMargin:a=i.height+i.textMargin+i.fontSize,i.textAlign=="left"||r.barcodePadding>0?(s=0,o.setAttribute("text-anchor","start")):i.textAlign=="right"?(s=r.width-1,o.setAttribute("text-anchor","end")):(s=r.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",s),o.setAttribute("y",a),o.appendChild(this.document.createTextNode(r.text)),n.appendChild(o)}}},{key:"setSvgAttributes",value:function(n,i){var r=this.svg;r.setAttribute("width",n+"px"),r.setAttribute("height",i+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+n+" "+i),r.setAttribute("xmlns",Es),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(n,i,r){var o=this.document.createElementNS(Es,"g");return o.setAttribute("transform","translate("+n+", "+i+")"),r.appendChild(o),o}},{key:"setGroupOptions",value:function(n,i){n.setAttribute("style","fill:"+i.lineColor+";")}},{key:"drawRect",value:function(n,i,r,o,s){var a=this.document.createElementNS(Es,"rect");return a.setAttribute("x",n),a.setAttribute("y",i),a.setAttribute("width",r),a.setAttribute("height",o),s.appendChild(a),a}}]),t}();ql.default=N_});var uh=M(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var z_=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function L_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var H_=function(){function t(e,n,i){L_(this,t),this.object=e,this.encodings=n,this.options=i}return z_(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();Gl.default=H_});var ph=M(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});var j_=ch(),V_=Xl(j_),U_=dh(),W_=Xl(U_),$_=uh(),q_=Xl($_);function Xl(t){return t&&t.__esModule?t:{default:t}}Yl.default={CanvasRenderer:V_.default,SVGRenderer:W_.default,ObjectRenderer:q_.default}});var Jl=M(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});function Kl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ql(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Zl(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var G_=function(t){Zl(e,t);function e(n,i){Kl(this,e);var r=Ql(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidInputException",r.symbology=n,r.input=i,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return e}(Error),X_=function(t){Zl(e,t);function e(){Kl(this,e);var n=Ql(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.name="InvalidElementException",n.message="Not supported type to render on",n}return e}(Error),Y_=function(t){Zl(e,t);function e(){Kl(this,e);var n=Ql(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.name="NoElementException",n.message="No element to render on.",n}return e}(Error);Dr.InvalidInputException=G_;Dr.InvalidElementException=X_;Dr.NoElementException=Y_});var fh=M(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var K_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q_=sh(),ec=hh(Q_),Z_=ph(),kr=hh(Z_),J_=Jl();function hh(t){return t&&t.__esModule?t:{default:t}}function tc(t){if(typeof t=="string")return ew(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(tc(t[n]));return e}else{if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLImageElement)return tw(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&t instanceof SVGElement)return{element:t,options:(0,ec.default)(t),renderer:kr.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,ec.default)(t),renderer:kr.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:kr.default.CanvasRenderer};if(t&&(typeof t>"u"?"undefined":K_(t))==="object"&&!t.nodeName)return{element:t,renderer:kr.default.ObjectRenderer};throw new J_.InvalidElementException}}function ew(t){var e=document.querySelectorAll(t);if(e.length!==0){for(var n=[],i=0;i<e.length;i++)n.push(tc(e[i]));return n}}function tw(t){var e=document.createElement("canvas");return{element:e,options:(0,ec.default)(t),renderer:kr.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}ic.default=tc});var mh=M(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var iw=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function nw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var rw=function(){function t(e){nw(this,t),this.api=e}return iw(t,[{key:"handleCatch",value:function(n){if(n.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw n.message;else throw n;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(n){try{var i=n.apply(void 0,arguments);return this.api._options.valid(!0),i}catch(r){return this.handleCatch(r),this.api}}}]),t}();nc.default=rw});var sc=M((xk,xh)=>{"use strict";var ow=th(),Zi=Hi(ow),sw=Er(),Tr=Hi(sw),aw=ih(),yh=Hi(aw),lw=nh(),gh=Hi(lw),cw=fh(),dw=Hi(cw),uw=zl(),pw=Hi(uw),hw=mh(),fw=Hi(hw),vh=Jl(),mw=Hl(),bh=Hi(mw);function Hi(t){return t&&t.__esModule?t:{default:t}}var bi=function(){},Ds=function(e,n,i){var r=new bi;if(typeof e>"u")throw Error("No element to render on was provided.");return r._renderProperties=(0,dw.default)(e),r._encodings=[],r._options=bh.default,r._errorHandler=new fw.default(r),typeof n<"u"&&(i=i||{},i.format||(i.format=wh()),r.options(i)[i.format](n,i).render()),r};Ds.getModule=function(t){return Zi.default[t]};for(rc in Zi.default)Zi.default.hasOwnProperty(rc)&&gw(Zi.default,rc);var rc;function gw(t,e){bi.prototype[e]=bi.prototype[e.toUpperCase()]=bi.prototype[e.toLowerCase()]=function(n,i){var r=this;return r._errorHandler.wrapBarcodeCall(function(){i.text=typeof i.text>"u"?void 0:""+i.text;var o=(0,Tr.default)(r._options,i);o=(0,pw.default)(o);var s=t[e],a=_h(n,s,o);return r._encodings.push(a),r})}}function _h(t,e,n){t=""+t;var i=new e(t,n);if(!i.valid())throw new vh.InvalidInputException(i.constructor.name,t);var r=i.encode();r=(0,yh.default)(r);for(var o=0;o<r.length;o++)r[o].options=(0,Tr.default)(n,r[o].options);return r}function wh(){return Zi.default.CODE128?"CODE128":Object.keys(Zi.default)[0]}bi.prototype.options=function(t){return this._options=(0,Tr.default)(this._options,t),this};bi.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this};bi.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var t;for(var e in this._renderProperties){t=this._renderProperties[e];var n=(0,Tr.default)(this._options,t.options);n.format=="auto"&&(n.format=wh()),this._errorHandler.wrapBarcodeCall(function(){var i=n.value,r=Zi.default[n.format.toUpperCase()],o=_h(i,r,n);oc(t,o,n)})}}};bi.prototype.render=function(){if(!this._renderProperties)throw new vh.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)oc(this._renderProperties[t],this._encodings,this._options);else oc(this._renderProperties,this._encodings,this._options);return this};bi.prototype._defaults=bh.default;function oc(t,e,n){e=(0,yh.default)(e);for(var i=0;i<e.length;i++)e[i].options=(0,Tr.default)(n,e[i].options),(0,gh.default)(e[i].options);(0,gh.default)(n);var r=t.renderer,o=new r(t.element,e,n);o.render(),t.afterRender&&t.afterRender()}typeof window<"u"&&(window.JsBarcode=Ds);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),Ds(n,t,e)});xh.exports=Ds});var yf=M((sO,gf)=>{gf.exports=function(){var e={},n=e._fns={};e.emit=function(s,a,l,c,d,p,g){var h=i(s);h.length&&r(s,h,[a,l,c,d,p,g])},e.on=function(s,a){n[s]||(n[s]=[]),n[s].push(a)},e.once=function(s,a){function l(){a.apply(this,arguments),e.off(s,l)}this.on(s,l)},e.off=function(s,a){var l=[];if(s&&a){var c=this._fns[s],d=0,p=c?c.length:0;for(d;d<p;d++)c[d]!==a&&l.push(c[d])}l.length?this._fns[s]=l:delete this._fns[s]};function i(o){var s=n[o]?n[o]:[],a=o.indexOf(":"),l=a===-1?[o]:[o.substring(0,a),o.substring(a+1)],c=Object.keys(n),d=0,p=c.length;for(d;d<p;d++){var g=c[d];if(g==="*"&&(s=s.concat(n[g])),l.length===2&&l[0]===g){s=s.concat(n[g]);break}}return s}function r(o,s,a){var l=0,c=s.length;for(l;l<c&&s[l];l++)s[l].event=o,s[l].apply(s[l],a)}return e}});var js=M((lO,bf)=>{function eC(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}bf.exports=eC});var wf=M((cO,_f)=>{var tC=typeof global=="object"&&global&&global.Object===Object&&global;_f.exports=tC});var Pc=M((dO,xf)=>{var iC=wf(),nC=typeof self=="object"&&self&&self.Object===Object&&self,rC=iC||nC||Function("return this")();xf.exports=rC});var Sf=M((uO,Cf)=>{var oC=Pc(),sC=function(){return oC.Date.now()};Cf.exports=sC});var Ef=M((pO,Pf)=>{var aC=/\s/;function lC(t){for(var e=t.length;e--&&aC.test(t.charAt(e)););return e}Pf.exports=lC});var kf=M((hO,Df)=>{var cC=Ef(),dC=/^\s+/;function uC(t){return t&&t.slice(0,cC(t)+1).replace(dC,"")}Df.exports=uC});var Ec=M((fO,Tf)=>{var pC=Pc(),hC=pC.Symbol;Tf.exports=hC});var Rf=M((mO,Ff)=>{var If=Ec(),Of=Object.prototype,fC=Of.hasOwnProperty,mC=Of.toString,Hr=If?If.toStringTag:void 0;function gC(t){var e=fC.call(t,Hr),n=t[Hr];try{t[Hr]=void 0;var i=!0}catch{}var r=mC.call(t);return i&&(e?t[Hr]=n:delete t[Hr]),r}Ff.exports=gC});var Bf=M((gO,Mf)=>{var yC=Object.prototype,vC=yC.toString;function bC(t){return vC.call(t)}Mf.exports=bC});var Lf=M((yO,zf)=>{var Af=Ec(),_C=Rf(),wC=Bf(),xC="[object Null]",CC="[object Undefined]",Nf=Af?Af.toStringTag:void 0;function SC(t){return t==null?t===void 0?CC:xC:Nf&&Nf in Object(t)?_C(t):wC(t)}zf.exports=SC});var jf=M((vO,Hf)=>{function PC(t){return t!=null&&typeof t=="object"}Hf.exports=PC});var Uf=M((bO,Vf)=>{var EC=Lf(),DC=jf(),kC="[object Symbol]";function TC(t){return typeof t=="symbol"||DC(t)&&EC(t)==kC}Vf.exports=TC});var Gf=M((_O,qf)=>{var IC=kf(),Wf=js(),OC=Uf(),$f=NaN,FC=/^[-+]0x[0-9a-f]+$/i,RC=/^0b[01]+$/i,MC=/^0o[0-7]+$/i,BC=parseInt;function AC(t){if(typeof t=="number")return t;if(OC(t))return $f;if(Wf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Wf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=IC(t);var n=RC.test(t);return n||MC.test(t)?BC(t.slice(2),n?2:8):FC.test(t)?$f:+t}qf.exports=AC});var kc=M((wO,Yf)=>{var NC=js(),Dc=Sf(),Xf=Gf(),zC="Expected a function",LC=Math.max,HC=Math.min;function jC(t,e,n){var i,r,o,s,a,l,c=0,d=!1,p=!1,g=!0;if(typeof t!="function")throw new TypeError(zC);e=Xf(e)||0,NC(n)&&(d=!!n.leading,p="maxWait"in n,o=p?LC(Xf(n.maxWait)||0,e):o,g="trailing"in n?!!n.trailing:g);function h(_){var x=i,P=r;return i=r=void 0,c=_,s=t.apply(P,x),s}function v(_){return c=_,a=setTimeout(I,e),d?h(_):s}function C(_){var x=_-l,P=_-c,T=e-x;return p?HC(T,o-P):T}function R(_){var x=_-l,P=_-c;return l===void 0||x>=e||x<0||p&&P>=o}function I(){var _=Dc();if(R(_))return N(_);a=setTimeout(I,C(_))}function N(_){return a=void 0,g&&i?h(_):(i=r=void 0,s)}function Q(){a!==void 0&&clearTimeout(a),c=0,i=l=r=a=void 0}function U(){return a===void 0?s:N(Dc())}function Y(){var _=Dc(),x=R(_);if(i=arguments,r=this,l=_,x){if(a===void 0)return v(l);if(p)return clearTimeout(a),a=setTimeout(I,e),h(l)}return a===void 0&&(a=setTimeout(I,e)),s}return Y.cancel=Q,Y.flush=U,Y}Yf.exports=jC});var Qf=M((xO,Kf)=>{var VC=kc(),UC=js(),WC="Expected a function";function $C(t,e,n){var i=!0,r=!0;if(typeof t!="function")throw new TypeError(WC);return UC(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),VC(t,e,{leading:i,maxWait:e,trailing:r})}Kf.exports=$C});var $s=M((zO,rm)=>{"use strict";rm.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let n=e<0,i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(n&&(e=-e),e<1)return`${(n?"-":"")+e} B`;let r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1);e=Number(e/1024**r);let o=i[r];return e>=10||e%1===0?`${(n?"-":"")+e.toFixed(0)} ${o}`:`${(n?"-":"")+e.toFixed(1)} ${o}`}});var am=M((LO,sm)=>{"use strict";function om(t,e){this.text=t=t||"",this.hasWild=~t.indexOf("*"),this.separator=e,this.parts=t.split(e)}om.prototype.match=function(t){var e=!0,n=this.parts,i,r=n.length,o;if(typeof t=="string"||t instanceof String)if(!this.hasWild&&this.text!=t)e=!1;else{for(o=(t||"").split(this.separator),i=0;e&&i<r;i++)n[i]!=="*"&&(i<o.length?e=n[i]===o[i]:e=!1);e=e&&o}else if(typeof t.splice=="function")for(e=[],i=t.length;i--;)this.match(t[i])&&(e[e.length]=t[i]);else if(typeof t=="object"){e={};for(var s in t)this.match(s)&&(e[s]=t[s])}return e};sm.exports=function(t,e,n){var i=new om(t,n||/[\/\.]/);return typeof e<"u"?i.match(e):i}});var cm=M((HO,lm)=>{var QC=am(),ZC=/[\/\+\.]/;lm.exports=function(t,e){function n(i){var r=QC(i,t,ZC);return r&&r.length>=2}return e?n(e.split(";")[0]):n}});var dt=M((_3,ia)=>{(function(){"use strict";var t={}.hasOwnProperty;function e(){for(var r="",o=0;o<arguments.length;o++){var s=arguments[o];s&&(r=i(r,n(s)))}return r}function n(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return e.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var s in r)t.call(r,s)&&r[s]&&(o=i(o,s));return o}function i(r,o){return o?r?r+" "+o:r+o:r}typeof ia<"u"&&ia.exports?(e.default=e,ia.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Tg=M((P5,Fd)=>{"use strict";var PP=Object.prototype.hasOwnProperty,pt="~";function vo(){}Object.create&&(vo.prototype=Object.create(null),new vo().__proto__||(pt=!1));function EP(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function kg(t,e,n,i,r){if(typeof n!="function")throw new TypeError("The listener must be a function");var o=new EP(n,i||t,r),s=pt?pt+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],o]:t._events[s].push(o):(t._events[s]=o,t._eventsCount++),t}function _a(t,e){--t._eventsCount===0?t._events=new vo:delete t._events[e]}function ot(){this._events=new vo,this._eventsCount=0}ot.prototype.eventNames=function(){var e=[],n,i;if(this._eventsCount===0)return e;for(i in n=this._events)PP.call(n,i)&&e.push(pt?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(n)):e};ot.prototype.listeners=function(e){var n=pt?pt+e:e,i=this._events[n];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s};ot.prototype.listenerCount=function(e){var n=pt?pt+e:e,i=this._events[n];return i?i.fn?1:i.length:0};ot.prototype.emit=function(e,n,i,r,o,s){var a=pt?pt+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,d,p;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,n),!0;case 3:return l.fn.call(l.context,n,i),!0;case 4:return l.fn.call(l.context,n,i,r),!0;case 5:return l.fn.call(l.context,n,i,r,o),!0;case 6:return l.fn.call(l.context,n,i,r,o,s),!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 g=l.length,h;for(p=0;p<g;p++)switch(l[p].once&&this.removeListener(e,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,n);break;case 3:l[p].fn.call(l[p].context,n,i);break;case 4:l[p].fn.call(l[p].context,n,i,r);break;default:if(!d)for(h=1,d=new Array(c-1);h<c;h++)d[h-1]=arguments[h];l[p].fn.apply(l[p].context,d)}}return!0};ot.prototype.on=function(e,n,i){return kg(this,e,n,i,!1)};ot.prototype.once=function(e,n,i){return kg(this,e,n,i,!0)};ot.prototype.removeListener=function(e,n,i,r){var o=pt?pt+e:e;if(!this._events[o])return this;if(!n)return _a(this,o),this;var s=this._events[o];if(s.fn)s.fn===n&&(!r||s.once)&&(!i||s.context===i)&&_a(this,o);else{for(var a=0,l=[],c=s.length;a<c;a++)(s[a].fn!==n||r&&!s[a].once||i&&s[a].context!==i)&&l.push(s[a]);l.length?this._events[o]=l.length===1?l[0]:l:_a(this,o)}return this};ot.prototype.removeAllListeners=function(e){var n;return e?(n=pt?pt+e:e,this._events[n]&&_a(this,n)):(this._events=new vo,this._eventsCount=0),this};ot.prototype.off=ot.prototype.removeListener;ot.prototype.addListener=ot.prototype.on;ot.prefixed=pt;ot.EventEmitter=ot;typeof Fd<"u"&&(Fd.exports=ot)});var v0=M((cu,du)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof du=="object"&&typeof cu<"u"?du.exports=e():t.Papa=e()})(cu,function t(){"use strict";var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},n=!e.document&&!!e.postMessage,i=e.IS_PAPA_WORKER||!1,r={},o=0,s={parse:function(_,x){var P=(x=x||{}).dynamicTyping||!1;if(Y(P)&&(x.dynamicTypingFunction=P,P={}),x.dynamicTyping=P,x.transform=!!Y(x.transform)&&x.transform,x.worker&&s.WORKERS_SUPPORTED){var T=function(){if(!s.WORKERS_SUPPORTED)return!1;var V=(Pe=e.URL||e.webkitURL||null,he=t.toString(),s.BLOB_URL||(s.BLOB_URL=Pe.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; ","(",he,")();"],{type:"text/javascript"})))),Z=new e.Worker(V),Pe,he;return Z.onmessage=R,Z.id=o++,r[Z.id]=Z}();return T.userStep=x.step,T.userChunk=x.chunk,T.userComplete=x.complete,T.userError=x.error,x.step=Y(x.step),x.chunk=Y(x.chunk),x.complete=Y(x.complete),x.error=Y(x.error),delete x.worker,void T.postMessage({input:_,config:x,workerId:T.id})}var B=null;return s.NODE_STREAM_INPUT,typeof _=="string"?(_=function(V){return V.charCodeAt(0)===65279?V.slice(1):V}(_),B=x.download?new c(x):new p(x)):_.readable===!0&&Y(_.read)&&Y(_.on)?B=new g(x):(e.File&&_ instanceof File||_ instanceof Object)&&(B=new d(x)),B.stream(_)},unparse:function(_,x){var P=!1,T=!0,B=",",V=`\r
|
|
2
|
-
`,Z='"',Pe=Z+Z,
|
|
3
|
-
`,'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!n&&!!e.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=C,s.ParserHandle=h,s.NetworkStreamer=c,s.FileStreamer=d,s.StringStreamer=p,s.ReadableStreamStreamer=g,e.jQuery){var a=e.jQuery;a.fn.parse=function(_){var x=_.config||{},P=[];return this.each(function(V){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length===0)return!0;for(var Z=0;Z<this.files.length;Z++)P.push({file:this.files[Z],inputElem:this,instanceConfig:a.extend({},x)})}),T(),this;function T(){if(P.length!==0){var V,Z,Pe,
|
|
4
|
-
`),mi=1<
|
|
1
|
+
import{A as fs,B as ip,C as np,D as nl,E as rp,F as op,a as Qo,c as ds,d as yr,e as Qa,f as qu,g as Gu,h as vi,i as Xu,j as vr,k as Za,l as Ja,m as Ie,n as Yu,o as us,p as ce,q as ps,r as Ku,s as Qu,t as tl,u as hs,v as Zu,w as il,x as Ju,y as ep,z as tp}from"./chunk-TQSC5F5R.js";import{a as ms,b as li,c as Wt}from"./chunk-ZXSD3XOK.js";import{$ as $u,B as Ke,C as yt,D as ts,E as is,F as ns,G as Ni,H as nt,I as Qe,J as qe,K as rt,L as Fn,M as rs,N as os,O as ss,P as as,Q as ls,R as cs,T as Lu,U as Hu,V as ju,W as Vu,X as Uu,Y as Rn,Z as Wu,a as si,aa as ai,b as Ru,c as Mu,fa as el,l as Ko,n as In,q as Ya,r as Jo,u as zu,v as On,w as Xe,x as Je,y as Ye,z as es}from"./chunk-XY3HB2QF.js";import{$b as mr,Aa as pr,Ab as hr,Ac as xe,Ad as Bu,Bd as Zo,Ca as J,Cb as Pu,Cd as Au,Da as I,Eb as jo,Ec as Te,Ed as gr,F as $e,Fc as Vt,Fd as Nu,G as mu,Gb as gt,Gc as yi,Ha as ee,Hb as Eu,Hc as Ga,Hd as Ka,Ia as Ct,Ib as Vo,Ic as te,Ja as Ki,Jb as Uo,K as ii,Ka as Lo,L as ni,Lb as H,M as gu,Mb as Ua,Oa as xu,Ob as fr,Pc as Du,Q as yu,R as ur,Ra as ri,Rb as K,Rc as Qi,S as Xi,Sa as q,Sb as St,Ta as G,Tb as S,U as Yi,Uc as Bi,V as At,Vb as En,Wa as Be,Wb as Wo,Xc as ku,Ya as Ae,Yc as Xa,Z as Aa,Za as Va,Zb as oe,_ as vu,_a as mt,_b as $o,a as b,ab as st,ac as Nt,b as E,ba as bu,bc as zt,c as Sn,cc as f,cd as at,d as M,da as Na,dc as m,e as ge,ec as X,fa as _u,fc as Wa,ga as za,gb as Cu,gc as $a,hd as Xo,ic as pe,j as F,jd as Ai,k as Pn,l as Ao,lc as A,ld as Tn,m as No,mc as k,md as Tu,n as zo,nc as Dn,o as Ri,oa as La,oc as kn,od as Iu,pd as Ou,q as ft,qa as Ha,qc as qo,qd as Yo,ra as Mi,rc as oi,rd as Fu,sa as ja,sc as Lt,sd as Ut,t as Ge,ta as re,tb as Ho,tc as Ht,uc as qa,vb as Su,vc as w,wa as wu,wc as D,xa as ke,xb as y,xc as jt,ya as xt,yb as Se,yc as Go,zc as ie}from"./chunk-PLQP4Q76.js";var Pt=M(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});function j0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var V0=function t(e,n){j0(this,t),this.data=e,this.text=n.text||e,this.options=n};rl.default=V0});var lp=M(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.CODE39=void 0;var U0=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),W0=Pt(),$0=q0(W0);function q0(t){return t&&t.__esModule?t:{default:t}}function G0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function X0(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Y0(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var K0=function(t){Y0(e,t);function e(n,i){return G0(this,e),n=n.toUpperCase(),i.mod43&&(n+=J0(ey(n))),X0(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return U0(e,[{key:"encode",value:function(){for(var i=ol("*"),r=0;r<this.data.length;r++)i+=ol(this.data[r])+"0";return i+=ol("*"),{data:i,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}($0.default),sp=["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","-","."," ","$","/","+","%","*"],Q0=[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 ol(t){return Z0(ap(t))}function Z0(t){return Q0[t].toString(2)}function J0(t){return sp[t]}function ap(t){return sp.indexOf(t)}function ey(t){for(var e=0,n=0;n<t.length;n++)e+=ap(t[n]);return e=e%43,e}gs.CODE39=K0});var Mn=M(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});var br;function sl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cp=Oe.SET_A=0,dp=Oe.SET_B=1,up=Oe.SET_C=2,dD=Oe.SHIFT=98,ty=Oe.START_A=103,iy=Oe.START_B=104,ny=Oe.START_C=105,uD=Oe.MODULO=103,pD=Oe.STOP=106,hD=Oe.FNC1=207,fD=Oe.SET_BY_CODE=(br={},sl(br,ty,cp),sl(br,iy,dp),sl(br,ny,up),br),mD=Oe.SWAP={101:cp,100:dp,99:up},gD=Oe.A_START_CHAR="\xD0",yD=Oe.B_START_CHAR="\xD1",vD=Oe.C_START_CHAR="\xD2",bD=Oe.A_CHARS="[\0-_\xC8-\xCF]",_D=Oe.B_CHARS="[ -\x7F\xC8-\xCF]",wD=Oe.C_CHARS="(\xCF*[0-9]{2}\xCF*)",xD=Oe.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 _r=M(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});var ry=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),oy=Pt(),sy=ay(oy),Et=Mn();function ay(t){return t&&t.__esModule?t:{default:t}}function ly(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cy(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function dy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var uy=function(t){dy(e,t);function e(n,i){ly(this,e);var r=cy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n.substring(1),i));return r.bytes=n.split("").map(function(o){return o.charCodeAt(0)}),r}return ry(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var i=this.bytes,r=i.shift()-105,o=Et.SET_BY_CODE[r];if(o===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&i.unshift(Et.FNC1);var s=e.next(i,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(r)+s.result+e.getBar((s.checksum+r)%Et.MODULO)+e.getBar(Et.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var i=this.options.ean128||!1;return typeof i=="string"&&(i=i.toLowerCase()==="true"),i}}],[{key:"getBar",value:function(i){return Et.BARS[i]?Et.BARS[i].toString():""}},{key:"correctIndex",value:function(i,r){if(r===Et.SET_A){var o=i.shift();return o<32?o+64:o-32}else return r===Et.SET_B?i.shift()-32:(i.shift()-48)*10+i.shift()-48}},{key:"next",value:function(i,r,o){if(!i.length)return{result:"",checksum:0};var s=void 0,a=void 0;if(i[0]>=200){a=i.shift()-105;var l=Et.SWAP[a];l!==void 0?s=e.next(i,r+1,l):((o===Et.SET_A||o===Et.SET_B)&&a===Et.SHIFT&&(i[0]=o===Et.SET_A?i[0]>95?i[0]-96:i[0]:i[0]<32?i[0]+96:i[0]),s=e.next(i,r+1,o))}else a=e.correctIndex(i,o),s=e.next(i,r+1,o);var c=e.getBar(a),d=a*r;return{result:c+s.result,checksum:d+s.checksum}}}]),e}(sy.default);al.default=uy});var gp=M(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});var zi=Mn(),pp=function(e){return e.match(new RegExp("^"+zi.A_CHARS+"*"))[0].length},hp=function(e){return e.match(new RegExp("^"+zi.B_CHARS+"*"))[0].length},fp=function(e){return e.match(new RegExp("^"+zi.C_CHARS+"*"))[0]};function ll(t,e){var n=e?zi.A_CHARS:zi.B_CHARS,i=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(i)return i[1]+"\xCC"+mp(t.substring(i[1].length));var r=t.match(new RegExp("^"+n+"+"))[0];return r.length===t.length?t:r+String.fromCharCode(e?205:206)+ll(t.substring(r.length),!e)}function mp(t){var e=fp(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var i=pp(t)>=hp(t);return e+String.fromCharCode(i?206:205)+ll(t,i)}cl.default=function(t){var e=void 0,n=fp(t).length;if(n>=2)e=zi.C_START_CHAR+mp(t);else{var i=pp(t)>hp(t);e=(i?zi.A_START_CHAR:zi.B_START_CHAR)+ll(t,i)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(r,o){return"\xCB"+o})}});var vp=M(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var py=_r(),hy=yp(py),fy=gp(),my=yp(fy);function yp(t){return t&&t.__esModule?t:{default:t}}function gy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dl(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function yy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var vy=function(t){yy(e,t);function e(n,i){if(gy(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(n))var r=dl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,my.default)(n),i));else var r=dl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return dl(r)}return e}(hy.default);ul.default=vy});var _p=M(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});var by=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),_y=_r(),wy=xy(_y),bp=Mn();function xy(t){return t&&t.__esModule?t:{default:t}}function Cy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sy(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Py(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ey=function(t){Py(e,t);function e(n,i){return Cy(this,e),Sy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,bp.A_START_CHAR+n,i))}return by(e,[{key:"valid",value:function(){return new RegExp("^"+bp.A_CHARS+"+$").test(this.data)}}]),e}(wy.default);pl.default=Ey});var xp=M(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});var Dy=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),ky=_r(),Ty=Iy(ky),wp=Mn();function Iy(t){return t&&t.__esModule?t:{default:t}}function Oy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Fy(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Ry(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var My=function(t){Ry(e,t);function e(n,i){return Oy(this,e),Fy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,wp.B_START_CHAR+n,i))}return Dy(e,[{key:"valid",value:function(){return new RegExp("^"+wp.B_CHARS+"+$").test(this.data)}}]),e}(Ty.default);hl.default=My});var Sp=M(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});var By=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Ay=_r(),Ny=zy(Ay),Cp=Mn();function zy(t){return t&&t.__esModule?t:{default:t}}function Ly(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hy(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function jy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Vy=function(t){jy(e,t);function e(n,i){return Ly(this,e),Hy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,Cp.C_START_CHAR+n,i))}return By(e,[{key:"valid",value:function(){return new RegExp("^"+Cp.C_CHARS+"+$").test(this.data)}}]),e}(Ny.default);fl.default=Vy});var Pp=M(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.CODE128C=ci.CODE128B=ci.CODE128A=ci.CODE128=void 0;var Uy=vp(),Wy=ys(Uy),$y=_p(),qy=ys($y),Gy=xp(),Xy=ys(Gy),Yy=Sp(),Ky=ys(Yy);function ys(t){return t&&t.__esModule?t:{default:t}}ci.CODE128=Wy.default;ci.CODE128A=qy.default;ci.CODE128B=Xy.default;ci.CODE128C=Ky.default});var Bn=M(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});var OD=Li.SIDE_BIN="101",FD=Li.MIDDLE_BIN="01010",RD=Li.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"]},MD=Li.EAN2_STRUCTURE=["LL","LG","GL","GG"],BD=Li.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],AD=Li.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]});var An=M(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});var Qy=Bn(),Zy=function(e,n,i){var r=e.split("").map(function(s,a){return Qy.BINARIES[n[a]]}).map(function(s,a){return s?s[e[a]]:""});if(i){var o=e.length-1;r=r.map(function(s,a){return a<o?s+i:s})}return r.join("")};ml.default=Zy});var yl=M(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});var Jy=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Nn=Bn(),ev=An(),Ep=Dp(ev),tv=Pt(),iv=Dp(tv);function Dp(t){return t&&t.__esModule?t:{default:t}}function nv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ov(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var sv=function(t){ov(e,t);function e(n,i){nv(this,e);var r=rv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return r.fontSize=!i.flat&&i.fontSize>i.width*10?i.width*10:i.fontSize,r.guardHeight=i.height+r.fontSize/2+i.textMargin,r}return Jy(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(i,r){return this.text.substr(i,r)}},{key:"leftEncode",value:function(i,r){return(0,Ep.default)(i,r)}},{key:"rightText",value:function(i,r){return this.text.substr(i,r)}},{key:"rightEncode",value:function(i,r){return(0,Ep.default)(i,r)}},{key:"encodeGuarded",value:function(){var i={fontSize:this.fontSize},r={height:this.guardHeight};return[{data:Nn.SIDE_BIN,options:r},{data:this.leftEncode(),text:this.leftText(),options:i},{data:Nn.MIDDLE_BIN,options:r},{data:this.rightEncode(),text:this.rightText(),options:i},{data:Nn.SIDE_BIN,options:r}]}},{key:"encodeFlat",value:function(){var i=[Nn.SIDE_BIN,this.leftEncode(),Nn.MIDDLE_BIN,this.rightEncode(),Nn.SIDE_BIN];return{data:i.join(""),text:this.text}}}]),e}(iv.default);gl.default=sv});var Tp=M(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});var av=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),wr=function t(e,n,i){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:t(o,n,i)}else{if("value"in r)return r.value;var s=r.get;return s===void 0?void 0:s.call(i)}},lv=Bn(),cv=yl(),dv=uv(cv);function uv(t){return t&&t.__esModule?t:{default:t}}function pv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function fv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var kp=function(e){var n=e.substr(0,12).split("").map(function(i){return+i}).reduce(function(i,r,o){return o%2?i+r*3:i+r},0);return(10-n%10)%10},mv=function(t){fv(e,t);function e(n,i){pv(this,e),n.search(/^[0-9]{12}$/)!==-1&&(n+=kp(n));var r=hv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return r.lastChar=i.lastChar,r}return av(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===kp(this.data)}},{key:"leftText",value:function(){return wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var i=this.data.substr(1,6),r=lv.EAN13_STRUCTURE[this.data[0]];return wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,i,r)}},{key:"rightText",value:function(){return wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var i=this.data.substr(7,6);return wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,i,"RRRRRR")}},{key:"encodeGuarded",value:function(){var i=wr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(i.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(i.push({data:"00"}),i.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),i}}]),e}(dv.default);vl.default=mv});var Op=M(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});var gv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),vs=function t(e,n,i){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,n);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:t(o,n,i)}else{if("value"in r)return r.value;var s=r.get;return s===void 0?void 0:s.call(i)}},yv=yl(),vv=bv(yv);function bv(t){return t&&t.__esModule?t:{default:t}}function _v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function xv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ip=function(e){var n=e.substr(0,7).split("").map(function(i){return+i}).reduce(function(i,r,o){return o%2?i+r:i+r*3},0);return(10-n%10)%10},Cv=function(t){xv(e,t);function e(n,i){return _v(this,e),n.search(/^[0-9]{7}$/)!==-1&&(n+=Ip(n)),wv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return gv(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===Ip(this.data)}},{key:"leftText",value:function(){return vs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var i=this.data.substr(0,4);return vs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,i,"LLLL")}},{key:"rightText",value:function(){return vs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var i=this.data.substr(4,4);return vs(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,i,"RRRR")}}]),e}(vv.default);bl.default=Cv});var Rp=M(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});var Sv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Pv=Bn(),Ev=An(),Dv=Fp(Ev),kv=Pt(),Tv=Fp(kv);function Fp(t){return t&&t.__esModule?t:{default:t}}function Iv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ov(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Fv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Rv=function(e){var n=e.split("").map(function(i){return+i}).reduce(function(i,r,o){return o%2?i+r*9:i+r*3},0);return n%10},Mv=function(t){Fv(e,t);function e(n,i){return Iv(this,e),Ov(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return Sv(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var i=Pv.EAN5_STRUCTURE[Rv(this.data)];return{data:"1011"+(0,Dv.default)(this.data,i,"01"),text:this.text}}}]),e}(Tv.default);_l.default=Mv});var Bp=M(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var Bv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Av=Bn(),Nv=An(),zv=Mp(Nv),Lv=Pt(),Hv=Mp(Lv);function Mp(t){return t&&t.__esModule?t:{default:t}}function jv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Uv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Wv=function(t){Uv(e,t);function e(n,i){return jv(this,e),Vv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return Bv(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var i=Av.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,zv.default)(this.data,i,"01"),text:this.text}}}]),e}(Hv.default);wl.default=Wv});var Cl=M(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});var $v=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();bs.checksum=xl;var qv=An(),zn=Ap(qv),Gv=Pt(),Xv=Ap(Gv);function Ap(t){return t&&t.__esModule?t:{default:t}}function Yv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kv(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Qv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Zv=function(t){Qv(e,t);function e(n,i){Yv(this,e),n.search(/^[0-9]{11}$/)!==-1&&(n+=xl(n));var r=Kv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return r.displayValue=i.displayValue,i.fontSize>i.width*10?r.fontSize=i.width*10:r.fontSize=i.fontSize,r.guardHeight=i.height+r.fontSize/2+i.textMargin,r}return $v(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==xl(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var i="";return i+="101",i+=(0,zn.default)(this.data.substr(0,6),"LLLLLL"),i+="01010",i+=(0,zn.default)(this.data.substr(6,6),"RRRRRR"),i+="101",{data:i,text:this.text}}},{key:"guardedEncoding",value:function(){var i=[];return this.displayValue&&i.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),i.push({data:"101"+(0,zn.default)(this.data[0],"L"),options:{height:this.guardHeight}}),i.push({data:(0,zn.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),i.push({data:"01010",options:{height:this.guardHeight}}),i.push({data:(0,zn.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),i.push({data:(0,zn.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&i.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),i}}]),e}(Xv.default);function xl(t){var e=0,n;for(n=1;n<11;n+=2)e+=parseInt(t[n]);for(n=0;n<11;n+=2)e+=parseInt(t[n])*3;return(10-e%10)%10}bs.default=Zv});var Lp=M(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var Jv=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),eb=An(),tb=zp(eb),ib=Pt(),nb=zp(ib),rb=Cl();function zp(t){return t&&t.__esModule?t:{default:t}}function ob(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sl(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function sb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ab=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],lb=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],cb=function(t){sb(e,t);function e(n,i){ob(this,e);var r=Sl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));if(r.isValid=!1,n.search(/^[0-9]{6}$/)!==-1)r.middleDigits=n,r.upcA=Np(n,"0"),r.text=i.text||""+r.upcA[0]+n+r.upcA[r.upcA.length-1],r.isValid=!0;else if(n.search(/^[01][0-9]{7}$/)!==-1)if(r.middleDigits=n.substring(1,n.length-1),r.upcA=Np(r.middleDigits,n[0]),r.upcA[r.upcA.length-1]===n[n.length-1])r.isValid=!0;else return Sl(r);else return Sl(r);return r.displayValue=i.displayValue,i.fontSize>i.width*10?r.fontSize=i.width*10:r.fontSize=i.fontSize,r.guardHeight=i.height+r.fontSize/2+i.textMargin,r}return Jv(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var i="";return i+="101",i+=this.encodeMiddleDigits(),i+="010101",{data:i,text:this.text}}},{key:"guardedEncoding",value:function(){var i=[];return this.displayValue&&i.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),i.push({data:"101",options:{height:this.guardHeight}}),i.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),i.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&i.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),i}},{key:"encodeMiddleDigits",value:function(){var i=this.upcA[0],r=this.upcA[this.upcA.length-1],o=lb[parseInt(r)][parseInt(i)];return(0,tb.default)(this.middleDigits,o)}}]),e}(nb.default);function Np(t,e){for(var n=parseInt(t[t.length-1]),i=ab[n],r="",o=0,s=0;s<i.length;s++){var a=i[s];a==="X"?r+=t[o++]:r+=a}return r=""+e+r,""+r+(0,rb.checksum)(r)}Pl.default=cb});var Hp=M(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.UPCE=vt.UPC=vt.EAN2=vt.EAN5=vt.EAN8=vt.EAN13=void 0;var db=Tp(),ub=Ln(db),pb=Op(),hb=Ln(pb),fb=Rp(),mb=Ln(fb),gb=Bp(),yb=Ln(gb),vb=Cl(),bb=Ln(vb),_b=Lp(),wb=Ln(_b);function Ln(t){return t&&t.__esModule?t:{default:t}}vt.EAN13=ub.default;vt.EAN8=hb.default;vt.EAN5=mb.default;vt.EAN2=yb.default;vt.UPC=bb.default;vt.UPCE=wb.default});var jp=M(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});var GD=xr.START_BIN="1010",XD=xr.END_BIN="11101",YD=xr.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]});var Dl=M(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});var xb=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),_s=jp(),Cb=Pt(),Sb=Pb(Cb);function Pb(t){return t&&t.__esModule?t:{default:t}}function Eb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Db(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function kb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Tb=function(t){kb(e,t);function e(){return Eb(this,e),Db(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return xb(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var i=this,r=this.data.match(/.{2}/g).map(function(o){return i.encodePair(o)}).join("");return{data:_s.START_BIN+r+_s.END_BIN,text:this.text}}},{key:"encodePair",value:function(i){var r=_s.BINARIES[i[1]];return _s.BINARIES[i[0]].split("").map(function(o,s){return(o==="1"?"111":"1")+(r[s]==="1"?"000":"0")}).join("")}}]),e}(Sb.default);El.default=Tb});var Up=M(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});var Ib=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Ob=Dl(),Fb=Rb(Ob);function Rb(t){return t&&t.__esModule?t:{default:t}}function Mb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bb(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Ab(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Vp=function(e){var n=e.substr(0,13).split("").map(function(i){return parseInt(i,10)}).reduce(function(i,r,o){return i+r*(3-o%2*2)},0);return Math.ceil(n/10)*10-n},Nb=function(t){Ab(e,t);function e(n,i){return Mb(this,e),n.search(/^[0-9]{13}$/)!==-1&&(n+=Vp(n)),Bb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return Ib(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===Vp(this.data)}}]),e}(Fb.default);kl.default=Nb});var $p=M(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.ITF14=Hn.ITF=void 0;var zb=Dl(),Lb=Wp(zb),Hb=Up(),jb=Wp(Hb);function Wp(t){return t&&t.__esModule?t:{default:t}}Hn.ITF=Lb.default;Hn.ITF14=jb.default});var jn=M(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});var Vb=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),Ub=Pt(),Wb=$b(Ub);function $b(t){return t&&t.__esModule?t:{default:t}}function qb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gb(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Xb(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Yb=function(t){Xb(e,t);function e(n,i){return qb(this,e),Gb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return Vb(e,[{key:"encode",value:function(){for(var i="110",r=0;r<this.data.length;r++){var o=parseInt(this.data[r]),s=o.toString(2);s=Kb(s,4-s.length);for(var a=0;a<s.length;a++)i+=s[a]=="0"?"100":"110"}return i+="1001",{data:i,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(Wb.default);function Kb(t,e){for(var n=0;n<e;n++)t="0"+t;return t}Tl.default=Yb});var Cr=M(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.mod10=Qb;ws.mod11=Zb;function Qb(t){for(var e=0,n=0;n<t.length;n++){var i=parseInt(t[n]);(n+t.length)%2===0?e+=i:e+=i*2%10+Math.floor(i*2/10)}return(10-e%10)%10}function Zb(t){for(var e=0,n=[2,3,4,5,6,7],i=0;i<t.length;i++){var r=parseInt(t[t.length-1-i]);e+=n[i%n.length]*r}return(11-e%11)%11}});var qp=M(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});var Jb=jn(),e1=i1(Jb),t1=Cr();function i1(t){return t&&t.__esModule?t:{default:t}}function n1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function o1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s1=function(t){o1(e,t);function e(n,i){return n1(this,e),r1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n+(0,t1.mod10)(n),i))}return e}(e1.default);Il.default=s1});var Gp=M(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});var a1=jn(),l1=d1(a1),c1=Cr();function d1(t){return t&&t.__esModule?t:{default:t}}function u1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function h1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var f1=function(t){h1(e,t);function e(n,i){return u1(this,e),p1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n+(0,c1.mod11)(n),i))}return e}(l1.default);Ol.default=f1});var Yp=M(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});var m1=jn(),g1=y1(m1),Xp=Cr();function y1(t){return t&&t.__esModule?t:{default:t}}function v1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function _1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var w1=function(t){_1(e,t);function e(n,i){return v1(this,e),n+=(0,Xp.mod10)(n),n+=(0,Xp.mod10)(n),b1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return e}(g1.default);Fl.default=w1});var Qp=M(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});var x1=jn(),C1=S1(x1),Kp=Cr();function S1(t){return t&&t.__esModule?t:{default:t}}function P1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function D1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var k1=function(t){D1(e,t);function e(n,i){return P1(this,e),n+=(0,Kp.mod11)(n),n+=(0,Kp.mod10)(n),E1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return e}(C1.default);Rl.default=k1});var Zp=M($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.MSI1110=$t.MSI1010=$t.MSI11=$t.MSI10=$t.MSI=void 0;var T1=jn(),I1=Sr(T1),O1=qp(),F1=Sr(O1),R1=Gp(),M1=Sr(R1),B1=Yp(),A1=Sr(B1),N1=Qp(),z1=Sr(N1);function Sr(t){return t&&t.__esModule?t:{default:t}}$t.MSI=I1.default;$t.MSI10=F1.default;$t.MSI11=M1.default;$t.MSI1010=A1.default;$t.MSI1110=z1.default});var Jp=M(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.pharmacode=void 0;var L1=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),H1=Pt(),j1=V1(H1);function V1(t){return t&&t.__esModule?t:{default:t}}function U1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function $1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var q1=function(t){$1(e,t);function e(n,i){U1(this,e);var r=W1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i));return r.number=parseInt(n,10),r}return L1(e,[{key:"encode",value:function(){for(var i=this.number,r="";!isNaN(i)&&i!=0;)i%2===0?(r="11100"+r,i=(i-2)/2):(r="100"+r,i=(i-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(j1.default);xs.pharmacode=q1});var eh=M(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.codabar=void 0;var G1=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),X1=Pt(),Y1=K1(X1);function K1(t){return t&&t.__esModule?t:{default:t}}function Q1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Z1(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function J1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var e_=function(t){J1(e,t);function e(n,i){Q1(this,e),n.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(n="A"+n+"A");var r=Z1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n.toUpperCase(),i));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return G1(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var i=[],r=this.getEncodings(),o=0;o<this.data.length;o++)i.push(r[this.data.charAt(o)]),o!==this.data.length-1&&i.push("0");return{text:this.text,data:i.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"}}}]),e}(Y1.default);Cs.codabar=e_});var th=M(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.GenericBarcode=void 0;var t_=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),i_=Pt(),n_=r_(i_);function r_(t){return t&&t.__esModule?t:{default:t}}function o_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s_(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function a_(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var l_=function(t){a_(e,t);function e(n,i){return o_(this,e),s_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,n,i))}return t_(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(n_.default);Ss.GenericBarcode=l_});var nh=M(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var c_=lp(),Ps=Pp(),Vn=Hp(),ih=$p(),Pr=Zp(),d_=Jp(),u_=eh(),p_=th();Ml.default={CODE39:c_.CODE39,CODE128:Ps.CODE128,CODE128A:Ps.CODE128A,CODE128B:Ps.CODE128B,CODE128C:Ps.CODE128C,EAN13:Vn.EAN13,EAN8:Vn.EAN8,EAN5:Vn.EAN5,EAN2:Vn.EAN2,UPC:Vn.UPC,UPCE:Vn.UPCE,ITF14:ih.ITF14,ITF:ih.ITF,MSI:Pr.MSI,MSI10:Pr.MSI10,MSI11:Pr.MSI11,MSI1010:Pr.MSI1010,MSI1110:Pr.MSI1110,pharmacode:d_.pharmacode,codabar:u_.codabar,GenericBarcode:p_.GenericBarcode}});var Er=M(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});var h_=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};Bl.default=function(t,e){return h_({},t,e)}});var rh=M(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.default=f_;function f_(t){var e=[];function n(i){if(Array.isArray(i))for(var r=0;r<i.length;r++)n(i[r]);else i.text=i.text||"",i.data=i.data||"",e.push(i)}return n(t),e}});var oh=M(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.default=m_;function m_(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}});var Ll=M(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.default=g_;function g_(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&(n=e[n],typeof t[n]=="string"&&(t[n]=parseInt(t[n],10)));return typeof t.displayValue=="string"&&(t.displayValue=t.displayValue!="false"),t}});var jl=M(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var y_={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(){}};Hl.default=y_});var lh=M(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var v_=Ll(),b_=ah(v_),__=jl(),sh=ah(__);function ah(t){return t&&t.__esModule?t:{default:t}}function w_(t){var e={};for(var n in sh.default)sh.default.hasOwnProperty(n)&&(t.hasAttribute("jsbarcode-"+n.toLowerCase())&&(e[n]=t.getAttribute("jsbarcode-"+n.toLowerCase())),t.hasAttribute("data-"+n.toLowerCase())&&(e[n]=t.getAttribute("data-"+n.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0,b_.default)(e),e}Vl.default=w_});var Ul=M(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.getTotalWidthOfEncodings=qt.calculateEncodingAttributes=qt.getBarcodePadding=qt.getEncodingHeight=qt.getMaximumHeightOfEncodings=void 0;var x_=Er(),C_=S_(x_);function S_(t){return t&&t.__esModule?t:{default:t}}function ch(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function dh(t,e,n){if(n.displayValue&&e<t){if(n.textAlign=="center")return Math.floor((t-e)/2);if(n.textAlign=="left")return 0;if(n.textAlign=="right")return Math.floor(t-e)}return 0}function P_(t,e,n){for(var i=0;i<t.length;i++){var r=t[i],o=(0,C_.default)(e,r.options),s;o.displayValue?s=k_(r.text,o,n):s=0;var a=r.data.length*o.width;r.width=Math.ceil(Math.max(s,a)),r.height=ch(r,o),r.barcodePadding=dh(s,a,o)}}function E_(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e}function D_(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e}function k_(t,e,n){var i;if(n)i=n;else if(typeof document<"u")i=document.createElement("canvas").getContext("2d");else return 0;i.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var r=i.measureText(t);if(!r)return 0;var o=r.width;return o}qt.getMaximumHeightOfEncodings=D_;qt.getEncodingHeight=ch;qt.getBarcodePadding=dh;qt.calculateEncodingAttributes=P_;qt.getTotalWidthOfEncodings=E_});var uh=M($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});var T_=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),I_=Er(),O_=F_(I_),Wl=Ul();function F_(t){return t&&t.__esModule?t:{default:t}}function R_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var M_=function(){function t(e,n,i){R_(this,t),this.canvas=e,this.encodings=n,this.options=i}return T_(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var n=0;n<this.encodings.length;n++){var i=(0,O_.default)(this.options,this.encodings[n].options);this.drawCanvasBarcode(i,this.encodings[n]),this.drawCanvasText(i,this.encodings[n]),this.moveCanvasDrawing(this.encodings[n])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var n=this.canvas.getContext("2d");n.save(),(0,Wl.calculateEncodingAttributes)(this.encodings,this.options,n);var i=(0,Wl.getTotalWidthOfEncodings)(this.encodings),r=(0,Wl.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=i+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,n.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(n.fillStyle=this.options.background,n.fillRect(0,0,this.canvas.width,this.canvas.height)),n.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(n,i){var r=this.canvas.getContext("2d"),o=i.data,s;n.textPosition=="top"?s=n.marginTop+n.fontSize+n.textMargin:s=n.marginTop,r.fillStyle=n.lineColor;for(var a=0;a<o.length;a++){var l=a*n.width+i.barcodePadding;o[a]==="1"?r.fillRect(l,s,n.width,n.height):o[a]&&r.fillRect(l,s,n.width,n.height*o[a])}}},{key:"drawCanvasText",value:function(n,i){var r=this.canvas.getContext("2d"),o=n.fontOptions+" "+n.fontSize+"px "+n.font;if(n.displayValue){var s,a;n.textPosition=="top"?a=n.marginTop+n.fontSize-n.textMargin:a=n.height+n.textMargin+n.marginTop+n.fontSize,r.font=o,n.textAlign=="left"||i.barcodePadding>0?(s=0,r.textAlign="left"):n.textAlign=="right"?(s=i.width-1,r.textAlign="right"):(s=i.width/2,r.textAlign="center"),r.fillText(i.text,s,a)}}},{key:"moveCanvasDrawing",value:function(n){var i=this.canvas.getContext("2d");i.translate(n.width,0)}},{key:"restoreCanvas",value:function(){var n=this.canvas.getContext("2d");n.restore()}}]),t}();$l.default=M_});var ph=M(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var B_=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),A_=Er(),N_=z_(A_),ql=Ul();function z_(t){return t&&t.__esModule?t:{default:t}}function L_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Es="http://www.w3.org/2000/svg",H_=function(){function t(e,n,i){L_(this,t),this.svg=e,this.encodings=n,this.options=i,this.document=i.xmlDocument||document}return B_(t,[{key:"render",value:function(){var n=this.options.marginLeft;this.prepareSVG();for(var i=0;i<this.encodings.length;i++){var r=this.encodings[i],o=(0,N_.default)(this.options,r.options),s=this.createGroup(n,o.marginTop,this.svg);this.setGroupOptions(s,o),this.drawSvgBarcode(s,o,r),this.drawSVGText(s,o,r),n+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,ql.calculateEncodingAttributes)(this.encodings,this.options);var n=(0,ql.getTotalWidthOfEncodings)(this.encodings),i=(0,ql.getMaximumHeightOfEncodings)(this.encodings),r=n+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,i),this.options.background&&this.drawRect(0,0,r,i,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(n,i,r){var o=r.data,s;i.textPosition=="top"?s=i.fontSize+i.textMargin:s=0;for(var a=0,l=0,c=0;c<o.length;c++)l=c*i.width+r.barcodePadding,o[c]==="1"?a++:a>0&&(this.drawRect(l-i.width*a,s,i.width*a,i.height,n),a=0);a>0&&this.drawRect(l-i.width*(a-1),s,i.width*a,i.height,n)}},{key:"drawSVGText",value:function(n,i,r){var o=this.document.createElementNS(Es,"text");if(i.displayValue){var s,a;o.setAttribute("style","font:"+i.fontOptions+" "+i.fontSize+"px "+i.font),i.textPosition=="top"?a=i.fontSize-i.textMargin:a=i.height+i.textMargin+i.fontSize,i.textAlign=="left"||r.barcodePadding>0?(s=0,o.setAttribute("text-anchor","start")):i.textAlign=="right"?(s=r.width-1,o.setAttribute("text-anchor","end")):(s=r.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",s),o.setAttribute("y",a),o.appendChild(this.document.createTextNode(r.text)),n.appendChild(o)}}},{key:"setSvgAttributes",value:function(n,i){var r=this.svg;r.setAttribute("width",n+"px"),r.setAttribute("height",i+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+n+" "+i),r.setAttribute("xmlns",Es),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(n,i,r){var o=this.document.createElementNS(Es,"g");return o.setAttribute("transform","translate("+n+", "+i+")"),r.appendChild(o),o}},{key:"setGroupOptions",value:function(n,i){n.setAttribute("style","fill:"+i.lineColor+";")}},{key:"drawRect",value:function(n,i,r,o,s){var a=this.document.createElementNS(Es,"rect");return a.setAttribute("x",n),a.setAttribute("y",i),a.setAttribute("width",r),a.setAttribute("height",o),s.appendChild(a),a}}]),t}();Gl.default=H_});var hh=M(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var j_=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function V_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var U_=function(){function t(e,n,i){V_(this,t),this.object=e,this.encodings=n,this.options=i}return j_(t,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),t}();Xl.default=U_});var fh=M(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});var W_=uh(),$_=Yl(W_),q_=ph(),G_=Yl(q_),X_=hh(),Y_=Yl(X_);function Yl(t){return t&&t.__esModule?t:{default:t}}Kl.default={CanvasRenderer:$_.default,SVGRenderer:G_.default,ObjectRenderer:Y_.default}});var ec=M(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});function Ql(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zl(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Jl(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var K_=function(t){Jl(e,t);function e(n,i){Ql(this,e);var r=Zl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidInputException",r.symbology=n,r.input=i,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return e}(Error),Q_=function(t){Jl(e,t);function e(){Ql(this,e);var n=Zl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.name="InvalidElementException",n.message="Not supported type to render on",n}return e}(Error),Z_=function(t){Jl(e,t);function e(){Ql(this,e);var n=Zl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.name="NoElementException",n.message="No element to render on.",n}return e}(Error);Dr.InvalidInputException=K_;Dr.InvalidElementException=Q_;Dr.NoElementException=Z_});var gh=M(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var J_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ew=lh(),tc=mh(ew),tw=fh(),kr=mh(tw),iw=ec();function mh(t){return t&&t.__esModule?t:{default:t}}function ic(t){if(typeof t=="string")return nw(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(ic(t[n]));return e}else{if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLImageElement)return rw(t);if(t&&t.nodeName&&t.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&t instanceof SVGElement)return{element:t,options:(0,tc.default)(t),renderer:kr.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement)return{element:t,options:(0,tc.default)(t),renderer:kr.default.CanvasRenderer};if(t&&t.getContext)return{element:t,renderer:kr.default.CanvasRenderer};if(t&&(typeof t>"u"?"undefined":J_(t))==="object"&&!t.nodeName)return{element:t,renderer:kr.default.ObjectRenderer};throw new iw.InvalidElementException}}function nw(t){var e=document.querySelectorAll(t);if(e.length!==0){for(var n=[],i=0;i<e.length;i++)n.push(ic(e[i]));return n}}function rw(t){var e=document.createElement("canvas");return{element:e,options:(0,tc.default)(t),renderer:kr.default.CanvasRenderer,afterRender:function(){t.setAttribute("src",e.toDataURL())}}}nc.default=ic});var yh=M(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var ow=function(){function t(e,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function sw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var aw=function(){function t(e){sw(this,t),this.api=e}return ow(t,[{key:"handleCatch",value:function(n){if(n.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw n.message;else throw n;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(n){try{var i=n.apply(void 0,arguments);return this.api._options.valid(!0),i}catch(r){return this.handleCatch(r),this.api}}}]),t}();rc.default=aw});var ac=M((Pk,Sh)=>{"use strict";var lw=nh(),Zi=Hi(lw),cw=Er(),Tr=Hi(cw),dw=rh(),bh=Hi(dw),uw=oh(),vh=Hi(uw),pw=gh(),hw=Hi(pw),fw=Ll(),mw=Hi(fw),gw=yh(),yw=Hi(gw),_h=ec(),vw=jl(),wh=Hi(vw);function Hi(t){return t&&t.__esModule?t:{default:t}}var bi=function(){},Ds=function(e,n,i){var r=new bi;if(typeof e>"u")throw Error("No element to render on was provided.");return r._renderProperties=(0,hw.default)(e),r._encodings=[],r._options=wh.default,r._errorHandler=new yw.default(r),typeof n<"u"&&(i=i||{},i.format||(i.format=Ch()),r.options(i)[i.format](n,i).render()),r};Ds.getModule=function(t){return Zi.default[t]};for(oc in Zi.default)Zi.default.hasOwnProperty(oc)&&bw(Zi.default,oc);var oc;function bw(t,e){bi.prototype[e]=bi.prototype[e.toUpperCase()]=bi.prototype[e.toLowerCase()]=function(n,i){var r=this;return r._errorHandler.wrapBarcodeCall(function(){i.text=typeof i.text>"u"?void 0:""+i.text;var o=(0,Tr.default)(r._options,i);o=(0,mw.default)(o);var s=t[e],a=xh(n,s,o);return r._encodings.push(a),r})}}function xh(t,e,n){t=""+t;var i=new e(t,n);if(!i.valid())throw new _h.InvalidInputException(i.constructor.name,t);var r=i.encode();r=(0,bh.default)(r);for(var o=0;o<r.length;o++)r[o].options=(0,Tr.default)(n,r[o].options);return r}function Ch(){return Zi.default.CODE128?"CODE128":Object.keys(Zi.default)[0]}bi.prototype.options=function(t){return this._options=(0,Tr.default)(this._options,t),this};bi.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this};bi.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var t;for(var e in this._renderProperties){t=this._renderProperties[e];var n=(0,Tr.default)(this._options,t.options);n.format=="auto"&&(n.format=Ch()),this._errorHandler.wrapBarcodeCall(function(){var i=n.value,r=Zi.default[n.format.toUpperCase()],o=xh(i,r,n);sc(t,o,n)})}}};bi.prototype.render=function(){if(!this._renderProperties)throw new _h.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)sc(this._renderProperties[t],this._encodings,this._options);else sc(this._renderProperties,this._encodings,this._options);return this};bi.prototype._defaults=wh.default;function sc(t,e,n){e=(0,bh.default)(e);for(var i=0;i<e.length;i++)e[i].options=(0,Tr.default)(n,e[i].options),(0,vh.default)(e[i].options);(0,vh.default)(n);var r=t.renderer,o=new r(t.element,e,n);o.render(),t.afterRender&&t.afterRender()}typeof window<"u"&&(window.JsBarcode=Ds);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each(function(){n.push(this)}),Ds(n,t,e)});Sh.exports=Ds});var _f=M((fO,bf)=>{bf.exports=function(){var e={},n=e._fns={};e.emit=function(s,a,l,c,d,p,g){var h=i(s);h.length&&r(s,h,[a,l,c,d,p,g])},e.on=function(s,a){n[s]||(n[s]=[]),n[s].push(a)},e.once=function(s,a){function l(){a.apply(this,arguments),e.off(s,l)}this.on(s,l)},e.off=function(s,a){var l=[];if(s&&a){var c=this._fns[s],d=0,p=c?c.length:0;for(d;d<p;d++)c[d]!==a&&l.push(c[d])}l.length?this._fns[s]=l:delete this._fns[s]};function i(o){var s=n[o]?n[o]:[],a=o.indexOf(":"),l=a===-1?[o]:[o.substring(0,a),o.substring(a+1)],c=Object.keys(n),d=0,p=c.length;for(d;d<p;d++){var g=c[d];if(g==="*"&&(s=s.concat(n[g])),l.length===2&&l[0]===g){s=s.concat(n[g]);break}}return s}function r(o,s,a){var l=0,c=s.length;for(l;l<c&&s[l];l++)s[l].event=o,s[l].apply(s[l],a)}return e}});var js=M((gO,xf)=>{function nC(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}xf.exports=nC});var Sf=M((yO,Cf)=>{var rC=typeof global=="object"&&global&&global.Object===Object&&global;Cf.exports=rC});var Dc=M((vO,Pf)=>{var oC=Sf(),sC=typeof self=="object"&&self&&self.Object===Object&&self,aC=oC||sC||Function("return this")();Pf.exports=aC});var Df=M((bO,Ef)=>{var lC=Dc(),cC=function(){return lC.Date.now()};Ef.exports=cC});var Tf=M((_O,kf)=>{var dC=/\s/;function uC(t){for(var e=t.length;e--&&dC.test(t.charAt(e)););return e}kf.exports=uC});var Of=M((wO,If)=>{var pC=Tf(),hC=/^\s+/;function fC(t){return t&&t.slice(0,pC(t)+1).replace(hC,"")}If.exports=fC});var kc=M((xO,Ff)=>{var mC=Dc(),gC=mC.Symbol;Ff.exports=gC});var Af=M((CO,Bf)=>{var Rf=kc(),Mf=Object.prototype,yC=Mf.hasOwnProperty,vC=Mf.toString,Hr=Rf?Rf.toStringTag:void 0;function bC(t){var e=yC.call(t,Hr),n=t[Hr];try{t[Hr]=void 0;var i=!0}catch{}var r=vC.call(t);return i&&(e?t[Hr]=n:delete t[Hr]),r}Bf.exports=bC});var zf=M((SO,Nf)=>{var _C=Object.prototype,wC=_C.toString;function xC(t){return wC.call(t)}Nf.exports=xC});var Vf=M((PO,jf)=>{var Lf=kc(),CC=Af(),SC=zf(),PC="[object Null]",EC="[object Undefined]",Hf=Lf?Lf.toStringTag:void 0;function DC(t){return t==null?t===void 0?EC:PC:Hf&&Hf in Object(t)?CC(t):SC(t)}jf.exports=DC});var Wf=M((EO,Uf)=>{function kC(t){return t!=null&&typeof t=="object"}Uf.exports=kC});var qf=M((DO,$f)=>{var TC=Vf(),IC=Wf(),OC="[object Symbol]";function FC(t){return typeof t=="symbol"||IC(t)&&TC(t)==OC}$f.exports=FC});var Kf=M((kO,Yf)=>{var RC=Of(),Gf=js(),MC=qf(),Xf=NaN,BC=/^[-+]0x[0-9a-f]+$/i,AC=/^0b[01]+$/i,NC=/^0o[0-7]+$/i,zC=parseInt;function LC(t){if(typeof t=="number")return t;if(MC(t))return Xf;if(Gf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=RC(t);var n=AC.test(t);return n||NC.test(t)?zC(t.slice(2),n?2:8):BC.test(t)?Xf:+t}Yf.exports=LC});var Ic=M((TO,Zf)=>{var HC=js(),Tc=Df(),Qf=Kf(),jC="Expected a function",VC=Math.max,UC=Math.min;function WC(t,e,n){var i,r,o,s,a,l,c=0,d=!1,p=!1,g=!0;if(typeof t!="function")throw new TypeError(jC);e=Qf(e)||0,HC(n)&&(d=!!n.leading,p="maxWait"in n,o=p?VC(Qf(n.maxWait)||0,e):o,g="trailing"in n?!!n.trailing:g);function h(_){var x=i,P=r;return i=r=void 0,c=_,s=t.apply(P,x),s}function v(_){return c=_,a=setTimeout(O,e),d?h(_):s}function C(_){var x=_-l,P=_-c,T=e-x;return p?UC(T,o-P):T}function R(_){var x=_-l,P=_-c;return l===void 0||x>=e||x<0||p&&P>=o}function O(){var _=Tc();if(R(_))return N(_);a=setTimeout(O,C(_))}function N(_){return a=void 0,g&&i?h(_):(i=r=void 0,s)}function Q(){a!==void 0&&clearTimeout(a),c=0,i=l=r=a=void 0}function U(){return a===void 0?s:N(Tc())}function Y(){var _=Tc(),x=R(_);if(i=arguments,r=this,l=_,x){if(a===void 0)return v(l);if(p)return clearTimeout(a),a=setTimeout(O,e),h(l)}return a===void 0&&(a=setTimeout(O,e)),s}return Y.cancel=Q,Y.flush=U,Y}Zf.exports=WC});var em=M((IO,Jf)=>{var $C=Ic(),qC=js(),GC="Expected a function";function XC(t,e,n){var i=!0,r=!0;if(typeof t!="function")throw new TypeError(GC);return qC(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),$C(t,e,{leading:i,maxWait:e,trailing:r})}Jf.exports=XC});var $s=M((qO,am)=>{"use strict";am.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let n=e<0,i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(n&&(e=-e),e<1)return`${(n?"-":"")+e} B`;let r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1);e=Number(e/1024**r);let o=i[r];return e>=10||e%1===0?`${(n?"-":"")+e.toFixed(0)} ${o}`:`${(n?"-":"")+e.toFixed(1)} ${o}`}});var dm=M((GO,cm)=>{"use strict";function lm(t,e){this.text=t=t||"",this.hasWild=~t.indexOf("*"),this.separator=e,this.parts=t.split(e)}lm.prototype.match=function(t){var e=!0,n=this.parts,i,r=n.length,o;if(typeof t=="string"||t instanceof String)if(!this.hasWild&&this.text!=t)e=!1;else{for(o=(t||"").split(this.separator),i=0;e&&i<r;i++)n[i]!=="*"&&(i<o.length?e=n[i]===o[i]:e=!1);e=e&&o}else if(typeof t.splice=="function")for(e=[],i=t.length;i--;)this.match(t[i])&&(e[e.length]=t[i]);else if(typeof t=="object"){e={};for(var s in t)this.match(s)&&(e[s]=t[s])}return e};cm.exports=function(t,e,n){var i=new lm(t,n||/[\/\.]/);return typeof e<"u"?i.match(e):i}});var pm=M((XO,um)=>{var eS=dm(),tS=/[\/\+\.]/;um.exports=function(t,e){function n(i){var r=eS(i,t,tS);return r&&r.length>=2}return e?n(e.split(";")[0]):n}});var dt=M((k3,ia)=>{(function(){"use strict";var t={}.hasOwnProperty;function e(){for(var r="",o=0;o<arguments.length;o++){var s=arguments[o];s&&(r=i(r,n(s)))}return r}function n(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return e.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var s in r)t.call(r,s)&&r[s]&&(o=i(o,s));return o}function i(r,o){return o?r?r+" "+o:r+o:r}typeof ia<"u"&&ia.exports?(e.default=e,ia.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Fg=M((RR,Md)=>{"use strict";var kP=Object.prototype.hasOwnProperty,pt="~";function vo(){}Object.create&&(vo.prototype=Object.create(null),new vo().__proto__||(pt=!1));function TP(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function Og(t,e,n,i,r){if(typeof n!="function")throw new TypeError("The listener must be a function");var o=new TP(n,i||t,r),s=pt?pt+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],o]:t._events[s].push(o):(t._events[s]=o,t._eventsCount++),t}function _a(t,e){--t._eventsCount===0?t._events=new vo:delete t._events[e]}function ot(){this._events=new vo,this._eventsCount=0}ot.prototype.eventNames=function(){var e=[],n,i;if(this._eventsCount===0)return e;for(i in n=this._events)kP.call(n,i)&&e.push(pt?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(n)):e};ot.prototype.listeners=function(e){var n=pt?pt+e:e,i=this._events[n];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s};ot.prototype.listenerCount=function(e){var n=pt?pt+e:e,i=this._events[n];return i?i.fn?1:i.length:0};ot.prototype.emit=function(e,n,i,r,o,s){var a=pt?pt+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,d,p;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,n),!0;case 3:return l.fn.call(l.context,n,i),!0;case 4:return l.fn.call(l.context,n,i,r),!0;case 5:return l.fn.call(l.context,n,i,r,o),!0;case 6:return l.fn.call(l.context,n,i,r,o,s),!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 g=l.length,h;for(p=0;p<g;p++)switch(l[p].once&&this.removeListener(e,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,n);break;case 3:l[p].fn.call(l[p].context,n,i);break;case 4:l[p].fn.call(l[p].context,n,i,r);break;default:if(!d)for(h=1,d=new Array(c-1);h<c;h++)d[h-1]=arguments[h];l[p].fn.apply(l[p].context,d)}}return!0};ot.prototype.on=function(e,n,i){return Og(this,e,n,i,!1)};ot.prototype.once=function(e,n,i){return Og(this,e,n,i,!0)};ot.prototype.removeListener=function(e,n,i,r){var o=pt?pt+e:e;if(!this._events[o])return this;if(!n)return _a(this,o),this;var s=this._events[o];if(s.fn)s.fn===n&&(!r||s.once)&&(!i||s.context===i)&&_a(this,o);else{for(var a=0,l=[],c=s.length;a<c;a++)(s[a].fn!==n||r&&!s[a].once||i&&s[a].context!==i)&&l.push(s[a]);l.length?this._events[o]=l.length===1?l[0]:l:_a(this,o)}return this};ot.prototype.removeAllListeners=function(e){var n;return e?(n=pt?pt+e:e,this._events[n]&&_a(this,n)):(this._events=new vo,this._eventsCount=0),this};ot.prototype.off=ot.prototype.removeListener;ot.prototype.addListener=ot.prototype.on;ot.prefixed=pt;ot.EventEmitter=ot;typeof Md<"u"&&(Md.exports=ot)});var w0=M((uu,pu)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof pu=="object"&&typeof uu<"u"?pu.exports=e():t.Papa=e()})(uu,function t(){"use strict";var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},n=!e.document&&!!e.postMessage,i=e.IS_PAPA_WORKER||!1,r={},o=0,s={parse:function(_,x){var P=(x=x||{}).dynamicTyping||!1;if(Y(P)&&(x.dynamicTypingFunction=P,P={}),x.dynamicTyping=P,x.transform=!!Y(x.transform)&&x.transform,x.worker&&s.WORKERS_SUPPORTED){var T=function(){if(!s.WORKERS_SUPPORTED)return!1;var V=(Pe=e.URL||e.webkitURL||null,fe=t.toString(),s.BLOB_URL||(s.BLOB_URL=Pe.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; ","(",fe,")();"],{type:"text/javascript"})))),Z=new e.Worker(V),Pe,fe;return Z.onmessage=R,Z.id=o++,r[Z.id]=Z}();return T.userStep=x.step,T.userChunk=x.chunk,T.userComplete=x.complete,T.userError=x.error,x.step=Y(x.step),x.chunk=Y(x.chunk),x.complete=Y(x.complete),x.error=Y(x.error),delete x.worker,void T.postMessage({input:_,config:x,workerId:T.id})}var B=null;return s.NODE_STREAM_INPUT,typeof _=="string"?(_=function(V){return V.charCodeAt(0)===65279?V.slice(1):V}(_),B=x.download?new c(x):new p(x)):_.readable===!0&&Y(_.read)&&Y(_.on)?B=new g(x):(e.File&&_ instanceof File||_ instanceof Object)&&(B=new d(x)),B.stream(_)},unparse:function(_,x){var P=!1,T=!0,B=",",V=`\r
|
|
2
|
+
`,Z='"',Pe=Z+Z,fe=!1,j=null,ye=!1;(function(){if(typeof x=="object"){if(typeof x.delimiter!="string"||s.BAD_DELIMITERS.filter(function(L){return x.delimiter.indexOf(L)!==-1}).length||(B=x.delimiter),(typeof x.quotes=="boolean"||typeof x.quotes=="function"||Array.isArray(x.quotes))&&(P=x.quotes),typeof x.skipEmptyLines!="boolean"&&typeof x.skipEmptyLines!="string"||(fe=x.skipEmptyLines),typeof x.newline=="string"&&(V=x.newline),typeof x.quoteChar=="string"&&(Z=x.quoteChar),typeof x.header=="boolean"&&(T=x.header),Array.isArray(x.columns)){if(x.columns.length===0)throw new Error("Option columns is empty");j=x.columns}x.escapeChar!==void 0&&(Pe=x.escapeChar+Z),(typeof x.escapeFormulae=="boolean"||x.escapeFormulae instanceof RegExp)&&(ye=x.escapeFormulae instanceof RegExp?x.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var W=new RegExp(v(Z),"g");if(typeof _=="string"&&(_=JSON.parse(_)),Array.isArray(_)){if(!_.length||Array.isArray(_[0]))return ht(null,_,fe);if(typeof _[0]=="object")return ht(j||Object.keys(_[0]),_,fe)}else if(typeof _=="object")return typeof _.data=="string"&&(_.data=JSON.parse(_.data)),Array.isArray(_.data)&&(_.fields||(_.fields=_.meta&&_.meta.fields||j),_.fields||(_.fields=Array.isArray(_.data[0])?_.fields:typeof _.data[0]=="object"?Object.keys(_.data[0]):[]),Array.isArray(_.data[0])||typeof _.data[0]=="object"||(_.data=[_.data])),ht(_.fields||[],_.data||[],fe);throw new Error("Unable to serialize unrecognized input");function ht(L,de,je){var be="";typeof L=="string"&&(L=JSON.parse(L)),typeof de=="string"&&(de=JSON.parse(de));var Ve=Array.isArray(L)&&0<L.length,Ee=!Array.isArray(de[0]);if(Ve&&T){for(var Ue=0;Ue<L.length;Ue++)0<Ue&&(be+=B),be+=He(L[Ue],Ue);0<de.length&&(be+=V)}for(var $=0;$<de.length;$++){var se=Ve?L.length:de[$].length,le=!1,We=Ve?Object.keys(de[$]).length===0:de[$].length===0;if(je&&!Ve&&(le=je==="greedy"?de[$].join("").trim()==="":de[$].length===1&&de[$][0].length===0),je==="greedy"&&Ve){for(var me=[],it=0;it<se;it++){var De=Ee?L[it]:it;me.push(de[$][De])}le=me.join("").trim()===""}if(!le){for(var ve=0;ve<se;ve++){0<ve&&!We&&(be+=B);var Yt=Ve&&Ee?L[ve]:ve;be+=He(de[$][Yt],ve)}$<de.length-1&&(!je||0<se&&!We)&&(be+=V)}}return be}function He(L,de){if(L==null)return"";if(L.constructor===Date)return JSON.stringify(L).slice(1,25);var je=!1;ye&&typeof L=="string"&&ye.test(L)&&(L="'"+L,je=!0);var be=L.toString().replace(W,Pe);return(je=je||P===!0||typeof P=="function"&&P(L,de)||Array.isArray(P)&&P[de]||function(Ve,Ee){for(var Ue=0;Ue<Ee.length;Ue++)if(-1<Ve.indexOf(Ee[Ue]))return!0;return!1}(be,s.BAD_DELIMITERS)||-1<be.indexOf(B)||be.charAt(0)===" "||be.charAt(be.length-1)===" ")?Z+be+Z:be}}};if(s.RECORD_SEP="",s.UNIT_SEP="",s.BYTE_ORDER_MARK="\uFEFF",s.BAD_DELIMITERS=["\r",`
|
|
3
|
+
`,'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!n&&!!e.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=C,s.ParserHandle=h,s.NetworkStreamer=c,s.FileStreamer=d,s.StringStreamer=p,s.ReadableStreamStreamer=g,e.jQuery){var a=e.jQuery;a.fn.parse=function(_){var x=_.config||{},P=[];return this.each(function(V){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length===0)return!0;for(var Z=0;Z<this.files.length;Z++)P.push({file:this.files[Z],inputElem:this,instanceConfig:a.extend({},x)})}),T(),this;function T(){if(P.length!==0){var V,Z,Pe,fe,j=P[0];if(Y(_.before)){var ye=_.before(j.file,j.inputElem);if(typeof ye=="object"){if(ye.action==="abort")return V="AbortError",Z=j.file,Pe=j.inputElem,fe=ye.reason,void(Y(_.error)&&_.error({name:V},Z,Pe,fe));if(ye.action==="skip")return void B();typeof ye.config=="object"&&(j.instanceConfig=a.extend(j.instanceConfig,ye.config))}else if(ye==="skip")return void B()}var W=j.instanceConfig.complete;j.instanceConfig.complete=function(ht){Y(W)&&W(ht,j.file,j.inputElem),B()},s.parse(j.file,j.instanceConfig)}else Y(_.complete)&&_.complete()}function B(){P.splice(0,1),T()}}}function l(_){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 P=Q(x);P.chunkSize=parseInt(P.chunkSize),x.step||x.chunk||(P.chunkSize=null),this._handle=new h(P),(this._handle.streamer=this)._config=P}).call(this,_),this.parseChunk=function(x,P){if(this.isFirstChunk&&Y(this._config.beforeFirstChunk)){var T=this._config.beforeFirstChunk(x);T!==void 0&&(x=T)}this.isFirstChunk=!1,this._halted=!1;var B=this._partialLine+x;this._partialLine="";var V=this._handle.parse(B,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var Z=V.meta.cursor;this._finished||(this._partialLine=B.substring(Z-this._baseIndex),this._baseIndex=Z),V&&V.data&&(this._rowCount+=V.data.length);var Pe=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(i)e.postMessage({results:V,workerId:s.WORKER_ID,finished:Pe});else if(Y(this._config.chunk)&&!P){if(this._config.chunk(V,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);V=void 0,this._completeResults=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||!Pe||!Y(this._config.complete)||V&&V.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),Pe||V&&V.meta.paused||this._nextChunk(),V}this._halted=!0},this._sendError=function(x){Y(this._config.error)?this._config.error(x):i&&this._config.error&&e.postMessage({workerId:s.WORKER_ID,error:x,finished:!1})}}function c(_){var x;(_=_||{}).chunkSize||(_.chunkSize=s.RemoteChunkSize),l.call(this,_),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(P){this._input=P,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=U(this._chunkLoaded,this),x.onerror=U(this._chunkError,this)),x.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var P=this._config.downloadRequestHeaders;for(var T in P)x.setRequestHeader(T,P[T])}if(this._config.chunkSize){var B=this._start+this._config.chunkSize-1;x.setRequestHeader("Range","bytes="+this._start+"-"+B)}try{x.send(this._config.downloadRequestBody)}catch(V){this._chunkError(V.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?this._config.chunkSize:x.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(P){var T=P.getResponseHeader("Content-Range");return T===null?-1:parseInt(T.substring(T.lastIndexOf("/")+1))}(x),this.parseChunk(x.responseText)))},this._chunkError=function(P){var T=x.statusText||P;this._sendError(new Error(T))}}function d(_){var x,P;(_=_||{}).chunkSize||(_.chunkSize=s.LocalChunkSize),l.call(this,_);var T=typeof FileReader<"u";this.stream=function(B){this._input=B,P=B.slice||B.webkitSlice||B.mozSlice,T?((x=new FileReader).onload=U(this._chunkLoaded,this),x.onerror=U(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 B=this._input;if(this._config.chunkSize){var V=Math.min(this._start+this._config.chunkSize,this._input.size);B=P.call(B,this._start,V)}var Z=x.readAsText(B,this._config.encoding);T||this._chunkLoaded({target:{result:Z}})},this._chunkLoaded=function(B){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(B.target.result)},this._chunkError=function(){this._sendError(x.error)}}function p(_){var x;l.call(this,_=_||{}),this.stream=function(P){return x=P,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var P,T=this._config.chunkSize;return T?(P=x.substring(0,T),x=x.substring(T)):(P=x,x=""),this._finished=!x,this.parseChunk(P)}}}function g(_){l.call(this,_=_||{});var x=[],P=!0,T=!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(B){this._input=B,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){T&&x.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),x.length?this.parseChunk(x.shift()):P=!0},this._streamData=U(function(B){try{x.push(typeof B=="string"?B:B.toString(this._config.encoding)),P&&(P=!1,this._checkIsFinished(),this.parseChunk(x.shift()))}catch(V){this._streamError(V)}},this),this._streamError=U(function(B){this._streamCleanUp(),this._sendError(B)},this),this._streamEnd=U(function(){this._streamCleanUp(),T=!0,this._streamData("")},this),this._streamCleanUp=U(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function h(_){var x,P,T,B=Math.pow(2,53),V=-B,Z=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Pe=/^((\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)))$/,fe=this,j=0,ye=0,W=!1,ht=!1,He=[],L={data:[],errors:[],meta:{}};if(Y(_.step)){var de=_.step;_.step=function($){if(L=$,Ve())be();else{if(be(),L.data.length===0)return;j+=$.data.length,_.preview&&j>_.preview?P.abort():(L.data=L.data[0],de(L,fe))}}}function je($){return _.skipEmptyLines==="greedy"?$.join("").trim()==="":$.length===1&&$[0].length===0}function be(){return L&&T&&(Ue("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),T=!1),_.skipEmptyLines&&(L.data=L.data.filter(function($){return!je($)})),Ve()&&function(){if(!L)return;function $(le,We){Y(_.transformHeader)&&(le=_.transformHeader(le,We)),He.push(le)}if(Array.isArray(L.data[0])){for(var se=0;Ve()&&se<L.data.length;se++)L.data[se].forEach($);L.data.splice(0,1)}else L.data.forEach($)}(),function(){if(!L||!_.header&&!_.dynamicTyping&&!_.transform)return L;function $(le,We){var me,it=_.header?{}:[];for(me=0;me<le.length;me++){var De=me,ve=le[me];_.header&&(De=me>=He.length?"__parsed_extra":He[me]),_.transform&&(ve=_.transform(ve,De)),ve=Ee(De,ve),De==="__parsed_extra"?(it[De]=it[De]||[],it[De].push(ve)):it[De]=ve}return _.header&&(me>He.length?Ue("FieldMismatch","TooManyFields","Too many fields: expected "+He.length+" fields but parsed "+me,ye+We):me<He.length&&Ue("FieldMismatch","TooFewFields","Too few fields: expected "+He.length+" fields but parsed "+me,ye+We)),it}var se=1;return!L.data.length||Array.isArray(L.data[0])?(L.data=L.data.map($),se=L.data.length):L.data=$(L.data,0),_.header&&L.meta&&(L.meta.fields=He),ye+=se,L}()}function Ve(){return _.header&&He.length===0}function Ee($,se){return le=$,_.dynamicTypingFunction&&_.dynamicTyping[le]===void 0&&(_.dynamicTyping[le]=_.dynamicTypingFunction(le)),(_.dynamicTyping[le]||_.dynamicTyping)===!0?se==="true"||se==="TRUE"||se!=="false"&&se!=="FALSE"&&(function(We){if(Z.test(We)){var me=parseFloat(We);if(V<me&&me<B)return!0}return!1}(se)?parseFloat(se):Pe.test(se)?new Date(se):se===""?null:se):se;var le}function Ue($,se,le,We){var me={type:$,code:se,message:le};We!==void 0&&(me.row=We),L.errors.push(me)}this.parse=function($,se,le){var We=_.quoteChar||'"';if(_.newline||(_.newline=function(De,ve){De=De.substring(0,1048576);var Yt=new RegExp(v(ve)+"([^]*?)"+v(ve),"gm"),Ft=(De=De.replace(Yt,"")).split("\r"),ti=De.split(`
|
|
4
|
+
`),mi=1<ti.length&&ti[0].length<Ft[0].length;if(Ft.length===1||mi)return`
|
|
5
5
|
`;for(var Rt=0,we=0;we<Ft.length;we++)Ft[we][0]===`
|
|
6
6
|
`&&Rt++;return Rt>=Ft.length/2?`\r
|
|
7
|
-
`:"\r"}($,
|
|
7
|
+
`:"\r"}($,We)),T=!1,_.delimiter)Y(_.delimiter)&&(_.delimiter=_.delimiter($),L.meta.delimiter=_.delimiter);else{var me=function(De,ve,Yt,Ft,ti){var mi,Rt,we,Me;ti=ti||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var qi=0;qi<ti.length;qi++){var ue=ti[qi],Cn=0,gi=0,Gi=0;we=void 0;for(var Ii=new C({comments:Ft,delimiter:ue,newline:ve,preview:10}).parse(De),Oi=0;Oi<Ii.data.length;Oi++)if(Yt&&je(Ii.data[Oi]))Gi++;else{var Fi=Ii.data[Oi].length;gi+=Fi,we!==void 0?0<Fi&&(Cn+=Math.abs(Fi-we),we=Fi):we=Fi}0<Ii.data.length&&(gi/=Ii.data.length-Gi),(Rt===void 0||Cn<=Rt)&&(Me===void 0||Me<gi)&&1.99<gi&&(Rt=Cn,mi=ue,Me=gi)}return{successful:!!(_.delimiter=mi),bestDelimiter:mi}}($,_.newline,_.skipEmptyLines,_.comments,_.delimitersToGuess);me.successful?_.delimiter=me.bestDelimiter:(T=!0,_.delimiter=s.DefaultDelimiter),L.meta.delimiter=_.delimiter}var it=Q(_);return _.preview&&_.header&&it.preview++,x=$,P=new C(it),L=P.parse(x,se,le),be(),W?{meta:{paused:!0}}:L||{meta:{paused:!1}}},this.paused=function(){return W},this.pause=function(){W=!0,P.abort(),x=Y(_.chunk)?"":x.substring(P.getCharIndex())},this.resume=function(){fe.streamer._halted?(W=!1,fe.streamer.parseChunk(x,!0)):setTimeout(fe.resume,3)},this.aborted=function(){return ht},this.abort=function(){ht=!0,P.abort(),L.meta.aborted=!0,Y(_.complete)&&_.complete(L),x=""}}function v(_){return _.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function C(_){var x,P=(_=_||{}).delimiter,T=_.newline,B=_.comments,V=_.step,Z=_.preview,Pe=_.fastMode,fe=x=_.quoteChar===void 0||_.quoteChar===null?'"':_.quoteChar;if(_.escapeChar!==void 0&&(fe=_.escapeChar),(typeof P!="string"||-1<s.BAD_DELIMITERS.indexOf(P))&&(P=","),B===P)throw new Error("Comment character same as delimiter");B===!0?B="#":(typeof B!="string"||-1<s.BAD_DELIMITERS.indexOf(B))&&(B=!1),T!==`
|
|
8
8
|
`&&T!=="\r"&&T!==`\r
|
|
9
9
|
`&&(T=`
|
|
10
|
-
`);var j=0,ye=!1;this.parse=function(W,ht,Le){if(typeof W!="string")throw new Error("Input must be a string");var L=W.length,de=P.length,He=T.length,be=B.length,je=Y(V),Ee=[],Ve=[],$=[],se=j=0;if(!W)return Mt();if(_.header&&!ht){var le=W.split(T)[0].split(P),Ue=[],fe={},it=!1;for(var De in le){var ve=le[De];Y(_.transformHeader)&&(ve=_.transformHeader(ve,De));var Gt=ve,Ft=fe[ve]||0;for(0<Ft&&(it=!0,Gt=ve+"_"+Ft),fe[ve]=Ft+1;Ue.includes(Gt);)Gt=Gt+"_"+Ft;Ue.push(Gt)}if(it){var Jt=W.split(T);Jt[0]=Ue.join(P),W=Jt.join(T)}}if(Pe||Pe!==!1&&W.indexOf(x)===-1){for(var mi=W.split(T),Rt=0;Rt<mi.length;Rt++){if($=mi[Rt],j+=$.length,Rt!==mi.length-1)j+=T.length;else if(Le)return Mt();if(!B||$.substring(0,be)!==B){if(je){if(Ee=[],Gi($.split(P)),Bo(),ye)return Mt()}else Gi($.split(P));if(Z&&Z<=Rt)return Ee=Ee.slice(0,Z),Mt(!0)}}return Mt()}for(var we=W.indexOf(P,j),Re=W.indexOf(T,j),qi=new RegExp(v(he)+v(x),"g"),ue=W.indexOf(x,j);;)if(W[j]!==x)if(B&&$.length===0&&W.substring(j,j+be)===B){if(Re===-1)return Mt();j=Re+He,Re=W.indexOf(T,j),we=W.indexOf(P,j)}else if(we!==-1&&(we<Re||Re===-1))$.push(W.substring(j,we)),j=we+de,we=W.indexOf(P,j);else{if(Re===-1)break;if($.push(W.substring(j,Re)),Fi(Re+He),je&&(Bo(),ye))return Mt();if(Z&&Ee.length>=Z)return Mt(!0)}else for(ue=j,j++;;){if((ue=W.indexOf(x,ue+1))===-1)return Le||Ve.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Ee.length,index:j}),Oi();if(ue===L-1)return Oi(W.substring(j,ue).replace(qi,x));if(x!==he||W[ue+1]!==he){if(x===he||ue===0||W[ue-1]!==he){we!==-1&&we<ue+1&&(we=W.indexOf(P,ue+1)),Re!==-1&&Re<ue+1&&(Re=W.indexOf(T,ue+1));var Cn=Ii(Re===-1?we:Math.min(we,Re));if(W.substr(ue+1+Cn,de)===P){$.push(W.substring(j,ue).replace(qi,x)),W[j=ue+1+Cn+de]!==x&&(ue=W.indexOf(x,j)),we=W.indexOf(P,j),Re=W.indexOf(T,j);break}var gi=Ii(Re);if(W.substring(ue+1+gi,ue+1+gi+He)===T){if($.push(W.substring(j,ue).replace(qi,x)),Fi(ue+1+gi+He),we=W.indexOf(P,j),ue=W.indexOf(x,j),je&&(Bo(),ye))return Mt();if(Z&&Ee.length>=Z)return Mt(!0);break}Ve.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Ee.length,index:j}),ue++}}else ue++}return Oi();function Gi(Bt){Ee.push(Bt),se=j}function Ii(Bt){var pu=0;if(Bt!==-1){var Ba=W.substring(ue+1,Bt);Ba&&Ba.trim()===""&&(pu=Ba.length)}return pu}function Oi(Bt){return Le||(Bt===void 0&&(Bt=W.substring(j)),$.push(Bt),j=L,Gi($),je&&Bo()),Mt()}function Fi(Bt){j=Bt,Gi($),$=[],Re=W.indexOf(T,j)}function Mt(Bt){return{data:Ee,errors:Ve,meta:{delimiter:P,linebreak:T,aborted:ye,truncated:!!Bt,cursor:se+(ht||0)}}}function Bo(){V(Mt()),Ee=[],Ve=[]}},this.abort=function(){ye=!0},this.getCharIndex=function(){return j}}function R(_){var x=_.data,P=r[x.workerId],T=!1;if(x.error)P.userError(x.error,x.file);else if(x.results&&x.results.data){var B={abort:function(){T=!0,I(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:N,resume:N};if(Y(P.userStep)){for(var V=0;V<x.results.data.length&&(P.userStep({data:x.results.data[V],errors:x.results.errors,meta:x.results.meta},B),!T);V++);delete x.results}else Y(P.userChunk)&&(P.userChunk(x.results,B,x.file),delete x.results)}x.finished&&!T&&I(x.workerId,x.results)}function I(_,x){var P=r[_];Y(P.userComplete)&&P.userComplete(x),P.terminate(),delete r[_]}function N(){throw new Error("Not implemented.")}function Q(_){if(typeof _!="object"||_===null)return _;var x=Array.isArray(_)?[]:{};for(var P in _)x[P]=Q(_[P]);return x}function U(_,x){return function(){_.apply(x,arguments)}}function Y(_){return typeof _=="function"}return i&&(e.onmessage=function(_){var x=_.data;if(s.WORKER_ID===void 0&&x&&(s.WORKER_ID=x.workerId),typeof x.input=="string")e.postMessage({workerId:s.WORKER_ID,results:s.parse(x.input,x.config),finished:!0});else if(e.File&&x.input instanceof File||x.input instanceof Object){var P=s.parse(x.input,x.config);P&&e.postMessage({workerId:s.WORKER_ID,results:P,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,(g.prototype=Object.create(l.prototype)).constructor=g,s})});var R0=M((Ma,uu)=>{(function(e,n){typeof Ma=="object"&&typeof uu=="object"?uu.exports=n():typeof define=="function"&&define.amd?define([],n):typeof Ma=="object"?Ma.printJS=n():e.printJS=n()})(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(i,r,o){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:o})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(r&1&&(i=n(i)),r&8||r&4&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),r&2&&typeof i!="string")for(var s in i)n.d(o,s,(function(a){return i[a]}).bind(null,s));return o},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)}({"./src/index.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/sass/index.scss"),r=n.n(i),o=n("./src/js/init.js"),s=o.default.init;typeof window<"u"&&(window.printJS=s),e.default=s},"./src/js/browser.js":function(t,e,n){"use strict";n.r(e);var i={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!i.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}};e.default=i},"./src/js/functions.js":function(t,e,n){"use strict";n.r(e),n.d(e,"addWrapper",function(){return s}),n.d(e,"capitalizePrint",function(){return a}),n.d(e,"collectStyles",function(){return l}),n.d(e,"addHeader",function(){return d}),n.d(e,"cleanUp",function(){return p}),n.d(e,"isRawHTML",function(){return g});var i=n("./src/js/modal.js"),r=n("./src/js/browser.js");function o(h){"@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(h)}function s(h,v){var C="font-family:"+v.font+" !important; font-size: "+v.font_size+" !important; width:100%;";return'<div style="'+C+'">'+h+"</div>"}function a(h){return h.charAt(0).toUpperCase()+h.slice(1)}function l(h,v){for(var C=document.defaultView||window,R="",I=C.getComputedStyle(h,""),N=0;N<I.length;N++)(v.targetStyles.indexOf("*")!==-1||v.targetStyle.indexOf(I[N])!==-1||c(v.targetStyles,I[N]))&&I.getPropertyValue(I[N])&&(R+=I[N]+":"+I.getPropertyValue(I[N])+";");return R+="max-width: "+v.maxWidth+"px !important; font-size: "+v.font_size+" !important;",R}function c(h,v){for(var C=0;C<h.length;C++)if(o(v)==="object"&&v.indexOf(h[C])!==-1)return!0;return!1}function d(h,v){var C=document.createElement("div");if(g(v.header))C.innerHTML=v.header;else{var R=document.createElement("h1"),I=document.createTextNode(v.header);R.appendChild(I),R.setAttribute("style",v.headerStyle),C.appendChild(R)}h.insertBefore(C,h.childNodes[0])}function p(h){h.showModal&&i.default.close(),h.onLoadingEnd&&h.onLoadingEnd(),(h.showModal||h.onLoadingStart)&&window.URL.revokeObjectURL(h.printable);var v="mouseover";(r.default.isChrome()||r.default.isFirefox())&&(v="focus");var C=function R(){window.removeEventListener(v,R),h.onPrintDialogClose();var I=document.getElementById(h.frameId);I&&I.remove()};window.addEventListener(v,C)}function g(h){var v=new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>");return v.test(h)}},"./src/js/html.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/functions.js"),r=n("./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)}e.default={print:function(c,d){var p=a(c.printable)?c.printable:document.getElementById(c.printable);if(!p){window.console.error("Invalid HTML element id: "+c.printable);return}c.printableElement=s(p,c),c.header&&Object(i.addHeader)(c.printableElement,c),r.default.send(c,d)}};function s(l,c){for(var d=l.cloneNode(),p=Array.prototype.slice.call(l.childNodes),g=0;g<p.length;g++)if(c.ignoreElements.indexOf(p[g].id)===-1){var h=s(p[g],c);d.appendChild(h)}switch(c.scanStyles&&l.nodeType===1&&d.setAttribute("style",Object(i.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 a(l){return o(l)==="object"&&l&&(l instanceof HTMLElement||l.nodeType===1)}},"./src/js/image.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/functions.js"),r=n("./src/js/print.js"),o=n("./src/js/browser.js");e.default={print:function(a,l){a.printable.constructor!==Array&&(a.printable=[a.printable]),a.printableElement=document.createElement("div"),a.printable.forEach(function(c){var d=document.createElement("img");if(d.setAttribute("style",a.imageStyle),d.src=c,o.default.isFirefox()){var p=d.src;d.src=p}var g=document.createElement("div");g.appendChild(d),a.printableElement.appendChild(g)}),a.header&&Object(i.addHeader)(a.printableElement,a),r.default.send(a,l)}}},"./src/js/init.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/browser.js"),r=n("./src/js/modal.js"),o=n("./src/js/pdf.js"),s=n("./src/js/html.js"),a=n("./src/js/raw-html.js"),l=n("./src/js/image.js"),c=n("./src/js/json.js");function d(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(v){return typeof v}:d=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},d(g)}var p=["pdf","html","image","json","raw-html"];e.default={init:function(){var h={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(U){throw U},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%;"},v=arguments[0];if(v===void 0)throw new Error("printJS expects at least 1 attribute.");switch(d(v)){case"string":h.printable=encodeURI(v),h.fallbackPrintable=h.printable,h.type=arguments[1]||h.type;break;case"object":h.printable=v.printable,h.fallbackPrintable=typeof v.fallbackPrintable<"u"?v.fallbackPrintable:h.printable,h.fallbackPrintable=h.base64?"data:application/pdf;base64,".concat(h.fallbackPrintable):h.fallbackPrintable;for(var C in h)C==="printable"||C==="fallbackPrintable"||(h[C]=typeof v[C]<"u"?v[C]:h[C]);break;default:throw new Error('Unexpected argument type! Expected "string" or "object", got '+d(v))}if(!h.printable)throw new Error("Missing printable information.");if(!h.type||typeof h.type!="string"||p.indexOf(h.type.toLowerCase())===-1)throw new Error("Invalid print type. Available types are: pdf, html, image and json.");h.showModal&&r.default.show(h),h.onLoadingStart&&h.onLoadingStart();var R=document.getElementById(h.frameId);R&&R.parentNode.removeChild(R);var I=document.createElement("iframe");switch(i.default.isFirefox()?I.setAttribute("style","width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0"):I.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute; border: 0"),I.setAttribute("id",h.frameId),h.type!=="pdf"&&(I.srcdoc="<html><head><title>"+h.documentTitle+"</title>",h.css&&(Array.isArray(h.css)||(h.css=[h.css]),h.css.forEach(function(Q){I.srcdoc+='<link rel="stylesheet" href="'+Q+'">'})),I.srcdoc+="</head><body></body></html>"),h.type){case"pdf":if(i.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var N=window.open(h.fallbackPrintable,"_blank");N.focus(),h.onIncompatibleBrowser()}catch(Q){h.onError(Q)}finally{h.showModal&&r.default.close(),h.onLoadingEnd&&h.onLoadingEnd()}else o.default.print(h,I);break;case"image":l.default.print(h,I);break;case"html":s.default.print(h,I);break;case"raw-html":a.default.print(h,I);break;case"json":c.default.print(h,I);break}}}},"./src/js/json.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/functions.js"),r=n("./src/js/print.js");function o(a){"@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(a)}e.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(i.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=s(l),r.default.send(l,c)}};function s(a){var l=a.printable,c=a.properties,d='<table style="border-collapse: collapse; width: 100%;">';a.repeatTableHeader&&(d+="<thead>"),d+="<tr>";for(var p=0;p<c.length;p++)d+='<th style="width:'+c[p].columnSize+";"+a.gridHeaderStyle+'">'+Object(i.capitalizePrint)(c[p].displayName)+"</th>";d+="</tr>",a.repeatTableHeader&&(d+="</thead>"),d+="<tbody>";for(var g=0;g<l.length;g++){d+="<tr>";for(var h=0;h<c.length;h++){var v=l[g],C=c[h].field.split(".");if(C.length>1)for(var R=0;R<C.length;R++)v=v[C[R]];else v=v[c[h].field];d+='<td style="width:'+c[h].columnSize+a.gridStyle+'">'+v+"</td>"}d+="</tr>"}return d+="</tbody></table>",d}},"./src/js/modal.js":function(t,e,n){"use strict";n.r(e);var i={show:function(o){var s="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;",a=document.createElement("div");a.setAttribute("style",s),a.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),a.appendChild(l),document.getElementsByTagName("body")[0].appendChild(a),document.getElementById("printClose").addEventListener("click",function(){i.close()})},close:function(){var o=document.getElementById("printJS-Modal");o&&o.parentNode.removeChild(o)}};e.default=i},"./src/js/pdf.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/print.js"),r=n("./src/js/functions.js");e.default={print:function(a,l){if(a.base64){var c=Uint8Array.from(atob(a.printable),function(p){return p.charCodeAt(0)});o(a,l,c);return}a.printable=/^(blob|http|\/\/)/i.test(a.printable)?a.printable:window.location.origin+(a.printable.charAt(0)!=="/"?"/"+a.printable:a.printable);var d=new window.XMLHttpRequest;d.responseType="arraybuffer",d.addEventListener("error",function(){Object(r.cleanUp)(a),a.onError(d.statusText,d)}),d.addEventListener("load",function(){if([200,201].indexOf(d.status)===-1){Object(r.cleanUp)(a),a.onError(d.statusText,d);return}o(a,l,d.response)}),d.open("GET",a.printable,!0),d.send()}};function o(s,a,l){var c=new window.Blob([l],{type:"application/pdf"});c=window.URL.createObjectURL(c),a.setAttribute("src",c),i.default.send(s,a)}},"./src/js/print.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/browser.js"),r=n("./src/js/functions.js"),o={send:function(d,p){document.getElementsByTagName("body")[0].appendChild(p);var g=document.getElementById(d.frameId);g.onload=function(){if(d.type==="pdf"){i.default.isFirefox()?setTimeout(function(){return s(g,d)},1e3):s(g,d);return}var h=g.contentWindow||g.contentDocument;if(h.document&&(h=h.document),h.body.appendChild(d.printableElement),d.type!=="pdf"&&d.style){var v=document.createElement("style");v.innerHTML=d.style,h.head.appendChild(v)}var C=h.getElementsByTagName("img");C.length>0?a(Array.from(C)).then(function(){return s(g,d)}):s(g,d)}}};function s(c,d){try{if(c.focus(),i.default.isEdge()||i.default.isIE())try{c.contentWindow.document.execCommand("print",!1,null)}catch{c.contentWindow.print()}else c.contentWindow.print()}catch(p){d.onError(p)}finally{i.default.isFirefox()&&(c.style.visibility="hidden",c.style.left="-1px"),Object(r.cleanUp)(d)}}function a(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 g(){!c||typeof c.naturalWidth>"u"||c.naturalWidth===0||!c.complete?setTimeout(g,500):d()};p()})}e.default=o},"./src/js/raw-html.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/print.js");e.default={print:function(o,s){o.printableElement=document.createElement("div"),o.printableElement.setAttribute("style","width:100%"),o.printableElement.innerHTML=o.printable,i.default.send(o,s)}}},"./src/sass/index.scss":function(t,e,n){},0:function(t,e,n){t.exports=n("./src/index.js")}}).default})});var yw=me(sc(),1);var Un=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({});let t=e;return t})();var vw=["*"],ks=(()=>{let e=class e{constructor(){this.title="",this.hasValid=!1,this.onClose=new st,this.onCancel=new st,this.onOK=new st,this.activeModal=F(Rn)}ngOnInit(){}onCancelHandler(){this.activeModal.close(),this.onCancel.emit()}onCloseHandler(){this.activeModal.close(),this.onClose.emit()}onOKHandler(){this.onOK.emit()}handleKeyboardEvent(i){i.key==="F2"&&this.onOKHandler()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-base-modal"]],hostBindings:function(r,o){r&1&&A("keydown",function(a){return o.handleKeyboardEvent(a)},!1,xu)},inputs:{title:"title",hasValid:"hasValid"},outputs:{onClose:"onClose",onCancel:"onCancel",onOK:"onOK"},standalone:!0,features:[ie],ngContentSelectors:vw,decls:12,vars:1,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title","font-robotoslab",2,"font-size","16px"],["aria-label","Close","type","button",1,"btn","btn-light-blue","text-primary","px-2","py-1",3,"click"],[1,"fas","fa-times"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-light-blue","btn-lg","text-primary","fw-semibold","fs-4",3,"click"]],template:function(r,o){r&1&&(Dn(),f(0,"div",0)(1,"h4",1),w(2),m(),f(3,"button",2),A("click",function(){return o.onCloseHandler()}),X(4,"i",3),m()(),f(5,"div",4),kn(6),m(),f(7,"div",5)(8,"button",6),A("click",function(){return o.onCancelHandler()}),w(9," Cancel "),m(),f(10,"button",6),A("click",function(){return o.onOKHandler()}),w(11," OK(F2) "),m()()),r&2&&(y(2),oi(" ",o.title," "))},dependencies:[Qo],styles:[".modal-header[_ngcontent-%COMP%]{background:#89b03e;display:flex;justify-content:space-between}.modal-title[_ngcontent-%COMP%]{color:#fff}.modal-body[_ngcontent-%COMP%]{max-height:60vh}"]});let t=e;return t})();function Ch(t){let{anchorOffset:e=0,focusOffset:n=0}=t.ownerDocument.getSelection()||{},i=Math.min(e,n),r=Math.max(e,n);return[i,r]}function bw(t,[e,n]){var i,r;let o=t.ownerDocument,s=o.createRange();s.setStart(t.firstChild||t,Math.min(e,((i=t.textContent)===null||i===void 0?void 0:i.length)||0)),s.setEnd(t.lastChild||t,Math.min(n,((r=t.textContent)===null||r===void 0?void 0:r.length)||0));let a=o.getSelection();a&&(a.removeAllRanges(),a.addRange(s))}var ac=class{constructor(e){this.element=e,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
|
|
10
|
+
`);var j=0,ye=!1;this.parse=function(W,ht,He){if(typeof W!="string")throw new Error("Input must be a string");var L=W.length,de=P.length,je=T.length,be=B.length,Ve=Y(V),Ee=[],Ue=[],$=[],se=j=0;if(!W)return Mt();if(_.header&&!ht){var le=W.split(T)[0].split(P),We=[],me={},it=!1;for(var De in le){var ve=le[De];Y(_.transformHeader)&&(ve=_.transformHeader(ve,De));var Yt=ve,Ft=me[ve]||0;for(0<Ft&&(it=!0,Yt=ve+"_"+Ft),me[ve]=Ft+1;We.includes(Yt);)Yt=Yt+"_"+Ft;We.push(Yt)}if(it){var ti=W.split(T);ti[0]=We.join(P),W=ti.join(T)}}if(Pe||Pe!==!1&&W.indexOf(x)===-1){for(var mi=W.split(T),Rt=0;Rt<mi.length;Rt++){if($=mi[Rt],j+=$.length,Rt!==mi.length-1)j+=T.length;else if(He)return Mt();if(!B||$.substring(0,be)!==B){if(Ve){if(Ee=[],Gi($.split(P)),Bo(),ye)return Mt()}else Gi($.split(P));if(Z&&Z<=Rt)return Ee=Ee.slice(0,Z),Mt(!0)}}return Mt()}for(var we=W.indexOf(P,j),Me=W.indexOf(T,j),qi=new RegExp(v(fe)+v(x),"g"),ue=W.indexOf(x,j);;)if(W[j]!==x)if(B&&$.length===0&&W.substring(j,j+be)===B){if(Me===-1)return Mt();j=Me+je,Me=W.indexOf(T,j),we=W.indexOf(P,j)}else if(we!==-1&&(we<Me||Me===-1))$.push(W.substring(j,we)),j=we+de,we=W.indexOf(P,j);else{if(Me===-1)break;if($.push(W.substring(j,Me)),Fi(Me+je),Ve&&(Bo(),ye))return Mt();if(Z&&Ee.length>=Z)return Mt(!0)}else for(ue=j,j++;;){if((ue=W.indexOf(x,ue+1))===-1)return He||Ue.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Ee.length,index:j}),Oi();if(ue===L-1)return Oi(W.substring(j,ue).replace(qi,x));if(x!==fe||W[ue+1]!==fe){if(x===fe||ue===0||W[ue-1]!==fe){we!==-1&&we<ue+1&&(we=W.indexOf(P,ue+1)),Me!==-1&&Me<ue+1&&(Me=W.indexOf(T,ue+1));var Cn=Ii(Me===-1?we:Math.min(we,Me));if(W.substr(ue+1+Cn,de)===P){$.push(W.substring(j,ue).replace(qi,x)),W[j=ue+1+Cn+de]!==x&&(ue=W.indexOf(x,j)),we=W.indexOf(P,j),Me=W.indexOf(T,j);break}var gi=Ii(Me);if(W.substring(ue+1+gi,ue+1+gi+je)===T){if($.push(W.substring(j,ue).replace(qi,x)),Fi(ue+1+gi+je),we=W.indexOf(P,j),ue=W.indexOf(x,j),Ve&&(Bo(),ye))return Mt();if(Z&&Ee.length>=Z)return Mt(!0);break}Ue.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Ee.length,index:j}),ue++}}else ue++}return Oi();function Gi(Bt){Ee.push(Bt),se=j}function Ii(Bt){var fu=0;if(Bt!==-1){var Ba=W.substring(ue+1,Bt);Ba&&Ba.trim()===""&&(fu=Ba.length)}return fu}function Oi(Bt){return He||(Bt===void 0&&(Bt=W.substring(j)),$.push(Bt),j=L,Gi($),Ve&&Bo()),Mt()}function Fi(Bt){j=Bt,Gi($),$=[],Me=W.indexOf(T,j)}function Mt(Bt){return{data:Ee,errors:Ue,meta:{delimiter:P,linebreak:T,aborted:ye,truncated:!!Bt,cursor:se+(ht||0)}}}function Bo(){V(Mt()),Ee=[],Ue=[]}},this.abort=function(){ye=!0},this.getCharIndex=function(){return j}}function R(_){var x=_.data,P=r[x.workerId],T=!1;if(x.error)P.userError(x.error,x.file);else if(x.results&&x.results.data){var B={abort:function(){T=!0,O(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:N,resume:N};if(Y(P.userStep)){for(var V=0;V<x.results.data.length&&(P.userStep({data:x.results.data[V],errors:x.results.errors,meta:x.results.meta},B),!T);V++);delete x.results}else Y(P.userChunk)&&(P.userChunk(x.results,B,x.file),delete x.results)}x.finished&&!T&&O(x.workerId,x.results)}function O(_,x){var P=r[_];Y(P.userComplete)&&P.userComplete(x),P.terminate(),delete r[_]}function N(){throw new Error("Not implemented.")}function Q(_){if(typeof _!="object"||_===null)return _;var x=Array.isArray(_)?[]:{};for(var P in _)x[P]=Q(_[P]);return x}function U(_,x){return function(){_.apply(x,arguments)}}function Y(_){return typeof _=="function"}return i&&(e.onmessage=function(_){var x=_.data;if(s.WORKER_ID===void 0&&x&&(s.WORKER_ID=x.workerId),typeof x.input=="string")e.postMessage({workerId:s.WORKER_ID,results:s.parse(x.input,x.config),finished:!0});else if(e.File&&x.input instanceof File||x.input instanceof Object){var P=s.parse(x.input,x.config);P&&e.postMessage({workerId:s.WORKER_ID,results:P,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,(g.prototype=Object.create(l.prototype)).constructor=g,s})});var A0=M((Ma,hu)=>{(function(e,n){typeof Ma=="object"&&typeof hu=="object"?hu.exports=n():typeof define=="function"&&define.amd?define([],n):typeof Ma=="object"?Ma.printJS=n():e.printJS=n()})(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(i,r,o){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:o})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(r&1&&(i=n(i)),r&8||r&4&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),r&2&&typeof i!="string")for(var s in i)n.d(o,s,(function(a){return i[a]}).bind(null,s));return o},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)}({"./src/index.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/sass/index.scss"),r=n.n(i),o=n("./src/js/init.js"),s=o.default.init;typeof window<"u"&&(window.printJS=s),e.default=s},"./src/js/browser.js":function(t,e,n){"use strict";n.r(e);var i={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!i.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}};e.default=i},"./src/js/functions.js":function(t,e,n){"use strict";n.r(e),n.d(e,"addWrapper",function(){return s}),n.d(e,"capitalizePrint",function(){return a}),n.d(e,"collectStyles",function(){return l}),n.d(e,"addHeader",function(){return d}),n.d(e,"cleanUp",function(){return p}),n.d(e,"isRawHTML",function(){return g});var i=n("./src/js/modal.js"),r=n("./src/js/browser.js");function o(h){"@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(h)}function s(h,v){var C="font-family:"+v.font+" !important; font-size: "+v.font_size+" !important; width:100%;";return'<div style="'+C+'">'+h+"</div>"}function a(h){return h.charAt(0).toUpperCase()+h.slice(1)}function l(h,v){for(var C=document.defaultView||window,R="",O=C.getComputedStyle(h,""),N=0;N<O.length;N++)(v.targetStyles.indexOf("*")!==-1||v.targetStyle.indexOf(O[N])!==-1||c(v.targetStyles,O[N]))&&O.getPropertyValue(O[N])&&(R+=O[N]+":"+O.getPropertyValue(O[N])+";");return R+="max-width: "+v.maxWidth+"px !important; font-size: "+v.font_size+" !important;",R}function c(h,v){for(var C=0;C<h.length;C++)if(o(v)==="object"&&v.indexOf(h[C])!==-1)return!0;return!1}function d(h,v){var C=document.createElement("div");if(g(v.header))C.innerHTML=v.header;else{var R=document.createElement("h1"),O=document.createTextNode(v.header);R.appendChild(O),R.setAttribute("style",v.headerStyle),C.appendChild(R)}h.insertBefore(C,h.childNodes[0])}function p(h){h.showModal&&i.default.close(),h.onLoadingEnd&&h.onLoadingEnd(),(h.showModal||h.onLoadingStart)&&window.URL.revokeObjectURL(h.printable);var v="mouseover";(r.default.isChrome()||r.default.isFirefox())&&(v="focus");var C=function R(){window.removeEventListener(v,R),h.onPrintDialogClose();var O=document.getElementById(h.frameId);O&&O.remove()};window.addEventListener(v,C)}function g(h){var v=new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>");return v.test(h)}},"./src/js/html.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/functions.js"),r=n("./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)}e.default={print:function(c,d){var p=a(c.printable)?c.printable:document.getElementById(c.printable);if(!p){window.console.error("Invalid HTML element id: "+c.printable);return}c.printableElement=s(p,c),c.header&&Object(i.addHeader)(c.printableElement,c),r.default.send(c,d)}};function s(l,c){for(var d=l.cloneNode(),p=Array.prototype.slice.call(l.childNodes),g=0;g<p.length;g++)if(c.ignoreElements.indexOf(p[g].id)===-1){var h=s(p[g],c);d.appendChild(h)}switch(c.scanStyles&&l.nodeType===1&&d.setAttribute("style",Object(i.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 a(l){return o(l)==="object"&&l&&(l instanceof HTMLElement||l.nodeType===1)}},"./src/js/image.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/functions.js"),r=n("./src/js/print.js"),o=n("./src/js/browser.js");e.default={print:function(a,l){a.printable.constructor!==Array&&(a.printable=[a.printable]),a.printableElement=document.createElement("div"),a.printable.forEach(function(c){var d=document.createElement("img");if(d.setAttribute("style",a.imageStyle),d.src=c,o.default.isFirefox()){var p=d.src;d.src=p}var g=document.createElement("div");g.appendChild(d),a.printableElement.appendChild(g)}),a.header&&Object(i.addHeader)(a.printableElement,a),r.default.send(a,l)}}},"./src/js/init.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/browser.js"),r=n("./src/js/modal.js"),o=n("./src/js/pdf.js"),s=n("./src/js/html.js"),a=n("./src/js/raw-html.js"),l=n("./src/js/image.js"),c=n("./src/js/json.js");function d(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(v){return typeof v}:d=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},d(g)}var p=["pdf","html","image","json","raw-html"];e.default={init:function(){var h={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(U){throw U},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%;"},v=arguments[0];if(v===void 0)throw new Error("printJS expects at least 1 attribute.");switch(d(v)){case"string":h.printable=encodeURI(v),h.fallbackPrintable=h.printable,h.type=arguments[1]||h.type;break;case"object":h.printable=v.printable,h.fallbackPrintable=typeof v.fallbackPrintable<"u"?v.fallbackPrintable:h.printable,h.fallbackPrintable=h.base64?"data:application/pdf;base64,".concat(h.fallbackPrintable):h.fallbackPrintable;for(var C in h)C==="printable"||C==="fallbackPrintable"||(h[C]=typeof v[C]<"u"?v[C]:h[C]);break;default:throw new Error('Unexpected argument type! Expected "string" or "object", got '+d(v))}if(!h.printable)throw new Error("Missing printable information.");if(!h.type||typeof h.type!="string"||p.indexOf(h.type.toLowerCase())===-1)throw new Error("Invalid print type. Available types are: pdf, html, image and json.");h.showModal&&r.default.show(h),h.onLoadingStart&&h.onLoadingStart();var R=document.getElementById(h.frameId);R&&R.parentNode.removeChild(R);var O=document.createElement("iframe");switch(i.default.isFirefox()?O.setAttribute("style","width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0"):O.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute; border: 0"),O.setAttribute("id",h.frameId),h.type!=="pdf"&&(O.srcdoc="<html><head><title>"+h.documentTitle+"</title>",h.css&&(Array.isArray(h.css)||(h.css=[h.css]),h.css.forEach(function(Q){O.srcdoc+='<link rel="stylesheet" href="'+Q+'">'})),O.srcdoc+="</head><body></body></html>"),h.type){case"pdf":if(i.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var N=window.open(h.fallbackPrintable,"_blank");N.focus(),h.onIncompatibleBrowser()}catch(Q){h.onError(Q)}finally{h.showModal&&r.default.close(),h.onLoadingEnd&&h.onLoadingEnd()}else o.default.print(h,O);break;case"image":l.default.print(h,O);break;case"html":s.default.print(h,O);break;case"raw-html":a.default.print(h,O);break;case"json":c.default.print(h,O);break}}}},"./src/js/json.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/functions.js"),r=n("./src/js/print.js");function o(a){"@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(a)}e.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(i.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=s(l),r.default.send(l,c)}};function s(a){var l=a.printable,c=a.properties,d='<table style="border-collapse: collapse; width: 100%;">';a.repeatTableHeader&&(d+="<thead>"),d+="<tr>";for(var p=0;p<c.length;p++)d+='<th style="width:'+c[p].columnSize+";"+a.gridHeaderStyle+'">'+Object(i.capitalizePrint)(c[p].displayName)+"</th>";d+="</tr>",a.repeatTableHeader&&(d+="</thead>"),d+="<tbody>";for(var g=0;g<l.length;g++){d+="<tr>";for(var h=0;h<c.length;h++){var v=l[g],C=c[h].field.split(".");if(C.length>1)for(var R=0;R<C.length;R++)v=v[C[R]];else v=v[c[h].field];d+='<td style="width:'+c[h].columnSize+a.gridStyle+'">'+v+"</td>"}d+="</tr>"}return d+="</tbody></table>",d}},"./src/js/modal.js":function(t,e,n){"use strict";n.r(e);var i={show:function(o){var s="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;",a=document.createElement("div");a.setAttribute("style",s),a.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),a.appendChild(l),document.getElementsByTagName("body")[0].appendChild(a),document.getElementById("printClose").addEventListener("click",function(){i.close()})},close:function(){var o=document.getElementById("printJS-Modal");o&&o.parentNode.removeChild(o)}};e.default=i},"./src/js/pdf.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/print.js"),r=n("./src/js/functions.js");e.default={print:function(a,l){if(a.base64){var c=Uint8Array.from(atob(a.printable),function(p){return p.charCodeAt(0)});o(a,l,c);return}a.printable=/^(blob|http|\/\/)/i.test(a.printable)?a.printable:window.location.origin+(a.printable.charAt(0)!=="/"?"/"+a.printable:a.printable);var d=new window.XMLHttpRequest;d.responseType="arraybuffer",d.addEventListener("error",function(){Object(r.cleanUp)(a),a.onError(d.statusText,d)}),d.addEventListener("load",function(){if([200,201].indexOf(d.status)===-1){Object(r.cleanUp)(a),a.onError(d.statusText,d);return}o(a,l,d.response)}),d.open("GET",a.printable,!0),d.send()}};function o(s,a,l){var c=new window.Blob([l],{type:"application/pdf"});c=window.URL.createObjectURL(c),a.setAttribute("src",c),i.default.send(s,a)}},"./src/js/print.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/browser.js"),r=n("./src/js/functions.js"),o={send:function(d,p){document.getElementsByTagName("body")[0].appendChild(p);var g=document.getElementById(d.frameId);g.onload=function(){if(d.type==="pdf"){i.default.isFirefox()?setTimeout(function(){return s(g,d)},1e3):s(g,d);return}var h=g.contentWindow||g.contentDocument;if(h.document&&(h=h.document),h.body.appendChild(d.printableElement),d.type!=="pdf"&&d.style){var v=document.createElement("style");v.innerHTML=d.style,h.head.appendChild(v)}var C=h.getElementsByTagName("img");C.length>0?a(Array.from(C)).then(function(){return s(g,d)}):s(g,d)}}};function s(c,d){try{if(c.focus(),i.default.isEdge()||i.default.isIE())try{c.contentWindow.document.execCommand("print",!1,null)}catch{c.contentWindow.print()}else c.contentWindow.print()}catch(p){d.onError(p)}finally{i.default.isFirefox()&&(c.style.visibility="hidden",c.style.left="-1px"),Object(r.cleanUp)(d)}}function a(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 g(){!c||typeof c.naturalWidth>"u"||c.naturalWidth===0||!c.complete?setTimeout(g,500):d()};p()})}e.default=o},"./src/js/raw-html.js":function(t,e,n){"use strict";n.r(e);var i=n("./src/js/print.js");e.default={print:function(o,s){o.printableElement=document.createElement("div"),o.printableElement.setAttribute("style","width:100%"),o.printableElement.innerHTML=o.printable,i.default.send(o,s)}}},"./src/sass/index.scss":function(t,e,n){},0:function(t,e,n){t.exports=n("./src/index.js")}}).default})});var _w=ge(ac(),1);var Un=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({});let t=e;return t})();var ww=["*"],ks=(()=>{let e=class e{constructor(){this.title="",this.hasValid=!1,this.onClose=new st,this.onCancel=new st,this.onOK=new st,this.activeModal=I(Rn)}ngOnInit(){}onCancelHandler(){this.activeModal.close(),this.onCancel.emit()}onCloseHandler(){this.activeModal.close(),this.onClose.emit()}onOKHandler(){this.onOK.emit()}handleKeyboardEvent(i){i.key==="F2"&&this.onOKHandler()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-base-modal"]],hostBindings:function(r,o){r&1&&A("keydown",function(a){return o.handleKeyboardEvent(a)},!1,Su)},inputs:{title:"title",hasValid:"hasValid"},outputs:{onClose:"onClose",onCancel:"onCancel",onOK:"onOK"},standalone:!0,features:[ie],ngContentSelectors:ww,decls:12,vars:1,consts:[[1,"modal-header"],["id","modal-basic-title",1,"modal-title","font-robotoslab",2,"font-size","16px"],["aria-label","Close","type","button",1,"btn","btn-light-blue","text-primary","px-2","py-1",3,"click"],[1,"fas","fa-times"],[1,"modal-body"],[1,"modal-footer"],["type","button",1,"btn","btn-light-blue","btn-lg","text-primary","fw-semibold","fs-4",3,"click"]],template:function(r,o){r&1&&(Dn(),f(0,"div",0)(1,"h4",1),w(2),m(),f(3,"button",2),A("click",function(){return o.onCloseHandler()}),X(4,"i",3),m()(),f(5,"div",4),kn(6),m(),f(7,"div",5)(8,"button",6),A("click",function(){return o.onCancelHandler()}),w(9," Cancel "),m(),f(10,"button",6),A("click",function(){return o.onOKHandler()}),w(11," OK(F2) "),m()()),r&2&&(y(2),jt(" ",o.title," "))},dependencies:[Qo],styles:[".modal-header[_ngcontent-%COMP%]{background:#89b03e;display:flex;justify-content:space-between}.modal-title[_ngcontent-%COMP%]{color:#fff}.modal-body[_ngcontent-%COMP%]{max-height:60vh}"]});let t=e;return t})();function Ph(t){let{anchorOffset:e=0,focusOffset:n=0}=t.ownerDocument.getSelection()||{},i=Math.min(e,n),r=Math.max(e,n);return[i,r]}function xw(t,[e,n]){var i,r;let o=t.ownerDocument,s=o.createRange();s.setStart(t.firstChild||t,Math.min(e,((i=t.textContent)===null||i===void 0?void 0:i.length)||0)),s.setEnd(t.lastChild||t,Math.min(n,((r=t.textContent)===null||r===void 0?void 0:r.length)||0));let a=o.getSelection();a&&(a.removeAllRanges(),a.addRange(s))}var lc=class{constructor(e){this.element=e,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
|
|
11
11
|
`)}set value(e){this.element.innerHTML=e.replace(/\n$/,`
|
|
12
12
|
|
|
13
|
-
`)}get selectionStart(){return
|
|
13
|
+
`)}get selectionStart(){return Ph(this.element)[0]}get selectionEnd(){return Ph(this.element)[1]}setSelectionRange(e,n){xw(this.element,[e||0,n||0])}select(){this.setSelectionRange(0,this.value.length)}};function Cw(t){let e=new lc(t);return new Proxy(t,{get(n,i){if(i in e)return e[i];let r=n[i];return typeof r=="function"?r.bind(n):r},set(n,i,r,o){return Reflect.set(i in e?e:n,i,r,o)}})}var Th=t=>t.isContentEditable?Cw(t):t.querySelector("input,textarea")||t,Wn={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"},cc=class{constructor(){this.now=null,this.past=[],this.future=[]}undo(){let e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){let e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now){this.now=e;return}let n=this.now.value!==e.value,i=this.now.selection.some((r,o)=>r!==e.selection[o]);!n&&!i||(n&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,n){this.now=e,this.updateElementState(e,{inputType:n,data:null})}};function Sw(t,...e){return e.every(({value:n})=>n===t.value)}function Pw(t,...e){return e.every(({value:n,selection:i})=>n===t.value&&i[0]===t.selection[0]&&i[1]===t.selection[1])}function Ew({value:t,selection:e},n,i){let[r,o]=e,s=typeof i=="function"?i({value:t,selection:e}):i;return{value:t,selection:s==="replace"?[r,r+n.length]:[r,o]}}function Fs(t){return typeof t=="string"}function Eh(t,e,n,i){let r="";for(let o=e.length;o<t.length;o++){let s=t[o],a=i?.value[o]===s;if(!Fs(s)||s===n&&!a)return r;r+=s}return r}function Ih(t,e){return Array.isArray(e)?t.length===e.length&&Array.from(t).every((n,i)=>{let r=e[i];return Fs(r)?n===r:n.match(r)}):e.test(t)}function Dw(t,e,n){let i=null,r=null,o=Array.from(t.value).reduce((a,l,c)=>{let d=Eh(e,a,l,n),p=a+d,g=e[p.length];return Fs(g)?p+g:l.match(g)?(i===null&&c>=t.selection[0]&&(i=p.length),r===null&&c>=t.selection[1]&&(r=p.length),p+l):p},""),s=Eh(e,o,"",n);return{value:Ih(o+s,e)?o+s:o,selection:[i??o.length,r??o.length]}}function kw({value:t,selection:e},n){let[i,r]=e,o=i,s=r;return{value:Array.from(t).reduce((l,c,d)=>{let p=l+c;return i===d&&(o=l.length),r===d&&(s=l.length),p.match(n)?p:l},""),selection:[o,s]}}function Ts(t,e,n=null){if(Ih(t.value,e))return t;let{value:i,selection:r}=Array.isArray(e)?Dw(t,e,n):kw(t,e);return{selection:r,value:Array.isArray(e)?i.slice(0,e.length):i}}function Dh(t,e){if(!Array.isArray(e))return t;let[n,i]=t.selection,r=[],o=Array.from(t.value).reduce((s,a,l)=>{let c=e[l];return l===n&&r.push(s.length),l===i&&r.push(s.length),Fs(c)&&c===a?s:s+a},"");return r.length<2&&r.push(...new Array(2-r.length).fill(o.length)),{value:o,selection:[r[0],r[1]]}}var Fr=class{constructor(e,n){this.initialElementState=e,this.maskOptions=n,this.value="",this.selection=[0,0];let{value:i,selection:r}=Ts(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=i,this.selection=r}addCharacters([e,n],i){let{value:r}=this,o=this.getMaskExpression({value:r.slice(0,e)+i+r.slice(n),selection:[e+i.length,e+i.length]}),s={value:r,selection:[e,n]},a=Dh(s,o),[l,c]=Ew(a,i,this.maskOptions.overwriteMode).selection,d=a.value.slice(0,l)+i,p=d.length,g=Ts({value:d+a.value.slice(c),selection:[p,p]},o,s);if(r.slice(0,l)===Ts({value:d,selection:[p,p]},o,s).value||Pw(this,g))throw new Error("Invalid mask value");this.value=g.value,this.selection=g.selection}deleteCharacters([e,n]){if(e===n||!n)return;let{value:i}=this,r=this.getMaskExpression({value:i.slice(0,e)+i.slice(n),selection:[e,e]}),o={value:i,selection:[e,n]},s=Dh(o,r),[a,l]=s.selection,c=s.value.slice(0,a)+s.value.slice(l),d=Ts({value:c,selection:[a,a]},r,o);this.value=d.value,this.selection=d.selection}getMaskExpression(e){let{mask:n}=this.maskOptions;return typeof n=="function"?n(e):n}},dc=class{constructor(e){this.element=e,this.listeners=[]}listen(e,n,i){let r=n;this.element.addEventListener(e,r,i),this.listeners.push(()=>this.element.removeEventListener(e,r))}destroy(){this.listeners.forEach(e=>e())}},Kt={CTRL:1,ALT:2,SHIFT:4,META:8},Ir={Y:89,Z:90};function Or(t,e,n){return t.ctrlKey===!!(e&Kt.CTRL)&&t.altKey===!!(e&Kt.ALT)&&t.shiftKey===!!(e&Kt.SHIFT)&&t.metaKey===!!(e&Kt.META)&&t.keyCode===n}function Tw(t){return Or(t,Kt.CTRL,Ir.Y)||Or(t,Kt.CTRL|Kt.SHIFT,Ir.Z)||Or(t,Kt.META|Kt.SHIFT,Ir.Z)}function Iw(t){return Or(t,Kt.CTRL,Ir.Z)||Or(t,Kt.META,Ir.Z)}function $n(t,e){var n;let i=t.value;if(typeof e=="string")t.value=e;else{let[r,o]=e.selection;t.value=e.value,t.matches(":focus")&&((n=t.setSelectionRange)===null||n===void 0||n.call(t,r,o))}t.value!==i&&t.dispatchEvent(new Event("input",{bubbles:!0}))}function Ow({value:t,selection:e},n){let[i,r]=e;if(i!==r)return[i,r];let o=n?t.slice(i).indexOf(`
|
|
14
14
|
`)+1||t.length:t.slice(0,r).lastIndexOf(`
|
|
15
|
-
`)+1;return[n?i:o,n?o:r]}function
|
|
16
|
-
`)}};function qn(t,e,n){let i=Math.min(Number(n),Math.max(Number(e),Number(t)));return t instanceof Date?new Date(i):i}var Rw=[".",",","\u0431","\u044E"];var Mw=[":","."];var Bw="\xA0",Aw="\u200B",Rh="\u2013",Mh="\u2014",Rs="-",dc="\u2212",Bh="\u30FC";var Ah=/[\\^$.*+?()[\]{}|]/g,Nw=new RegExp(Ah.source);function lt(t){return t&&Nw.test(t)?t.replaceAll(Ah,"\\$&"):t}function Yt(t,{prefix:e,postfix:n}){var i,r;let o=new RegExp(`^${lt(e)}`),s=new RegExp(`${lt(n)}$`),[a=""]=(i=t.match(o))!==null&&i!==void 0?i:[],[l=""]=(r=t.match(s))!==null&&r!==void 0?r:[],c=t.replace(o,"").replace(s,"");return{extractedPrefix:a,extractedPostfix:l,cleanValue:c}}function zw(t,e){let n="";for(let i=0;i<t.length;i++){if(t[i]!==e[i])return n;n+=t[i]}return n}function Rr(t){return t}function Th(t){return t.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function Lw(){return({elementState:t,data:e})=>{let{value:n,selection:i}=t;return{elementState:{selection:i,value:Th(n)},data:Th(e)}}}function Hw(t){let e=new RegExp(`${lt(t)}$`);return t?({value:n,selection:i},r)=>{if(!n&&!r.value.endsWith(t))return{value:n,selection:i};if(!n.endsWith(t)&&!r.value.endsWith(t))return{selection:i,value:n+t};let o=r.value.replace(e,""),s=r.selection[1]>=o.length,a=zw(o,n);return{selection:i,value:Array.from(t).reverse().reduce((l,c,d)=>{let p=l.length-1-d,g=a[p]===c&&s;return l[p]!==c||g?l.slice(0,p+1)+c+l.slice(p+1):l},n)}}:Rr}function jw(t){return t?({value:e,selection:n},i)=>{if(e.startsWith(t)||!e&&!i.value.startsWith(t))return{value:e,selection:n};let[r,o]=n,s=Array.from(t).reduce((l,c,d)=>l[d]===c?l:l.slice(0,d)+c+l.slice(d),e),a=s.length-e.length;return{selection:[r+a,o+a],value:s}}:Rr}function Gn(t,e,n){return(i,r)=>{let o=()=>e(i,r);return i.addEventListener(t,o,n),()=>i.removeEventListener(t,o,n)}}function Nh(t){return e=>{let n=e.ownerDocument,i=0,r=()=>i++,o=()=>{i=Math.max(--i,0)},s=()=>{if(!e.matches(":focus"))return;if(i)return n.addEventListener("mouseup",s,{once:!0,passive:!0});let a=e.selectionStart||0,l=e.selectionEnd||0,[c,d]=t(e.value,[a,l]);(c>a||d<l)&&e.setSelectionRange(qn(a,c,d),qn(l,c,d))};return n.addEventListener("selectionchange",s,{passive:!0}),e.addEventListener("mousedown",r,{passive:!0}),n.addEventListener("mouseup",o,{passive:!0}),()=>{n.removeEventListener("selectionchange",s),n.removeEventListener("mousedown",r),n.removeEventListener("mouseup",o)}}}var Mk=new RegExp(`[${Mw.map(lt).join("")}]$`);function Vw({prefix:t,postfix:e}){return({elementState:n,data:i})=>{let{cleanValue:r}=Yt(i,{prefix:t,postfix:e});return{elementState:n,data:r}}}function zh({decimalSeparator:t,isNegativeAllowed:e,precision:n,thousandSeparator:i,prefix:r,postfix:o,decimalPseudoSeparators:s=[],pseudoMinuses:a=[],minusSign:l}){let c=Ih(r),d="\\d",p=e?`[${l}${a.map(C=>`\\${C}`).join("")}]?`:"",g=i?`[${d}${lt(i).replaceAll(/\s/g,"\\s")}]*`:`[${d}]*`,h=n>0?`([${lt(t)}${s.map(lt).join("")}]${d}{0,${Number.isFinite(n)?n:""}})?`:"",v=Ih(o);return new RegExp(`^${c}${p}${g}${h}${v}$`)}function Ih(t){return t?`${t.split("").map(e=>`${lt(e)}?`).join("")}`:""}function uc(t,e="."){let n=!!t.match(new RegExp(`^\\D*[${dc}\\${Rs}${Rh}${Mh}${Bh}]`)),i=lt(e),r=t.replaceAll(new RegExp(`${i}(?!\\d)`,"g"),"").replaceAll(new RegExp(`[^\\d${i}]`,"g"),"").replace(e,".");return r?Number((n?Rs:"")+r):NaN}function Uw(t){let e=String(t),[n,i]=e.split("e-"),r=e;if(i){let[,o]=n.split("."),s=Number(i)+(o?.length||0);r=t.toFixed(s)}return r}function Lh(t,{decimalSeparator:e,thousandSeparator:n}){let[i="",r=""]=t.split(e),[,o="",s=""]=i.match(new RegExp(`([^\\d${lt(n)}]+)?(.*)`))||[];return{minus:o,integerPart:s,decimalPart:r}}function Ww({decimalSeparator:t,thousandSeparator:e,decimalPseudoSeparators:n=Rw}){return n.filter(i=>i!==e&&i!==t)}function $w({decimalSeparator:t,precision:e,decimalZeroPadding:n,prefix:i,postfix:r}){return e<=0||!n?Rr:({value:o,selection:s})=>{let{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=Yt(o,{prefix:i,postfix:r});if(Number.isNaN(uc(a,t)))return{value:o,selection:s};let[d,p=""]=a.split(t);return{value:l+d+t+p.padEnd(e,"0")+c,selection:s}}}function qw({prefix:t,postfix:e,decimalSeparator:n,thousandSeparator:i}){return({value:r,selection:o})=>{let[s]=o,{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=Yt(r,{prefix:t,postfix:e}),{minus:d,integerPart:p,decimalPart:g}=Lh(a,{decimalSeparator:n,thousandSeparator:i}),h=!p&&!g&&a.includes(n);return!p&&!Number(g)&&s===(d+l).length||h?{selection:o,value:l+d+c}:{value:r,selection:o}}}function Gw({decimalSeparator:t,decimalPseudoSeparators:e,pseudoMinuses:n,prefix:i,postfix:r,minusSign:o}){let s=!0,a=zh({decimalSeparator:t,decimalPseudoSeparators:e,pseudoMinuses:n,prefix:"",postfix:"",thousandSeparator:"",precision:1/0,isNegativeAllowed:!0,minusSign:o});return({elementState:l,data:c})=>{if(!s)return{elementState:l,data:c};s=!1;let{value:d,selection:p}=l,[g,h]=p,{extractedPrefix:v,cleanValue:C,extractedPostfix:R}=Yt(d,{prefix:i,postfix:r}),I=Ji({selection:[Math.max(g-v.length,0),qn(h-v.length,0,C.length)],value:C},{mask:a}),[N,Q]=I.selection;return{elementState:{selection:[N+v.length,Q+v.length],value:v+I.value+R},data:c}}}function Xw({decimalSeparator:t,thousandSeparator:e,prefix:n,postfix:i}){let r=s=>{let a=lt(e);return s.replace(new RegExp(`^(\\D+)?[0${a}]+(?=0)`),"$1").replace(new RegExp(`^(\\D+)?[0${a}]+(?=[1-9])`),"$1")},o=(s,a)=>{let l=s.slice(0,a),c=s.slice(a).startsWith("0");return l.length-r(l).length+(c?1:0)};return({value:s,selection:a})=>{let[l,c]=a,{cleanValue:d,extractedPrefix:p,extractedPostfix:g}=Yt(s,{prefix:n,postfix:i}),h=d.includes(t),[v,C=""]=d.split(t),R=r(v);if(v===R)return{value:s,selection:a};let I=l-o(s,l),N=c-o(s,c);return{value:p+R+(h?t:"")+C+g,selection:[Math.max(I,0),Math.max(N,0)]}}}function Yw({min:t,max:e,decimalSeparator:n,minusSign:i}){return({value:r,selection:o})=>{let s=uc(r,n),a=s>0?Math.min(s,e):Math.max(s,t);if(s&&a!==s){let l=`${a}`.replace(".",n).replace(Rs,i);return{value:l,selection:[l.length,l.length]}}return{value:r,selection:o}}}function Kw({decimalSeparator:t,thousandSeparator:e,decimalZeroPadding:n}){return({elementState:i,data:r},o)=>{let{value:s,selection:a}=i,[l,c]=a,d=s.slice(l,c),p=n?[t,e]:[e],g=n&&l>s.indexOf(t)&&!!d.match(/^0+$/gi);return o!=="deleteBackward"&&o!=="deleteForward"||!p.includes(d)&&!g?{elementState:i,data:r}:{elementState:{value:s,selection:o==="deleteForward"?[c,c]:[l,l]},data:r}}}function Qw({decimalSeparator:t,precision:e,prefix:n,postfix:i}){let r=new RegExp(`^\\D*${lt(t)}`);return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPrefix:d}=Yt(a,{prefix:n,postfix:i}),[p,g]=l,h=qn(p-d.length,0,c.length),v=qn(g-d.length,0,c.length);if(e<=0||c.slice(0,h).includes(t)||c.slice(v).includes(t)||!s.match(r))return{elementState:o,data:s};let C=c.slice(0,h).match(/\d+/);return{elementState:o,data:C?s:`0${s}`}}}function Oh({validCharacter:t,pseudoCharacters:e,prefix:n,postfix:i}){let r=new RegExp(`[${e.join("")}]`,"gi");return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPostfix:d,extractedPrefix:p}=Yt(a,{prefix:n,postfix:i});return{elementState:{selection:l,value:p+c.replace(r,t)+d},data:s.replace(r,t)}}}function Zw({decimalSeparator:t,prefix:e,postfix:n}){return({elementState:i,data:r})=>{let{value:o,selection:s}=i,[a,l]=s,{cleanValue:c}=Yt(o,{prefix:e,postfix:n});return{elementState:i,data:!c.includes(t)||o.slice(a,l+1).includes(t)?r:r.replaceAll(new RegExp(lt(t),"gi"),"")}}}function Jw({thousandSeparator:t,decimalSeparator:e,prefix:n,postfix:i}){if(!t)return Rr;let r=(...o)=>o.every(s=>/\s/.test(s));return({value:o,selection:s})=>{let{cleanValue:a,extractedPostfix:l,extractedPrefix:c}=Yt(o,{prefix:n,postfix:i}),{minus:d,integerPart:p,decimalPart:g}=Lh(a,{decimalSeparator:e,thousandSeparator:t}),[h,v]=s,[C,R]=s,I=Array.from(p).reduceRight((N,Q,U)=>{let _=!(!U&&Q===t)&&N.length&&(N.length+1)%4===0;return _&&(Q===t||r(Q,t))?t+N:Q===t&&!_?(U&&U<=h&&C--,U&&U<=v&&R--,N):_?(U<=h&&C++,U<=v&&R++,Q+t+N):Q+N},"");return{value:c+d+I+(a.includes(e)?e:"")+g+l,selection:[C,R]}}}function ex({precision:t,decimalSeparator:e,prefix:n,postfix:i}){if(t>0)return Rr;let r=new RegExp(`${lt(e)}.*$`,"g");return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPrefix:d,extractedPostfix:p}=Yt(a,{prefix:n,postfix:i}),[g,h]=l,v=d+c.replace(r,"")+p;return{elementState:{selection:[Math.min(g,v.length),Math.min(h,v.length)],value:v},data:s.replace(r,"")}}}var Fh=[0,0];function tx({decimalSeparator:t,thousandSeparator:e,prefix:n,postfix:i}){let r=Xw({decimalSeparator:t,thousandSeparator:e,prefix:n,postfix:i});return Gn("blur",o=>{let s=r({value:o.value,selection:Fh},{value:"",selection:Fh}).value;$n(o,s)},{capture:!0})}function ix({min:t,max:e,decimalSeparator:n}){return Gn("blur",(i,r)=>{let o=uc(i.value,n),s=qn(o,t,e);!Number.isNaN(o)&&o!==s&&$n(i,Ji(Uw(s),r))},{capture:!0})}function nx({decimalSeparator:t,prefix:e,postfix:n}){return Gn("blur",i=>{let{cleanValue:r,extractedPostfix:o,extractedPrefix:s}=Yt(i.value,{prefix:e,postfix:n}),a=s+r.replace(new RegExp(`^(\\D+)?${lt(t)}`),`$10${t}`)+o;$n(i,a)},{capture:!0})}function Xn({max:t=Number.MAX_SAFE_INTEGER,min:e=Number.MIN_SAFE_INTEGER,precision:n=0,thousandSeparator:i=Bw,decimalSeparator:r=".",decimalPseudoSeparators:o,decimalZeroPadding:s=!1,prefix:a="",postfix:l="",minusSign:c=dc}={}){let d=[Rs,Rh,Mh,Bh,dc].filter(h=>h!==i&&h!==r&&h!==c),p=Ww({decimalSeparator:r,thousandSeparator:i,decimalPseudoSeparators:o}),g=a.endsWith(r)&&n>0?`${a}${Aw}`:a;return Object.assign(Object.assign({},Wn),{mask:zh({decimalSeparator:r,precision:n,thousandSeparator:i,prefix:g,postfix:l,isNegativeAllowed:e<0,minusSign:c}),preprocessors:[Lw(),Gw({decimalSeparator:r,decimalPseudoSeparators:p,pseudoMinuses:d,prefix:g,postfix:l,minusSign:c}),Vw({prefix:g,postfix:l}),Oh({validCharacter:c,pseudoCharacters:d,prefix:g,postfix:l}),Oh({validCharacter:r,pseudoCharacters:p,prefix:g,postfix:l}),Qw({decimalSeparator:r,precision:n,prefix:g,postfix:l}),Kw({decimalSeparator:r,decimalZeroPadding:s,thousandSeparator:i}),ex({precision:n,decimalSeparator:r,prefix:g,postfix:l}),Zw({decimalSeparator:r,prefix:g,postfix:l})],postprocessors:[Yw({decimalSeparator:r,min:e,max:t,minusSign:c}),jw(g),Hw(l),Jw({decimalSeparator:r,thousandSeparator:i,prefix:g,postfix:l}),$w({decimalSeparator:r,decimalZeroPadding:s,precision:n,prefix:g,postfix:l}),qw({prefix:g,postfix:l,decimalSeparator:r,thousandSeparator:i})],plugins:[tx({decimalSeparator:r,thousandSeparator:i,prefix:g,postfix:l}),nx({decimalSeparator:r,prefix:g,postfix:l}),ix({min:e,max:t,decimalSeparator:r})],overwriteMode:s?({value:h,selection:[v]})=>v<=h.indexOf(r)?"shift":"replace":"shift"})}var ji=(()=>{let e=class e{constructor(){this.elementRef=F(mt).nativeElement,this.ngZone=F(gt),this.maskedElement=null,this.options=null,this.elementPredicate=Dh;let i=F(Ge,{self:!0,optional:!0});if(i){let r=i.writeValue.bind(i);i.writeValue=o=>{r(this.options?Ji(String(o??""),this.options):o)}}}ngOnChanges(){return O(this,null,function*(){let{elementPredicate:i,options:r}=this;if(this.maskedElement?.destroy(),!r)return;let o=yield i(this.elementRef);this.elementPredicate===i&&this.ngZone.runOutsideAngular(()=>{this.maskedElement=new Os(o,r)})})}ngOnDestroy(){this.maskedElement?.destroy()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275dir=Ki({type:e,selectors:[["","maskito",""]],inputs:{options:[0,"maskito","options"],elementPredicate:[0,"maskitoElement","elementPredicate"]},standalone:!0,features:[ni]});let t=e;return t})(),Hh=(()=>{let e=class e{transform(i,r){return Ji(String(i??""),r??Wn)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=Lo({name:"maskito",type:e,pure:!0,standalone:!0});let t=e;return t})();var ox=20,Vh=(()=>{let e=class e{constructor(i,r,o){this._ngZone=i,this._platform=r,this._scrolled=new qe,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=o}register(i){this.scrollContainers.has(i)||this.scrollContainers.set(i,i.elementScrolled().subscribe(()=>this._scrolled.next(i)))}deregister(i){let r=this.scrollContainers.get(i);r&&(r.unsubscribe(),this.scrollContainers.delete(i))}scrolled(i=ox){return this._platform.isBrowser?new ft(r=>{this._globalSubscription||this._addGlobalListener();let o=i>0?this._scrolled.pipe(Aa(i)).subscribe(r):this._scrolled.subscribe(r);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):Ze()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((i,r)=>this.deregister(r)),this._scrolled.complete()}ancestorScrolled(i,r){let o=this.getAncestorScrollContainers(i);return this.scrolled(r).pipe(ii(s=>!s||o.indexOf(s)>-1))}getAncestorScrollContainers(i){let r=[];return this.scrollContainers.forEach((o,s)=>{this._scrollableContainsElement(s,i)&&r.push(s)}),r}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(i,r){let o=Gu(r),s=i.getElementRef().nativeElement;do if(o==s)return!0;while(o=o.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>{let i=this._getWindow();return Xi(i.document,"scroll").subscribe(()=>this._scrolled.next())})}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}};e.\u0275fac=function(r){return new(r||e)(J(gt),J(vi),J(at,8))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var sx=20,Mr=(()=>{let e=class e{constructor(i,r,o){this._platform=i,this._change=new qe,this._changeListener=s=>{this._change.next(s)},this._document=o,r.runOutsideAngular(()=>{if(i.isBrowser){let s=this._getWindow();s.addEventListener("resize",this._changeListener),s.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let i=this._getWindow();i.removeEventListener("resize",this._changeListener),i.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let i={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),i}getViewportRect(){let i=this.getViewportScrollPosition(),{width:r,height:o}=this.getViewportSize();return{top:i.top,left:i.left,bottom:i.top+o,right:i.left+r,height:o,width:r}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let i=this._document,r=this._getWindow(),o=i.documentElement,s=o.getBoundingClientRect(),a=-s.top||i.body.scrollTop||r.scrollY||o.scrollTop||0,l=-s.left||i.body.scrollLeft||r.scrollX||o.scrollLeft||0;return{top:a,left:l}}change(i=sx){return i>0?this._change.pipe(Aa(i)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let i=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:i.innerWidth,height:i.innerHeight}:{width:0,height:0}}};e.\u0275fac=function(r){return new(r||e)(J(vi),J(gt),J(at,8))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Ms=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({});let t=e;return t})(),pc=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({imports:[yr,Ms,yr,Ms]});let t=e;return t})();var Wh=qu(),hc=class{constructor(e,n){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=n}attach(){}enable(){if(this._canBeEnabled()){let e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=Te(-this._previousScrollPosition.left),e.style.top=Te(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let e=this._document.documentElement,n=this._document.body,i=e.style,r=n.style,o=i.scrollBehavior||"",s=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),Wh&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Wh&&(i.scrollBehavior=o,r.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let n=this._document.body,i=this._viewportRuler.getViewportSize();return n.scrollHeight>i.height||n.scrollWidth>i.width}};var fc=class{constructor(e,n,i,r){this._scrollDispatcher=e,this._ngZone=n,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(this._scrollSubscription)return;let e=this._scrollDispatcher.scrolled(0).pipe(ii(n=>!n||!this._overlayRef.overlayElement.contains(n.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{let n=this._viewportRuler.getViewportScrollPosition().top;Math.abs(n-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},Bs=class{enable(){}disable(){}attach(){}};function mc(t,e){return e.some(n=>{let i=t.bottom<n.top,r=t.top>n.bottom,o=t.right<n.left,s=t.left>n.right;return i||r||o||s})}function $h(t,e){return e.some(n=>{let i=t.top<n.top,r=t.bottom>n.bottom,o=t.left<n.left,s=t.right>n.right;return i||r||o||s})}var gc=class{constructor(e,n,i,r){this._scrollDispatcher=e,this._viewportRuler=n,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(!this._scrollSubscription){let e=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(e).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let n=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:r}=this._viewportRuler.getViewportSize();mc(n,[{width:i,height:r,bottom:r,right:i,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}},lx=(()=>{let e=class e{constructor(i,r,o,s){this._scrollDispatcher=i,this._viewportRuler=r,this._ngZone=o,this.noop=()=>new Bs,this.close=a=>new fc(this._scrollDispatcher,this._ngZone,this._viewportRuler,a),this.block=()=>new hc(this._viewportRuler,this._document),this.reposition=a=>new gc(this._scrollDispatcher,this._viewportRuler,this._ngZone,a),this._document=s}};e.\u0275fac=function(r){return new(r||e)(J(Vh),J(Mr),J(gt),J(at))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),Br=class{constructor(e){if(this.scrollStrategy=new Bs,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){let n=Object.keys(e);for(let i of n)e[i]!==void 0&&(this[i]=e[i])}}};var yc=class{constructor(e,n){this.connectionPair=e,this.scrollableViewProperties=n}};var Qh=(()=>{let e=class e{constructor(i){this._attachedOverlays=[],this._document=i}ngOnDestroy(){this.detach()}add(i){this.remove(i),this._attachedOverlays.push(i)}remove(i){let r=this._attachedOverlays.indexOf(i);r>-1&&this._attachedOverlays.splice(r,1),this._attachedOverlays.length===0&&this.detach()}};e.\u0275fac=function(r){return new(r||e)(J(at))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),cx=(()=>{let e=class e extends Qh{constructor(i,r){super(i),this._ngZone=r,this._keydownListener=o=>{let s=this._attachedOverlays;for(let a=s.length-1;a>-1;a--)if(s[a]._keydownEvents.observers.length>0){let l=s[a]._keydownEvents;this._ngZone?this._ngZone.run(()=>l.next(o)):l.next(o);break}}}add(i){super.add(i),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)}};e.\u0275fac=function(r){return new(r||e)(J(at),J(gt,8))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),dx=(()=>{let e=class e extends Qh{constructor(i,r,o){super(i),this._platform=r,this._ngZone=o,this._cursorStyleIsSet=!1,this._pointerDownListener=s=>{this._pointerDownEventTarget=vr(s)},this._clickListener=s=>{let a=vr(s),l=s.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:a;this._pointerDownEventTarget=null;let c=this._attachedOverlays.slice();for(let d=c.length-1;d>-1;d--){let p=c[d];if(p._outsidePointerEvents.observers.length<1||!p.hasAttached())continue;if(qh(p.overlayElement,a)||qh(p.overlayElement,l))break;let g=p._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>g.next(s)):g.next(s)}}}add(i){if(super.add(i),!this._isAttached){let r=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(r)):this._addEventListeners(r),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=r.style.cursor,r.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){let i=this._document.body;i.removeEventListener("pointerdown",this._pointerDownListener,!0),i.removeEventListener("click",this._clickListener,!0),i.removeEventListener("auxclick",this._clickListener,!0),i.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(i.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(i){i.addEventListener("pointerdown",this._pointerDownListener,!0),i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0)}};e.\u0275fac=function(r){return new(r||e)(J(at),J(vi),J(gt,8))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function qh(t,e){let n=typeof ShadowRoot<"u"&&ShadowRoot,i=e;for(;i;){if(i===t)return!0;i=n&&i instanceof ShadowRoot?i.host:i.parentNode}return!1}var Zh=(()=>{let e=class e{constructor(i,r){this._platform=r,this._document=i}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let i="cdk-overlay-container";if(this._platform.isBrowser||Za()){let o=this._document.querySelectorAll(`.${i}[platform="server"], .${i}[platform="test"]`);for(let s=0;s<o.length;s++)o[s].remove()}let r=this._document.createElement("div");r.classList.add(i),Za()?r.setAttribute("platform","test"):this._platform.isBrowser||r.setAttribute("platform","server"),this._document.body.appendChild(r),this._containerElement=r}};e.\u0275fac=function(r){return new(r||e)(J(at),J(vi))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),vc=class{constructor(e,n,i,r,o,s,a,l,c,d=!1,p){this._portalOutlet=e,this._host=n,this._pane=i,this._config=r,this._ngZone=o,this._keyboardDispatcher=s,this._document=a,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=d,this._injector=p,this._backdropElement=null,this._backdropClick=new qe,this._attachments=new qe,this._detachments=new qe,this._locationChanges=Ri.EMPTY,this._backdropClickHandler=g=>this._backdropClick.next(g),this._backdropTransitionendHandler=g=>{this._disposeBackdrop(g.target)},this._keydownEvents=new qe,this._outsidePointerEvents=new qe,this._renders=new qe,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy,this._afterRenderRef=Eu(()=>Su(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let n=this._portalOutlet.attach(e);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),Vo(()=>{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 n?.onDestroy=="function"&&n.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),n}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){let e=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._previousHostParent=this._pane=this._host=null,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=b(b({},this._config),e),this._updateElementSize()}setDirection(e){this._config=E(b({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){let e=this._config.direction;return e?typeof e=="string"?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let e=this._pane.style;e.width=Te(this._config.width),e.height=Te(this._config.height),e.minWidth=Te(this._config.minWidth),e.minHeight=Te(this._config.minHeight),e.maxWidth=Te(this._config.maxWidth),e.maxHeight=Te(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){let e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(e){if(this._animationsDisabled){this._disposeBackdrop(e);return}e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",this._backdropTransitionendHandler)}),e.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(()=>{this._disposeBackdrop(e)},500))}}_toggleClasses(e,n,i){let r=Ja(n||[]).filter(o=>!!o);r.length&&(i?e.classList.add(...r):e.classList.remove(...r))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{let e=this._renders.pipe(ja(Yi(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()),e.unsubscribe())})})}_disposeScrollStrategy(){let e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}_disposeBackdrop(e){e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",this._backdropTransitionendHandler),e.remove(),this._backdropElement===e&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}},Gh="cdk-overlay-connected-position-bounding-box",ux=/([A-Za-z%]+)$/,bc=class{get positions(){return this._preferredPositions}constructor(e,n,i,r,o){this._viewportRuler=n,this._document=i,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 qe,this._resizeSubscription=Ri.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}attach(e){this._overlayRef&&this._overlayRef,this._validatePositions(),e.hostElement.classList.add(Gh),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,n=this._overlayRect,i=this._viewportRect,r=this._containerRect,o=[],s;for(let a of this._preferredPositions){let l=this._getOriginPoint(e,r,a),c=this._getOverlayPoint(l,n,a),d=this._getOverlayFit(c,n,i,a);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(a,l);return}if(this._canFitWithFlexibleDimensions(d,c,i)){o.push({position:a,origin:l,overlayRect:n,boundingBoxRect:this._calculateBoundingBoxRect(l,a)});continue}(!s||s.overlayFit.visibleArea<d.visibleArea)&&(s={overlayFit:d,overlayPoint:c,originPoint:l,position:a,overlayRect:n})}if(o.length){let a=null,l=-1;for(let c of o){let d=c.boundingBoxRect.width*c.boundingBoxRect.height*(c.position.weight||1);d>l&&(l=d,a=c)}this._isPushed=!1,this._applyPosition(a.position,a.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(s.position,s.originPoint);return}this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&en(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Gh),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let e=this._lastPosition;if(e){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let n=this._getOriginPoint(this._originRect,this._containerRect,e);this._applyPosition(e,n)}else this.apply()}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,e.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,n,i){let r;if(i.originX=="center")r=e.left+e.width/2;else{let s=this._isRtl()?e.right:e.left,a=this._isRtl()?e.left:e.right;r=i.originX=="start"?s:a}n.left<0&&(r-=n.left);let o;return i.originY=="center"?o=e.top+e.height/2:o=i.originY=="top"?e.top:e.bottom,n.top<0&&(o-=n.top),{x:r,y:o}}_getOverlayPoint(e,n,i){let r;i.overlayX=="center"?r=-n.width/2:i.overlayX==="start"?r=this._isRtl()?-n.width:0:r=this._isRtl()?0:-n.width;let o;return i.overlayY=="center"?o=-n.height/2:o=i.overlayY=="top"?0:-n.height,{x:e.x+r,y:e.y+o}}_getOverlayFit(e,n,i,r){let o=Yh(n),{x:s,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(s+=l),c&&(a+=c);let d=0-s,p=s+o.width-i.width,g=0-a,h=a+o.height-i.height,v=this._subtractOverflows(o.width,d,p),C=this._subtractOverflows(o.height,g,h),R=v*C;return{visibleArea:R,isCompletelyWithinViewport:o.width*o.height===R,fitsInViewportVertically:C===o.height,fitsInViewportHorizontally:v==o.width}}_canFitWithFlexibleDimensions(e,n,i){if(this._hasFlexibleDimensions){let r=i.bottom-n.y,o=i.right-n.x,s=Xh(this._overlayRef.getConfig().minHeight),a=Xh(this._overlayRef.getConfig().minWidth),l=e.fitsInViewportVertically||s!=null&&s<=r,c=e.fitsInViewportHorizontally||a!=null&&a<=o;return l&&c}return!1}_pushOverlayOnScreen(e,n,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};let r=Yh(n),o=this._viewportRect,s=Math.max(e.x+r.width-o.width,0),a=Math.max(e.y+r.height-o.height,0),l=Math.max(o.top-i.top-e.y,0),c=Math.max(o.left-i.left-e.x,0),d=0,p=0;return r.width<=o.width?d=c||-s:d=e.x<this._viewportMargin?o.left-i.left-e.x:0,r.height<=o.height?p=l||-a:p=e.y<this._viewportMargin?o.top-i.top-e.y:0,this._previousPushAmount={x:d,y:p},{x:e.x+d,y:e.y+p}}_applyPosition(e,n){if(this._setTransformOrigin(e),this._setOverlayElementStyles(n,e),this._setBoundingBoxStyles(n,e),e.panelClass&&this._addPanelClasses(e.panelClass),this._positionChanges.observers.length){let i=this._getScrollVisibility();if(e!==this._lastPosition||!this._lastScrollVisibility||!px(this._lastScrollVisibility,i)){let r=new yc(e,i);this._positionChanges.next(r)}this._lastScrollVisibility=i}this._lastPosition=e,this._isInitialRender=!1}_setTransformOrigin(e){if(!this._transformOriginSelector)return;let n=this._boundingBox.querySelectorAll(this._transformOriginSelector),i,r=e.overlayY;e.overlayX==="center"?i="center":this._isRtl()?i=e.overlayX==="start"?"right":"left":i=e.overlayX==="start"?"left":"right";for(let o=0;o<n.length;o++)n[o].style.transformOrigin=`${i} ${r}`}_calculateBoundingBoxRect(e,n){let i=this._viewportRect,r=this._isRtl(),o,s,a;if(n.overlayY==="top")s=e.y,o=i.height-s+this._viewportMargin;else if(n.overlayY==="bottom")a=i.height-e.y+this._viewportMargin*2,o=i.height-a+this._viewportMargin;else{let h=Math.min(i.bottom-e.y+i.top,e.y),v=this._lastBoundingBoxSize.height;o=h*2,s=e.y-h,o>v&&!this._isInitialRender&&!this._growAfterOpen&&(s=e.y-v/2)}let l=n.overlayX==="start"&&!r||n.overlayX==="end"&&r,c=n.overlayX==="end"&&!r||n.overlayX==="start"&&r,d,p,g;if(c)g=i.width-e.x+this._viewportMargin*2,d=e.x-this._viewportMargin;else if(l)p=e.x,d=i.right-e.x;else{let h=Math.min(i.right-e.x+i.left,e.x),v=this._lastBoundingBoxSize.width;d=h*2,p=e.x-h,d>v&&!this._isInitialRender&&!this._growAfterOpen&&(p=e.x-v/2)}return{top:s,left:p,bottom:a,right:g,width:d,height:o}}_setBoundingBoxStyles(e,n){let i=this._calculateBoundingBoxRect(e,n);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.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,s=this._overlayRef.getConfig().maxWidth;r.height=Te(i.height),r.top=Te(i.top),r.bottom=Te(i.bottom),r.width=Te(i.width),r.left=Te(i.left),r.right=Te(i.right),n.overlayX==="center"?r.alignItems="center":r.alignItems=n.overlayX==="end"?"flex-end":"flex-start",n.overlayY==="center"?r.justifyContent="center":r.justifyContent=n.overlayY==="bottom"?"flex-end":"flex-start",o&&(r.maxHeight=Te(o)),s&&(r.maxWidth=Te(s))}this._lastBoundingBoxSize=i,en(this._boundingBox.style,r)}_resetBoundingBoxStyles(){en(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){en(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,n){let i={},r=this._hasExactPosition(),o=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(r){let d=this._viewportRuler.getViewportScrollPosition();en(i,this._getExactOverlayY(n,e,d)),en(i,this._getExactOverlayX(n,e,d))}else i.position="static";let a="",l=this._getOffset(n,"x"),c=this._getOffset(n,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),s.maxHeight&&(r?i.maxHeight=Te(s.maxHeight):o&&(i.maxHeight="")),s.maxWidth&&(r?i.maxWidth=Te(s.maxWidth):o&&(i.maxWidth="")),en(this._pane.style,i)}_getExactOverlayY(e,n,i){let r={top:"",bottom:""},o=this._getOverlayPoint(n,this._overlayRect,e);if(this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,i)),e.overlayY==="bottom"){let s=this._document.documentElement.clientHeight;r.bottom=`${s-(o.y+this._overlayRect.height)}px`}else r.top=Te(o.y);return r}_getExactOverlayX(e,n,i){let r={left:"",right:""},o=this._getOverlayPoint(n,this._overlayRect,e);this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,i));let s;if(this._isRtl()?s=e.overlayX==="end"?"left":"right":s=e.overlayX==="end"?"right":"left",s==="right"){let a=this._document.documentElement.clientWidth;r.right=`${a-(o.x+this._overlayRect.width)}px`}else r.left=Te(o.x);return r}_getScrollVisibility(){let e=this._getOriginRect(),n=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:$h(e,i),isOriginOutsideView:mc(e,i),isOverlayClipped:$h(n,i),isOverlayOutsideView:mc(n,i)}}_subtractOverflows(e,...n){return n.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){let e=this._document.documentElement.clientWidth,n=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+n-this._viewportMargin,width:e-2*this._viewportMargin,height:n-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,n){return n==="x"?e.offsetX==null?this._offsetX:e.offsetX:e.offsetY==null?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&Ja(e).forEach(n=>{n!==""&&this._appliedPanelClasses.indexOf(n)===-1&&(this._appliedPanelClasses.push(n),this._pane.classList.add(n))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){let e=this._origin;if(e instanceof mt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();let n=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+n,height:i,width:n}}};function en(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Xh(t){if(typeof t!="number"&&t!=null){let[e,n]=t.split(ux);return!n||n==="px"?parseFloat(e):null}return t||null}function Yh(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}function px(t,e){return t===e?!0:t.isOriginClipped===e.isOriginClipped&&t.isOriginOutsideView===e.isOriginOutsideView&&t.isOverlayClipped===e.isOverlayClipped&&t.isOverlayOutsideView===e.isOverlayOutsideView}var Kh="cdk-global-overlay-wrapper",_c=class{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(e){let n=e.getConfig();this._overlayRef=e,this._width&&!n.width&&e.updateSize({width:this._width}),this._height&&!n.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(Kh),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._xOffset=e,this._xPosition="left",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._xOffset=e,this._xPosition="right",this}start(e=""){return this._xOffset=e,this._xPosition="start",this}end(e=""){return this._xOffset=e,this._xPosition="end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._xPosition="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let e=this._overlayRef.overlayElement.style,n=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:o,maxWidth:s,maxHeight:a}=i,l=(r==="100%"||r==="100vw")&&(!s||s==="100%"||s==="100vw"),c=(o==="100%"||o==="100vh")&&(!a||a==="100%"||a==="100vh"),d=this._xPosition,p=this._xOffset,g=this._overlayRef.getConfig().direction==="rtl",h="",v="",C="";l?C="flex-start":d==="center"?(C="center",g?v=p:h=p):g?d==="left"||d==="end"?(C="flex-end",h=p):(d==="right"||d==="start")&&(C="flex-start",v=p):d==="left"||d==="start"?(C="flex-start",h=p):(d==="right"||d==="end")&&(C="flex-end",v=p),e.position=this._cssPosition,e.marginLeft=l?"0":h,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=l?"0":v,n.justifyContent=C,n.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let e=this._overlayRef.overlayElement.style,n=this._overlayRef.hostElement,i=n.style;n.classList.remove(Kh),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}},hx=(()=>{let e=class e{constructor(i,r,o,s){this._viewportRuler=i,this._document=r,this._platform=o,this._overlayContainer=s}global(){return new _c}flexibleConnectedTo(i){return new bc(i,this._viewportRuler,this._document,this._platform,this._overlayContainer)}};e.\u0275fac=function(r){return new(r||e)(J(Mr),J(at),J(vi),J(Zh))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),fx=0,Vi=(()=>{let e=class e{constructor(i,r,o,s,a,l,c,d,p,g,h,v){this.scrollStrategies=i,this._overlayContainer=r,this._componentFactoryResolver=o,this._positionBuilder=s,this._keyboardDispatcher=a,this._injector=l,this._ngZone=c,this._document=d,this._directionality=p,this._location=g,this._outsideClickDispatcher=h,this._animationsModuleType=v}create(i){let r=this._createHostElement(),o=this._createPaneElement(r),s=this._createPortalOutlet(o),a=new Br(i);return a.direction=a.direction||this._directionality.value,new vc(s,r,o,a,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,this._animationsModuleType==="NoopAnimations",this._injector.get(_u))}position(){return this._positionBuilder}_createPaneElement(i){let r=this._document.createElement("div");return r.id=`cdk-overlay-${fx++}`,r.classList.add("cdk-overlay-pane"),i.appendChild(r),r}_createHostElement(){let i=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalOutlet(i){return this._appRef||(this._appRef=this._injector.get(Pu)),new Wu(i,this._componentFactoryResolver,this._appRef,this._injector,this._document)}};e.\u0275fac=function(r){return new(r||e)(J(lx),J(Zh),J(Cu),J(hx),J(cx),J(Me),J(gt),J(at),J(ds),J(Xo),J(dx),J(wu,8))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var mx=new pr("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let t=F(Vi);return()=>t.scrollStrategies.reposition()}});function gx(t){return()=>t.scrollStrategies.reposition()}var yx={provide:mx,deps:[Vi],useFactory:gx},Jh=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({providers:[Vi,yx],imports:[yr,$u,pc,pc]});let t=e;return t})();var xx=["panel"],Cx=["*"];function Sx(t,e){if(t&1){let n=pe();f(0,"div",1,0),A("@panelAnimation.done",function(r){q(n);let o=k();return G(o._animationDone.next(r))}),kn(2),m()}if(t&2){let n=e.id,i=k();Wo(i._classList),En("mat-mdc-autocomplete-visible",i.showPanel)("mat-mdc-autocomplete-hidden",!i.showPanel)("mat-primary",i._color==="primary")("mat-accent",i._color==="accent")("mat-warn",i._color==="warn"),S("id",i.id)("@panelAnimation",i.isOpen?"visible":"hidden"),St("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby(n))}}var Px=Ru("panelAnimation",[Bu("void, hidden",gr({opacity:0,transform:"scaleY(0.8)"})),Ka(":enter, hidden => visible",[Mu([Zo("0.03s linear",gr({opacity:1})),Zo("0.12s cubic-bezier(0, 0, 0.2, 1)",gr({transform:"scaleY(1)"}))])]),Ka(":leave, visible => hidden",[Zo("0.075s linear",gr({opacity:0}))])]),Ex=0,xc=class{constructor(e,n){this.source=e,this.option=n}},nf=new pr("mat-autocomplete-default-options",{providedIn:"root",factory:Dx});function Dx(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var rf=(()=>{let e=class e{get isOpen(){return this._isOpen&&this.showPanel}_setColor(i){this._color=i,this._changeDetectorRef.markForCheck()}set classList(i){this._classList=i,this._elementRef.nativeElement.className=""}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(i){this._hideSingleSelectionIndicator=i,this._syncParentProperties()}_syncParentProperties(){if(this.options)for(let i of this.options)i._changeDetectorRef.markForCheck()}constructor(i,r,o,s){this._changeDetectorRef=i,this._elementRef=r,this._defaults=o,this._activeOptionChanges=Ri.EMPTY,this._animationDone=new st,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new st,this.opened=new st,this.closed=new st,this.optionActivated=new st,this.id=`mat-autocomplete-${Ex++}`,this.inertGroups=s?.SAFARI||!1,this.autoActiveFirstOption=!!o.autoActiveFirstOption,this.autoSelectActiveOption=!!o.autoSelectActiveOption,this.requireSelection=!!o.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new Ku(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(i=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[i]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(i){this.panel&&(this.panel.nativeElement.scrollTop=i)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(i){let r=new xc(this,i);this.optionSelected.emit(r)}_getPanelAriaLabelledby(i){if(this.ariaLabel)return null;let r=i?i+" ":"";return this.ariaLabelledby?r+this.ariaLabelledby:i}_skipPredicate(){return!1}};e.\u0275fac=function(r){return new(r||e)(Se(Qi),Se(mt),Se(nf),Se(vi))},e.\u0275cmp=ee({type:e,selectors:[["mat-autocomplete"]],contentQueries:function(r,o,s){if(r&1&&(qo(s,fs,5),qo(s,Zu,5)),r&2){let a;zt(a=Lt())&&(o.options=a),zt(a=Lt())&&(o.optionGroups=a)}},viewQuery:function(r,o){if(r&1&&(ri(hr,7),ri(xx,5)),r&2){let s;zt(s=Lt())&&(o.template=s.first),zt(s=Lt())&&(o.panel=s.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",Bi],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",Bi],requireSelection:[2,"requireSelection","requireSelection",Bi],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",Bi],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",Bi]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],standalone:!0,features:[Go([{provide:Qu,useExisting:e}]),fr,ie],ngContentSelectors:Cx,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(r,o){r&1&&(Dn(),K(0,Sx,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);box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color)}.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:[Px]},changeDetection:0});let t=e;return t})();var kx={provide:Au,useExisting:bu(()=>Cc),multi:!0};var of=new pr("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let t=F(Vi);return()=>t.scrollStrategies.reposition()}});function Tx(t){return()=>t.scrollStrategies.reposition()}var Ix={provide:of,deps:[Vi],useFactory:Tx},Cc=(()=>{let e=class e{constructor(i,r,o,s,a,l,c,d,p,g,h){this._element=i,this._overlay=r,this._viewContainerRef=o,this._zone=s,this._changeDetectorRef=a,this._dir=c,this._formField=d,this._document=p,this._viewportRuler=g,this._defaults=h,this._componentDestroyed=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=Ri.EMPTY,this._breakpointObserver=F(Xu),this._handsetLandscapeSubscription=Ri.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new qe,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 qe,this._injector=F(Me),this._aboveClass="mat-mdc-autocomplete-panel-above",this._overlayAttached=!1,this.optionSelections=mu(()=>{let v=this.autocomplete?this.autocomplete.options:null;return v?v.changes.pipe(Ha(v),Mi(()=>Yi(...v.map(C=>C.onSelectionChange)))):this._initialized.pipe(Mi(()=>this.optionSelections))}),this._handlePanelKeydown=v=>{(v.keyCode===27&&!ps(v)||v.keyCode===38&&ps(v,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),v.stopPropagation(),v.preventDefault())},this._trackedModal=null,this._scrollStrategy=l}ngAfterViewInit(){this._initialized.next(),this._initialized.complete();let i=this._getWindow();typeof i<"u"&&this._zone.runOutsideAngular(()=>i.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(i){i.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){let i=this._getWindow();typeof i<"u"&&i.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&&hs(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Yi(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(ii(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(ii(()=>this._overlayAttached)):Ze()).pipe(ti(i=>i instanceof Ju?i:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Yi(Xi(this._document,"click"),Xi(this._document,"auxclick"),Xi(this._document,"touchend")).pipe(ii(i=>{let r=vr(i),o=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,s=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&r!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!o||!o.contains(r))&&(!s||!s.contains(r))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(r)}))}writeValue(i){Promise.resolve(null).then(()=>this._assignOptionValue(i))}registerOnChange(i){this._onChange=i}registerOnTouched(i){this._onTouched=i}setDisabledState(i){this._element.nativeElement.disabled=i}_handleKeydown(i){let r=i.keyCode,o=ps(i);if(r===27&&!o&&i.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&r===13&&this.panelOpen&&!o)this.activeOption._selectViaInteraction(),this._resetActiveItem(),i.preventDefault();else if(this.autocomplete){let s=this.autocomplete._keyManager.activeItem,a=r===38||r===40;r===9||a&&!o&&this.panelOpen?this.autocomplete._keyManager.onKeydown(i):a&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(a||this.autocomplete._keyManager.activeItem!==s)&&(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(i){let r=i.target,o=r.value;if(r.type==="number"&&(o=o==""?null:parseFloat(o)),this._previousValue!==o){if(this._previousValue=o,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(o),!o)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let s=this.autocomplete.options?.find(a=>a.selected);if(s){let a=this._getDisplayValue(s.value);o!==a&&s.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===i.target){let s=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(s)}}}_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(i=!1){this._formField&&this._formField.floatLabel==="auto"&&(i?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let i=new ft(o=>{Vo(()=>{o.next()},{injector:this._injector})}),r=this.autocomplete.options.changes.pipe(re(()=>this._positionStrategy.reapplyLastPosition()),vu(0));return Yi(i,r).pipe(Mi(()=>this._zone.run(()=>{let o=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),o!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),Na(1)).subscribe(o=>this._setValueAndClose(o))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(i){let r=this.autocomplete;return r&&r.displayWith?r.displayWith(i):i}_assignOptionValue(i){let r=this._getDisplayValue(i);i==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(r??"")}_updateNativeInputValue(i){this._formField?this._formField._control.value=i:this._element.nativeElement.value=i,this._previousValue=i}_setValueAndClose(i){let r=this.autocomplete,o=i?i.source:this._pendingAutoselectedOption;o?(this._clearPreviousSelectedOption(o),this._assignOptionValue(o.value),this._onChange(o.value),r._emitSelectEvent(o),this._element.nativeElement.focus()):r.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),r._animationDone?r._animationDone.pipe(Na(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(i,r){this.autocomplete?.options?.forEach(o=>{o!==i&&o.selected&&o.deselect(r)})}_openPanelInternal(i=this._element.nativeElement.value){if(this._attachOverlay(i),this._floatLabel(),this._trackedModal){let r=this.autocomplete.id;el(this._trackedModal,"aria-owns",r)}}_attachOverlay(i){this.autocomplete;let r=this._overlayRef;r?(this._positionStrategy.setOrigin(this._getConnectedElement()),r.updateSize({width:this._getPanelWidth()})):(this._portal=new Qa(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),r=this._overlay.create(this._getOverlayConfig()),this._overlayRef=r,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&r&&r.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Yu.HandsetLandscape).subscribe(s=>{s.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),r&&!r.hasAttached()&&(r.attach(this._portal),this._valueOnAttach=i,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let o=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&o!==this.panelOpen&&this._emitOpened()}_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let i=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=i.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=i.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Br({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let i=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(i),this._positionStrategy=i,i}_setStrategyPositions(i){let r=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],o=this._aboveClass,s=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:o},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:o}],a;this.position==="above"?a=s:this.position==="below"?a=r:a=[...r,...s],i.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 i=this.autocomplete;if(i.autoActiveFirstOption){let r=-1;for(let o=0;o<i.options.length;o++)if(!i.options.get(o).disabled){r=o;break}i._keyManager.setActiveItem(r)}else i._keyManager.setActiveItem(-1)}_canOpen(){let i=this._element.nativeElement;return!i.readOnly&&!i.disabled&&!this.autocompleteDisabled}_getWindow(){return this._document?.defaultView||window}_scrollToOption(i){let r=this.autocomplete,o=ep(i,r.options,r.optionGroups);if(i===0&&o===1)r._setScrollTop(0);else if(r.panel){let s=r.options.toArray()[i];if(s){let a=s._getHostElement(),l=tp(a.offsetTop,a.offsetHeight,r._getScrollTop(),r.panel.nativeElement.offsetHeight);r._setScrollTop(l)}}}_applyModalPanelOwnership(){let i=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!i)return;let r=this.autocomplete.id;this._trackedModal&&hs(this._trackedModal,"aria-owns",r),el(i,"aria-owns",r),this._trackedModal=i}_clearFromModal(){if(this._trackedModal){let i=this.autocomplete.id;hs(this._trackedModal,"aria-owns",i),this._trackedModal=null}}};e.\u0275fac=function(r){return new(r||e)(Se(mt),Se(Vi),Se(Uo),Se(gt),Se(Qi),Se(of),Se(ds,8),Se(ip,9),Se(at,8),Se(Mr),Se(nf,8))},e.\u0275dir=Ki({type:e,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(r,o){r&1&&A("focusin",function(){return o._handleFocus()})("blur",function(){return o._onTouched()})("input",function(a){return o._handleInput(a)})("keydown",function(a){return o._handleKeydown(a)})("click",function(){return o._handleClick()}),r&2&&St("autocomplete",o.autocompleteAttribute)("role",o.autocompleteDisabled?null:"combobox")("aria-autocomplete",o.autocompleteDisabled?null:"list")("aria-activedescendant",o.panelOpen&&o.activeOption?o.activeOption.id:null)("aria-expanded",o.autocompleteDisabled?null:o.panelOpen.toString())("aria-controls",o.autocompleteDisabled||!o.panelOpen||o.autocomplete==null?null:o.autocomplete.id)("aria-haspopup",o.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",Bi]},exportAs:["matAutocompleteTrigger"],standalone:!0,features:[Go([kx]),fr,ni]});let t=e;return t})(),sf=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({providers:[Ix],imports:[Jh,il,tl,jt,Ms,il,tl]});let t=e;return t})();function Ar(t="emit"){return e=>e.pipe(re(n=>console.log(`${t}`,n)))}var Nr=()=>{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=Math.random()*16;return n=(t+n)%16|0,t=Math.floor(t/16),(e==="x"?n:n&3|8).toString(16)})};var af=(t,e)=>e.PromotionID;function Fx(t,e){if(t&1&&(f(0,"mat-option",19)(1,"div",20)(2,"span",21),w(3),m(),f(4,"span",22),w(5),m()()()),t&2){let n=e.$implicit;S("value",n),y(3),D(n.Value),y(2),D(n.Code)}}function Rx(t,e){if(t&1&&At(0,Fx,6,3,"mat-option",19,$o),t&2){let n=k();Nt(n)}}function Mx(t,e){t&1&&(f(0,"mat-option",18),w(1,"No items found"),m()),t&2&&S("disabled",!0)}function Bx(t,e){t&1&&K(0,Rx,2,0)(1,Mx,2,1,"mat-option",18),t&2&&oe(e.length>0?0:1)}function Ax(t,e){if(t&1){let n=pe();f(0,"div",23)(1,"img",24),A("error",function(r){q(n);let o=k();return G(o.onErrorImage(r))}),m(),f(2,"div",25)(3,"ngb-highlight",26),w(4),m(),f(5,"span"),w(6),m()()()}if(t&2){let n=e.result,i=e.term;y(),S("src",n.ImgUrl,Ho)("alt",n.Value),y(2),S("result",n.Value)("term",i),y(),D(n.Value),y(2),D(n.Code)}}function Nx(t,e){if(t&1&&(f(0,"ng-option",28),w(1),m()),t&2){let n=e.$implicit;S("value",n.PromotionID),y(),D(n.Name)}}function zx(t,e){if(t&1&&(f(0,"ng-select",27),At(1,Nx,2,2,"ng-option",28,af),m()),t&2){let n=k(2);y(),Nt(n)}}function Lx(t,e){if(t&1&&(f(0,"ng-option",28),w(1),m()),t&2){let n=e.$implicit;S("value",n),y(),D(n.Name)}}function Hx(t,e){if(t&1&&(f(0,"ng-select",27),At(1,Lx,2,2,"ng-option",28,af),m()),t&2){let n=k(2);y(),Nt(n)}}function jx(t,e){if(t&1&&(f(0,"div",12)(1,"label",9),w(2,"Promotion Price"),m(),K(3,zx,3,0,"ng-select",27)(4,Hx,3,0,"ng-select",27),m()),t&2){let n=k(2);y(3),oe(n.isEditProduct()?3:4)}}function Vx(t,e){t&1&&K(0,jx,5,1,"div",12),t&2&&oe(e.length?0:-1)}function Ux(t,e){if(t&1){let n=pe();f(0,"button",29),A("click",function(){q(n);let r=k();return G(r.resetForm())}),w(1," Cancel "),m()}}var Ns=(()=>{let e=class e{constructor(){this.promotionPrice$=Ze([]),this.variant$=Ze({}),this.UUidSelected="",this.httpService=F(ai),this.fb=F(Ni),this.router=F(In),this.storeService=F(ce),this.location=F(Xo),this.maskitoOptions=Xn({precision:2,thousandSeparator:","}),this.route=F(Ko),this.variant={},this.domain="",this.isEditProduct=H(!1)}displayFn(i){return i?i.Value:""}initForm(){this.form=this.fb.group({name:new Ye("",[Je.required]),quantity:new Ye("",[Je.required]),promotionPrice:new Ye("",[]),price:new Ye("",[Je.required])})}ngAfterViewInit(){this.domain=`https://${localStorage.getItem("Domain")}`}ngOnInit(){this.initForm(),this.form.get("promotionPrice").valueChanges.pipe(ii(()=>Object.keys(this.variant).length>0),Ar("prommotionPrice"),re(i=>{if(i)this.form.patchValue({price:+this.variant.UnitPrice}),this.form.get("price").disable();else{console.warn("Invalid UnitPrice, not patching price");let r=[...this.storeService.productItems()],o=r.findIndex(s=>s.Uuid.toLowerCase()===this.route.snapshot.queryParamMap.get("id")?.toLowerCase());o!==-1&&this.form.patchValue({price:+this.variant.UnitPrice!=+r[o].UnitPrice?+r[o].UnitPrice:+this.variant.UnitPrice}),this.form.get("price").enable()}})).subscribe(),this.route.queryParamMap.pipe(re(i=>{this.isEditProduct.set(i.has("id")),console.log("edit",this.isEditProduct()),this.UUidSelected=i.get("id")||""})).subscribe(),this.route.queryParamMap.pipe(Mi(i=>{if(i.has("id")){let r=i.get("id"),o=[...this.storeService.productItems()],s=o.findIndex(a=>a.Uuid.toLowerCase()===r.toLowerCase());if(s!==-1){let a={EntityID:"00000000-0000-0000-0000-000000000000",ID:o[s].ID},l={VariantID:o[s].ID};return ur([this.httpService.post("/API/V3/Variant/ID",a,void 0,this.domain),this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",l,void 0,this.domain)]).pipe(ti(([c,d])=>({variant:c,promotion:d,KEY:r})))}return Ze(null)}else return this.form.reset(),this.form.enable(),this.promotionPrice$=Ze([]),Ze(null)}),Ar("edit"),re(i=>{if(i===null)return;this.form.get("name").disable();let{variant:r,promotion:o,KEY:s}=i;this.promotionPrice$=Ze(o),this.variant$=Ze(r),this.variant=r;let a=[...this.storeService.productItems()],l=a.findIndex(c=>c.Uuid.toLowerCase()===s.toLowerCase());if(l!==-1){let c=o.findIndex(d=>d.PromotionID.toLowerCase()===a[l].Promotions?.PromotionID?.toLowerCase());if(c!==-1){let d=+o[c]?.UnitPrice;isNaN(d)&&(d=+r.UnitPrice),this.form.patchValue({price:+r.UnitPrice!=+a[l].UnitPrice?+a[l].UnitPrice:+r.UnitPrice,promotionPrice:o[c].PromotionID,quantity:+a[l].Quantity,name:{Value:r.Name}}),this.form.get("price").disable()}else this.form.patchValue({price:+r.UnitPrice!=+a[l].UnitPrice?+a[l].UnitPrice:+r.UnitPrice,promotionPrice:null,quantity:+a[l].Quantity,name:{Value:r.Name}})}})).subscribe(),this.variantSuggestion$=this.form.get("name").valueChanges.pipe(yu(200),za(),Mi(i=>{if(i&&i.length>2){let r={count:100,prefix:i},o=`https://${localStorage.getItem("Domain")}`;return this.httpService.post("/API/AC/GetVariantSuggestionByCodeNName",r,void 0,o)}else return Ze([])}))}onOptionSelected(i){if(Object.hasOwn(i.option.value,"Key")){let r=i.option.value.Key,o={EntityID:"00000000-0000-0000-0000-000000000000",ID:r},s={VariantID:r};return ur([this.httpService.post("/API/V3/Variant/ID",o,void 0,this.domain),this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",s,void 0,this.domain)]).pipe(ti(([a,l])=>({variant:a,promotion:l})),re(({variant:a,promotion:l})=>{this.form.patchValue({price:a.UnitPrice,promotionPrice:null,quantity:1}),this.promotionPrice$=Ze(l),this.variant$=Ze(a),this.variant=a})).subscribe()}else throw new Error("Key not found")}onSubmit(){let{name:i,quantity:r,promotionPrice:o,price:s}=this.form.getRawValue(),a=r.toString().replace(/,/g,""),l=s.toString().replace(/,/g,"");return this.isEditProduct()?fu([this.promotionPrice$,this.variant$]).pipe(ti(([c,d])=>({promotions:c,variant:d})),ti(({promotions:c,variant:d})=>{let p=[...this.storeService.productItems()],g=p.findIndex(v=>v.Uuid.toLowerCase()===this.UUidSelected.toLowerCase());if(g!==-1){let v=c.findIndex(C=>C.PromotionID.toLowerCase()===o?.toLowerCase());if(v!==-1){let C=+c[v]?.UnitPrice;isNaN(C)&&(C=+d.UnitPrice),p[g]=E(b({},p[g]),{Quantity:+a,Promotions:c[v],UnitPrice:+l,isSelected:!1})}else p[g]=E(b({},p[g]),{Quantity:+a,Promotions:o,UnitPrice:+l,isSelected:!1})}let h=[...p];this.storeService.onChangeProductItems(h),this.form.get("price").enable(),this.form.reset(),this.router.navigate(["/pages"]),this.promotionPrice$=Ze([]),this.variant={}})).subscribe():this.variant$.pipe(ti(c=>E(b({},c),{Quantity:+r,Promotions:o,UnitPrice:+l,Uuid:Nr()})),re(c=>{let d=[...this.storeService.productItems()];d.push(c);let p=[...d];this.storeService.onChangeProductItems(p),this.form.get("price").enable(),this.form.reset(),this.promotionPrice$=Ze([])})).subscribe()}onErrorImage(i){console.log(i);let r=i.target;i.type==="error"&&(r.src="assets/images/image-404.svg")}get hasEdit(){return this.route.snapshot.queryParamMap.has("id")}resetForm(){this.form.reset(),this.router.navigate([],{relativeTo:this.route,queryParams:{id:null},queryParamsHandling:"merge"})}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["modal-choose-product"]],standalone:!0,features:[ie],decls:31,vars:14,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,"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,"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(r,o){if(r&1){let s=pe();f(0,"div",2)(1,"div",3)(2,"span",4),w(3),m()(),f(4,"div",5)(5,"div",6)(6,"form",7)(7,"div",8)(8,"label",9),w(9,"Name"),m(),X(10,"input",10),f(11,"mat-autocomplete",11,0),A("optionSelected",function(l){return q(s),G(o.onOptionSelected(l))}),K(13,Bx,2,1),ke(14,"async"),m(),K(15,Ax,7,6,"ng-template",null,1,te),m(),f(17,"div",12)(18,"label",9),w(19,"Quantity"),m(),X(20,"input",13),m(),f(21,"div",12)(22,"label",9),w(23,"Price"),m(),X(24,"input",14),m(),K(25,Vx,1,1),ke(26,"async"),f(27,"div",15),K(28,Ux,2,0,"button",16),f(29,"button",17),A("click",function(){return q(s),G(o.onSubmit())}),w(30," Submit "),m()()()()()()}if(r&2){let s,a,l=qa(12);y(3),oi("",o.UUidSelected?"Update":"Add"," Product"),y(3),S("formGroup",o.form),y(4),S("matAutocomplete",l),y(),S("displayWith",o.displayFn),y(2),oe((s=Ht(14,10,o.variantSuggestion$))?13:-1,s),y(7),S("maskito",o.maskitoOptions),y(4),S("maskito",o.maskitoOptions),y(),oe((a=Ht(26,12,o.promotionPrice$))?25:-1,a),y(3),oe(o.hasEdit?28:-1),y(),S("disabled",o.form.invalid)}},dependencies:[Qo,Vt,li,ms,Ke,ts,Ge,Xe,es,is,ns,Uu,ku,ji,us,sf,rf,fs,Cc],styles:[".mat-mdc-autocomplete-panel{background-color:#fff!important} .mat-mdc-autocomplete-panel>.mat-mdc-option.mdc-list-item--disabled{min-height:34px}"]});let t=e;return t})();var lf=(()=>{let e=class e{constructor(){this.transactionType=H([{title:"Supplier Bill",type:0},{title:"Transfer Order",type:1}]),this.storeService=F(ce),this.fb=F(Ni),this.activeModal=F(Rn)}get outlets(){return this.storeService.paperConfig().Outlets}initForm(){this.form=this.fb.group({type:new Ye("",[Je.required]),outlet:new Ye("",[Je.required]),number:new Ye("",[Je.required])})}ngOnInit(){this.initForm()}onOK(){this.activeModal.close({role:"ok",data:this.form.value})}onClose(){this.activeModal.dismiss({role:"close",data:null})}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-dialog-load-transaction"]],standalone:!0,features:[ie],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"]],template:function(r,o){r&1&&(f(0,"app-base-modal",0),A("onOK",function(){return o.onOK()})("onClose",function(){return o.onClose()}),f(1,"form",1)(2,"div",2)(3,"label",3),w(4,"Choose Type"),m(),X(5,"ng-select",4),m(),f(6,"div",2)(7,"label",3),w(8,"Choose Outlet"),m(),X(9,"ng-select",5),m(),f(10,"div",2)(11,"label",3),w(12,"Invoice Number"),m(),X(13,"input",6),m()()()),r&2&&(S("hasValid",o.form.valid),y(),S("formGroup",o.form),y(4),S("items",o.transactionType()),y(4),S("items",o.outlets))},dependencies:[ks,Vt,li,nt,ts,Ge,Xe,es,Ke,is,ns],changeDetection:0});let t=e;return t})();var Wx=(()=>{class t{constructor(n){this.document=n,this.width=this.getWidth()}getWidth(){let n=this.document.createElement("div");n.style.visibility="hidden",n.style.width="100px",n.style.msOverflowStyle="scrollbar",this.document.body.appendChild(n);let i=n.offsetWidth;n.style.overflow="scroll";let r=this.document.createElement("div");r.style.width="100%",n.appendChild(r);let o=r.offsetWidth;return n.parentNode.removeChild(n),i-o}}return t.\u0275fac=function(n){return new(n||t)(J(at))},t.\u0275prov=We({token:t,factory:t.\u0275fac}),t})(),$x=(()=>{class t{getDimensions(n){return n.getBoundingClientRect()}}return t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=We({token:t,factory:t.\u0275fac}),t})(),qx=(()=>{class t{constructor(){this.columnInputChanges=new qe}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=We({token:t,factory:t.\u0275fac}),t})();function Gx(t){return t=t.replace(/[^a-zA-Z0-9 ]/g," "),t=t.replace(/([a-z](?=[A-Z]))/g,"$1 "),t=t.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase(),t=t.replace(/([ 0-9]+)([a-zA-Z])/g,function(e,n,i){return n.trim()+i.toUpperCase()}),t}var zs={},cf=typeof document<"u"?document.createElement("div").style:void 0,Sc=function(){let t=typeof window<"u"?window.getComputedStyle(document.documentElement,""):void 0,e=typeof t<"u"?Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/):null,n=e!==null?e[1]:void 0,i=typeof n<"u"?"WebKit|Moz|MS|O".match(new RegExp("("+n+")","i"))[1]:void 0;return i?{dom:i,lowercase:n,css:`-${n}-`,js:n[0].toUpperCase()+n.substr(1)}:void 0}();function Ls(t){let e=Gx(t);return zs[e]||(Sc!==void 0&&cf[Sc.css+t]!==void 0?zs[e]=Sc.css+t:cf[t]!==void 0&&(zs[e]=t)),zs[e]}var VI=typeof window<"u"?Ls("transform"):void 0,UI=typeof window<"u"?Ls("backfaceVisibility"):void 0,WI=typeof window<"u"?!!Ls("transform"):void 0,$I=typeof window<"u"?!!Ls("perspective"):void 0,df=typeof window<"u"?window.navigator.userAgent:"Chrome",qI=/Safari\//.test(df)&&!/Chrome\//.test(df);var uf=(()=>{class t{static forRoot(n){return{ngModule:t,providers:[{provide:"configuration",useValue:n}]}}}return t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=Ct({type:t}),t.\u0275inj=xt({providers:[Wx,$x,qx],imports:[[jt]]}),t})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=Xx);function Xx(t,e){let n=[],i=[],r,o,s;for(;(r=document.elementFromPoint(t,e))&&n.indexOf(r)===-1&&r!=null;)n.push(r),i.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(o=i.length;s=i[--o];)n[o].style.setProperty("pointer-events",s.value?s.value:"",s.priority);return n}var pf=(()=>{let e=class e{constructor(){this.subject$=new qe}onFileLoad(i){let o=i.target.result,s=!1,a=[],l=[],c=0;for(let d of o.split(/[\r\n]+/))if(s){let p={};for(let g=0;g<c;g++)p[l[g]]=d.split(",")[g];a.push(p)}else{for(let p=0;p<d.split(",").length;p++)c=d.split(",").length,l.push(d.split(",")[p].replace(/ /g,""));s=!0}return a.splice(-1),a}convertFile(i){let r=i,o=new FileReader;return o.onload=s=>{let a=this.onFileLoad(s);this.subject$.next(a)},o.readAsText(r,"UTF-8"),this.subject$.asObservable()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var hf=(()=>{let e=class e{constructor(i,r,o){this.http=i,this.toastr=r,this.router=o}PostToUrlEncode(i,r,o=1e5){let s=new si;return s=s.set("Content-Type","application/x-www-form-urlencoded"),new ft(a=>{this.http.post(i,r,{headers:s}).pipe(ei(o)).subscribe(l=>{a.next(l),a.complete()})})}GetText(i=1e5){let r=localStorage.getItem("Token"),s={responseType:"text",headers:new si({Authorization:"Bearer "+r})};return new ft(a=>{this.http.get("/API/Token/GetZendeskJWT",s).pipe(ei(i)).subscribe(l=>{a.next(l),a.complete()})})}POSText(i,r,o=1e5){let s=localStorage.getItem("Token"),l={responseType:"text",headers:new si({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+s})};return new ft(c=>{this.http.post(i,r,l).pipe(ei(o)).subscribe(d=>{c.next(d),c.complete()})})}get(i){let r=localStorage.getItem("Token"),o=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});r&&(o=o.append("Authorization","Bearer "+r));let s={headers:o};return this.http.get(i,s).pipe(gu(a=>{if(!this.unauthorizedErrorHandling(a)){let c=this.errorMessageHandling(a);this.toastr.error(c.Message!=""?c.Message:"An unknown error has occured!",c.header),this.paymentErrorHandling(a)}return hu(()=>a)}))}getNews(i){return this.http.get(i)}paymentErrorHandling(i){i.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(i,r,o=1e5){return new ft(s=>{let a=localStorage.getItem("Token"),l=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(l=l.append("Authorization","Bearer "+a));let c={headers:l};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+d(this.getMonth()+1)+"-"+d(this.getDate())+"T"+d(this.getHours())+":"+d(this.getMinutes())+":"+d(this.getSeconds())+".000"};function d(p){return p<10?"0"+p:p}this.http.post(i,r,c).pipe(ei(o)).subscribe({next:p=>{s.next(p),s.complete()},error:p=>{if(p.status==200)s.next(p.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(p)){let h=this.errorMessageHandling(p);this.toastr.error(h.Message!=""?h.Message:"An unknown error has occured!",h.header,{enableHtml:!0})}s.error(p)}}})})}postFile(i,r,o=1e5){return new ft(s=>{let a=localStorage.getItem("Token"),l=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(l=l.append("Authorization","Bearer "+a)),this.http.post(i,r,{headers:l,observe:"response",responseType:"blob"}).pipe(ei(o)).subscribe({next:c=>{s.next({title:c.headers.get("Content-Disposition"),file:c.body}),s.complete()},error:c=>{if(c.headers.get("Content-Type")==="application/json; charset=utf-8"){let d=new FileReader;d.addEventListener("loadend",p=>{let g=JSON.parse(p.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(c)){let v=this.errorMessageHandling(c);this.toastr.error(g??"An unknown error has occured!",v.header,{enableHtml:!0})}}),d.readAsText(c.error)}s.error(c)}})})}put(i,r,o=1e5){return new ft(s=>{let a=localStorage.getItem("Token"),l=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(l=l.append("Authorization","Bearer "+a));let c={headers:l};this.http.put(i,r,c).pipe(ei(o)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header)}s.error(d)}}})})}delete(i,r,o=1e5){return new ft(s=>{let a=localStorage.getItem("Token"),l=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(l=l.append("Authorization","Bearer "+a));let c={headers:l,body:r};this.http.delete(i,c).pipe(ei(o)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header)}s.error(d)}}})})}unauthorizedErrorHandling(i){let r=!1;return(i.status==401||i.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",r=!0),r}errorMessageHandling(i){let r="API Error",o="Exception Message";return i.error?(r="API Error - "+i.status,i.status==451&&(r="Error"),i.error&&(o=i.error.Message)):i.Message&&(r="API Error - "+i.name,o=i.Message),{header:r,Message:o}}postFormDataWithoutBearer(i,r){return new ft(o=>{this.http.post(i,r).pipe(ei(1e5)).subscribe({next:s=>{o.next(s),o.complete()},error:s=>{s.status==200&&(o.next(s.error.text),o.complete()),o.error(s)}})})}postFormData(i,r,o=!0){return new ft(s=>{let a=localStorage.getItem("Token"),c={headers:new si({Authorization:"Bearer "+a})};this.http.post(i,r,c).pipe(ei(1e5)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)&&o){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header)}s.error(d)}}})})}};e.\u0275fac=function(r){return new(r||e)(J(Fu),J(Jo),J(In))},e.\u0275prov=We({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function Hs(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Yx=0;function mf(t){return"__private_"+Yx+++"_"+t}function Kx(t,e,n){let i=[];return t.forEach(r=>typeof r!="string"?i.push(r):e[Symbol.split](r).forEach((o,s,a)=>{o!==""&&i.push(o),s<a.length-1&&i.push(n)})),i}function ff(t,e){let n=/\$/g,i="$$$$",r=[t];if(e==null)return r;for(let o of Object.keys(e))if(o!=="_"){let s=e[o];typeof s=="string"&&(s=n[Symbol.replace](s,i)),r=Kx(r,new RegExp(`%\\{${o}\\}`,"g"),s)}return r}var Qx=t=>{throw new Error(`missing string: ${t}`)},zr=mf("onMissingKey"),Lr=mf("apply"),Yn=class{constructor(e,n){let{onMissingKey:i=Qx}=n===void 0?{}:n;Object.defineProperty(this,Lr,{value:Zx}),Object.defineProperty(this,zr,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(Hs(this,Lr)[Lr],this):Hs(this,Lr)[Lr](e),Hs(this,zr)[zr]=i}translate(e,n){return this.translateArray(e,n).join("")}translateArray(e,n){let i=this.locale.strings[e];if(i==null&&(Hs(this,zr)[zr](e),i=e),typeof i=="object"){if(n&&typeof n.smart_count<"u"){let o=this.locale.pluralize(n.smart_count);return ff(i[o],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return ff(i,n)}};function Zx(t){if(!(t!=null&&t.strings))return;let e=this.locale;Object.assign(this.locale,{strings:b(b({},e.strings),t.strings),pluralize:t.pluralize||e.pluralize})}var hm=me(yf(),1);var Jx="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var vf=(t=21)=>{let e="",n=t;for(;n--;)e+=Jx[Math.random()*64|0];return e};var fm=me(Qf(),1);function Vs(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var qC=0;function Zf(t){return"__private_"+qC+++"_"+t}var GC={version:"4.1.0"},tn=Zf("callbacks"),Tc=Zf("publish"),Us=class{constructor(){Object.defineProperty(this,Tc,{value:XC}),this.state={},Object.defineProperty(this,tn,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let n=b({},this.state),i=b(b({},this.state),e);this.state=i,Vs(this,Tc)[Tc](n,i,e)}subscribe(e){return Vs(this,tn)[tn].add(e),()=>{Vs(this,tn)[tn].delete(e)}}};function XC(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Vs(this,tn)[tn].forEach(i=>{i(...e)})}Us.VERSION=GC.version;var Jf=Us;function nn(t){let e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}var Ic={__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 jr(t){var e;if(t.type)return t.type;let n=t.name?(e=nn(t.name).extension)==null?void 0:e.toLowerCase():null;return n&&n in Ic?Ic[n]:"application/octet-stream"}function YC(t){return t.charCodeAt(0).toString(32)}function em(t){let e="";return t.replace(/[^A-Z0-9]/gi,n=>(e+=`-${YC(n)}`,"/"))+e}function tm(t,e){let n=e||"uppy";return typeof t.name=="string"&&(n+=`-${em(t.name.toLowerCase())}`),t.type!==void 0&&(n+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(n+=`-${em(t.meta.relativePath.toLowerCase())}`),t.data.size!==void 0&&(n+=`-${t.data.size}`),t.data.lastModified!==void 0&&(n+=`-${t.data.lastModified}`),n}function KC(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function Ws(t,e){if(KC(t))return t.id;let n=jr(t);return tm(E(b({},t),{type:n}),e)}function Oc(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;let e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;let i=e[1].split(".",2),r=parseInt(i[0],10),o=parseInt(i[1],10);return r<15||r===15&&o<15063||r>18||r===18&&o>=18218}function Fc(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}function Rc(t){return t<10?`0${t}`:t.toString()}function Kn(){let t=new Date,e=Rc(t.getHours()),n=Rc(t.getMinutes()),i=Rc(t.getSeconds());return`${e}:${n}:${i}`}var im={debug:()=>{},warn:()=>{},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.error(`[Uppy] [${Kn()}]`,...e)}},nm={debug:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.debug(`[Uppy] [${Kn()}]`,...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.warn(`[Uppy] [${Kn()}]`,...e)},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.error(`[Uppy] [${Kn()}]`,...e)}};var Vr=me($s(),1),dm=me(cm(),1),um={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},bt=class extends Error{constructor(e,n){var i;super(e),this.isRestriction=!0,this.isUserFacing=(i=n?.isUserFacing)!=null?i:!0,n!=null&&n.file&&(this.file=n.file)}},qs=class{constructor(e,n){this.getI18n=n,this.getOpts=()=>{var i;let r=e();if(((i=r.restrictions)==null?void 0:i.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,n){let{maxTotalFileSize:i,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(s=>!s.isGhost).length+n.length>r)throw new bt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(i){let o=[...e,...n].reduce((s,a)=>{var l;return s+((l=a.size)!=null?l:0)},0);if(o>i)throw new bt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,Vr.default)(i),size:(0,Vr.default)(o)}))}}validateSingleFile(e){let{maxFileSize:n,minFileSize:i,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(a=>a.includes("/")?e.type?(0,dm.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=r.join(", ");throw new bt(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(n&&e.size!=null&&e.size>n){var o;throw new bt(this.getI18n()("exceedsSize",{size:(0,Vr.default)(n),file:(o=e.name)!=null?o:this.getI18n()("unnamed")}),{file:e})}if(i&&e.size!=null&&e.size<i)throw new bt(this.getI18n()("inferiorSize",{size:(0,Vr.default)(i)}),{file:e})}validate(e,n){n.forEach(i=>{this.validateSingleFile(i)}),this.validateAggregateRestrictions(e,n)}validateMinNumberOfFiles(e){let{minNumberOfFiles:n}=this.getOpts().restrictions;if(n&&Object.keys(e).length<n)throw new bt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:n}))}getMissingRequiredMetaFields(e){var n;let i=new bt(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(n=e.name)!=null?n:this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,o=[];for(let s of r)(!Object.hasOwn(e.meta,s)||e.meta[s]==="")&&o.push(s);return{missingFields:o,error:i}}};var pm={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed"}};function z(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var JC=0;function Oe(t){return"__private_"+JC+++"_"+t}var eS={version:"4.2.0"},Gs={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},et=Oe("plugins"),ct=Oe("restricter"),Ur=Oe("storeUnsubscribe"),_i=Oe("emitter"),rn=Oe("preProcessors"),on=Oe("uploaders"),Ci=Oe("postProcessors"),Dt=Oe("informAndEmit"),Xr=Oe("checkRequiredMetaFieldsOnFile"),Mc=Oe("checkRequiredMetaFields"),Wr=Oe("assertNewUploadAllowed"),Nc=Oe("transformFile"),$r=Oe("startIfAutoProceed"),qr=Oe("checkAndUpdateFileState"),Bc=Oe("addListeners"),Kt=Oe("updateOnlineStatus"),Gr=Oe("requestClientById"),wi=Oe("createUpload"),Ac=Oe("getUpload"),sn=Oe("removeUpload"),xi=Oe("runUpload"),Xs=class t{constructor(e){Object.defineProperty(this,xi,{value:pS}),Object.defineProperty(this,sn,{value:uS}),Object.defineProperty(this,Ac,{value:dS}),Object.defineProperty(this,wi,{value:cS}),Object.defineProperty(this,Bc,{value:lS}),Object.defineProperty(this,qr,{value:aS}),Object.defineProperty(this,$r,{value:sS}),Object.defineProperty(this,Nc,{value:oS}),Object.defineProperty(this,Wr,{value:rS}),Object.defineProperty(this,Mc,{value:nS}),Object.defineProperty(this,Xr,{value:iS}),Object.defineProperty(this,Dt,{value:tS}),Object.defineProperty(this,et,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,Ur,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:(0,hm.default)()}),Object.defineProperty(this,rn,{writable:!0,value:new Set}),Object.defineProperty(this,on,{writable:!0,value:new Set}),Object.defineProperty(this,Ci,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=(0,fm.default)((r,o)=>{let s=this.getFile(r?.id);if(r==null||!s){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}if(s.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}let a=Number.isFinite(o.bytesTotal)&&o.bytesTotal>0;this.setFileState(r.id,{progress:E(b({},s.progress),{bytesUploaded:o.bytesUploaded,bytesTotal:o.bytesTotal,percentage:a?Math.round(o.bytesUploaded/o.bytesTotal*100):0})}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Kt,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Gr,{writable:!0,value:new Map}),this.defaultLocale=pm;let n={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:um,meta:{},onBeforeFileAdded:(r,o)=>!Object.hasOwn(o,r.id),onBeforeUpload:r=>r,store:new Jf,logger:im,infoTimeout:5e3},i=b(b({},n),e);this.opts=E(b({},i),{restrictions:b(b({},n.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=nm),this.log(`Using Core v${t.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(E(b({},Gs),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Oc(),individualCancellation:!0,resumableUploads:!1},meta:b({},this.opts.meta),info:[]})),z(this,ct)[ct]=new qs(()=>this.opts,()=>this.i18n),z(this,Ur)[Ur]=this.store.subscribe((r,o,s)=>{this.emit("state-update",r,o,s),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),z(this,Bc)[Bc]()}emit(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];z(this,_i)[_i].emit(e,...i)}on(e,n){return z(this,_i)[_i].on(e,n),this}once(e,n){return z(this,_i)[_i].once(e,n),this}off(e,n){return z(this,_i)[_i].off(e,n),this}updateAll(e){this.iteratePlugins(n=>{n.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let n=this.getState().files;this.setState({files:b(b({},n),Object.fromEntries(Object.entries(e).map(i=>{let[r,o]=i;return[r,b(b({},n[r]),o)]})))})}setFileState(e,n){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:n})}i18nInit(){let e=i=>this.log(`Missing i18n string: ${i}`,"error"),n=new Yn([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=n.translate.bind(n),this.i18nArray=n.translateArray.bind(n),this.locale=n.locale}setOptions(e){this.opts=E(b(b({},this.opts),e),{restrictions:b(b({},this.opts.restrictions),e?.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(n=>{n.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},n=b({},this.getState().files),i=Object.create(null);Object.keys(n).forEach(r=>{i[r]=E(b({},n[r]),{progress:b(b({},n[r].progress),e)})}),this.setState(b({files:i},Gs))}clear(){let{capabilities:e,currentUploads:n}=this.getState();if(Object.keys(n).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(E(b({},Gs),{files:{}}))}addPreProcessor(e){z(this,rn)[rn].add(e)}removePreProcessor(e){return z(this,rn)[rn].delete(e)}addPostProcessor(e){z(this,Ci)[Ci].add(e)}removePostProcessor(e){return z(this,Ci)[Ci].delete(e)}addUploader(e){z(this,on)[on].add(e)}removeUploader(e){return z(this,on)[on].delete(e)}setMeta(e){let n=b(b({},this.getState().meta),e),i=b({},this.getState().files);Object.keys(i).forEach(r=>{i[r]=E(b({},i[r]),{meta:b(b({},i[r].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:n,files:i})}setFileMeta(e,n){let i=b({},this.getState().files);if(!i[e]){this.log("Was trying to set metadata for a file that has been removed: ",e);return}let r=b(b({},i[e].meta),n);i[e]=E(b({},i[e]),{meta:r}),this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(n=>this.getFile(n))}getObjectOfFilesPerState(){let{files:e,totalProgress:n,error:i}=this.getState(),r=Object.values(e),o=[],s=[],a=[],l=[],c=[],d=[],p=[],g=[],h=[];for(let v of r){let{progress:C}=v;!C.uploadComplete&&C.uploadStarted&&(o.push(v),v.isPaused||g.push(v)),C.uploadStarted||s.push(v),(C.uploadStarted||C.preprocess||C.postprocess)&&a.push(v),C.uploadStarted&&l.push(v),v.isPaused&&c.push(v),C.uploadComplete&&d.push(v),v.error&&p.push(v),(C.preprocess||C.postprocess)&&h.push(v)}return{newFiles:s,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:p,inProgressFiles:o,inProgressNotPausedFiles:g,processingFiles:h,isUploadStarted:l.length>0,isAllComplete:n===100&&d.length===r.length&&h.length===0,isAllErrored:!!i&&p.length===r.length,isAllPaused:o.length!==0&&c.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(v=>v.isGhost)}}validateSingleFile(e){try{z(this,ct)[ct].validateSingleFile(e)}catch(n){return n.message}return null}validateAggregateRestrictions(e){let n=this.getFiles();try{z(this,ct)[ct].validateAggregateRestrictions(n,e)}catch(i){return i.message}return null}checkIfFileAlreadyExists(e){let{files:n}=this.getState();return!!(n[e]&&!n[e].isGhost)}addFile(e){z(this,Wr)[Wr](e);let{nextFilesState:n,validFilesToAdd:i,errors:r}=z(this,qr)[qr]([e]),o=r.filter(a=>a.isRestriction);if(z(this,Dt)[Dt](o),r.length>0)throw r[0];this.setState({files:n});let[s]=i;return this.emit("file-added",s),this.emit("files-added",i),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),z(this,$r)[$r](),s.id}addFiles(e){z(this,Wr)[Wr]();let{nextFilesState:n,validFilesToAdd:i,errors:r}=z(this,qr)[qr](e),o=r.filter(a=>a.isRestriction);z(this,Dt)[Dt](o);let s=r.filter(a=>!a.isRestriction);if(s.length>0){let a=`Multiple errors occurred while adding files:
|
|
15
|
+
`)+1;return[n?i:o,n?o:r]}function Fw({value:t,selection:e},n){let[i,r]=e;return i!==r?[i,r]:(n?[i,r+1]:[i-1,r]).map(s=>Math.min(Math.max(s,0),t.length))}var Rw=/\s+$/g,Mw=/^\s+/g,kh=/\s/;function Bw({value:t,selection:e},n){let[i,r]=e;if(i!==r)return[i,r];if(n){let l=t.slice(i),[c]=l.match(Mw)||[""],d=l.trimStart().search(kh);return[i,d!==-1?i+c.length+d:t.length]}let o=t.slice(0,r),[s]=o.match(Rw)||[""],a=o.trimEnd().split("").reverse().findIndex(l=>l.match(kh));return[a!==-1?r-s.length-a:0,r]}function Is(t=[]){return(e,...n)=>t.reduce((i,r)=>Object.assign(Object.assign({},i),r(i,...n)),e)}function Ji(t,e){let n=Object.assign(Object.assign({},Wn),e),i=Is(n.preprocessors),r=Is(n.postprocessors),o=typeof t=="string"?{value:t,selection:[0,0]}:t,{elementState:s}=i({elementState:o,data:""},"validation"),a=new Fr(s,n),{value:l,selection:c}=r(a,o);return typeof t=="string"?l:{value:l,selection:c}}var Os=class extends cc{constructor(e,n){super(),this.element=e,this.maskitoOptions=n,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new dc(this.element),this.options=Object.assign(Object.assign({},Wn),this.maskitoOptions),this.preprocessor=Is(this.options.preprocessors),this.postprocessor=Is(this.options.postprocessors),this.teardowns=this.options.plugins.map(i=>i(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",i=>{if(Tw(i))return i.preventDefault(),this.redo();if(Iw(i))return i.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",i=>{var r;let o=i.inputType.includes("Forward");switch(this.updateHistory(this.elementState),i.inputType){case"historyUndo":return i.preventDefault(),this.undo();case"historyRedo":return i.preventDefault(),this.redo();case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:i,isForward:o,selection:Fw(this.elementState,o)});case"deleteWordForward":case"deleteWordBackward":return this.handleDelete({event:i,isForward:o,selection:Bw(this.elementState,o),force:!0});case"deleteSoftLineBackward":case"deleteSoftLineForward":case"deleteHardLineBackward":case"deleteHardLineForward":return this.handleDelete({event:i,isForward:o,selection:Ow(this.elementState,o),force:!0});case"insertCompositionText":return;case"insertReplacementText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(i);case"insertFromPaste":case"insertText":case"insertFromDrop":default:return this.handleInsert(i,i.data||((r=i.dataTransfer)===null||r===void 0?void 0:r.getData("text/plain"))||"")}}),this.eventListener.listen("input",({inputType:i})=>{i!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}get elementState(){let{value:e,selectionStart:n,selectionEnd:i}=this.element;return{value:e,selection:[n||0,i||0]}}get maxLength(){let{maxLength:e}=this.element;return e===-1?1/0:e}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e?.())}updateElementState({value:e,selection:n},i={inputType:"insertText",data:null}){let r=this.elementState.value;this.updateValue(e),this.updateSelectionRange(n),r!==e&&this.dispatchInputEvent(i)}updateSelectionRange([e,n]){var i;let{element:r}=this;r.matches(":focus")&&(r.selectionStart!==e||r.selectionEnd!==n)&&((i=r.setSelectionRange)===null||i===void 0||i.call(r,e,n))}updateValue(e){this.element.value=e}ensureValueFitsMask(){this.updateElementState(Ji(this.elementState,this.options))}dispatchInputEvent(e={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},e),{bubbles:!0,cancelable:!1})))}handleDelete({event:e,selection:n,isForward:i,force:r=!1}){let o={value:this.elementState.value,selection:n},[s,a]=o.selection,{elementState:l}=this.preprocessor({elementState:o,data:""},i?"deleteForward":"deleteBackward"),c=new Fr(l,this.options),[d,p]=l.selection;c.deleteCharacters([d,p]);let g=this.postprocessor(c,o);if(!(o.value.slice(0,s)+o.value.slice(a)===g.value&&!r&&!this.element.isContentEditable)){if(e.preventDefault(),Sw(o,l,c,g))return this.updateSelectionRange(i?[p,p]:[d,d]);this.updateElementState(g,{inputType:e.inputType,data:null}),this.updateHistory(g)}}handleInsert(e,n){let i=this.elementState,{elementState:r,data:o=n}=this.preprocessor({data:n,elementState:i},"insert"),s=new Fr(r,this.options);try{s.addCharacters(r.selection,o)}catch{return e.preventDefault()}let[a,l]=r.selection,c=i.value.slice(0,a)+n+i.value.slice(l),d=this.postprocessor(s,i);if(d.value.length>this.maxLength)return e.preventDefault();(c!==d.value||this.element.isContentEditable)&&(e.preventDefault(),this.updateElementState(d,{data:n,inputType:e.inputType}),this.updateHistory(d))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(e,`
|
|
16
|
+
`)}};function qn(t,e,n){let i=Math.min(Number(n),Math.max(Number(e),Number(t)));return t instanceof Date?new Date(i):i}var Aw=[".",",","\u0431","\u044E"];var Nw=[":","."];var zw="\xA0",Lw="\u200B",Bh="\u2013",Ah="\u2014",Rs="-",uc="\u2212",Nh="\u30FC";var zh=/[\\^$.*+?()[\]{}|]/g,Hw=new RegExp(zh.source);function lt(t){return t&&Hw.test(t)?t.replaceAll(zh,"\\$&"):t}function Qt(t,{prefix:e,postfix:n}){var i,r;let o=new RegExp(`^${lt(e)}`),s=new RegExp(`${lt(n)}$`),[a=""]=(i=t.match(o))!==null&&i!==void 0?i:[],[l=""]=(r=t.match(s))!==null&&r!==void 0?r:[],c=t.replace(o,"").replace(s,"");return{extractedPrefix:a,extractedPostfix:l,cleanValue:c}}function jw(t,e){let n="";for(let i=0;i<t.length;i++){if(t[i]!==e[i])return n;n+=t[i]}return n}function Rr(t){return t}function Oh(t){return t.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function Vw(){return({elementState:t,data:e})=>{let{value:n,selection:i}=t;return{elementState:{selection:i,value:Oh(n)},data:Oh(e)}}}function Uw(t){let e=new RegExp(`${lt(t)}$`);return t?({value:n,selection:i},r)=>{if(!n&&!r.value.endsWith(t))return{value:n,selection:i};if(!n.endsWith(t)&&!r.value.endsWith(t))return{selection:i,value:n+t};let o=r.value.replace(e,""),s=r.selection[1]>=o.length,a=jw(o,n);return{selection:i,value:Array.from(t).reverse().reduce((l,c,d)=>{let p=l.length-1-d,g=a[p]===c&&s;return l[p]!==c||g?l.slice(0,p+1)+c+l.slice(p+1):l},n)}}:Rr}function Ww(t){return t?({value:e,selection:n},i)=>{if(e.startsWith(t)||!e&&!i.value.startsWith(t))return{value:e,selection:n};let[r,o]=n,s=Array.from(t).reduce((l,c,d)=>l[d]===c?l:l.slice(0,d)+c+l.slice(d),e),a=s.length-e.length;return{selection:[r+a,o+a],value:s}}:Rr}function Gn(t,e,n){return(i,r)=>{let o=()=>e(i,r);return i.addEventListener(t,o,n),()=>i.removeEventListener(t,o,n)}}function Lh(t){return e=>{let n=e.ownerDocument,i=0,r=()=>i++,o=()=>{i=Math.max(--i,0)},s=()=>{if(!e.matches(":focus"))return;if(i)return n.addEventListener("mouseup",s,{once:!0,passive:!0});let a=e.selectionStart||0,l=e.selectionEnd||0,[c,d]=t(e.value,[a,l]);(c>a||d<l)&&e.setSelectionRange(qn(a,c,d),qn(l,c,d))};return n.addEventListener("selectionchange",s,{passive:!0}),e.addEventListener("mousedown",r,{passive:!0}),n.addEventListener("mouseup",o,{passive:!0}),()=>{n.removeEventListener("selectionchange",s),n.removeEventListener("mousedown",r),n.removeEventListener("mouseup",o)}}}var Nk=new RegExp(`[${Nw.map(lt).join("")}]$`);function $w({prefix:t,postfix:e}){return({elementState:n,data:i})=>{let{cleanValue:r}=Qt(i,{prefix:t,postfix:e});return{elementState:n,data:r}}}function Hh({decimalSeparator:t,isNegativeAllowed:e,precision:n,thousandSeparator:i,prefix:r,postfix:o,decimalPseudoSeparators:s=[],pseudoMinuses:a=[],minusSign:l}){let c=Fh(r),d="\\d",p=e?`[${l}${a.map(C=>`\\${C}`).join("")}]?`:"",g=i?`[${d}${lt(i).replaceAll(/\s/g,"\\s")}]*`:`[${d}]*`,h=n>0?`([${lt(t)}${s.map(lt).join("")}]${d}{0,${Number.isFinite(n)?n:""}})?`:"",v=Fh(o);return new RegExp(`^${c}${p}${g}${h}${v}$`)}function Fh(t){return t?`${t.split("").map(e=>`${lt(e)}?`).join("")}`:""}function pc(t,e="."){let n=!!t.match(new RegExp(`^\\D*[${uc}\\${Rs}${Bh}${Ah}${Nh}]`)),i=lt(e),r=t.replaceAll(new RegExp(`${i}(?!\\d)`,"g"),"").replaceAll(new RegExp(`[^\\d${i}]`,"g"),"").replace(e,".");return r?Number((n?Rs:"")+r):NaN}function qw(t){let e=String(t),[n,i]=e.split("e-"),r=e;if(i){let[,o]=n.split("."),s=Number(i)+(o?.length||0);r=t.toFixed(s)}return r}function jh(t,{decimalSeparator:e,thousandSeparator:n}){let[i="",r=""]=t.split(e),[,o="",s=""]=i.match(new RegExp(`([^\\d${lt(n)}]+)?(.*)`))||[];return{minus:o,integerPart:s,decimalPart:r}}function Gw({decimalSeparator:t,thousandSeparator:e,decimalPseudoSeparators:n=Aw}){return n.filter(i=>i!==e&&i!==t)}function Xw({decimalSeparator:t,precision:e,decimalZeroPadding:n,prefix:i,postfix:r}){return e<=0||!n?Rr:({value:o,selection:s})=>{let{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=Qt(o,{prefix:i,postfix:r});if(Number.isNaN(pc(a,t)))return{value:o,selection:s};let[d,p=""]=a.split(t);return{value:l+d+t+p.padEnd(e,"0")+c,selection:s}}}function Yw({prefix:t,postfix:e,decimalSeparator:n,thousandSeparator:i}){return({value:r,selection:o})=>{let[s]=o,{cleanValue:a,extractedPrefix:l,extractedPostfix:c}=Qt(r,{prefix:t,postfix:e}),{minus:d,integerPart:p,decimalPart:g}=jh(a,{decimalSeparator:n,thousandSeparator:i}),h=!p&&!g&&a.includes(n);return!p&&!Number(g)&&s===(d+l).length||h?{selection:o,value:l+d+c}:{value:r,selection:o}}}function Kw({decimalSeparator:t,decimalPseudoSeparators:e,pseudoMinuses:n,prefix:i,postfix:r,minusSign:o}){let s=!0,a=Hh({decimalSeparator:t,decimalPseudoSeparators:e,pseudoMinuses:n,prefix:"",postfix:"",thousandSeparator:"",precision:1/0,isNegativeAllowed:!0,minusSign:o});return({elementState:l,data:c})=>{if(!s)return{elementState:l,data:c};s=!1;let{value:d,selection:p}=l,[g,h]=p,{extractedPrefix:v,cleanValue:C,extractedPostfix:R}=Qt(d,{prefix:i,postfix:r}),O=Ji({selection:[Math.max(g-v.length,0),qn(h-v.length,0,C.length)],value:C},{mask:a}),[N,Q]=O.selection;return{elementState:{selection:[N+v.length,Q+v.length],value:v+O.value+R},data:c}}}function Qw({decimalSeparator:t,thousandSeparator:e,prefix:n,postfix:i}){let r=s=>{let a=lt(e);return s.replace(new RegExp(`^(\\D+)?[0${a}]+(?=0)`),"$1").replace(new RegExp(`^(\\D+)?[0${a}]+(?=[1-9])`),"$1")},o=(s,a)=>{let l=s.slice(0,a),c=s.slice(a).startsWith("0");return l.length-r(l).length+(c?1:0)};return({value:s,selection:a})=>{let[l,c]=a,{cleanValue:d,extractedPrefix:p,extractedPostfix:g}=Qt(s,{prefix:n,postfix:i}),h=d.includes(t),[v,C=""]=d.split(t),R=r(v);if(v===R)return{value:s,selection:a};let O=l-o(s,l),N=c-o(s,c);return{value:p+R+(h?t:"")+C+g,selection:[Math.max(O,0),Math.max(N,0)]}}}function Zw({min:t,max:e,decimalSeparator:n,minusSign:i}){return({value:r,selection:o})=>{let s=pc(r,n),a=s>0?Math.min(s,e):Math.max(s,t);if(s&&a!==s){let l=`${a}`.replace(".",n).replace(Rs,i);return{value:l,selection:[l.length,l.length]}}return{value:r,selection:o}}}function Jw({decimalSeparator:t,thousandSeparator:e,decimalZeroPadding:n}){return({elementState:i,data:r},o)=>{let{value:s,selection:a}=i,[l,c]=a,d=s.slice(l,c),p=n?[t,e]:[e],g=n&&l>s.indexOf(t)&&!!d.match(/^0+$/gi);return o!=="deleteBackward"&&o!=="deleteForward"||!p.includes(d)&&!g?{elementState:i,data:r}:{elementState:{value:s,selection:o==="deleteForward"?[c,c]:[l,l]},data:r}}}function ex({decimalSeparator:t,precision:e,prefix:n,postfix:i}){let r=new RegExp(`^\\D*${lt(t)}`);return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPrefix:d}=Qt(a,{prefix:n,postfix:i}),[p,g]=l,h=qn(p-d.length,0,c.length),v=qn(g-d.length,0,c.length);if(e<=0||c.slice(0,h).includes(t)||c.slice(v).includes(t)||!s.match(r))return{elementState:o,data:s};let C=c.slice(0,h).match(/\d+/);return{elementState:o,data:C?s:`0${s}`}}}function Rh({validCharacter:t,pseudoCharacters:e,prefix:n,postfix:i}){let r=new RegExp(`[${e.join("")}]`,"gi");return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPostfix:d,extractedPrefix:p}=Qt(a,{prefix:n,postfix:i});return{elementState:{selection:l,value:p+c.replace(r,t)+d},data:s.replace(r,t)}}}function tx({decimalSeparator:t,prefix:e,postfix:n}){return({elementState:i,data:r})=>{let{value:o,selection:s}=i,[a,l]=s,{cleanValue:c}=Qt(o,{prefix:e,postfix:n});return{elementState:i,data:!c.includes(t)||o.slice(a,l+1).includes(t)?r:r.replaceAll(new RegExp(lt(t),"gi"),"")}}}function ix({thousandSeparator:t,decimalSeparator:e,prefix:n,postfix:i}){if(!t)return Rr;let r=(...o)=>o.every(s=>/\s/.test(s));return({value:o,selection:s})=>{let{cleanValue:a,extractedPostfix:l,extractedPrefix:c}=Qt(o,{prefix:n,postfix:i}),{minus:d,integerPart:p,decimalPart:g}=jh(a,{decimalSeparator:e,thousandSeparator:t}),[h,v]=s,[C,R]=s,O=Array.from(p).reduceRight((N,Q,U)=>{let _=!(!U&&Q===t)&&N.length&&(N.length+1)%4===0;return _&&(Q===t||r(Q,t))?t+N:Q===t&&!_?(U&&U<=h&&C--,U&&U<=v&&R--,N):_?(U<=h&&C++,U<=v&&R++,Q+t+N):Q+N},"");return{value:c+d+O+(a.includes(e)?e:"")+g+l,selection:[C,R]}}}function nx({precision:t,decimalSeparator:e,prefix:n,postfix:i}){if(t>0)return Rr;let r=new RegExp(`${lt(e)}.*$`,"g");return({elementState:o,data:s})=>{let{value:a,selection:l}=o,{cleanValue:c,extractedPrefix:d,extractedPostfix:p}=Qt(a,{prefix:n,postfix:i}),[g,h]=l,v=d+c.replace(r,"")+p;return{elementState:{selection:[Math.min(g,v.length),Math.min(h,v.length)],value:v},data:s.replace(r,"")}}}var Mh=[0,0];function rx({decimalSeparator:t,thousandSeparator:e,prefix:n,postfix:i}){let r=Qw({decimalSeparator:t,thousandSeparator:e,prefix:n,postfix:i});return Gn("blur",o=>{let s=r({value:o.value,selection:Mh},{value:"",selection:Mh}).value;$n(o,s)},{capture:!0})}function ox({min:t,max:e,decimalSeparator:n}){return Gn("blur",(i,r)=>{let o=pc(i.value,n),s=qn(o,t,e);!Number.isNaN(o)&&o!==s&&$n(i,Ji(qw(s),r))},{capture:!0})}function sx({decimalSeparator:t,prefix:e,postfix:n}){return Gn("blur",i=>{let{cleanValue:r,extractedPostfix:o,extractedPrefix:s}=Qt(i.value,{prefix:e,postfix:n}),a=s+r.replace(new RegExp(`^(\\D+)?${lt(t)}`),`$10${t}`)+o;$n(i,a)},{capture:!0})}function Xn({max:t=Number.MAX_SAFE_INTEGER,min:e=Number.MIN_SAFE_INTEGER,precision:n=0,thousandSeparator:i=zw,decimalSeparator:r=".",decimalPseudoSeparators:o,decimalZeroPadding:s=!1,prefix:a="",postfix:l="",minusSign:c=uc}={}){let d=[Rs,Bh,Ah,Nh,uc].filter(h=>h!==i&&h!==r&&h!==c),p=Gw({decimalSeparator:r,thousandSeparator:i,decimalPseudoSeparators:o}),g=a.endsWith(r)&&n>0?`${a}${Lw}`:a;return Object.assign(Object.assign({},Wn),{mask:Hh({decimalSeparator:r,precision:n,thousandSeparator:i,prefix:g,postfix:l,isNegativeAllowed:e<0,minusSign:c}),preprocessors:[Vw(),Kw({decimalSeparator:r,decimalPseudoSeparators:p,pseudoMinuses:d,prefix:g,postfix:l,minusSign:c}),$w({prefix:g,postfix:l}),Rh({validCharacter:c,pseudoCharacters:d,prefix:g,postfix:l}),Rh({validCharacter:r,pseudoCharacters:p,prefix:g,postfix:l}),ex({decimalSeparator:r,precision:n,prefix:g,postfix:l}),Jw({decimalSeparator:r,decimalZeroPadding:s,thousandSeparator:i}),nx({precision:n,decimalSeparator:r,prefix:g,postfix:l}),tx({decimalSeparator:r,prefix:g,postfix:l})],postprocessors:[Zw({decimalSeparator:r,min:e,max:t,minusSign:c}),Ww(g),Uw(l),ix({decimalSeparator:r,thousandSeparator:i,prefix:g,postfix:l}),Xw({decimalSeparator:r,decimalZeroPadding:s,precision:n,prefix:g,postfix:l}),Yw({prefix:g,postfix:l,decimalSeparator:r,thousandSeparator:i})],plugins:[rx({decimalSeparator:r,thousandSeparator:i,prefix:g,postfix:l}),sx({decimalSeparator:r,prefix:g,postfix:l}),ox({min:e,max:t,decimalSeparator:r})],overwriteMode:s?({value:h,selection:[v]})=>v<=h.indexOf(r)?"shift":"replace":"shift"})}var ji=(()=>{let e=class e{constructor(){this.elementRef=I(mt).nativeElement,this.ngZone=I(gt),this.maskedElement=null,this.options=null,this.elementPredicate=Th;let i=I(Xe,{self:!0,optional:!0});if(i){let r=i.writeValue.bind(i);i.writeValue=o=>{r(this.options?Ji(String(o??""),this.options):o)}}}ngOnChanges(){return F(this,null,function*(){let{elementPredicate:i,options:r}=this;if(this.maskedElement?.destroy(),!r)return;let o=yield i(this.elementRef);this.elementPredicate===i&&this.ngZone.runOutsideAngular(()=>{this.maskedElement=new Os(o,r)})})}ngOnDestroy(){this.maskedElement?.destroy()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275dir=Ki({type:e,selectors:[["","maskito",""]],inputs:{options:[0,"maskito","options"],elementPredicate:[0,"maskitoElement","elementPredicate"]},standalone:!0,features:[ri]});let t=e;return t})(),Vh=(()=>{let e=class e{transform(i,r){return Ji(String(i??""),r??Wn)}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=Lo({name:"maskito",type:e,pure:!0,standalone:!0});let t=e;return t})();var lx=20,Wh=(()=>{let e=class e{constructor(i,r,o){this._ngZone=i,this._platform=r,this._scrolled=new Ge,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=o}register(i){this.scrollContainers.has(i)||this.scrollContainers.set(i,i.elementScrolled().subscribe(()=>this._scrolled.next(i)))}deregister(i){let r=this.scrollContainers.get(i);r&&(r.unsubscribe(),this.scrollContainers.delete(i))}scrolled(i=lx){return this._platform.isBrowser?new ft(r=>{this._globalSubscription||this._addGlobalListener();let o=i>0?this._scrolled.pipe(Aa(i)).subscribe(r):this._scrolled.subscribe(r);return this._scrolledCount++,()=>{o.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):$e()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((i,r)=>this.deregister(r)),this._scrolled.complete()}ancestorScrolled(i,r){let o=this.getAncestorScrollContainers(i);return this.scrolled(r).pipe(At(s=>!s||o.indexOf(s)>-1))}getAncestorScrollContainers(i){let r=[];return this.scrollContainers.forEach((o,s)=>{this._scrollableContainsElement(s,i)&&r.push(s)}),r}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(i,r){let o=Yu(r),s=i.getElementRef().nativeElement;do if(o==s)return!0;while(o=o.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>{let i=this._getWindow();return Xi(i.document,"scroll").subscribe(()=>this._scrolled.next())})}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}};e.\u0275fac=function(r){return new(r||e)(J(gt),J(vi),J(at,8))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var cx=20,Mr=(()=>{let e=class e{constructor(i,r,o){this._platform=i,this._change=new Ge,this._changeListener=s=>{this._change.next(s)},this._document=o,r.runOutsideAngular(()=>{if(i.isBrowser){let s=this._getWindow();s.addEventListener("resize",this._changeListener),s.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let i=this._getWindow();i.removeEventListener("resize",this._changeListener),i.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let i={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),i}getViewportRect(){let i=this.getViewportScrollPosition(),{width:r,height:o}=this.getViewportSize();return{top:i.top,left:i.left,bottom:i.top+o,right:i.left+r,height:o,width:r}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let i=this._document,r=this._getWindow(),o=i.documentElement,s=o.getBoundingClientRect(),a=-s.top||i.body.scrollTop||r.scrollY||o.scrollTop||0,l=-s.left||i.body.scrollLeft||r.scrollX||o.scrollLeft||0;return{top:a,left:l}}change(i=cx){return i>0?this._change.pipe(Aa(i)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let i=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:i.innerWidth,height:i.innerHeight}:{width:0,height:0}}};e.\u0275fac=function(r){return new(r||e)(J(vi),J(gt),J(at,8))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var Ms=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({});let t=e;return t})(),hc=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({imports:[yr,Ms,yr,Ms]});let t=e;return t})();var qh=Xu(),fc=class{constructor(e,n){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=n}attach(){}enable(){if(this._canBeEnabled()){let e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=Ie(-this._previousScrollPosition.left),e.style.top=Ie(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let e=this._document.documentElement,n=this._document.body,i=e.style,r=n.style,o=i.scrollBehavior||"",s=r.scrollBehavior||"";this._isEnabled=!1,i.left=this._previousHTMLStyles.left,i.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),qh&&(i.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),qh&&(i.scrollBehavior=o,r.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let n=this._document.body,i=this._viewportRuler.getViewportSize();return n.scrollHeight>i.height||n.scrollWidth>i.width}};var mc=class{constructor(e,n,i,r){this._scrollDispatcher=e,this._ngZone=n,this._viewportRuler=i,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(this._scrollSubscription)return;let e=this._scrollDispatcher.scrolled(0).pipe(At(n=>!n||!this._overlayRef.overlayElement.contains(n.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{let n=this._viewportRuler.getViewportScrollPosition().top;Math.abs(n-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},Bs=class{enable(){}disable(){}attach(){}};function gc(t,e){return e.some(n=>{let i=t.bottom<n.top,r=t.top>n.bottom,o=t.right<n.left,s=t.left>n.right;return i||r||o||s})}function Gh(t,e){return e.some(n=>{let i=t.top<n.top,r=t.bottom>n.bottom,o=t.left<n.left,s=t.right>n.right;return i||r||o||s})}var yc=class{constructor(e,n,i,r){this._scrollDispatcher=e,this._viewportRuler=n,this._ngZone=i,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(!this._scrollSubscription){let e=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(e).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let n=this._overlayRef.overlayElement.getBoundingClientRect(),{width:i,height:r}=this._viewportRuler.getViewportSize();gc(n,[{width:i,height:r,bottom:r,right:i,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}},ux=(()=>{let e=class e{constructor(i,r,o,s){this._scrollDispatcher=i,this._viewportRuler=r,this._ngZone=o,this.noop=()=>new Bs,this.close=a=>new mc(this._scrollDispatcher,this._ngZone,this._viewportRuler,a),this.block=()=>new fc(this._viewportRuler,this._document),this.reposition=a=>new yc(this._scrollDispatcher,this._viewportRuler,this._ngZone,a),this._document=s}};e.\u0275fac=function(r){return new(r||e)(J(Wh),J(Mr),J(gt),J(at))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),Br=class{constructor(e){if(this.scrollStrategy=new Bs,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){let n=Object.keys(e);for(let i of n)e[i]!==void 0&&(this[i]=e[i])}}};var vc=class{constructor(e,n){this.connectionPair=e,this.scrollableViewProperties=n}};var Jh=(()=>{let e=class e{constructor(i){this._attachedOverlays=[],this._document=i}ngOnDestroy(){this.detach()}add(i){this.remove(i),this._attachedOverlays.push(i)}remove(i){let r=this._attachedOverlays.indexOf(i);r>-1&&this._attachedOverlays.splice(r,1),this._attachedOverlays.length===0&&this.detach()}};e.\u0275fac=function(r){return new(r||e)(J(at))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),px=(()=>{let e=class e extends Jh{constructor(i,r){super(i),this._ngZone=r,this._keydownListener=o=>{let s=this._attachedOverlays;for(let a=s.length-1;a>-1;a--)if(s[a]._keydownEvents.observers.length>0){let l=s[a]._keydownEvents;this._ngZone?this._ngZone.run(()=>l.next(o)):l.next(o);break}}}add(i){super.add(i),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)}};e.\u0275fac=function(r){return new(r||e)(J(at),J(gt,8))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),hx=(()=>{let e=class e extends Jh{constructor(i,r,o){super(i),this._platform=r,this._ngZone=o,this._cursorStyleIsSet=!1,this._pointerDownListener=s=>{this._pointerDownEventTarget=vr(s)},this._clickListener=s=>{let a=vr(s),l=s.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:a;this._pointerDownEventTarget=null;let c=this._attachedOverlays.slice();for(let d=c.length-1;d>-1;d--){let p=c[d];if(p._outsidePointerEvents.observers.length<1||!p.hasAttached())continue;if(Xh(p.overlayElement,a)||Xh(p.overlayElement,l))break;let g=p._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>g.next(s)):g.next(s)}}}add(i){if(super.add(i),!this._isAttached){let r=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(r)):this._addEventListeners(r),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=r.style.cursor,r.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){let i=this._document.body;i.removeEventListener("pointerdown",this._pointerDownListener,!0),i.removeEventListener("click",this._clickListener,!0),i.removeEventListener("auxclick",this._clickListener,!0),i.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(i.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(i){i.addEventListener("pointerdown",this._pointerDownListener,!0),i.addEventListener("click",this._clickListener,!0),i.addEventListener("auxclick",this._clickListener,!0),i.addEventListener("contextmenu",this._clickListener,!0)}};e.\u0275fac=function(r){return new(r||e)(J(at),J(vi),J(gt,8))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function Xh(t,e){let n=typeof ShadowRoot<"u"&&ShadowRoot,i=e;for(;i;){if(i===t)return!0;i=n&&i instanceof ShadowRoot?i.host:i.parentNode}return!1}var ef=(()=>{let e=class e{constructor(i,r){this._platform=r,this._document=i}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let i="cdk-overlay-container";if(this._platform.isBrowser||Za()){let o=this._document.querySelectorAll(`.${i}[platform="server"], .${i}[platform="test"]`);for(let s=0;s<o.length;s++)o[s].remove()}let r=this._document.createElement("div");r.classList.add(i),Za()?r.setAttribute("platform","test"):this._platform.isBrowser||r.setAttribute("platform","server"),this._document.body.appendChild(r),this._containerElement=r}};e.\u0275fac=function(r){return new(r||e)(J(at),J(vi))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),bc=class{constructor(e,n,i,r,o,s,a,l,c,d=!1,p){this._portalOutlet=e,this._host=n,this._pane=i,this._config=r,this._ngZone=o,this._keyboardDispatcher=s,this._document=a,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=d,this._injector=p,this._backdropElement=null,this._backdropClick=new Ge,this._attachments=new Ge,this._detachments=new Ge,this._locationChanges=Ri.EMPTY,this._backdropClickHandler=g=>this._backdropClick.next(g),this._backdropTransitionendHandler=g=>{this._disposeBackdrop(g.target)},this._keydownEvents=new Ge,this._outsidePointerEvents=new Ge,this._renders=new Ge,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy,this._afterRenderRef=ku(()=>Eu(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let n=this._portalOutlet.attach(e);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),Vo(()=>{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 n?.onDestroy=="function"&&n.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),n}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){let e=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._previousHostParent=this._pane=this._host=null,e&&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(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=b(b({},this._config),e),this._updateElementSize()}setDirection(e){this._config=E(b({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){let e=this._config.direction;return e?typeof e=="string"?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let e=this._pane.style;e.width=Ie(this._config.width),e.height=Ie(this._config.height),e.minWidth=Ie(this._config.minWidth),e.minHeight=Ie(this._config.minHeight),e.maxWidth=Ie(this._config.maxWidth),e.maxHeight=Ie(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){let e="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(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(e){if(this._animationsDisabled){this._disposeBackdrop(e);return}e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",this._backdropTransitionendHandler)}),e.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(()=>{this._disposeBackdrop(e)},500))}}_toggleClasses(e,n,i){let r=Ja(n||[]).filter(o=>!!o);r.length&&(i?e.classList.add(...r):e.classList.remove(...r))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{let e=this._renders.pipe(ja(Yi(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()),e.unsubscribe())})})}_disposeScrollStrategy(){let e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}_disposeBackdrop(e){e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",this._backdropTransitionendHandler),e.remove(),this._backdropElement===e&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}},Yh="cdk-overlay-connected-position-bounding-box",fx=/([A-Za-z%]+)$/,_c=class{get positions(){return this._preferredPositions}constructor(e,n,i,r,o){this._viewportRuler=n,this._document=i,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 Ge,this._resizeSubscription=Ri.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}attach(e){this._overlayRef&&this._overlayRef,this._validatePositions(),e.hostElement.classList.add(Yh),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.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 e=this._originRect,n=this._overlayRect,i=this._viewportRect,r=this._containerRect,o=[],s;for(let a of this._preferredPositions){let l=this._getOriginPoint(e,r,a),c=this._getOverlayPoint(l,n,a),d=this._getOverlayFit(c,n,i,a);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(a,l);return}if(this._canFitWithFlexibleDimensions(d,c,i)){o.push({position:a,origin:l,overlayRect:n,boundingBoxRect:this._calculateBoundingBoxRect(l,a)});continue}(!s||s.overlayFit.visibleArea<d.visibleArea)&&(s={overlayFit:d,overlayPoint:c,originPoint:l,position:a,overlayRect:n})}if(o.length){let a=null,l=-1;for(let c of o){let d=c.boundingBoxRect.width*c.boundingBoxRect.height*(c.position.weight||1);d>l&&(l=d,a=c)}this._isPushed=!1,this._applyPosition(a.position,a.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(s.position,s.originPoint);return}this._applyPosition(s.position,s.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&en(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Yh),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let e=this._lastPosition;if(e){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let n=this._getOriginPoint(this._originRect,this._containerRect,e);this._applyPosition(e,n)}else this.apply()}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,e.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,n,i){let r;if(i.originX=="center")r=e.left+e.width/2;else{let s=this._isRtl()?e.right:e.left,a=this._isRtl()?e.left:e.right;r=i.originX=="start"?s:a}n.left<0&&(r-=n.left);let o;return i.originY=="center"?o=e.top+e.height/2:o=i.originY=="top"?e.top:e.bottom,n.top<0&&(o-=n.top),{x:r,y:o}}_getOverlayPoint(e,n,i){let r;i.overlayX=="center"?r=-n.width/2:i.overlayX==="start"?r=this._isRtl()?-n.width:0:r=this._isRtl()?0:-n.width;let o;return i.overlayY=="center"?o=-n.height/2:o=i.overlayY=="top"?0:-n.height,{x:e.x+r,y:e.y+o}}_getOverlayFit(e,n,i,r){let o=Qh(n),{x:s,y:a}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(s+=l),c&&(a+=c);let d=0-s,p=s+o.width-i.width,g=0-a,h=a+o.height-i.height,v=this._subtractOverflows(o.width,d,p),C=this._subtractOverflows(o.height,g,h),R=v*C;return{visibleArea:R,isCompletelyWithinViewport:o.width*o.height===R,fitsInViewportVertically:C===o.height,fitsInViewportHorizontally:v==o.width}}_canFitWithFlexibleDimensions(e,n,i){if(this._hasFlexibleDimensions){let r=i.bottom-n.y,o=i.right-n.x,s=Kh(this._overlayRef.getConfig().minHeight),a=Kh(this._overlayRef.getConfig().minWidth),l=e.fitsInViewportVertically||s!=null&&s<=r,c=e.fitsInViewportHorizontally||a!=null&&a<=o;return l&&c}return!1}_pushOverlayOnScreen(e,n,i){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};let r=Qh(n),o=this._viewportRect,s=Math.max(e.x+r.width-o.width,0),a=Math.max(e.y+r.height-o.height,0),l=Math.max(o.top-i.top-e.y,0),c=Math.max(o.left-i.left-e.x,0),d=0,p=0;return r.width<=o.width?d=c||-s:d=e.x<this._viewportMargin?o.left-i.left-e.x:0,r.height<=o.height?p=l||-a:p=e.y<this._viewportMargin?o.top-i.top-e.y:0,this._previousPushAmount={x:d,y:p},{x:e.x+d,y:e.y+p}}_applyPosition(e,n){if(this._setTransformOrigin(e),this._setOverlayElementStyles(n,e),this._setBoundingBoxStyles(n,e),e.panelClass&&this._addPanelClasses(e.panelClass),this._positionChanges.observers.length){let i=this._getScrollVisibility();if(e!==this._lastPosition||!this._lastScrollVisibility||!mx(this._lastScrollVisibility,i)){let r=new vc(e,i);this._positionChanges.next(r)}this._lastScrollVisibility=i}this._lastPosition=e,this._isInitialRender=!1}_setTransformOrigin(e){if(!this._transformOriginSelector)return;let n=this._boundingBox.querySelectorAll(this._transformOriginSelector),i,r=e.overlayY;e.overlayX==="center"?i="center":this._isRtl()?i=e.overlayX==="start"?"right":"left":i=e.overlayX==="start"?"left":"right";for(let o=0;o<n.length;o++)n[o].style.transformOrigin=`${i} ${r}`}_calculateBoundingBoxRect(e,n){let i=this._viewportRect,r=this._isRtl(),o,s,a;if(n.overlayY==="top")s=e.y,o=i.height-s+this._viewportMargin;else if(n.overlayY==="bottom")a=i.height-e.y+this._viewportMargin*2,o=i.height-a+this._viewportMargin;else{let h=Math.min(i.bottom-e.y+i.top,e.y),v=this._lastBoundingBoxSize.height;o=h*2,s=e.y-h,o>v&&!this._isInitialRender&&!this._growAfterOpen&&(s=e.y-v/2)}let l=n.overlayX==="start"&&!r||n.overlayX==="end"&&r,c=n.overlayX==="end"&&!r||n.overlayX==="start"&&r,d,p,g;if(c)g=i.width-e.x+this._viewportMargin*2,d=e.x-this._viewportMargin;else if(l)p=e.x,d=i.right-e.x;else{let h=Math.min(i.right-e.x+i.left,e.x),v=this._lastBoundingBoxSize.width;d=h*2,p=e.x-h,d>v&&!this._isInitialRender&&!this._growAfterOpen&&(p=e.x-v/2)}return{top:s,left:p,bottom:a,right:g,width:d,height:o}}_setBoundingBoxStyles(e,n){let i=this._calculateBoundingBoxRect(e,n);!this._isInitialRender&&!this._growAfterOpen&&(i.height=Math.min(i.height,this._lastBoundingBoxSize.height),i.width=Math.min(i.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,s=this._overlayRef.getConfig().maxWidth;r.height=Ie(i.height),r.top=Ie(i.top),r.bottom=Ie(i.bottom),r.width=Ie(i.width),r.left=Ie(i.left),r.right=Ie(i.right),n.overlayX==="center"?r.alignItems="center":r.alignItems=n.overlayX==="end"?"flex-end":"flex-start",n.overlayY==="center"?r.justifyContent="center":r.justifyContent=n.overlayY==="bottom"?"flex-end":"flex-start",o&&(r.maxHeight=Ie(o)),s&&(r.maxWidth=Ie(s))}this._lastBoundingBoxSize=i,en(this._boundingBox.style,r)}_resetBoundingBoxStyles(){en(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){en(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,n){let i={},r=this._hasExactPosition(),o=this._hasFlexibleDimensions,s=this._overlayRef.getConfig();if(r){let d=this._viewportRuler.getViewportScrollPosition();en(i,this._getExactOverlayY(n,e,d)),en(i,this._getExactOverlayX(n,e,d))}else i.position="static";let a="",l=this._getOffset(n,"x"),c=this._getOffset(n,"y");l&&(a+=`translateX(${l}px) `),c&&(a+=`translateY(${c}px)`),i.transform=a.trim(),s.maxHeight&&(r?i.maxHeight=Ie(s.maxHeight):o&&(i.maxHeight="")),s.maxWidth&&(r?i.maxWidth=Ie(s.maxWidth):o&&(i.maxWidth="")),en(this._pane.style,i)}_getExactOverlayY(e,n,i){let r={top:"",bottom:""},o=this._getOverlayPoint(n,this._overlayRect,e);if(this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,i)),e.overlayY==="bottom"){let s=this._document.documentElement.clientHeight;r.bottom=`${s-(o.y+this._overlayRect.height)}px`}else r.top=Ie(o.y);return r}_getExactOverlayX(e,n,i){let r={left:"",right:""},o=this._getOverlayPoint(n,this._overlayRect,e);this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,i));let s;if(this._isRtl()?s=e.overlayX==="end"?"left":"right":s=e.overlayX==="end"?"right":"left",s==="right"){let a=this._document.documentElement.clientWidth;r.right=`${a-(o.x+this._overlayRect.width)}px`}else r.left=Ie(o.x);return r}_getScrollVisibility(){let e=this._getOriginRect(),n=this._pane.getBoundingClientRect(),i=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:Gh(e,i),isOriginOutsideView:gc(e,i),isOverlayClipped:Gh(n,i),isOverlayOutsideView:gc(n,i)}}_subtractOverflows(e,...n){return n.reduce((i,r)=>i-Math.max(r,0),e)}_getNarrowedViewportRect(){let e=this._document.documentElement.clientWidth,n=this._document.documentElement.clientHeight,i=this._viewportRuler.getViewportScrollPosition();return{top:i.top+this._viewportMargin,left:i.left+this._viewportMargin,right:i.left+e-this._viewportMargin,bottom:i.top+n-this._viewportMargin,width:e-2*this._viewportMargin,height:n-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,n){return n==="x"?e.offsetX==null?this._offsetX:e.offsetX:e.offsetY==null?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&Ja(e).forEach(n=>{n!==""&&this._appliedPanelClasses.indexOf(n)===-1&&(this._appliedPanelClasses.push(n),this._pane.classList.add(n))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){let e=this._origin;if(e instanceof mt)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();let n=e.width||0,i=e.height||0;return{top:e.y,bottom:e.y+i,left:e.x,right:e.x+n,height:i,width:n}}};function en(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Kh(t){if(typeof t!="number"&&t!=null){let[e,n]=t.split(fx);return!n||n==="px"?parseFloat(e):null}return t||null}function Qh(t){return{top:Math.floor(t.top),right:Math.floor(t.right),bottom:Math.floor(t.bottom),left:Math.floor(t.left),width:Math.floor(t.width),height:Math.floor(t.height)}}function mx(t,e){return t===e?!0:t.isOriginClipped===e.isOriginClipped&&t.isOriginOutsideView===e.isOriginOutsideView&&t.isOverlayClipped===e.isOverlayClipped&&t.isOverlayOutsideView===e.isOverlayOutsideView}var Zh="cdk-global-overlay-wrapper",wc=class{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(e){let n=e.getConfig();this._overlayRef=e,this._width&&!n.width&&e.updateSize({width:this._width}),this._height&&!n.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(Zh),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._xOffset=e,this._xPosition="left",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._xOffset=e,this._xPosition="right",this}start(e=""){return this._xOffset=e,this._xPosition="start",this}end(e=""){return this._xOffset=e,this._xPosition="end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._xPosition="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let e=this._overlayRef.overlayElement.style,n=this._overlayRef.hostElement.style,i=this._overlayRef.getConfig(),{width:r,height:o,maxWidth:s,maxHeight:a}=i,l=(r==="100%"||r==="100vw")&&(!s||s==="100%"||s==="100vw"),c=(o==="100%"||o==="100vh")&&(!a||a==="100%"||a==="100vh"),d=this._xPosition,p=this._xOffset,g=this._overlayRef.getConfig().direction==="rtl",h="",v="",C="";l?C="flex-start":d==="center"?(C="center",g?v=p:h=p):g?d==="left"||d==="end"?(C="flex-end",h=p):(d==="right"||d==="start")&&(C="flex-start",v=p):d==="left"||d==="start"?(C="flex-start",h=p):(d==="right"||d==="end")&&(C="flex-end",v=p),e.position=this._cssPosition,e.marginLeft=l?"0":h,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=l?"0":v,n.justifyContent=C,n.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let e=this._overlayRef.overlayElement.style,n=this._overlayRef.hostElement,i=n.style;n.classList.remove(Zh),i.justifyContent=i.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}},gx=(()=>{let e=class e{constructor(i,r,o,s){this._viewportRuler=i,this._document=r,this._platform=o,this._overlayContainer=s}global(){return new wc}flexibleConnectedTo(i){return new _c(i,this._viewportRuler,this._document,this._platform,this._overlayContainer)}};e.\u0275fac=function(r){return new(r||e)(J(Mr),J(at),J(vi),J(ef))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})(),yx=0,Vi=(()=>{let e=class e{constructor(i,r,o,s,a,l,c,d,p,g,h,v){this.scrollStrategies=i,this._overlayContainer=r,this._componentFactoryResolver=o,this._positionBuilder=s,this._keyboardDispatcher=a,this._injector=l,this._ngZone=c,this._document=d,this._directionality=p,this._location=g,this._outsideClickDispatcher=h,this._animationsModuleType=v}create(i){let r=this._createHostElement(),o=this._createPaneElement(r),s=this._createPortalOutlet(o),a=new Br(i);return a.direction=a.direction||this._directionality.value,new bc(s,r,o,a,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,this._animationsModuleType==="NoopAnimations",this._injector.get(xu))}position(){return this._positionBuilder}_createPaneElement(i){let r=this._document.createElement("div");return r.id=`cdk-overlay-${yx++}`,r.classList.add("cdk-overlay-pane"),i.appendChild(r),r}_createHostElement(){let i=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(i),i}_createPortalOutlet(i){return this._appRef||(this._appRef=this._injector.get(Du)),new qu(i,this._componentFactoryResolver,this._appRef,this._injector,this._document)}};e.\u0275fac=function(r){return new(r||e)(J(ux),J(ef),J(Pu),J(gx),J(px),J(Be),J(gt),J(at),J(ds),J(Xo),J(hx),J(Cu,8))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var vx=new pr("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let t=I(Vi);return()=>t.scrollStrategies.reposition()}});function bx(t){return()=>t.scrollStrategies.reposition()}var _x={provide:vx,deps:[Vi],useFactory:bx},tf=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({providers:[Vi,_x],imports:[yr,Gu,hc,hc]});let t=e;return t})();var Px=["panel"],Ex=["*"];function Dx(t,e){if(t&1){let n=pe();f(0,"div",1,0),A("@panelAnimation.done",function(r){q(n);let o=k();return G(o._animationDone.next(r))}),kn(2),m()}if(t&2){let n=e.id,i=k();Wo(i._classList),En("mat-mdc-autocomplete-visible",i.showPanel)("mat-mdc-autocomplete-hidden",!i.showPanel)("mat-primary",i._color==="primary")("mat-accent",i._color==="accent")("mat-warn",i._color==="warn"),S("id",i.id)("@panelAnimation",i.isOpen?"visible":"hidden"),St("aria-label",i.ariaLabel||null)("aria-labelledby",i._getPanelAriaLabelledby(n))}}var kx=Bu("panelAnimation",[Nu("void, hidden",gr({opacity:0,transform:"scaleY(0.8)"})),Ka(":enter, hidden => visible",[Au([Zo("0.03s linear",gr({opacity:1})),Zo("0.12s cubic-bezier(0, 0, 0.2, 1)",gr({transform:"scaleY(1)"}))])]),Ka(":leave, visible => hidden",[Zo("0.075s linear",gr({opacity:0}))])]),Tx=0,Cc=class{constructor(e,n){this.source=e,this.option=n}},of=new pr("mat-autocomplete-default-options",{providedIn:"root",factory:Ix});function Ix(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var sf=(()=>{let e=class e{get isOpen(){return this._isOpen&&this.showPanel}_setColor(i){this._color=i,this._changeDetectorRef.markForCheck()}set classList(i){this._classList=i,this._elementRef.nativeElement.className=""}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(i){this._hideSingleSelectionIndicator=i,this._syncParentProperties()}_syncParentProperties(){if(this.options)for(let i of this.options)i._changeDetectorRef.markForCheck()}constructor(i,r,o,s){this._changeDetectorRef=i,this._elementRef=r,this._defaults=o,this._activeOptionChanges=Ri.EMPTY,this._animationDone=new st,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new st,this.opened=new st,this.closed=new st,this.optionActivated=new st,this.id=`mat-autocomplete-${Tx++}`,this.inertGroups=s?.SAFARI||!1,this.autoActiveFirstOption=!!o.autoActiveFirstOption,this.autoSelectActiveOption=!!o.autoSelectActiveOption,this.requireSelection=!!o.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new Zu(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(i=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[i]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(i){this.panel&&(this.panel.nativeElement.scrollTop=i)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(i){let r=new Cc(this,i);this.optionSelected.emit(r)}_getPanelAriaLabelledby(i){if(this.ariaLabel)return null;let r=i?i+" ":"";return this.ariaLabelledby?r+this.ariaLabelledby:i}_skipPredicate(){return!1}};e.\u0275fac=function(r){return new(r||e)(Se(Qi),Se(mt),Se(of),Se(vi))},e.\u0275cmp=ee({type:e,selectors:[["mat-autocomplete"]],contentQueries:function(r,o,s){if(r&1&&(qo(s,fs,5),qo(s,ep,5)),r&2){let a;Lt(a=Ht())&&(o.options=a),Lt(a=Ht())&&(o.optionGroups=a)}},viewQuery:function(r,o){if(r&1&&(oi(hr,7),oi(Px,5)),r&2){let s;Lt(s=Ht())&&(o.template=s.first),Lt(s=Ht())&&(o.panel=s.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",Bi],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",Bi],requireSelection:[2,"requireSelection","requireSelection",Bi],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",Bi],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",Bi]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],standalone:!0,features:[Go([{provide:Ju,useExisting:e}]),fr,ie],ngContentSelectors:Ex,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(r,o){r&1&&(Dn(),K(0,Dx,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);box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color)}.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:[kx]},changeDetection:0});let t=e;return t})();var Ox={provide:zu,useExisting:wu(()=>Sc),multi:!0};var af=new pr("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let t=I(Vi);return()=>t.scrollStrategies.reposition()}});function Fx(t){return()=>t.scrollStrategies.reposition()}var Rx={provide:af,deps:[Vi],useFactory:Fx},Sc=(()=>{let e=class e{constructor(i,r,o,s,a,l,c,d,p,g,h){this._element=i,this._overlay=r,this._viewContainerRef=o,this._zone=s,this._changeDetectorRef=a,this._dir=c,this._formField=d,this._document=p,this._viewportRuler=g,this._defaults=h,this._componentDestroyed=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=Ri.EMPTY,this._breakpointObserver=I(Ku),this._handsetLandscapeSubscription=Ri.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new Ge,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 Ge,this._injector=I(Be),this._aboveClass="mat-mdc-autocomplete-panel-above",this._overlayAttached=!1,this.optionSelections=yu(()=>{let v=this.autocomplete?this.autocomplete.options:null;return v?v.changes.pipe(Ha(v),Mi(()=>Yi(...v.map(C=>C.onSelectionChange)))):this._initialized.pipe(Mi(()=>this.optionSelections))}),this._handlePanelKeydown=v=>{(v.keyCode===27&&!ps(v)||v.keyCode===38&&ps(v,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),v.stopPropagation(),v.preventDefault())},this._trackedModal=null,this._scrollStrategy=l}ngAfterViewInit(){this._initialized.next(),this._initialized.complete();let i=this._getWindow();typeof i<"u"&&this._zone.runOutsideAngular(()=>i.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(i){i.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){let i=this._getWindow();typeof i<"u"&&i.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&&hs(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return Yi(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(At(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(At(()=>this._overlayAttached)):$e()).pipe(ni(i=>i instanceof tp?i:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return Yi(Xi(this._document,"click"),Xi(this._document,"auxclick"),Xi(this._document,"touchend")).pipe(At(i=>{let r=vr(i),o=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,s=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&r!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!o||!o.contains(r))&&(!s||!s.contains(r))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(r)}))}writeValue(i){Promise.resolve(null).then(()=>this._assignOptionValue(i))}registerOnChange(i){this._onChange=i}registerOnTouched(i){this._onTouched=i}setDisabledState(i){this._element.nativeElement.disabled=i}_handleKeydown(i){let r=i.keyCode,o=ps(i);if(r===27&&!o&&i.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&r===13&&this.panelOpen&&!o)this.activeOption._selectViaInteraction(),this._resetActiveItem(),i.preventDefault();else if(this.autocomplete){let s=this.autocomplete._keyManager.activeItem,a=r===38||r===40;r===9||a&&!o&&this.panelOpen?this.autocomplete._keyManager.onKeydown(i):a&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(a||this.autocomplete._keyManager.activeItem!==s)&&(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(i){let r=i.target,o=r.value;if(r.type==="number"&&(o=o==""?null:parseFloat(o)),this._previousValue!==o){if(this._previousValue=o,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(o),!o)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let s=this.autocomplete.options?.find(a=>a.selected);if(s){let a=this._getDisplayValue(s.value);o!==a&&s.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===i.target){let s=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(s)}}}_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(i=!1){this._formField&&this._formField.floatLabel==="auto"&&(i?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let i=new ft(o=>{Vo(()=>{o.next()},{injector:this._injector})}),r=this.autocomplete.options.changes.pipe(re(()=>this._positionStrategy.reapplyLastPosition()),_u(0));return Yi(i,r).pipe(Mi(()=>this._zone.run(()=>{let o=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),o!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),Na(1)).subscribe(o=>this._setValueAndClose(o))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(i){let r=this.autocomplete;return r&&r.displayWith?r.displayWith(i):i}_assignOptionValue(i){let r=this._getDisplayValue(i);i==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(r??"")}_updateNativeInputValue(i){this._formField?this._formField._control.value=i:this._element.nativeElement.value=i,this._previousValue=i}_setValueAndClose(i){let r=this.autocomplete,o=i?i.source:this._pendingAutoselectedOption;o?(this._clearPreviousSelectedOption(o),this._assignOptionValue(o.value),this._onChange(o.value),r._emitSelectEvent(o),this._element.nativeElement.focus()):r.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),r._animationDone?r._animationDone.pipe(Na(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(i,r){this.autocomplete?.options?.forEach(o=>{o!==i&&o.selected&&o.deselect(r)})}_openPanelInternal(i=this._element.nativeElement.value){if(this._attachOverlay(i),this._floatLabel(),this._trackedModal){let r=this.autocomplete.id;tl(this._trackedModal,"aria-owns",r)}}_attachOverlay(i){this.autocomplete;let r=this._overlayRef;r?(this._positionStrategy.setOrigin(this._getConnectedElement()),r.updateSize({width:this._getPanelWidth()})):(this._portal=new Qa(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),r=this._overlay.create(this._getOverlayConfig()),this._overlayRef=r,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&r&&r.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Qu.HandsetLandscape).subscribe(s=>{s.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),r&&!r.hasAttached()&&(r.attach(this._portal),this._valueOnAttach=i,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let o=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&o!==this.panelOpen&&this._emitOpened()}_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let i=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=i.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=i.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Br({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let i=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(i),this._positionStrategy=i,i}_setStrategyPositions(i){let r=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],o=this._aboveClass,s=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:o},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:o}],a;this.position==="above"?a=s:this.position==="below"?a=r:a=[...r,...s],i.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 i=this.autocomplete;if(i.autoActiveFirstOption){let r=-1;for(let o=0;o<i.options.length;o++)if(!i.options.get(o).disabled){r=o;break}i._keyManager.setActiveItem(r)}else i._keyManager.setActiveItem(-1)}_canOpen(){let i=this._element.nativeElement;return!i.readOnly&&!i.disabled&&!this.autocompleteDisabled}_getWindow(){return this._document?.defaultView||window}_scrollToOption(i){let r=this.autocomplete,o=ip(i,r.options,r.optionGroups);if(i===0&&o===1)r._setScrollTop(0);else if(r.panel){let s=r.options.toArray()[i];if(s){let a=s._getHostElement(),l=np(a.offsetTop,a.offsetHeight,r._getScrollTop(),r.panel.nativeElement.offsetHeight);r._setScrollTop(l)}}}_applyModalPanelOwnership(){let i=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!i)return;let r=this.autocomplete.id;this._trackedModal&&hs(this._trackedModal,"aria-owns",r),tl(i,"aria-owns",r),this._trackedModal=i}_clearFromModal(){if(this._trackedModal){let i=this.autocomplete.id;hs(this._trackedModal,"aria-owns",i),this._trackedModal=null}}};e.\u0275fac=function(r){return new(r||e)(Se(mt),Se(Vi),Se(Uo),Se(gt),Se(Qi),Se(af),Se(ds,8),Se(rp,9),Se(at,8),Se(Mr),Se(of,8))},e.\u0275dir=Ki({type:e,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(r,o){r&1&&A("focusin",function(){return o._handleFocus()})("blur",function(){return o._onTouched()})("input",function(a){return o._handleInput(a)})("keydown",function(a){return o._handleKeydown(a)})("click",function(){return o._handleClick()}),r&2&&St("autocomplete",o.autocompleteAttribute)("role",o.autocompleteDisabled?null:"combobox")("aria-autocomplete",o.autocompleteDisabled?null:"list")("aria-activedescendant",o.panelOpen&&o.activeOption?o.activeOption.id:null)("aria-expanded",o.autocompleteDisabled?null:o.panelOpen.toString())("aria-controls",o.autocompleteDisabled||!o.panelOpen||o.autocomplete==null?null:o.autocomplete.id)("aria-haspopup",o.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",Bi]},exportAs:["matAutocompleteTrigger"],standalone:!0,features:[Go([Ox]),fr,ri]});let t=e;return t})(),lf=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({providers:[Rx],imports:[tf,nl,il,Ut,Ms,nl,il]});let t=e;return t})();function Ar(t="emit"){return e=>e.pipe(re(n=>console.log(`${t}`,n)))}var Nr=()=>{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=Math.random()*16;return n=(t+n)%16|0,t=Math.floor(t/16),(e==="x"?n:n&3|8).toString(16)})};var Pc={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 cf=(()=>{let e=class e{constructor(){this._roles=[],this.parseJWTRoles()}parseJWTRoles(){let i=localStorage.getItem("Token");if(i){var r=el(i);this._roles=r["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"],console.log(this._roles)}}isInRole(i,r){let o={};return r.forEach((s,a)=>o[i[a]]=typeof s=="string"?this._roles.includes(s):s(this._roles)),o}isUserHasRole(i){return this._roles.includes(i)}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(i){let r={};for(let o in Pc[i])r[o]=this.isUserHasRole(Pc[i][o]);return r}get isSystemUser(){let i=localStorage.getItem("Token");return el(i).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}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var df=(t,e)=>e.PromotionID;function Bx(t,e){if(t&1&&(f(0,"mat-option",19)(1,"div",20)(2,"span",21),w(3),m(),f(4,"span",22),w(5),m()()()),t&2){let n=e.$implicit;S("value",n),y(3),D(n.Value),y(2),D(n.Code)}}function Ax(t,e){if(t&1&&Nt(0,Bx,6,3,"mat-option",19,$o),t&2){let n=k();zt(n)}}function Nx(t,e){t&1&&(f(0,"mat-option",18),w(1,"No items found"),m()),t&2&&S("disabled",!0)}function zx(t,e){t&1&&K(0,Ax,2,0)(1,Nx,2,1,"mat-option",18),t&2&&oe(e.length>0?0:1)}function Lx(t,e){if(t&1){let n=pe();f(0,"div",23)(1,"img",24),A("error",function(r){q(n);let o=k();return G(o.onErrorImage(r))}),m(),f(2,"div",25)(3,"ngb-highlight",26),w(4),m(),f(5,"span"),w(6),m()()()}if(t&2){let n=e.result,i=e.term;y(),S("src",n.ImgUrl,Ho)("alt",n.Value),y(2),S("result",n.Value)("term",i),y(),D(n.Value),y(2),D(n.Code)}}function Hx(t,e){if(t&1&&(f(0,"ng-option",28),w(1),m()),t&2){let n=e.$implicit;S("value",n.PromotionID),y(),D(n.Name)}}function jx(t,e){if(t&1&&(f(0,"ng-select",27),Nt(1,Hx,2,2,"ng-option",28,df),m()),t&2){let n=k(2);y(),zt(n)}}function Vx(t,e){if(t&1&&(f(0,"ng-option",28),w(1),m()),t&2){let n=e.$implicit;S("value",n),y(),D(n.Name)}}function Ux(t,e){if(t&1&&(f(0,"ng-select",27),Nt(1,Vx,2,2,"ng-option",28,df),m()),t&2){let n=k(2);y(),zt(n)}}function Wx(t,e){if(t&1&&(f(0,"div",12)(1,"label",9),w(2,"Promotion Price"),m(),K(3,jx,3,0,"ng-select",27)(4,Ux,3,0,"ng-select",27),m()),t&2){let n=k(2);y(3),oe(n.isEditProduct()?3:4)}}function $x(t,e){t&1&&K(0,Wx,5,1,"div",12),t&2&&oe(e.length?0:-1)}function qx(t,e){if(t&1){let n=pe();f(0,"button",29),A("click",function(){q(n);let r=k();return G(r.resetForm())}),w(1," Cancel "),m()}}var Ns=(()=>{let e=class e{constructor(){this.promotionPrice$=$e([]),this.variant$=$e({}),this.UUidSelected="",this.httpService=I(ai),this.fb=I(Ni),this.router=I(In),this.storeService=I(ce),this.location=I(Xo),this.maskitoOptions=Xn({precision:2,thousandSeparator:","}),this.route=I(Ko),this.variant={},this.roleService=I(cf),this.domain="",this.isEditProduct=H(!1)}displayFn(i){return i?i.Value:""}initForm(){this.form=this.fb.group({name:new Ke("",[Je.required]),quantity:new Ke("",[Je.required]),promotionPrice:new Ke("",[]),price:new Ke("",[Je.required])})}ngAfterViewInit(){this.domain=`https://${localStorage.getItem("Domain")}`}ngOnInit(){this.initForm(),this.form.get("promotionPrice").valueChanges.pipe(At(()=>Object.keys(this.variant).length>0),Ar("prommotionPrice"),re(i=>{if(i)this.form.patchValue({price:+this.variant.UnitPrice}),this.form.get("price").disable();else{console.warn("Invalid UnitPrice, not patching price");let r=[...this.storeService.productItems()],o=r.findIndex(s=>s.Uuid.toLowerCase()===this.route.snapshot.queryParamMap.get("id")?.toLowerCase());o!==-1&&this.form.patchValue({price:+this.variant.UnitPrice!=+r[o].UnitPrice?+r[o].UnitPrice:+this.variant.UnitPrice}),this.form.get("price").enable()}})).subscribe(),this.route.queryParamMap.pipe(re(i=>{this.isEditProduct.set(i.has("id")),console.log("edit",this.isEditProduct()),this.UUidSelected=i.get("id")||""})).subscribe(),this.route.queryParamMap.pipe(Mi(i=>{if(i.has("id")){let r=i.get("id"),o=[...this.storeService.productItems()],s=o.findIndex(a=>a.Uuid.toLowerCase()===r.toLowerCase());if(s!==-1){let a={EntityID:"00000000-0000-0000-0000-000000000000",ID:o[s].ID},l={VariantID:o[s].ID};return ur([this.httpService.post("/API/V3/Variant/ID",a,void 0,this.domain),this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",l,void 0,this.domain):$e(null)]).pipe(ni(([c,d])=>({variant:c,promotion:d,KEY:r})))}return $e(null)}else return this.form.reset(),this.form.enable(),this.promotionPrice$=$e([]),$e(null)}),Ar("edit"),re(i=>{if(i===null)return;this.form.get("name").disable();let{variant:r,promotion:o,KEY:s}=i;this.promotionPrice$=$e(o),this.variant$=$e(r),this.variant=r;let a=[...this.storeService.productItems()],l=a.findIndex(c=>c.Uuid.toLowerCase()===s.toLowerCase());if(l!==-1){let c=o.findIndex(d=>d.PromotionID.toLowerCase()===a[l].Promotions?.PromotionID?.toLowerCase());if(c!==-1){let d=+o[c]?.UnitPrice;isNaN(d)&&(d=+r.UnitPrice),this.form.patchValue({price:+r.UnitPrice!=+a[l].UnitPrice?+a[l].UnitPrice:+r.UnitPrice,promotionPrice:o[c].PromotionID,quantity:+a[l].Quantity,name:{Value:r.Name}}),this.form.get("price").disable()}else this.form.patchValue({price:+r.UnitPrice!=+a[l].UnitPrice?+a[l].UnitPrice:+r.UnitPrice,promotionPrice:null,quantity:+a[l].Quantity,name:{Value:r.Name}})}})).subscribe(),this.variantSuggestion$=this.form.get("name").valueChanges.pipe(bu(200),za(),Mi(i=>{if(i&&i.length>2){let r={count:100,prefix:i},o=`https://${localStorage.getItem("Domain")}`;return this.httpService.post("/API/AC/GetVariantSuggestionByCodeNName",r,void 0,o)}else return $e([])}))}onOptionSelected(i){if(Object.hasOwn(i.option.value,"Key")){let r=i.option.value.Key,o={EntityID:"00000000-0000-0000-0000-000000000000",ID:r},s={VariantID:r};return ur([this.httpService.post("/API/V3/Variant/ID",o,void 0,this.domain),this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",s,void 0,this.domain):$e(null)]).pipe(ni(([a,l])=>({variant:a,promotion:l})),re(({variant:a,promotion:l})=>{this.form.patchValue({price:a.UnitPrice,promotionPrice:null,quantity:1}),this.promotionPrice$=$e(l),this.variant$=$e(a),this.variant=a})).subscribe()}else throw new Error("Key not found")}onSubmit(){let{name:i,quantity:r,promotionPrice:o,price:s}=this.form.getRawValue(),a=r.toString().replace(/,/g,""),l=s.toString().replace(/,/g,"");return this.isEditProduct()?gu([this.promotionPrice$,this.variant$]).pipe(ni(([c,d])=>({promotions:c,variant:d})),ni(({promotions:c,variant:d})=>{let p=[...this.storeService.productItems()],g=p.findIndex(v=>v.Uuid.toLowerCase()===this.UUidSelected.toLowerCase());if(g!==-1){let v=c.findIndex(C=>C.PromotionID.toLowerCase()===o?.toLowerCase());if(v!==-1){let C=+c[v]?.UnitPrice;isNaN(C)&&(C=+d.UnitPrice),p[g]=E(b({},p[g]),{Quantity:+a,Promotions:c[v],UnitPrice:+l,isSelected:!1})}else p[g]=E(b({},p[g]),{Quantity:+a,Promotions:o,UnitPrice:+l,isSelected:!1})}let h=[...p];this.storeService.onChangeProductItems(h),this.form.get("price").enable(),this.form.reset(),this.router.navigate(["/pages"]),this.promotionPrice$=$e([]),this.variant={}})).subscribe():this.variant$.pipe(ni(c=>E(b({},c),{Quantity:+r,Promotions:o,UnitPrice:+l,Uuid:Nr()})),re(c=>{let d=[...this.storeService.productItems()];d.push(c);let p=[...d];this.storeService.onChangeProductItems(p),this.form.get("price").enable(),this.form.reset(),this.promotionPrice$=$e([])})).subscribe()}onErrorImage(i){console.log(i);let r=i.target;i.type==="error"&&(r.src="assets/images/image-404.svg")}get hasEdit(){return this.route.snapshot.queryParamMap.has("id")}resetForm(){this.form.reset(),this.router.navigate([],{relativeTo:this.route,queryParams:{id:null},queryParamsHandling:"merge"})}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["modal-choose-product"]],standalone:!0,features:[ie],decls:31,vars:14,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,"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,"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(r,o){if(r&1){let s=pe();f(0,"div",2)(1,"div",3)(2,"span",4),w(3),m()(),f(4,"div",5)(5,"div",6)(6,"form",7)(7,"div",8)(8,"label",9),w(9,"Name"),m(),X(10,"input",10),f(11,"mat-autocomplete",11,0),A("optionSelected",function(l){return q(s),G(o.onOptionSelected(l))}),K(13,zx,2,1),Te(14,"async"),m(),K(15,Lx,7,6,"ng-template",null,1,te),m(),f(17,"div",12)(18,"label",9),w(19,"Quantity"),m(),X(20,"input",13),m(),f(21,"div",12)(22,"label",9),w(23,"Price"),m(),X(24,"input",14),m(),K(25,$x,1,1),Te(26,"async"),f(27,"div",15),K(28,qx,2,0,"button",16),f(29,"button",17),A("click",function(){return q(s),G(o.onSubmit())}),w(30," Submit "),m()()()()()()}if(r&2){let s,a,l=qa(12);y(3),jt("",o.UUidSelected?"Update":"Add"," Product"),y(3),S("formGroup",o.form),y(4),S("matAutocomplete",l),y(),S("displayWith",o.displayFn),y(2),oe((s=Vt(14,10,o.variantSuggestion$))?13:-1,s),y(7),S("maskito",o.maskitoOptions),y(4),S("maskito",o.maskitoOptions),y(),oe((a=Vt(26,12,o.promotionPrice$))?25:-1,a),y(3),oe(o.hasEdit?28:-1),y(),S("disabled",o.form.invalid)}},dependencies:[Qo,Wt,li,ms,Qe,ts,Xe,Ye,es,is,ns,$u,Iu,ji,us,lf,sf,fs,Sc],styles:[".mat-mdc-autocomplete-panel{background-color:#fff!important} .mat-mdc-autocomplete-panel>.mat-mdc-option.mdc-list-item--disabled{min-height:34px}"]});let t=e;return t})();var uf=(()=>{let e=class e{constructor(){this.transactionType=H([{title:"Supplier Bill",type:0},{title:"Transfer Order",type:1}]),this.storeService=I(ce),this.fb=I(Ni),this.activeModal=I(Rn)}get outlets(){return this.storeService.paperConfig().Outlets}initForm(){this.form=this.fb.group({type:new Ke("",[Je.required]),outlet:new Ke("",[Je.required]),number:new Ke("",[Je.required])})}ngOnInit(){this.initForm()}onOK(){this.activeModal.close({role:"ok",data:this.form.value})}onClose(){this.activeModal.dismiss({role:"close",data:null})}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-dialog-load-transaction"]],standalone:!0,features:[ie],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"]],template:function(r,o){r&1&&(f(0,"app-base-modal",0),A("onOK",function(){return o.onOK()})("onClose",function(){return o.onClose()}),f(1,"form",1)(2,"div",2)(3,"label",3),w(4,"Choose Type"),m(),X(5,"ng-select",4),m(),f(6,"div",2)(7,"label",3),w(8,"Choose Outlet"),m(),X(9,"ng-select",5),m(),f(10,"div",2)(11,"label",3),w(12,"Invoice Number"),m(),X(13,"input",6),m()()()),r&2&&(S("hasValid",o.form.valid),y(),S("formGroup",o.form),y(4),S("items",o.transactionType()),y(4),S("items",o.outlets))},dependencies:[ks,Wt,li,nt,ts,Xe,Ye,es,Qe,is,ns],changeDetection:0});let t=e;return t})();var Gx=(()=>{class t{constructor(n){this.document=n,this.width=this.getWidth()}getWidth(){let n=this.document.createElement("div");n.style.visibility="hidden",n.style.width="100px",n.style.msOverflowStyle="scrollbar",this.document.body.appendChild(n);let i=n.offsetWidth;n.style.overflow="scroll";let r=this.document.createElement("div");r.style.width="100%",n.appendChild(r);let o=r.offsetWidth;return n.parentNode.removeChild(n),i-o}}return t.\u0275fac=function(n){return new(n||t)(J(at))},t.\u0275prov=ke({token:t,factory:t.\u0275fac}),t})(),Xx=(()=>{class t{getDimensions(n){return n.getBoundingClientRect()}}return t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=ke({token:t,factory:t.\u0275fac}),t})(),Yx=(()=>{class t{constructor(){this.columnInputChanges=new Ge}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=ke({token:t,factory:t.\u0275fac}),t})();function Kx(t){return t=t.replace(/[^a-zA-Z0-9 ]/g," "),t=t.replace(/([a-z](?=[A-Z]))/g,"$1 "),t=t.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase(),t=t.replace(/([ 0-9]+)([a-zA-Z])/g,function(e,n,i){return n.trim()+i.toUpperCase()}),t}var zs={},pf=typeof document<"u"?document.createElement("div").style:void 0,Ec=function(){let t=typeof window<"u"?window.getComputedStyle(document.documentElement,""):void 0,e=typeof t<"u"?Array.prototype.slice.call(t).join("").match(/-(moz|webkit|ms)-/):null,n=e!==null?e[1]:void 0,i=typeof n<"u"?"WebKit|Moz|MS|O".match(new RegExp("("+n+")","i"))[1]:void 0;return i?{dom:i,lowercase:n,css:`-${n}-`,js:n[0].toUpperCase()+n.substr(1)}:void 0}();function Ls(t){let e=Kx(t);return zs[e]||(Ec!==void 0&&pf[Ec.css+t]!==void 0?zs[e]=Ec.css+t:pf[t]!==void 0&&(zs[e]=t)),zs[e]}var KI=typeof window<"u"?Ls("transform"):void 0,QI=typeof window<"u"?Ls("backfaceVisibility"):void 0,ZI=typeof window<"u"?!!Ls("transform"):void 0,JI=typeof window<"u"?!!Ls("perspective"):void 0,hf=typeof window<"u"?window.navigator.userAgent:"Chrome",eO=/Safari\//.test(hf)&&!/Chrome\//.test(hf);var ff=(()=>{class t{static forRoot(n){return{ngModule:t,providers:[{provide:"configuration",useValue:n}]}}}return t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=Ct({type:t}),t.\u0275inj=xt({providers:[Gx,Xx,Yx],imports:[[Ut]]}),t})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=Qx);function Qx(t,e){let n=[],i=[],r,o,s;for(;(r=document.elementFromPoint(t,e))&&n.indexOf(r)===-1&&r!=null;)n.push(r),i.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(o=i.length;s=i[--o];)n[o].style.setProperty("pointer-events",s.value?s.value:"",s.priority);return n}var mf=(()=>{let e=class e{constructor(){this.subject$=new Ge}onFileLoad(i){let o=i.target.result,s=!1,a=[],l=[],c=0;for(let d of o.split(/[\r\n]+/))if(s){let p={};for(let g=0;g<c;g++)p[l[g]]=d.split(",")[g];a.push(p)}else{for(let p=0;p<d.split(",").length;p++)c=d.split(",").length,l.push(d.split(",")[p].replace(/ /g,""));s=!0}return a.splice(-1),a}convertFile(i){let r=i,o=new FileReader;return o.onload=s=>{let a=this.onFileLoad(s);this.subject$.next(a)},o.readAsText(r,"UTF-8"),this.subject$.asObservable()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var gf=(()=>{let e=class e{constructor(i,r,o){this.http=i,this.toastr=r,this.router=o}PostToUrlEncode(i,r,o=1e5){let s=new si;return s=s.set("Content-Type","application/x-www-form-urlencoded"),new ft(a=>{this.http.post(i,r,{headers:s}).pipe(ii(o)).subscribe(l=>{a.next(l),a.complete()})})}GetText(i=1e5){let r=localStorage.getItem("Token"),s={responseType:"text",headers:new si({Authorization:"Bearer "+r})};return new ft(a=>{this.http.get("/API/Token/GetZendeskJWT",s).pipe(ii(i)).subscribe(l=>{a.next(l),a.complete()})})}POSText(i,r,o=1e5){let s=localStorage.getItem("Token"),l={responseType:"text",headers:new si({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+s})};return new ft(c=>{this.http.post(i,r,l).pipe(ii(o)).subscribe(d=>{c.next(d),c.complete()})})}get(i){let r=localStorage.getItem("Token"),o=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});r&&(o=o.append("Authorization","Bearer "+r));let s={headers:o};return this.http.get(i,s).pipe(vu(a=>{if(!this.unauthorizedErrorHandling(a)){let c=this.errorMessageHandling(a);this.toastr.error(c.Message!=""?c.Message:"An unknown error has occured!",c.header),this.paymentErrorHandling(a)}return mu(()=>a)}))}getNews(i){return this.http.get(i)}paymentErrorHandling(i){i.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(i,r,o=1e5){return new ft(s=>{let a=localStorage.getItem("Token"),l=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(l=l.append("Authorization","Bearer "+a));let c={headers:l};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+d(this.getMonth()+1)+"-"+d(this.getDate())+"T"+d(this.getHours())+":"+d(this.getMinutes())+":"+d(this.getSeconds())+".000"};function d(p){return p<10?"0"+p:p}this.http.post(i,r,c).pipe(ii(o)).subscribe({next:p=>{s.next(p),s.complete()},error:p=>{if(p.status==200)s.next(p.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(p)){let h=this.errorMessageHandling(p);this.toastr.error(h.Message!=""?h.Message:"An unknown error has occured!",h.header,{enableHtml:!0})}s.error(p)}}})})}postFile(i,r,o=1e5){return new ft(s=>{let a=localStorage.getItem("Token"),l=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(l=l.append("Authorization","Bearer "+a)),this.http.post(i,r,{headers:l,observe:"response",responseType:"blob"}).pipe(ii(o)).subscribe({next:c=>{s.next({title:c.headers.get("Content-Disposition"),file:c.body}),s.complete()},error:c=>{if(c.headers.get("Content-Type")==="application/json; charset=utf-8"){let d=new FileReader;d.addEventListener("loadend",p=>{let g=JSON.parse(p.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(c)){let v=this.errorMessageHandling(c);this.toastr.error(g??"An unknown error has occured!",v.header,{enableHtml:!0})}}),d.readAsText(c.error)}s.error(c)}})})}put(i,r,o=1e5){return new ft(s=>{let a=localStorage.getItem("Token"),l=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(l=l.append("Authorization","Bearer "+a));let c={headers:l};this.http.put(i,r,c).pipe(ii(o)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header)}s.error(d)}}})})}delete(i,r,o=1e5){return new ft(s=>{let a=localStorage.getItem("Token"),l=new si({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(l=l.append("Authorization","Bearer "+a));let c={headers:l,body:r};this.http.delete(i,c).pipe(ii(o)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header)}s.error(d)}}})})}unauthorizedErrorHandling(i){let r=!1;return(i.status==401||i.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",r=!0),r}errorMessageHandling(i){let r="API Error",o="Exception Message";return i.error?(r="API Error - "+i.status,i.status==451&&(r="Error"),i.error&&(o=i.error.Message)):i.Message&&(r="API Error - "+i.name,o=i.Message),{header:r,Message:o}}postFormDataWithoutBearer(i,r){return new ft(o=>{this.http.post(i,r).pipe(ii(1e5)).subscribe({next:s=>{o.next(s),o.complete()},error:s=>{s.status==200&&(o.next(s.error.text),o.complete()),o.error(s)}})})}postFormData(i,r,o=!0){return new ft(s=>{let a=localStorage.getItem("Token"),c={headers:new si({Authorization:"Bearer "+a})};this.http.post(i,r,c).pipe(ii(1e5)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)&&o){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header)}s.error(d)}}})})}};e.\u0275fac=function(r){return new(r||e)(J(Mu),J(Jo),J(In))},e.\u0275prov=ke({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function Hs(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Zx=0;function vf(t){return"__private_"+Zx+++"_"+t}function Jx(t,e,n){let i=[];return t.forEach(r=>typeof r!="string"?i.push(r):e[Symbol.split](r).forEach((o,s,a)=>{o!==""&&i.push(o),s<a.length-1&&i.push(n)})),i}function yf(t,e){let n=/\$/g,i="$$$$",r=[t];if(e==null)return r;for(let o of Object.keys(e))if(o!=="_"){let s=e[o];typeof s=="string"&&(s=n[Symbol.replace](s,i)),r=Jx(r,new RegExp(`%\\{${o}\\}`,"g"),s)}return r}var eC=t=>{throw new Error(`missing string: ${t}`)},zr=vf("onMissingKey"),Lr=vf("apply"),Yn=class{constructor(e,n){let{onMissingKey:i=eC}=n===void 0?{}:n;Object.defineProperty(this,Lr,{value:tC}),Object.defineProperty(this,zr,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(Hs(this,Lr)[Lr],this):Hs(this,Lr)[Lr](e),Hs(this,zr)[zr]=i}translate(e,n){return this.translateArray(e,n).join("")}translateArray(e,n){let i=this.locale.strings[e];if(i==null&&(Hs(this,zr)[zr](e),i=e),typeof i=="object"){if(n&&typeof n.smart_count<"u"){let o=this.locale.pluralize(n.smart_count);return yf(i[o],n)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return yf(i,n)}};function tC(t){if(!(t!=null&&t.strings))return;let e=this.locale;Object.assign(this.locale,{strings:b(b({},e.strings),t.strings),pluralize:t.pluralize||e.pluralize})}var gm=ge(_f(),1);var iC="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var wf=(t=21)=>{let e="",n=t;for(;n--;)e+=iC[Math.random()*64|0];return e};var ym=ge(em(),1);function Vs(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var YC=0;function tm(t){return"__private_"+YC+++"_"+t}var KC={version:"4.1.0"},tn=tm("callbacks"),Oc=tm("publish"),Us=class{constructor(){Object.defineProperty(this,Oc,{value:QC}),this.state={},Object.defineProperty(this,tn,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let n=b({},this.state),i=b(b({},this.state),e);this.state=i,Vs(this,Oc)[Oc](n,i,e)}subscribe(e){return Vs(this,tn)[tn].add(e),()=>{Vs(this,tn)[tn].delete(e)}}};function QC(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Vs(this,tn)[tn].forEach(i=>{i(...e)})}Us.VERSION=KC.version;var im=Us;function nn(t){let e=t.lastIndexOf(".");return e===-1||e===t.length-1?{name:t,extension:void 0}:{name:t.slice(0,e),extension:t.slice(e+1)}}var Fc={__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 jr(t){var e;if(t.type)return t.type;let n=t.name?(e=nn(t.name).extension)==null?void 0:e.toLowerCase():null;return n&&n in Fc?Fc[n]:"application/octet-stream"}function ZC(t){return t.charCodeAt(0).toString(32)}function nm(t){let e="";return t.replace(/[^A-Z0-9]/gi,n=>(e+=`-${ZC(n)}`,"/"))+e}function rm(t,e){let n=e||"uppy";return typeof t.name=="string"&&(n+=`-${nm(t.name.toLowerCase())}`),t.type!==void 0&&(n+=`-${t.type}`),t.meta&&typeof t.meta.relativePath=="string"&&(n+=`-${nm(t.meta.relativePath.toLowerCase())}`),t.data.size!==void 0&&(n+=`-${t.data.size}`),t.data.lastModified!==void 0&&(n+=`-${t.data.lastModified}`),n}function JC(t){return!t.isRemote||!t.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(t.remote.provider)}function Ws(t,e){if(JC(t))return t.id;let n=jr(t);return rm(E(b({},t),{type:n}),e)}function Rc(t){if(t==null&&typeof navigator<"u"&&(t=navigator.userAgent),!t)return!0;let e=/Edge\/(\d+\.\d+)/.exec(t);if(!e)return!0;let i=e[1].split(".",2),r=parseInt(i[0],10),o=parseInt(i[1],10);return r<15||r===15&&o<15063||r>18||r===18&&o>=18218}function Mc(t,e){return e.name?e.name:t.split("/")[0]==="image"?`${t.split("/")[0]}.${t.split("/")[1]}`:"noname"}function Bc(t){return t<10?`0${t}`:t.toString()}function Kn(){let t=new Date,e=Bc(t.getHours()),n=Bc(t.getMinutes()),i=Bc(t.getSeconds());return`${e}:${n}:${i}`}var om={debug:()=>{},warn:()=>{},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.error(`[Uppy] [${Kn()}]`,...e)}},sm={debug:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.debug(`[Uppy] [${Kn()}]`,...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.warn(`[Uppy] [${Kn()}]`,...e)},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return console.error(`[Uppy] [${Kn()}]`,...e)}};var Vr=ge($s(),1),hm=ge(pm(),1),fm={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},bt=class extends Error{constructor(e,n){var i;super(e),this.isRestriction=!0,this.isUserFacing=(i=n?.isUserFacing)!=null?i:!0,n!=null&&n.file&&(this.file=n.file)}},qs=class{constructor(e,n){this.getI18n=n,this.getOpts=()=>{var i;let r=e();if(((i=r.restrictions)==null?void 0:i.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,n){let{maxTotalFileSize:i,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(s=>!s.isGhost).length+n.length>r)throw new bt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(i){let o=[...e,...n].reduce((s,a)=>{var l;return s+((l=a.size)!=null?l:0)},0);if(o>i)throw new bt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,Vr.default)(i),size:(0,Vr.default)(o)}))}}validateSingleFile(e){let{maxFileSize:n,minFileSize:i,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(a=>a.includes("/")?e.type?(0,hm.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=r.join(", ");throw new bt(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(n&&e.size!=null&&e.size>n){var o;throw new bt(this.getI18n()("exceedsSize",{size:(0,Vr.default)(n),file:(o=e.name)!=null?o:this.getI18n()("unnamed")}),{file:e})}if(i&&e.size!=null&&e.size<i)throw new bt(this.getI18n()("inferiorSize",{size:(0,Vr.default)(i)}),{file:e})}validate(e,n){n.forEach(i=>{this.validateSingleFile(i)}),this.validateAggregateRestrictions(e,n)}validateMinNumberOfFiles(e){let{minNumberOfFiles:n}=this.getOpts().restrictions;if(n&&Object.keys(e).length<n)throw new bt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:n}))}getMissingRequiredMetaFields(e){var n;let i=new bt(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(n=e.name)!=null?n:this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,o=[];for(let s of r)(!Object.hasOwn(e.meta,s)||e.meta[s]==="")&&o.push(s);return{missingFields:o,error:i}}};var mm={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed"}};function z(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var iS=0;function Fe(t){return"__private_"+iS+++"_"+t}var nS={version:"4.2.0"},Gs={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},et=Fe("plugins"),ct=Fe("restricter"),Ur=Fe("storeUnsubscribe"),_i=Fe("emitter"),rn=Fe("preProcessors"),on=Fe("uploaders"),Ci=Fe("postProcessors"),Dt=Fe("informAndEmit"),Xr=Fe("checkRequiredMetaFieldsOnFile"),Ac=Fe("checkRequiredMetaFields"),Wr=Fe("assertNewUploadAllowed"),Lc=Fe("transformFile"),$r=Fe("startIfAutoProceed"),qr=Fe("checkAndUpdateFileState"),Nc=Fe("addListeners"),Zt=Fe("updateOnlineStatus"),Gr=Fe("requestClientById"),wi=Fe("createUpload"),zc=Fe("getUpload"),sn=Fe("removeUpload"),xi=Fe("runUpload"),Xs=class t{constructor(e){Object.defineProperty(this,xi,{value:mS}),Object.defineProperty(this,sn,{value:fS}),Object.defineProperty(this,zc,{value:hS}),Object.defineProperty(this,wi,{value:pS}),Object.defineProperty(this,Nc,{value:uS}),Object.defineProperty(this,qr,{value:dS}),Object.defineProperty(this,$r,{value:cS}),Object.defineProperty(this,Lc,{value:lS}),Object.defineProperty(this,Wr,{value:aS}),Object.defineProperty(this,Ac,{value:sS}),Object.defineProperty(this,Xr,{value:oS}),Object.defineProperty(this,Dt,{value:rS}),Object.defineProperty(this,et,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,Ur,{writable:!0,value:void 0}),Object.defineProperty(this,_i,{writable:!0,value:(0,gm.default)()}),Object.defineProperty(this,rn,{writable:!0,value:new Set}),Object.defineProperty(this,on,{writable:!0,value:new Set}),Object.defineProperty(this,Ci,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=(0,ym.default)((r,o)=>{let s=this.getFile(r?.id);if(r==null||!s){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}if(s.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}let a=Number.isFinite(o.bytesTotal)&&o.bytesTotal>0;this.setFileState(r.id,{progress:E(b({},s.progress),{bytesUploaded:o.bytesUploaded,bytesTotal:o.bytesTotal,percentage:a?Math.round(o.bytesUploaded/o.bytesTotal*100):0})}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Zt,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Gr,{writable:!0,value:new Map}),this.defaultLocale=mm;let n={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:fm,meta:{},onBeforeFileAdded:(r,o)=>!Object.hasOwn(o,r.id),onBeforeUpload:r=>r,store:new im,logger:om,infoTimeout:5e3},i=b(b({},n),e);this.opts=E(b({},i),{restrictions:b(b({},n.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=sm),this.log(`Using Core v${t.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(E(b({},Gs),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Rc(),individualCancellation:!0,resumableUploads:!1},meta:b({},this.opts.meta),info:[]})),z(this,ct)[ct]=new qs(()=>this.opts,()=>this.i18n),z(this,Ur)[Ur]=this.store.subscribe((r,o,s)=>{this.emit("state-update",r,o,s),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),z(this,Nc)[Nc]()}emit(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];z(this,_i)[_i].emit(e,...i)}on(e,n){return z(this,_i)[_i].on(e,n),this}once(e,n){return z(this,_i)[_i].once(e,n),this}off(e,n){return z(this,_i)[_i].off(e,n),this}updateAll(e){this.iteratePlugins(n=>{n.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let n=this.getState().files;this.setState({files:b(b({},n),Object.fromEntries(Object.entries(e).map(i=>{let[r,o]=i;return[r,b(b({},n[r]),o)]})))})}setFileState(e,n){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:n})}i18nInit(){let e=i=>this.log(`Missing i18n string: ${i}`,"error"),n=new Yn([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=n.translate.bind(n),this.i18nArray=n.translateArray.bind(n),this.locale=n.locale}setOptions(e){this.opts=E(b(b({},this.opts),e),{restrictions:b(b({},this.opts.restrictions),e?.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(n=>{n.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},n=b({},this.getState().files),i=Object.create(null);Object.keys(n).forEach(r=>{i[r]=E(b({},n[r]),{progress:b(b({},n[r].progress),e)})}),this.setState(b({files:i},Gs))}clear(){let{capabilities:e,currentUploads:n}=this.getState();if(Object.keys(n).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(E(b({},Gs),{files:{}}))}addPreProcessor(e){z(this,rn)[rn].add(e)}removePreProcessor(e){return z(this,rn)[rn].delete(e)}addPostProcessor(e){z(this,Ci)[Ci].add(e)}removePostProcessor(e){return z(this,Ci)[Ci].delete(e)}addUploader(e){z(this,on)[on].add(e)}removeUploader(e){return z(this,on)[on].delete(e)}setMeta(e){let n=b(b({},this.getState().meta),e),i=b({},this.getState().files);Object.keys(i).forEach(r=>{i[r]=E(b({},i[r]),{meta:b(b({},i[r].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:n,files:i})}setFileMeta(e,n){let i=b({},this.getState().files);if(!i[e]){this.log("Was trying to set metadata for a file that has been removed: ",e);return}let r=b(b({},i[e].meta),n);i[e]=E(b({},i[e]),{meta:r}),this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(n=>this.getFile(n))}getObjectOfFilesPerState(){let{files:e,totalProgress:n,error:i}=this.getState(),r=Object.values(e),o=[],s=[],a=[],l=[],c=[],d=[],p=[],g=[],h=[];for(let v of r){let{progress:C}=v;!C.uploadComplete&&C.uploadStarted&&(o.push(v),v.isPaused||g.push(v)),C.uploadStarted||s.push(v),(C.uploadStarted||C.preprocess||C.postprocess)&&a.push(v),C.uploadStarted&&l.push(v),v.isPaused&&c.push(v),C.uploadComplete&&d.push(v),v.error&&p.push(v),(C.preprocess||C.postprocess)&&h.push(v)}return{newFiles:s,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:p,inProgressFiles:o,inProgressNotPausedFiles:g,processingFiles:h,isUploadStarted:l.length>0,isAllComplete:n===100&&d.length===r.length&&h.length===0,isAllErrored:!!i&&p.length===r.length,isAllPaused:o.length!==0&&c.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(v=>v.isGhost)}}validateSingleFile(e){try{z(this,ct)[ct].validateSingleFile(e)}catch(n){return n.message}return null}validateAggregateRestrictions(e){let n=this.getFiles();try{z(this,ct)[ct].validateAggregateRestrictions(n,e)}catch(i){return i.message}return null}checkIfFileAlreadyExists(e){let{files:n}=this.getState();return!!(n[e]&&!n[e].isGhost)}addFile(e){z(this,Wr)[Wr](e);let{nextFilesState:n,validFilesToAdd:i,errors:r}=z(this,qr)[qr]([e]),o=r.filter(a=>a.isRestriction);if(z(this,Dt)[Dt](o),r.length>0)throw r[0];this.setState({files:n});let[s]=i;return this.emit("file-added",s),this.emit("files-added",i),this.log(`Added file: ${s.name}, ${s.id}, mime type: ${s.type}`),z(this,$r)[$r](),s.id}addFiles(e){z(this,Wr)[Wr]();let{nextFilesState:n,validFilesToAdd:i,errors:r}=z(this,qr)[qr](e),o=r.filter(a=>a.isRestriction);z(this,Dt)[Dt](o);let s=r.filter(a=>!a.isRestriction);if(s.length>0){let a=`Multiple errors occurred while adding files:
|
|
17
17
|
`;if(s.forEach(l=>{a+=`
|
|
18
18
|
* ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:s.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(s,a);{let l=new Error(a);throw l.errors=s,l}}this.setState({files:n}),i.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(a=>{this.log(`Added file: ${a.name}
|
|
19
19
|
id: ${a.id}
|
|
20
20
|
type: ${a.type}`)}),i.length>0&&z(this,$r)[$r]()}removeFiles(e){let{files:n,currentUploads:i}=this.getState(),r=b({},n),o=b({},i),s=Object.create(null);e.forEach(d=>{n[d]&&(s[d]=n[d],delete r[d])});function a(d){return s[d]===void 0}Object.keys(o).forEach(d=>{let p=i[d].fileIDs.filter(a);if(p.length===0){delete o[d];return}let{capabilities:g}=this.getState();if(p.length!==i[d].fileIDs.length&&!g.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[d]=E(b({},i[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.calculateTotalProgress();let c=Object.keys(s);c.forEach(d=>{this.emit("file-removed",s[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let n=this.getFile(e),r=!(n.isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",n,r),r}pauseAll(){let e=b({},this.getState().files);Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{let r=E(b({},e[i]),{isPaused:!0});e[i]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e=b({},this.getState().files);Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{let r=E(b({},e[i]),{isPaused:!1,error:null});e[i]=r}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e=b({},this.getState().files),n=Object.keys(e).filter(r=>e[r].error);if(n.forEach(r=>{let o=E(b({},e[r]),{isPaused:!1,error:null});e[r]=o}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),n.length===0)return Promise.resolve({successful:[],failed:[]});let i=z(this,wi)[wi](n,{forceAllowNewUpload:!0});return z(this,xi)[xi](i)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),n=Object.keys(e);n.length&&this.removeFiles(n),this.setState(Gs)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let n=z(this,wi)[wi]([e],{forceAllowNewUpload:!0});return z(this,xi)[xi](n)}logout(){this.iteratePlugins(e=>{var n;(n=e.provider)==null||n.logout==null||n.logout()})}calculateTotalProgress(){let n=this.getFiles().filter(c=>c.progress.uploadStarted||c.progress.preprocess||c.progress.postprocess);if(n.length===0){this.emit("progress",0),this.setState({totalProgress:0});return}let i=n.filter(c=>c.progress.bytesTotal!=null),r=n.filter(c=>c.progress.bytesTotal==null);if(i.length===0){let c=n.length*100,d=r.reduce((g,h)=>g+h.progress.percentage,0),p=Math.round(d/c*100);this.setState({totalProgress:p});return}let o=i.reduce((c,d)=>{var p;return c+((p=d.progress.bytesTotal)!=null?p:0)},0),s=o/i.length;o+=s*r.length;let a=0;i.forEach(c=>{a+=c.progress.bytesUploaded}),r.forEach(c=>{a+=s*(c.progress.percentage||0)/100});let l=o===0?0:Math.round(a/o*100);l>100&&(l=100),this.setState({totalProgress:l}),this.emit("progress",l)}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!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(e){if(typeof e!="function"){let l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];let o=new e(this,...i),s=o.id;if(!s)throw new Error("Your plugin must have an id");if(!o.type)throw new Error("Your plugin must have a type");let a=this.getPlugin(s);if(a){let l=`Already found a plugin named '${a.id}'. Tried to use: '${s}'.
|
|
21
|
-
Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),o.type in z(this,et)[et]?z(this,et)[et][o.type].push(o):z(this,et)[et][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(e){for(let n of Object.values(z(this,et)[et])){let i=n.find(r=>r.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return z(this,et)[et][e]}iteratePlugins(e){Object.values(z(this,et)[et]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let n=z(this,et)[et][e.type],i=n.findIndex(s=>s.id===e.id);i!==-1&&n.splice(i,1);let r=this.getState(),o={plugins:E(b({},r.plugins),{[e.id]:void 0})};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),z(this,Ur)[Ur](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",z(this,Kt)[Kt]),window.removeEventListener("offline",z(this,Kt)[Kt]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n,i){n===void 0&&(n="info"),i===void 0&&(i=3e3);let r=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,n){let{logger:i}=this.opts;switch(n){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}registerRequestClient(e,n){z(this,Gr)[Gr].set(e,n)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let n=z(this,Gr)[Gr].get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?z(this,xi)[xi](e):(z(this,sn)[sn](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return z(this,wi)[wi](...arguments)}addResultData(e,n){if(!z(this,Ac)[Ac](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:i}=this.getState(),r=E(b({},i[e]),{result:b(b({},i[e].result),n)});this.setState({currentUploads:E(b({},i),{[e]:r})})}upload(){var e;(e=z(this,et)[et].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:n}=this.getState(),i=this.opts.onBeforeUpload(n);return i===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(i&&typeof i=="object"&&(n=i,this.setState({files:n})),Promise.resolve().then(()=>z(this,ct)[ct].validateMinNumberOfFiles(n)).catch(r=>{throw z(this,Dt)[Dt]([r]),r}).then(()=>{if(!z(this,Mc)[Mc](n))throw new bt(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{let{currentUploads:r}=this.getState(),o=Object.values(r).flatMap(l=>l.fileIDs),s=[];Object.keys(n).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&o.indexOf(l)===-1&&s.push(c.id)});let a=z(this,wi)[wi](s);return z(this,xi)[xi](a)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}};function tS(t){for(let o of t)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");let e=t.filter(o=>o.isUserFacing),n=4,i=e.slice(0,n),r=e.slice(n);i.forEach(o=>{let{message:s,details:a=""}=o;this.info({message:s,details:a},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function iS(t){let{missingFields:e,error:n}=z(this,ct)[ct].getMissingRequiredMetaFields(t);return e.length>0?(this.setFileState(t.id,{missingRequiredMetaFields:e}),this.log(n.message),this.emit("restriction-failed",t,n),!1):!0}function nS(t){let e=!0;for(let n of Object.values(t))z(this,Xr)[Xr](n)||(e=!1);return e}function rS(t){let{allowNewUpload:e}=this.getState();if(e===!1){let n=new bt(this.i18n("noMoreFilesAllowed"),{file:t});throw z(this,Dt)[Dt]([n]),n}}function oS(t){let e=t instanceof File?{name:t.name,type:t.type,size:t.size,data:t}:t,n=jr(e),i=Fc(n,e),r=nn(i).extension,o=Ws(e,this.getID()),s=e.meta||{};s.name=i,s.type=n;let a=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:o,name:i,extension:r||"",meta:b(b({},this.getState().meta),s),type:n,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function sS(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(t=>{t.isRestriction||this.log(t.stack||t.message||t)})},4))}function aS(t){let{files:e}=this.getState(),n=b({},e),i=[],r=[];for(let a of t)try{var o;let l=z(this,Nc)[Nc](a),c=(o=e[l.id])==null?void 0:o.isGhost;if(c){let p=e[l.id];l=E(b({},p),{isGhost:!1,data:a.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let d=this.opts.onBeforeFileAdded(l,n);if(!d&&this.checkIfFileAlreadyExists(l.id)){var s;throw new bt(this.i18n("noDuplicates",{fileName:(s=l.name)!=null?s:this.i18n("unnamed")}),{file:a})}if(d===!1&&!c)throw new bt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(l=d),z(this,ct)[ct].validateSingleFile(l),n[l.id]=l,i.push(l)}catch(l){r.push(l)}try{z(this,ct)[ct].validateAggregateRestrictions(Object.values(e),i)}catch(a){return r.push(a),{nextFilesState:e,validFilesToAdd:[],errors:r}}return{nextFilesState:n,validFilesToAdd:i,errors:r}}function lS(){let t=(i,r,o)=>{let s=i.message||"Unknown error";i.details&&(s+=` ${i.details}`),this.setState({error:s}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:s,response:o})};this.on("error",t),this.on("upload-error",(i,r,o)=>{if(t(r,i,o),typeof r=="object"&&r.message){var s;this.log(r.message,"error");let a=new Error(this.i18n("failedToUpload",{file:(s=i?.name)!=null?s:""}));a.isUserFacing=!0,a.details=r.message,r.details&&(a.details+=` ${r.details}`),z(this,Dt)[Dt]([a])}else z(this,Dt)[Dt]([r])});let e=null;this.on("upload-stalled",(i,r)=>{let{message:o}=i,s=r.map(a=>a.meta.name).join(", ");e||(this.info({message:o,details:s},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${o} ${s}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let n=i=>{let r=i.filter(s=>{let a=s!=null&&this.getFile(s.id);return a||this.log(`Not setting progress for a file that has been removed: ${s?.id}`),a}),o=Object.fromEntries(r.map(s=>[s.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:s.size}}]));this.patchFilesState(o)};this.on("upload-start",n),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(i,r)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let o=this.getFile(i.id).progress;this.setFileState(i.id,{progress:E(b({},o),{postprocess:z(this,Ci)[Ci].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),i.size==null&&this.setFileState(i.id,{size:r.bytesUploaded||o.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(i,r)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}this.setFileState(i.id,{progress:E(b({},this.getFile(i.id).progress),{preprocess:r})})}),this.on("preprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let r=b({},this.getState().files);r[i.id]=E(b({},r[i.id]),{progress:b({},r[i.id].progress)}),delete r[i.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(i,r)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}this.setFileState(i.id,{progress:E(b({},this.getState().files[i.id].progress),{postprocess:r})})}),this.on("postprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let r=b({},this.getState().files);r[i.id]=E(b({},r[i.id]),{progress:b({},r[i.id].progress)}),delete r[i.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",i=>{i&&z(this,Xr)[Xr](i)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",z(this,Kt)[Kt]),window.addEventListener("offline",z(this,Kt)[Kt]),setTimeout(z(this,Kt)[Kt],3e3))}function cS(t,e){e===void 0&&(e={});let{forceAllowNewUpload:n=!1}=e,{allowNewUpload:i,currentUploads:r}=this.getState();if(!i&&!n)throw new Error("Cannot create a new upload: already uploading.");let o=vf();return this.emit("upload",o,this.getFilesByIds(t)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:E(b({},r),{[o]:{fileIDs:t,step:0,result:{}}})}),o}function dS(t){let{currentUploads:e}=this.getState();return e[t]}function uS(t){let e=b({},this.getState().currentUploads);delete e[t],this.setState({currentUploads:e})}function pS(t){return O(this,null,function*(){let e=()=>{let{currentUploads:o}=this.getState();return o[t]},n=e(),i=[...z(this,rn)[rn],...z(this,on)[on],...z(this,Ci)[Ci]];try{for(let o=n.step||0;o<i.length&&n;o++){let s=i[o];this.setState({currentUploads:E(b({},this.getState().currentUploads),{[t]:E(b({},n),{step:o})})});let{fileIDs:a}=n;yield s(a,t),n=e()}}catch(o){throw z(this,sn)[sn](t),o}if(n){n.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let o=n.fileIDs.map(l=>this.getFile(l)),s=o.filter(l=>!l.error),a=o.filter(l=>l.error);this.addResultData(t,{successful:s,failed:a,uploadID:t}),n=e()}let r;return n&&(r=n.result,this.emit("complete",r),z(this,sn)[sn](t)),r==null&&this.log(`Not setting result for an upload that has been removed: ${t}`),r})}Xs.VERSION=eS.version;var Yr=Xs;var Zr,_e,bm,hS,an,mm,_m,zc,Vc,Lc,Hc,fS,Qr={},wm=[],mS=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qs=Array.isArray;function Si(t,e){for(var n in e)t[n]=e[n];return t}function xm(t){var e=t.parentNode;e&&e.removeChild(t)}function u(t,e,n){var i,r,o,s={};for(o in e)o=="key"?i=e[o]:o=="ref"?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?Zr.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return Kr(t,s,i,r,null)}function Kr(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++bm,__i:-1,__u:0};return r==null&&_e.vnode!=null&&_e.vnode(o),o}function Cm(){return{current:null}}function $t(t){return t.children}function _t(t,e){this.props=t,this.context=e}function ln(t,e){if(e==null)return t.__?ln(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?ln(t):null}function Sm(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Sm(t)}}function gm(t){(!t.__d&&(t.__d=!0)&&an.push(t)&&!Ks.__r++||mm!==_e.debounceRendering)&&((mm=_e.debounceRendering)||_m)(Ks)}function Ks(){var t,e,n,i,r,o,s,a;for(an.sort(zc);t=an.shift();)t.__d&&(e=an.length,i=void 0,o=(r=(n=t).__v).__e,s=[],a=[],n.__P&&((i=Si({},r)).__v=r.__v+1,_e.vnode&&_e.vnode(i),Uc(n.__P,i,r,n.__n,n.__P.namespaceURI,32&r.__u?[o]:null,s,o??ln(r),!!(32&r.__u),a),i.__v=r.__v,i.__.__k[i.__i]=i,Dm(s,i,a),i.__e!=o&&Sm(i)),an.length>e&&an.sort(zc));Ks.__r=0}function Pm(t,e,n,i,r,o,s,a,l,c,d){var p,g,h,v,C,R=i&&i.__k||wm,I=e.length;for(n.__d=l,gS(n,e,R),l=n.__d,p=0;p<I;p++)(h=n.__k[p])!=null&&typeof h!="boolean"&&typeof h!="function"&&(g=h.__i===-1?Qr:R[h.__i]||Qr,h.__i=p,Uc(t,h,g,r,o,s,a,l,c,d),v=h.__e,h.ref&&g.ref!=h.ref&&(g.ref&&Wc(g.ref,null,h),d.push(h.ref,h.__c||v,h)),C==null&&v!=null&&(C=v),65536&h.__u||g.__k===h.__k?l=Em(h,l,t):typeof h.type=="function"&&h.__d!==void 0?l=h.__d:v&&(l=v.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=C}function gS(t,e,n){var i,r,o,s,a,l=e.length,c=n.length,d=c,p=0;for(t.__k=[],i=0;i<l;i++)s=i+p,(r=t.__k[i]=(r=e[i])==null||typeof r=="boolean"||typeof r=="function"?null:typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?Kr(null,r,null,null,null):Qs(r)?Kr($t,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?Kr(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=t,r.__b=t.__b+1,a=yS(r,n,s,d),r.__i=a,o=null,a!==-1&&(d--,(o=n[a])&&(o.__u|=131072)),o==null||o.__v===null?(a==-1&&p--,typeof r.type!="function"&&(r.__u|=65536)):a!==s&&(a==s-1?p--:a==s+1?p++:a>s?d>l-s?p+=a-s:p--:a<s&&(a==s-p?p-=a-s:p++),a!==i+p&&(r.__u|=65536))):(o=n[s])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=ln(o)),jc(o,o,!1),n[s]=null,d--);if(d)for(i=0;i<c;i++)(o=n[i])!=null&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=ln(o)),jc(o,o))}function Em(t,e,n){var i,r;if(typeof t.type=="function"){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=Em(i[r],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=ln(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function di(t,e){return e=e||[],t==null||typeof t=="boolean"||(Qs(t)?t.some(function(n){di(n,e)}):e.push(t)),e}function yS(t,e,n,i){var r=t.key,o=t.type,s=n-1,a=n+1,l=e[n];if(l===null||l&&r==l.key&&o===l.type&&!(131072&l.__u))return n;if(i>(l!=null&&!(131072&l.__u)?1:0))for(;s>=0||a<e.length;){if(s>=0){if((l=e[s])&&!(131072&l.__u)&&r==l.key&&o===l.type)return s;s--}if(a<e.length){if((l=e[a])&&!(131072&l.__u)&&r==l.key&&o===l.type)return a;a++}}return-1}function ym(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||mS.test(e)?n:n+"px"}function Ys(t,e,n,i,r){var o;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||ym(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||ym(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n.u=i.u:(n.u=Vc,t.addEventListener(e,o?Hc:Lc,o)):t.removeEventListener(e,o?Hc:Lc,o);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function vm(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Vc++;else if(e.t<n.u)return;return n(_e.event?_e.event(e):e)}}}function Uc(t,e,n,i,r,o,s,a,l,c){var d,p,g,h,v,C,R,I,N,Q,U,Y,_,x,P,T,B=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=e.__e=n.__e]),(d=_e.__b)&&d(e);e:if(typeof B=="function")try{if(I=e.props,N="prototype"in B&&B.prototype.render,Q=(d=B.contextType)&&i[d.__c],U=d?Q?Q.props.value:d.__:i,n.__c?R=(p=e.__c=n.__c).__=p.__E:(N?e.__c=p=new B(I,U):(e.__c=p=new _t(I,U),p.constructor=B,p.render=bS),Q&&Q.sub(p),p.props=I,p.state||(p.state={}),p.context=U,p.__n=i,g=p.__d=!0,p.__h=[],p._sb=[]),N&&p.__s==null&&(p.__s=p.state),N&&B.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Si({},p.__s)),Si(p.__s,B.getDerivedStateFromProps(I,p.__s))),h=p.props,v=p.state,p.__v=e,g)N&&B.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),N&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(N&&B.getDerivedStateFromProps==null&&I!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(I,U),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(I,p.__s,U)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(p.props=I,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(V){V&&(V.__=e)}),Y=0;Y<p._sb.length;Y++)p.__h.push(p._sb[Y]);p._sb=[],p.__h.length&&s.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(I,p.__s,U),N&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,v,C)})}if(p.context=U,p.props=I,p.__P=t,p.__e=!1,_=_e.__r,x=0,N){for(p.state=p.__s,p.__d=!1,_&&_(e),d=p.render(p.props,p.state,p.context),P=0;P<p._sb.length;P++)p.__h.push(p._sb[P]);p._sb=[]}else do p.__d=!1,_&&_(e),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&&(i=Si(Si({},i),p.getChildContext())),N&&!g&&p.getSnapshotBeforeUpdate!=null&&(C=p.getSnapshotBeforeUpdate(h,v)),Pm(t,Qs(T=d!=null&&d.type===$t&&d.key==null?d.props.children:d)?T:[T],e,n,i,r,o,s,a,l,c),p.base=e.__e,e.__u&=-161,p.__h.length&&s.push(p),R&&(p.__E=p.__=null)}catch(V){if(e.__v=null,l||o!=null){for(e.__u|=l?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else e.__e=n.__e,e.__k=n.__k;_e.__e(V,e,n)}else o==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=vS(n.__e,e,n,i,r,o,s,l,c);(d=_e.diffed)&&d(e)}function Dm(t,e,n){e.__d=void 0;for(var i=0;i<n.length;i++)Wc(n[i],n[++i],n[++i]);_e.__c&&_e.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(o){o.call(r)})}catch(o){_e.__e(o,r.__v)}})}function vS(t,e,n,i,r,o,s,a,l){var c,d,p,g,h,v,C,R=n.props,I=e.props,N=e.type;if(N==="svg"?r="http://www.w3.org/2000/svg":N==="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((h=o[c])&&"setAttribute"in h==!!N&&(N?h.localName===N:h.nodeType===3)){t=h,o[c]=null;break}}if(t==null){if(N===null)return document.createTextNode(I);t=document.createElementNS(r,N,I.is&&I),o=null,a=!1}if(N===null)R===I||a&&t.data===I||(t.data=I);else{if(o=o&&Zr.call(t.childNodes),R=n.props||Qr,!a&&o!=null)for(R={},c=0;c<t.attributes.length;c++)R[(h=t.attributes[c]).name]=h.value;for(c in R)if(h=R[c],c!="children"){if(c=="dangerouslySetInnerHTML")p=h;else if(c!=="key"&&!(c in I)){if(c=="value"&&"defaultValue"in I||c=="checked"&&"defaultChecked"in I)continue;Ys(t,c,null,h,r)}}for(c in I)h=I[c],c=="children"?g=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?v=h:c=="checked"?C=h:c==="key"||a&&typeof h!="function"||R[c]===h||Ys(t,c,h,R[c],r);if(d)a||p&&(d.__html===p.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(p&&(t.innerHTML=""),Pm(t,Qs(g)?g:[g],e,n,i,N==="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&ln(n,0),a,l),o!=null)for(c=o.length;c--;)o[c]!=null&&xm(o[c]);a||(c="value",v!==void 0&&(v!==t[c]||N==="progress"&&!v||N==="option"&&v!==R[c])&&Ys(t,c,v,R[c],r),c="checked",C!==void 0&&C!==t[c]&&Ys(t,c,C,R[c],r))}return t}function Wc(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(r){_e.__e(r,n)}}function jc(t,e,n){var i,r;if(_e.unmount&&_e.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||Wc(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){_e.__e(o,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&jc(i[r],e,n||typeof t.type!="function");n||t.__e==null||xm(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function bS(t,e,n){return this.constructor(t,n)}function $c(t,e,n){var i,r,o,s;_e.__&&_e.__(t,e),r=(i=typeof n=="function")?null:n&&n.__k||e.__k,o=[],s=[],Uc(e,t=(!i&&n||e).__k=u($t,null,[t]),r||Qr,Qr,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?Zr.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),Dm(o,t,s)}function Zs(t,e,n){var i,r,o,s,a=Si({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)o=="key"?i=e[o]:o=="ref"?r=e[o]:a[o]=e[o]===void 0&&s!==void 0?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?Zr.call(arguments,2):n),Kr(t.type,a,i||t.key,r||t.ref,null)}Zr=wm.slice,_e={__e:function(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(a){t=a}throw t}},bm=0,hS=function(t){return t!=null&&t.constructor==null},_t.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Si({},this.state),typeof t=="function"&&(t=t(Si({},n),this.props)),t&&Si(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),gm(this))},_t.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),gm(this))},_t.prototype.render=$t,an=[],_m=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,zc=function(t,e){return t.__v.__b-e.__v.__b},Ks.__r=0,Vc=0,Lc=vm(!1),Hc=vm(!0),fS=0;function Jr(t){return typeof t!="object"||t===null||!("nodeType"in t)?!1:t.nodeType===Node.ELEMENT_NODE}function _S(t,e){return e===void 0&&(e=document),typeof t=="string"?e.querySelector(t):Jr(t)?t:null}var km=_S;function wS(t){for(var e;t&&!t.dir;)t=t.parentNode;return(e=t)==null?void 0:e.dir}var Js=wS;var ea=class{constructor(e,n){this.uppy=e,this.opts=n??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:E(b({},n),{[this.id]:b(b({},n[this.id]),e)})})}setOptions(e){this.opts=b(b({},this.opts),e),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new Yn([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function Tm(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var xS=0;function CS(t){return"__private_"+xS+++"_"+t}function SS(t){let e=null,n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return n=r,e||(e=Promise.resolve().then(()=>(e=null,t(...n)))),e}}var eo=CS("updateUI"),qc=class t extends ea{constructor(){super(...arguments),Object.defineProperty(this,eo,{writable:!0,value:void 0})}getTargetPlugin(e){let n;if(typeof e?.addTarget=="function")n=e,n instanceof t||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:n,UIPlugin:t}}));else if(typeof e=="function"){let i=e;this.uppy.iteratePlugins(r=>{r instanceof i&&(n=r)})}return n}mount(e,n){let i=n.id,r=km(e);if(r){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),Tm(this,eo)[eo]=SS(l=>{this.uppy.getPlugin(this.id)&&($c(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),$c(this.render(this.uppy.getState(),a),a),this.el=a,r.appendChild(a),a.dir=this.opts.direction||Js(a)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${i} to ${o.id}`),this.parent=o,this.el=o.addTarget(n),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let s=`Invalid target option given to ${i}.`;throw typeof e=="function"?s+=" 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.":s+="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(s)}render(e,n){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var n,i;(n=(i=Tm(this,eo))[eo])==null||n.call(i,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},kt=qc;function ta(t,e,n,i){return n===0||t===e?t:i===0?e:t+(e-t)*2**(-i/n)}var Tt={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Jc=me(dt(),1);function to(t){let e=[],n="indeterminate",i;for(let{progress:o}of Object.values(t)){let{preprocess:s,postprocess:a}=o;i==null&&(s||a)&&({mode:n,message:i}=s||a),s?.mode==="determinate"&&e.push(s.value),a?.mode==="determinate"&&e.push(a.value)}let r=e.reduce((o,s)=>o+s/e.length,0);return{mode:n,message:i,value:r}}var Kc=me(dt(),1),Yc=me($s(),1);function Gc(t){let e=Math.floor(t/3600)%24,n=Math.floor(t/60)%60,i=Math.floor(t%60);return{hours:e,minutes:n,seconds:i}}function Xc(t){let e=Gc(t),n=e.hours===0?"":`${e.hours}h`,i=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,r=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${n}${i}${r}`}var PS="\xB7",Im=()=>` ${PS} `;function Om(t){let{newFiles:e,isUploadStarted:n,recoveredState:i,i18n:r,uploadState:o,isSomeGhost:s,startUpload:a}=t,l=(0,Kc.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===Tt.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),c=e&&n&&!i?r("uploadXNewFiles",{smart_count:e}):r("uploadXFiles",{smart_count:e});return u("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},c)}function Fm(t){let{i18n:e,uppy:n}=t;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>n.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"})),e("retry"))}function Rm(t){let{i18n:e,uppy:n}=t;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>n.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 Mm(t){let{isAllPaused:e,i18n:n,isAllComplete:i,resumableUploads:r,uppy:o}=t,s=n(e?"resume":"pause");function a(){if(!i){if(!r){o.cancelAll();return}if(e){o.resumeAll();return}o.pauseAll()}}return u("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"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:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Bm(t){let{i18n:e,doneButtonHandler:n}=t;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:n,"data-uppy-super-focusable":!0},e("done"))}function Am(){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 Nm(t){let{progress:e}=t,{value:n,mode:i,message:r}=e;return u("div",{className:"uppy-StatusBar-content"},u(Am,null),i==="determinate"?`${Math.round(n*100)}% \xB7 `:"",r)}function ES(t){let{numUploads:e,complete:n,totalUploadedSize:i,totalSize:r,totalETA:o,i18n:s}=t,a=e>1;return u("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:n,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},a&&Im(),s("dataUploadedOfTotal",{complete:(0,Yc.default)(i),total:(0,Yc.default)(r)}),Im(),s("xTimeLeft",{time:Xc(o)})))}function zm(t){let{i18n:e,complete:n,numUploads:i}=t;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:n,smart_count:i}))}function DS(t){let{i18n:e,newFiles:n,startUpload:i}=t,r=(0,Kc.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"},e("xMoreFilesAdded",{smart_count:n})),u("button",{type:"button",className:r,"aria-label":e("uploadXFiles",{smart_count:n}),onClick:i},e("upload")))}function Lm(t){let{i18n:e,supportsUploadProgress:n,totalProgress:i,showProgressDetails:r,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:c,complete:d,totalUploadedSize:p,totalSize:g,totalETA:h,startUpload:v}=t,C=l&&o;if(!o||s)return null;let R=e(a?"paused":"uploading");function I(){return!a&&!C&&r?n?u(ES,{numUploads:c,complete:d,totalUploadedSize:p,totalSize:g,totalETA:h,i18n:e}):u(zm,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":R,title:R},a?null:u(Am,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},n?`${R}: ${i}%`:R),I(),C?u(DS,{i18n:e,newFiles:l,startUpload:v}):null))}function Hm(t){let{i18n:e}=t;return u("div",{className:"uppy-StatusBar-content",role:"status",title:e("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"})),e("complete"))))}function jm(t){let{error:e,i18n:n,complete:i,numUploads:r}=t;function o(){let s=`${n("uploadFailed")}
|
|
21
|
+
Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),o.type in z(this,et)[et]?z(this,et)[et][o.type].push(o):z(this,et)[et][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(e){for(let n of Object.values(z(this,et)[et])){let i=n.find(r=>r.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return z(this,et)[et][e]}iteratePlugins(e){Object.values(z(this,et)[et]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let n=z(this,et)[et][e.type],i=n.findIndex(s=>s.id===e.id);i!==-1&&n.splice(i,1);let r=this.getState(),o={plugins:E(b({},r.plugins),{[e.id]:void 0})};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),z(this,Ur)[Ur](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",z(this,Zt)[Zt]),window.removeEventListener("offline",z(this,Zt)[Zt]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,n,i){n===void 0&&(n="info"),i===void 0&&(i=3e3);let r=typeof e=="object";this.setState({info:[...this.getState().info,{type:n,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,n){let{logger:i}=this.opts;switch(n){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}registerRequestClient(e,n){z(this,Gr)[Gr].set(e,n)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let n=z(this,Gr)[Gr].get(e.remote.requestClientId);if(n==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return n}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?z(this,xi)[xi](e):(z(this,sn)[sn](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return z(this,wi)[wi](...arguments)}addResultData(e,n){if(!z(this,zc)[zc](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:i}=this.getState(),r=E(b({},i[e]),{result:b(b({},i[e].result),n)});this.setState({currentUploads:E(b({},i),{[e]:r})})}upload(){var e;(e=z(this,et)[et].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:n}=this.getState(),i=this.opts.onBeforeUpload(n);return i===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(i&&typeof i=="object"&&(n=i,this.setState({files:n})),Promise.resolve().then(()=>z(this,ct)[ct].validateMinNumberOfFiles(n)).catch(r=>{throw z(this,Dt)[Dt]([r]),r}).then(()=>{if(!z(this,Ac)[Ac](n))throw new bt(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{let{currentUploads:r}=this.getState(),o=Object.values(r).flatMap(l=>l.fileIDs),s=[];Object.keys(n).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&o.indexOf(l)===-1&&s.push(c.id)});let a=z(this,wi)[wi](s);return z(this,xi)[xi](a)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}};function rS(t){for(let o of t)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");let e=t.filter(o=>o.isUserFacing),n=4,i=e.slice(0,n),r=e.slice(n);i.forEach(o=>{let{message:s,details:a=""}=o;this.info({message:s,details:a},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function oS(t){let{missingFields:e,error:n}=z(this,ct)[ct].getMissingRequiredMetaFields(t);return e.length>0?(this.setFileState(t.id,{missingRequiredMetaFields:e}),this.log(n.message),this.emit("restriction-failed",t,n),!1):!0}function sS(t){let e=!0;for(let n of Object.values(t))z(this,Xr)[Xr](n)||(e=!1);return e}function aS(t){let{allowNewUpload:e}=this.getState();if(e===!1){let n=new bt(this.i18n("noMoreFilesAllowed"),{file:t});throw z(this,Dt)[Dt]([n]),n}}function lS(t){let e=t instanceof File?{name:t.name,type:t.type,size:t.size,data:t}:t,n=jr(e),i=Mc(n,e),r=nn(i).extension,o=Ws(e,this.getID()),s=e.meta||{};s.name=i,s.type=n;let a=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:o,name:i,extension:r||"",meta:b(b({},this.getState().meta),s),type:n,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function cS(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(t=>{t.isRestriction||this.log(t.stack||t.message||t)})},4))}function dS(t){let{files:e}=this.getState(),n=b({},e),i=[],r=[];for(let a of t)try{var o;let l=z(this,Lc)[Lc](a),c=(o=e[l.id])==null?void 0:o.isGhost;if(c){let p=e[l.id];l=E(b({},p),{isGhost:!1,data:a.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let d=this.opts.onBeforeFileAdded(l,n);if(!d&&this.checkIfFileAlreadyExists(l.id)){var s;throw new bt(this.i18n("noDuplicates",{fileName:(s=l.name)!=null?s:this.i18n("unnamed")}),{file:a})}if(d===!1&&!c)throw new bt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(l=d),z(this,ct)[ct].validateSingleFile(l),n[l.id]=l,i.push(l)}catch(l){r.push(l)}try{z(this,ct)[ct].validateAggregateRestrictions(Object.values(e),i)}catch(a){return r.push(a),{nextFilesState:e,validFilesToAdd:[],errors:r}}return{nextFilesState:n,validFilesToAdd:i,errors:r}}function uS(){let t=(i,r,o)=>{let s=i.message||"Unknown error";i.details&&(s+=` ${i.details}`),this.setState({error:s}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:s,response:o})};this.on("error",t),this.on("upload-error",(i,r,o)=>{if(t(r,i,o),typeof r=="object"&&r.message){var s;this.log(r.message,"error");let a=new Error(this.i18n("failedToUpload",{file:(s=i?.name)!=null?s:""}));a.isUserFacing=!0,a.details=r.message,r.details&&(a.details+=` ${r.details}`),z(this,Dt)[Dt]([a])}else z(this,Dt)[Dt]([r])});let e=null;this.on("upload-stalled",(i,r)=>{let{message:o}=i,s=r.map(a=>a.meta.name).join(", ");e||(this.info({message:o,details:s},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${o} ${s}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let n=i=>{let r=i.filter(s=>{let a=s!=null&&this.getFile(s.id);return a||this.log(`Not setting progress for a file that has been removed: ${s?.id}`),a}),o=Object.fromEntries(r.map(s=>[s.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:s.size}}]));this.patchFilesState(o)};this.on("upload-start",n),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(i,r)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let o=this.getFile(i.id).progress;this.setFileState(i.id,{progress:E(b({},o),{postprocess:z(this,Ci)[Ci].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),i.size==null&&this.setFileState(i.id,{size:r.bytesUploaded||o.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(i,r)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}this.setFileState(i.id,{progress:E(b({},this.getFile(i.id).progress),{preprocess:r})})}),this.on("preprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let r=b({},this.getState().files);r[i.id]=E(b({},r[i.id]),{progress:b({},r[i.id].progress)}),delete r[i.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(i,r)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}this.setFileState(i.id,{progress:E(b({},this.getState().files[i.id].progress),{postprocess:r})})}),this.on("postprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let r=b({},this.getState().files);r[i.id]=E(b({},r[i.id]),{progress:b({},r[i.id].progress)}),delete r[i.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",i=>{i&&z(this,Xr)[Xr](i)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",z(this,Zt)[Zt]),window.addEventListener("offline",z(this,Zt)[Zt]),setTimeout(z(this,Zt)[Zt],3e3))}function pS(t,e){e===void 0&&(e={});let{forceAllowNewUpload:n=!1}=e,{allowNewUpload:i,currentUploads:r}=this.getState();if(!i&&!n)throw new Error("Cannot create a new upload: already uploading.");let o=wf();return this.emit("upload",o,this.getFilesByIds(t)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:E(b({},r),{[o]:{fileIDs:t,step:0,result:{}}})}),o}function hS(t){let{currentUploads:e}=this.getState();return e[t]}function fS(t){let e=b({},this.getState().currentUploads);delete e[t],this.setState({currentUploads:e})}function mS(t){return F(this,null,function*(){let e=()=>{let{currentUploads:o}=this.getState();return o[t]},n=e(),i=[...z(this,rn)[rn],...z(this,on)[on],...z(this,Ci)[Ci]];try{for(let o=n.step||0;o<i.length&&n;o++){let s=i[o];this.setState({currentUploads:E(b({},this.getState().currentUploads),{[t]:E(b({},n),{step:o})})});let{fileIDs:a}=n;yield s(a,t),n=e()}}catch(o){throw z(this,sn)[sn](t),o}if(n){n.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let o=n.fileIDs.map(l=>this.getFile(l)),s=o.filter(l=>!l.error),a=o.filter(l=>l.error);this.addResultData(t,{successful:s,failed:a,uploadID:t}),n=e()}let r;return n&&(r=n.result,this.emit("complete",r),z(this,sn)[sn](t)),r==null&&this.log(`Not setting result for an upload that has been removed: ${t}`),r})}Xs.VERSION=nS.version;var Yr=Xs;var Zr,_e,xm,gS,an,vm,Cm,Hc,Wc,jc,Vc,yS,Qr={},Sm=[],vS=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qs=Array.isArray;function Si(t,e){for(var n in e)t[n]=e[n];return t}function Pm(t){var e=t.parentNode;e&&e.removeChild(t)}function u(t,e,n){var i,r,o,s={};for(o in e)o=="key"?i=e[o]:o=="ref"?r=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?Zr.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return Kr(t,s,i,r,null)}function Kr(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++xm,__i:-1,__u:0};return r==null&&_e.vnode!=null&&_e.vnode(o),o}function Em(){return{current:null}}function Gt(t){return t.children}function _t(t,e){this.props=t,this.context=e}function ln(t,e){if(e==null)return t.__?ln(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?ln(t):null}function Dm(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Dm(t)}}function bm(t){(!t.__d&&(t.__d=!0)&&an.push(t)&&!Ks.__r++||vm!==_e.debounceRendering)&&((vm=_e.debounceRendering)||Cm)(Ks)}function Ks(){var t,e,n,i,r,o,s,a;for(an.sort(Hc);t=an.shift();)t.__d&&(e=an.length,i=void 0,o=(r=(n=t).__v).__e,s=[],a=[],n.__P&&((i=Si({},r)).__v=r.__v+1,_e.vnode&&_e.vnode(i),$c(n.__P,i,r,n.__n,n.__P.namespaceURI,32&r.__u?[o]:null,s,o??ln(r),!!(32&r.__u),a),i.__v=r.__v,i.__.__k[i.__i]=i,Im(s,i,a),i.__e!=o&&Dm(i)),an.length>e&&an.sort(Hc));Ks.__r=0}function km(t,e,n,i,r,o,s,a,l,c,d){var p,g,h,v,C,R=i&&i.__k||Sm,O=e.length;for(n.__d=l,bS(n,e,R),l=n.__d,p=0;p<O;p++)(h=n.__k[p])!=null&&typeof h!="boolean"&&typeof h!="function"&&(g=h.__i===-1?Qr:R[h.__i]||Qr,h.__i=p,$c(t,h,g,r,o,s,a,l,c,d),v=h.__e,h.ref&&g.ref!=h.ref&&(g.ref&&qc(g.ref,null,h),d.push(h.ref,h.__c||v,h)),C==null&&v!=null&&(C=v),65536&h.__u||g.__k===h.__k?l=Tm(h,l,t):typeof h.type=="function"&&h.__d!==void 0?l=h.__d:v&&(l=v.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=C}function bS(t,e,n){var i,r,o,s,a,l=e.length,c=n.length,d=c,p=0;for(t.__k=[],i=0;i<l;i++)s=i+p,(r=t.__k[i]=(r=e[i])==null||typeof r=="boolean"||typeof r=="function"?null:typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?Kr(null,r,null,null,null):Qs(r)?Kr(Gt,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?Kr(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)!=null?(r.__=t,r.__b=t.__b+1,a=_S(r,n,s,d),r.__i=a,o=null,a!==-1&&(d--,(o=n[a])&&(o.__u|=131072)),o==null||o.__v===null?(a==-1&&p--,typeof r.type!="function"&&(r.__u|=65536)):a!==s&&(a==s-1?p--:a==s+1?p++:a>s?d>l-s?p+=a-s:p--:a<s&&(a==s-p?p-=a-s:p++),a!==i+p&&(r.__u|=65536))):(o=n[s])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=ln(o)),Uc(o,o,!1),n[s]=null,d--);if(d)for(i=0;i<c;i++)(o=n[i])!=null&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=ln(o)),Uc(o,o))}function Tm(t,e,n){var i,r;if(typeof t.type=="function"){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=Tm(i[r],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=ln(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function di(t,e){return e=e||[],t==null||typeof t=="boolean"||(Qs(t)?t.some(function(n){di(n,e)}):e.push(t)),e}function _S(t,e,n,i){var r=t.key,o=t.type,s=n-1,a=n+1,l=e[n];if(l===null||l&&r==l.key&&o===l.type&&!(131072&l.__u))return n;if(i>(l!=null&&!(131072&l.__u)?1:0))for(;s>=0||a<e.length;){if(s>=0){if((l=e[s])&&!(131072&l.__u)&&r==l.key&&o===l.type)return s;s--}if(a<e.length){if((l=e[a])&&!(131072&l.__u)&&r==l.key&&o===l.type)return a;a++}}return-1}function _m(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||vS.test(e)?n:n+"px"}function Ys(t,e,n,i,r){var o;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||_m(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||_m(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n.u=i.u:(n.u=Wc,t.addEventListener(e,o?Vc:jc,o)):t.removeEventListener(e,o?Vc:jc,o);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function wm(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Wc++;else if(e.t<n.u)return;return n(_e.event?_e.event(e):e)}}}function $c(t,e,n,i,r,o,s,a,l,c){var d,p,g,h,v,C,R,O,N,Q,U,Y,_,x,P,T,B=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=e.__e=n.__e]),(d=_e.__b)&&d(e);e:if(typeof B=="function")try{if(O=e.props,N="prototype"in B&&B.prototype.render,Q=(d=B.contextType)&&i[d.__c],U=d?Q?Q.props.value:d.__:i,n.__c?R=(p=e.__c=n.__c).__=p.__E:(N?e.__c=p=new B(O,U):(e.__c=p=new _t(O,U),p.constructor=B,p.render=xS),Q&&Q.sub(p),p.props=O,p.state||(p.state={}),p.context=U,p.__n=i,g=p.__d=!0,p.__h=[],p._sb=[]),N&&p.__s==null&&(p.__s=p.state),N&&B.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Si({},p.__s)),Si(p.__s,B.getDerivedStateFromProps(O,p.__s))),h=p.props,v=p.state,p.__v=e,g)N&&B.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),N&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(N&&B.getDerivedStateFromProps==null&&O!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(O,U),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(O,p.__s,U)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(p.props=O,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(V){V&&(V.__=e)}),Y=0;Y<p._sb.length;Y++)p.__h.push(p._sb[Y]);p._sb=[],p.__h.length&&s.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(O,p.__s,U),N&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,v,C)})}if(p.context=U,p.props=O,p.__P=t,p.__e=!1,_=_e.__r,x=0,N){for(p.state=p.__s,p.__d=!1,_&&_(e),d=p.render(p.props,p.state,p.context),P=0;P<p._sb.length;P++)p.__h.push(p._sb[P]);p._sb=[]}else do p.__d=!1,_&&_(e),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&&(i=Si(Si({},i),p.getChildContext())),N&&!g&&p.getSnapshotBeforeUpdate!=null&&(C=p.getSnapshotBeforeUpdate(h,v)),km(t,Qs(T=d!=null&&d.type===Gt&&d.key==null?d.props.children:d)?T:[T],e,n,i,r,o,s,a,l,c),p.base=e.__e,e.__u&=-161,p.__h.length&&s.push(p),R&&(p.__E=p.__=null)}catch(V){if(e.__v=null,l||o!=null){for(e.__u|=l?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else e.__e=n.__e,e.__k=n.__k;_e.__e(V,e,n)}else o==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=wS(n.__e,e,n,i,r,o,s,l,c);(d=_e.diffed)&&d(e)}function Im(t,e,n){e.__d=void 0;for(var i=0;i<n.length;i++)qc(n[i],n[++i],n[++i]);_e.__c&&_e.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(o){o.call(r)})}catch(o){_e.__e(o,r.__v)}})}function wS(t,e,n,i,r,o,s,a,l){var c,d,p,g,h,v,C,R=n.props,O=e.props,N=e.type;if(N==="svg"?r="http://www.w3.org/2000/svg":N==="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((h=o[c])&&"setAttribute"in h==!!N&&(N?h.localName===N:h.nodeType===3)){t=h,o[c]=null;break}}if(t==null){if(N===null)return document.createTextNode(O);t=document.createElementNS(r,N,O.is&&O),o=null,a=!1}if(N===null)R===O||a&&t.data===O||(t.data=O);else{if(o=o&&Zr.call(t.childNodes),R=n.props||Qr,!a&&o!=null)for(R={},c=0;c<t.attributes.length;c++)R[(h=t.attributes[c]).name]=h.value;for(c in R)if(h=R[c],c!="children"){if(c=="dangerouslySetInnerHTML")p=h;else if(c!=="key"&&!(c in O)){if(c=="value"&&"defaultValue"in O||c=="checked"&&"defaultChecked"in O)continue;Ys(t,c,null,h,r)}}for(c in O)h=O[c],c=="children"?g=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?v=h:c=="checked"?C=h:c==="key"||a&&typeof h!="function"||R[c]===h||Ys(t,c,h,R[c],r);if(d)a||p&&(d.__html===p.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(p&&(t.innerHTML=""),km(t,Qs(g)?g:[g],e,n,i,N==="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&ln(n,0),a,l),o!=null)for(c=o.length;c--;)o[c]!=null&&Pm(o[c]);a||(c="value",v!==void 0&&(v!==t[c]||N==="progress"&&!v||N==="option"&&v!==R[c])&&Ys(t,c,v,R[c],r),c="checked",C!==void 0&&C!==t[c]&&Ys(t,c,C,R[c],r))}return t}function qc(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(r){_e.__e(r,n)}}function Uc(t,e,n){var i,r;if(_e.unmount&&_e.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||qc(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){_e.__e(o,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&Uc(i[r],e,n||typeof t.type!="function");n||t.__e==null||Pm(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function xS(t,e,n){return this.constructor(t,n)}function Gc(t,e,n){var i,r,o,s;_e.__&&_e.__(t,e),r=(i=typeof n=="function")?null:n&&n.__k||e.__k,o=[],s=[],$c(e,t=(!i&&n||e).__k=u(Gt,null,[t]),r||Qr,Qr,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?Zr.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i,s),Im(o,t,s)}function Zs(t,e,n){var i,r,o,s,a=Si({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)o=="key"?i=e[o]:o=="ref"?r=e[o]:a[o]=e[o]===void 0&&s!==void 0?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?Zr.call(arguments,2):n),Kr(t.type,a,i||t.key,r||t.ref,null)}Zr=Sm.slice,_e={__e:function(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(a){t=a}throw t}},xm=0,gS=function(t){return t!=null&&t.constructor==null},_t.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Si({},this.state),typeof t=="function"&&(t=t(Si({},n),this.props)),t&&Si(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),bm(this))},_t.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),bm(this))},_t.prototype.render=Gt,an=[],Cm=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Hc=function(t,e){return t.__v.__b-e.__v.__b},Ks.__r=0,Wc=0,jc=wm(!1),Vc=wm(!0),yS=0;function Jr(t){return typeof t!="object"||t===null||!("nodeType"in t)?!1:t.nodeType===Node.ELEMENT_NODE}function CS(t,e){return e===void 0&&(e=document),typeof t=="string"?e.querySelector(t):Jr(t)?t:null}var Om=CS;function SS(t){for(var e;t&&!t.dir;)t=t.parentNode;return(e=t)==null?void 0:e.dir}var Js=SS;var ea=class{constructor(e,n){this.uppy=e,this.opts=n??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:n}=this.uppy.getState();this.uppy.setState({plugins:E(b({},n),{[this.id]:b(b({},n[this.id]),e)})})}setOptions(e){this.opts=b(b({},this.opts),e),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new Yn([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function Fm(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var PS=0;function ES(t){return"__private_"+PS+++"_"+t}function DS(t){let e=null,n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return n=r,e||(e=Promise.resolve().then(()=>(e=null,t(...n)))),e}}var eo=ES("updateUI"),Xc=class t extends ea{constructor(){super(...arguments),Object.defineProperty(this,eo,{writable:!0,value:void 0})}getTargetPlugin(e){let n;if(typeof e?.addTarget=="function")n=e,n instanceof t||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:n,UIPlugin:t}}));else if(typeof e=="function"){let i=e;this.uppy.iteratePlugins(r=>{r instanceof i&&(n=r)})}return n}mount(e,n){let i=n.id,r=Om(e);if(r){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),Fm(this,eo)[eo]=DS(l=>{this.uppy.getPlugin(this.id)&&(Gc(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),Gc(this.render(this.uppy.getState(),a),a),this.el=a,r.appendChild(a),a.dir=this.opts.direction||Js(a)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${i} to ${o.id}`),this.parent=o,this.el=o.addTarget(n),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let s=`Invalid target option given to ${i}.`;throw typeof e=="function"?s+=" 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.":s+="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(s)}render(e,n){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var n,i;(n=(i=Fm(this,eo))[eo])==null||n.call(i,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},kt=Xc;function ta(t,e,n,i){return n===0||t===e?t:i===0?e:t+(e-t)*2**(-i/n)}var Tt={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var td=ge(dt(),1);function to(t){let e=[],n="indeterminate",i;for(let{progress:o}of Object.values(t)){let{preprocess:s,postprocess:a}=o;i==null&&(s||a)&&({mode:n,message:i}=s||a),s?.mode==="determinate"&&e.push(s.value),a?.mode==="determinate"&&e.push(a.value)}let r=e.reduce((o,s)=>o+s/e.length,0);return{mode:n,message:i,value:r}}var Zc=ge(dt(),1),Qc=ge($s(),1);function Yc(t){let e=Math.floor(t/3600)%24,n=Math.floor(t/60)%60,i=Math.floor(t%60);return{hours:e,minutes:n,seconds:i}}function Kc(t){let e=Yc(t),n=e.hours===0?"":`${e.hours}h`,i=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,r=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${n}${i}${r}`}var kS="\xB7",Rm=()=>` ${kS} `;function Mm(t){let{newFiles:e,isUploadStarted:n,recoveredState:i,i18n:r,uploadState:o,isSomeGhost:s,startUpload:a}=t,l=(0,Zc.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===Tt.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":s}),c=e&&n&&!i?r("uploadXNewFiles",{smart_count:e}):r("uploadXFiles",{smart_count:e});return u("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:a,disabled:s,"data-uppy-super-focusable":!0},c)}function Bm(t){let{i18n:e,uppy:n}=t;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>n.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"})),e("retry"))}function Am(t){let{i18n:e,uppy:n}=t;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>n.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 Nm(t){let{isAllPaused:e,i18n:n,isAllComplete:i,resumableUploads:r,uppy:o}=t,s=n(e?"resume":"pause");function a(){if(!i){if(!r){o.cancelAll();return}if(e){o.resumeAll();return}o.pauseAll()}}return u("button",{title:s,"aria-label":s,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"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:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function zm(t){let{i18n:e,doneButtonHandler:n}=t;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:n,"data-uppy-super-focusable":!0},e("done"))}function Lm(){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 Hm(t){let{progress:e}=t,{value:n,mode:i,message:r}=e;return u("div",{className:"uppy-StatusBar-content"},u(Lm,null),i==="determinate"?`${Math.round(n*100)}% \xB7 `:"",r)}function TS(t){let{numUploads:e,complete:n,totalUploadedSize:i,totalSize:r,totalETA:o,i18n:s}=t,a=e>1;return u("div",{className:"uppy-StatusBar-statusSecondary"},a&&s("filesUploadedOfTotal",{complete:n,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},a&&Rm(),s("dataUploadedOfTotal",{complete:(0,Qc.default)(i),total:(0,Qc.default)(r)}),Rm(),s("xTimeLeft",{time:Kc(o)})))}function jm(t){let{i18n:e,complete:n,numUploads:i}=t;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:n,smart_count:i}))}function IS(t){let{i18n:e,newFiles:n,startUpload:i}=t,r=(0,Zc.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"},e("xMoreFilesAdded",{smart_count:n})),u("button",{type:"button",className:r,"aria-label":e("uploadXFiles",{smart_count:n}),onClick:i},e("upload")))}function Vm(t){let{i18n:e,supportsUploadProgress:n,totalProgress:i,showProgressDetails:r,isUploadStarted:o,isAllComplete:s,isAllPaused:a,newFiles:l,numUploads:c,complete:d,totalUploadedSize:p,totalSize:g,totalETA:h,startUpload:v}=t,C=l&&o;if(!o||s)return null;let R=e(a?"paused":"uploading");function O(){return!a&&!C&&r?n?u(TS,{numUploads:c,complete:d,totalUploadedSize:p,totalSize:g,totalETA:h,i18n:e}):u(jm,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":R,title:R},a?null:u(Lm,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},n?`${R}: ${i}%`:R),O(),C?u(IS,{i18n:e,newFiles:l,startUpload:v}):null))}function Um(t){let{i18n:e}=t;return u("div",{className:"uppy-StatusBar-content",role:"status",title:e("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"})),e("complete"))))}function Wm(t){let{error:e,i18n:n,complete:i,numUploads:r}=t;function o(){let s=`${n("uploadFailed")}
|
|
22
22
|
|
|
23
|
-
${e}`;alert(s)}return u("div",{className:"uppy-StatusBar-content",title:n("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"},n("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":n("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:o,type:"button"},"?")),u(zm,{i18n:n,complete:i,numUploads:r})))}var{STATE_ERROR:Vm,STATE_WAITING:kS,STATE_PREPROCESSING:Qc,STATE_UPLOADING:na,STATE_POSTPROCESSING:Zc,STATE_COMPLETE:ra}=Tt;function ed(t){let{newFiles:e,allowNewUpload:n,isUploadInProgress:i,isAllPaused:r,resumableUploads:o,error:s,hideUploadButton:a=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:p,uploadState:g,totalProgress:h,files:v,supportsUploadProgress:C,hideAfterFinish:R=!1,isSomeGhost:I,doneButtonHandler:N=void 0,isUploadStarted:Q,i18n:U,startUpload:Y,uppy:_,isAllComplete:x,showProgressDetails:P=void 0,numUploads:T,complete:B,totalSize:V,totalETA:Z,totalUploadedSize:Pe}=t;function he(){switch(g){case Zc:case Qc:{let le=to(v);return le.mode==="determinate"?le.value*100:h}case Vm:return null;case na:return C?h:null;default:return h}}function j(){switch(g){case Zc:case Qc:{let{mode:le}=to(v);return le==="indeterminate"}case na:return!C;default:return!1}}let ye=he(),W=ye??100,ht=!s&&e&&(!i&&!r||p)&&n&&!a,Le=!c&&g!==kS&&g!==ra,L=o&&!l&&g===na,de=s&&!x&&!d,He=N&&g===ra,be=(0,Jc.default)("uppy-StatusBar-progress",{"is-indeterminate":j()}),je=(0,Jc.default)("uppy-StatusBar",`is-${g}`,{"has-ghosts":I}),Ee=(()=>{switch(g){case Qc:case Zc:return u(Nm,{progress:to(v)});case ra:return u(Hm,{i18n:U});case Vm:return u(jm,{error:s,i18n:U,numUploads:T,complete:B});case na:return u(Lm,{i18n:U,supportsUploadProgress:C,totalProgress:h,showProgressDetails:P,isUploadStarted:Q,isAllComplete:x,isAllPaused:r,newFiles:e,numUploads:T,complete:B,totalUploadedSize:Pe,totalSize:V,totalETA:Z,startUpload:Y});default:return null}})();return u("div",{className:je,"aria-hidden":!(ht||de||L||Le||He)&&!Ee||g===ra&&R},u("div",{className:be,style:{width:`${W}%`},role:"progressbar","aria-label":`${W}%`,"aria-valuetext":`${W}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":ye}),Ee,u("div",{className:"uppy-StatusBar-actions"},ht?u(Om,{newFiles:e,isUploadStarted:Q,recoveredState:p,i18n:U,isSomeGhost:I,startUpload:Y,uploadState:g}):null,de?u(Fm,{i18n:U,uppy:_}):null,L?u(Mm,{isAllPaused:r,i18n:U,isAllComplete:x,resumableUploads:o,uppy:_}):null,Le?u(Rm,{i18n:U,uppy:_}):null,He?u(Bm,{i18n:U,doneButtonHandler:N}):null))}var Um={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}",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 Ce(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var TS=0;function Qn(t){return"__private_"+TS+++"_"+t}var IS={version:"4.0.3"},OS=2e3,FS=2e3;function RS(t,e,n,i){if(t)return Tt.STATE_ERROR;if(e)return Tt.STATE_COMPLETE;if(n)return Tt.STATE_WAITING;let r=Tt.STATE_WAITING,o=Object.keys(i);for(let s=0;s<o.length;s++){let{progress:a}=i[o[s]];if(a.uploadStarted&&!a.uploadComplete)return Tt.STATE_UPLOADING;a.preprocess&&(r=Tt.STATE_PREPROCESSING),a.postprocess&&r!==Tt.STATE_PREPROCESSING&&(r=Tt.STATE_POSTPROCESSING)}return r}var MS={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},qt=Qn("lastUpdateTime"),Qt=Qn("previousUploadedBytes"),Pi=Qn("previousSpeed"),It=Qn("previousETA"),td=Qn("computeSmoothETA"),io=Qn("onUploadStart"),cn=class extends kt{constructor(e,n){super(e,b(b({},MS),n)),Object.defineProperty(this,td,{value:BS}),Object.defineProperty(this,qt,{writable:!0,value:void 0}),Object.defineProperty(this,Qt,{writable:!0,value:void 0}),Object.defineProperty(this,Pi,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,io,{writable:!0,value:()=>{let{recoveredState:i}=this.uppy.getState();if(Ce(this,Pi)[Pi]=null,Ce(this,It)[It]=null,i){Ce(this,Qt)[Qt]=Object.values(i.files).reduce((r,o)=>{let{progress:s}=o;return r+s.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Ce(this,qt)[qt]=performance.now(),Ce(this,Qt)[Qt]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Um,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:n,files:i,allowNewUpload:r,totalProgress:o,error:s,recoveredState:a}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:p,isAllComplete:g,isAllPaused:h,isUploadInProgress:v,isSomeGhost:C}=this.uppy.getObjectOfFilesPerState(),R=a?Object.values(i):l,I=!!n.resumableUploads,N=n.uploadProgress!==!1,Q=0,U=0;c.forEach(_=>{Q+=_.progress.bytesTotal||0,U+=_.progress.bytesUploaded||0});let Y=Ce(this,td)[td]({uploaded:U,total:Q,remaining:Q-U});return ed({error:s,uploadState:RS(s,g,a,e.files||{}),allowNewUpload:r,totalProgress:o,totalSize:Q,totalUploadedSize:U,isAllComplete:!1,isAllPaused:h,isUploadStarted:p,isUploadInProgress:v,isSomeGhost:C,recoveredState:a,complete:d.length,newFiles:R.length,numUploads:c.length,totalETA:Y,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:I,supportsUploadProgress:N,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 e=this.el;Js(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Ce(this,io)[io]),Ce(this,qt)[qt]=performance.now(),Ce(this,Qt)[Qt]=this.uppy.getFiles().reduce((n,i)=>n+i.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Ce(this,io)[io])}};function BS(t){var e,n;if(t.total===0||t.remaining===0)return 0;(n=(e=Ce(this,qt))[qt])!=null||(e[qt]=performance.now());let i=performance.now()-Ce(this,qt)[qt];if(i===0){var r;return Math.round(((r=Ce(this,It)[It])!=null?r:0)/100)/10}let o=t.uploaded-Ce(this,Qt)[Qt];if(Ce(this,Qt)[Qt]=t.uploaded,o<=0){var s;return Math.round(((s=Ce(this,It)[It])!=null?s:0)/100)/10}let a=o/i,l=Ce(this,Pi)[Pi]==null?a:ta(a,Ce(this,Pi)[Pi],OS,i);Ce(this,Pi)[Pi]=l;let c=t.remaining/l,d=Math.max(Ce(this,It)[It]-i,0),p=Ce(this,It)[It]==null?c:ta(c,d,FS,i);return Ce(this,It)[It]=p,Ce(this,qt)[qt]=performance.now(),Math.round(p/100)/10}cn.VERSION=IS.version;var Wm=300,oa=class extends _t{constructor(){super(...arguments),this.ref=Cm()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Wm)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Wm)}render(){let{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function AS(t,e){return Object.assign(t,e)}function NS(t,e){var n;return(n=t?.key)!=null?n:e}function zS(t,e){let n=t._ptgLinkedRefs||(t._ptgLinkedRefs={});return n[e]||(n[e]=i=>{t.refs[e]=i})}function no(t){let e={};for(let n=0;n<t.length;n++)if(t[n]!=null){let i=NS(t[n],n.toString(36));e[i]=t[n]}return e}function LS(t,e){t=t||{},e=e||{};let n=s=>e.hasOwnProperty(s)?e[s]:t[s],i={},r=[];for(let s in t)e.hasOwnProperty(s)?r.length&&(i[s]=r,r=[]):r.push(s);let o={};for(let s in e){if(i.hasOwnProperty(s))for(let a=0;a<i[s].length;a++){let l=i[s][a];o[i[s][a]]=n(l)}o[s]=n(s)}for(let s=0;s<r.length;s++)o[r[s]]=n(r[s]);return o}var HS=t=>t,jS=(()=>{class t extends _t{constructor(n,i){super(n,i),this.refs={},this.state={children:no(di(di(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 n=this.state.children;for(let i in n)n[i]&&this.performAppear(i)}componentWillReceiveProps(n){let i=no(di(n.children)||[]),r=this.state.children;this.setState(s=>({children:LS(s.children,i)}));let o;for(o in i)if(i.hasOwnProperty(o)){let s=r&&r.hasOwnProperty(o);i[o]&&s&&this.currentlyTransitioningKeys[o]?(this.keysToEnter.push(o),this.keysToAbortLeave.push(o)):i[o]&&!s&&!this.currentlyTransitioningKeys[o]&&this.keysToEnter.push(o)}for(o in r)if(r.hasOwnProperty(o)){let s=i&&i.hasOwnProperty(o);r[o]&&!s&&!this.currentlyTransitioningKeys[o]&&this.keysToLeave.push(o)}}componentDidUpdate(){let{keysToEnter:n}=this;this.keysToEnter=[],n.forEach(this.performEnter);let{keysToLeave:i}=this;this.keysToLeave=[],i.forEach(this.performLeave)}_finishAbort(n){let i=this.keysToAbortLeave.indexOf(n);i!==-1&&this.keysToAbortLeave.splice(i,1)}performAppear(n){this.currentlyTransitioningKeys[n]=!0;let i=this.refs[n];i!=null&&i.componentWillAppear?i.componentWillAppear(this._handleDoneAppearing.bind(this,n)):this._handleDoneAppearing(n)}_handleDoneAppearing(n){let i=this.refs[n];i!=null&&i.componentDidAppear&&i.componentDidAppear(),delete this.currentlyTransitioningKeys[n],this._finishAbort(n);let r=no(di(this.props.children)||[]);(!r||!r.hasOwnProperty(n))&&this.performLeave(n)}performEnter(n){this.currentlyTransitioningKeys[n]=!0;let i=this.refs[n];i!=null&&i.componentWillEnter?i.componentWillEnter(this._handleDoneEntering.bind(this,n)):this._handleDoneEntering(n)}_handleDoneEntering(n){let i=this.refs[n];i!=null&&i.componentDidEnter&&i.componentDidEnter(),delete this.currentlyTransitioningKeys[n],this._finishAbort(n);let r=no(di(this.props.children)||[]);(!r||!r.hasOwnProperty(n))&&this.performLeave(n)}performLeave(n){if(this.keysToAbortLeave.indexOf(n)!==-1)return;this.currentlyTransitioningKeys[n]=!0;let r=this.refs[n];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,n)):this._handleDoneLeaving(n)}_handleDoneLeaving(n){if(this.keysToAbortLeave.indexOf(n)!==-1)return;let r=this.refs[n];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[n];let o=no(di(this.props.children)||[]);if(o&&o.hasOwnProperty(n))this.performEnter(n);else{let s=AS({},this.state.children);delete s[n],this.setState({children:s})}}render(n,i){let R=n,{childFactory:r,transitionLeave:o,transitionName:s,transitionAppear:a,transitionEnter:l,transitionLeaveTimeout:c,transitionEnterTimeout:d,transitionAppearTimeout:p,component:g}=R,h=Sn(R,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:v}=i,C=Object.entries(v).map(I=>{let[N,Q]=I;if(!Q)return;let U=zS(this,N);return Zs(r(Q),{ref:U,key:N})}).filter(Boolean);return u(g,h,C)}}return t.defaultProps={component:"span",childFactory:HS},t})(),$m=jS;var VS={version:"4.1.0"},dn=class extends kt{constructor(e,n){super(e,n),this.render=i=>u("div",{className:"uppy uppy-Informer"},u($m,null,i.info.map(r=>u(oa,{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
|
+
${e}`;alert(s)}return u("div",{className:"uppy-StatusBar-content",title:n("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"},n("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":n("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:o,type:"button"},"?")),u(jm,{i18n:n,complete:i,numUploads:r})))}var{STATE_ERROR:$m,STATE_WAITING:OS,STATE_PREPROCESSING:Jc,STATE_UPLOADING:na,STATE_POSTPROCESSING:ed,STATE_COMPLETE:ra}=Tt;function id(t){let{newFiles:e,allowNewUpload:n,isUploadInProgress:i,isAllPaused:r,resumableUploads:o,error:s,hideUploadButton:a=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:p,uploadState:g,totalProgress:h,files:v,supportsUploadProgress:C,hideAfterFinish:R=!1,isSomeGhost:O,doneButtonHandler:N=void 0,isUploadStarted:Q,i18n:U,startUpload:Y,uppy:_,isAllComplete:x,showProgressDetails:P=void 0,numUploads:T,complete:B,totalSize:V,totalETA:Z,totalUploadedSize:Pe}=t;function fe(){switch(g){case ed:case Jc:{let le=to(v);return le.mode==="determinate"?le.value*100:h}case $m:return null;case na:return C?h:null;default:return h}}function j(){switch(g){case ed:case Jc:{let{mode:le}=to(v);return le==="indeterminate"}case na:return!C;default:return!1}}let ye=fe(),W=ye??100,ht=!s&&e&&(!i&&!r||p)&&n&&!a,He=!c&&g!==OS&&g!==ra,L=o&&!l&&g===na,de=s&&!x&&!d,je=N&&g===ra,be=(0,td.default)("uppy-StatusBar-progress",{"is-indeterminate":j()}),Ve=(0,td.default)("uppy-StatusBar",`is-${g}`,{"has-ghosts":O}),Ee=(()=>{switch(g){case Jc:case ed:return u(Hm,{progress:to(v)});case ra:return u(Um,{i18n:U});case $m:return u(Wm,{error:s,i18n:U,numUploads:T,complete:B});case na:return u(Vm,{i18n:U,supportsUploadProgress:C,totalProgress:h,showProgressDetails:P,isUploadStarted:Q,isAllComplete:x,isAllPaused:r,newFiles:e,numUploads:T,complete:B,totalUploadedSize:Pe,totalSize:V,totalETA:Z,startUpload:Y});default:return null}})();return u("div",{className:Ve,"aria-hidden":!(ht||de||L||He||je)&&!Ee||g===ra&&R},u("div",{className:be,style:{width:`${W}%`},role:"progressbar","aria-label":`${W}%`,"aria-valuetext":`${W}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":ye}),Ee,u("div",{className:"uppy-StatusBar-actions"},ht?u(Mm,{newFiles:e,isUploadStarted:Q,recoveredState:p,i18n:U,isSomeGhost:O,startUpload:Y,uploadState:g}):null,de?u(Bm,{i18n:U,uppy:_}):null,L?u(Nm,{isAllPaused:r,i18n:U,isAllComplete:x,resumableUploads:o,uppy:_}):null,He?u(Am,{i18n:U,uppy:_}):null,je?u(zm,{i18n:U,doneButtonHandler:N}):null))}var qm={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}",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 Ce(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var FS=0;function Qn(t){return"__private_"+FS+++"_"+t}var RS={version:"4.0.3"},MS=2e3,BS=2e3;function AS(t,e,n,i){if(t)return Tt.STATE_ERROR;if(e)return Tt.STATE_COMPLETE;if(n)return Tt.STATE_WAITING;let r=Tt.STATE_WAITING,o=Object.keys(i);for(let s=0;s<o.length;s++){let{progress:a}=i[o[s]];if(a.uploadStarted&&!a.uploadComplete)return Tt.STATE_UPLOADING;a.preprocess&&(r=Tt.STATE_PREPROCESSING),a.postprocess&&r!==Tt.STATE_PREPROCESSING&&(r=Tt.STATE_POSTPROCESSING)}return r}var NS={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Xt=Qn("lastUpdateTime"),Jt=Qn("previousUploadedBytes"),Pi=Qn("previousSpeed"),It=Qn("previousETA"),nd=Qn("computeSmoothETA"),io=Qn("onUploadStart"),cn=class extends kt{constructor(e,n){super(e,b(b({},NS),n)),Object.defineProperty(this,nd,{value:zS}),Object.defineProperty(this,Xt,{writable:!0,value:void 0}),Object.defineProperty(this,Jt,{writable:!0,value:void 0}),Object.defineProperty(this,Pi,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,io,{writable:!0,value:()=>{let{recoveredState:i}=this.uppy.getState();if(Ce(this,Pi)[Pi]=null,Ce(this,It)[It]=null,i){Ce(this,Jt)[Jt]=Object.values(i.files).reduce((r,o)=>{let{progress:s}=o;return r+s.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Ce(this,Xt)[Xt]=performance.now(),Ce(this,Jt)[Jt]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=qm,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:n,files:i,allowNewUpload:r,totalProgress:o,error:s,recoveredState:a}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:p,isAllComplete:g,isAllPaused:h,isUploadInProgress:v,isSomeGhost:C}=this.uppy.getObjectOfFilesPerState(),R=a?Object.values(i):l,O=!!n.resumableUploads,N=n.uploadProgress!==!1,Q=0,U=0;c.forEach(_=>{Q+=_.progress.bytesTotal||0,U+=_.progress.bytesUploaded||0});let Y=Ce(this,nd)[nd]({uploaded:U,total:Q,remaining:Q-U});return id({error:s,uploadState:AS(s,g,a,e.files||{}),allowNewUpload:r,totalProgress:o,totalSize:Q,totalUploadedSize:U,isAllComplete:!1,isAllPaused:h,isUploadStarted:p,isUploadInProgress:v,isSomeGhost:C,recoveredState:a,complete:d.length,newFiles:R.length,numUploads:c.length,totalETA:Y,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:O,supportsUploadProgress:N,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 e=this.el;Js(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Ce(this,io)[io]),Ce(this,Xt)[Xt]=performance.now(),Ce(this,Jt)[Jt]=this.uppy.getFiles().reduce((n,i)=>n+i.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Ce(this,io)[io])}};function zS(t){var e,n;if(t.total===0||t.remaining===0)return 0;(n=(e=Ce(this,Xt))[Xt])!=null||(e[Xt]=performance.now());let i=performance.now()-Ce(this,Xt)[Xt];if(i===0){var r;return Math.round(((r=Ce(this,It)[It])!=null?r:0)/100)/10}let o=t.uploaded-Ce(this,Jt)[Jt];if(Ce(this,Jt)[Jt]=t.uploaded,o<=0){var s;return Math.round(((s=Ce(this,It)[It])!=null?s:0)/100)/10}let a=o/i,l=Ce(this,Pi)[Pi]==null?a:ta(a,Ce(this,Pi)[Pi],MS,i);Ce(this,Pi)[Pi]=l;let c=t.remaining/l,d=Math.max(Ce(this,It)[It]-i,0),p=Ce(this,It)[It]==null?c:ta(c,d,BS,i);return Ce(this,It)[It]=p,Ce(this,Xt)[Xt]=performance.now(),Math.round(p/100)/10}cn.VERSION=RS.version;var Gm=300,oa=class extends _t{constructor(){super(...arguments),this.ref=Em()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Gm)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Gm)}render(){let{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function LS(t,e){return Object.assign(t,e)}function HS(t,e){var n;return(n=t?.key)!=null?n:e}function jS(t,e){let n=t._ptgLinkedRefs||(t._ptgLinkedRefs={});return n[e]||(n[e]=i=>{t.refs[e]=i})}function no(t){let e={};for(let n=0;n<t.length;n++)if(t[n]!=null){let i=HS(t[n],n.toString(36));e[i]=t[n]}return e}function VS(t,e){t=t||{},e=e||{};let n=s=>e.hasOwnProperty(s)?e[s]:t[s],i={},r=[];for(let s in t)e.hasOwnProperty(s)?r.length&&(i[s]=r,r=[]):r.push(s);let o={};for(let s in e){if(i.hasOwnProperty(s))for(let a=0;a<i[s].length;a++){let l=i[s][a];o[i[s][a]]=n(l)}o[s]=n(s)}for(let s=0;s<r.length;s++)o[r[s]]=n(r[s]);return o}var US=t=>t,WS=(()=>{class t extends _t{constructor(n,i){super(n,i),this.refs={},this.state={children:no(di(di(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 n=this.state.children;for(let i in n)n[i]&&this.performAppear(i)}componentWillReceiveProps(n){let i=no(di(n.children)||[]),r=this.state.children;this.setState(s=>({children:VS(s.children,i)}));let o;for(o in i)if(i.hasOwnProperty(o)){let s=r&&r.hasOwnProperty(o);i[o]&&s&&this.currentlyTransitioningKeys[o]?(this.keysToEnter.push(o),this.keysToAbortLeave.push(o)):i[o]&&!s&&!this.currentlyTransitioningKeys[o]&&this.keysToEnter.push(o)}for(o in r)if(r.hasOwnProperty(o)){let s=i&&i.hasOwnProperty(o);r[o]&&!s&&!this.currentlyTransitioningKeys[o]&&this.keysToLeave.push(o)}}componentDidUpdate(){let{keysToEnter:n}=this;this.keysToEnter=[],n.forEach(this.performEnter);let{keysToLeave:i}=this;this.keysToLeave=[],i.forEach(this.performLeave)}_finishAbort(n){let i=this.keysToAbortLeave.indexOf(n);i!==-1&&this.keysToAbortLeave.splice(i,1)}performAppear(n){this.currentlyTransitioningKeys[n]=!0;let i=this.refs[n];i!=null&&i.componentWillAppear?i.componentWillAppear(this._handleDoneAppearing.bind(this,n)):this._handleDoneAppearing(n)}_handleDoneAppearing(n){let i=this.refs[n];i!=null&&i.componentDidAppear&&i.componentDidAppear(),delete this.currentlyTransitioningKeys[n],this._finishAbort(n);let r=no(di(this.props.children)||[]);(!r||!r.hasOwnProperty(n))&&this.performLeave(n)}performEnter(n){this.currentlyTransitioningKeys[n]=!0;let i=this.refs[n];i!=null&&i.componentWillEnter?i.componentWillEnter(this._handleDoneEntering.bind(this,n)):this._handleDoneEntering(n)}_handleDoneEntering(n){let i=this.refs[n];i!=null&&i.componentDidEnter&&i.componentDidEnter(),delete this.currentlyTransitioningKeys[n],this._finishAbort(n);let r=no(di(this.props.children)||[]);(!r||!r.hasOwnProperty(n))&&this.performLeave(n)}performLeave(n){if(this.keysToAbortLeave.indexOf(n)!==-1)return;this.currentlyTransitioningKeys[n]=!0;let r=this.refs[n];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,n)):this._handleDoneLeaving(n)}_handleDoneLeaving(n){if(this.keysToAbortLeave.indexOf(n)!==-1)return;let r=this.refs[n];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[n];let o=no(di(this.props.children)||[]);if(o&&o.hasOwnProperty(n))this.performEnter(n);else{let s=LS({},this.state.children);delete s[n],this.setState({children:s})}}render(n,i){let R=n,{childFactory:r,transitionLeave:o,transitionName:s,transitionAppear:a,transitionEnter:l,transitionLeaveTimeout:c,transitionEnterTimeout:d,transitionAppearTimeout:p,component:g}=R,h=Sn(R,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:v}=i,C=Object.entries(v).map(O=>{let[N,Q]=O;if(!Q)return;let U=jS(this,N);return Zs(r(Q),{ref:U,key:N})}).filter(Boolean);return u(g,h,C)}}return t.defaultProps={component:"span",childFactory:US},t})(),Xm=WS;var $S={version:"4.1.0"},dn=class extends kt{constructor(e,n){super(e,n),this.render=i=>u("div",{className:"uppy uppy-Informer"},u(Xm,null,i.info.map(r=>u(oa,{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:e}=this.opts;e&&this.mount(e,this)}};dn.VERSION=VS.version;var US=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function WS(t,e,n){var i,r;let o=US.exec(t),s=(i=(r=e.mimeType)!=null?r:o?.[1])!=null?i:"plain/text",a;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);a=[c]}else o?.[3]!=null&&(a=[decodeURIComponent(o[3])]);return n?new File(a,e.name||"",{type:s}):new Blob(a,{type:s})}var qm=WS;function sa(t){return t.startsWith("blob:")}function aa(t){return t?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(t):!1}function ae(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var tg=typeof self<"u"?self:global,ao=typeof navigator<"u",$S=ao&&typeof HTMLImageElement>"u",Gm=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),ig=tg.Buffer,ng=!!ig,qS=t=>t!==void 0;function rg(t){return t===void 0||(t instanceof Map?t.size===0:Object.values(t).filter(qS).length===0)}function Qe(t){let e=new Error(t);throw delete e.stack,e}function Xm(t){let e=function(n){let i=0;return n.ifd0.enabled&&(i+=1024),n.exif.enabled&&(i+=2048),n.makerNote&&(i+=2048),n.userComment&&(i+=1024),n.gps.enabled&&(i+=512),n.interop.enabled&&(i+=100),n.ifd1.enabled&&(i+=1024),i+2048}(t);return t.jfif.enabled&&(e+=50),t.xmp.enabled&&(e+=2e4),t.iptc.enabled&&(e+=14e3),t.icc.enabled&&(e+=6e3),e}var id=t=>String.fromCharCode.apply(null,t),Ym=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,pn=class t{static from(e,n){return e instanceof this&&e.le===n?e:new t(e,void 0,void 0,n)}constructor(e,n=0,i,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){i===void 0&&(i=e.byteLength-n);let o=new DataView(e,n,i);this._swapDataView(o)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof t){i===void 0&&(i=e.byteLength-n),(n+=e.byteOffset)+i>e.byteOffset+e.byteLength&&Qe("Creating view outside of available memory in ArrayBuffer");let o=new DataView(e.buffer,n,i);this._swapDataView(o)}else if(typeof e=="number"){let o=new DataView(new ArrayBuffer(e));this._swapDataView(o)}else Qe("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,n,i=t){return e instanceof DataView||e instanceof t?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||Qe("BufferView.set(): Invalid data argument."),this.toUint8().set(e,n),new i(this,n,e.byteLength)}subarray(e,n){return n=n||this._lengthToEnd(e),new t(this,e,n)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,n){return new Uint8Array(this.buffer,this.byteOffset+e,n)}getString(e=0,n=this.byteLength){return r=this.getUint8Array(e,n),Ym?Ym.decode(r):ng?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(id(r)));var r}getLatin1String(e=0,n=this.byteLength){let i=this.getUint8Array(e,n);return id(i)}getUnicodeString(e=0,n=this.byteLength){let i=[];for(let r=0;r<n&&e+r<this.byteLength;r+=2)i.push(this.getUint16(e+r));return id(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,n=this.le){return this.dataView.getInt16(e,n)}getInt32(e,n=this.le){return this.dataView.getInt32(e,n)}getUint16(e,n=this.le){return this.dataView.getUint16(e,n)}getUint32(e,n=this.le){return this.dataView.getUint32(e,n)}getFloat32(e,n=this.le){return this.dataView.getFloat32(e,n)}getFloat64(e,n=this.le){return this.dataView.getFloat64(e,n)}getFloat(e,n=this.le){return this.dataView.getFloat32(e,n)}getDouble(e,n=this.le){return this.dataView.getFloat64(e,n)}getUintBytes(e,n,i){switch(n){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,n,i){switch(n){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function rd(t,e){Qe(`${t} '${e}' was not loaded, try using full build of exifr.`)}var lo=class extends Map{constructor(e){super(),this.kind=e}get(e,n){return this.has(e)||rd(this.kind,e),n&&(e in n||function(i,r){Qe(`Unknown ${i} '${r}'.`)}(this.kind,e),n[e].enabled||rd(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},pa=new lo("file parser"),Ot=new lo("segment parser"),po=new lo("file reader"),GS=tg.fetch;function Km(t,e){return(n=t).startsWith("data:")||n.length>1e4?sd(t,e,"base64"):Gm&&t.includes("://")?od(t,e,"url",la):Gm?sd(t,e,"fs"):ao?od(t,e,"url",la):void Qe("Invalid input argument");var n}function od(t,e,n,i){return O(this,null,function*(){return po.has(n)?sd(t,e,n):i?function(r,o){return O(this,null,function*(){let s=yield o(r);return new pn(s)})}(t,i):void Qe(`Parser ${n} is not loaded`)})}function sd(t,e,n){return O(this,null,function*(){let i=new(po.get(n))(t,e);return yield i.read(),i})}var la=t=>GS(t).then(e=>e.arrayBuffer()),co=t=>new Promise((e,n)=>{let i=new FileReader;i.onloadend=()=>e(i.result||new ArrayBuffer),i.onerror=n,i.readAsArrayBuffer(t)}),ad=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 og(t,e,n){let i=new ad;for(let[r,o]of n)i.set(r,o);if(Array.isArray(e))for(let r of e)t.set(r,i);else t.set(e,i);return i}function sg(t,e,n){let i,r=t.get(e);for(i of n)r.set(i[0],i[1])}var ho=new Map,pd=new Map,hd=new Map,Zn=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],ha=["jfif","xmp","icc","iptc","ihdr"],uo=["tiff",...ha],Ae=["ifd0","ifd1","exif","gps","interop"],Jn=[...uo,...Ae],er=["makerNote","userComment"],fa=["translateKeys","translateValues","reviveValues","multiSegment"],tr=[...fa,"sanitize","mergeOutput","silentErrors"],ca=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},un=class extends ca{get needed(){return this.enabled||this.deps.size>0}constructor(e,n,i,r){if(super(),ae(this,"enabled",!1),ae(this,"skip",new Set),ae(this,"pick",new Set),ae(this,"deps",new Set),ae(this,"translateKeys",!1),ae(this,"translateValues",!1),ae(this,"reviveValues",!1),this.key=e,this.enabled=n,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=Ae.includes(e),this.canBeFiltered&&(this.dict=ho.get(e)),i!==void 0)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if(typeof i=="object"){if(this.enabled=!0,this.parse=i.parse!==!1,this.canBeFiltered){let{pick:o,skip:s}=i;o&&o.length>0&&this.translateTagSet(o,this.pick),s&&s.length>0&&this.translateTagSet(s,this.skip)}this.applyInheritables(i)}else i===!0||i===!1?this.parse=this.enabled=i:Qe(`Invalid options argument: ${i}`)}applyInheritables(e){let n,i;for(n of fa)i=e[n],i!==void 0&&(this[n]=i)}translateTagSet(e,n){if(this.dict){let i,r,{tagKeys:o,tagValues:s}=this.dict;for(i of e)typeof i=="string"?(r=s.indexOf(i),r===-1&&(r=o.indexOf(Number(i))),r!==-1&&n.add(Number(o[r]))):n.add(i)}else for(let i of e)n.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,da(this.pick,this.deps)):this.enabled&&this.pick.size>0&&da(this.pick,this.deps)}},ut={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},Qm=new Map,hn=class extends ca{static useCached(e){let n=Qm.get(e);return n!==void 0||(n=new this(e),Qm.set(e,n)),n}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):Qe(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=ao?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Zn)this[e]=ut[e];for(e of tr)this[e]=ut[e];for(e of er)this[e]=ut[e];for(e of Jn)this[e]=new un(e,ut[e],void 0,this)}setupFromTrue(){let e;for(e of Zn)this[e]=ut[e];for(e of tr)this[e]=ut[e];for(e of er)this[e]=!0;for(e of Jn)this[e]=new un(e,!0,void 0,this)}setupFromArray(e){let n;for(n of Zn)this[n]=ut[n];for(n of tr)this[n]=ut[n];for(n of er)this[n]=ut[n];for(n of Jn)this[n]=new un(n,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ae)}setupFromObject(e){let n;for(n of(Ae.ifd0=Ae.ifd0||Ae.image,Ae.ifd1=Ae.ifd1||Ae.thumbnail,Object.assign(this,e),Zn))this[n]=nd(e[n],ut[n]);for(n of tr)this[n]=nd(e[n],ut[n]);for(n of er)this[n]=nd(e[n],ut[n]);for(n of uo)this[n]=new un(n,ut[n],e[n],this);for(n of Ae)this[n]=new un(n,ut[n],e[n],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ae,Jn),e.tiff===!0?this.batchEnableWithBool(Ae,!0):e.tiff===!1?this.batchEnableWithUserValue(Ae,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ae):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ae)}batchEnableWithBool(e,n){for(let i of e)this[i].enabled=n}batchEnableWithUserValue(e,n){for(let i of e){let r=n[i];this[i].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(e,n,i,r=i){if(e&&e.length){for(let s of r)this[s].enabled=!1;let o=Zm(e,i);for(let[s,a]of o)da(this[s].pick,a),this[s].enabled=!0}else if(n&&n.length){let o=Zm(n,i);for(let[s,a]of o)da(this[s].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:n,xmp:i,iptc:r,icc:o}=this;this.makerNote?n.deps.add(37500):n.skip.add(37500),this.userComment?n.deps.add(37510):n.skip.add(37510),i.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),o.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:n,gps:i,interop:r}=this;r.needed&&(n.deps.add(40965),e.deps.add(40965)),n.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=Ae.some(o=>this[o].enabled===!0)||this.makerNote||this.userComment;for(let o of Ae)this[o].finalizeFilters()}get onlyTiff(){return!ha.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of uo)this[e].enabled&&!Ot.has(e)&&rd("segment parser",e)}};function Zm(t,e){let n,i,r,o,s=[];for(r of e){for(o of(n=ho.get(r),i=[],n))(t.includes(o[0])||t.includes(o[1]))&&i.push(o[0]);i.length&&s.push([r,i])}return s}function nd(t,e){return t!==void 0?t:e!==void 0?e:void 0}function da(t,e){for(let n of e)t.add(n)}ae(hn,"default",ut);var ir=class{constructor(e){ae(this,"parsers",{}),ae(this,"output",{}),ae(this,"errors",[]),ae(this,"pushToErrors",n=>this.errors.push(n)),this.options=hn.useCached(e)}read(e){return O(this,null,function*(){this.file=yield function(n,i){return typeof n=="string"?Km(n,i):ao&&!$S&&n instanceof HTMLImageElement?Km(n.src,i):n instanceof Uint8Array||n instanceof ArrayBuffer||n instanceof DataView?new pn(n):ao&&n instanceof Blob?od(n,i,"blob",co):void Qe("Invalid input argument")}(e,this.options)})}setup(){if(this.fileParser)return;let{file:e}=this,n=e.getUint16(0);for(let[i,r]of pa)if(r.canHandle(e,n))return this.fileParser=new r(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),Qe("Unknown file format")}parse(){return O(this,null,function*(){let{output:e,errors:n}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),n.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&n.length>0&&(e.errors=n),rg(i=e)?void 0:i;var i})}executeParsers(){return O(this,null,function*(){let{output:e}=this;yield this.fileParser.parse();let n=Object.values(this.parsers).map(i=>O(this,null,function*(){let r=yield i.parse();i.assignToOutput(e,r)}));this.options.silentErrors&&(n=n.map(i=>i.catch(this.pushToErrors))),yield Promise.all(n)})}extractThumbnail(){return O(this,null,function*(){this.setup();let{options:e,file:n}=this,i=Ot.get("tiff",e);var r;if(n.tiff?r={start:0,type:"tiff"}:n.jpeg&&(r=yield this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let o=yield this.fileParser.ensureSegmentChunk(r),s=this.parsers.tiff=new i(o,e,n),a=yield s.extractThumbnail();return n.close&&n.close(),a})}};function ag(t,e){return O(this,null,function*(){let n=new ir(e);return yield n.read(t),n.parse()})}var XS=Object.freeze({__proto__:null,parse:ag,Exifr:ir,fileParsers:pa,segmentParsers:Ot,fileReaders:po,tagKeys:ho,tagValues:pd,tagRevivers:hd,createDictionary:og,extendDictionary:sg,fetchUrlAsArrayBuffer:la,readBlobAsArrayBuffer:co,chunkedProps:Zn,otherSegments:ha,segments:uo,tiffBlocks:Ae,segmentsAndBlocks:Jn,tiffExtractables:er,inheritables:fa,allFormatters:tr,Options:hn}),Wi=class{static findPosition(e,n){let i=e.getUint16(n+2)+2,r=typeof this.headerLength=="function"?this.headerLength(e,n,i):this.headerLength,o=n+r,s=i-r;return{offset:n,length:i,headerLength:r,start:o,size:s,end:o+s}}static parse(e,n={}){return new this(e,new hn({[this.type]:n}),e).parse()}normalizeInput(e){return e instanceof pn?e:new pn(e)}constructor(e,n={},i){ae(this,"errors",[]),ae(this,"raw",new Map),ae(this,"handleError",r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)}),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,n){let i=hd.get(n),r=pd.get(n),o=ho.get(n),s=this.options[n],a=s.reviveValues&&!!i,l=s.translateValues&&!!r,c=s.translateKeys&&!!o,d={};for(let[p,g]of e)a&&i.has(p)?g=i.get(p)(g):l&&r.has(p)&&(g=this.translateValue(g,r.get(p))),c&&o.has(p)&&(p=o.get(p)||p),d[p]=g;return d}translateValue(e,n){return n[e]||n.DEFAULT||e}assignToOutput(e,n){this.assignObjectToOutput(e,this.constructor.type,n)}assignObjectToOutput(e,n,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[n]?Object.assign(e[n],i):e[n]=i}};ae(Wi,"headerLength",4),ae(Wi,"type",void 0),ae(Wi,"multiSegment",!1),ae(Wi,"canHandle",()=>!1);function YS(t){return t===192||t===194||t===196||t===219||t===221||t===218||t===254}function KS(t){return t>=224&&t<=239}function QS(t,e,n){for(let[i,r]of Ot)if(r.canHandle(t,e,n))return i}var ua=class extends class{constructor(e,n,i){ae(this,"errors",[]),ae(this,"ensureSegmentChunk",r=>O(this,null,function*(){let o=r.start,s=r.size||65536;if(this.file.chunked)if(this.file.available(o,s))r.chunk=this.file.subarray(o,s);else try{r.chunk=yield this.file.readChunk(o,s)}catch(a){Qe(`Couldn't read segment: ${JSON.stringify(r)}. ${a.message}`)}else this.file.byteLength>o+s?r.chunk=this.file.subarray(o,s):r.size===void 0?r.chunk=this.file.subarray(o):Qe("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=n,this.parsers=i}injectSegment(e,n){this.options[e].enabled&&this.createParser(e,n)}createParser(e,n){let i=new(Ot.get(e))(n,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let n of e){let{type:i,chunk:r}=n,o=this.options[i];if(o&&o.enabled){let s=this.parsers[i];s&&s.append||s||this.createParser(i,r)}}}readSegments(e){return O(this,null,function*(){let n=e.map(this.ensureSegmentChunk);yield Promise.all(n)})}}{constructor(...e){super(...e),ae(this,"appSegments",[]),ae(this,"jpegSegments",[]),ae(this,"unknownSegments",[])}static canHandle(e,n){return n===65496}parse(){return O(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Ot.keyList())):(e=e===void 0?Ot.keyList().filter(n=>this.options[n].enabled):e.filter(n=>this.options[n].enabled&&Ot.has(n)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}findAppSegments(e=0,n){return O(this,null,function*(){this.setupSegmentFinderArgs(n);let{file:i,findAll:r,wanted:o,remaining:s}=this;if(!r&&this.file.chunked&&(r=Array.from(o).some(a=>{let l=Ot.get(a),c=this.options[a];return l.multiSegment&&c.multiSegment}),r&&(yield this.file.readWhole())),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let a=!1;for(;s.size>0&&!a&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=i,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(a=e>l&&!c?!(yield i.readNextChunk(e)):!(yield i.readNextChunk(l)),(e=this.findAppSegmentsInRange(e,i.byteLength))===void 0)return}}})}findAppSegmentsInRange(e,n){n-=2;let i,r,o,s,a,l,{file:c,findAll:d,wanted:p,remaining:g,options:h}=this;for(;e<n;e++)if(c.getUint8(e)===255){if(i=c.getUint8(e+1),KS(i)){if(r=c.getUint16(e+2),o=QS(c,e,r),o&&p.has(o)&&(s=Ot.get(o),a=s.findPosition(c,e),l=h[o],a.type=o,this.appSegments.push(a),!d&&(s.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||g.delete(o)):g.delete(o),g.size===0)))break;h.recordUnknownSegments&&(a=Wi.findPosition(c,e),a.marker=i,this.unknownSegments.push(a)),e+=r+1}else if(YS(i)){if(r=c.getUint16(e+2),i===218&&h.stopAfterSos!==!1)return;h.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:i}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(n=>n.multiSegment))return;let e=function(n,i){let r,o,s,a=new Map;for(let l=0;l<n.length;l++)r=n[l],o=r[i],a.has(o)?s=a.get(o):a.set(o,s=[]),s.push(r);return Array.from(a)}(this.appSegments,"type");this.mergedAppSegments=e.map(([n,i])=>{let r=Ot.get(n,this.options);return r.handleMultiSegments?{type:n,chunk:r.handleMultiSegments(i)}:i[0]})}getSegment(e){return this.appSegments.find(n=>n.type===e)}getOrFindSegment(e){return O(this,null,function*(){let n=this.getSegment(e);return n===void 0&&(yield this.findAppSegments(0,[e]),n=this.getSegment(e)),n})}};ae(ua,"type","jpeg"),pa.set("jpeg",ua);var ZS=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],ld=class extends Wi{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,n,i=new Map){let{pick:r,skip:o}=this.options[n];r=new Set(r);let s=r.size>0,a=o.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(s){if(r.has(d)&&(i.set(d,this.parseTag(e,d,n)),r.delete(d),r.size===0))break}else!a&&o.has(d)||i.set(d,this.parseTag(e,d,n));e+=12}return i}parseTag(e,n,i){let{chunk:r}=this,o=r.getUint16(e+2),s=r.getUint32(e+4),a=ZS[o];if(a*s<=4?e+=8:e=r.getUint32(e+8),(o<1||o>13)&&Qe(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${n.toString(16)}, type: ${o}, offset ${e}`),e>r.byteLength&&Qe(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${n.toString(16)}, type: ${o}, offset ${e} is outside of chunk size ${r.byteLength}`),o===1)return r.getUint8Array(e,s);if(o===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=r.getString(e,s)).trim())===""?void 0:l;var l;if(o===7)return r.getUint8Array(e,s);if(s===1)return this.parseTagValue(o,e);{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))(s),d=a;for(let p=0;p<s;p++)c[p]=this.parseTagValue(o,e),e+=d;return c}}parseTagValue(e,n){let{chunk:i}=this;switch(e){case 1:return i.getUint8(n);case 3:return i.getUint16(n);case 4:return i.getUint32(n);case 5:return i.getUint32(n)/i.getUint32(n+4);case 6:return i.getInt8(n);case 8:return i.getInt16(n);case 9:return i.getInt32(n);case 10:return i.getInt32(n)/i.getInt32(n+4);case 11:return i.getFloat(n);case 12:return i.getDouble(n);case 13:return i.getUint32(n);default:Qe(`Invalid tiff type ${e}`)}}},so=class extends ld{static canHandle(e,n){return e.getUint8(n+1)===225&&e.getUint32(n+4)===1165519206&&e.getUint16(n+8)===0}parse(){return O(this,null,function*(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&(yield this.parseIfd0Block()),e.exif.enabled&&(yield this.safeParse("parseExifBlock")),e.gps.enabled&&(yield this.safeParse("parseGpsBlock")),e.interop.enabled&&(yield this.safeParse("parseInteropBlock")),e.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(e){let n=this[e]();return n.catch!==void 0&&(n=n.catch(this.handleError)),n}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),n=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(n)}}parseBlock(e,n){let i=new Map;return this[n]=i,this.parseTags(e,n,i),i}parseIfd0Block(){return O(this,null,function*(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Qe("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&Qe(`IFD0 offset points to outside of file.
|
|
26
|
-
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&(yield e.ensureChunk(this.ifd0Offset,Xm(this.options)));let n=this.parseBlock(this.ifd0Offset,"ifd0");return n.size!==0?(this.exifOffset=n.get(34665),this.interopOffset=n.get(40965),this.gpsOffset=n.get(34853),this.xmp=n.get(700),this.iptc=n.get(33723),this.icc=n.get(34675),this.options.sanitize&&(n.delete(34665),n.delete(40965),n.delete(34853),n.delete(700),n.delete(33723),n.delete(34675)),n):void 0})}parseExifBlock(){return O(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,Xm(this.options)));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e})}unpack(e,n){let i=e.get(n);i&&i.length===1&&e.set(n,i[0])}parseGpsBlock(){return O(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Jm(...e.get(2),e.get(1))),e.set("longitude",Jm(...e.get(4),e.get(3)))),e})}parseInteropBlock(){return O(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(e=!1){return O(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return O(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let e=this.ifd1.get(513),n=this.ifd1.get(514);return this.chunk.getUint8Array(e,n)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,n,i,r={};for(n of Ae)if(e=this[n],!rg(e))if(i=this.canTranslate?this.translateBlock(e,n):Object.fromEntries(e),this.options.mergeOutput){if(n==="ifd1")continue;Object.assign(r,i)}else r[n]=i;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,n){if(this.globalOptions.mergeOutput)Object.assign(e,n);else for(let[i,r]of Object.entries(n))this.assignObjectToOutput(e,i,r)}};function Jm(t,e,n,i){var r=t+e/60+n/3600;return i!=="S"&&i!=="W"||(r*=-1),r}ae(so,"type","tiff"),ae(so,"headerLength",10),Ot.set("tiff",so);var sF=Object.freeze({__proto__:null,default:XS,Exifr:ir,fileParsers:pa,segmentParsers:Ot,fileReaders:po,tagKeys:ho,tagValues:pd,tagRevivers:hd,createDictionary:og,extendDictionary:sg,fetchUrlAsArrayBuffer:la,readBlobAsArrayBuffer:co,chunkedProps:Zn,otherSegments:ha,segments:uo,tiffBlocks:Ae,segmentsAndBlocks:Jn,tiffExtractables:er,inheritables:fa,allFormatters:tr,Options:hn,parse:ag}),fd={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},aF=Object.assign({},fd,{firstChunkSize:4e4,gps:[1,2,3,4]});var lF=Object.assign({},fd,{tiff:!1,ifd1:!0,mergeOutput:!1});var JS=Object.assign({},fd,{firstChunkSize:4e4,ifd0:[274]});function eP(t){return O(this,null,function*(){let e=new ir(JS);yield e.read(t);let n=yield e.parse();if(n&&n.ifd0)return n.ifd0[274]})}var tP=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}}),ro=!0,oo=!0;if(typeof navigator=="object"){let t=navigator.userAgent;if(t.includes("iPad")||t.includes("iPhone")){let e=t.match(/OS (\d+)_(\d+)/);if(e){let[,n,i]=e;ro=Number(n)+.1*Number(i)<13.4,oo=!1}}else if(t.includes("OS X 10")){let[,e]=t.match(/OS X 10[_.](\d+)/);ro=oo=Number(e)<15}if(t.includes("Chrome/")){let[,e]=t.match(/Chrome\/(\d+)/);ro=oo=Number(e)<81}else if(t.includes("Firefox/")){let[,e]=t.match(/Firefox\/(\d+)/);ro=oo=Number(e)<77}}function lg(t){return O(this,null,function*(){let e=yield eP(t);return Object.assign({canvas:ro,css:oo},tP[e])})}var cd=class extends pn{constructor(...e){super(...e),ae(this,"ranges",new dd),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,n,i){if(e===0&&this.byteLength===0&&i){let r=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(r)}else{let r=e+n;if(r>this.byteLength){let{dataView:o}=this._extend(r);this._swapDataView(o)}}}_extend(e){let n;n=ng?ig.allocUnsafe(e):new Uint8Array(e);let i=new DataView(n.buffer,n.byteOffset,n.byteLength);return n.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:n,dataView:i}}subarray(e,n,i=!1){return n=n||this._lengthToEnd(e),i&&this._tryExtend(e,n),this.ranges.add(e,n),super.subarray(e,n)}set(e,n,i=!1){i&&this._tryExtend(n,e.byteLength,e);let r=super.set(e,n);return this.ranges.add(n,r.byteLength),r}ensureChunk(e,n){return O(this,null,function*(){this.chunked&&(this.ranges.available(e,n)||(yield this.readChunk(e,n)))})}available(e,n){return this.ranges.available(e,n)}},dd=class{constructor(){ae(this,"list",[])}get length(){return this.list.length}add(e,n,i=0){let r=e+n,o=this.list.filter(s=>eg(e,s.offset,r)||eg(e,s.end,r));if(o.length>0){e=Math.min(e,...o.map(a=>a.offset)),r=Math.max(r,...o.map(a=>a.end)),n=r-e;let s=o.shift();s.offset=e,s.length=n,s.end=r,this.list=this.list.filter(a=>!o.includes(a))}else this.list.push({offset:e,length:n,end:r})}available(e,n){let i=e+n;return this.list.some(r=>r.offset<=e&&i<=r.end)}};function eg(t,e,n){return t<=e&&e<=n}var ud=class extends cd{constructor(e,n){super(0),ae(this,"chunksRead",0),this.input=e,this.options=n}readWhole(){return O(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return O(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return O(this,arguments,function*(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let n=this.options.chunkSize,i=yield this.readChunk(e,n);return!!i&&i.byteLength===n})}readChunk(e,n){return O(this,null,function*(){if(this.chunksRead++,(n=this.safeWrapAddress(e,n))!==0)return this._readChunk(e,n)})}safeWrapAddress(e,n){return this.size!==void 0&&e+n>this.size?Math.max(0,this.size-e):n}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(){}};po.set("blob",class extends ud{readWhole(){return O(this,null,function*(){this.chunked=!1;let t=yield co(this.input);this._swapArrayBuffer(t)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(t,e){return O(this,null,function*(){let n=e?t+e:void 0,i=this.input.slice(t,n),r=yield co(i);return this.set(r,t,!0)})}});var cg={strings:{generatingThumbnails:"Generating thumbnails..."}};var iP={version:"4.0.0"};function nP(t,e,n){try{t.getContext("2d").getImageData(0,0,1,1)}catch(i){if(i.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return t.toBlob?new Promise(i=>{t.toBlob(i,e,n)}).then(i=>{if(i===null)throw new Error("cannot read image, probably an svg with external resources");return i}):Promise.resolve().then(()=>qm(t.toDataURL(e,n),{})).then(i=>{if(i===null)throw new Error("could not extract blob, probably an old browser");return i})}function rP(t,e){let n=t.width,i=t.height;(e.deg===90||e.deg===270)&&(n=t.height,i=t.width);let r=document.createElement("canvas");r.width=n,r.height=i;let o=r.getContext("2d");return o.translate(n/2,i/2),e.canvas&&(o.rotate(e.rad),o.scale(e.scaleX,e.scaleY)),o.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),r}function oP(t){let e=t.width/t.height,n=5e6,i=4096,r=Math.floor(Math.sqrt(n*e)),o=Math.floor(n/Math.sqrt(n*e));if(r>i&&(r=i,o=Math.round(r/e)),o>i&&(o=i,r=Math.round(e*o)),t.width>r){let s=document.createElement("canvas");return s.width=r,s.height=o,s.getContext("2d").drawImage(t,0,0,r,o),s}return t}var sP={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},nr=class extends kt{constructor(e,n){if(super(e,b(b({},sP),n)),this.onFileAdded=i=>{!i.preview&&i.data&&aa(i.type)&&!i.isRemote&&this.addToQueue(i.id)},this.onCancelRequest=i=>{let r=this.queue.indexOf(i.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=i=>{let r=this.queue.indexOf(i.id);r!==-1&&this.queue.splice(r,1),i.preview&&sa(i.preview)&&URL.revokeObjectURL(i.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||sa(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=i=>{i.forEach(o=>{let s=this.uppy.getFile(o);this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let r=()=>{i.forEach(o=>{let s=this.uppy.getFile(o);this.uppy.emit("preprocess-complete",s)})};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=cg,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(e,n,i){let r=URL.createObjectURL(e.data),o=new Promise((a,l)=>{let c=new Image;c.src=r,c.addEventListener("load",()=>{URL.revokeObjectURL(r),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(r),l(d.error||new Error("Could not create thumbnail"))})}),s=lg(e.data).catch(()=>1);return Promise.all([o,s]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,n,i,c.deg),p=rP(l,c),g=this.resizeImage(p,d.width,d.height);return nP(g,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,n,i,r){let o=e.width/e.height;return(r===90||r===270)&&(o=e.height/e.width),n!=null?{width:n,height:Math.round(n/o)}:i!=null?{width:Math.round(i*o),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}}resizeImage(e,n,i){let r=oP(e),o=Math.ceil(Math.log2(r.width/n));o<1&&(o=1);let s=n*2**(o-1),a=i*2**(o-1),l=2;for(;o--;){let c=document.createElement("canvas");c.width=s,c.height=a,c.getContext("2d").drawImage(r,0,0,s,a),r=c,s=Math.round(s/l),a=Math.round(a/l)}return r}setPreviewURL(e,n){this.uppy.setFileState(e,{preview:n})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).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(e){return aa(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(n=>{this.setPreviewURL(e.id,n),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),n)}).catch(n=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(n,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),n)}):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)}};nr.VERSION=iP.version;function aP(t){if(typeof t=="string"){let e=document.querySelectorAll(t);return e.length===0?null:Array.from(e)}return typeof t=="object"&&Jr(t)?[t]:null}var md=aP;var ui=Array.from;function ma(t,e,n,i){let{onSuccess:r}=i;t.readEntries(o=>{let s=[...e,...o];o.length?queueMicrotask(()=>{ma(t,s,n,{onSuccess:r})}):r(s)},o=>{n(o),r(e)})}function dg(t,e){return t==null?t:{kind:t.isFile?"file":t.isDirectory?"directory":void 0,name:t.name,getFile(){return new Promise((i,r)=>t.file(i,r))},values(){return Ao(this,null,function*(){let i=t.createReader(),r=yield new Pn(new Promise(o=>{ma(i,[],e,{onSuccess:s=>o(s.map(a=>dg(a,e)))})}));yield*No(r)})},isSameEntry:void 0}}function ug(t,e,n){try{return n===void 0&&(n=void 0),function(){return Ao(this,null,function*(){let i=()=>`${e}/${t.name}`;if(t.kind==="file"){let l=yield new Pn(t.getFile());l!=null?(l.relativePath=e?i():null,yield l):n!=null&&(yield n)}else if(t.kind==="directory")try{for(var r=zo(t.values()),o,s,a;o=!(s=yield new Pn(r.next())).done;o=!1){let l=s.value;yield*No(ug(l,e?i():t.name))}}catch{a=[s]}finally{try{o&&(s=r.return)&&(yield new Pn(s.call(r)))}finally{if(a)throw a[0]}}else n!=null&&(yield n)})}()}catch(i){return Promise.reject(i)}}function gd(t,e){return Ao(this,null,function*(){let n=yield new Pn(Promise.all(Array.from(t.items,i=>O(this,null,function*(){var r;let o,s=()=>typeof i.getAsEntry=="function"?i.getAsEntry():i.webkitGetAsEntry();return(r=o)!=null||(o=dg(s(),e)),{fileSystemHandle:o,lastResortFile:i.getAsFile()}}))));for(let{lastResortFile:i,fileSystemHandle:r}of n)if(r!=null)try{yield*No(ug(r,"",i))}catch(o){i!=null?yield i:e(o)}else i!=null&&(yield i)})}function yd(t){let e=ui(t.files);return Promise.resolve(e)}function fo(t,e){return O(this,null,function*(){var n;let i=(n=e?.logDropError)!=null?n:Function.prototype;try{let l=[];try{for(var r=zo(gd(t,i)),o,s,a;o=!(s=yield r.next()).done;o=!1){let c=s.value;l.push(c)}}catch{a=[s]}finally{try{o&&(s=r.return)&&(yield s.call(r))}finally{if(a)throw a[0]}}return l}catch{return yd(t)}})}var Vg=me(dt(),1);function mo(t){return E(b({},t),{type:t.mimeType,extension:t.name?nn(t.name).extension:null})}var go,Fe,vd,pg,yo=0,_g=[],Ne=_e,hg=Ne.__b,fg=Ne.__r,mg=Ne.diffed,gg=Ne.__c,yg=Ne.unmount,vg=Ne.__;function _d(t,e){Ne.__h&&Ne.__h(Fe,t,yo||e),yo=0;var n=Fe.__H||(Fe.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function pi(t){return yo=1,lP(xg,t)}function lP(t,e,n){var i=_d(go++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):xg(void 0,e),function(a){var l=i.__N?i.__N[0]:i.__[0],c=i.t(l,a);l!==c&&(i.__N=[c,i.__[1]],i.__c.setState({}))}],i.__c=Fe,!Fe.u)){var r=function(a,l,c){if(!i.__c.__H)return!0;var d=i.__c.__H.__.filter(function(g){return!!g.__c});if(d.every(function(g){return!g.__N}))return!o||o.call(this,a,l,c);var p=!1;return d.forEach(function(g){if(g.__N){var h=g.__[0];g.__=g.__N,g.__N=void 0,h!==g.__[0]&&(p=!0)}}),!(!p&&i.__c.props===a)&&(!o||o.call(this,a,l,c))};Fe.u=!0;var o=Fe.shouldComponentUpdate,s=Fe.componentWillUpdate;Fe.componentWillUpdate=function(a,l,c){if(this.__e){var d=o;o=void 0,r(a,l,c),o=d}s&&s.call(this,a,l,c)},Fe.shouldComponentUpdate=r}return i.__N||i.__}function Ei(t,e){var n=_d(go++,3);!Ne.__s&&wg(n.__H,e)&&(n.__=t,n.i=e,Fe.__H.__h.push(n))}function rr(t){return yo=5,fn(function(){return{current:t}},[])}function fn(t,e){var n=_d(go++,7);return wg(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function or(t,e){return yo=8,fn(function(){return t},e)}function cP(){for(var t;t=_g.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ga),t.__H.__h.forEach(bd),t.__H.__h=[]}catch(e){t.__H.__h=[],Ne.__e(e,t.__v)}}Ne.__b=function(t){Fe=null,hg&&hg(t)},Ne.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),vg&&vg(t,e)},Ne.__r=function(t){fg&&fg(t),go=0;var e=(Fe=t.__c).__H;e&&(vd===Fe?(e.__h=[],Fe.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(ga),e.__h.forEach(bd),e.__h=[],go=0)),vd=Fe},Ne.diffed=function(t){mg&&mg(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(_g.push(e)!==1&&pg===Ne.requestAnimationFrame||((pg=Ne.requestAnimationFrame)||dP)(cP)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),vd=Fe=null},Ne.__c=function(t,e){e.some(function(n){try{n.__h.forEach(ga),n.__h=n.__h.filter(function(i){return!i.__||bd(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Ne.__e(i,n.__v)}}),gg&&gg(t,e)},Ne.unmount=function(t){yg&&yg(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{ga(i)}catch(r){e=r}}),n.__H=void 0,e&&Ne.__e(e,n.__v))};var bg=typeof requestAnimationFrame=="function";function dP(t){var e,n=function(){clearTimeout(i),bg&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);bg&&(e=requestAnimationFrame(n))}function ga(t){var e=Fe,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Fe=e}function bd(t){var e=Fe;t.__c=t.__(),Fe=e}function wg(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function xg(t,e){return typeof e=="function"?e(t):e}function uP(){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 pP(t){let{pluginName:e,i18n:n,onAuth:i}=t,r=e==="Google Drive",o=or(s=>{s.preventDefault(),i()},[i]);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(uP,null),n("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},n("authenticateWith",{pluginName:e})))}var hP=t=>{let{pluginName:e,i18n:n,onAuth:i}=t;return u(pP,{pluginName:e,i18n:n,onAuth:i})};function wd(t){let{loading:e,pluginName:n,pluginIcon:i,i18n:r,handleAuth:o,renderForm:s=hP}=t;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},i()),u("div",{className:"uppy-Provider-authTitle"},r("authenticateWithTitle",{pluginName:n})),u("div",{className:"uppy-Provider-authForm"},s({pluginName:n,i18n:r,loading:e,onAuth:o})))}var Cg=me(dt(),1);function xd(t){let{i18n:e,logout:n,username:i}=t;return u($t,null,i&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},i),u("button",{type:"button",onClick:n,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Cd(t){let{openFolder:e,title:n,breadcrumbsIcon:i,breadcrumbs:r,i18n:o}=t;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},i),r.map((s,a)=>{var l;return u($t,null,u("button",{key:s.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(s.id)},s.type==="root"?n:(l=s.data.name)!=null?l:o("unnamed")),r.length===a+1?"":" / ")}))}function Sd(t){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,Cg.default)("uppy-ProviderBrowser-headerBar",!t.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},t.showBreadcrumbs&&u(Cd,{openFolder:t.openFolder,breadcrumbs:t.breadcrumbs,breadcrumbsIcon:t.pluginIcon&&t.pluginIcon(),title:t.title,i18n:t.i18n}),u(xd,{logout:t.logout,username:t.username,i18n:t.i18n})))}function Pd(){return Pd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Pd.apply(null,arguments)}var fP={position:"relative",width:"100%",minHeight:"100%"},mP={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Ed=class extends _t{constructor(e){super(e),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:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let C=e,{data:n,rowHeight:i,renderRow:r,overscanCount:o=10}=C,s=Sn(C,["data","rowHeight","renderRow","overscanCount"]),{offset:a,height:l}=this.state,c=Math.floor(a/i),d=Math.floor(l/i);o&&(c=Math.max(0,c-c%o),d+=o);let p=c+d+4,g=n.slice(c,p),h=E(b({},fP),{height:n.length*i}),v=E(b({},mP),{top:c*i});return u("div",Pd({onScroll:this.handleScroll},s),u("div",{role:"presentation",style:h},u("div",{role:"presentation",style:v},g.map(r))))}},ya=Ed;var Sg=me(dt(),1);function gP(){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 yP(){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 vP(){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 sr(t){let{itemIconString:e,alt:n=void 0}=t;if(e===null)return null;switch(e){case"file":return u(gP,null);case"folder":return u(yP,null);case"video":return u(vP,null);default:return u("img",{src:e,alt:n,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function bP(t){var e,n;let{file:i,toggleCheckbox:r,className:o,isDisabled:s,restrictionError:a,showTitles:l,children:c=null,i18n:d}=t;return u("li",{className:o,title:s&&a?a:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:r,name:"listitem",id:i.id,checked:i.status==="checked",disabled:s,"data-uppy-super-focusable":!0}),u("label",{htmlFor:i.id,"aria-label":(e=i.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(sr,{itemIconString:i.data.thumbnail||i.data.icon}),l&&((n=i.data.name)!=null?n:d("unnamed")),c))}var Dd=bP;function kd(t){var e,n,i;let{file:r,openFolder:o,className:s,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:p}=t;return u("li",{className:s,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:(e=r.data.name)!=null?e:p("unnamed")}):null,disabled:a,"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:(n=r.data.name)!=null?n:p("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(sr,{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(sr,{itemIconString:r.data.icon})),d&&((i=r.data.name)!=null?i:p("unnamed"))))}function Td(t){let{viewType:e,toggleCheckbox:n,showTitles:i,i18n:r,openFolder:o,file:s}=t,a=s.type==="folder"?null:s.restrictionError,l=!!a&&s.status!=="checked",c={file:s,openFolder:o,toggleCheckbox:n,i18n:r,viewType:e,showTitles:i,className:(0,Sg.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":l},{"uppy-ProviderBrowserItem--noPreview":s.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":s.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":s.status==="partial"}),isDisabled:l,restrictionError:a};switch(e){case"grid":return u(Dd,c);case"list":return u(kd,c);case"unsplash":return u(Dd,c,u("a",{href:`${s.data.author.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},s.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function _P(t){let{displayedPartialTree:e,viewType:n,toggleCheckbox:i,handleScroll:r,showTitles:o,i18n:s,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d}=t,[p,g]=pi(!1);if(Ei(()=>{let v=R=>{R.key==="Shift"&&g(!1)},C=R=>{R.key==="Shift"&&g(!0)};return document.addEventListener("keyup",v),document.addEventListener("keydown",C),()=>{document.removeEventListener("keyup",v),document.removeEventListener("keydown",C)}},[]),a)return u("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:s("loading"));if(e.length===0)return u("div",{className:"uppy-Provider-empty"},c);let h=v=>u(Td,{viewType:n,toggleCheckbox:C=>{var R;C.stopPropagation(),C.preventDefault(),(R=document.getSelection())==null||R.removeAllRanges(),i(v,p)},showTitles:o,i18n:s,openFolder:l,file:v});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(ya,{data:e,renderRow:h,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,role:"listbox",tabIndex:-1},e.map(h)))}var va=_P;var wP=(t,e,n,i,r)=>{let o=e.filter(h=>h.isFolder===!0),s=e.filter(h=>h.isFolder===!1),a=n.type==="folder"&&n.status==="checked",l=o.map(h=>({type:"folder",id:h.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:n.id,data:h})),c=s.map(h=>{let v=r(h);return{type:"file",id:h.requestPath,restrictionError:v,status:a&&!v?"checked":"unchecked",parentId:n.id,data:h}}),d=E(b({},n),{cached:!0,nextPagePath:i});return[...t.map(h=>h.id===d.id?d:h),...l,...c]},Pg=wP;var xP=(t,e,n,i,r)=>{let o=t.find(v=>v.id===e),s=n.filter(v=>v.isFolder===!0),a=n.filter(v=>v.isFolder===!1),l=E(b({},o),{nextPagePath:i}),c=t.map(v=>v.id===l.id?l:v),d=l.type==="folder"&&l.status==="checked",p=s.map(v=>({type:"folder",id:v.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:v})),g=a.map(v=>{let C=r(v);return{type:"file",id:v.requestPath,restrictionError:C,status:d&&!C?"checked":"unchecked",parentId:l.id,data:v}});return[...c,...p,...g]},Eg=xP;var CP=t=>t.map(e=>b({},e)),ba=CP;var Id=(t,e,n)=>{t.filter(r=>r.type!=="root"&&r.parentId===e).forEach(r=>{r.status=n&&!(r.type==="file"&&r.restrictionError)?"checked":"unchecked",Id(t,r.id,n)})},Od=(t,e)=>{let n=t.find(s=>s.id===e);if(n.type==="root")return;let i=t.filter(s=>s.type!=="root"&&s.parentId===n.id&&!(s.type==="file"&&s.restrictionError)),r=i.every(s=>s.status==="checked"),o=i.every(s=>s.status==="unchecked");r?n.status="checked":o?n.status="unchecked":n.status="partial",Od(t,n.parentId)},SP=(t,e)=>{let n=ba(t);if(e.length>=2){let i=n.filter(r=>r.type!=="root"&&e.includes(r.id));i.forEach(r=>{r.type==="file"?r.status=r.restrictionError?"unchecked":"checked":r.status="checked"}),i.forEach(r=>{Id(n,r.id,!0)}),Od(n,i[0].parentId)}else{let i=n.find(r=>r.id===e[0]);i.status=i.status==="checked"?"unchecked":"checked",Id(n,i.id,i.status==="checked"),Od(n,i.parentId)}return n},Dg=SP;var Rd=me(Tg(),1);var bo=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Md=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Ig=t=>globalThis.DOMException===void 0?new Md(t):new DOMException(t),Og=t=>{let e=t.reason===void 0?Ig("This operation was aborted."):t.reason;return e instanceof Error?e:Ig(e)};function Bd(t,e){let{milliseconds:n,fallback:i,message:r,customTimers:o={setTimeout,clearTimeout}}=e,s,l=new Promise((c,d)=>{if(typeof n!="number"||Math.sign(n)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(e.signal){let{signal:g}=e;g.aborted&&d(Og(g)),g.addEventListener("abort",()=>{d(Og(g))})}if(n===Number.POSITIVE_INFINITY){t.then(c,d);return}let p=new bo;s=o.setTimeout.call(void 0,()=>{if(i){try{c(i())}catch(g){d(g)}return}typeof t.cancel=="function"&&t.cancel(),r===!1?c():r instanceof Error?d(r):(p.message=r??`Promise timed out after ${n} milliseconds`,d(p))},n),O(this,null,function*(){try{c(yield t)}catch(g){d(g)}})}).finally(()=>{l.clear()});return l.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},l}function Ad(t,e,n){let i=0,r=t.length;for(;r>0;){let o=Math.trunc(r/2),s=i+o;n(t[s],e)<=0?(i=++s,r-=o+1):r=o}return i}var wa=class{#e=[];enqueue(e,n){n=b({priority:0},n);let i={priority:n.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=n.priority){this.#e.push(i);return}let r=Ad(this.#e,i,(o,s)=>s.priority-o.priority);this.#e.splice(r,0,i)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(n=>n.priority===e.priority).map(n=>n.run)}get size(){return this.#e.length}};var xa=class extends Rd.default{#e;#s;#o=0;#h;#a;#f=0;#i;#l;#t;#m;#n=0;#c;#r;#g;timeout;constructor(e){if(super(),e=b({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:wa},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#s=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#h=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#r=e.autoStart===!1}get#b(){return this.#s||this.#o<this.#h}get#_(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#x(){this.#v(),this.#y(),this.#l=void 0}get#C(){let e=Date.now();if(this.#i===void 0){let n=this.#f-e;if(n<0)this.#o=this.#e?this.#n:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#x()},n)),!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 e=!this.#C;if(this.#b&&this.#_){let n=this.#t.dequeue();return n?(this.emit("active"),n(),e&&this.#y(),!0):!1}}return!1}#y(){this.#s||this.#i!==void 0||(this.#i=setInterval(()=>{this.#v()},this.#a),this.#f=Date.now()+this.#a)}#v(){this.#o===0&&this.#n===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#o=this.#e?this.#n:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#u()}#S(e){return O(this,null,function*(){return new Promise((n,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})})}add(i){return O(this,arguments,function*(e,n={}){return n=b({timeout:this.timeout,throwOnTimeout:this.#g},n),new Promise((r,o)=>{this.#t.enqueue(()=>O(this,null,function*(){this.#n++,this.#o++;try{n.signal?.throwIfAborted();let s=e({signal:n.signal});n.timeout&&(s=Bd(Promise.resolve(s),{milliseconds:n.timeout})),n.signal&&(s=Promise.race([s,this.#S(n.signal)]));let a=yield s;r(a),this.emit("completed",a)}catch(s){if(s instanceof bo&&!n.throwOnTimeout){r();return}o(s),this.emit("error",s)}finally{this.#w()}}),n),this.emit("add"),this.#d()})})}addAll(e,n){return O(this,null,function*(){return Promise.all(e.map(i=>O(this,null,function*(){return this.add(i,n)})))})}start(){return this.#r?(this.#r=!1,this.#u(),this):this}pause(){this.#r=!0}clear(){this.#t=new this.#m}onEmpty(){return O(this,null,function*(){this.#t.size!==0&&(yield this.#p("empty"))})}onSizeLessThan(e){return O(this,null,function*(){this.#t.size<e||(yield this.#p("next",()=>this.#t.size<e))})}onIdle(){return O(this,null,function*(){this.#n===0&&this.#t.size===0||(yield this.#p("idle"))})}#p(e,n){return O(this,null,function*(){return new Promise(i=>{let r=()=>{n&&!n()||(this.off(e,r),i())};this.on(e,r)})})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#r}};var Fg=(t,e,n,i,r)=>O(void 0,null,function*(){let o=[],s=n.cached?n.nextPagePath:n.id;for(;s;){let p=yield i(s);o=o.concat(p.items),s=p.nextPagePath}let a=o.filter(p=>p.isFolder===!0),l=o.filter(p=>p.isFolder===!1),c=a.map(p=>({type:"folder",id:p.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:n.id,data:p})),d=l.map(p=>{let g=r(p);return{type:"file",id:p.requestPath,restrictionError:g,status:g?"unchecked":"checked",parentId:n.id,data:p}});n.cached=!0,n.nextPagePath=null,e.push(...d,...c),c.forEach(p=>O(void 0,null,function*(){t.add(()=>Fg(t,e,p,i,r))}))}),DP=(t,e,n,i)=>O(void 0,null,function*(){let r=new xa({concurrency:6}),o=ba(t);return o.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{r.add(()=>Fg(r,o,a,e,n))}),r.on("completed",()=>{let a=o.filter(l=>l.type==="file"&&l.status==="checked").length;i(a)}),yield r.onIdle(),o}),Rg=DP;var mn={afterOpenFolder:Pg,afterScrollFolder:Eg,afterToggleCheckbox:Dg,afterFill:Rg};var kP=t=>{let{scrollHeight:e,scrollTop:n,offsetHeight:i}=t.target;return e-(n+i)<50},Ca=kP;var TP=t=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){t.log("Aborting request","warning");return}t.log(e,"error"),e.name==="UserFacingApiError"&&t.info({message:t.i18n("companionError"),details:t.i18n(e.message)},"warning",5e3)}},Di=TP;var IP=(t,e,n,i)=>{let r=e.findIndex(o=>o.id===i);if(r!==-1&&n){let o=e.findIndex(a=>a.id===t);return e.slice(Math.min(r,o),Math.max(r,o)+1).map(a=>a.id)}return[t]},Sa=IP;var OP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Mg=(t=21)=>{let e="",n=t;for(;n--;)e+=OP[Math.random()*64|0];return e};function FP(t){let{searchString:e,setSearchString:n,submitSearchString:i,wrapperClassName:r,inputClassName:o,inputLabel:s,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=t,p=v=>{n(v.target.value)},g=or(v=>{v.preventDefault(),i()},[i]),[h]=pi(()=>{let v=document.createElement("form");return v.setAttribute("tabindex","-1"),v.id=Mg(),v});return Ei(()=>(document.body.appendChild(h),h.addEventListener("submit",g),()=>{h.removeEventListener("submit",g),document.body.removeChild(h)}),[h,g]),u("section",{className:r},u("input",{className:`uppy-u-reset ${o}`,type:"search","aria-label":s,placeholder:s,value:e,onInput:p,form:h.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&&e&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>n("")},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:h.id},c))}var _o=FP;var Ag=me(dt(),1);var RP=t=>t.filter(n=>n.type==="file"&&n.status==="checked"?!0:n.type==="folder"&&n.status==="checked"?!t.some(r=>r.type!=="root"&&r.parentId===n.id):!1).length,Bg=RP;function wo(t){let{cancelSelection:e,donePicking:n,i18n:i,partialTree:r,validateAggregateRestrictions:o}=t,s=fn(()=>o(r),[r,o]),a=fn(()=>Bg(r),[r]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,Ag.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":s}),disabled:!!s,onClick:n,type:"button"},i("selectX",{smart_count:a})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},i("cancel"))),s&&u("div",{className:"uppy-ProviderBrowser-footer-error"},s))}var MP=(t,e,n)=>{var i,r;return{id:t.id,source:e.id,name:t.name||t.id,type:t.mimeType,isRemote:!0,data:t,preview:t.thumbnail||void 0,meta:{authorName:(i=t.author)==null?void 0:i.name,authorUrl:(r=t.author)==null?void 0:r.url,relativePath:t.relDirPath||null,absolutePath:t.absDirPath},body:{fileId:t.id},remote:{companionUrl:e.opts.companionUrl,url:`${n.fileUrl(t.requestPath)}`,body:{fileId:t.id},providerName:n.name,provider:n.provider,requestClientId:n.provider}}},Ng=MP;var BP=(t,e,n)=>{let i=t.map(s=>Ng(s,e,n)),r=[],o=[];i.forEach(s=>{e.uppy.checkIfFileAlreadyExists(Ws(s,e.uppy.getID()))?o.push(s):r.push(s)}),r.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:r.length})),o.length>0&&e.uppy.info(`Not adding ${o.length} files because they already exist`),e.uppy.addFiles(r)},Pa=BP;var zg=(t,e,n)=>{let i=e===null?"null":e;if(n[i])return n[i];let r=t.find(s=>s.id===e);if(r.type==="root")return[];let o=[...zg(t,r.parentId,n),r];return n[i]=o,o},AP=t=>{let e=Object.create(null);return t.filter(r=>r.type==="file"&&r.status==="checked").map(r=>{let o=zg(t,r.id,e),s=o.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=o.slice(s),l=`/${o.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return E(b({},r.data),{absDirPath:l,relDirPath:c})})},Ea=AP;var NP=(t,e)=>{let n=t.find(r=>r.id===e),i=[];for(;i=[n,...i],n.type!=="root";){let r=n.parentId;n=t.find(o=>o.id===r)}return i},Lg=NP;function $i(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var zP=0;function jg(t){return"__private_"+zP+++"_"+t}var LP={version:"4.0.1"};function Co(){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 Hg=t=>({authenticated:void 0,partialTree:[{type:"root",id:t,cached:!1,nextPagePath:null}],currentFolderId:t,searchString:"",didFirstRender:!1,username:null,loading:!1}),gn=jg("abortController"),Zt=jg("withAbort"),xo=class{constructor(e,n){Object.defineProperty(this,Zt,{value:HP}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,gn,{writable:!0,value:void 0}),this.validateSingleFile=r=>{let o=mo(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r,currentFolderId:o,searchString:s}=this.plugin.getPluginState(),a=r.filter(c=>c.type!=="root"&&c.parentId===o);return s===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(s.toLowerCase())!==-1})},this.validateAggregateRestrictions=r=>{let s=r.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(s)},this.plugin=e,this.provider=n.provider;let i={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=b(b({},i),n),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(Hg(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),n=e.map(i=>i.type==="root"?i:E(b({},i),{status:"unchecked"}));this.plugin.setPluginState({partialTree:n})}openFolder(e){return O(this,null,function*(){this.lastCheckbox=null;let{partialTree:n}=this.plugin.getPluginState(),i=n.find(r=>r.id===e);if(i.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),yield $i(this,Zt)[Zt](r=>O(this,null,function*(){let o=e,s=[];do{let{username:l,nextPagePath:c,items:d}=yield this.provider.list(o,{signal:r});this.plugin.setPluginState({username:l}),o=c,s=s.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:s.length}))}while(this.opts.loadAllFiles&&o);let a=mn.afterOpenFolder(n,s,i,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})})).catch(Di(this.plugin.uppy)),this.setLoading(!1)})}logout(){return O(this,null,function*(){yield $i(this,Zt)[Zt](e=>O(this,null,function*(){let n=yield this.provider.logout({signal:e});if(n.ok){if(!n.revoked){let i=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:n.manual_revoke_url});this.plugin.uppy.info(i,"info",7e3)}this.plugin.setPluginState(E(b({},Hg(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(Di(this.plugin.uppy))})}handleAuth(e){return O(this,null,function*(){yield $i(this,Zt)[Zt](n=>O(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:e,signal:n}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(Di(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(e){return O(this,null,function*(){let{partialTree:n,currentFolderId:i}=this.plugin.getPluginState(),r=n.find(o=>o.id===i);Ca(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,yield $i(this,Zt)[Zt](o=>O(this,null,function*(){let{nextPagePath:s,items:a}=yield this.provider.list(r.nextPagePath,{signal:o}),l=mn.afterScrollFolder(n,i,a,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(Di(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return O(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),yield $i(this,Zt)[Zt](n=>O(this,null,function*(){let i=yield mn.afterFill(e,s=>this.provider.list(s,{signal:n}),this.validateSingleFile,s=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:s}))});if(this.validateAggregateRestrictions(i)){this.plugin.setPluginState({partialTree:i});return}let o=Ea(i);Pa(o,this.plugin,this.provider),this.resetPluginState()})).catch(Di(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(e,n){let{partialTree:i}=this.plugin.getPluginState(),r=Sa(e.id,this.getDisplayedPartialTree(),n,this.lastCheckbox),o=mn.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,n){n===void 0&&(n={});let{didFirstRender:i}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let o=b(b({},this.opts),n),{authenticated:s,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||Co;if(s===!1)return u(wd,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:o.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:p,searchString:g}=this.plugin.getPluginState(),h=Lg(c,d);return u("div",{className:(0,Vg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`)},u(Sd,{showBreadcrumbs:o.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:h,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:p,i18n:r}),o.showFilter&&u(_o,{searchString:g,setSearchString:v=>{this.plugin.setPluginState({searchString:v})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(va,{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:a}),u(wo,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function HP(t){return O(this,null,function*(){var e;(e=$i(this,gn)[gn])==null||e.abort();let n=new AbortController;$i(this,gn)[gn]=n;let i=()=>{n.abort()};try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),yield t(n.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),$i(this,gn)[gn]=void 0}})}xo.VERSION=LP.version;var Ug=me(dt(),1);var jP={version:"4.0.1"},VP={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},ar=class{constructor(e,n){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let o=mo(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r}=this.plugin.getPluginState();return r.filter(o=>o.type!=="root")},this.setSearchString=r=>{this.plugin.setPluginState({searchString:r}),r===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=r=>{let s=r.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(s)},this.plugin=e,this.provider=n.provider;let i={viewType:"grid",showTitles:!0,showFilter:!0};this.opts=b(b({},i),n),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(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(VP)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),n=e.map(i=>i.type==="root"?i:E(b({},i),{status:"unchecked"}));this.plugin.setPluginState({partialTree:n})}search(){return O(this,null,function*(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let n=yield this.provider.search(e),i=[{type:"root",id:null,cached:!1,nextPagePath:n.nextPageQuery},...n.items.map(r=>({type:"file",id:r.requestPath,status:"unchecked",parentId:null,data:r}))];this.plugin.setPluginState({partialTree:i,isInputMode:!1})}catch(n){Di(this.plugin.uppy)(n)}this.setLoading(!1)}})}handleScroll(e){return O(this,null,function*(){let{partialTree:n,searchString:i}=this.plugin.getPluginState(),r=n.find(o=>o.type==="root");if(Ca(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let o=yield this.provider.search(i,r.nextPagePath),s=E(b({},r),{nextPagePath:o.nextPageQuery}),a=n.filter(c=>c.type!=="root"),l=[s,...a,...o.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(o){Di(this.plugin.uppy)(o)}this.isHandlingScroll=!1}})}donePicking(){return O(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState(),n=Ea(e);Pa(n,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,n){let{partialTree:i}=this.plugin.getPluginState(),r=Sa(e.id,this.getDisplayedPartialTree(),n,this.lastCheckbox),o=mn.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,n){n===void 0&&(n={});let{isInputMode:i,searchString:r,loading:o,partialTree:s}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l=b(b({},this.opts),n);return i?u(_o,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,Ug.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(_o,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(va,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>O(this,null,function*(){}),noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:o,i18n:a,virtualList:!1}),u(wo,{partialTree:s,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};ar.VERSION=jP.version;var UP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Da=(t=21)=>{let e="",n=t;for(;n--;)e+=UP[Math.random()*64|0];return e};var Wg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function WP(t,e){return!!(t===e||Wg(t)&&Wg(e))}function $P(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!WP(t[n],e[n]))return!1;return!0}function Nd(t,e){e===void 0&&(e=$P);var n=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&e(r,n.lastArgs))return n.lastResult;var s=t.apply(this,r);return n={lastResult:s,lastArgs:r,lastThis:this},s}return i.clear=function(){n=null},i}var ka=['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 So(t,e){if(e){let n=t.querySelector(`[data-uppy-paneltype="${e}"]`);if(n)return n}return t}function $g(t,e){let n=e[0];n&&(n.focus(),t.preventDefault())}function qP(t,e){let n=e[e.length-1];n&&(n.focus(),t.preventDefault())}function GP(t){return t.contains(document.activeElement)}function zd(t,e,n){let i=So(n,e),r=ui(i.querySelectorAll(ka)),o=r.indexOf(document.activeElement);GP(i)?t.shiftKey&&o===0?qP(t,r):!t.shiftKey&&o===r.length-1&&$g(t,r):$g(t,r)}function qg(t,e,n){e===null||zd(t,e,n)}var Gg=me(kc(),1);function Ld(){let t=!1;return(0,Gg.default)((n,i)=>{let r=So(n,i),o=r.contains(document.activeElement);if(o&&t)return;let s=r.querySelector("[data-uppy-super-focusable]");if(!(o&&!s))if(s)s.focus({preventScroll:!0}),t=!0;else{let a=r.querySelector(ka);a?.focus({preventScroll:!0}),t=!1}},260)}var u0=me(dt(),1);function Po(){let t=document.body;return!(!("draggable"in t)||!("ondragstart"in t&&"ondrop"in t)||!("FormData"in window)||!("FileReader"in window))}var Qg=me(dt(),1);function Xg(t,e){if(t===e)return!0;if(!t||!e)return!1;let n=Object.keys(t),i=Object.keys(e),r=n.length;if(i.length!==r)return!1;for(let o=0;o<r;o++){let s=n[o];if(t[s]!==e[s]||!Object.prototype.hasOwnProperty.call(e,s))return!1}return!0}function YP(){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 KP(){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 QP(){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 ZP(){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 JP(){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 e2(){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 t2(){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 yn(t){let e={color:"#838999",icon:e2()};if(!t)return e;let n=t.split("/")[0],i=t.split("/")[1];return n==="text"?{color:"#5a5e69",icon:t2()}:n==="image"?{color:"#686de0",icon:YP()}:n==="audio"?{color:"#068dbb",icon:KP()}:n==="video"?{color:"#19af67",icon:QP()}:n==="application"&&i==="pdf"?{color:"#e25149",icon:ZP()}:n==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(i)!==-1?{color:"#00C469",icon:JP()}:e}function Eo(t){let{file:e}=t;if(e.preview)return u("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:n,icon:i}=yn(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:n}},i),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 i2=(t,e)=>(typeof e=="function"?e():e).filter(r=>r.id===t)[0].name;function Do(t){let{file:e,toggleFileCard:n,i18n:i,metaFields:r}=t,{missingRequiredMetaFields:o}=e;if(!(o!=null&&o.length))return null;let s=o.map(a=>i2(a,r)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},i("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>n(!0,e.id)},i("editFile")))}function Hd(t){let{file:e,i18n:n,toggleFileCard:i,metaFields:r,showLinkToFileUploadResult:o}=t,a=e.preview?"rgba(255, 255, 255, 0.5)":yn(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},o&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u(Eo,{file:e}),u(Do,{file:e,i18n:n,toggleFileCard:i,metaFields:r}))}function n2(t){if(!t.isUploaded){if(t.error&&!t.hideRetryButton){t.uppy.retryUpload(t.file.id);return}t.resumableUploads&&!t.hidePauseResumeButton?t.uppy.pauseResume(t.file.id):t.individualCancellation&&!t.hideCancelButton&&t.uppy.removeFile(t.file.id)}}function Yg(t){return t.isUploaded?t.i18n("uploadComplete"):t.error?t.i18n("retryUpload"):t.resumableUploads?t.file.isPaused?t.i18n("resumeUpload"):t.i18n("pauseUpload"):t.individualCancellation?t.i18n("cancelUpload"):""}function jd(t){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":Yg(t),title:Yg(t),onClick:()=>n2(t)},t.children))}function Ta(t){let{children:e}=t;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"},e)}function Vd(t){let{progress:e}=t,n=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":n,"stroke-dashoffset":n-n/100*e}))}function Ud(t){return!t.file.progress.uploadStarted||t.file.progress.percentage===void 0?null:t.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(Ta,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"})))):t.recoveredState?null:t.error&&!t.hideRetryButton?u(jd,t,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"}))):t.resumableUploads&&!t.hidePauseResumeButton?u(jd,t,u(Ta,null,u(Vd,{progress:t.file.progress.percentage}),t.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"})))):!t.resumableUploads&&t.individualCancellation&&!t.hideCancelButton?u(jd,t,u(Ta,null,u(Vd,{progress:t.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(Ta,null,u(Vd,{progress:t.file.progress.percentage}))))}var Kg=me($s(),1);var Wd="...";function Ia(t,e){if(e===0)return"";if(t.length<=e)return t;if(e<=Wd.length+1)return`${t.slice(0,e-1)}\u2026`;let n=e-Wd.length,i=Math.ceil(n/2),r=Math.floor(n/2);return t.slice(0,i)+Wd+t.slice(-r)}var r2=t=>{let{author:e,name:n}=t.file.meta;function i(){return t.isSingleFile&&t.containerHeight>=350?90:t.containerWidth<=352?35:t.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:n},Ia(n,i()))},o2=t=>{var e;let{author:n}=t.file.meta,i=(e=t.file.remote)==null?void 0:e.providerName,r="\xB7";return n?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${n.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Ia(n.name,13)),i?u(Fragment,null,` ${r} `,i,` ${r} `):null):null},s2=t=>t.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Kg.default)(t.file.size)),a2=t=>t.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>t.toggleAddFilesPanel(!0)},t.i18n("reSelect"))),l2=t=>{let{file:e,onClick:n}=t;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:n,type:"button"},"?"):null};function $d(t){let{file:e,i18n:n,toggleFileCard:i,metaFields:r,toggleAddFilesPanel:o,isSingleFile:s,containerHeight:a,containerWidth:l}=t;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},r2({file:e,isSingleFile:s,containerHeight:a,containerWidth:l}),u(l2,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},o2({file:e}),s2({file:e}),a2({file:e,toggleAddFilesPanel:o,i18n:n})),u(Do,{file:e,i18n:n,toggleFileCard:i,metaFields:r}))}function qd(t,e){return e===void 0&&(e="Copy the URL below"),new Promise(n=>{let i=document.createElement("textarea");i.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),i.value=t,document.body.appendChild(i),i.select();let r=()=>{document.body.removeChild(i),window.prompt(e,t),n()};try{return document.execCommand("copy")?(document.body.removeChild(i),n()):r()}catch{return document.body.removeChild(i),r()}})}function c2(t){let{file:e,uploadInProgressOrComplete:n,metaFields:i,canEditFile:r,i18n:o,onClick:s}=t;return!n&&i&&i.length>0||!n&&r(e)?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:e.meta.name}),title:o("editFileWithFilename",{file:e.meta.name}),onClick:()=>s()},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 d2(t){let{i18n:e,onClick:n,file:i}=t;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:i.meta.name}),title:e("removeFile",{file:i.meta.name}),onClick:()=>n()},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 u2(t){let{file:e,uppy:n,i18n:i}=t,r=o=>{qd(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{n.log("Link copied to clipboard."),n.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(n.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":i("copyLink"),title:i("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 Gd(t){let{uppy:e,file:n,uploadInProgressOrComplete:i,canEditFile:r,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=t;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(c2,{i18n:l,file:n,uploadInProgressOrComplete:i,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,n.id):d(n)}}),s&&n.uploadURL?u(u2,{file:n,uppy:e,i18n:l}):null,a?u(d2,{i18n:l,file:n,onClick:()=>e.removeFile(n.id)}):null)}var Oa=class extends _t{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Xg(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,n=e.progress.preprocess||e.progress.postprocess,i=!!e.progress.uploadComplete&&!n&&!e.error,r=!!e.progress.uploadStarted||!!n,o=e.progress.uploadStarted&&!e.progress.uploadComplete||n,s=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!o)&&!i;i&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,Qg.default)({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":n,"is-complete":i,"is-error":!!s,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(Hd,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(Ud,{uppy:this.props.uppy,file:e,error:s,isUploaded:i,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($d,{file:e,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(Gd,{file:e,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 p2(t,e){let n=[],i=[];return t.forEach(r=>{i.length<e?i.push(r):(n.push(i),i=[r])}),i.length&&n.push(i),n}function Xd(t){let{id:e,i18n:n,uppy:i,files:r,resumableUploads:o,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,isSingleFile:g,toggleFileCard:h,handleRequestThumbnail:v,handleCancelThumbnail:C,recoveredState:R,individualCancellation:I,itemsPerRow:N,openFileEditor:Q,canEditFile:U,toggleAddFilesPanel:Y,containerWidth:_,containerHeight:x}=t,P=N===1?71:200,T=fn(()=>{let V=(Pe,he)=>Number(r[he].isGhost)-Number(r[Pe].isGhost),Z=Object.keys(r);return R&&Z.sort(V),p2(Z,N)},[r,N,R]),B=V=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:V[0]},V.map(Z=>u(Oa,{key:Z,uppy:i,id:e,i18n:n,resumableUploads:o,individualCancellation:I,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,recoveredState:R,isSingleFile:g,containerWidth:_,containerHeight:x,toggleFileCard:h,handleRequestThumbnail:v,handleCancelThumbnail:C,role:"listitem",openFileEditor:Q,canEditFile:U,toggleAddFilesPanel:Y,file:r[Z]})));return g?u("div",{class:"uppy-Dashboard-files"},B(T[0])):u(ya,{class:"uppy-Dashboard-files",role:"list",data:T,renderRow:B,rowHeight:P})}var Yd=class extends _t{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput.click()},this.triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,n)=>{var i;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(i=this.props.allowedFileTypes)==null?void 0:i.join(", "),ref:n})},this.renderHiddenCameraInput=(e,n,i)=>{let o={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:n,accept:o,ref:i})},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=(e,n)=>{let i=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:n,"data-uppy-super-focusable":i===0},e)},this.renderDropPasteBrowseTagline=e=>{let n=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=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"):e>0?this.props.i18nArray(`dropPasteImport${o}`,{browseFiles:n,browseFolders:i,browse:n}):this.props.i18nArray(`dropPaste${o}`,{browseFiles:n,browseFolders:i,browse:n}))},this.renderAcquirer=e=>{var n;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((n=this.props.activePickerPanel)==null?void 0:n.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let n=[...e],i=n.splice(e.length-2,e.length);return u($t,null,n.map(r=>this.renderAcquirer(r)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},i.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(e,n)=>{let{showNativePhotoCameraButton:i,showNativeVideoCameraButton:r}=this.props,o=[],s="myDevice";n||o.push({key:s,elements:this.renderMyDeviceAcquirer()}),i&&o.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&o.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),o.push(...e.map(p=>({key:p.id,elements:this.renderAcquirer(p)}))),o.length===1&&o[0].key===s&&(o=[]);let l=[...o],c=l.splice(o.length-2,o.length),d=p=>p.map(g=>{let{key:h,elements:v}=g;return u($t,{key:h},v)});return u($t,null,this.renderDropPasteBrowseTagline(o.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},d(l),u("span",{role:"presentation",style:{"white-space":"nowrap"}},d(c))))}}[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:e}=this.props,n=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")),i=e("poweredBy",{uppy:n});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},i)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:n,nativeCameraFacingMode:i}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),e&&this.renderHiddenCameraInput("photo",i,r=>{this.mobilePhotoFileInput=r}),n&&this.renderHiddenCameraInput("video",i,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(this.props)))}},Fa=Yd;var Zg=me(dt(),1);var h2=t=>u("div",{className:(0,Zg.default)("uppy-Dashboard-AddFilesPanel",t.className),"data-uppy-panelType":"AddFiles","aria-hidden":!t.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},t.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>t.toggleAddFilesPanel(!1)},t.i18n("back"))),u(Fa,t)),Jg=h2;var e0=me(dt(),1);function f2(t){let{tagName:e}=t.target;if(e==="INPUT"||e==="TEXTAREA"){t.stopPropagation();return}t.preventDefault(),t.stopPropagation()}var hi=f2;function m2(t){let{activePickerPanel:e,className:n,hideAllPanels:i,i18n:r,state:o,uppy:s}=t,a=rr(null);return u("div",{className:(0,e0.default)("uppy-DashboardContent-panel",n),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:hi,onDragLeave:hi,onDrop:hi,onPaste:hi},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i},r("cancel"))),u("div",{ref:a,className:"uppy-DashboardContent-panelBody"},s.getPlugin(e.id).render(o,a.current)))}var t0=m2;var i0=me(dt(),1);function g2(t){let e=t.files[t.fileCardFor],n=()=>{t.uppy.emit("file-editor:cancel",e),t.closeFileEditor()};return u("div",{className:(0,i0.default)("uppy-DashboardContent-panel",t.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"},t.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:n},t.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:t.saveFileEditor},t.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},t.editors.map(i=>t.uppy.getPlugin(i.id).render(t.state))))}var n0=g2;var fi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function y2(t,e,n,i){if(i===void 0&&(i={}),t)return fi.STATE_ERROR;if(e)return fi.STATE_COMPLETE;if(n)return fi.STATE_PAUSED;let r=fi.STATE_WAITING,o=Object.keys(i);for(let s=0;s<o.length;s++){let{progress:a}=i[o[s]];if(a.uploadStarted&&!a.uploadComplete)return fi.STATE_UPLOADING;a.preprocess&&r!==fi.STATE_UPLOADING&&(r=fi.STATE_PREPROCESSING),a.postprocess&&r!==fi.STATE_UPLOADING&&r!==fi.STATE_PREPROCESSING&&(r=fi.STATE_POSTPROCESSING)}return r}function v2(t){let{files:e,i18n:n,isAllComplete:i,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=t;switch(y2(r,i,o,e)){case"uploading":return n("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return n("processingXFiles",{smart_count:l.length});case"paused":return n("uploadPaused");case"waiting":return n("xFilesSelected",{smart_count:a.length});case"complete":return n("uploadComplete");case"error":return n("error");default:}}function b2(t){let{i18n:e,isAllComplete:n,hideCancelButton:i,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:s}=t,{allowNewUpload:a}=t;return a&&r&&(a=t.totalFileCount<t.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!n&&!i?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(v2,t)),a?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("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"},e("addMore"))):u("div",null))}var r0=b2;var o0=me(dt(),1);function Kd(t){let{computedMetaFields:e,requiredMetaFields:n,updateMeta:i,form:r,formState:o}=t,s={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=n.includes(a.id);return u("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:o[a.id],onChange:d=>i(d,a.id),fieldCSSClasses:s,required:c,form:r.id},u):u("input",{className:s.text,id:l,form:r.id,type:a.type||"text",required:c,value:o[a.id],placeholder:a.placeholder,onInput:d=>i(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function Qd(t){var e;let{files:n,fileCardFor:i,toggleFileCard:r,saveFileCard:o,metaFields:s,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:p,canEditFile:g}=t,h=()=>typeof s=="function"?s(n[i]):s,v=n[i],C=(e=h())!=null?e:[],R=g(v),I={};C.forEach(P=>{var T;I[P.id]=(T=v.meta[P.id])!=null?T:""});let[N,Q]=pi(I),U=or(P=>{P.preventDefault(),o(N,i)},[o,N,i]),Y=(P,T)=>{Q(E(b({},N),{[T]:P}))},_=()=>{r(!1)},[x]=pi(()=>{let P=document.createElement("form");return P.setAttribute("tabindex","-1"),P.id=Da(),P});return Ei(()=>(document.body.appendChild(x),x.addEventListener("submit",U),()=>{x.removeEventListener("submit",U),document.body.removeChild(x)}),[x,U]),u("div",{className:(0,o0.default)("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:hi,onDragLeave:hi,onDrop:hi,onPaste:hi},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"},v.meta?v.meta.name:v.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:x.id,title:c("finishEditingFile"),onClick:_},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:yn(v.type).color}},u(Eo,{file:v}),R&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:P=>{U(P),l(v)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(Kd,{computedMetaFields:C,requiredMetaFields:a,updateMeta:Y,form:x,formState:N})),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:_,form:x.id},c("cancel")))))}var a0=me(dt(),1),lr="uppy-transition-slideDownUp",s0=250;function _2(t){let{children:e}=t,[n,i]=pi(null),[r,o]=pi(""),s=rr(),a=rr(),l=rr(),c=()=>{o(`${lr}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{o(`${lr}-enter ${lr}-enter-active`),s.current=setTimeout(()=>{o("")},s0)})},d=()=>{o(`${lr}-leave`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{o(`${lr}-leave ${lr}-leave-active`),a.current=setTimeout(()=>{i(null),o("")},s0)})};return Ei(()=>{let p=di(e)[0];n!==p&&(p&&!n?c():n&&!p&&!a.current&&d(),i(p))},[e,n]),Ei(()=>()=>{clearTimeout(s.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),n?Zs(n,{className:(0,a0.default)(r,n.props.className)}):null}var ko=_2;function vn(){return vn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},vn.apply(null,arguments)}var l0=900,c0=700,Zd=576,d0=330;function Jd(t){let e=t.totalFileCount===0,n=t.totalFileCount===1,i=t.containerWidth>Zd,r=t.containerHeight>d0,o=(0,u0.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":t.disabled,"uppy-Dashboard--animateOpenClose":t.animateOpenClose,"uppy-Dashboard--isClosing":t.isClosing,"uppy-Dashboard--isDraggingOver":t.isDraggingOver,"uppy-Dashboard--modal":!t.inline,"uppy-size--md":t.containerWidth>Zd,"uppy-size--lg":t.containerWidth>c0,"uppy-size--xl":t.containerWidth>l0,"uppy-size--height-md":t.containerHeight>d0,"uppy-Dashboard--isAddFilesPanelVisible":t.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":t.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":t.singleFileFullScreen&&n&&r}),s=1;t.containerWidth>l0?s=5:t.containerWidth>c0?s=4:t.containerWidth>Zd&&(s=3);let a=t.showSelectedFiles&&!e,l=t.recoveredState?Object.keys(t.recoveredState.files).length:null,c=t.files?Object.keys(t.files).filter(g=>t.files[g].isGhost).length:null,d=()=>c>0?t.i18n("recoveredXFiles",{smart_count:c}):t.i18n("recoveredAllFiles");return u("div",{className:o,"data-uppy-theme":t.theme,"data-uppy-num-acquirers":t.acquirers.length,"data-uppy-drag-drop-supported":!t.disableLocalFiles&&Po(),"aria-hidden":t.inline?"false":t.isHidden,"aria-disabled":t.disabled,"aria-label":t.inline?t.i18n("dashboardTitle"):t.i18n("dashboardWindowTitle"),onPaste:t.handlePaste,onDragOver:t.handleDragOver,onDragLeave:t.handleDragLeave,onDrop:t.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:t.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!t.inline&&"true",role:t.inline?void 0:"dialog",style:{width:t.inline&&t.width?t.width:"",height:t.inline&&t.height?t.height:""}},t.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":t.i18n("closeModal"),title:t.i18n("closeModal"),onClick:t.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},t.i18n("dropHint")),a&&u(r0,t),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"},t.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?u(Xd,{id:t.id,i18n:t.i18n,uppy:t.uppy,files:t.files,resumableUploads:t.resumableUploads,hideRetryButton:t.hideRetryButton,hidePauseResumeButton:t.hidePauseResumeButton,hideCancelButton:t.hideCancelButton,showLinkToFileUploadResult:t.showLinkToFileUploadResult,showRemoveButtonAfterComplete:t.showRemoveButtonAfterComplete,metaFields:t.metaFields,toggleFileCard:t.toggleFileCard,handleRequestThumbnail:t.handleRequestThumbnail,handleCancelThumbnail:t.handleCancelThumbnail,recoveredState:t.recoveredState,individualCancellation:t.individualCancellation,openFileEditor:t.openFileEditor,canEditFile:t.canEditFile,toggleAddFilesPanel:t.toggleAddFilesPanel,isSingleFile:n,itemsPerRow:s,containerWidth:t.containerWidth,containerHeight:t.containerHeight}):u(Fa,vn({},t,{isSizeMD:i})),u(ko,null,t.showAddFilesPanel?u(Jg,vn({key:"AddFiles"},t,{isSizeMD:i})):null),u(ko,null,t.fileCardFor?u(Qd,vn({key:"FileCard"},t)):null),u(ko,null,t.activePickerPanel?u(t0,vn({key:"Picker"},t)):null),u(ko,null,t.showFileEditor?u(n0,vn({key:"Editor"},t)):null),u("div",{className:"uppy-Dashboard-progressindicators"},t.progressindicators.map(g=>t.uppy.getPlugin(g.id).render(t.state))))))}var p0={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 ne(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var w2=0;function tt(t){return"__private_"+w2+++"_"+t}var x2={version:"4.1.0"},eu=Nd.default||Nd,h0=9,C2=27;function f0(){let t={};return t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),t}var S2={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Co,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,doneButtonHandler:void 0,onRequestCloseModal:null},bn=tt("disabledNodes"),ki=tt("generateLargeThumbnailIfSingleFile"),To=tt("openFileEditorWhenFilesAdded"),_n=tt("attachRenderFunctionToTarget"),tu=tt("isTargetSupported"),iu=tt("getAcquirers"),nu=tt("getProgressIndicators"),Ti=tt("getEditors"),ru=tt("addSpecifiedPluginsFromOptions"),ou=tt("autoDiscoverPlugins"),wn=tt("addSupportedPluginIfNoTarget"),Io=tt("getStatusBarOpts"),Oo=tt("getThumbnailGeneratorOpts"),su=tt("getInformerOpts"),Fo=tt("getStatusBarId"),Ro=tt("getThumbnailGeneratorId"),au=tt("getInformerId"),xn=class extends kt{constructor(e,n){var i,r,o;let s=(i=n?.autoOpen)!=null?i:null;super(e,E(b(b({},S2),n),{autoOpen:s})),Object.defineProperty(this,au,{value:I2}),Object.defineProperty(this,Ro,{value:T2}),Object.defineProperty(this,Fo,{value:k2}),Object.defineProperty(this,su,{value:D2}),Object.defineProperty(this,Oo,{value:E2}),Object.defineProperty(this,Io,{value:P2}),Object.defineProperty(this,bn,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Da()}`,this.superFocus=Ld(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.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},h=this.getPluginState().targets.slice();return h.push(p),this.setPluginState({targets:h}),this.el},this.hideAllPanels=()=>{var a;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",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return ne(this,Ti)[Ti](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=ne(this,Ti)[Ti](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();ne(this,Ti)[Ti](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=f0();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"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:p}=this.getPluginState();if(d||p)return;let{promise:g,resolve:h}=f0();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let C=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",C,!1),h()};this.el.addEventListener("animationend",C,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),h();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var v;(v=history.state)!=null&&v[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),g},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:E(b({},l),{darkMode:a})})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.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(a=>{let l=a[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 a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.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=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=ne(this,bn)[bn])!=null?l:ui(this.el.querySelectorAll(c)).filter(p=>!p.classList.contains("uppy-Dashboard-close"));for(let p of d)p.tagName==="A"?p.setAttribute("aria-disabled",a):p.disabled=a;a?ne(this,bn)[bn]=d:ne(this,bn)[bn]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState(E(b({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===C2&&this.requestCloseModal(),a.keyCode===h0&&zd(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=ui(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=ui(a.target.files);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{var l,c;a.preventDefault(),a.stopPropagation();let d=()=>{let v=!0;return this.uppy.iteratePlugins(C=>{C.canHandleRootDrop!=null&&C.canHandleRootDrop(a)&&(v=!0)}),v},p=()=>{let{types:v}=a.dataTransfer;return v.some(C=>C==="Files")},g=d(),h=p();if(!g&&!h||this.opts.disabled||this.opts.disableLocalFiles&&(h||!g)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(l=(c=this.opts).onDragOver)==null||l.call(c,a)},this.handleDragLeave=a=>{var l,c;a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(l=(c=this.opts).onDragLeave)==null||l.call(c,a)},this.handleDrop=a=>O(this,null,function*(){var l,c;a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(h=>{h.type==="acquirer"&&(h.handleRootDrop==null||h.handleRootDrop(a))});let d=!1,p=h=>{this.uppy.log(h,"error"),d||(this.uppy.info(h.message,"error"),d=!0)};this.uppy.log("[Dashboard] Processing dropped files");let g=yield fo(a.dataTransfer,{logDropError:p});g.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(g)),(l=(c=this.opts).onDrop)==null||l.call(c,a)}),this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===h0&&qg(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,ki,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d=E(b({},l[0]),{preview:void 0});c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,To,{writable:!0,value:a=>{let l=a[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 a=md(this.opts.trigger);a?a.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",ne(this,wn)[wn]),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",ne(this,ki)[ki]),this.uppy.on("file-removed",ne(this,ki)[ki]),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",ne(this,To)[To])},this.removeEvents=()=>{let a=md(this.opts.trigger);!this.opts.inline&&a&&a.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",ne(this,wn)[wn]),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",ne(this,ki)[ki]),this.uppy.off("file-removed",ne(this,ki)[ki]),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",ne(this,To)[To])},this.superFocusOnEachUpdate=()=>{let a=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||a||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=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,_n,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return E(b({},a),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,tu,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,iu,{writable:!0,value:eu(a=>a.filter(l=>l.type==="acquirer"&&ne(this,tu)[tu](l)).map(ne(this,_n)[_n]))}),Object.defineProperty(this,nu,{writable:!0,value:eu(a=>a.filter(l=>l.type==="progressindicator").map(ne(this,_n)[_n]))}),Object.defineProperty(this,Ti,{writable:!0,value:eu(a=>a.filter(l=>l.type==="editor").map(ne(this,_n)[_n]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:p}=a,{newFiles:g,uploadStartedFiles:h,completeFiles:v,erroredFiles:C,inProgressFiles:R,inProgressNotPausedFiles:I,processingFiles:N,isUploadStarted:Q,isAllComplete:U,isAllPaused:Y}=this.uppy.getObjectOfFilesPerState(),_=ne(this,iu)[iu](l.targets),x=ne(this,nu)[nu](l.targets),P=ne(this,Ti)[Ti](l.targets),T;return this.opts.theme==="auto"?T=d.darkMode?"dark":"light":T=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}".`)),Jd({state:a,isHidden:l.isHidden,files:c,newFiles:g,uploadStartedFiles:h,completeFiles:v,erroredFiles:C,inProgressFiles:R,inProgressNotPausedFiles:I,processingFiles:N,isUploadStarted:Q,isAllComplete:U,isAllPaused:Y,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:p,acquirers:_,theme:T,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:P,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:a.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,ru,{writable:!0,value:()=>{(this.opts.plugins||[]).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,ou,{writable:!0,value:()=>{this.uppy.iteratePlugins(ne(this,wn)[wn])}}),Object.defineProperty(this,wn,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(p=>a.id===p.id)||a.mount(this,a))}}),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:a,closeAfterFinish:l}=this.opts;if(a&&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(cn,b({id:ne(this,Fo)[Fo](),target:this},ne(this,Io)[Io]())),this.opts.disableInformer||this.uppy.use(dn,b({id:ne(this,au)[au](),target:this},ne(this,su)[su]())),this.opts.disableThumbnailGenerator||this.uppy.use(nr,b({id:ne(this,Ro)[Ro]()},ne(this,Oo)[Oo]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let g=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${g?"on":"off"}`),this.setDarkModeCapability(g),this.opts.theme==="auto"){var h;(h=this.darkModeMediaQuery)==null||h.addListener(this.handleSystemDarkModeChange)}ne(this,ru)[ru](),ne(this,ou)[ou](),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)}if((this.opts.plugins||[]).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=p0,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(e){var n,i;super.setOptions(e),(n=this.uppy.getPlugin(ne(this,Fo)[Fo]()))==null||n.setOptions(ne(this,Io)[Io]()),(i=this.uppy.getPlugin(ne(this,Ro)[Ro]()))==null||i.setOptions(ne(this,Oo)[Oo]())}};function P2(){let{hideUploadButton:t,hideRetryButton:e,hidePauseResumeButton:n,hideCancelButton:i,showProgressDetails:r,hideProgressAfterFinish:o,locale:s,doneButtonHandler:a}=this.opts;return{hideUploadButton:t,hideRetryButton:e,hidePauseResumeButton:n,hideCancelButton:i,showProgressDetails:r,hideAfterFinish:o,locale:s,doneButtonHandler:a}}function E2(){let{thumbnailWidth:t,thumbnailHeight:e,thumbnailType:n,waitForThumbnailsBeforeUpload:i}=this.opts;return{thumbnailWidth:t,thumbnailHeight:e,thumbnailType:n,waitForThumbnailsBeforeUpload:i,lazy:!i}}function D2(){return{}}function k2(){return`${this.id}:StatusBar`}function T2(){return`${this.id}:ThumbnailGenerator`}function I2(){return`${this.id}:Informer`}xn.VERSION=x2.version;var O2={version:"4.0.0"},F2={fixed:!1,hideAfterFinish:!0},cr=class extends kt{constructor(e,n){super(e,b(b({},F2),n)),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let n=e.totalProgress||0,i=(n===0||n===100)&&this.opts.hideAfterFinish;return u("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i},u("div",{className:"uppy-ProgressBar-inner",style:{width:`${n}%`}}),u("div",{className:"uppy-ProgressBar-percentage"},n))}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};cr.VERSION=O2.version;var m0={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var R2={version:"4.0.2"},M2={inputName:"files[]",width:"100%",height:"100%"},dr=class t extends kt{constructor(e,n){super(e,b(b({},M2),n)),this.isDragDropSupported=Po(),this.addFiles=i=>{let r=i.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=i=>{let r=ui(i.target.files);r.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(r)),i.target.value=null},this.handleDragOver=i=>{var r,o;i.preventDefault(),i.stopPropagation();let{types:s}=i.dataTransfer,a=s.some(c=>c==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!a||!l){i.dataTransfer.dropEffect="none";return}i.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(r=(o=this.opts).onDragOver)==null||r.call(o,i)},this.handleDragLeave=i=>{var r,o;i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(r=(o=this.opts).onDragLeave)==null||r.call(o,i)},this.handleDrop=i=>O(this,null,function*(){var r,o;i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1});let s=l=>{this.uppy.log(l,"error")},a=yield fo(i.dataTransfer,{logDropError:s});a.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(a)),(r=(o=this.opts).onDrop)==null||r.call(o,i)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=m0,this.i18nInit()}renderHiddenFileInput(){var e;let{restrictions:n}=this.uppy.opts;return u("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:i=>{this.fileInputRef=i},name:this.opts.inputName,multiple:n.maxNumberOfFiles!==1,accept:(e=n.allowedFileTypes)==null?void 0:e.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 e=`uppy-u-reset
|
|
25
|
+
${r.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};dn.VERSION=$S.version;var qS=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function GS(t,e,n){var i,r;let o=qS.exec(t),s=(i=(r=e.mimeType)!=null?r:o?.[1])!=null?i:"plain/text",a;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);a=[c]}else o?.[3]!=null&&(a=[decodeURIComponent(o[3])]);return n?new File(a,e.name||"",{type:s}):new Blob(a,{type:s})}var Ym=GS;function sa(t){return t.startsWith("blob:")}function aa(t){return t?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(t):!1}function ae(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var rg=typeof self<"u"?self:global,ao=typeof navigator<"u",XS=ao&&typeof HTMLImageElement>"u",Km=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),og=rg.Buffer,sg=!!og,YS=t=>t!==void 0;function ag(t){return t===void 0||(t instanceof Map?t.size===0:Object.values(t).filter(YS).length===0)}function Ze(t){let e=new Error(t);throw delete e.stack,e}function Qm(t){let e=function(n){let i=0;return n.ifd0.enabled&&(i+=1024),n.exif.enabled&&(i+=2048),n.makerNote&&(i+=2048),n.userComment&&(i+=1024),n.gps.enabled&&(i+=512),n.interop.enabled&&(i+=100),n.ifd1.enabled&&(i+=1024),i+2048}(t);return t.jfif.enabled&&(e+=50),t.xmp.enabled&&(e+=2e4),t.iptc.enabled&&(e+=14e3),t.icc.enabled&&(e+=6e3),e}var rd=t=>String.fromCharCode.apply(null,t),Zm=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,pn=class t{static from(e,n){return e instanceof this&&e.le===n?e:new t(e,void 0,void 0,n)}constructor(e,n=0,i,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){i===void 0&&(i=e.byteLength-n);let o=new DataView(e,n,i);this._swapDataView(o)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof t){i===void 0&&(i=e.byteLength-n),(n+=e.byteOffset)+i>e.byteOffset+e.byteLength&&Ze("Creating view outside of available memory in ArrayBuffer");let o=new DataView(e.buffer,n,i);this._swapDataView(o)}else if(typeof e=="number"){let o=new DataView(new ArrayBuffer(e));this._swapDataView(o)}else Ze("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,n,i=t){return e instanceof DataView||e instanceof t?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||Ze("BufferView.set(): Invalid data argument."),this.toUint8().set(e,n),new i(this,n,e.byteLength)}subarray(e,n){return n=n||this._lengthToEnd(e),new t(this,e,n)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,n){return new Uint8Array(this.buffer,this.byteOffset+e,n)}getString(e=0,n=this.byteLength){return r=this.getUint8Array(e,n),Zm?Zm.decode(r):sg?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(rd(r)));var r}getLatin1String(e=0,n=this.byteLength){let i=this.getUint8Array(e,n);return rd(i)}getUnicodeString(e=0,n=this.byteLength){let i=[];for(let r=0;r<n&&e+r<this.byteLength;r+=2)i.push(this.getUint16(e+r));return rd(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,n=this.le){return this.dataView.getInt16(e,n)}getInt32(e,n=this.le){return this.dataView.getInt32(e,n)}getUint16(e,n=this.le){return this.dataView.getUint16(e,n)}getUint32(e,n=this.le){return this.dataView.getUint32(e,n)}getFloat32(e,n=this.le){return this.dataView.getFloat32(e,n)}getFloat64(e,n=this.le){return this.dataView.getFloat64(e,n)}getFloat(e,n=this.le){return this.dataView.getFloat32(e,n)}getDouble(e,n=this.le){return this.dataView.getFloat64(e,n)}getUintBytes(e,n,i){switch(n){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,n,i){switch(n){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function sd(t,e){Ze(`${t} '${e}' was not loaded, try using full build of exifr.`)}var lo=class extends Map{constructor(e){super(),this.kind=e}get(e,n){return this.has(e)||sd(this.kind,e),n&&(e in n||function(i,r){Ze(`Unknown ${i} '${r}'.`)}(this.kind,e),n[e].enabled||sd(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},pa=new lo("file parser"),Ot=new lo("segment parser"),po=new lo("file reader"),KS=rg.fetch;function Jm(t,e){return(n=t).startsWith("data:")||n.length>1e4?ld(t,e,"base64"):Km&&t.includes("://")?ad(t,e,"url",la):Km?ld(t,e,"fs"):ao?ad(t,e,"url",la):void Ze("Invalid input argument");var n}function ad(t,e,n,i){return F(this,null,function*(){return po.has(n)?ld(t,e,n):i?function(r,o){return F(this,null,function*(){let s=yield o(r);return new pn(s)})}(t,i):void Ze(`Parser ${n} is not loaded`)})}function ld(t,e,n){return F(this,null,function*(){let i=new(po.get(n))(t,e);return yield i.read(),i})}var la=t=>KS(t).then(e=>e.arrayBuffer()),co=t=>new Promise((e,n)=>{let i=new FileReader;i.onloadend=()=>e(i.result||new ArrayBuffer),i.onerror=n,i.readAsArrayBuffer(t)}),cd=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 lg(t,e,n){let i=new cd;for(let[r,o]of n)i.set(r,o);if(Array.isArray(e))for(let r of e)t.set(r,i);else t.set(e,i);return i}function cg(t,e,n){let i,r=t.get(e);for(i of n)r.set(i[0],i[1])}var ho=new Map,fd=new Map,md=new Map,Zn=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],ha=["jfif","xmp","icc","iptc","ihdr"],uo=["tiff",...ha],Ne=["ifd0","ifd1","exif","gps","interop"],Jn=[...uo,...Ne],er=["makerNote","userComment"],fa=["translateKeys","translateValues","reviveValues","multiSegment"],tr=[...fa,"sanitize","mergeOutput","silentErrors"],ca=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},un=class extends ca{get needed(){return this.enabled||this.deps.size>0}constructor(e,n,i,r){if(super(),ae(this,"enabled",!1),ae(this,"skip",new Set),ae(this,"pick",new Set),ae(this,"deps",new Set),ae(this,"translateKeys",!1),ae(this,"translateValues",!1),ae(this,"reviveValues",!1),this.key=e,this.enabled=n,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=Ne.includes(e),this.canBeFiltered&&(this.dict=ho.get(e)),i!==void 0)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if(typeof i=="object"){if(this.enabled=!0,this.parse=i.parse!==!1,this.canBeFiltered){let{pick:o,skip:s}=i;o&&o.length>0&&this.translateTagSet(o,this.pick),s&&s.length>0&&this.translateTagSet(s,this.skip)}this.applyInheritables(i)}else i===!0||i===!1?this.parse=this.enabled=i:Ze(`Invalid options argument: ${i}`)}applyInheritables(e){let n,i;for(n of fa)i=e[n],i!==void 0&&(this[n]=i)}translateTagSet(e,n){if(this.dict){let i,r,{tagKeys:o,tagValues:s}=this.dict;for(i of e)typeof i=="string"?(r=s.indexOf(i),r===-1&&(r=o.indexOf(Number(i))),r!==-1&&n.add(Number(o[r]))):n.add(i)}else for(let i of e)n.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,da(this.pick,this.deps)):this.enabled&&this.pick.size>0&&da(this.pick,this.deps)}},ut={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},eg=new Map,hn=class extends ca{static useCached(e){let n=eg.get(e);return n!==void 0||(n=new this(e),eg.set(e,n)),n}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):Ze(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=ao?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Zn)this[e]=ut[e];for(e of tr)this[e]=ut[e];for(e of er)this[e]=ut[e];for(e of Jn)this[e]=new un(e,ut[e],void 0,this)}setupFromTrue(){let e;for(e of Zn)this[e]=ut[e];for(e of tr)this[e]=ut[e];for(e of er)this[e]=!0;for(e of Jn)this[e]=new un(e,!0,void 0,this)}setupFromArray(e){let n;for(n of Zn)this[n]=ut[n];for(n of tr)this[n]=ut[n];for(n of er)this[n]=ut[n];for(n of Jn)this[n]=new un(n,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ne)}setupFromObject(e){let n;for(n of(Ne.ifd0=Ne.ifd0||Ne.image,Ne.ifd1=Ne.ifd1||Ne.thumbnail,Object.assign(this,e),Zn))this[n]=od(e[n],ut[n]);for(n of tr)this[n]=od(e[n],ut[n]);for(n of er)this[n]=od(e[n],ut[n]);for(n of uo)this[n]=new un(n,ut[n],e[n],this);for(n of Ne)this[n]=new un(n,ut[n],e[n],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ne,Jn),e.tiff===!0?this.batchEnableWithBool(Ne,!0):e.tiff===!1?this.batchEnableWithUserValue(Ne,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ne):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ne)}batchEnableWithBool(e,n){for(let i of e)this[i].enabled=n}batchEnableWithUserValue(e,n){for(let i of e){let r=n[i];this[i].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(e,n,i,r=i){if(e&&e.length){for(let s of r)this[s].enabled=!1;let o=tg(e,i);for(let[s,a]of o)da(this[s].pick,a),this[s].enabled=!0}else if(n&&n.length){let o=tg(n,i);for(let[s,a]of o)da(this[s].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:n,xmp:i,iptc:r,icc:o}=this;this.makerNote?n.deps.add(37500):n.skip.add(37500),this.userComment?n.deps.add(37510):n.skip.add(37510),i.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),o.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:n,gps:i,interop:r}=this;r.needed&&(n.deps.add(40965),e.deps.add(40965)),n.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=Ne.some(o=>this[o].enabled===!0)||this.makerNote||this.userComment;for(let o of Ne)this[o].finalizeFilters()}get onlyTiff(){return!ha.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of uo)this[e].enabled&&!Ot.has(e)&&sd("segment parser",e)}};function tg(t,e){let n,i,r,o,s=[];for(r of e){for(o of(n=ho.get(r),i=[],n))(t.includes(o[0])||t.includes(o[1]))&&i.push(o[0]);i.length&&s.push([r,i])}return s}function od(t,e){return t!==void 0?t:e!==void 0?e:void 0}function da(t,e){for(let n of e)t.add(n)}ae(hn,"default",ut);var ir=class{constructor(e){ae(this,"parsers",{}),ae(this,"output",{}),ae(this,"errors",[]),ae(this,"pushToErrors",n=>this.errors.push(n)),this.options=hn.useCached(e)}read(e){return F(this,null,function*(){this.file=yield function(n,i){return typeof n=="string"?Jm(n,i):ao&&!XS&&n instanceof HTMLImageElement?Jm(n.src,i):n instanceof Uint8Array||n instanceof ArrayBuffer||n instanceof DataView?new pn(n):ao&&n instanceof Blob?ad(n,i,"blob",co):void Ze("Invalid input argument")}(e,this.options)})}setup(){if(this.fileParser)return;let{file:e}=this,n=e.getUint16(0);for(let[i,r]of pa)if(r.canHandle(e,n))return this.fileParser=new r(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),Ze("Unknown file format")}parse(){return F(this,null,function*(){let{output:e,errors:n}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),n.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&n.length>0&&(e.errors=n),ag(i=e)?void 0:i;var i})}executeParsers(){return F(this,null,function*(){let{output:e}=this;yield this.fileParser.parse();let n=Object.values(this.parsers).map(i=>F(this,null,function*(){let r=yield i.parse();i.assignToOutput(e,r)}));this.options.silentErrors&&(n=n.map(i=>i.catch(this.pushToErrors))),yield Promise.all(n)})}extractThumbnail(){return F(this,null,function*(){this.setup();let{options:e,file:n}=this,i=Ot.get("tiff",e);var r;if(n.tiff?r={start:0,type:"tiff"}:n.jpeg&&(r=yield this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let o=yield this.fileParser.ensureSegmentChunk(r),s=this.parsers.tiff=new i(o,e,n),a=yield s.extractThumbnail();return n.close&&n.close(),a})}};function dg(t,e){return F(this,null,function*(){let n=new ir(e);return yield n.read(t),n.parse()})}var QS=Object.freeze({__proto__:null,parse:dg,Exifr:ir,fileParsers:pa,segmentParsers:Ot,fileReaders:po,tagKeys:ho,tagValues:fd,tagRevivers:md,createDictionary:lg,extendDictionary:cg,fetchUrlAsArrayBuffer:la,readBlobAsArrayBuffer:co,chunkedProps:Zn,otherSegments:ha,segments:uo,tiffBlocks:Ne,segmentsAndBlocks:Jn,tiffExtractables:er,inheritables:fa,allFormatters:tr,Options:hn}),Wi=class{static findPosition(e,n){let i=e.getUint16(n+2)+2,r=typeof this.headerLength=="function"?this.headerLength(e,n,i):this.headerLength,o=n+r,s=i-r;return{offset:n,length:i,headerLength:r,start:o,size:s,end:o+s}}static parse(e,n={}){return new this(e,new hn({[this.type]:n}),e).parse()}normalizeInput(e){return e instanceof pn?e:new pn(e)}constructor(e,n={},i){ae(this,"errors",[]),ae(this,"raw",new Map),ae(this,"handleError",r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)}),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,n){let i=md.get(n),r=fd.get(n),o=ho.get(n),s=this.options[n],a=s.reviveValues&&!!i,l=s.translateValues&&!!r,c=s.translateKeys&&!!o,d={};for(let[p,g]of e)a&&i.has(p)?g=i.get(p)(g):l&&r.has(p)&&(g=this.translateValue(g,r.get(p))),c&&o.has(p)&&(p=o.get(p)||p),d[p]=g;return d}translateValue(e,n){return n[e]||n.DEFAULT||e}assignToOutput(e,n){this.assignObjectToOutput(e,this.constructor.type,n)}assignObjectToOutput(e,n,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[n]?Object.assign(e[n],i):e[n]=i}};ae(Wi,"headerLength",4),ae(Wi,"type",void 0),ae(Wi,"multiSegment",!1),ae(Wi,"canHandle",()=>!1);function ZS(t){return t===192||t===194||t===196||t===219||t===221||t===218||t===254}function JS(t){return t>=224&&t<=239}function eP(t,e,n){for(let[i,r]of Ot)if(r.canHandle(t,e,n))return i}var ua=class extends class{constructor(e,n,i){ae(this,"errors",[]),ae(this,"ensureSegmentChunk",r=>F(this,null,function*(){let o=r.start,s=r.size||65536;if(this.file.chunked)if(this.file.available(o,s))r.chunk=this.file.subarray(o,s);else try{r.chunk=yield this.file.readChunk(o,s)}catch(a){Ze(`Couldn't read segment: ${JSON.stringify(r)}. ${a.message}`)}else this.file.byteLength>o+s?r.chunk=this.file.subarray(o,s):r.size===void 0?r.chunk=this.file.subarray(o):Ze("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=n,this.parsers=i}injectSegment(e,n){this.options[e].enabled&&this.createParser(e,n)}createParser(e,n){let i=new(Ot.get(e))(n,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let n of e){let{type:i,chunk:r}=n,o=this.options[i];if(o&&o.enabled){let s=this.parsers[i];s&&s.append||s||this.createParser(i,r)}}}readSegments(e){return F(this,null,function*(){let n=e.map(this.ensureSegmentChunk);yield Promise.all(n)})}}{constructor(...e){super(...e),ae(this,"appSegments",[]),ae(this,"jpegSegments",[]),ae(this,"unknownSegments",[])}static canHandle(e,n){return n===65496}parse(){return F(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Ot.keyList())):(e=e===void 0?Ot.keyList().filter(n=>this.options[n].enabled):e.filter(n=>this.options[n].enabled&&Ot.has(n)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}findAppSegments(e=0,n){return F(this,null,function*(){this.setupSegmentFinderArgs(n);let{file:i,findAll:r,wanted:o,remaining:s}=this;if(!r&&this.file.chunked&&(r=Array.from(o).some(a=>{let l=Ot.get(a),c=this.options[a];return l.multiSegment&&c.multiSegment}),r&&(yield this.file.readWhole())),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let a=!1;for(;s.size>0&&!a&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=i,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(a=e>l&&!c?!(yield i.readNextChunk(e)):!(yield i.readNextChunk(l)),(e=this.findAppSegmentsInRange(e,i.byteLength))===void 0)return}}})}findAppSegmentsInRange(e,n){n-=2;let i,r,o,s,a,l,{file:c,findAll:d,wanted:p,remaining:g,options:h}=this;for(;e<n;e++)if(c.getUint8(e)===255){if(i=c.getUint8(e+1),JS(i)){if(r=c.getUint16(e+2),o=eP(c,e,r),o&&p.has(o)&&(s=Ot.get(o),a=s.findPosition(c,e),l=h[o],a.type=o,this.appSegments.push(a),!d&&(s.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||g.delete(o)):g.delete(o),g.size===0)))break;h.recordUnknownSegments&&(a=Wi.findPosition(c,e),a.marker=i,this.unknownSegments.push(a)),e+=r+1}else if(ZS(i)){if(r=c.getUint16(e+2),i===218&&h.stopAfterSos!==!1)return;h.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:i}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(n=>n.multiSegment))return;let e=function(n,i){let r,o,s,a=new Map;for(let l=0;l<n.length;l++)r=n[l],o=r[i],a.has(o)?s=a.get(o):a.set(o,s=[]),s.push(r);return Array.from(a)}(this.appSegments,"type");this.mergedAppSegments=e.map(([n,i])=>{let r=Ot.get(n,this.options);return r.handleMultiSegments?{type:n,chunk:r.handleMultiSegments(i)}:i[0]})}getSegment(e){return this.appSegments.find(n=>n.type===e)}getOrFindSegment(e){return F(this,null,function*(){let n=this.getSegment(e);return n===void 0&&(yield this.findAppSegments(0,[e]),n=this.getSegment(e)),n})}};ae(ua,"type","jpeg"),pa.set("jpeg",ua);var tP=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],dd=class extends Wi{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,n,i=new Map){let{pick:r,skip:o}=this.options[n];r=new Set(r);let s=r.size>0,a=o.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(s){if(r.has(d)&&(i.set(d,this.parseTag(e,d,n)),r.delete(d),r.size===0))break}else!a&&o.has(d)||i.set(d,this.parseTag(e,d,n));e+=12}return i}parseTag(e,n,i){let{chunk:r}=this,o=r.getUint16(e+2),s=r.getUint32(e+4),a=tP[o];if(a*s<=4?e+=8:e=r.getUint32(e+8),(o<1||o>13)&&Ze(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${n.toString(16)}, type: ${o}, offset ${e}`),e>r.byteLength&&Ze(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${n.toString(16)}, type: ${o}, offset ${e} is outside of chunk size ${r.byteLength}`),o===1)return r.getUint8Array(e,s);if(o===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=r.getString(e,s)).trim())===""?void 0:l;var l;if(o===7)return r.getUint8Array(e,s);if(s===1)return this.parseTagValue(o,e);{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))(s),d=a;for(let p=0;p<s;p++)c[p]=this.parseTagValue(o,e),e+=d;return c}}parseTagValue(e,n){let{chunk:i}=this;switch(e){case 1:return i.getUint8(n);case 3:return i.getUint16(n);case 4:return i.getUint32(n);case 5:return i.getUint32(n)/i.getUint32(n+4);case 6:return i.getInt8(n);case 8:return i.getInt16(n);case 9:return i.getInt32(n);case 10:return i.getInt32(n)/i.getInt32(n+4);case 11:return i.getFloat(n);case 12:return i.getDouble(n);case 13:return i.getUint32(n);default:Ze(`Invalid tiff type ${e}`)}}},so=class extends dd{static canHandle(e,n){return e.getUint8(n+1)===225&&e.getUint32(n+4)===1165519206&&e.getUint16(n+8)===0}parse(){return F(this,null,function*(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&(yield this.parseIfd0Block()),e.exif.enabled&&(yield this.safeParse("parseExifBlock")),e.gps.enabled&&(yield this.safeParse("parseGpsBlock")),e.interop.enabled&&(yield this.safeParse("parseInteropBlock")),e.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(e){let n=this[e]();return n.catch!==void 0&&(n=n.catch(this.handleError)),n}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),n=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(n)}}parseBlock(e,n){let i=new Map;return this[n]=i,this.parseTags(e,n,i),i}parseIfd0Block(){return F(this,null,function*(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Ze("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&Ze(`IFD0 offset points to outside of file.
|
|
26
|
+
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&(yield e.ensureChunk(this.ifd0Offset,Qm(this.options)));let n=this.parseBlock(this.ifd0Offset,"ifd0");return n.size!==0?(this.exifOffset=n.get(34665),this.interopOffset=n.get(40965),this.gpsOffset=n.get(34853),this.xmp=n.get(700),this.iptc=n.get(33723),this.icc=n.get(34675),this.options.sanitize&&(n.delete(34665),n.delete(40965),n.delete(34853),n.delete(700),n.delete(33723),n.delete(34675)),n):void 0})}parseExifBlock(){return F(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,Qm(this.options)));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e})}unpack(e,n){let i=e.get(n);i&&i.length===1&&e.set(n,i[0])}parseGpsBlock(){return F(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",ig(...e.get(2),e.get(1))),e.set("longitude",ig(...e.get(4),e.get(3)))),e})}parseInteropBlock(){return F(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(e=!1){return F(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return F(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let e=this.ifd1.get(513),n=this.ifd1.get(514);return this.chunk.getUint8Array(e,n)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,n,i,r={};for(n of Ne)if(e=this[n],!ag(e))if(i=this.canTranslate?this.translateBlock(e,n):Object.fromEntries(e),this.options.mergeOutput){if(n==="ifd1")continue;Object.assign(r,i)}else r[n]=i;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,n){if(this.globalOptions.mergeOutput)Object.assign(e,n);else for(let[i,r]of Object.entries(n))this.assignObjectToOutput(e,i,r)}};function ig(t,e,n,i){var r=t+e/60+n/3600;return i!=="S"&&i!=="W"||(r*=-1),r}ae(so,"type","tiff"),ae(so,"headerLength",10),Ot.set("tiff",so);var fF=Object.freeze({__proto__:null,default:QS,Exifr:ir,fileParsers:pa,segmentParsers:Ot,fileReaders:po,tagKeys:ho,tagValues:fd,tagRevivers:md,createDictionary:lg,extendDictionary:cg,fetchUrlAsArrayBuffer:la,readBlobAsArrayBuffer:co,chunkedProps:Zn,otherSegments:ha,segments:uo,tiffBlocks:Ne,segmentsAndBlocks:Jn,tiffExtractables:er,inheritables:fa,allFormatters:tr,Options:hn,parse:dg}),gd={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},mF=Object.assign({},gd,{firstChunkSize:4e4,gps:[1,2,3,4]});var gF=Object.assign({},gd,{tiff:!1,ifd1:!0,mergeOutput:!1});var iP=Object.assign({},gd,{firstChunkSize:4e4,ifd0:[274]});function nP(t){return F(this,null,function*(){let e=new ir(iP);yield e.read(t);let n=yield e.parse();if(n&&n.ifd0)return n.ifd0[274]})}var rP=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}}),ro=!0,oo=!0;if(typeof navigator=="object"){let t=navigator.userAgent;if(t.includes("iPad")||t.includes("iPhone")){let e=t.match(/OS (\d+)_(\d+)/);if(e){let[,n,i]=e;ro=Number(n)+.1*Number(i)<13.4,oo=!1}}else if(t.includes("OS X 10")){let[,e]=t.match(/OS X 10[_.](\d+)/);ro=oo=Number(e)<15}if(t.includes("Chrome/")){let[,e]=t.match(/Chrome\/(\d+)/);ro=oo=Number(e)<81}else if(t.includes("Firefox/")){let[,e]=t.match(/Firefox\/(\d+)/);ro=oo=Number(e)<77}}function ug(t){return F(this,null,function*(){let e=yield nP(t);return Object.assign({canvas:ro,css:oo},rP[e])})}var ud=class extends pn{constructor(...e){super(...e),ae(this,"ranges",new pd),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,n,i){if(e===0&&this.byteLength===0&&i){let r=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(r)}else{let r=e+n;if(r>this.byteLength){let{dataView:o}=this._extend(r);this._swapDataView(o)}}}_extend(e){let n;n=sg?og.allocUnsafe(e):new Uint8Array(e);let i=new DataView(n.buffer,n.byteOffset,n.byteLength);return n.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:n,dataView:i}}subarray(e,n,i=!1){return n=n||this._lengthToEnd(e),i&&this._tryExtend(e,n),this.ranges.add(e,n),super.subarray(e,n)}set(e,n,i=!1){i&&this._tryExtend(n,e.byteLength,e);let r=super.set(e,n);return this.ranges.add(n,r.byteLength),r}ensureChunk(e,n){return F(this,null,function*(){this.chunked&&(this.ranges.available(e,n)||(yield this.readChunk(e,n)))})}available(e,n){return this.ranges.available(e,n)}},pd=class{constructor(){ae(this,"list",[])}get length(){return this.list.length}add(e,n,i=0){let r=e+n,o=this.list.filter(s=>ng(e,s.offset,r)||ng(e,s.end,r));if(o.length>0){e=Math.min(e,...o.map(a=>a.offset)),r=Math.max(r,...o.map(a=>a.end)),n=r-e;let s=o.shift();s.offset=e,s.length=n,s.end=r,this.list=this.list.filter(a=>!o.includes(a))}else this.list.push({offset:e,length:n,end:r})}available(e,n){let i=e+n;return this.list.some(r=>r.offset<=e&&i<=r.end)}};function ng(t,e,n){return t<=e&&e<=n}var hd=class extends ud{constructor(e,n){super(0),ae(this,"chunksRead",0),this.input=e,this.options=n}readWhole(){return F(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return F(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return F(this,arguments,function*(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let n=this.options.chunkSize,i=yield this.readChunk(e,n);return!!i&&i.byteLength===n})}readChunk(e,n){return F(this,null,function*(){if(this.chunksRead++,(n=this.safeWrapAddress(e,n))!==0)return this._readChunk(e,n)})}safeWrapAddress(e,n){return this.size!==void 0&&e+n>this.size?Math.max(0,this.size-e):n}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(){}};po.set("blob",class extends hd{readWhole(){return F(this,null,function*(){this.chunked=!1;let t=yield co(this.input);this._swapArrayBuffer(t)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(t,e){return F(this,null,function*(){let n=e?t+e:void 0,i=this.input.slice(t,n),r=yield co(i);return this.set(r,t,!0)})}});var pg={strings:{generatingThumbnails:"Generating thumbnails..."}};var oP={version:"4.0.0"};function sP(t,e,n){try{t.getContext("2d").getImageData(0,0,1,1)}catch(i){if(i.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return t.toBlob?new Promise(i=>{t.toBlob(i,e,n)}).then(i=>{if(i===null)throw new Error("cannot read image, probably an svg with external resources");return i}):Promise.resolve().then(()=>Ym(t.toDataURL(e,n),{})).then(i=>{if(i===null)throw new Error("could not extract blob, probably an old browser");return i})}function aP(t,e){let n=t.width,i=t.height;(e.deg===90||e.deg===270)&&(n=t.height,i=t.width);let r=document.createElement("canvas");r.width=n,r.height=i;let o=r.getContext("2d");return o.translate(n/2,i/2),e.canvas&&(o.rotate(e.rad),o.scale(e.scaleX,e.scaleY)),o.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),r}function lP(t){let e=t.width/t.height,n=5e6,i=4096,r=Math.floor(Math.sqrt(n*e)),o=Math.floor(n/Math.sqrt(n*e));if(r>i&&(r=i,o=Math.round(r/e)),o>i&&(o=i,r=Math.round(e*o)),t.width>r){let s=document.createElement("canvas");return s.width=r,s.height=o,s.getContext("2d").drawImage(t,0,0,r,o),s}return t}var cP={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},nr=class extends kt{constructor(e,n){if(super(e,b(b({},cP),n)),this.onFileAdded=i=>{!i.preview&&i.data&&aa(i.type)&&!i.isRemote&&this.addToQueue(i.id)},this.onCancelRequest=i=>{let r=this.queue.indexOf(i.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=i=>{let r=this.queue.indexOf(i.id);r!==-1&&this.queue.splice(r,1),i.preview&&sa(i.preview)&&URL.revokeObjectURL(i.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||sa(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=i=>{i.forEach(o=>{let s=this.uppy.getFile(o);this.uppy.emit("preprocess-progress",s,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let r=()=>{i.forEach(o=>{let s=this.uppy.getFile(o);this.uppy.emit("preprocess-complete",s)})};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=pg,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(e,n,i){let r=URL.createObjectURL(e.data),o=new Promise((a,l)=>{let c=new Image;c.src=r,c.addEventListener("load",()=>{URL.revokeObjectURL(r),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(r),l(d.error||new Error("Could not create thumbnail"))})}),s=ug(e.data).catch(()=>1);return Promise.all([o,s]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,n,i,c.deg),p=aP(l,c),g=this.resizeImage(p,d.width,d.height);return sP(g,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,n,i,r){let o=e.width/e.height;return(r===90||r===270)&&(o=e.height/e.width),n!=null?{width:n,height:Math.round(n/o)}:i!=null?{width:Math.round(i*o),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}}resizeImage(e,n,i){let r=lP(e),o=Math.ceil(Math.log2(r.width/n));o<1&&(o=1);let s=n*2**(o-1),a=i*2**(o-1),l=2;for(;o--;){let c=document.createElement("canvas");c.width=s,c.height=a,c.getContext("2d").drawImage(r,0,0,s,a),r=c,s=Math.round(s/l),a=Math.round(a/l)}return r}setPreviewURL(e,n){this.uppy.setFileState(e,{preview:n})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).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(e){return aa(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(n=>{this.setPreviewURL(e.id,n),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),n)}).catch(n=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(n,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),n)}):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)}};nr.VERSION=oP.version;function dP(t){if(typeof t=="string"){let e=document.querySelectorAll(t);return e.length===0?null:Array.from(e)}return typeof t=="object"&&Jr(t)?[t]:null}var yd=dP;var ui=Array.from;function ma(t,e,n,i){let{onSuccess:r}=i;t.readEntries(o=>{let s=[...e,...o];o.length?queueMicrotask(()=>{ma(t,s,n,{onSuccess:r})}):r(s)},o=>{n(o),r(e)})}function hg(t,e){return t==null?t:{kind:t.isFile?"file":t.isDirectory?"directory":void 0,name:t.name,getFile(){return new Promise((i,r)=>t.file(i,r))},values(){return Ao(this,null,function*(){let i=t.createReader(),r=yield new Pn(new Promise(o=>{ma(i,[],e,{onSuccess:s=>o(s.map(a=>hg(a,e)))})}));yield*No(r)})},isSameEntry:void 0}}function fg(t,e,n){try{return n===void 0&&(n=void 0),function(){return Ao(this,null,function*(){let i=()=>`${e}/${t.name}`;if(t.kind==="file"){let l=yield new Pn(t.getFile());l!=null?(l.relativePath=e?i():null,yield l):n!=null&&(yield n)}else if(t.kind==="directory")try{for(var r=zo(t.values()),o,s,a;o=!(s=yield new Pn(r.next())).done;o=!1){let l=s.value;yield*No(fg(l,e?i():t.name))}}catch{a=[s]}finally{try{o&&(s=r.return)&&(yield new Pn(s.call(r)))}finally{if(a)throw a[0]}}else n!=null&&(yield n)})}()}catch(i){return Promise.reject(i)}}function vd(t,e){return Ao(this,null,function*(){let n=yield new Pn(Promise.all(Array.from(t.items,i=>F(this,null,function*(){var r;let o,s=()=>typeof i.getAsEntry=="function"?i.getAsEntry():i.webkitGetAsEntry();return(r=o)!=null||(o=hg(s(),e)),{fileSystemHandle:o,lastResortFile:i.getAsFile()}}))));for(let{lastResortFile:i,fileSystemHandle:r}of n)if(r!=null)try{yield*No(fg(r,"",i))}catch(o){i!=null?yield i:e(o)}else i!=null&&(yield i)})}function bd(t){let e=ui(t.files);return Promise.resolve(e)}function fo(t,e){return F(this,null,function*(){var n;let i=(n=e?.logDropError)!=null?n:Function.prototype;try{let l=[];try{for(var r=zo(vd(t,i)),o,s,a;o=!(s=yield r.next()).done;o=!1){let c=s.value;l.push(c)}}catch{a=[s]}finally{try{o&&(s=r.return)&&(yield s.call(r))}finally{if(a)throw a[0]}}return l}catch{return bd(t)}})}var $g=ge(dt(),1);function mo(t){return E(b({},t),{type:t.mimeType,extension:t.name?nn(t.name).extension:null})}var go,Re,_d,mg,yo=0,Cg=[],ze=_e,gg=ze.__b,yg=ze.__r,vg=ze.diffed,bg=ze.__c,_g=ze.unmount,wg=ze.__;function xd(t,e){ze.__h&&ze.__h(Re,t,yo||e),yo=0;var n=Re.__H||(Re.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function pi(t){return yo=1,uP(Pg,t)}function uP(t,e,n){var i=xd(go++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):Pg(void 0,e),function(a){var l=i.__N?i.__N[0]:i.__[0],c=i.t(l,a);l!==c&&(i.__N=[c,i.__[1]],i.__c.setState({}))}],i.__c=Re,!Re.u)){var r=function(a,l,c){if(!i.__c.__H)return!0;var d=i.__c.__H.__.filter(function(g){return!!g.__c});if(d.every(function(g){return!g.__N}))return!o||o.call(this,a,l,c);var p=!1;return d.forEach(function(g){if(g.__N){var h=g.__[0];g.__=g.__N,g.__N=void 0,h!==g.__[0]&&(p=!0)}}),!(!p&&i.__c.props===a)&&(!o||o.call(this,a,l,c))};Re.u=!0;var o=Re.shouldComponentUpdate,s=Re.componentWillUpdate;Re.componentWillUpdate=function(a,l,c){if(this.__e){var d=o;o=void 0,r(a,l,c),o=d}s&&s.call(this,a,l,c)},Re.shouldComponentUpdate=r}return i.__N||i.__}function Ei(t,e){var n=xd(go++,3);!ze.__s&&Sg(n.__H,e)&&(n.__=t,n.i=e,Re.__H.__h.push(n))}function rr(t){return yo=5,fn(function(){return{current:t}},[])}function fn(t,e){var n=xd(go++,7);return Sg(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function or(t,e){return yo=8,fn(function(){return t},e)}function pP(){for(var t;t=Cg.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ga),t.__H.__h.forEach(wd),t.__H.__h=[]}catch(e){t.__H.__h=[],ze.__e(e,t.__v)}}ze.__b=function(t){Re=null,gg&&gg(t)},ze.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),wg&&wg(t,e)},ze.__r=function(t){yg&&yg(t),go=0;var e=(Re=t.__c).__H;e&&(_d===Re?(e.__h=[],Re.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(ga),e.__h.forEach(wd),e.__h=[],go=0)),_d=Re},ze.diffed=function(t){vg&&vg(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Cg.push(e)!==1&&mg===ze.requestAnimationFrame||((mg=ze.requestAnimationFrame)||hP)(pP)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),_d=Re=null},ze.__c=function(t,e){e.some(function(n){try{n.__h.forEach(ga),n.__h=n.__h.filter(function(i){return!i.__||wd(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],ze.__e(i,n.__v)}}),bg&&bg(t,e)},ze.unmount=function(t){_g&&_g(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{ga(i)}catch(r){e=r}}),n.__H=void 0,e&&ze.__e(e,n.__v))};var xg=typeof requestAnimationFrame=="function";function hP(t){var e,n=function(){clearTimeout(i),xg&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);xg&&(e=requestAnimationFrame(n))}function ga(t){var e=Re,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Re=e}function wd(t){var e=Re;t.__c=t.__(),Re=e}function Sg(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function Pg(t,e){return typeof e=="function"?e(t):e}function fP(){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 mP(t){let{pluginName:e,i18n:n,onAuth:i}=t,r=e==="Google Drive",o=or(s=>{s.preventDefault(),i()},[i]);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(fP,null),n("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},n("authenticateWith",{pluginName:e})))}var gP=t=>{let{pluginName:e,i18n:n,onAuth:i}=t;return u(mP,{pluginName:e,i18n:n,onAuth:i})};function Cd(t){let{loading:e,pluginName:n,pluginIcon:i,i18n:r,handleAuth:o,renderForm:s=gP}=t;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},i()),u("div",{className:"uppy-Provider-authTitle"},r("authenticateWithTitle",{pluginName:n})),u("div",{className:"uppy-Provider-authForm"},s({pluginName:n,i18n:r,loading:e,onAuth:o})))}var Eg=ge(dt(),1);function Sd(t){let{i18n:e,logout:n,username:i}=t;return u(Gt,null,i&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},i),u("button",{type:"button",onClick:n,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Pd(t){let{openFolder:e,title:n,breadcrumbsIcon:i,breadcrumbs:r,i18n:o}=t;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},i),r.map((s,a)=>{var l;return u(Gt,null,u("button",{key:s.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(s.id)},s.type==="root"?n:(l=s.data.name)!=null?l:o("unnamed")),r.length===a+1?"":" / ")}))}function Ed(t){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,Eg.default)("uppy-ProviderBrowser-headerBar",!t.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},t.showBreadcrumbs&&u(Pd,{openFolder:t.openFolder,breadcrumbs:t.breadcrumbs,breadcrumbsIcon:t.pluginIcon&&t.pluginIcon(),title:t.title,i18n:t.i18n}),u(Sd,{logout:t.logout,username:t.username,i18n:t.i18n})))}function Dd(){return Dd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Dd.apply(null,arguments)}var yP={position:"relative",width:"100%",minHeight:"100%"},vP={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},kd=class extends _t{constructor(e){super(e),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:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let C=e,{data:n,rowHeight:i,renderRow:r,overscanCount:o=10}=C,s=Sn(C,["data","rowHeight","renderRow","overscanCount"]),{offset:a,height:l}=this.state,c=Math.floor(a/i),d=Math.floor(l/i);o&&(c=Math.max(0,c-c%o),d+=o);let p=c+d+4,g=n.slice(c,p),h=E(b({},yP),{height:n.length*i}),v=E(b({},vP),{top:c*i});return u("div",Dd({onScroll:this.handleScroll},s),u("div",{role:"presentation",style:h},u("div",{role:"presentation",style:v},g.map(r))))}},ya=kd;var Dg=ge(dt(),1);function bP(){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 _P(){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 wP(){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 sr(t){let{itemIconString:e,alt:n=void 0}=t;if(e===null)return null;switch(e){case"file":return u(bP,null);case"folder":return u(_P,null);case"video":return u(wP,null);default:return u("img",{src:e,alt:n,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function xP(t){var e,n;let{file:i,toggleCheckbox:r,className:o,isDisabled:s,restrictionError:a,showTitles:l,children:c=null,i18n:d}=t;return u("li",{className:o,title:s&&a?a:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:r,name:"listitem",id:i.id,checked:i.status==="checked",disabled:s,"data-uppy-super-focusable":!0}),u("label",{htmlFor:i.id,"aria-label":(e=i.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(sr,{itemIconString:i.data.thumbnail||i.data.icon}),l&&((n=i.data.name)!=null?n:d("unnamed")),c))}var Td=xP;function Id(t){var e,n,i;let{file:r,openFolder:o,className:s,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:p}=t;return u("li",{className:s,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:(e=r.data.name)!=null?e:p("unnamed")}):null,disabled:a,"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:(n=r.data.name)!=null?n:p("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(sr,{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(sr,{itemIconString:r.data.icon})),d&&((i=r.data.name)!=null?i:p("unnamed"))))}function Od(t){let{viewType:e,toggleCheckbox:n,showTitles:i,i18n:r,openFolder:o,file:s}=t,a=s.type==="folder"?null:s.restrictionError,l=!!a&&s.status!=="checked",c={file:s,openFolder:o,toggleCheckbox:n,i18n:r,viewType:e,showTitles:i,className:(0,Dg.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":l},{"uppy-ProviderBrowserItem--noPreview":s.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":s.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":s.status==="partial"}),isDisabled:l,restrictionError:a};switch(e){case"grid":return u(Td,c);case"list":return u(Id,c);case"unsplash":return u(Td,c,u("a",{href:`${s.data.author.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},s.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function CP(t){let{displayedPartialTree:e,viewType:n,toggleCheckbox:i,handleScroll:r,showTitles:o,i18n:s,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d}=t,[p,g]=pi(!1);if(Ei(()=>{let v=R=>{R.key==="Shift"&&g(!1)},C=R=>{R.key==="Shift"&&g(!0)};return document.addEventListener("keyup",v),document.addEventListener("keydown",C),()=>{document.removeEventListener("keyup",v),document.removeEventListener("keydown",C)}},[]),a)return u("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:s("loading"));if(e.length===0)return u("div",{className:"uppy-Provider-empty"},c);let h=v=>u(Od,{viewType:n,toggleCheckbox:C=>{var R;C.stopPropagation(),C.preventDefault(),(R=document.getSelection())==null||R.removeAllRanges(),i(v,p)},showTitles:o,i18n:s,openFolder:l,file:v});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(ya,{data:e,renderRow:h,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,role:"listbox",tabIndex:-1},e.map(h)))}var va=CP;var SP=(t,e,n,i,r)=>{let o=e.filter(h=>h.isFolder===!0),s=e.filter(h=>h.isFolder===!1),a=n.type==="folder"&&n.status==="checked",l=o.map(h=>({type:"folder",id:h.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:n.id,data:h})),c=s.map(h=>{let v=r(h);return{type:"file",id:h.requestPath,restrictionError:v,status:a&&!v?"checked":"unchecked",parentId:n.id,data:h}}),d=E(b({},n),{cached:!0,nextPagePath:i});return[...t.map(h=>h.id===d.id?d:h),...l,...c]},kg=SP;var PP=(t,e,n,i,r)=>{let o=t.find(v=>v.id===e),s=n.filter(v=>v.isFolder===!0),a=n.filter(v=>v.isFolder===!1),l=E(b({},o),{nextPagePath:i}),c=t.map(v=>v.id===l.id?l:v),d=l.type==="folder"&&l.status==="checked",p=s.map(v=>({type:"folder",id:v.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:v})),g=a.map(v=>{let C=r(v);return{type:"file",id:v.requestPath,restrictionError:C,status:d&&!C?"checked":"unchecked",parentId:l.id,data:v}});return[...c,...p,...g]},Tg=PP;var EP=t=>t.map(e=>b({},e)),ba=EP;var Fd=(t,e,n)=>{t.filter(r=>r.type!=="root"&&r.parentId===e).forEach(r=>{r.status=n&&!(r.type==="file"&&r.restrictionError)?"checked":"unchecked",Fd(t,r.id,n)})},Rd=(t,e)=>{let n=t.find(s=>s.id===e);if(n.type==="root")return;let i=t.filter(s=>s.type!=="root"&&s.parentId===n.id&&!(s.type==="file"&&s.restrictionError)),r=i.every(s=>s.status==="checked"),o=i.every(s=>s.status==="unchecked");r?n.status="checked":o?n.status="unchecked":n.status="partial",Rd(t,n.parentId)},DP=(t,e)=>{let n=ba(t);if(e.length>=2){let i=n.filter(r=>r.type!=="root"&&e.includes(r.id));i.forEach(r=>{r.type==="file"?r.status=r.restrictionError?"unchecked":"checked":r.status="checked"}),i.forEach(r=>{Fd(n,r.id,!0)}),Rd(n,i[0].parentId)}else{let i=n.find(r=>r.id===e[0]);i.status=i.status==="checked"?"unchecked":"checked",Fd(n,i.id,i.status==="checked"),Rd(n,i.parentId)}return n},Ig=DP;var Bd=ge(Fg(),1);var bo=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Ad=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Rg=t=>globalThis.DOMException===void 0?new Ad(t):new DOMException(t),Mg=t=>{let e=t.reason===void 0?Rg("This operation was aborted."):t.reason;return e instanceof Error?e:Rg(e)};function Nd(t,e){let{milliseconds:n,fallback:i,message:r,customTimers:o={setTimeout,clearTimeout}}=e,s,l=new Promise((c,d)=>{if(typeof n!="number"||Math.sign(n)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(e.signal){let{signal:g}=e;g.aborted&&d(Mg(g)),g.addEventListener("abort",()=>{d(Mg(g))})}if(n===Number.POSITIVE_INFINITY){t.then(c,d);return}let p=new bo;s=o.setTimeout.call(void 0,()=>{if(i){try{c(i())}catch(g){d(g)}return}typeof t.cancel=="function"&&t.cancel(),r===!1?c():r instanceof Error?d(r):(p.message=r??`Promise timed out after ${n} milliseconds`,d(p))},n),F(this,null,function*(){try{c(yield t)}catch(g){d(g)}})}).finally(()=>{l.clear()});return l.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},l}function zd(t,e,n){let i=0,r=t.length;for(;r>0;){let o=Math.trunc(r/2),s=i+o;n(t[s],e)<=0?(i=++s,r-=o+1):r=o}return i}var wa=class{#e=[];enqueue(e,n){n=b({priority:0},n);let i={priority:n.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=n.priority){this.#e.push(i);return}let r=zd(this.#e,i,(o,s)=>s.priority-o.priority);this.#e.splice(r,0,i)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(n=>n.priority===e.priority).map(n=>n.run)}get size(){return this.#e.length}};var xa=class extends Bd.default{#e;#s;#o=0;#h;#a;#f=0;#i;#l;#t;#m;#n=0;#c;#r;#g;timeout;constructor(e){if(super(),e=b({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:wa},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#s=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#h=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#r=e.autoStart===!1}get#b(){return this.#s||this.#o<this.#h}get#_(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#x(){this.#v(),this.#y(),this.#l=void 0}get#C(){let e=Date.now();if(this.#i===void 0){let n=this.#f-e;if(n<0)this.#o=this.#e?this.#n:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#x()},n)),!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 e=!this.#C;if(this.#b&&this.#_){let n=this.#t.dequeue();return n?(this.emit("active"),n(),e&&this.#y(),!0):!1}}return!1}#y(){this.#s||this.#i!==void 0||(this.#i=setInterval(()=>{this.#v()},this.#a),this.#f=Date.now()+this.#a)}#v(){this.#o===0&&this.#n===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#o=this.#e?this.#n:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#u()}#S(e){return F(this,null,function*(){return new Promise((n,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})})}add(i){return F(this,arguments,function*(e,n={}){return n=b({timeout:this.timeout,throwOnTimeout:this.#g},n),new Promise((r,o)=>{this.#t.enqueue(()=>F(this,null,function*(){this.#n++,this.#o++;try{n.signal?.throwIfAborted();let s=e({signal:n.signal});n.timeout&&(s=Nd(Promise.resolve(s),{milliseconds:n.timeout})),n.signal&&(s=Promise.race([s,this.#S(n.signal)]));let a=yield s;r(a),this.emit("completed",a)}catch(s){if(s instanceof bo&&!n.throwOnTimeout){r();return}o(s),this.emit("error",s)}finally{this.#w()}}),n),this.emit("add"),this.#d()})})}addAll(e,n){return F(this,null,function*(){return Promise.all(e.map(i=>F(this,null,function*(){return this.add(i,n)})))})}start(){return this.#r?(this.#r=!1,this.#u(),this):this}pause(){this.#r=!0}clear(){this.#t=new this.#m}onEmpty(){return F(this,null,function*(){this.#t.size!==0&&(yield this.#p("empty"))})}onSizeLessThan(e){return F(this,null,function*(){this.#t.size<e||(yield this.#p("next",()=>this.#t.size<e))})}onIdle(){return F(this,null,function*(){this.#n===0&&this.#t.size===0||(yield this.#p("idle"))})}#p(e,n){return F(this,null,function*(){return new Promise(i=>{let r=()=>{n&&!n()||(this.off(e,r),i())};this.on(e,r)})})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#r}};var Bg=(t,e,n,i,r)=>F(void 0,null,function*(){let o=[],s=n.cached?n.nextPagePath:n.id;for(;s;){let p=yield i(s);o=o.concat(p.items),s=p.nextPagePath}let a=o.filter(p=>p.isFolder===!0),l=o.filter(p=>p.isFolder===!1),c=a.map(p=>({type:"folder",id:p.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:n.id,data:p})),d=l.map(p=>{let g=r(p);return{type:"file",id:p.requestPath,restrictionError:g,status:g?"unchecked":"checked",parentId:n.id,data:p}});n.cached=!0,n.nextPagePath=null,e.push(...d,...c),c.forEach(p=>F(void 0,null,function*(){t.add(()=>Bg(t,e,p,i,r))}))}),IP=(t,e,n,i)=>F(void 0,null,function*(){let r=new xa({concurrency:6}),o=ba(t);return o.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{r.add(()=>Bg(r,o,a,e,n))}),r.on("completed",()=>{let a=o.filter(l=>l.type==="file"&&l.status==="checked").length;i(a)}),yield r.onIdle(),o}),Ag=IP;var mn={afterOpenFolder:kg,afterScrollFolder:Tg,afterToggleCheckbox:Ig,afterFill:Ag};var OP=t=>{let{scrollHeight:e,scrollTop:n,offsetHeight:i}=t.target;return e-(n+i)<50},Ca=OP;var FP=t=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){t.log("Aborting request","warning");return}t.log(e,"error"),e.name==="UserFacingApiError"&&t.info({message:t.i18n("companionError"),details:t.i18n(e.message)},"warning",5e3)}},Di=FP;var RP=(t,e,n,i)=>{let r=e.findIndex(o=>o.id===i);if(r!==-1&&n){let o=e.findIndex(a=>a.id===t);return e.slice(Math.min(r,o),Math.max(r,o)+1).map(a=>a.id)}return[t]},Sa=RP;var MP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ng=(t=21)=>{let e="",n=t;for(;n--;)e+=MP[Math.random()*64|0];return e};function BP(t){let{searchString:e,setSearchString:n,submitSearchString:i,wrapperClassName:r,inputClassName:o,inputLabel:s,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=t,p=v=>{n(v.target.value)},g=or(v=>{v.preventDefault(),i()},[i]),[h]=pi(()=>{let v=document.createElement("form");return v.setAttribute("tabindex","-1"),v.id=Ng(),v});return Ei(()=>(document.body.appendChild(h),h.addEventListener("submit",g),()=>{h.removeEventListener("submit",g),document.body.removeChild(h)}),[h,g]),u("section",{className:r},u("input",{className:`uppy-u-reset ${o}`,type:"search","aria-label":s,placeholder:s,value:e,onInput:p,form:h.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&&e&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>n("")},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:h.id},c))}var _o=BP;var Lg=ge(dt(),1);var AP=t=>t.filter(n=>n.type==="file"&&n.status==="checked"?!0:n.type==="folder"&&n.status==="checked"?!t.some(r=>r.type!=="root"&&r.parentId===n.id):!1).length,zg=AP;function wo(t){let{cancelSelection:e,donePicking:n,i18n:i,partialTree:r,validateAggregateRestrictions:o}=t,s=fn(()=>o(r),[r,o]),a=fn(()=>zg(r),[r]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,Lg.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":s}),disabled:!!s,onClick:n,type:"button"},i("selectX",{smart_count:a})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},i("cancel"))),s&&u("div",{className:"uppy-ProviderBrowser-footer-error"},s))}var NP=(t,e,n)=>{var i,r;return{id:t.id,source:e.id,name:t.name||t.id,type:t.mimeType,isRemote:!0,data:t,preview:t.thumbnail||void 0,meta:{authorName:(i=t.author)==null?void 0:i.name,authorUrl:(r=t.author)==null?void 0:r.url,relativePath:t.relDirPath||null,absolutePath:t.absDirPath},body:{fileId:t.id},remote:{companionUrl:e.opts.companionUrl,url:`${n.fileUrl(t.requestPath)}`,body:{fileId:t.id},providerName:n.name,provider:n.provider,requestClientId:n.provider}}},Hg=NP;var zP=(t,e,n)=>{let i=t.map(s=>Hg(s,e,n)),r=[],o=[];i.forEach(s=>{e.uppy.checkIfFileAlreadyExists(Ws(s,e.uppy.getID()))?o.push(s):r.push(s)}),r.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:r.length})),o.length>0&&e.uppy.info(`Not adding ${o.length} files because they already exist`),e.uppy.addFiles(r)},Pa=zP;var jg=(t,e,n)=>{let i=e===null?"null":e;if(n[i])return n[i];let r=t.find(s=>s.id===e);if(r.type==="root")return[];let o=[...jg(t,r.parentId,n),r];return n[i]=o,o},LP=t=>{let e=Object.create(null);return t.filter(r=>r.type==="file"&&r.status==="checked").map(r=>{let o=jg(t,r.id,e),s=o.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=o.slice(s),l=`/${o.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return E(b({},r.data),{absDirPath:l,relDirPath:c})})},Ea=LP;var HP=(t,e)=>{let n=t.find(r=>r.id===e),i=[];for(;i=[n,...i],n.type!=="root";){let r=n.parentId;n=t.find(o=>o.id===r)}return i},Vg=HP;function $i(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var jP=0;function Wg(t){return"__private_"+jP+++"_"+t}var VP={version:"4.0.1"};function Co(){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 Ug=t=>({authenticated:void 0,partialTree:[{type:"root",id:t,cached:!1,nextPagePath:null}],currentFolderId:t,searchString:"",didFirstRender:!1,username:null,loading:!1}),gn=Wg("abortController"),ei=Wg("withAbort"),xo=class{constructor(e,n){Object.defineProperty(this,ei,{value:UP}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,gn,{writable:!0,value:void 0}),this.validateSingleFile=r=>{let o=mo(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r,currentFolderId:o,searchString:s}=this.plugin.getPluginState(),a=r.filter(c=>c.type!=="root"&&c.parentId===o);return s===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(s.toLowerCase())!==-1})},this.validateAggregateRestrictions=r=>{let s=r.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(s)},this.plugin=e,this.provider=n.provider;let i={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=b(b({},i),n),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(Ug(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),n=e.map(i=>i.type==="root"?i:E(b({},i),{status:"unchecked"}));this.plugin.setPluginState({partialTree:n})}openFolder(e){return F(this,null,function*(){this.lastCheckbox=null;let{partialTree:n}=this.plugin.getPluginState(),i=n.find(r=>r.id===e);if(i.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),yield $i(this,ei)[ei](r=>F(this,null,function*(){let o=e,s=[];do{let{username:l,nextPagePath:c,items:d}=yield this.provider.list(o,{signal:r});this.plugin.setPluginState({username:l}),o=c,s=s.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:s.length}))}while(this.opts.loadAllFiles&&o);let a=mn.afterOpenFolder(n,s,i,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})})).catch(Di(this.plugin.uppy)),this.setLoading(!1)})}logout(){return F(this,null,function*(){yield $i(this,ei)[ei](e=>F(this,null,function*(){let n=yield this.provider.logout({signal:e});if(n.ok){if(!n.revoked){let i=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:n.manual_revoke_url});this.plugin.uppy.info(i,"info",7e3)}this.plugin.setPluginState(E(b({},Ug(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(Di(this.plugin.uppy))})}handleAuth(e){return F(this,null,function*(){yield $i(this,ei)[ei](n=>F(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:e,signal:n}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(Di(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(e){return F(this,null,function*(){let{partialTree:n,currentFolderId:i}=this.plugin.getPluginState(),r=n.find(o=>o.id===i);Ca(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,yield $i(this,ei)[ei](o=>F(this,null,function*(){let{nextPagePath:s,items:a}=yield this.provider.list(r.nextPagePath,{signal:o}),l=mn.afterScrollFolder(n,i,a,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(Di(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return F(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),yield $i(this,ei)[ei](n=>F(this,null,function*(){let i=yield mn.afterFill(e,s=>this.provider.list(s,{signal:n}),this.validateSingleFile,s=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:s}))});if(this.validateAggregateRestrictions(i)){this.plugin.setPluginState({partialTree:i});return}let o=Ea(i);Pa(o,this.plugin,this.provider),this.resetPluginState()})).catch(Di(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(e,n){let{partialTree:i}=this.plugin.getPluginState(),r=Sa(e.id,this.getDisplayedPartialTree(),n,this.lastCheckbox),o=mn.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,n){n===void 0&&(n={});let{didFirstRender:i}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let o=b(b({},this.opts),n),{authenticated:s,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||Co;if(s===!1)return u(Cd,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:o.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:p,searchString:g}=this.plugin.getPluginState(),h=Vg(c,d);return u("div",{className:(0,$g.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`)},u(Ed,{showBreadcrumbs:o.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:h,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:p,i18n:r}),o.showFilter&&u(_o,{searchString:g,setSearchString:v=>{this.plugin.setPluginState({searchString:v})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(va,{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:a}),u(wo,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function UP(t){return F(this,null,function*(){var e;(e=$i(this,gn)[gn])==null||e.abort();let n=new AbortController;$i(this,gn)[gn]=n;let i=()=>{n.abort()};try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),yield t(n.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),$i(this,gn)[gn]=void 0}})}xo.VERSION=VP.version;var qg=ge(dt(),1);var WP={version:"4.0.1"},$P={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},ar=class{constructor(e,n){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=r=>{let o=mo(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r}=this.plugin.getPluginState();return r.filter(o=>o.type!=="root")},this.setSearchString=r=>{this.plugin.setPluginState({searchString:r}),r===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=r=>{let s=r.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(s)},this.plugin=e,this.provider=n.provider;let i={viewType:"grid",showTitles:!0,showFilter:!0};this.opts=b(b({},i),n),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(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState($P)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),n=e.map(i=>i.type==="root"?i:E(b({},i),{status:"unchecked"}));this.plugin.setPluginState({partialTree:n})}search(){return F(this,null,function*(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let n=yield this.provider.search(e),i=[{type:"root",id:null,cached:!1,nextPagePath:n.nextPageQuery},...n.items.map(r=>({type:"file",id:r.requestPath,status:"unchecked",parentId:null,data:r}))];this.plugin.setPluginState({partialTree:i,isInputMode:!1})}catch(n){Di(this.plugin.uppy)(n)}this.setLoading(!1)}})}handleScroll(e){return F(this,null,function*(){let{partialTree:n,searchString:i}=this.plugin.getPluginState(),r=n.find(o=>o.type==="root");if(Ca(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let o=yield this.provider.search(i,r.nextPagePath),s=E(b({},r),{nextPagePath:o.nextPageQuery}),a=n.filter(c=>c.type!=="root"),l=[s,...a,...o.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(o){Di(this.plugin.uppy)(o)}this.isHandlingScroll=!1}})}donePicking(){return F(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState(),n=Ea(e);Pa(n,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,n){let{partialTree:i}=this.plugin.getPluginState(),r=Sa(e.id,this.getDisplayedPartialTree(),n,this.lastCheckbox),o=mn.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,n){n===void 0&&(n={});let{isInputMode:i,searchString:r,loading:o,partialTree:s}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l=b(b({},this.opts),n);return i?u(_o,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,qg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(_o,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(va,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>F(this,null,function*(){}),noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:o,i18n:a,virtualList:!1}),u(wo,{partialTree:s,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};ar.VERSION=WP.version;var qP="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Da=(t=21)=>{let e="",n=t;for(;n--;)e+=qP[Math.random()*64|0];return e};var Gg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function GP(t,e){return!!(t===e||Gg(t)&&Gg(e))}function XP(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!GP(t[n],e[n]))return!1;return!0}function Ld(t,e){e===void 0&&(e=XP);var n=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&e(r,n.lastArgs))return n.lastResult;var s=t.apply(this,r);return n={lastResult:s,lastArgs:r,lastThis:this},s}return i.clear=function(){n=null},i}var ka=['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 So(t,e){if(e){let n=t.querySelector(`[data-uppy-paneltype="${e}"]`);if(n)return n}return t}function Xg(t,e){let n=e[0];n&&(n.focus(),t.preventDefault())}function YP(t,e){let n=e[e.length-1];n&&(n.focus(),t.preventDefault())}function KP(t){return t.contains(document.activeElement)}function Hd(t,e,n){let i=So(n,e),r=ui(i.querySelectorAll(ka)),o=r.indexOf(document.activeElement);KP(i)?t.shiftKey&&o===0?YP(t,r):!t.shiftKey&&o===r.length-1&&Xg(t,r):Xg(t,r)}function Yg(t,e,n){e===null||Hd(t,e,n)}var Kg=ge(Ic(),1);function jd(){let t=!1;return(0,Kg.default)((n,i)=>{let r=So(n,i),o=r.contains(document.activeElement);if(o&&t)return;let s=r.querySelector("[data-uppy-super-focusable]");if(!(o&&!s))if(s)s.focus({preventScroll:!0}),t=!0;else{let a=r.querySelector(ka);a?.focus({preventScroll:!0}),t=!1}},260)}var f0=ge(dt(),1);function Po(){let t=document.body;return!(!("draggable"in t)||!("ondragstart"in t&&"ondrop"in t)||!("FormData"in window)||!("FileReader"in window))}var e0=ge(dt(),1);function Qg(t,e){if(t===e)return!0;if(!t||!e)return!1;let n=Object.keys(t),i=Object.keys(e),r=n.length;if(i.length!==r)return!1;for(let o=0;o<r;o++){let s=n[o];if(t[s]!==e[s]||!Object.prototype.hasOwnProperty.call(e,s))return!1}return!0}function ZP(){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 JP(){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 e2(){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 t2(){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 i2(){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 n2(){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 r2(){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 yn(t){let e={color:"#838999",icon:n2()};if(!t)return e;let n=t.split("/")[0],i=t.split("/")[1];return n==="text"?{color:"#5a5e69",icon:r2()}:n==="image"?{color:"#686de0",icon:ZP()}:n==="audio"?{color:"#068dbb",icon:JP()}:n==="video"?{color:"#19af67",icon:e2()}:n==="application"&&i==="pdf"?{color:"#e25149",icon:t2()}:n==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(i)!==-1?{color:"#00C469",icon:i2()}:e}function Eo(t){let{file:e}=t;if(e.preview)return u("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:n,icon:i}=yn(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:n}},i),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 o2=(t,e)=>(typeof e=="function"?e():e).filter(r=>r.id===t)[0].name;function Do(t){let{file:e,toggleFileCard:n,i18n:i,metaFields:r}=t,{missingRequiredMetaFields:o}=e;if(!(o!=null&&o.length))return null;let s=o.map(a=>o2(a,r)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},i("missingRequiredMetaFields",{smart_count:o.length,fields:s})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>n(!0,e.id)},i("editFile")))}function Vd(t){let{file:e,i18n:n,toggleFileCard:i,metaFields:r,showLinkToFileUploadResult:o}=t,a=e.preview?"rgba(255, 255, 255, 0.5)":yn(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},o&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u(Eo,{file:e}),u(Do,{file:e,i18n:n,toggleFileCard:i,metaFields:r}))}function s2(t){if(!t.isUploaded){if(t.error&&!t.hideRetryButton){t.uppy.retryUpload(t.file.id);return}t.resumableUploads&&!t.hidePauseResumeButton?t.uppy.pauseResume(t.file.id):t.individualCancellation&&!t.hideCancelButton&&t.uppy.removeFile(t.file.id)}}function Zg(t){return t.isUploaded?t.i18n("uploadComplete"):t.error?t.i18n("retryUpload"):t.resumableUploads?t.file.isPaused?t.i18n("resumeUpload"):t.i18n("pauseUpload"):t.individualCancellation?t.i18n("cancelUpload"):""}function Ud(t){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":Zg(t),title:Zg(t),onClick:()=>s2(t)},t.children))}function Ta(t){let{children:e}=t;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"},e)}function Wd(t){let{progress:e}=t,n=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":n,"stroke-dashoffset":n-n/100*e}))}function $d(t){return!t.file.progress.uploadStarted||t.file.progress.percentage===void 0?null:t.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(Ta,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"})))):t.recoveredState?null:t.error&&!t.hideRetryButton?u(Ud,t,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"}))):t.resumableUploads&&!t.hidePauseResumeButton?u(Ud,t,u(Ta,null,u(Wd,{progress:t.file.progress.percentage}),t.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"})))):!t.resumableUploads&&t.individualCancellation&&!t.hideCancelButton?u(Ud,t,u(Ta,null,u(Wd,{progress:t.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(Ta,null,u(Wd,{progress:t.file.progress.percentage}))))}var Jg=ge($s(),1);var qd="...";function Ia(t,e){if(e===0)return"";if(t.length<=e)return t;if(e<=qd.length+1)return`${t.slice(0,e-1)}\u2026`;let n=e-qd.length,i=Math.ceil(n/2),r=Math.floor(n/2);return t.slice(0,i)+qd+t.slice(-r)}var a2=t=>{let{author:e,name:n}=t.file.meta;function i(){return t.isSingleFile&&t.containerHeight>=350?90:t.containerWidth<=352?35:t.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:n},Ia(n,i()))},l2=t=>{var e;let{author:n}=t.file.meta,i=(e=t.file.remote)==null?void 0:e.providerName,r="\xB7";return n?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${n.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Ia(n.name,13)),i?u(Fragment,null,` ${r} `,i,` ${r} `):null):null},c2=t=>t.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Jg.default)(t.file.size)),d2=t=>t.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>t.toggleAddFilesPanel(!0)},t.i18n("reSelect"))),u2=t=>{let{file:e,onClick:n}=t;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:n,type:"button"},"?"):null};function Gd(t){let{file:e,i18n:n,toggleFileCard:i,metaFields:r,toggleAddFilesPanel:o,isSingleFile:s,containerHeight:a,containerWidth:l}=t;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},a2({file:e,isSingleFile:s,containerHeight:a,containerWidth:l}),u(u2,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},l2({file:e}),c2({file:e}),d2({file:e,toggleAddFilesPanel:o,i18n:n})),u(Do,{file:e,i18n:n,toggleFileCard:i,metaFields:r}))}function Xd(t,e){return e===void 0&&(e="Copy the URL below"),new Promise(n=>{let i=document.createElement("textarea");i.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),i.value=t,document.body.appendChild(i),i.select();let r=()=>{document.body.removeChild(i),window.prompt(e,t),n()};try{return document.execCommand("copy")?(document.body.removeChild(i),n()):r()}catch{return document.body.removeChild(i),r()}})}function p2(t){let{file:e,uploadInProgressOrComplete:n,metaFields:i,canEditFile:r,i18n:o,onClick:s}=t;return!n&&i&&i.length>0||!n&&r(e)?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:e.meta.name}),title:o("editFileWithFilename",{file:e.meta.name}),onClick:()=>s()},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 h2(t){let{i18n:e,onClick:n,file:i}=t;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:i.meta.name}),title:e("removeFile",{file:i.meta.name}),onClick:()=>n()},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 f2(t){let{file:e,uppy:n,i18n:i}=t,r=o=>{Xd(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{n.log("Link copied to clipboard."),n.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(n.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":i("copyLink"),title:i("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 Yd(t){let{uppy:e,file:n,uploadInProgressOrComplete:i,canEditFile:r,metaFields:o,showLinkToFileUploadResult:s,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=t;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(p2,{i18n:l,file:n,uploadInProgressOrComplete:i,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,n.id):d(n)}}),s&&n.uploadURL?u(f2,{file:n,uppy:e,i18n:l}):null,a?u(h2,{i18n:l,file:n,onClick:()=>e.removeFile(n.id)}):null)}var Oa=class extends _t{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Qg(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,n=e.progress.preprocess||e.progress.postprocess,i=!!e.progress.uploadComplete&&!n&&!e.error,r=!!e.progress.uploadStarted||!!n,o=e.progress.uploadStarted&&!e.progress.uploadComplete||n,s=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!o)&&!i;i&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,e0.default)({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":n,"is-complete":i,"is-error":!!s,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(Vd,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u($d,{uppy:this.props.uppy,file:e,error:s,isUploaded:i,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(Gd,{file:e,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(Yd,{file:e,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 m2(t,e){let n=[],i=[];return t.forEach(r=>{i.length<e?i.push(r):(n.push(i),i=[r])}),i.length&&n.push(i),n}function Kd(t){let{id:e,i18n:n,uppy:i,files:r,resumableUploads:o,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,isSingleFile:g,toggleFileCard:h,handleRequestThumbnail:v,handleCancelThumbnail:C,recoveredState:R,individualCancellation:O,itemsPerRow:N,openFileEditor:Q,canEditFile:U,toggleAddFilesPanel:Y,containerWidth:_,containerHeight:x}=t,P=N===1?71:200,T=fn(()=>{let V=(Pe,fe)=>Number(r[fe].isGhost)-Number(r[Pe].isGhost),Z=Object.keys(r);return R&&Z.sort(V),m2(Z,N)},[r,N,R]),B=V=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:V[0]},V.map(Z=>u(Oa,{key:Z,uppy:i,id:e,i18n:n,resumableUploads:o,individualCancellation:O,hideRetryButton:s,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:p,recoveredState:R,isSingleFile:g,containerWidth:_,containerHeight:x,toggleFileCard:h,handleRequestThumbnail:v,handleCancelThumbnail:C,role:"listitem",openFileEditor:Q,canEditFile:U,toggleAddFilesPanel:Y,file:r[Z]})));return g?u("div",{class:"uppy-Dashboard-files"},B(T[0])):u(ya,{class:"uppy-Dashboard-files",role:"list",data:T,renderRow:B,rowHeight:P})}var Qd=class extends _t{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput.click()},this.triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,n)=>{var i;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(i=this.props.allowedFileTypes)==null?void 0:i.join(", "),ref:n})},this.renderHiddenCameraInput=(e,n,i)=>{let o={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:n,accept:o,ref:i})},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=(e,n)=>{let i=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:n,"data-uppy-super-focusable":i===0},e)},this.renderDropPasteBrowseTagline=e=>{let n=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=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"):e>0?this.props.i18nArray(`dropPasteImport${o}`,{browseFiles:n,browseFolders:i,browse:n}):this.props.i18nArray(`dropPaste${o}`,{browseFiles:n,browseFolders:i,browse:n}))},this.renderAcquirer=e=>{var n;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((n=this.props.activePickerPanel)==null?void 0:n.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let n=[...e],i=n.splice(e.length-2,e.length);return u(Gt,null,n.map(r=>this.renderAcquirer(r)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},i.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(e,n)=>{let{showNativePhotoCameraButton:i,showNativeVideoCameraButton:r}=this.props,o=[],s="myDevice";n||o.push({key:s,elements:this.renderMyDeviceAcquirer()}),i&&o.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&o.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),o.push(...e.map(p=>({key:p.id,elements:this.renderAcquirer(p)}))),o.length===1&&o[0].key===s&&(o=[]);let l=[...o],c=l.splice(o.length-2,o.length),d=p=>p.map(g=>{let{key:h,elements:v}=g;return u(Gt,{key:h},v)});return u(Gt,null,this.renderDropPasteBrowseTagline(o.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},d(l),u("span",{role:"presentation",style:{"white-space":"nowrap"}},d(c))))}}[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:e}=this.props,n=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")),i=e("poweredBy",{uppy:n});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},i)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:n,nativeCameraFacingMode:i}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),e&&this.renderHiddenCameraInput("photo",i,r=>{this.mobilePhotoFileInput=r}),n&&this.renderHiddenCameraInput("video",i,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(this.props)))}},Fa=Qd;var t0=ge(dt(),1);var g2=t=>u("div",{className:(0,t0.default)("uppy-Dashboard-AddFilesPanel",t.className),"data-uppy-panelType":"AddFiles","aria-hidden":!t.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},t.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>t.toggleAddFilesPanel(!1)},t.i18n("back"))),u(Fa,t)),i0=g2;var n0=ge(dt(),1);function y2(t){let{tagName:e}=t.target;if(e==="INPUT"||e==="TEXTAREA"){t.stopPropagation();return}t.preventDefault(),t.stopPropagation()}var hi=y2;function v2(t){let{activePickerPanel:e,className:n,hideAllPanels:i,i18n:r,state:o,uppy:s}=t,a=rr(null);return u("div",{className:(0,n0.default)("uppy-DashboardContent-panel",n),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:hi,onDragLeave:hi,onDrop:hi,onPaste:hi},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i},r("cancel"))),u("div",{ref:a,className:"uppy-DashboardContent-panelBody"},s.getPlugin(e.id).render(o,a.current)))}var r0=v2;var o0=ge(dt(),1);function b2(t){let e=t.files[t.fileCardFor],n=()=>{t.uppy.emit("file-editor:cancel",e),t.closeFileEditor()};return u("div",{className:(0,o0.default)("uppy-DashboardContent-panel",t.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"},t.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:n},t.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:t.saveFileEditor},t.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},t.editors.map(i=>t.uppy.getPlugin(i.id).render(t.state))))}var s0=b2;var fi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function _2(t,e,n,i){if(i===void 0&&(i={}),t)return fi.STATE_ERROR;if(e)return fi.STATE_COMPLETE;if(n)return fi.STATE_PAUSED;let r=fi.STATE_WAITING,o=Object.keys(i);for(let s=0;s<o.length;s++){let{progress:a}=i[o[s]];if(a.uploadStarted&&!a.uploadComplete)return fi.STATE_UPLOADING;a.preprocess&&r!==fi.STATE_UPLOADING&&(r=fi.STATE_PREPROCESSING),a.postprocess&&r!==fi.STATE_UPLOADING&&r!==fi.STATE_PREPROCESSING&&(r=fi.STATE_POSTPROCESSING)}return r}function w2(t){let{files:e,i18n:n,isAllComplete:i,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:s,newFiles:a,processingFiles:l}=t;switch(_2(r,i,o,e)){case"uploading":return n("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return n("processingXFiles",{smart_count:l.length});case"paused":return n("uploadPaused");case"waiting":return n("xFilesSelected",{smart_count:a.length});case"complete":return n("uploadComplete");case"error":return n("error");default:}}function x2(t){let{i18n:e,isAllComplete:n,hideCancelButton:i,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:s}=t,{allowNewUpload:a}=t;return a&&r&&(a=t.totalFileCount<t.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!n&&!i?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>s.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(w2,t)),a?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("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"},e("addMore"))):u("div",null))}var a0=x2;var l0=ge(dt(),1);function Zd(t){let{computedMetaFields:e,requiredMetaFields:n,updateMeta:i,form:r,formState:o}=t,s={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=n.includes(a.id);return u("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:o[a.id],onChange:d=>i(d,a.id),fieldCSSClasses:s,required:c,form:r.id},u):u("input",{className:s.text,id:l,form:r.id,type:a.type||"text",required:c,value:o[a.id],placeholder:a.placeholder,onInput:d=>i(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function Jd(t){var e;let{files:n,fileCardFor:i,toggleFileCard:r,saveFileCard:o,metaFields:s,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:p,canEditFile:g}=t,h=()=>typeof s=="function"?s(n[i]):s,v=n[i],C=(e=h())!=null?e:[],R=g(v),O={};C.forEach(P=>{var T;O[P.id]=(T=v.meta[P.id])!=null?T:""});let[N,Q]=pi(O),U=or(P=>{P.preventDefault(),o(N,i)},[o,N,i]),Y=(P,T)=>{Q(E(b({},N),{[T]:P}))},_=()=>{r(!1)},[x]=pi(()=>{let P=document.createElement("form");return P.setAttribute("tabindex","-1"),P.id=Da(),P});return Ei(()=>(document.body.appendChild(x),x.addEventListener("submit",U),()=>{x.removeEventListener("submit",U),document.body.removeChild(x)}),[x,U]),u("div",{className:(0,l0.default)("uppy-Dashboard-FileCard",p),"data-uppy-panelType":"FileCard",onDragOver:hi,onDragLeave:hi,onDrop:hi,onPaste:hi},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"},v.meta?v.meta.name:v.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:x.id,title:c("finishEditingFile"),onClick:_},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:yn(v.type).color}},u(Eo,{file:v}),R&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:P=>{U(P),l(v)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(Zd,{computedMetaFields:C,requiredMetaFields:a,updateMeta:Y,form:x,formState:N})),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:_,form:x.id},c("cancel")))))}var d0=ge(dt(),1),lr="uppy-transition-slideDownUp",c0=250;function C2(t){let{children:e}=t,[n,i]=pi(null),[r,o]=pi(""),s=rr(),a=rr(),l=rr(),c=()=>{o(`${lr}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{o(`${lr}-enter ${lr}-enter-active`),s.current=setTimeout(()=>{o("")},c0)})},d=()=>{o(`${lr}-leave`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{o(`${lr}-leave ${lr}-leave-active`),a.current=setTimeout(()=>{i(null),o("")},c0)})};return Ei(()=>{let p=di(e)[0];n!==p&&(p&&!n?c():n&&!p&&!a.current&&d(),i(p))},[e,n]),Ei(()=>()=>{clearTimeout(s.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),n?Zs(n,{className:(0,d0.default)(r,n.props.className)}):null}var ko=C2;function vn(){return vn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},vn.apply(null,arguments)}var u0=900,p0=700,eu=576,h0=330;function tu(t){let e=t.totalFileCount===0,n=t.totalFileCount===1,i=t.containerWidth>eu,r=t.containerHeight>h0,o=(0,f0.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":t.disabled,"uppy-Dashboard--animateOpenClose":t.animateOpenClose,"uppy-Dashboard--isClosing":t.isClosing,"uppy-Dashboard--isDraggingOver":t.isDraggingOver,"uppy-Dashboard--modal":!t.inline,"uppy-size--md":t.containerWidth>eu,"uppy-size--lg":t.containerWidth>p0,"uppy-size--xl":t.containerWidth>u0,"uppy-size--height-md":t.containerHeight>h0,"uppy-Dashboard--isAddFilesPanelVisible":t.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":t.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":t.singleFileFullScreen&&n&&r}),s=1;t.containerWidth>u0?s=5:t.containerWidth>p0?s=4:t.containerWidth>eu&&(s=3);let a=t.showSelectedFiles&&!e,l=t.recoveredState?Object.keys(t.recoveredState.files).length:null,c=t.files?Object.keys(t.files).filter(g=>t.files[g].isGhost).length:null,d=()=>c>0?t.i18n("recoveredXFiles",{smart_count:c}):t.i18n("recoveredAllFiles");return u("div",{className:o,"data-uppy-theme":t.theme,"data-uppy-num-acquirers":t.acquirers.length,"data-uppy-drag-drop-supported":!t.disableLocalFiles&&Po(),"aria-hidden":t.inline?"false":t.isHidden,"aria-disabled":t.disabled,"aria-label":t.inline?t.i18n("dashboardTitle"):t.i18n("dashboardWindowTitle"),onPaste:t.handlePaste,onDragOver:t.handleDragOver,onDragLeave:t.handleDragLeave,onDrop:t.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:t.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!t.inline&&"true",role:t.inline?void 0:"dialog",style:{width:t.inline&&t.width?t.width:"",height:t.inline&&t.height?t.height:""}},t.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":t.i18n("closeModal"),title:t.i18n("closeModal"),onClick:t.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},t.i18n("dropHint")),a&&u(a0,t),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"},t.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?u(Kd,{id:t.id,i18n:t.i18n,uppy:t.uppy,files:t.files,resumableUploads:t.resumableUploads,hideRetryButton:t.hideRetryButton,hidePauseResumeButton:t.hidePauseResumeButton,hideCancelButton:t.hideCancelButton,showLinkToFileUploadResult:t.showLinkToFileUploadResult,showRemoveButtonAfterComplete:t.showRemoveButtonAfterComplete,metaFields:t.metaFields,toggleFileCard:t.toggleFileCard,handleRequestThumbnail:t.handleRequestThumbnail,handleCancelThumbnail:t.handleCancelThumbnail,recoveredState:t.recoveredState,individualCancellation:t.individualCancellation,openFileEditor:t.openFileEditor,canEditFile:t.canEditFile,toggleAddFilesPanel:t.toggleAddFilesPanel,isSingleFile:n,itemsPerRow:s,containerWidth:t.containerWidth,containerHeight:t.containerHeight}):u(Fa,vn({},t,{isSizeMD:i})),u(ko,null,t.showAddFilesPanel?u(i0,vn({key:"AddFiles"},t,{isSizeMD:i})):null),u(ko,null,t.fileCardFor?u(Jd,vn({key:"FileCard"},t)):null),u(ko,null,t.activePickerPanel?u(r0,vn({key:"Picker"},t)):null),u(ko,null,t.showFileEditor?u(s0,vn({key:"Editor"},t)):null),u("div",{className:"uppy-Dashboard-progressindicators"},t.progressindicators.map(g=>t.uppy.getPlugin(g.id).render(t.state))))))}var m0={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 ne(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var S2=0;function tt(t){return"__private_"+S2+++"_"+t}var P2={version:"4.1.0"},iu=Ld.default||Ld,g0=9,E2=27;function y0(){let t={};return t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),t}var D2={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Co,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,doneButtonHandler:void 0,onRequestCloseModal:null},bn=tt("disabledNodes"),ki=tt("generateLargeThumbnailIfSingleFile"),To=tt("openFileEditorWhenFilesAdded"),_n=tt("attachRenderFunctionToTarget"),nu=tt("isTargetSupported"),ru=tt("getAcquirers"),ou=tt("getProgressIndicators"),Ti=tt("getEditors"),su=tt("addSpecifiedPluginsFromOptions"),au=tt("autoDiscoverPlugins"),wn=tt("addSupportedPluginIfNoTarget"),Io=tt("getStatusBarOpts"),Oo=tt("getThumbnailGeneratorOpts"),lu=tt("getInformerOpts"),Fo=tt("getStatusBarId"),Ro=tt("getThumbnailGeneratorId"),cu=tt("getInformerId"),xn=class extends kt{constructor(e,n){var i,r,o;let s=(i=n?.autoOpen)!=null?i:null;super(e,E(b(b({},D2),n),{autoOpen:s})),Object.defineProperty(this,cu,{value:R2}),Object.defineProperty(this,Ro,{value:F2}),Object.defineProperty(this,Fo,{value:O2}),Object.defineProperty(this,lu,{value:I2}),Object.defineProperty(this,Oo,{value:T2}),Object.defineProperty(this,Io,{value:k2}),Object.defineProperty(this,bn,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Da()}`,this.superFocus=jd(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.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},h=this.getPluginState().targets.slice();return h.push(p),this.setPluginState({targets:h}),this.el},this.hideAllPanels=()=>{var a;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",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return ne(this,Ti)[Ti](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=ne(this,Ti)[Ti](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();ne(this,Ti)[Ti](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=y0();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"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:p}=this.getPluginState();if(d||p)return;let{promise:g,resolve:h}=y0();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let C=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",C,!1),h()};this.el.addEventListener("animationend",C,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),h();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var v;(v=history.state)!=null&&v[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),g},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:E(b({},l),{darkMode:a})})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.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(a=>{let l=a[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 a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.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=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=ne(this,bn)[bn])!=null?l:ui(this.el.querySelectorAll(c)).filter(p=>!p.classList.contains("uppy-Dashboard-close"));for(let p of d)p.tagName==="A"?p.setAttribute("aria-disabled",a):p.disabled=a;a?ne(this,bn)[bn]=d:ne(this,bn)[bn]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState(E(b({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===E2&&this.requestCloseModal(),a.keyCode===g0&&Hd(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=ui(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=ui(a.target.files);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{var l,c;a.preventDefault(),a.stopPropagation();let d=()=>{let v=!0;return this.uppy.iteratePlugins(C=>{C.canHandleRootDrop!=null&&C.canHandleRootDrop(a)&&(v=!0)}),v},p=()=>{let{types:v}=a.dataTransfer;return v.some(C=>C==="Files")},g=d(),h=p();if(!g&&!h||this.opts.disabled||this.opts.disableLocalFiles&&(h||!g)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(l=(c=this.opts).onDragOver)==null||l.call(c,a)},this.handleDragLeave=a=>{var l,c;a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(l=(c=this.opts).onDragLeave)==null||l.call(c,a)},this.handleDrop=a=>F(this,null,function*(){var l,c;a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(h=>{h.type==="acquirer"&&(h.handleRootDrop==null||h.handleRootDrop(a))});let d=!1,p=h=>{this.uppy.log(h,"error"),d||(this.uppy.info(h.message,"error"),d=!0)};this.uppy.log("[Dashboard] Processing dropped files");let g=yield fo(a.dataTransfer,{logDropError:p});g.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(g)),(l=(c=this.opts).onDrop)==null||l.call(c,a)}),this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===g0&&Yg(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,ki,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d=E(b({},l[0]),{preview:void 0});c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,To,{writable:!0,value:a=>{let l=a[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 a=yd(this.opts.trigger);a?a.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",ne(this,wn)[wn]),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",ne(this,ki)[ki]),this.uppy.on("file-removed",ne(this,ki)[ki]),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",ne(this,To)[To])},this.removeEvents=()=>{let a=yd(this.opts.trigger);!this.opts.inline&&a&&a.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",ne(this,wn)[wn]),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",ne(this,ki)[ki]),this.uppy.off("file-removed",ne(this,ki)[ki]),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",ne(this,To)[To])},this.superFocusOnEachUpdate=()=>{let a=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||a||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=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,_n,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return E(b({},a),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,nu,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,ru,{writable:!0,value:iu(a=>a.filter(l=>l.type==="acquirer"&&ne(this,nu)[nu](l)).map(ne(this,_n)[_n]))}),Object.defineProperty(this,ou,{writable:!0,value:iu(a=>a.filter(l=>l.type==="progressindicator").map(ne(this,_n)[_n]))}),Object.defineProperty(this,Ti,{writable:!0,value:iu(a=>a.filter(l=>l.type==="editor").map(ne(this,_n)[_n]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:p}=a,{newFiles:g,uploadStartedFiles:h,completeFiles:v,erroredFiles:C,inProgressFiles:R,inProgressNotPausedFiles:O,processingFiles:N,isUploadStarted:Q,isAllComplete:U,isAllPaused:Y}=this.uppy.getObjectOfFilesPerState(),_=ne(this,ru)[ru](l.targets),x=ne(this,ou)[ou](l.targets),P=ne(this,Ti)[Ti](l.targets),T;return this.opts.theme==="auto"?T=d.darkMode?"dark":"light":T=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}".`)),tu({state:a,isHidden:l.isHidden,files:c,newFiles:g,uploadStartedFiles:h,completeFiles:v,erroredFiles:C,inProgressFiles:R,inProgressNotPausedFiles:O,processingFiles:N,isUploadStarted:Q,isAllComplete:U,isAllPaused:Y,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:p,acquirers:_,theme:T,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:P,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:a.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,su,{writable:!0,value:()=>{(this.opts.plugins||[]).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,au,{writable:!0,value:()=>{this.uppy.iteratePlugins(ne(this,wn)[wn])}}),Object.defineProperty(this,wn,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(p=>a.id===p.id)||a.mount(this,a))}}),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:a,closeAfterFinish:l}=this.opts;if(a&&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(cn,b({id:ne(this,Fo)[Fo](),target:this},ne(this,Io)[Io]())),this.opts.disableInformer||this.uppy.use(dn,b({id:ne(this,cu)[cu](),target:this},ne(this,lu)[lu]())),this.opts.disableThumbnailGenerator||this.uppy.use(nr,b({id:ne(this,Ro)[Ro]()},ne(this,Oo)[Oo]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let g=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${g?"on":"off"}`),this.setDarkModeCapability(g),this.opts.theme==="auto"){var h;(h=this.darkModeMediaQuery)==null||h.addListener(this.handleSystemDarkModeChange)}ne(this,su)[su](),ne(this,au)[au](),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)}if((this.opts.plugins||[]).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=m0,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(e){var n,i;super.setOptions(e),(n=this.uppy.getPlugin(ne(this,Fo)[Fo]()))==null||n.setOptions(ne(this,Io)[Io]()),(i=this.uppy.getPlugin(ne(this,Ro)[Ro]()))==null||i.setOptions(ne(this,Oo)[Oo]())}};function k2(){let{hideUploadButton:t,hideRetryButton:e,hidePauseResumeButton:n,hideCancelButton:i,showProgressDetails:r,hideProgressAfterFinish:o,locale:s,doneButtonHandler:a}=this.opts;return{hideUploadButton:t,hideRetryButton:e,hidePauseResumeButton:n,hideCancelButton:i,showProgressDetails:r,hideAfterFinish:o,locale:s,doneButtonHandler:a}}function T2(){let{thumbnailWidth:t,thumbnailHeight:e,thumbnailType:n,waitForThumbnailsBeforeUpload:i}=this.opts;return{thumbnailWidth:t,thumbnailHeight:e,thumbnailType:n,waitForThumbnailsBeforeUpload:i,lazy:!i}}function I2(){return{}}function O2(){return`${this.id}:StatusBar`}function F2(){return`${this.id}:ThumbnailGenerator`}function R2(){return`${this.id}:Informer`}xn.VERSION=P2.version;var M2={version:"4.0.0"},B2={fixed:!1,hideAfterFinish:!0},cr=class extends kt{constructor(e,n){super(e,b(b({},B2),n)),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let n=e.totalProgress||0,i=(n===0||n===100)&&this.opts.hideAfterFinish;return u("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i},u("div",{className:"uppy-ProgressBar-inner",style:{width:`${n}%`}}),u("div",{className:"uppy-ProgressBar-percentage"},n))}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};cr.VERSION=M2.version;var v0={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var A2={version:"4.0.2"},N2={inputName:"files[]",width:"100%",height:"100%"},dr=class t extends kt{constructor(e,n){super(e,b(b({},N2),n)),this.isDragDropSupported=Po(),this.addFiles=i=>{let r=i.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=i=>{let r=ui(i.target.files);r.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(r)),i.target.value=null},this.handleDragOver=i=>{var r,o;i.preventDefault(),i.stopPropagation();let{types:s}=i.dataTransfer,a=s.some(c=>c==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!a||!l){i.dataTransfer.dropEffect="none";return}i.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(r=(o=this.opts).onDragOver)==null||r.call(o,i)},this.handleDragLeave=i=>{var r,o;i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(r=(o=this.opts).onDragLeave)==null||r.call(o,i)},this.handleDrop=i=>F(this,null,function*(){var r,o;i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1});let s=l=>{this.uppy.log(l,"error")},a=yield fo(i.dataTransfer,{logDropError:s});a.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(a)),(r=(o=this.opts).onDrop)==null||r.call(o,i)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=v0,this.i18nInit()}renderHiddenFileInput(){var e;let{restrictions:n}=this.uppy.opts;return u("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:i=>{this.fileInputRef=i},name:this.opts.inputName,multiple:n.maxNumberOfFiles!==1,accept:(e=n.allowedFileTypes)==null?void 0:e.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 e=`uppy-u-reset
|
|
27
27
|
uppy-DragDrop-container
|
|
28
28
|
${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
|
|
29
29
|
${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
|
|
30
|
-
`,n={width:this.opts.width,height:this.opts.height};return u("button",{type:"button",className:e,style:n,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),u("div",{className:"uppy-DragDrop-inner"},t.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};dr.VERSION=R2.version;var lu=class{onMount(e,n){this.options=b(b({},e),this.props),this.uppy.use(n,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(e,n){e.uppy&&this.uppy!==e.uppy.previousValue&&e.uppy.previousValue!==void 0&&(this.uninstall(e.uppy.previousValue),this.uppy.use(n,this.options)),this.options=b(b({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),e.props&&this.props!==e.props.previousValue&&e.props.previousValue!==void 0&&this.plugin.setOptions(b({},this.options))}uninstall(e=this.uppy){e.removePlugin(this.plugin)}},g0=(()=>{let e=class e extends lu{constructor(i){super(),this.el=i,this.uppy=new Yr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},xn)}ngOnChanges(i){this.handleChanges(i,xn)}ngOnDestroy(){this.uninstall()}};e.\u0275fac=function(r){return new(r||e)(Se(mt))},e.\u0275cmp=ee({type:e,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[Ua,ni],decls:0,vars:0,template:function(r,o){},encapsulation:2,changeDetection:0});let t=e;return t})();var y0=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({});let t=e;return t})();var b0=me(v0(),1);function A2(t,e){if(t&1&&(f(0,"small",5),w(1),m()),t&2){let n=k();y(),D(n.subtitle)}}function N2(t,e){if(t&1&&(f(0,"a",6),X(1,"i",7),w(2," Download Template "),m()),t&2){let n=k();En("top-58",n.subtitle),S("href",n.sampleUrl,Ho)}}function z2(t,e){if(t&1&&(Wa(0),w(1),$a()),t&2){let n=k(2);y(),oi("- ",n.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function L2(t,e){if(t&1&&(f(0,"div",4)(1,"h4",8),w(2,"CSV File Content Summary"),m(),X(3,"hr"),f(4,"p",9),w(5),K(6,z2,2,1,"ng-container",10),m()()),t&2){let n=k();y(5),oi("",n.rowSummary().rowCount," rows found "),y(),S("ngIf",n.rowSummary().rowEmpty>0)}}var _0=(()=>{let e=class e{constructor(){this.sampleUrl="",this.subtitle="",this.showSample=!0,this.uppyCoreConfiguration=Va(),this.dashboardPropsConfiguration=Va(),this.fileUploaded=new st,this.fileRemoved=new st,this.onParser=new st,this.http=F(hf),this.csvParser=F(pf),this.rowSummary=H({rowCount:0,rowEmpty:0}),this.file=H(null),this.uppy=new Yr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}),this.dashboardProps={hideUploadButton:!0,height:350},Xa(()=>this.uppy.setOptions(b({},this.uppyCoreConfiguration()))),Xa(()=>this.dashboardProps=b(b({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(i,r)=>{let o=r[0]?.data;this.showSample=!1,this.fileUploaded.emit(o),this.file.set(r[0].data),b0.default.parse(o,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:s=>{let a=s.split(/\r?\n/).slice(1);return a[a.length-1]===""&&a.pop(),this.rowSummary.update(l=>E(b({},l),{rowCount:a.length})),a.forEach(l=>{l.split(",").every(d=>d==="")&&this.rowSummary.update(d=>E(b({},d),{rowEmpty:d.rowEmpty+1}))}),s},error(s,a){console.log("ERROR",s,a)},complete:(s,a)=>{this.onParser.emit(s.data)}})}),this.uppy.on("file-removed",()=>{this.showSample=!0,this.fileRemoved.emit(),this.file.set(null),this.rowSummary.set({rowCount:0,rowEmpty:0})})}formatFileSize(i,r=2){if(i===0)return"0 bytes";let o=Math.floor(Math.log(i)/Math.log(e.kilobyte));return`${(i/Math.pow(e.kilobyte,o)).toFixed(r)} ${e.sizes[o]}`}};e.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],e.kilobyte=1024,e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["POS-uppy"]],inputs:{sampleUrl:"sampleUrl",subtitle:"subtitle",uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileRemoved:"fileRemoved",onParser:"onParser"},standalone:!0,features:[ie],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(r,o){if(r&1&&(f(0,"div",0),X(1,"uppy-dashboard",1),K(2,A2,2,1,"small",2)(3,N2,3,3,"a",3)(4,L2,7,2,"div",4),m()),r&2){let s;y(),S("uppy",o.uppy)("props",o.dashboardProps),y(),S("ngIf",o.subtitle),y(),S("ngIf",o.sampleUrl&&o.showSample),y(),oe(o.file()&&((s=o.file())==null?null:s.type)==="text/csv"?4:-1)}},dependencies:[y0,g0,jt,Tn],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%}"]});let t=e;return t})();var w0=(()=>{let e=class e{constructor(){this.file=null,this.sample_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",this.fb=F(Ni),this.httpService=F(ai),this.destroyRef=F(Be),this.activeModal=F(Rn)}ngOnInit(){this.form=this.fb.group({file:new Ye("",[Je.required])})}onSelectFile(i){i instanceof File&&(this.file=i)}onOK(){let i=`https://${localStorage.getItem("Domain")}`;if(this.file){let r=new FormData;r.append("file",this.file,this.file.name),r.append("OutletID",""),this.httpService.postFormData("API/catalog/product/UploadCSVforBarcode",r,void 0,i).pipe($e(this.destroyRef)).subscribe({next:o=>{this.activeModal.close(o)}})}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-dialog-import-product"]],standalone:!0,features:[ie],decls:2,vars:2,consts:[["title","Upload New Product Barcode?",3,"onOK","hasValid"],[3,"fileUploaded","sampleUrl"]],template:function(r,o){r&1&&(f(0,"app-base-modal",0),A("onOK",function(){return o.onOK()}),f(1,"POS-uppy",1),A("fileUploaded",function(a){return o.onSelectFile(a)}),m()()),r&2&&(S("hasValid",o.form.valid),y(),S("sampleUrl",o.sample_URL))},dependencies:[ks,Ke,_0],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}"]});let t=e;return t})();var H2=(t,e)=>e.Uuid;function j2(t,e){if(t&1&&(f(0,"span",46),w(1),ke(2,"maskito"),m()),t&2){let n=k(2).$implicit,i=k();y(),D(yi(2,1,i.promotionDiscount(n.Promotions),i.options))}}function V2(t,e){if(t&1&&(f(0,"div",37)(1,"span",44),w(2),ke(3,"maskito"),m(),K(4,j2,3,4,"span",45),m()),t&2){let n=k().$implicit,i=k();y(2),D(yi(3,2,n.UnitPrice,i.options)),y(2),S("ngIf",n.Promotions)}}function U2(t,e){if(t&1&&(f(0,"div",37)(1,"span"),w(2),ke(3,"maskito"),m()()),t&2){let n=k(2).$implicit,i=k();y(2),D(yi(3,1,n.Print[0].UnitPrice,i.options))}}function W2(t,e){if(t&1&&(f(0,"div",37)(1,"span"),w(2),ke(3,"maskito"),m()()),t&2){let n=k(2).$implicit,i=k();y(2),D(yi(3,1,n.UnitPrice,i.options))}}function $2(t,e){if(t&1&&K(0,U2,4,4,"div",37)(1,W2,4,4,"div",37),t&2){let n=k().$implicit;oe(n.Print&&n.Print.length>0?0:1)}}function q2(t,e){t&1&&X(0,"i",40)}function G2(t,e){t&1&&X(0,"i",41)}function X2(t,e){if(t&1){let n=pe();f(0,"tr")(1,"td"),w(2),m(),f(3,"td"),w(4),m(),f(5,"td"),w(6),ke(7,"number"),m(),f(8,"td"),K(9,V2,5,5,"div",37)(10,$2,2,1),m(),f(11,"td")(12,"div",38)(13,"button",39),A("click",function(){let r=q(n).$implicit,o=k();return G(o.onToggleSelected(r))}),K(14,q2,1,0,"i",40)(15,G2,1,0,"i",41),m(),f(16,"button",42),A("click",function(){let r=q(n).$implicit,o=k();return G(o.onRemoveItem(r))}),X(17,"i",43),m()()()()}if(t&2){let n=e.$implicit,i=k();y(2),D(n.Name),y(2),D(n.Code),y(2),D(Ht(7,6,n.Quantity)),y(3),oe(n.Promotions?9:10),y(5),oe(n.isSelected&&i.productEdit?14:15),y(2),S("disabled",n.isSelected&&i.productEdit)}}var x0=(()=>{let e=class e{constructor(){this.productItems=[],this.storeService=F(ce),this.Object=Object,this.options=Xn({precision:2,thousandSeparator:","}),this.modalService=F(Vu),this.httpService=F(ai),this.router=F(In),this.route=F(Ko)}ngOnInit(){}onNext(){this.storeService.onNextStep(),this.storeService.productItems().length>0&&(this.storeService.stepperRef().selected.completed=!0,this.storeService.stepperRef().next())}onOpenModalChooseProduct(){return O(this,null,function*(){let r=yield this.modalService.open(Ns,{centered:!0}).result;if(r){let o=[...this.storeService.productItems()],s=o.findIndex(l=>l.ID===r.ID);s!==-1?o[s].Quantity+=r.Quantity:o.push(r);let a=[...o];this.storeService.onChangeProductItems(a),Ya.production||localStorage.setItem("productItems",JSON.stringify(a))}})}onOpenModalEdit(i){return O(this,null,function*(){let r=this.modalService.open(Ns,{centered:!0,scrollable:!0});r.componentInstance.data=i;try{let o=yield r.result;if(o){let s=[...this.storeService.productItems()],a=s.findIndex(c=>c.ID===o.ID);a!==-1?s[a]=o:s.push(o);let l=[...s];this.storeService.onChangeProductItems(l),Ya.production||localStorage.setItem("productItems",JSON.stringify(l))}}catch{}})}ngAfterViewInit(){this.productItems=this.storeService.productItems().map(i=>E(b({},i),{isSelected:!1}))}onToggleSelected(i){let r=[...this.storeService.productItems()],o=r.findIndex(s=>s.Uuid.toLowerCase()===i.Uuid.toLowerCase());o!==-1?r.every(a=>!a.isSelected)?r[o].isSelected=!r[o].isSelected||!1:r.forEach(a=>a.isSelected=!1):r.forEach(s=>s.isSelected=!1),this.router.navigate(["/pages"],{queryParams:{id:r[o].isSelected?i.Uuid:null}})}onOpenDialogImportProduct(){return O(this,null,function*(){let r=yield this.modalService.open(w0,{scrollable:!0,centered:!0}).result,o=[...this.storeService.productItems()];r.forEach(s=>{o.push(E(b({},s),{Uuid:Nr(),ID:s.VariantID}))}),this.storeService.onChangeProductItems(o),console.log("result",r)})}onOpenDialogLoadTransaction(){return O(this,null,function*(){let r=yield this.modalService.open(lf,{scrollable:!0,centered:!0}).result,s=`https://${localStorage.getItem("Domain")}`;if(console.log("result",r),r!==void 0)switch(r.role){case"ok":let a={Number:r.data.number,Outlet:r.data.outlet};this.httpService.post("/API/V3/Barcode/byBillNumber",a,void 0,s).pipe(re(l=>{let c=[...this.storeService.productItems()];l.forEach(d=>{c.push(E(b({},d),{Uuid:Nr(),ID:d.VariantID}))}),this.storeService.onChangeProductItems(c)})).subscribe();break}})}onRemoveItem(i){let o=[...this.storeService.productItems()].filter(s=>s.Uuid.toLowerCase()!==i.Uuid.toLowerCase());this.storeService.onChangeProductItems(o)}onActivate(i){return O(this,null,function*(){i.type==="click"&&(yield this.onOpenModalEdit(i.row))})}promotionDiscount(i){try{return Object.keys(i).length?i.Discount&&i.Discount>0?i.UnitPrice-i.UnitPrice*i.Discount/100:i.UnitPrice:0}catch(r){throw new Error("error: ",r)}}onClear(){this.storeService.onChangeProductItems([])}get productEdit(){return this.route.snapshot.queryParamMap.has("id")}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["choose-product"]],viewQuery:function(r,o){if(r&1&&ri(np,5),r&2){let s;zt(s=Lt())&&(o.verticalSidebar=s.first)}},standalone:!0,features:[ie],decls:58,vars:5,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"],[1,"card"],[1,"card-body",2,"padding","0.8rem"],[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"],["type","button",1,"btn","btn-link",3,"click","disabled"],[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(r,o){r&1&&(f(0,"div",0)(1,"header",1)(2,"nav",2)(3,"div",3)(4,"div",4)(5,"ul",5)(6,"li",6)(7,"h3",7),w(8,"Choose Product"),m()()(),f(9,"ul",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"button",12),A("click",function(){return o.onOpenDialogImportProduct()}),X(14,"i",13),f(15,"span",14),w(16,"Upload"),m()(),X(17,"button",15),f(18,"div",16)(19,"button",17),A("click",function(){return o.onOpenDialogLoadTransaction()}),X(20,"i",18),f(21,"span",14),w(22,"Load Transaction"),m()(),f(23,"button",17),A("click",function(){return o.onClear()}),X(24,"i",19),f(25,"span",14),w(26,"Clear"),m()()()()(),f(27,"button",20),A("click",function(){return o.onNext()}),f(28,"span",14),w(29,"Next"),m(),X(30,"i",21),m()()()()(),w(31,' " '),m()(),f(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),w(43,"Name"),m(),f(44,"th",31),w(45,"Code"),m(),f(46,"th",32),w(47,"Qty"),m(),f(48,"th",33),w(49," Price "),m(),X(50,"th",32),m()(),f(51,"tbody"),At(52,X2,18,8,"tr",null,H2),m()()()()()()(),f(54,"div",34)(55,"div",35)(56,"div",36),X(57,"modal-choose-product"),m()()()()()()),r&2&&(y(),St("data-navbarbg",o.storeService.options().navbarbg),y(),S("ngClass",o.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),S("ngbCollapse",!o.storeService.options().isCollapsed),St("data-navbarbg",o.storeService.options().navbarbg),y(24),S("disabled",o.storeService.productItems().length<=0),y(25),Nt(o.storeService.productItems()))},dependencies:[jt,Ai,Tn,Yo,ju,zu,Nu,Lu,Hu,Fn,Hh,uf,Ns],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});let t=e;return t})();var Mo="px",C0=Xn({postfix:Mo,min:0,thousandSeparator:""}),{plugins:Y2}=C0,K2=Sn(C0,["plugins"]),wt=E(b({},K2),{plugins:[...Y2,Nh(t=>[0,t.length-Mo.length]),Gn("focus",t=>{t.setSelectionRange(0,t.value.length-Mo.length)}),Gn("blur",t=>{t.value===Mo&&$n(t,`0${Mo}`)})]});function Q2(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.barcodeHeight)}}function Z2(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.fontSize)}}function J2(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.barcode)}}function eE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.code)}}function tE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.price)}}function iE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.name)}}function nE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.moveProductName)}}function rE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.releaseDate)}}function oE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.discountVisible)}}function sE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.pricebookPrice)}}function aE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.pricebookFontSize)}}var S0=(()=>{let e=class e{constructor(){this.options=wt,this.barcodeHeight=H(0),this.fontSize=H(0),this.barcode=H(!1),this.code=H(!1),this.price=H(!1),this.name=H(!1),this.moveProductName=H(!1),this.releaseDate=H(!1),this.discountVisible=H(!1),this.pricebookPrice=H(!1),this.pricebookFontSize=H(0),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"},this.storeService=F(ce),this.injector=F(Me),this.destroyRef=F(Be)}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe($e(this.destroyRef),re(i=>{this.barcodeHeight.set(i.BarcodeHeight),this.fontSize.set(i.ProductNameFontSize),this.barcode.set(i.BarcodeVisible),this.code.set(i.CodeVisible),this.price.set(i.PriceVisible),this.name.set(i.NameVisible),this.moveProductName.set(i.MoveProductNameOnTop),this.releaseDate.set(i.ShowReleasedDate),this.discountVisible.set(i.ShowPriceDiscount),this.pricebookPrice.set(i.PricebookVisible),this.pricebookFontSize.set(i.PricebookFontSize)})).subscribe()}onInputHandler(i,r){switch(console.log("value",i),r){case"barcodeHeight":this.barcodeHeight.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"barcode":this.barcode.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{BarcodeVisible:this.barcode()}));break;case"code":this.code.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{CodeVisible:this.code()}));break;case"price":this.price.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PriceVisible:this.price()}));break;case"name":this.name.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{NameVisible:this.name()}));break;case"moveProductName":this.moveProductName.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{MoveProductNameOnTop:this.moveProductName()}));break;case"releaseDate":this.releaseDate.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ShowReleasedDate:this.releaseDate()}));break;case"discountVisible":this.discountVisible.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ShowPriceDiscount:this.discountVisible()}));break;case"pricebookPrice":this.pricebookPrice.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PricebookVisible:this.pricebookPrice()}));break;case"pricebookFontSize":this.pricebookFontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PricebookFontSize:this.pricebookFontSize()}));break}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-barcode-view"]],standalone:!0,features:[ie],decls:104,vars:18,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(r,o){if(r&1){let s=pe();f(0,"table",11)(1,"tbody")(2,"tr")(3,"td")(4,"label",12),w(5,"Barcode"),m()(),f(6,"td")(7,"div",13)(8,"input",14),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"barcode"))}),m()()(),f(9,"td")(10,"span",15),w(11),m()()(),f(12,"tr")(13,"td")(14,"label",16),w(15,"Code"),m()(),f(16,"td")(17,"div",13)(18,"input",17),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"code"))}),m()()(),f(19,"td")(20,"span",15),w(21),m()()(),f(22,"tr")(23,"th")(24,"label",18),w(25,"Price"),m()(),f(26,"td")(27,"div",13)(28,"input",19),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"price"))}),m()()(),f(29,"td")(30,"span",15),w(31),m()()(),f(32,"tr")(33,"td")(34,"label",20),w(35,"Name"),m()(),f(36,"td")(37,"div",13)(38,"input",21),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"name"))}),m()()(),f(39,"td")(40,"span",15),w(41),m()()(),f(42,"tr")(43,"td")(44,"label",22),w(45,"Move Product Name"),m()(),f(46,"td")(47,"div",13)(48,"input",23),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"moveProductName"))}),m()()(),f(49,"td")(50,"span",15),w(51),m()()(),f(52,"tr")(53,"td")(54,"label",24),w(55,"Release Date"),m()(),f(56,"td")(57,"div",13)(58,"input",25),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"releaseDate"))}),m()()(),f(59,"td")(60,"span",15),w(61),m()()(),f(62,"tr")(63,"td")(64,"label",26),w(65,"Discount Visible"),m()(),f(66,"td")(67,"div",13)(68,"input",27),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"discountVisible"))}),m()()(),f(69,"td")(70,"span",15),w(71),m()()(),f(72,"tr")(73,"td")(74,"label",28),w(75,"Pricebook Price"),m()(),f(76,"td")(77,"div",13)(78,"input",29),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"pricebookPrice"))}),m()()(),f(79,"td")(80,"span",15),w(81),m()()()()(),K(82,Q2,2,1,"ng-template",null,0,te)(84,Z2,2,1,"ng-template",null,1,te)(86,J2,2,1,"ng-template",null,2,te)(88,eE,2,1,"ng-template",null,3,te)(90,tE,2,1,"ng-template",null,4,te)(92,iE,2,1,"ng-template",null,5,te)(94,nE,2,1,"ng-template",null,6,te)(96,rE,2,1,"ng-template",null,7,te)(98,oE,2,1,"ng-template",null,8,te)(100,sE,2,1,"ng-template",null,9,te)(102,aE,2,1,"ng-template",null,10,te)}r&2&&(y(8),S("checked",o.barcode())("ngModel",o.barcode()),y(3),D(o.tooltip.barcode),y(7),S("checked",o.code())("ngModel",o.code()),y(3),D(o.tooltip.code),y(7),S("ngModel",o.price()),y(3),D(o.tooltip.price),y(7),S("ngModel",o.name()),y(3),D(o.tooltip.name),y(7),S("ngModel",o.moveProductName()),y(3),D(o.tooltip.moveProductName),y(7),S("ngModel",o.releaseDate()),y(3),D(o.tooltip.releaseDate),y(7),S("ngModel",o.discountVisible()),y(3),D(o.tooltip.discountVisible),y(7),S("ngModel",o.pricebookPrice()),y(3),D(o.tooltip.pricebookPrice))},dependencies:[nt,On,Xe,yt,Ke,us],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});let t=e;return t})();function lE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.priceWithTax)}}function cE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.selectedTax)}}function dE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.currency)}}function uE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.fontSize)}}function pE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.outletPrice)}}var P0=(()=>{let e=class e{constructor(){this.options=wt,this.hasPriceTax=H(!1),this.selectedTax=H(""),this.taxType=H({}),this.currency=H(""),this.fontSize=H(0),this.outletPrice=H(""),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=F(ce),this.destroyRef=F(Be),this.injector=F(Me),this.outlets=H([])}get taxs(){return this.storeService.taxs()}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe($e(this.destroyRef),re(s=>{this.hasPriceTax.set(s.PriceWithTax),this.selectedTax.set(s.TaxType&&s.TaxType.ID),this.currency.set(s.CurrencySymbol),this.fontSize.set(s.PriceFontSize),this.outletPrice.set(s.OutletID)})).subscribe();let i=this.storeService.paperConfig().Outlets,r=this.storeService.productItems(),o=i.filter(s=>r.some(a=>a.OutletPrice.some(l=>l.Outlet===s.Name)));this.outlets.set(o),rt(this.storeService.productItems,{injector:this.injector}).pipe(re(s=>{let a=s.some(l=>l.Promotions);this.outletPrice.set(a?"":this.outletPrice())})).subscribe(),rt(this.outletPrice,{injector:this.injector}).pipe(re(()=>{let s=[...this.storeService.productItems().map(a=>E(b({},a),{Promotions:null}))];this.storeService.onChangeProductItems(s)})).subscribe()}onInputHandler(i,r){switch(r){case"hasPriceTax":this.hasPriceTax.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PriceWithTax:this.hasPriceTax()}));break;case"selectedTax":let o=this.storeService.taxs().findIndex(s=>s.ID===i);o!==-1&&(this.selectedTax.set(i),this.taxType.set(this.storeService.taxs()[o])),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{TaxType:this.taxType()}));break;case"currency":this.currency.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{CurrencySymbol:this.currency()}));break;case"fontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break;case"outletPrice":if(this.outletPrice.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{OutletID:this.outletPrice()})),this.storeService.paperConfiguration().OutletID){let s=[...this.storeService.productItems().map(a=>E(b({},a),{Promotions:null}))];this.storeService.onChangeProductItems(s)}break}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-price"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",5)(1,"tbody")(2,"tr")(3,"td")(4,"label",6),w(5,"Price With Tax"),m()(),f(6,"td")(7,"div",7)(8,"input",8),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"hasPriceTax"))}),m()()(),f(9,"td")(10,"span",9),w(11),m()()(),f(12,"tr")(13,"td")(14,"label",10),w(15,"Selected Tax"),m()(),f(16,"td")(17,"ng-select",11),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"selectedTax"))}),m()(),f(18,"td")(19,"span",9),w(20),m()()(),f(21,"tr")(22,"td")(23,"label",12),w(24,"Currency"),m()(),f(25,"td")(26,"input",13),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"currency"))}),m()(),f(27,"td")(28,"span",9),w(29),m()()(),f(30,"tr")(31,"th")(32,"label",14),w(33,"Outlet Price"),m()(),f(34,"td")(35,"ng-select",15),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"outletPrice"))}),m()(),f(36,"td")(37,"span",9),w(38),m()()()()(),K(39,lE,2,1,"ng-template",null,0,te)(41,cE,2,1,"ng-template",null,1,te)(43,dE,2,1,"ng-template",null,2,te)(45,uE,2,1,"ng-template",null,3,te)(47,pE,2,1,"ng-template",null,4,te)}r&2&&(y(8),S("checked",o.hasPriceTax())("ngModel",o.hasPriceTax()),y(3),D(o.tooltip.priceWithTax),y(6),S("ngModel",o.selectedTax())("items",o.taxs),y(3),D(o.tooltip.selectedTax),y(6),S("ngModel",o.currency()),y(3),D(o.tooltip.currency),y(6),S("ngModel",o.outletPrice())("items",o.outlets()),y(3),D(o.tooltip.outletPrice))},dependencies:[nt,Ge,On,Xe,yt,Ke,Vt,li],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});let t=e;return t})();function hE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.maxCharacter)}}function fE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.namePrefix)}}function mE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.storeName)}}function gE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.orientation)}}function yE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.useDescriptionAsCode)}}function vE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.removeDefault)}}var E0=(()=>{let e=class e{constructor(){this.storeService=F(ce),this.fb=F(Ni),this.destroyRef=F(Be),this.injector=F(Me),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=H(0),this.namePrefix=H(""),this.storeName=H(""),this.orientation=H(0),this.useDescriptionAsCode=H(!1),this.removeDefault=H(!1),this.options=wt}ngOnInit(){this.initForm(),rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe($e(this.destroyRef),re(i=>{this.maxCharacter.set(i.ProductNameMaxLength),this.namePrefix.set(i.ProductNamePrefix),this.storeName.set(i.StoreName),this.orientation.set(i.Orientation),this.useDescriptionAsCode.set(i.DescriptionAsCode),this.removeDefault.set(!1)})).subscribe(),this.form.valueChanges.pipe($e(this.destroyRef),re(i=>{let r=E(b({},this.storeService.paperConfiguration()),{ProductNameMaxLength:i.maxCharacter,ProductNamePrefix:i.namePrefix,StoreName:i.storeName,Orientation:i.orientation,DescriptionAsCode:!!i.useDescriptionAsCode});this.storeService.onChangePaperConfiguration(r);let s=["ProductNameMaxLength","ProductNamePrefix","StoreName","Orientation","DescriptionAsCode"].reduce((a,l)=>(l in this.storeService.paperConfiguration()&&(a[l]=this.storeService.paperConfiguration()[l]),a),{});console.log("filtered advanced",s)})).subscribe()}onInputHandler(i,r){switch(r){case"maxCharacter":this.maxCharacter.set(+i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNameMaxLength:this.maxCharacter()}));break;case"namePrefix":this.namePrefix.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNamePrefix:this.namePrefix()}));break;case"storeName":this.storeName.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{StoreName:this.storeName()}));break;case"orientation":this.orientation.set(+i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{Orientation:this.orientation()}));break;case"useDescriptionAsCode":this.useDescriptionAsCode.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{DescriptionAsCode:this.useDescriptionAsCode()}));break;case"removeDefault":this.removeDefault.set(!!i);break}}initForm(){this.form=this.fb.group({maxCharacter:new Ye(this.storeService.paperConfiguration().ProductNameMaxLength,[Je.required]),namePrefix:new Ye(null,[Je.required]),storeName:new Ye(null,[Je.required]),orientation:new Ye(null,[Je.required]),useDescriptionAsCode:new Ye(null,[Je.required]),removeDefault:new Ye("0",[Je.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()})}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-advanced"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",6)(1,"tbody")(2,"tr")(3,"td")(4,"label",7),w(5,"Max Character"),m()(),f(6,"td")(7,"input",8),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"maxCharacter"))}),m()(),f(8,"td")(9,"span",9),w(10),m()()(),f(11,"tr")(12,"td")(13,"label",10),w(14,"Name Prefix"),m()(),f(15,"td")(16,"input",11),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"namePrefix"))}),m()(),f(17,"td")(18,"span",9),w(19),m()()(),f(20,"tr")(21,"td")(22,"label",12),w(23,"Store Name"),m()(),f(24,"td")(25,"input",13),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"storeName"))}),m()(),f(26,"td")(27,"span",9),w(28),m()()(),f(29,"tr")(30,"th")(31,"label",14),w(32,"Orientation"),m()(),f(33,"td")(34,"ng-select",15),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"orientation"))}),m()(),f(35,"td")(36,"span",9),w(37),m()()(),f(38,"tr")(39,"td")(40,"label",16),w(41,"Use description as code"),m()(),f(42,"td")(43,"div",17)(44,"input",18),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"useDescriptionAsCode"))}),m()()(),f(45,"td")(46,"span",9),w(47),m()()(),f(48,"tr")(49,"td")(50,"label",19),w(51,'Remove "Default"'),m()(),f(52,"td")(53,"div",17)(54,"input",20),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"removeDefault"))}),m()()(),f(55,"td")(56,"span",9),w(57),m()()()()(),K(58,hE,2,1,"ng-template",null,0,te)(60,fE,2,1,"ng-template",null,1,te)(62,mE,2,1,"ng-template",null,2,te)(64,gE,2,1,"ng-template",null,3,te)(66,yE,2,1,"ng-template",null,4,te)(68,vE,2,1,"ng-template",null,5,te)}r&2&&(y(7),S("ngModel",o.maxCharacter()),y(3),D(o.tooltip.maxCharacter),y(6),S("ngModel",o.namePrefix()),y(3),D(o.tooltip.namePrefix),y(6),S("ngModel",o.storeName()),y(3),D(o.tooltip.storeName),y(6),S("ngModel",o.orientation())("items",o.storeService.paperConfiguration().OrientationChoice),y(3),D(o.tooltip.orientation),y(7),S("checked",o.useDescriptionAsCode())("ngModel",o.useDescriptionAsCode()),y(3),D(o.tooltip.useDescriptionAsCode),y(7),S("checked",o.removeDefault())("ngModel",o.removeDefault()),y(3),D(o.tooltip.removeDefault))},dependencies:[Ke,Ge,On,Xe,Vt,li,nt,yt],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});let t=e;return t})();var D0=(()=>{let e=class e{transform(i,...r){let o=Number(i),s=Number(r[0]);return o*s/100+o}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=Lo({name:"taxs",type:e,pure:!0,standalone:!0});let t=e;return t})();var k0=me(sc());var bE=["barcode"],_E=t=>({"h-100":t}),ze=t=>({"font-size.px":t});function wE(t,e){if(t&1&&(f(0,"div",3),X(1,"canvas",10,0),m()),t&2){let n=k(2);y(),S("ngStyle",n.barcodeStyle)}}function xE(t,e){if(t&1&&(f(0,"span",5),w(1),m()),t&2){let n=k().$implicit,i=k();S("ngStyle",xe(2,ze,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.Code)}}function CE(t,e){if(t&1&&(f(0,"span",12),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,ze,n.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.storeService.paperConfiguration().ProductNamePrefix)}}function SE(t,e){if(t&1&&(f(0,"div",6),K(1,CE,2,4,"span",11),f(2,"span",12),w(3),ke(4,"slice"),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngIf",i.storeService.paperConfiguration().ProductNamePrefix),y(),S("ngStyle",xe(7,ze,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(Ga(4,3,n.Name,0,i.storeService.paperConfiguration().ProductNameMaxLength))}}function PE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,ze,n.storeService.paperConfiguration().PriceFontSize)),y(),D(n.storeService.paperConfiguration().CurrencySymbol)}}function EE(t,e){if(t&1&&(f(0,"span",22),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,ze,n.storeService.paperConfiguration().PriceFontSize)),y(),D(n.storeService.paperConfiguration().CurrencySymbol)}}function DE(t,e){if(t&1&&(f(0,"div",7)(1,"div",13)(2,"span",14),w(3),m(),f(4,"div",15),K(5,PE,2,4,"span",16),f(6,"span",17),w(7),ke(8,"number"),m()()(),f(9,"div",13)(10,"span",18),w(11),m(),f(12,"div",15),K(13,EE,2,4,"span",19),f(14,"span",20),w(15),ke(16,"number"),m()()()()),t&2){let n=k().$implicit,i=k();y(2),S("ngStyle",xe(14,ze,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(i.storeService.paperConfiguration().BasicPriceLabel),y(2),S("ngIf",i.storeService.paperConfiguration().CurrencySymbol),y(),S("ngStyle",xe(16,ze,i.storeService.paperConfiguration().PriceFontSize)),y(),D(Ht(8,10,n.UnitPrice)),y(3),S("ngStyle",xe(18,ze,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(i.storeService.paperConfiguration().PromotionPriceLabel),y(2),S("ngIf",i.storeService.paperConfiguration().CurrencySymbol),y(),S("ngStyle",xe(20,ze,i.storeService.paperConfiguration().PriceFontSize)),y(),D(Ht(16,12,i.promotionDiscount(n.Promotions)))}}function kE(t,e){if(t&1&&(f(0,"span",24),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,ze,n.storeService.paperConfiguration().PriceFontSize)),y(),D(n.storeService.paperConfiguration().CurrencySymbol)}}function TE(t,e){if(t&1&&(f(0,"div",8),K(1,kE,2,4,"span",23),f(2,"span",24),w(3),ke(4,"taxs"),ke(5,"number"),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngIf",i.storeService.paperConfiguration().CurrencySymbol),y(),S("ngStyle",xe(8,ze,i.storeService.paperConfiguration().PriceFontSize)),y(),D(Ht(5,6,yi(4,3,n.UnitPrice,i.taxRate)))}}function IE(t,e){if(t&1&&(f(0,"span",24),w(1),m()),t&2){let n=k(5);S("ngStyle",xe(2,ze,n.storeService.paperConfiguration().PriceFontSize)),y(),D(n.storeService.paperConfiguration().CurrencySymbol)}}function OE(t,e){if(t&1&&(f(0,"div",8),K(1,IE,2,4,"span",23),f(2,"span",24),w(3),ke(4,"taxs"),ke(5,"number"),m()()),t&2){let n=k().$implicit,i=k(3);y(),S("ngIf",i.storeService.paperConfiguration().CurrencySymbol),y(),S("ngStyle",xe(8,ze,i.storeService.paperConfiguration().PriceFontSize)),y(),D(Ht(5,6,yi(4,3,n.Price,i.taxRate)))}}function FE(t,e){if(t&1&&K(0,OE,6,10,"div",8),t&2){let n=e.$implicit,i=k(3);oe(n.Outlet===i.storeService.outlet$().Name?0:-1)}}function RE(t,e){if(t&1&&At(0,FE,1,1,null,null,$o),t&2){let n=k().$implicit;Nt(n.OutletPrice)}}function ME(t,e){if(t&1&&(f(0,"span",12),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,ze,n.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.storeService.paperConfiguration().ProductNamePrefix)}}function BE(t,e){if(t&1&&(f(0,"div",6),K(1,ME,2,4,"span",11),f(2,"span",12),w(3),ke(4,"slice"),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngIf",i.storeService.paperConfiguration().ProductNamePrefix),y(),S("ngStyle",xe(7,ze,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(Ga(4,3,n.Name,0,i.storeService.paperConfiguration().ProductNameMaxLength))}}function AE(t,e){if(t&1&&(f(0,"div",25)(1,"span",12),w(2),m()()),t&2){let n=k(3);y(),S("ngStyle",xe(2,ze,n.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.storeService.paperConfiguration().StoreName)}}function NE(t,e){if(t&1&&(f(0,"div",26)(1,"span",12),w(2),m()()),t&2){let n=k(3);y(),S("ngStyle",xe(2,ze,n.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.storeService.paperConfiguration().StoreName)}}function zE(t,e){if(t&1&&K(0,AE,3,4,"div",25)(1,NE,3,4,"div",26),t&2){let n=k(2);oe(n.storeService.paperConfiguration().Orientation===0?0:1)}}function LE(t,e){if(t&1&&(f(0,"div",8)(1,"span",12),w(2),ke(3,"date"),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngStyle",xe(5,ze,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(yi(3,2,n.ReleasedDate,"dd MMM yyyy"))}}function HE(t,e){if(t&1&&(f(0,"div",8)(1,"span",12),w(2),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngStyle",xe(2,ze,i.storeService.paperConfiguration().ProductNameFontSize)),y(),oi("",n.PriceDiscount,"% Off")}}function jE(t,e){if(t&1&&(f(0,"span"),w(1),m(),f(2,"span"),w(3,"-"),m(),f(4,"span"),w(5),m(),f(6,"span"),w(7,"-"),m(),f(8,"span"),w(9),ke(10,"number"),m()),t&2){let n=e.$implicit;y(),D(n.Name),y(4),D(n.MinimumQuantity),y(4),D(Ht(10,3,n.UnitPrice))}}function VE(t,e){if(t&1&&(f(0,"div",9),At(1,jE,11,5,null,null,mr),m()),t&2){let n=k().$implicit,i=k();S("ngStyle",xe(1,ze,i.storeService.paperConfiguration().PricebookFontSize)),y(),Nt(n.Pricebook)}}function UE(t,e){if(t&1&&(f(0,"div",2),K(1,wE,3,1,"div",3),f(2,"div",4),K(3,xE,2,4,"span",5)(4,SE,5,9,"div",6)(5,DE,17,22,"div",7)(6,TE,6,10,"div",8)(7,RE,2,0)(8,BE,5,9,"div",6)(9,zE,2,1)(10,LE,4,7,"div",8)(11,HE,3,4,"div",8)(12,VE,3,3,"div",9),m()()),t&2){let n=e.$implicit,i=k();S("ngStyle",i.stickerStyles),y(),oe(i.storeService.paperConfiguration().BarcodeVisible?1:-1),y(),S("ngClass",xe(13,_E,!i.storeService.paperConfiguration().BarcodeVisible)),y(),oe(i.storeService.paperConfiguration().CodeVisible?3:-1),y(),oe(i.storeService.paperConfiguration().MoveProductNameOnTop&&i.storeService.paperConfiguration().NameVisible?4:-1),y(),oe(n.Promotions&&i.storeService.paperConfiguration().PriceVisible?5:-1),y(),oe(!n.Promotions&&!i.storeService.paperConfiguration().OutletID&&i.storeService.paperConfiguration().PriceVisible?6:-1),y(),oe(i.storeService.paperConfiguration().OutletID&&i.storeService.paperConfiguration().PriceVisible?7:-1),y(),oe(!i.storeService.paperConfiguration().MoveProductNameOnTop&&i.storeService.paperConfiguration().NameVisible?8:-1),y(),oe(i.storeService.paperConfiguration().StoreName?9:-1),y(),oe(i.storeService.paperConfiguration().ShowReleasedDate?10:-1),y(),oe(i.storeService.paperConfiguration().ShowPriceDiscount?11:-1),y(),oe(i.storeService.paperConfiguration().PricebookVisible?12:-1)}}var Ra=(()=>{let e=class e{constructor(){this.items=[],this.previewType="single",this.storeService=F(ce),this.Object=Object,this.cdr=F(Qi),this.renderer=F(jo),this.elementsInitialized=!1,this.injector=F(Me)}get barcodeContainerStyles(){return{display:"grid",gridTemplateColumns:`repeat(${Math.floor(this.storeService.paperConfiguration().PaperWidth/this.storeService.paperConfiguration().StickerWidth)}, ${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`,padding:`${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"}`}}get stickerStyles(){let i=this.storeService.paperConfiguration().StickerWidth,r=this.storeService.paperConfiguration().StickerHeight,o=this.items.length===1&&this.previewType==="single"?"250px":`${typeof i=="number"?i+"px":i}`,s=`${this.previewType==="single"?"90px":r+"px"}`;return{width:o,height:s}}get barcodeStyle(){return{width:"100%",height:`${this.previewType==="single"?"25px":this.storeService.paperConfiguration().BarcodeHeight+"px"}`}}get taxRate(){if(this.storeService.paperConfiguration().TaxType){let r=this.storeService.taxs().findIndex(o=>o.ID===this.storeService.paperConfiguration().TaxType.ID);if(r!==-1)return this.storeService.taxs()[r].Rate}return 0}get stickerStoreName(){let i={order:"4",lineHeight:"15px"},r={position:"absolute",right:"0",top:"0",transform:"translate(0%, 20%) rotate(270deg)"};return this.storeService.paperConfiguration().Orientation===0?i:r}ngOnInit(){}ngAfterViewInit(){this.elementsInitialized=!0}ngAfterViewChecked(){this.generateBarcodes(),this.elementsInitialized&&(this.generateBarcodes(),this.elementsInitialized=!1)}generateBarcodes(){this.storeService.expandProductItems().forEach((i,r)=>{let o=this.barcodeRef.get(r)?.nativeElement;o&&(0,k0.default)(o,i.Code,{format:"CODE128",lineColor:"#000",width:20,displayValue:!1})})}promotionDiscount(i){try{return Object.keys(i).length?i.Discount&&i.Discount>0?i.UnitPrice-i.UnitPrice*i.Discount/100:i.UnitPrice:0}catch(r){throw new Error("error: ",r)}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-barcode-preview"]],viewQuery:function(r,o){if(r&1&&ri(bE,5,mt),r&2){let s;zt(s=Lt())&&(o.barcodeRef=s)}},inputs:{items:"items",previewType:"previewType"},standalone:!0,features:[ie],decls:3,vars:1,consts:[["barcode",""],["id","barcode-container",1,"barcode-container",3,"ngStyle"],[1,"sticker","position-relative","border","border-dark","py-1","d-flex","flex-column","gap-1",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"],[1,"text-dark",2,"line-height","9px",3,"ngStyle"],[2,"line-height","9px","width","100%","text-align","center"],[1,"d-flex","flex-column",2,"line-height","9px"],[2,"line-height","9px"],[1,"d-flex","gap-1",2,"line-height","9px",3,"ngStyle"],["id","barcode",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",3,"ngStyle"],[1,"d-flex","gap-2"],["class","promotion__normalprice text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__normalprice","text-decoration-line-through","text-danger",3,"ngStyle"],[1,"promotion__price_label","text-dark",3,"ngStyle"],["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"],["id","store-name-horizontal",1,"",2,"line-height","9px"],["id","store-name-vertical",1,"position-absolute",2,"line-height","9px"]],template:function(r,o){r&1&&(f(0,"div",1),At(1,UE,13,15,"div",2,mr),m()),r&2&&(S("ngStyle",o.barcodeContainerStyles),y(),Nt(o.items))},dependencies:[Du,D0,Tn,Tu,jt,Ai,Iu,Yo],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)}"],changeDetection:0});let t=e;return t})();var T0=(()=>{let e=class e{constructor(){this.storeService=F(ce)}ngOnInit(){}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-customize-label"]],standalone:!0,features:[ie],decls:58,vars:9,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"],[1,"f","fas","fa-angle-right"],[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"],[3,"items"],[1,"col-lg-6","col-md-6"],[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"]],template:function(r,o){if(r&1){let s=pe();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),w(8,"Customize Label"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),A("click",function(){return q(s),G(o.storeService.onPrevStep())}),X(12,"i",12),f(13,"span",13),w(14,"Back"),m()(),f(15,"button",11),A("click",function(){return q(s),G(o.storeService.onNextStep())}),f(16,"span",13),w(17,"Next"),m(),X(18,"i",14),m()()()()()()(),f(19,"div",15)(20,"div",16)(21,"div",17)(22,"div",18),X(23,"app-barcode-preview",19),m()()(),f(24,"div",20)(25,"div",21)(26,"div",22)(27,"h4",23),w(28," Sticker Content "),m()(),f(29,"div",24)(30,"div",25)(31,"div",26)(32,"h2",27)(33,"button",28)(34,"span",29),w(35,"Barcode View"),m()()(),f(36,"div",30)(37,"div",31,0),X(39,"app-barcode-view"),m()()(),f(40,"div",26)(41,"h2",27)(42,"button",28)(43,"span",32),w(44,"Price"),m()()(),f(45,"div",30)(46,"div",31,0),X(48,"app-price"),m()()(),f(49,"div",26)(50,"h2",27)(51,"button",28)(52,"span",32),w(53,"Advanced"),m()()(),f(54,"div",30)(55,"div",31,0),X(57,"app-advanced"),m()()()()()()()()()}r&2&&(y(),St("data-navbarbg",o.storeService.options().navbarbg),y(),S("ngClass",o.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),S("ngbCollapse",!o.storeService.options().isCollapsed),St("data-navbarbg",o.storeService.options().navbarbg),y(20),S("items",o.storeService.expandProductItem()),y(7),S("closeOthers",!0),y(),S("collapsed",!1),y(9),S("collapsed",!0),y(9),S("collapsed",!0))},dependencies:[rs,ss,os,cs,as,ls,Un,Fn,Ai,S0,P0,E0,Ra],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100vh}"],changeDetection:0});let t=e;return t})();function WE(t,e){if(t&1&&(f(0,"ng-option",3),w(1),m()),t&2){let n=e.$implicit;S("value",n.Name),y(),D(n.Name)}}var I0=(()=>{let e=class e{onInputHandler(i,r){switch(r){case"paperWidth":this.paperWidth.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PaperWidth:this.paperWidth()}));break;case"stickerWidth":this.stickerWidth.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{StickerWidth:this.stickerWidth()}));break;case"stickerHeight":this.stickerHeight.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{StickerHeight:this.stickerHeight()}));break;case"barcodeHeight":this.barcodeHeight.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break}}constructor(){this.options=wt,this.storeService=F(ce),this.destroyRef=F(Be),this.injector=F(Me),this.paperWidth=H(0),this.stickerWidth=H(0),this.stickerHeight=H(0),this.paperSource=H(""),this.barcodeHeight=H(0),this.fontSize=H(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(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(re(i=>{this.paperWidth.set(i.PaperWidth),this.stickerWidth.set(i.StickerWidth),this.stickerHeight.set(i.StickerHeight),this.barcodeHeight.set(i.BarcodeHeight),this.fontSize.set(i.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(i){let r=this.storeService.paperConfig().PaperFormats.findIndex(o=>o.Name===i);r!==-1&&(this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[r].Name),this.storeService.onChangePaperConfiguration(this.storeService.paperConfig().PaperFormats[r]))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-pp-paper"]],standalone:!0,features:[ie],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(r,o){r&1&&(f(0,"table",0)(1,"tbody")(2,"tr")(3,"td")(4,"label",1),w(5,"Paper Source"),m()(),f(6,"td")(7,"ng-select",2),A("ngModelChange",function(a){return o.onChangePaperSource(a)}),At(8,WE,2,2,"ng-option",3,mr),m()(),f(10,"td")(11,"span",4),w(12),m()()(),f(13,"tr")(14,"td")(15,"label",5),w(16,"Paper Width"),m()(),f(17,"td")(18,"input",6),A("ngModelChange",function(a){return o.onInputHandler(a,"paperWidth")}),m()(),f(19,"td")(20,"span",4),w(21),m()()(),f(22,"tr")(23,"td")(24,"label",7),w(25,"Sticker Width"),m()(),f(26,"td")(27,"input",8),A("ngModelChange",function(a){return o.onInputHandler(a,"stickerWidth")}),m()(),f(28,"td")(29,"span",4),w(30),m()()(),f(31,"tr")(32,"th")(33,"label",9),w(34,"Sticker Height"),m()(),f(35,"td")(36,"input",10),A("ngModelChange",function(a){return o.onInputHandler(a,"stickerHeight")}),m()(),f(37,"td")(38,"span",4),w(39),m()()(),f(40,"tr")(41,"td")(42,"label",11),w(43,"Barcode Height"),m()(),f(44,"td")(45,"input",12),A("ngModelChange",function(a){return o.onInputHandler(a,"barcodeHeight")}),m()(),f(46,"td")(47,"span",4),w(48),m()()(),f(49,"tr")(50,"td")(51,"label",13),w(52,"Font Size"),m()(),f(53,"td")(54,"input",14),A("ngModelChange",function(a){return o.onInputHandler(a,"fontSize")}),m()(),f(55,"td")(56,"span",4),w(57),m()()()()()),r&2&&(y(7),S("ngModel",o.storeService.paperSource()),y(),Nt(o.storeService.paperConfig().PaperFormats),y(4),D(o.tooltip.paperWidth),y(6),S("maskito",o.options)("ngModel",o.paperWidth()),y(3),D(o.tooltip.paperWidth),y(6),S("maskito",o.options)("ngModel",o.stickerWidth()),y(3),D(o.tooltip.stickerWidth),y(6),S("maskito",o.options)("ngModel",o.stickerHeight()),y(3),D(o.tooltip.stickerHeight),y(6),S("maskito",o.options)("ngModel",o.barcodeHeight()),y(3),D(o.tooltip.barcodeHeight),y(6),S("maskito",o.options)("ngModel",o.fontSize()),y(3),D(o.tooltip.fontSize))},dependencies:[nt,Ge,Xe,yt,Ke,Vt,li,ms,ji],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});let t=e;return t})();function $E(t,e){if(t&1&&(f(0,"span",14),w(1),m()),t&2){let n=k();y(),D(n.tooltip.leftIndent)}}function qE(t,e){if(t&1&&(f(0,"span",14),w(1),m()),t&2){let n=k();y(),D(n.tooltip.topIndent)}}function GE(t,e){if(t&1&&(f(0,"span",14),w(1),m()),t&2){let n=k();y(),D(n.tooltip.rowSpacing)}}function XE(t,e){if(t&1&&(f(0,"span",14),w(1),m()),t&2){let n=k();y(),D(n.tooltip.columnSpacing)}}var O0=(()=>{let e=class e{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=H(0),this.topIndent=H(0),this.rowSpacing=H(0),this.columnSpacing=H(0),this.storeService=F(ce),this.destroyRef=F(Be),this.injector=F(Me)}onInputHandler(i,r){switch(r){case"marginLeft":this.leftIndent.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{MarginLeft:this.leftIndent()}));break;case"marginTop":this.topIndent.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{MarginTop:this.topIndent()}));break;case"rowSpacing":this.rowSpacing.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{RowSpacing:this.rowSpacing()}));break;case"columnSpacing":this.columnSpacing.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ColumnSpacing:this.columnSpacing()}));break}}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe($e(this.destroyRef),re(i=>{this.leftIndent.set(i.MarginLeft),this.topIndent.set(i.MarginTop),this.rowSpacing.set(i.RowSpacing),this.columnSpacing.set(i.ColumnSpacing)})).subscribe()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-pp-spacing"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",4)(1,"tbody")(2,"tr")(3,"td")(4,"label",5),w(5,"Left Indent"),m()(),f(6,"td")(7,"input",6),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"marginLeft"))}),m()(),f(8,"td")(9,"span",7),w(10),m()()(),f(11,"tr")(12,"td")(13,"label",8),w(14,"Top Indent"),m()(),f(15,"td")(16,"input",9),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"marginTop"))}),m()(),f(17,"td")(18,"span",7),w(19),m()()(),f(20,"tr")(21,"td")(22,"label",10),w(23,"Row Spacing"),m()(),f(24,"td")(25,"input",11),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"rowSpacing"))}),m()(),f(26,"td")(27,"span",7),w(28),m()()(),f(29,"tr")(30,"th")(31,"label",12),w(32,"Column Spacing"),m()(),f(33,"td")(34,"input",13),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"columnSpacing"))}),m()(),f(35,"td")(36,"span",7),w(37),m()()()()(),K(38,$E,2,1,"ng-template",null,0,te)(40,qE,2,1,"ng-template",null,1,te)(42,GE,2,1,"ng-template",null,2,te)(44,XE,2,1,"ng-template",null,3,te)}r&2&&(y(7),S("maskito",o.options)("ngModel",o.leftIndent()),y(3),D(o.tooltip.leftIndent),y(6),S("maskito",o.options)("ngModel",o.topIndent()),y(3),D(o.tooltip.topIndent),y(6),S("maskito",o.options)("ngModel",o.rowSpacing()),y(3),D(o.tooltip.rowSpacing),y(6),S("maskito",o.options)("ngModel",o.columnSpacing()),y(3),D(o.tooltip.columnSpacing))},dependencies:[nt,Ge,Xe,yt,Ke,ji,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});let t=e;return t})();function YE(t,e){if(t&1&&(f(0,"span",8),w(1),m()),t&2){let n=k();y(),D(n.tooltip.basicPriceLabel)}}function KE(t,e){if(t&1&&(f(0,"span",8),w(1),m()),t&2){let n=k();y(),D(n.tooltip.promotionPriceLabel)}}var F0=(()=>{let e=class e{constructor(){this.tooltip={basicPriceLabel:"Custom label normal price",promotionPriceLabel:"Custom label promotion price"},this.storeService=F(ce),this.destroyRef=F(Be),this.injector=F(Me),this.basicPriceLabel=H(""),this.promotionPriceLabel=H(""),this.options=wt}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe($e(this.destroyRef),re(i=>{this.basicPriceLabel.set(i.BasicPriceLabel),this.promotionPriceLabel.set(i.PromotionPriceLabel)})).subscribe()}onInputHandler(i,r){switch(r){case"basicPriceLabel":this.basicPriceLabel.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{BasicPriceLabel:this.basicPriceLabel()}));break;case"promotionPriceLabel":this.promotionPriceLabel.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PromotionPriceLabel:this.promotionPriceLabel()}));break}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-pp-label"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"label",3),w(5,"Normal Price"),m()(),f(6,"td")(7,"input",4),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"basicPriceLabel"))}),m()(),f(8,"td")(9,"span",5),w(10),m()()(),f(11,"tr")(12,"td")(13,"label",6),w(14,"Promotion Price"),m()(),f(15,"td")(16,"input",7),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"promotionPriceLabel"))}),m()(),f(17,"td")(18,"span",5),w(19),m()()()()(),K(20,YE,2,1,"ng-template",null,0,te)(22,KE,2,1,"ng-template",null,1,te)}r&2&&(y(7),S("ngModel",o.basicPriceLabel()),y(3),D(o.tooltip.basicPriceLabel),y(6),S("ngModel",o.promotionPriceLabel()),y(3),D(o.tooltip.promotionPriceLabel))},dependencies:[nt,Ge,Xe,yt,Ke],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});let t=e;return t})();var B0=me(R0());function QE(t,e){if(t&1){let n=pe();f(0,"tr")(1,"td")(2,"label",6),w(3,"Pricebook Font Size"),m()(),f(4,"td")(5,"input",7),A("ngModelChange",function(r){q(n);let o=k();return G(o.onInputHandler(r,"pricebookFontSize"))}),m()(),f(6,"td")(7,"span",5),w(8),m()()()}if(t&2){let n=k();y(5),S("maskito",n.options)("ngModel",n.pricebookFontSize()),y(3),D(n.tooltip.pricebookFontSize)}}function ZE(t,e){if(t&1&&(f(0,"span",8),w(1),m()),t&2){let n=k();y(),D(n.tooltip.pricebookFontSize)}}function JE(t,e){if(t&1&&(f(0,"span",8),w(1),m()),t&2){let n=k();y(),D(n.tooltip.fontSize)}}var M0=(()=>{let e=class e{constructor(){this.options=wt,this.barcodeHeight=H(0),this.fontSize=H(0),this.barcode=H(!1),this.code=H(!1),this.price=H(!1),this.name=H(!1),this.moveProductName=H(!1),this.releaseDate=H(!1),this.discountVisible=H(!1),this.pricebookPrice=H(!1),this.pricebookFontSize=H(0),this.tooltip={fontSize:"Change font size for price",pricebookFontSize:"Change font size for pricebook price"},this.storeService=F(ce),this.injector=F(Me),this.destroyRef=F(Be)}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe($e(this.destroyRef),re(i=>{this.pricebookFontSize.set(i.PricebookFontSize),this.fontSize.set(i.PriceFontSize)})).subscribe()}onInputHandler(i,r){switch(console.log("value",i),r){case"pricebookFontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"fontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-price-fontsize"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",2)(1,"tbody"),K(2,QE,9,3,"tr"),f(3,"tr")(4,"td")(5,"label",3),w(6,"Font Size"),m()(),f(7,"td")(8,"input",4),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"fontSize"))}),m()(),f(9,"td")(10,"span",5),w(11),m()()()()(),K(12,ZE,2,1,"ng-template",null,0,te)(14,JE,2,1,"ng-template",null,1,te)}r&2&&(y(2),oe(o.storeService.paperConfiguration().PricebookVisible?2:-1),y(6),S("maskito",o.options)("ngModel",o.fontSize()),y(3),D(o.tooltip.fontSize))},dependencies:[ji,jt,nt,Ge,Xe,yt],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%}"]});let t=e;return t})();function eD(t,e){t&1&&(f(0,"button",14)(1,"span",13),w(2,"Next"),m(),X(3,"i",33),m())}function tD(t,e){if(t&1){let n=pe();f(0,"button",34),A("click",function(){q(n);let r=k();return G(r.printBarcode())}),f(1,"span",13),w(2,"Print"),m()()}}var A0=(()=>{let e=class e{constructor(){this.storeService=F(ce),this.httpService=F(ai),this.toastr=F(Jo),this.destroyRef=F(Be)}ngOnInit(){}printBarcode(){let i=this.storeService.paperConfiguration().PaperWidth,r=this.storeService.paperConfiguration().RowSpacing,o=this.storeService.paperConfiguration().ColumnSpacing,s=document.getElementById("barcode-container").innerHTML,a=Math.floor(+this.storeService.paperConfiguration().PaperWidth/+this.storeService.paperConfiguration().StickerWidth);(0,B0.default)({printable:"barcode-container",type:"html",css:"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",style:`
|
|
30
|
+
`,n={width:this.opts.width,height:this.opts.height};return u("button",{type:"button",className:e,style:n,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),u("div",{className:"uppy-DragDrop-inner"},t.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};dr.VERSION=A2.version;var du=class{onMount(e,n){this.options=b(b({},e),this.props),this.uppy.use(n,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(e,n){e.uppy&&this.uppy!==e.uppy.previousValue&&e.uppy.previousValue!==void 0&&(this.uninstall(e.uppy.previousValue),this.uppy.use(n,this.options)),this.options=b(b({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),e.props&&this.props!==e.props.previousValue&&e.props.previousValue!==void 0&&this.plugin.setOptions(b({},this.options))}uninstall(e=this.uppy){e.removePlugin(this.plugin)}},b0=(()=>{let e=class e extends du{constructor(i){super(),this.el=i,this.uppy=new Yr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},xn)}ngOnChanges(i){this.handleChanges(i,xn)}ngOnDestroy(){this.uninstall()}};e.\u0275fac=function(r){return new(r||e)(Se(mt))},e.\u0275cmp=ee({type:e,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[Ua,ri],decls:0,vars:0,template:function(r,o){},encapsulation:2,changeDetection:0});let t=e;return t})();var _0=(()=>{let e=class e{};e.\u0275fac=function(r){return new(r||e)},e.\u0275mod=Ct({type:e}),e.\u0275inj=xt({});let t=e;return t})();var x0=ge(w0(),1);function L2(t,e){if(t&1&&(f(0,"small",5),w(1),m()),t&2){let n=k();y(),D(n.subtitle)}}function H2(t,e){if(t&1&&(f(0,"a",6),X(1,"i",7),w(2," Download Template "),m()),t&2){let n=k();En("top-58",n.subtitle),S("href",n.sampleUrl,Ho)}}function j2(t,e){if(t&1&&(Wa(0),w(1),$a()),t&2){let n=k(2);y(),jt("- ",n.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function V2(t,e){if(t&1&&(f(0,"div",4)(1,"h4",8),w(2,"CSV File Content Summary"),m(),X(3,"hr"),f(4,"p",9),w(5),K(6,j2,2,1,"ng-container",10),m()()),t&2){let n=k();y(5),jt("",n.rowSummary().rowCount," rows found "),y(),S("ngIf",n.rowSummary().rowEmpty>0)}}var C0=(()=>{let e=class e{constructor(){this.sampleUrl="",this.subtitle="",this.showSample=!0,this.uppyCoreConfiguration=Va(),this.dashboardPropsConfiguration=Va(),this.fileUploaded=new st,this.fileRemoved=new st,this.onParser=new st,this.http=I(gf),this.csvParser=I(mf),this.rowSummary=H({rowCount:0,rowEmpty:0}),this.file=H(null),this.uppy=new Yr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}),this.dashboardProps={hideUploadButton:!0,height:350},Xa(()=>this.uppy.setOptions(b({},this.uppyCoreConfiguration()))),Xa(()=>this.dashboardProps=b(b({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(i,r)=>{let o=r[0]?.data;this.showSample=!1,this.fileUploaded.emit(o),this.file.set(r[0].data),x0.default.parse(o,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:s=>{let a=s.split(/\r?\n/).slice(1);return a[a.length-1]===""&&a.pop(),this.rowSummary.update(l=>E(b({},l),{rowCount:a.length})),a.forEach(l=>{l.split(",").every(d=>d==="")&&this.rowSummary.update(d=>E(b({},d),{rowEmpty:d.rowEmpty+1}))}),s},error(s,a){console.log("ERROR",s,a)},complete:(s,a)=>{this.onParser.emit(s.data)}})}),this.uppy.on("file-removed",()=>{this.showSample=!0,this.fileRemoved.emit(),this.file.set(null),this.rowSummary.set({rowCount:0,rowEmpty:0})})}formatFileSize(i,r=2){if(i===0)return"0 bytes";let o=Math.floor(Math.log(i)/Math.log(e.kilobyte));return`${(i/Math.pow(e.kilobyte,o)).toFixed(r)} ${e.sizes[o]}`}};e.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],e.kilobyte=1024,e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["POS-uppy"]],inputs:{sampleUrl:"sampleUrl",subtitle:"subtitle",uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileRemoved:"fileRemoved",onParser:"onParser"},standalone:!0,features:[ie],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(r,o){if(r&1&&(f(0,"div",0),X(1,"uppy-dashboard",1),K(2,L2,2,1,"small",2)(3,H2,3,3,"a",3)(4,V2,7,2,"div",4),m()),r&2){let s;y(),S("uppy",o.uppy)("props",o.dashboardProps),y(),S("ngIf",o.subtitle),y(),S("ngIf",o.sampleUrl&&o.showSample),y(),oe(o.file()&&((s=o.file())==null?null:s.type)==="text/csv"?4:-1)}},dependencies:[_0,b0,Ut,Tn],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%}"]});let t=e;return t})();var S0=(()=>{let e=class e{constructor(){this.file=null,this.sample_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",this.fb=I(Ni),this.httpService=I(ai),this.destroyRef=I(Ae),this.activeModal=I(Rn)}ngOnInit(){this.form=this.fb.group({file:new Ke("",[Je.required])})}onSelectFile(i){i instanceof File&&(this.file=i)}onOK(){let i=`https://${localStorage.getItem("Domain")}`;if(this.file){let r=new FormData;r.append("file",this.file,this.file.name),r.append("OutletID",""),this.httpService.postFormData("API/catalog/product/UploadCSVforBarcode",r,void 0,i).pipe(qe(this.destroyRef)).subscribe({next:o=>{this.activeModal.close(o)}})}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-dialog-import-product"]],standalone:!0,features:[ie],decls:2,vars:2,consts:[["title","Upload New Product Barcode?",3,"onOK","hasValid"],[3,"fileUploaded","sampleUrl"]],template:function(r,o){r&1&&(f(0,"app-base-modal",0),A("onOK",function(){return o.onOK()}),f(1,"POS-uppy",1),A("fileUploaded",function(a){return o.onSelectFile(a)}),m()()),r&2&&(S("hasValid",o.form.valid),y(),S("sampleUrl",o.sample_URL))},dependencies:[ks,Qe,C0],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}"]});let t=e;return t})();var U2=(t,e)=>e.Uuid;function W2(t,e){if(t&1&&(f(0,"span",46),w(1),Te(2,"maskito"),m()),t&2){let n=k(2).$implicit,i=k();y(),D(yi(2,1,i.promotionDiscount(n.Promotions),i.options))}}function $2(t,e){if(t&1&&(f(0,"div",37)(1,"span",44),w(2),Te(3,"maskito"),m(),K(4,W2,3,4,"span",45),m()),t&2){let n=k().$implicit,i=k();y(2),D(yi(3,2,n.UnitPrice,i.options)),y(2),S("ngIf",n.Promotions)}}function q2(t,e){if(t&1&&(f(0,"div",37)(1,"span"),w(2),Te(3,"maskito"),m()()),t&2){let n=k(2).$implicit,i=k();y(2),D(yi(3,1,n.Print[0].UnitPrice,i.options))}}function G2(t,e){if(t&1&&(f(0,"div",37)(1,"span"),w(2),Te(3,"maskito"),m()()),t&2){let n=k(2).$implicit,i=k();y(2),D(yi(3,1,n.UnitPrice,i.options))}}function X2(t,e){if(t&1&&K(0,q2,4,4,"div",37)(1,G2,4,4,"div",37),t&2){let n=k().$implicit;oe(n.Print&&n.Print.length>0?0:1)}}function Y2(t,e){t&1&&X(0,"i",40)}function K2(t,e){t&1&&X(0,"i",41)}function Q2(t,e){if(t&1){let n=pe();f(0,"tr")(1,"td"),w(2),m(),f(3,"td"),w(4),m(),f(5,"td"),w(6),Te(7,"number"),m(),f(8,"td"),K(9,$2,5,5,"div",37)(10,X2,2,1),m(),f(11,"td")(12,"div",38)(13,"button",39),A("click",function(){let r=q(n).$implicit,o=k();return G(o.onToggleSelected(r))}),K(14,Y2,1,0,"i",40)(15,K2,1,0,"i",41),m(),f(16,"button",42),A("click",function(){let r=q(n).$implicit,o=k();return G(o.onRemoveItem(r))}),X(17,"i",43),m()()()()}if(t&2){let n=e.$implicit,i=k();y(2),D(n.Name),y(2),D(n.Code),y(2),D(Vt(7,6,n.Quantity)),y(3),oe(n.Promotions?9:10),y(5),oe(n.isSelected&&i.productEdit?14:15),y(2),S("disabled",n.isSelected&&i.productEdit)}}var P0=(()=>{let e=class e{constructor(){this.productItems=[],this.storeService=I(ce),this.Object=Object,this.options=Xn({precision:2,thousandSeparator:","}),this.modalService=I(Wu),this.httpService=I(ai),this.router=I(In),this.route=I(Ko)}ngOnInit(){}onNext(){this.storeService.onNextStep(),this.storeService.productItems().length>0&&(this.storeService.stepperRef().selected.completed=!0,this.storeService.stepperRef().next())}onOpenModalChooseProduct(){return F(this,null,function*(){let r=yield this.modalService.open(Ns,{centered:!0}).result;if(r){let o=[...this.storeService.productItems()],s=o.findIndex(l=>l.ID===r.ID);s!==-1?o[s].Quantity+=r.Quantity:o.push(r);let a=[...o];this.storeService.onChangeProductItems(a),Ya.production||localStorage.setItem("productItems",JSON.stringify(a))}})}onOpenModalEdit(i){return F(this,null,function*(){let r=this.modalService.open(Ns,{centered:!0,scrollable:!0});r.componentInstance.data=i;try{let o=yield r.result;if(o){let s=[...this.storeService.productItems()],a=s.findIndex(c=>c.ID===o.ID);a!==-1?s[a]=o:s.push(o);let l=[...s];this.storeService.onChangeProductItems(l),Ya.production||localStorage.setItem("productItems",JSON.stringify(l))}}catch{}})}ngAfterViewInit(){this.productItems=this.storeService.productItems().map(i=>E(b({},i),{isSelected:!1}))}onToggleSelected(i){let r=[...this.storeService.productItems()],o=r.findIndex(s=>s.Uuid.toLowerCase()===i.Uuid.toLowerCase());o!==-1?r.every(a=>!a.isSelected)?r[o].isSelected=!r[o].isSelected||!1:r.forEach(a=>a.isSelected=!1):r.forEach(s=>s.isSelected=!1),this.router.navigate(["/pages"],{queryParams:{id:r[o].isSelected?i.Uuid:null}})}onOpenDialogImportProduct(){return F(this,null,function*(){let r=yield this.modalService.open(S0,{scrollable:!0,centered:!0}).result,o=[...this.storeService.productItems()];r.forEach(s=>{o.push(E(b({},s),{Uuid:Nr(),ID:s.VariantID}))}),this.storeService.onChangeProductItems(o),console.log("result",r)})}onOpenDialogLoadTransaction(){return F(this,null,function*(){let r=yield this.modalService.open(uf,{scrollable:!0,centered:!0}).result,s=`https://${localStorage.getItem("Domain")}`;if(console.log("result",r),r!==void 0)switch(r.role){case"ok":let a={Number:r.data.number,Outlet:r.data.outlet};this.httpService.post("/API/V3/Barcode/byBillNumber",a,void 0,s).pipe(re(l=>{let c=[...this.storeService.productItems()];l.forEach(d=>{c.push(E(b({},d),{Uuid:Nr(),ID:d.VariantID}))}),this.storeService.onChangeProductItems(c)})).subscribe();break}})}onRemoveItem(i){let o=[...this.storeService.productItems()].filter(s=>s.Uuid.toLowerCase()!==i.Uuid.toLowerCase());this.storeService.onChangeProductItems(o)}onActivate(i){return F(this,null,function*(){i.type==="click"&&(yield this.onOpenModalEdit(i.row))})}promotionDiscount(i){try{return Object.keys(i).length?i.Discount&&i.Discount>0?i.UnitPrice-i.UnitPrice*i.Discount/100:i.UnitPrice:0}catch(r){throw new Error("error: ",r)}}onClear(){this.storeService.onChangeProductItems([])}get productEdit(){return this.route.snapshot.queryParamMap.has("id")}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["choose-product"]],viewQuery:function(r,o){if(r&1&&oi(op,5),r&2){let s;Lt(s=Ht())&&(o.verticalSidebar=s.first)}},standalone:!0,features:[ie],decls:58,vars:5,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"],[1,"card"],[1,"card-body",2,"padding","0.8rem"],[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"],["type","button",1,"btn","btn-link",3,"click","disabled"],[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(r,o){r&1&&(f(0,"div",0)(1,"header",1)(2,"nav",2)(3,"div",3)(4,"div",4)(5,"ul",5)(6,"li",6)(7,"h3",7),w(8,"Choose Product"),m()()(),f(9,"ul",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"button",12),A("click",function(){return o.onOpenDialogImportProduct()}),X(14,"i",13),f(15,"span",14),w(16,"Upload"),m()(),X(17,"button",15),f(18,"div",16)(19,"button",17),A("click",function(){return o.onOpenDialogLoadTransaction()}),X(20,"i",18),f(21,"span",14),w(22,"Load Transaction"),m()(),f(23,"button",17),A("click",function(){return o.onClear()}),X(24,"i",19),f(25,"span",14),w(26,"Clear"),m()()()()(),f(27,"button",20),A("click",function(){return o.onNext()}),f(28,"span",14),w(29,"Next"),m(),X(30,"i",21),m()()()()(),w(31,' " '),m()(),f(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),w(43,"Name"),m(),f(44,"th",31),w(45,"Code"),m(),f(46,"th",32),w(47,"Qty"),m(),f(48,"th",33),w(49," Price "),m(),X(50,"th",32),m()(),f(51,"tbody"),Nt(52,Q2,18,8,"tr",null,U2),m()()()()()()(),f(54,"div",34)(55,"div",35)(56,"div",36),X(57,"modal-choose-product"),m()()()()()()),r&2&&(y(),St("data-navbarbg",o.storeService.options().navbarbg),y(),S("ngClass",o.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),S("ngbCollapse",!o.storeService.options().isCollapsed),St("data-navbarbg",o.storeService.options().navbarbg),y(24),S("disabled",o.storeService.productItems().length<=0),y(25),zt(o.storeService.productItems()))},dependencies:[Ut,Ai,Tn,Yo,Uu,Hu,Lu,ju,Vu,Fn,Vh,ff,Ns],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});let t=e;return t})();var Mo="px",E0=Xn({postfix:Mo,min:0,thousandSeparator:""}),{plugins:Z2}=E0,J2=Sn(E0,["plugins"]),wt=E(b({},J2),{plugins:[...Z2,Lh(t=>[0,t.length-Mo.length]),Gn("focus",t=>{t.setSelectionRange(0,t.value.length-Mo.length)}),Gn("blur",t=>{t.value===Mo&&$n(t,`0${Mo}`)})]});function eE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.barcodeHeight)}}function tE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.fontSize)}}function iE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.barcode)}}function nE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.code)}}function rE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.price)}}function oE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.name)}}function sE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.moveProductName)}}function aE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.releaseDate)}}function lE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.discountVisible)}}function cE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.pricebookPrice)}}function dE(t,e){if(t&1&&(f(0,"span",30),w(1),m()),t&2){let n=k();y(),D(n.tooltip.pricebookFontSize)}}var D0=(()=>{let e=class e{constructor(){this.options=wt,this.barcodeHeight=H(0),this.fontSize=H(0),this.barcode=H(!1),this.code=H(!1),this.price=H(!1),this.name=H(!1),this.moveProductName=H(!1),this.releaseDate=H(!1),this.discountVisible=H(!1),this.pricebookPrice=H(!1),this.pricebookFontSize=H(0),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"},this.storeService=I(ce),this.injector=I(Be),this.destroyRef=I(Ae)}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(qe(this.destroyRef),re(i=>{this.barcodeHeight.set(i.BarcodeHeight),this.fontSize.set(i.ProductNameFontSize),this.barcode.set(i.BarcodeVisible),this.code.set(i.CodeVisible),this.price.set(i.PriceVisible),this.name.set(i.NameVisible),this.moveProductName.set(i.MoveProductNameOnTop),this.releaseDate.set(i.ShowReleasedDate),this.discountVisible.set(i.ShowPriceDiscount),this.pricebookPrice.set(i.PricebookVisible),this.pricebookFontSize.set(i.PricebookFontSize)})).subscribe()}onInputHandler(i,r){switch(console.log("value",i),r){case"barcodeHeight":this.barcodeHeight.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"barcode":this.barcode.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{BarcodeVisible:this.barcode()}));break;case"code":this.code.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{CodeVisible:this.code()}));break;case"price":this.price.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PriceVisible:this.price()}));break;case"name":this.name.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{NameVisible:this.name()}));break;case"moveProductName":this.moveProductName.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{MoveProductNameOnTop:this.moveProductName()}));break;case"releaseDate":this.releaseDate.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ShowReleasedDate:this.releaseDate()}));break;case"discountVisible":this.discountVisible.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ShowPriceDiscount:this.discountVisible()}));break;case"pricebookPrice":this.pricebookPrice.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PricebookVisible:this.pricebookPrice()}));break;case"pricebookFontSize":this.pricebookFontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PricebookFontSize:this.pricebookFontSize()}));break}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-barcode-view"]],standalone:!0,features:[ie],decls:104,vars:18,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(r,o){if(r&1){let s=pe();f(0,"table",11)(1,"tbody")(2,"tr")(3,"td")(4,"label",12),w(5,"Barcode"),m()(),f(6,"td")(7,"div",13)(8,"input",14),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"barcode"))}),m()()(),f(9,"td")(10,"span",15),w(11),m()()(),f(12,"tr")(13,"td")(14,"label",16),w(15,"Code"),m()(),f(16,"td")(17,"div",13)(18,"input",17),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"code"))}),m()()(),f(19,"td")(20,"span",15),w(21),m()()(),f(22,"tr")(23,"th")(24,"label",18),w(25,"Price"),m()(),f(26,"td")(27,"div",13)(28,"input",19),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"price"))}),m()()(),f(29,"td")(30,"span",15),w(31),m()()(),f(32,"tr")(33,"td")(34,"label",20),w(35,"Name"),m()(),f(36,"td")(37,"div",13)(38,"input",21),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"name"))}),m()()(),f(39,"td")(40,"span",15),w(41),m()()(),f(42,"tr")(43,"td")(44,"label",22),w(45,"Move Product Name"),m()(),f(46,"td")(47,"div",13)(48,"input",23),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"moveProductName"))}),m()()(),f(49,"td")(50,"span",15),w(51),m()()(),f(52,"tr")(53,"td")(54,"label",24),w(55,"Release Date"),m()(),f(56,"td")(57,"div",13)(58,"input",25),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"releaseDate"))}),m()()(),f(59,"td")(60,"span",15),w(61),m()()(),f(62,"tr")(63,"td")(64,"label",26),w(65,"Discount Visible"),m()(),f(66,"td")(67,"div",13)(68,"input",27),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"discountVisible"))}),m()()(),f(69,"td")(70,"span",15),w(71),m()()(),f(72,"tr")(73,"td")(74,"label",28),w(75,"Pricebook Price"),m()(),f(76,"td")(77,"div",13)(78,"input",29),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"pricebookPrice"))}),m()()(),f(79,"td")(80,"span",15),w(81),m()()()()(),K(82,eE,2,1,"ng-template",null,0,te)(84,tE,2,1,"ng-template",null,1,te)(86,iE,2,1,"ng-template",null,2,te)(88,nE,2,1,"ng-template",null,3,te)(90,rE,2,1,"ng-template",null,4,te)(92,oE,2,1,"ng-template",null,5,te)(94,sE,2,1,"ng-template",null,6,te)(96,aE,2,1,"ng-template",null,7,te)(98,lE,2,1,"ng-template",null,8,te)(100,cE,2,1,"ng-template",null,9,te)(102,dE,2,1,"ng-template",null,10,te)}r&2&&(y(8),S("checked",o.barcode())("ngModel",o.barcode()),y(3),D(o.tooltip.barcode),y(7),S("checked",o.code())("ngModel",o.code()),y(3),D(o.tooltip.code),y(7),S("ngModel",o.price()),y(3),D(o.tooltip.price),y(7),S("ngModel",o.name()),y(3),D(o.tooltip.name),y(7),S("ngModel",o.moveProductName()),y(3),D(o.tooltip.moveProductName),y(7),S("ngModel",o.releaseDate()),y(3),D(o.tooltip.releaseDate),y(7),S("ngModel",o.discountVisible()),y(3),D(o.tooltip.discountVisible),y(7),S("ngModel",o.pricebookPrice()),y(3),D(o.tooltip.pricebookPrice))},dependencies:[nt,On,Ye,yt,Qe,us],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});let t=e;return t})();function uE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.priceWithTax)}}function pE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.selectedTax)}}function hE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.currency)}}function fE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.fontSize)}}function mE(t,e){if(t&1&&(f(0,"span",16),w(1),m()),t&2){let n=k();y(),D(n.tooltip.outletPrice)}}var k0=(()=>{let e=class e{constructor(){this.options=wt,this.hasPriceTax=H(!1),this.selectedTax=H(""),this.taxType=H({}),this.currency=H(""),this.fontSize=H(0),this.outletPrice=H(""),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=I(ce),this.destroyRef=I(Ae),this.injector=I(Be),this.outlets=H([])}get taxs(){return this.storeService.taxs()}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(qe(this.destroyRef),re(s=>{this.hasPriceTax.set(s.PriceWithTax),this.selectedTax.set(s.TaxType&&s.TaxType.ID),this.currency.set(s.CurrencySymbol),this.fontSize.set(s.PriceFontSize),this.outletPrice.set(s.OutletID)})).subscribe();let i=this.storeService.paperConfig().Outlets,r=this.storeService.productItems(),o=i.filter(s=>r.some(a=>a.OutletPrice.some(l=>l.Outlet===s.Name)));this.outlets.set(o),rt(this.storeService.productItems,{injector:this.injector}).pipe(re(s=>{let a=s.some(l=>l.Promotions);this.outletPrice.set(a?"":this.outletPrice())})).subscribe(),rt(this.outletPrice,{injector:this.injector}).pipe(At(s=>!!s),re(()=>{let s=[...this.storeService.productItems().map(a=>E(b({},a),{Promotions:null}))];this.storeService.onChangeProductItems(s)})).subscribe()}onInputHandler(i,r){switch(r){case"hasPriceTax":this.hasPriceTax.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PriceWithTax:this.hasPriceTax()}));break;case"selectedTax":let o=this.storeService.taxs().findIndex(s=>s.ID===i);o!==-1&&(this.selectedTax.set(i),this.taxType.set(this.storeService.taxs()[o])),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{TaxType:this.taxType()}));break;case"currency":this.currency.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{CurrencySymbol:this.currency()}));break;case"fontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break;case"outletPrice":if(this.outletPrice.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{OutletID:this.outletPrice()})),this.storeService.paperConfiguration().OutletID){let s=[...this.storeService.productItems().map(a=>E(b({},a),{Promotions:null}))];this.storeService.onChangeProductItems(s)}break}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-price"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",5)(1,"tbody")(2,"tr")(3,"td")(4,"label",6),w(5,"Price With Tax"),m()(),f(6,"td")(7,"div",7)(8,"input",8),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"hasPriceTax"))}),m()()(),f(9,"td")(10,"span",9),w(11),m()()(),f(12,"tr")(13,"td")(14,"label",10),w(15,"Selected Tax"),m()(),f(16,"td")(17,"ng-select",11),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"selectedTax"))}),m()(),f(18,"td")(19,"span",9),w(20),m()()(),f(21,"tr")(22,"td")(23,"label",12),w(24,"Currency"),m()(),f(25,"td")(26,"input",13),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"currency"))}),m()(),f(27,"td")(28,"span",9),w(29),m()()(),f(30,"tr")(31,"th")(32,"label",14),w(33,"Outlet Price"),m()(),f(34,"td")(35,"ng-select",15),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"outletPrice"))}),m()(),f(36,"td")(37,"span",9),w(38),m()()()()(),K(39,uE,2,1,"ng-template",null,0,te)(41,pE,2,1,"ng-template",null,1,te)(43,hE,2,1,"ng-template",null,2,te)(45,fE,2,1,"ng-template",null,3,te)(47,mE,2,1,"ng-template",null,4,te)}r&2&&(y(8),S("checked",o.hasPriceTax())("ngModel",o.hasPriceTax()),y(3),D(o.tooltip.priceWithTax),y(6),S("ngModel",o.selectedTax())("items",o.taxs),y(3),D(o.tooltip.selectedTax),y(6),S("ngModel",o.currency()),y(3),D(o.tooltip.currency),y(6),S("ngModel",o.outletPrice())("items",o.outlets()),y(3),D(o.tooltip.outletPrice))},dependencies:[nt,Xe,On,Ye,yt,Qe,Wt,li],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});let t=e;return t})();function gE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.maxCharacter)}}function yE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.namePrefix)}}function vE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.storeName)}}function bE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.orientation)}}function _E(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.useDescriptionAsCode)}}function wE(t,e){if(t&1&&(f(0,"span",21),w(1),m()),t&2){let n=k();y(),D(n.tooltip.removeDefault)}}var T0=(()=>{let e=class e{constructor(){this.storeService=I(ce),this.fb=I(Ni),this.destroyRef=I(Ae),this.injector=I(Be),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=H(0),this.namePrefix=H(""),this.storeName=H(""),this.orientation=H(0),this.useDescriptionAsCode=H(!1),this.removeDefault=H(!1),this.options=wt}ngOnInit(){this.initForm(),rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(qe(this.destroyRef),re(i=>{this.maxCharacter.set(i.ProductNameMaxLength),this.namePrefix.set(i.ProductNamePrefix),this.storeName.set(i.StoreName),this.orientation.set(i.Orientation),this.useDescriptionAsCode.set(i.DescriptionAsCode),this.removeDefault.set(!1)})).subscribe(),this.form.valueChanges.pipe(qe(this.destroyRef),re(i=>{let r=E(b({},this.storeService.paperConfiguration()),{ProductNameMaxLength:i.maxCharacter,ProductNamePrefix:i.namePrefix,StoreName:i.storeName,Orientation:i.orientation,DescriptionAsCode:!!i.useDescriptionAsCode});this.storeService.onChangePaperConfiguration(r);let s=["ProductNameMaxLength","ProductNamePrefix","StoreName","Orientation","DescriptionAsCode"].reduce((a,l)=>(l in this.storeService.paperConfiguration()&&(a[l]=this.storeService.paperConfiguration()[l]),a),{});console.log("filtered advanced",s)})).subscribe()}onInputHandler(i,r){switch(r){case"maxCharacter":this.maxCharacter.set(+i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNameMaxLength:this.maxCharacter()}));break;case"namePrefix":this.namePrefix.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNamePrefix:this.namePrefix()}));break;case"storeName":this.storeName.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{StoreName:this.storeName()}));break;case"orientation":this.orientation.set(+i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{Orientation:this.orientation()}));break;case"useDescriptionAsCode":this.useDescriptionAsCode.set(!!i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{DescriptionAsCode:this.useDescriptionAsCode()}));break;case"removeDefault":this.removeDefault.set(!!i);break}}initForm(){this.form=this.fb.group({maxCharacter:new Ke(this.storeService.paperConfiguration().ProductNameMaxLength,[Je.required]),namePrefix:new Ke(null,[Je.required]),storeName:new Ke(null,[Je.required]),orientation:new Ke(null,[Je.required]),useDescriptionAsCode:new Ke(null,[Je.required]),removeDefault:new Ke("0",[Je.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()})}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-advanced"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",6)(1,"tbody")(2,"tr")(3,"td")(4,"label",7),w(5,"Max Character"),m()(),f(6,"td")(7,"input",8),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"maxCharacter"))}),m()(),f(8,"td")(9,"span",9),w(10),m()()(),f(11,"tr")(12,"td")(13,"label",10),w(14,"Name Prefix"),m()(),f(15,"td")(16,"input",11),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"namePrefix"))}),m()(),f(17,"td")(18,"span",9),w(19),m()()(),f(20,"tr")(21,"td")(22,"label",12),w(23,"Store Name"),m()(),f(24,"td")(25,"input",13),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"storeName"))}),m()(),f(26,"td")(27,"span",9),w(28),m()()(),f(29,"tr")(30,"th")(31,"label",14),w(32,"Orientation"),m()(),f(33,"td")(34,"ng-select",15),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"orientation"))}),m()(),f(35,"td")(36,"span",9),w(37),m()()(),f(38,"tr")(39,"td")(40,"label",16),w(41,"Use description as code"),m()(),f(42,"td")(43,"div",17)(44,"input",18),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"useDescriptionAsCode"))}),m()()(),f(45,"td")(46,"span",9),w(47),m()()(),f(48,"tr")(49,"td")(50,"label",19),w(51,'Remove "Default"'),m()(),f(52,"td")(53,"div",17)(54,"input",20),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"removeDefault"))}),m()()(),f(55,"td")(56,"span",9),w(57),m()()()()(),K(58,gE,2,1,"ng-template",null,0,te)(60,yE,2,1,"ng-template",null,1,te)(62,vE,2,1,"ng-template",null,2,te)(64,bE,2,1,"ng-template",null,3,te)(66,_E,2,1,"ng-template",null,4,te)(68,wE,2,1,"ng-template",null,5,te)}r&2&&(y(7),S("ngModel",o.maxCharacter()),y(3),D(o.tooltip.maxCharacter),y(6),S("ngModel",o.namePrefix()),y(3),D(o.tooltip.namePrefix),y(6),S("ngModel",o.storeName()),y(3),D(o.tooltip.storeName),y(6),S("ngModel",o.orientation())("items",o.storeService.paperConfiguration().OrientationChoice),y(3),D(o.tooltip.orientation),y(7),S("checked",o.useDescriptionAsCode())("ngModel",o.useDescriptionAsCode()),y(3),D(o.tooltip.useDescriptionAsCode),y(7),S("checked",o.removeDefault())("ngModel",o.removeDefault()),y(3),D(o.tooltip.removeDefault))},dependencies:[Qe,Xe,On,Ye,Wt,li,nt,yt],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});let t=e;return t})();var I0=(()=>{let e=class e{transform(i,...r){let o=Number(i),s=Number(r[0]);return o*s/100+o}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=Lo({name:"taxs",type:e,pure:!0,standalone:!0});let t=e;return t})();var O0=ge(ac());var xE=["barcode"],CE=t=>({"h-100":t}),Le=t=>({"font-size.px":t});function SE(t,e){if(t&1&&(f(0,"div",3),X(1,"canvas",11,0),m()),t&2){let n=k(2);y(),S("ngStyle",n.barcodeStyle)}}function PE(t,e){if(t&1&&(f(0,"span",5),w(1),m()),t&2){let n=k().$implicit,i=k();S("ngStyle",xe(2,Le,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.Code)}}function EE(t,e){if(t&1&&(f(0,"span",13),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,Le,n.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.storeService.paperConfiguration().ProductNamePrefix)}}function DE(t,e){if(t&1&&(f(0,"div",6),K(1,EE,2,4,"span",12),f(2,"span",13),w(3),Te(4,"slice"),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngIf",i.storeService.paperConfiguration().ProductNamePrefix),y(),S("ngStyle",xe(7,Le,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(Ga(4,3,n.Name,0,i.storeService.paperConfiguration().ProductNameMaxLength))}}function kE(t,e){if(t&1&&(f(0,"span",23),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,Le,n.storeService.paperConfiguration().PriceFontSize)),y(),D(n.storeService.paperConfiguration().CurrencySymbol)}}function TE(t,e){if(t&1&&(f(0,"span",24),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,Le,n.storeService.paperConfiguration().PriceFontSize)),y(),D(n.storeService.paperConfiguration().CurrencySymbol)}}function IE(t,e){if(t&1&&(f(0,"div",7)(1,"div",14)(2,"div",15),w(3),m(),f(4,"div",16),K(5,kE,2,4,"span",17),f(6,"span",18),w(7),Te(8,"number"),m()()(),f(9,"div",14)(10,"div",19),w(11),m(),f(12,"div",20),K(13,TE,2,4,"span",21),f(14,"span",22),w(15),Te(16,"number"),m()()()()),t&2){let n=k().$implicit,i=k();y(2),S("ngStyle",xe(14,Le,i.storeService.paperConfiguration().ProductNameFontSize)),y(),jt(" ",i.storeService.paperConfiguration().BasicPriceLabel," "),y(2),S("ngIf",i.storeService.paperConfiguration().CurrencySymbol),y(),S("ngStyle",xe(16,Le,i.storeService.paperConfiguration().PriceFontSize)),y(),D(Vt(8,10,n.UnitPrice)),y(3),S("ngStyle",xe(18,Le,i.storeService.paperConfiguration().ProductNameFontSize)),y(),jt(" ",i.storeService.paperConfiguration().PromotionPriceLabel," "),y(2),S("ngIf",i.storeService.paperConfiguration().CurrencySymbol),y(),S("ngStyle",xe(20,Le,i.storeService.paperConfiguration().PriceFontSize)),y(),D(Vt(16,12,i.promotionDiscount(n.Promotions)))}}function OE(t,e){if(t&1&&(f(0,"span",26),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,Le,n.storeService.paperConfiguration().PriceFontSize)),y(),D(n.storeService.paperConfiguration().CurrencySymbol)}}function FE(t,e){if(t&1&&(f(0,"div",8),K(1,OE,2,4,"span",25),f(2,"span",26),w(3),Te(4,"taxs"),Te(5,"number"),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngIf",i.storeService.paperConfiguration().CurrencySymbol),y(),S("ngStyle",xe(8,Le,i.storeService.paperConfiguration().PriceFontSize)),y(),D(Vt(5,6,yi(4,3,n.UnitPrice,i.taxRate)))}}function RE(t,e){if(t&1&&(f(0,"span",26),w(1),m()),t&2){let n=k(5);S("ngStyle",xe(2,Le,n.storeService.paperConfiguration().PriceFontSize)),y(),D(n.storeService.paperConfiguration().CurrencySymbol)}}function ME(t,e){if(t&1&&(f(0,"div",8),K(1,RE,2,4,"span",25),f(2,"span",26),w(3),Te(4,"taxs"),Te(5,"number"),m()()),t&2){let n=k().$implicit,i=k(3);y(),S("ngIf",i.storeService.paperConfiguration().CurrencySymbol),y(),S("ngStyle",xe(8,Le,i.storeService.paperConfiguration().PriceFontSize)),y(),D(Vt(5,6,yi(4,3,n.Price,i.taxRate)))}}function BE(t,e){if(t&1&&K(0,ME,6,10,"div",8),t&2){let n=e.$implicit,i=k(3);oe(n.Outlet===i.storeService.outlet$().Name?0:-1)}}function AE(t,e){if(t&1&&Nt(0,BE,1,1,null,null,$o),t&2){let n=k().$implicit;zt(n.OutletPrice)}}function NE(t,e){if(t&1&&(f(0,"span",13),w(1),m()),t&2){let n=k(3);S("ngStyle",xe(2,Le,n.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.storeService.paperConfiguration().ProductNamePrefix)}}function zE(t,e){if(t&1&&(f(0,"div",9),K(1,NE,2,4,"span",12),f(2,"span",13),w(3),Te(4,"slice"),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngIf",i.storeService.paperConfiguration().ProductNamePrefix),y(),S("ngStyle",xe(7,Le,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(Ga(4,3,n.Name,0,i.storeService.paperConfiguration().ProductNameMaxLength))}}function LE(t,e){if(t&1&&(f(0,"div",27)(1,"span",13),w(2),m()()),t&2){let n=k(3);y(),S("ngStyle",xe(2,Le,n.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.storeService.paperConfiguration().StoreName)}}function HE(t,e){if(t&1&&(f(0,"div",28)(1,"span",13),w(2),m()()),t&2){let n=k(3);y(),S("ngStyle",xe(2,Le,n.storeService.paperConfiguration().ProductNameFontSize)),y(),D(n.storeService.paperConfiguration().StoreName)}}function jE(t,e){if(t&1&&K(0,LE,3,4,"div",27)(1,HE,3,4,"div",28),t&2){let n=k(2);oe(n.storeService.paperConfiguration().Orientation===0?0:1)}}function VE(t,e){if(t&1&&(f(0,"div",8)(1,"span",13),w(2),Te(3,"date"),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngStyle",xe(5,Le,i.storeService.paperConfiguration().ProductNameFontSize)),y(),D(yi(3,2,n.ReleasedDate,"dd MMM yyyy"))}}function UE(t,e){if(t&1&&(f(0,"div",8)(1,"span",13),w(2),m()()),t&2){let n=k().$implicit,i=k();y(),S("ngStyle",xe(2,Le,i.storeService.paperConfiguration().ProductNameFontSize)),y(),jt("",n.PriceDiscount,"% Off")}}function WE(t,e){if(t&1&&(f(0,"span"),w(1),m(),f(2,"span"),w(3,"-"),m(),f(4,"span"),w(5),m(),f(6,"span"),w(7,"-"),m(),f(8,"span"),w(9),Te(10,"number"),m()),t&2){let n=e.$implicit;y(),D(n.Name),y(4),D(n.MinimumQuantity),y(4),D(Vt(10,3,n.UnitPrice))}}function $E(t,e){if(t&1&&(f(0,"div",10),Nt(1,WE,11,5,null,null,mr),m()),t&2){let n=k().$implicit,i=k();S("ngStyle",xe(1,Le,i.storeService.paperConfiguration().PricebookFontSize)),y(),zt(n.Pricebook)}}function qE(t,e){if(t&1&&(f(0,"div",2),K(1,SE,3,1,"div",3),f(2,"div",4),K(3,PE,2,4,"span",5)(4,DE,5,9,"div",6)(5,IE,17,22,"div",7)(6,FE,6,10,"div",8)(7,AE,2,0)(8,zE,5,9,"div",9)(9,jE,2,1)(10,VE,4,7,"div",8)(11,UE,3,4,"div",8)(12,$E,3,3,"div",10),m()()),t&2){let n=e.$implicit,i=k();S("ngStyle",i.stickerStyles),y(),oe(i.storeService.paperConfiguration().BarcodeVisible?1:-1),y(),S("ngClass",xe(13,CE,!i.storeService.paperConfiguration().BarcodeVisible)),y(),oe(i.storeService.paperConfiguration().CodeVisible?3:-1),y(),oe(i.storeService.paperConfiguration().MoveProductNameOnTop&&i.storeService.paperConfiguration().NameVisible?4:-1),y(),oe(n.Promotions&&i.storeService.paperConfiguration().PriceVisible?5:-1),y(),oe(!n.Promotions&&!i.storeService.paperConfiguration().OutletID&&i.storeService.paperConfiguration().PriceVisible?6:-1),y(),oe(i.storeService.paperConfiguration().OutletID&&i.storeService.paperConfiguration().PriceVisible?7:-1),y(),oe(!i.storeService.paperConfiguration().MoveProductNameOnTop&&i.storeService.paperConfiguration().NameVisible?8:-1),y(),oe(i.storeService.paperConfiguration().StoreName?9:-1),y(),oe(i.storeService.paperConfiguration().ShowReleasedDate?10:-1),y(),oe(i.storeService.paperConfiguration().ShowPriceDiscount?11:-1),y(),oe(i.storeService.paperConfiguration().PricebookVisible?12:-1)}}var Ra=(()=>{let e=class e{constructor(){this.items=[],this.previewType="single",this.storeService=I(ce),this.Object=Object,this.cdr=I(Qi),this.renderer=I(jo),this.elementsInitialized=!1,this.injector=I(Be)}get barcodeContainerStyles(){return{display:"grid",gridTemplateColumns:`repeat(${Math.floor(this.storeService.paperConfiguration().PaperWidth/this.storeService.paperConfiguration().StickerWidth)}, ${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`,padding:`${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"}`}}get stickerStyles(){let i=this.storeService.paperConfiguration().StickerWidth,r=this.storeService.paperConfiguration().StickerHeight,o=this.items.length===1&&this.previewType==="single"?"250px":`${typeof i=="number"?i+"px":i}`,s=`${this.previewType==="single"?"90px":r+"px"}`;return{width:o,height:s}}get barcodeStyle(){return{width:"100%",height:`${this.previewType==="single"?"25px":this.storeService.paperConfiguration().BarcodeHeight+"px"}`}}get taxRate(){if(this.storeService.paperConfiguration().TaxType){let r=this.storeService.taxs().findIndex(o=>o.ID===this.storeService.paperConfiguration().TaxType.ID);if(r!==-1)return this.storeService.taxs()[r].Rate}return 0}get stickerStoreName(){let i={order:"4",lineHeight:"15px"},r={position:"absolute",right:"0",top:"0",transform:"translate(0%, 20%) rotate(270deg)"};return this.storeService.paperConfiguration().Orientation===0?i:r}ngOnInit(){}ngAfterViewInit(){this.elementsInitialized=!0}ngAfterViewChecked(){this.generateBarcodes(),this.elementsInitialized&&(this.generateBarcodes(),this.elementsInitialized=!1)}generateBarcodes(){this.storeService.expandProductItems().forEach((i,r)=>{let o=this.barcodeRef.get(r)?.nativeElement;o&&(0,O0.default)(o,i.Code,{format:"CODE128",lineColor:"#000",width:20,displayValue:!1})})}promotionDiscount(i){try{return Object.keys(i).length?i.Discount&&i.Discount>0?i.UnitPrice-i.UnitPrice*i.Discount/100:i.UnitPrice:0}catch(r){throw new Error("error: ",r)}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-barcode-preview"]],viewQuery:function(r,o){if(r&1&&oi(xE,5,mt),r&2){let s;Lt(s=Ht())&&(o.barcodeRef=s)}},inputs:{items:"items",previewType:"previewType"},standalone:!0,features:[ie],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"],[1,"text-dark",2,"line-height","9px",3,"ngStyle"],[2,"line-height","9px","width","100%","text-align","center"],[1,"d-flex","flex-column",2,"line-height","9px"],[2,"line-height","9px"],[2,"line-height","0","width","100%","text-align","center"],[1,"d-flex","gap-1",2,"line-height","9px",3,"ngStyle"],["id","barcode",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"],["class","promotion__normalprice text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__normalprice","text-decoration-line-through","text-danger",3,"ngStyle"],[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"],["id","store-name-horizontal",1,"",2,"line-height","9px"],["id","store-name-vertical",1,"position-absolute",2,"line-height","9px"]],template:function(r,o){r&1&&(f(0,"div",1),Nt(1,qE,13,15,"div",2,mr),m()),r&2&&(S("ngStyle",o.barcodeContainerStyles),y(),zt(o.items))},dependencies:[Tu,I0,Tn,Ou,Ut,Ai,Fu,Yo],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)}"],changeDetection:0});let t=e;return t})();var F0=(()=>{let e=class e{constructor(){this.storeService=I(ce)}ngOnInit(){}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-customize-label"]],standalone:!0,features:[ie],decls:58,vars:9,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"],[1,"f","fas","fa-angle-right"],[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"],[3,"items"],[1,"col-lg-6","col-md-6"],[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"]],template:function(r,o){if(r&1){let s=pe();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),w(8,"Customize Label"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),A("click",function(){return q(s),G(o.storeService.onPrevStep())}),X(12,"i",12),f(13,"span",13),w(14,"Back"),m()(),f(15,"button",11),A("click",function(){return q(s),G(o.storeService.onNextStep())}),f(16,"span",13),w(17,"Next"),m(),X(18,"i",14),m()()()()()()(),f(19,"div",15)(20,"div",16)(21,"div",17)(22,"div",18),X(23,"app-barcode-preview",19),m()()(),f(24,"div",20)(25,"div",21)(26,"div",22)(27,"h4",23),w(28," Sticker Content "),m()(),f(29,"div",24)(30,"div",25)(31,"div",26)(32,"h2",27)(33,"button",28)(34,"span",29),w(35,"Barcode View"),m()()(),f(36,"div",30)(37,"div",31,0),X(39,"app-barcode-view"),m()()(),f(40,"div",26)(41,"h2",27)(42,"button",28)(43,"span",32),w(44,"Price"),m()()(),f(45,"div",30)(46,"div",31,0),X(48,"app-price"),m()()(),f(49,"div",26)(50,"h2",27)(51,"button",28)(52,"span",32),w(53,"Advanced"),m()()(),f(54,"div",30)(55,"div",31,0),X(57,"app-advanced"),m()()()()()()()()()}r&2&&(y(),St("data-navbarbg",o.storeService.options().navbarbg),y(),S("ngClass",o.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),S("ngbCollapse",!o.storeService.options().isCollapsed),St("data-navbarbg",o.storeService.options().navbarbg),y(20),S("items",o.storeService.expandProductItem()),y(7),S("closeOthers",!0),y(),S("collapsed",!1),y(9),S("collapsed",!0),y(9),S("collapsed",!0))},dependencies:[rs,ss,os,cs,as,ls,Un,Fn,Ai,D0,k0,T0,Ra],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100vh}"],changeDetection:0});let t=e;return t})();function GE(t,e){if(t&1&&(f(0,"ng-option",3),w(1),m()),t&2){let n=e.$implicit;S("value",n.Name),y(),D(n.Name)}}var R0=(()=>{let e=class e{onInputHandler(i,r){switch(r){case"paperWidth":this.paperWidth.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PaperWidth:this.paperWidth()}));break;case"stickerWidth":this.stickerWidth.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{StickerWidth:this.stickerWidth()}));break;case"stickerHeight":this.stickerHeight.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{StickerHeight:this.stickerHeight()}));break;case"barcodeHeight":this.barcodeHeight.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break}}constructor(){this.options=wt,this.storeService=I(ce),this.destroyRef=I(Ae),this.injector=I(Be),this.paperWidth=H(0),this.stickerWidth=H(0),this.stickerHeight=H(0),this.paperSource=H(""),this.barcodeHeight=H(0),this.fontSize=H(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(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(re(i=>{this.paperWidth.set(i.PaperWidth),this.stickerWidth.set(i.StickerWidth),this.stickerHeight.set(i.StickerHeight),this.barcodeHeight.set(i.BarcodeHeight),this.fontSize.set(i.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(i){let r=this.storeService.paperConfig().PaperFormats.findIndex(o=>o.Name===i);r!==-1&&(this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[r].Name),this.storeService.onChangePaperConfiguration(this.storeService.paperConfig().PaperFormats[r]))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-pp-paper"]],standalone:!0,features:[ie],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(r,o){r&1&&(f(0,"table",0)(1,"tbody")(2,"tr")(3,"td")(4,"label",1),w(5,"Paper Source"),m()(),f(6,"td")(7,"ng-select",2),A("ngModelChange",function(a){return o.onChangePaperSource(a)}),Nt(8,GE,2,2,"ng-option",3,mr),m()(),f(10,"td")(11,"span",4),w(12),m()()(),f(13,"tr")(14,"td")(15,"label",5),w(16,"Paper Width"),m()(),f(17,"td")(18,"input",6),A("ngModelChange",function(a){return o.onInputHandler(a,"paperWidth")}),m()(),f(19,"td")(20,"span",4),w(21),m()()(),f(22,"tr")(23,"td")(24,"label",7),w(25,"Sticker Width"),m()(),f(26,"td")(27,"input",8),A("ngModelChange",function(a){return o.onInputHandler(a,"stickerWidth")}),m()(),f(28,"td")(29,"span",4),w(30),m()()(),f(31,"tr")(32,"th")(33,"label",9),w(34,"Sticker Height"),m()(),f(35,"td")(36,"input",10),A("ngModelChange",function(a){return o.onInputHandler(a,"stickerHeight")}),m()(),f(37,"td")(38,"span",4),w(39),m()()(),f(40,"tr")(41,"td")(42,"label",11),w(43,"Barcode Height"),m()(),f(44,"td")(45,"input",12),A("ngModelChange",function(a){return o.onInputHandler(a,"barcodeHeight")}),m()(),f(46,"td")(47,"span",4),w(48),m()()(),f(49,"tr")(50,"td")(51,"label",13),w(52,"Font Size"),m()(),f(53,"td")(54,"input",14),A("ngModelChange",function(a){return o.onInputHandler(a,"fontSize")}),m()(),f(55,"td")(56,"span",4),w(57),m()()()()()),r&2&&(y(7),S("ngModel",o.storeService.paperSource()),y(),zt(o.storeService.paperConfig().PaperFormats),y(4),D(o.tooltip.paperWidth),y(6),S("maskito",o.options)("ngModel",o.paperWidth()),y(3),D(o.tooltip.paperWidth),y(6),S("maskito",o.options)("ngModel",o.stickerWidth()),y(3),D(o.tooltip.stickerWidth),y(6),S("maskito",o.options)("ngModel",o.stickerHeight()),y(3),D(o.tooltip.stickerHeight),y(6),S("maskito",o.options)("ngModel",o.barcodeHeight()),y(3),D(o.tooltip.barcodeHeight),y(6),S("maskito",o.options)("ngModel",o.fontSize()),y(3),D(o.tooltip.fontSize))},dependencies:[nt,Xe,Ye,yt,Qe,Wt,li,ms,ji],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});let t=e;return t})();function XE(t,e){if(t&1&&(f(0,"span",14),w(1),m()),t&2){let n=k();y(),D(n.tooltip.leftIndent)}}function YE(t,e){if(t&1&&(f(0,"span",14),w(1),m()),t&2){let n=k();y(),D(n.tooltip.topIndent)}}function KE(t,e){if(t&1&&(f(0,"span",14),w(1),m()),t&2){let n=k();y(),D(n.tooltip.rowSpacing)}}function QE(t,e){if(t&1&&(f(0,"span",14),w(1),m()),t&2){let n=k();y(),D(n.tooltip.columnSpacing)}}var M0=(()=>{let e=class e{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=H(0),this.topIndent=H(0),this.rowSpacing=H(0),this.columnSpacing=H(0),this.storeService=I(ce),this.destroyRef=I(Ae),this.injector=I(Be)}onInputHandler(i,r){switch(r){case"marginLeft":this.leftIndent.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{MarginLeft:this.leftIndent()}));break;case"marginTop":this.topIndent.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{MarginTop:this.topIndent()}));break;case"rowSpacing":this.rowSpacing.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{RowSpacing:this.rowSpacing()}));break;case"columnSpacing":this.columnSpacing.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ColumnSpacing:this.columnSpacing()}));break}}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(qe(this.destroyRef),re(i=>{this.leftIndent.set(i.MarginLeft),this.topIndent.set(i.MarginTop),this.rowSpacing.set(i.RowSpacing),this.columnSpacing.set(i.ColumnSpacing)})).subscribe()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-pp-spacing"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",4)(1,"tbody")(2,"tr")(3,"td")(4,"label",5),w(5,"Left Indent"),m()(),f(6,"td")(7,"input",6),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"marginLeft"))}),m()(),f(8,"td")(9,"span",7),w(10),m()()(),f(11,"tr")(12,"td")(13,"label",8),w(14,"Top Indent"),m()(),f(15,"td")(16,"input",9),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"marginTop"))}),m()(),f(17,"td")(18,"span",7),w(19),m()()(),f(20,"tr")(21,"td")(22,"label",10),w(23,"Row Spacing"),m()(),f(24,"td")(25,"input",11),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"rowSpacing"))}),m()(),f(26,"td")(27,"span",7),w(28),m()()(),f(29,"tr")(30,"th")(31,"label",12),w(32,"Column Spacing"),m()(),f(33,"td")(34,"input",13),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"columnSpacing"))}),m()(),f(35,"td")(36,"span",7),w(37),m()()()()(),K(38,XE,2,1,"ng-template",null,0,te)(40,YE,2,1,"ng-template",null,1,te)(42,KE,2,1,"ng-template",null,2,te)(44,QE,2,1,"ng-template",null,3,te)}r&2&&(y(7),S("maskito",o.options)("ngModel",o.leftIndent()),y(3),D(o.tooltip.leftIndent),y(6),S("maskito",o.options)("ngModel",o.topIndent()),y(3),D(o.tooltip.topIndent),y(6),S("maskito",o.options)("ngModel",o.rowSpacing()),y(3),D(o.tooltip.rowSpacing),y(6),S("maskito",o.options)("ngModel",o.columnSpacing()),y(3),D(o.tooltip.columnSpacing))},dependencies:[nt,Xe,Ye,yt,Qe,ji,Wt],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});let t=e;return t})();function ZE(t,e){if(t&1&&(f(0,"span",8),w(1),m()),t&2){let n=k();y(),D(n.tooltip.basicPriceLabel)}}function JE(t,e){if(t&1&&(f(0,"span",8),w(1),m()),t&2){let n=k();y(),D(n.tooltip.promotionPriceLabel)}}var B0=(()=>{let e=class e{constructor(){this.tooltip={basicPriceLabel:"Custom label normal price",promotionPriceLabel:"Custom label promotion price"},this.storeService=I(ce),this.destroyRef=I(Ae),this.injector=I(Be),this.basicPriceLabel=H(""),this.promotionPriceLabel=H(""),this.options=wt}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(qe(this.destroyRef),re(i=>{this.basicPriceLabel.set(i.BasicPriceLabel),this.promotionPriceLabel.set(i.PromotionPriceLabel)})).subscribe()}onInputHandler(i,r){switch(r){case"basicPriceLabel":this.basicPriceLabel.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{BasicPriceLabel:this.basicPriceLabel()}));break;case"promotionPriceLabel":this.promotionPriceLabel.set(i),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PromotionPriceLabel:this.promotionPriceLabel()}));break}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-pp-label"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"label",3),w(5,"Normal Price"),m()(),f(6,"td")(7,"input",4),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"basicPriceLabel"))}),m()(),f(8,"td")(9,"span",5),w(10),m()()(),f(11,"tr")(12,"td")(13,"label",6),w(14,"Promotion Price"),m()(),f(15,"td")(16,"input",7),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"promotionPriceLabel"))}),m()(),f(17,"td")(18,"span",5),w(19),m()()()()(),K(20,ZE,2,1,"ng-template",null,0,te)(22,JE,2,1,"ng-template",null,1,te)}r&2&&(y(7),S("ngModel",o.basicPriceLabel()),y(3),D(o.tooltip.basicPriceLabel),y(6),S("ngModel",o.promotionPriceLabel()),y(3),D(o.tooltip.promotionPriceLabel))},dependencies:[nt,Xe,Ye,yt,Qe],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});let t=e;return t})();var z0=ge(A0());function eD(t,e){if(t&1){let n=pe();f(0,"tr")(1,"td")(2,"label",6),w(3,"Pricebook Font Size"),m()(),f(4,"td")(5,"input",7),A("ngModelChange",function(r){q(n);let o=k();return G(o.onInputHandler(r,"pricebookFontSize"))}),m()(),f(6,"td")(7,"span",5),w(8),m()()()}if(t&2){let n=k();y(5),S("maskito",n.options)("ngModel",n.pricebookFontSize()),y(3),D(n.tooltip.pricebookFontSize)}}function tD(t,e){if(t&1&&(f(0,"span",8),w(1),m()),t&2){let n=k();y(),D(n.tooltip.pricebookFontSize)}}function iD(t,e){if(t&1&&(f(0,"span",8),w(1),m()),t&2){let n=k();y(),D(n.tooltip.fontSize)}}var N0=(()=>{let e=class e{constructor(){this.options=wt,this.barcodeHeight=H(0),this.fontSize=H(0),this.barcode=H(!1),this.code=H(!1),this.price=H(!1),this.name=H(!1),this.moveProductName=H(!1),this.releaseDate=H(!1),this.discountVisible=H(!1),this.pricebookPrice=H(!1),this.pricebookFontSize=H(0),this.tooltip={fontSize:"Change font size for price",pricebookFontSize:"Change font size for pricebook price"},this.storeService=I(ce),this.injector=I(Be),this.destroyRef=I(Ae)}ngOnInit(){rt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(qe(this.destroyRef),re(i=>{this.pricebookFontSize.set(i.PricebookFontSize),this.fontSize.set(i.PriceFontSize)})).subscribe()}onInputHandler(i,r){switch(console.log("value",i),r){case"pricebookFontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"fontSize":this.fontSize.set(parseFloat(i.replace("px",""))),this.storeService.onChangePaperConfiguration(E(b({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break}}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-price-fontsize"]],standalone:!0,features:[ie],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(r,o){if(r&1){let s=pe();f(0,"table",2)(1,"tbody"),K(2,eD,9,3,"tr"),f(3,"tr")(4,"td")(5,"label",3),w(6,"Font Size"),m()(),f(7,"td")(8,"input",4),A("ngModelChange",function(l){return q(s),G(o.onInputHandler(l,"fontSize"))}),m()(),f(9,"td")(10,"span",5),w(11),m()()()()(),K(12,tD,2,1,"ng-template",null,0,te)(14,iD,2,1,"ng-template",null,1,te)}r&2&&(y(2),oe(o.storeService.paperConfiguration().PricebookVisible?2:-1),y(6),S("maskito",o.options)("ngModel",o.fontSize()),y(3),D(o.tooltip.fontSize))},dependencies:[ji,Ut,nt,Xe,Ye,yt],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%}"]});let t=e;return t})();function nD(t,e){t&1&&(f(0,"button",14)(1,"span",13),w(2,"Next"),m(),X(3,"i",33),m())}function rD(t,e){if(t&1){let n=pe();f(0,"button",34),A("click",function(){q(n);let r=k();return G(r.printBarcode())}),f(1,"span",13),w(2,"Print"),m()()}}var L0=(()=>{let e=class e{constructor(){this.storeService=I(ce),this.httpService=I(ai),this.toastr=I(Jo),this.destroyRef=I(Ae)}ngOnInit(){}printBarcode(){let i=this.storeService.paperConfiguration().PaperWidth,r=this.storeService.paperConfiguration().RowSpacing,o=this.storeService.paperConfiguration().ColumnSpacing,s=document.getElementById("barcode-container").innerHTML,a=Math.floor(+this.storeService.paperConfiguration().PaperWidth/+this.storeService.paperConfiguration().StickerWidth);(0,z0.default)({printable:"barcode-container",type:"html",css:"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",style:`
|
|
31
31
|
body {
|
|
32
32
|
font-family: Arial, Helvetica, sans-serif;
|
|
33
33
|
font-size: ${this.storeService.paperConfiguration().ProductNameFontSize}px;
|
|
@@ -43,13 +43,16 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
|
|
|
43
43
|
.sticker {
|
|
44
44
|
border: none !important;
|
|
45
45
|
height: ${this.storeService.paperConfiguration().StickerHeight}px;
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
|
|
48
48
|
}
|
|
49
49
|
.sticker-body {
|
|
50
50
|
display: flex;
|
|
51
51
|
flex-direction: column;
|
|
52
52
|
justify-content: center;
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
53
56
|
|
|
54
57
|
}
|
|
55
58
|
.sticker-body div {
|
|
@@ -64,18 +67,16 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
|
|
|
64
67
|
.sticker-header {
|
|
65
68
|
height: ${this.storeService.paperConfiguration().BarcodeHeight}px !important;
|
|
66
69
|
width: 100%;
|
|
70
|
+
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
height: 100%;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
+
|
|
73
74
|
.sticker-header canvas {
|
|
74
75
|
height: 100%;
|
|
75
76
|
width: 100%;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
|
|
79
80
|
|
|
80
81
|
#store-name-vertical {
|
|
81
82
|
top: 50%;
|
|
@@ -106,4 +107,4 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&
|
|
|
106
107
|
color: #000 !important;
|
|
107
108
|
}
|
|
108
109
|
`,font_size:"",targetStyle:["*"],onError:l=>{console.error("printjs",l)},onLoadingEnd:()=>{this.onSaveConfig()}})}ngAfterViewInit(){}onSaveConfig(){let i=this.storeService.paperConfig().PaperFormats,r=i.findIndex(a=>a.Name===this.storeService.paperConfiguration().Name);r!==-1&&(i[r]=this.storeService.paperConfiguration());let o={PaperFormats:[...i],SubDomain:localStorage.getItem("Domain")};console.log("Debug \u{1F41E} ==> Class: PrintPreviewComponent, Function: onSaveConfig, Line 189 payload(): ",`
|
|
109
|
-
`,o);let s={responseType:"text",observe:"response"};this.httpService.post("api/Config/SaveConfig",o,s).pipe(
|
|
110
|
+
`,o);let s={responseType:"text",observe:"response"};this.httpService.post("api/Config/SaveConfig",o,s).pipe(qe(this.destroyRef),Ar("response"),re(a=>{a instanceof Ru&&a.status===200&&this.toastr.success(a.body,"success")}),La(1)).subscribe()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-print-preview"]],standalone:!0,features:[ie],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"],["previewType","multiple",3,"items"],[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"]],template:function(r,o){if(r&1){let s=pe();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),w(8,"Print Preview"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),A("click",function(){return q(s),G(o.storeService.onPrevStep())}),X(12,"i",12),f(13,"span",13),w(14,"Back"),m()(),K(15,nD,4,0,"button",14)(16,rD,3,0,"button",15),m()()()()()(),f(17,"div",16)(18,"div",17)(19,"div",18)(20,"div",19)(21,"div",20),X(22,"app-barcode-preview",21),m()()()(),f(23,"div",17)(24,"div",22)(25,"div",23)(26,"h4",24),w(27,"Label Spacing"),m()(),f(28,"div",25)(29,"div",26)(30,"div",27)(31,"h2",28)(32,"button",29)(33,"span",30),w(34,"Paper"),m()()(),f(35,"div",31)(36,"div",32,0),X(38,"app-pp-paper"),m()()(),f(39,"div",27)(40,"h2",28)(41,"button",29)(42,"span",30),w(43,"Price Font Size"),m()()(),f(44,"div",31)(45,"div",32,0),X(47,"app-price-fontsize"),m()()(),f(48,"div",27)(49,"h2",28)(50,"button",29)(51,"span",30),w(52,"Spacing"),m()()(),f(53,"div",31)(54,"div",32,0),X(56,"app-pp-spacing"),m()()(),f(57,"div",27)(58,"h2",28)(59,"button",29)(60,"span",30),w(61,"Label"),m()()(),f(62,"div",31)(63,"div",32,0),X(65,"app-pp-label"),m()()()()()()()()()}r&2&&(y(),St("data-navbarbg",o.storeService.options().navbarbg),y(),S("ngClass",o.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),S("ngbCollapse",!o.storeService.options().isCollapsed),St("data-navbarbg",o.storeService.options().navbarbg),y(12),oe(o.storeService.stepper$().state<2?15:16),y(7),S("items",o.storeService.expandProductItems()),y(7),S("closeOthers",!0),y(),S("collapsed",!1),y(9),S("collapsed",!0),y(9),S("collapsed",!0),y(9),S("collapsed",!0))},dependencies:[rs,ss,os,cs,as,ls,Un,Ai,Fn,R0,M0,B0,Ra,N0],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100%;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}"]});let t=e;return t})();function oD(t,e){t&1&&X(0,"choose-product")}function sD(t,e){t&1&&X(0,"app-customize-label")}function aD(t,e){t&1&&X(0,"app-print-preview")}var H0=(()=>{let e=class e{constructor(){this.storeService=I(ce),this.httpService=I(ai),this.destroyRef=I(Ae),this.options=this.storeService.options()}ngOnInit(){this.storeService.onReset()}ngAfterViewInit(){let i=localStorage.getItem("Domain"),r=`https://${i}`;ur([this.httpService.post("api/Config/PaperConfig",{SubDomain:i},void 0),this.httpService.get("/API/V3/Tax",void 0,r)]).pipe(qe(this.destroyRef),ni(([o,s])=>({paperConfig:o,taxs:s})),re(({paperConfig:o,taxs:s})=>{this.storeService.onChangePaperConfig(E(b({},o),{PaperFormats:o.PaperFormats.map(a=>E(b({},a),{OutletID:null}))})),this.storeService.onChangeTaxs(s),this.storeService.onChangePaperConfiguration(this.storeService.paperConfig().PaperFormats[0])})).subscribe()}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=ee({type:e,selectors:[["app-dashboard"]],standalone:!0,features:[ie],decls:3,vars:1,template:function(r,o){if(r&1&&K(0,oD,1,0,"choose-product")(1,sD,1,0,"app-customize-label")(2,aD,1,0,"app-print-preview"),r&2){let s;oe((s=o.storeService.stepper$().state)===0?0:s===1?1:s===2?2:-1)}},dependencies:[Un,P0,F0,L0]});let t=e;return t})();var xz=[{path:"",children:[{path:"",component:H0}]}];export{xz as dashboardRoutes};
|