nexabase-report 0.1.2 → 0.1.4
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/README.md +18 -13
- package/dist/{html2canvas-Bt7A8WrM.js → html2canvas-D50ZZ6bl.js} +1 -1
- package/dist/{html2canvas-ChtVTMFS.js → html2canvas-i0L2rKdt.js} +2 -2
- package/dist/{html2pdf-DsfBPN4L.js → html2pdf-D668c5FJ.js} +3 -3
- package/dist/{index-D3l3xYdG.js → index-dmi6__Nc.js} +43 -17
- package/dist/{index.es-CmGmMwAx.js → index.es-DrkNTh0H.js} +2 -2
- package/dist/{jspdf.es.min-M0h3R1kR.js → jspdf.es.min-N6hWbNim.js} +2 -2
- package/dist/nexabase-report.es.js +1 -1
- package/dist/nexabase-report.umd.js +2 -2
- package/docs/VIEWER_API.md +46 -37
- package/package.json +1 -1
|
@@ -181,7 +181,7 @@ echarts.use([`+C+"]);":"Unknown series "+b))}return}if(u==="tooltip"){if(E){proc
|
|
|
181
181
|
`)),Jn(n));var B=h?Xz(h):null;h&&!B&&(process.env.NODE_ENV!=="production"&&(n=SA("Invalid parser name "+h+`.
|
|
182
182
|
`,"Illegal config:",c,`.
|
|
183
183
|
`)),Jn(n)),a.push({dimIdx:p.index,parser:B,comparator:new qz(f,g)})});var o=e.sourceFormat;o!==Qo&&o!==ks&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),Jn(n));for(var A=[],s=0,l=e.count();s<l;s++)A.push(e.getRawDataItem(s));return A.sort(function(c,u){for(var f=0;f<a.length;f++){var h=a[f],g=e.retrieveValueFromItem(c,h.dimIdx),d=e.retrieveValueFromItem(u,h.dimIdx);h.parser&&(g=h.parser(g),d=h.parser(d));var v=h.comparator.evaluate(g,d);if(v!==0)return v}return 0}),{data:A}}};function Kke(r){r.registerTransform(Vke),r.registerTransform(Jke)}var Wke=function(r){at(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataset",t}return e.prototype.init=function(t,n,i){r.prototype.init.call(this,t,n,i),this._sourceManager=new iH(this),aH(this)},e.prototype.mergeOption=function(t,n){r.prototype.mergeOption.call(this,t,n),aH(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:rl},e}(on),Xke=function(r){at(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataset",t}return e.type="dataset",e}(ui);function Zke(r){r.registerComponentModel(Wke),r.registerComponentView(Xke)}var Ec=rc.CMD;function up(r,e){return Math.abs(r-e)<1e-5}function oT(r){var e=r.data,t=r.len(),n=[],i,a=0,o=0,A=0,s=0;function l(D,F){i&&i.length>2&&n.push(i),i=[D,F]}function c(D,F,H,X){up(D,H)&&up(F,X)||i.push(D,F,H,X,H,X)}function u(D,F,H,X,q,re){var ie=Math.abs(F-D),ge=Math.tan(ie/4)*4/3,he=F<D?-1:1,R=Math.cos(D),V=Math.sin(D),J=Math.cos(F),ee=Math.sin(F),ae=R*q+H,j=V*re+X,G=J*q+H,oe=ee*re+X,se=q*ge*he,ne=re*ge*he;i.push(ae-se*V,j+ne*R,G+se*ee,oe-ne*J,G,oe)}for(var f,h,g,d,v=0;v<t;){var p=e[v++],B=v===1;switch(B&&(a=e[v],o=e[v+1],A=a,s=o,(p===Ec.L||p===Ec.C||p===Ec.Q)&&(i=[A,s])),p){case Ec.M:a=A=e[v++],o=s=e[v++],l(A,s);break;case Ec.L:f=e[v++],h=e[v++],c(a,o,f,h),a=f,o=h;break;case Ec.C:i.push(e[v++],e[v++],e[v++],e[v++],a=e[v++],o=e[v++]);break;case Ec.Q:f=e[v++],h=e[v++],g=e[v++],d=e[v++],i.push(a+2/3*(f-a),o+2/3*(h-o),g+2/3*(f-g),d+2/3*(h-d),g,d),a=g,o=d;break;case Ec.A:var E=e[v++],m=e[v++],y=e[v++],w=e[v++],I=e[v++],Q=e[v++]+I;v+=1;var x=!e[v++];f=Math.cos(I)*y+E,h=Math.sin(I)*w+m,B?(A=f,s=h,l(A,s)):c(a,o,f,h),a=Math.cos(Q)*y+E,o=Math.sin(Q)*w+m;for(var U=(x?-1:1)*Math.PI/2,b=I;x?b>Q:b<Q;b+=U){var C=x?Math.max(b+U,Q):Math.min(b+U,Q);u(b,C,E,m,y,w)}break;case Ec.R:A=a=e[v++],s=o=e[v++],f=A+e[v++],h=s+e[v++],l(f,s),c(f,s,f,h),c(f,h,A,h),c(A,h,A,s),c(A,s,f,s);break;case Ec.Z:i&&c(a,o,A,s),a=A,o=s;break}}return i&&i.length>2&&n.push(i),n}function AT(r,e,t,n,i,a,o,A,s,l){if(up(r,t)&&up(e,n)&&up(i,o)&&up(a,A)){s.push(o,A);return}var c=2/l,u=c*c,f=o-r,h=A-e,g=Math.sqrt(f*f+h*h);f/=g,h/=g;var d=t-r,v=n-e,p=i-o,B=a-A,E=d*d+v*v,m=p*p+B*B;if(E<u&&m<u){s.push(o,A);return}var y=f*d+h*v,w=-f*p-h*B,I=E-y*y,Q=m-w*w;if(I<u&&y>=0&&Q<u&&w>=0){s.push(o,A);return}var x=[],U=[];E2(r,t,i,o,.5,x),E2(e,n,a,A,.5,U),AT(x[0],U[0],x[1],U[1],x[2],U[2],x[3],U[3],s,l),AT(x[4],U[4],x[5],U[5],x[6],U[6],x[7],U[7],s,l)}function qke(r,e){var t=oT(r),n=[];e=e||1;for(var i=0;i<t.length;i++){var a=t[i],o=[],A=a[0],s=a[1];o.push(A,s);for(var l=2;l<a.length;){var c=a[l++],u=a[l++],f=a[l++],h=a[l++],g=a[l++],d=a[l++];AT(A,s,c,u,f,h,g,d,o,e),A=g,s=d}n.push(o)}return n}function gee(r,e,t){var n=r[e],i=r[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*t)),A=Math.floor(t/o);A===0&&(A=1,o=t);for(var s=[],l=0;l<o;l++)s.push(A);var c=o*A,u=t-c;if(u>0)for(var l=0;l<u;l++)s[l%o]+=1;return s}function dee(r,e,t){for(var n=r.r0,i=r.r,a=r.startAngle,o=r.endAngle,A=Math.abs(o-a),s=A*i,l=i-n,c=s>Math.abs(l),u=gee([s,l],c?0:1,e),f=(c?A:l)/u.length,h=0;h<u.length;h++)for(var g=(c?l:A)/u[h],d=0;d<u[h];d++){var v={};c?(v.startAngle=a+f*h,v.endAngle=a+f*(h+1),v.r0=n+g*d,v.r=n+g*(d+1)):(v.startAngle=a+g*d,v.endAngle=a+g*(d+1),v.r0=n+f*h,v.r=n+f*(h+1)),v.clockwise=r.clockwise,v.cx=r.cx,v.cy=r.cy,t.push(v)}}function $ke(r,e,t){for(var n=r.width,i=r.height,a=n>i,o=gee([n,i],a?0:1,e),A=a?"width":"height",s=a?"height":"width",l=a?"x":"y",c=a?"y":"x",u=r[A]/o.length,f=0;f<o.length;f++)for(var h=r[s]/o[f],g=0;g<o[f];g++){var d={};d[l]=f*u,d[c]=g*h,d[A]=u,d[s]=h,d.x+=r.x,d.y+=r.y,t.push(d)}}function pee(r,e,t,n){return r*n-t*e}function eYe(r,e,t,n,i,a,o,A){var s=t-r,l=n-e,c=o-i,u=A-a,f=pee(c,u,s,l);if(Math.abs(f)<1e-6)return null;var h=r-i,g=e-a,d=pee(h,g,c,u)/f;return d<0||d>1?null:new Tr(d*s+r,d*l+e)}function tYe(r,e,t){var n=new Tr;Tr.sub(n,t,e),n.normalize();var i=new Tr;Tr.sub(i,r,e);var a=i.dot(n);return a}function hp(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function rYe(r,e,t){for(var n=r.length,i=[],a=0;a<n;a++){var o=r[a],A=r[(a+1)%n],s=eYe(o[0],o[1],A[0],A[1],e.x,e.y,t.x,t.y);s&&i.push({projPt:tYe(s,e,t),pt:s,idx:a})}if(i.length<2)return[{points:r},{points:r}];i.sort(function(v,p){return v.projPt-p.projPt});var l=i[0],c=i[i.length-1];if(c.idx<l.idx){var u=l;l=c,c=u}for(var f=[l.pt.x,l.pt.y],h=[c.pt.x,c.pt.y],g=[f],d=[h],a=l.idx+1;a<=c.idx;a++)hp(g,r[a].slice());hp(g,h),hp(g,f);for(var a=c.idx+1;a<=l.idx+n;a++)hp(d,r[a%n].slice());return hp(d,f),hp(d,h),[{points:g},{points:d}]}function vee(r){var e=r.points,t=[],n=[];um(e,t,n);var i=new Rr(t[0],t[1],n[0]-t[0],n[1]-t[1]),a=i.width,o=i.height,A=i.x,s=i.y,l=new Tr,c=new Tr;return a>o?(l.x=c.x=A+a/2,l.y=s,c.y=s+o):(l.y=c.y=s+o/2,l.x=A,c.x=A+a),rYe(e,l,c)}function Ww(r,e,t,n){if(t===1)n.push(e);else{var i=Math.floor(t/2),a=r(e);Ww(r,a[0],i,n),Ww(r,a[1],t-i,n)}return n}function nYe(r,e){for(var t=[],n=0;n<e;n++)t.push(LM(r));return t}function iYe(r,e){e.setStyle(r.style),e.z=r.z,e.z2=r.z2,e.zlevel=r.zlevel}function aYe(r){for(var e=[],t=0;t<r.length;)e.push([r[t++],r[t++]]);return e}function oYe(r,e){var t=[],n=r.shape,i;switch(r.type){case"rect":$ke(n,e,t),i=an;break;case"sector":dee(n,e,t),i=Lo;break;case"circle":dee({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,t),i=Lo;break;default:var a=r.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,A=It(qke(r.getUpdatedPathProxy(),o),function(p){return aYe(p)}),s=A.length;if(s===0)Ww(vee,{points:A[0]},e,t);else if(s===e)for(var l=0;l<s;l++)t.push({points:A[l]});else{var c=0,u=It(A,function(p){var B=[],E=[];um(p,B,E);var m=(E[1]-B[1])*(E[0]-B[0]);return c+=m,{poly:p,area:m}});u.sort(function(p,B){return B.area-p.area});for(var f=e,l=0;l<s;l++){var h=u[l];if(f<=0)break;var g=l===s-1?f:Math.ceil(h.area/c*e);g<0||(Ww(vee,{points:h.poly},g,t),f-=g)}}i=Go;break}if(!i)return nYe(r,e);for(var d=[],l=0;l<t.length;l++){var v=new i;v.setShape(t[l]),iYe(r,v),d.push(v)}return d}function AYe(r,e){var t=r.length,n=e.length;if(t===n)return[r,e];for(var i=[],a=[],o=t<n?r:e,A=Math.min(t,n),s=Math.abs(n-t)/6,l=(A-2)/6,c=Math.ceil(s/l)+1,u=[o[0],o[1]],f=s,h=2;h<A;){var g=o[h-2],d=o[h-1],v=o[h++],p=o[h++],B=o[h++],E=o[h++],m=o[h++],y=o[h++];if(f<=0){u.push(v,p,B,E,m,y);continue}for(var w=Math.min(f,c-1)+1,I=1;I<=w;I++){var Q=I/w;E2(g,v,B,m,Q,i),E2(d,p,E,y,Q,a),g=i[3],d=a[3],u.push(i[1],a[1],i[2],a[2],g,d),v=i[5],p=a[5],B=i[6],E=a[6]}f-=w-1}return o===r?[u,e]:[r,u]}function Bee(r,e){for(var t=r.length,n=r[t-2],i=r[t-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function sYe(r,e){for(var t,n,i,a=[],o=[],A=0;A<Math.max(r.length,e.length);A++){var s=r[A],l=e[A],c=void 0,u=void 0;s?l?(t=AYe(s,l),c=t[0],u=t[1],n=c,i=u):(u=Bee(i||s,s),c=s):(c=Bee(n||l,l),u=l),a.push(c),o.push(u)}return[a,o]}function Eee(r){for(var e=0,t=0,n=0,i=r.length,a=0,o=i-2;a<i;o=a,a+=2){var A=r[o],s=r[o+1],l=r[a],c=r[a+1],u=A*c-l*s;e+=u,t+=(A+l)*u,n+=(s+c)*u}return e===0?[r[0]||0,r[1]||0]:[t/e/3,n/e/3,e]}function lYe(r,e,t,n){for(var i=(r.length-2)/6,a=1/0,o=0,A=r.length,s=A-2,l=0;l<i;l++){for(var c=l*6,u=0,f=0;f<A;f+=2){var h=f===0?c:(c+f-2)%s+2,g=r[h]-t[0],d=r[h+1]-t[1],v=e[f]-n[0],p=e[f+1]-n[1],B=v-g,E=p-d;u+=B*B+E*E}u<a&&(a=u,o=l)}return o}function cYe(r){for(var e=[],t=r.length,n=0;n<t;n+=2)e[n]=r[t-n-2],e[n+1]=r[t-n-1];return e}function uYe(r,e,t,n){for(var i=[],a,o=0;o<r.length;o++){var A=r[o],s=e[o],l=Eee(A),c=Eee(s);a==null&&(a=l[2]<0!=c[2]<0);var u=[],f=[],h=0,g=1/0,d=[],v=A.length;a&&(A=cYe(A));for(var p=lYe(A,s,l,c)*6,B=v-2,E=0;E<B;E+=2){var m=(p+E)%B+2;u[E+2]=A[m]-l[0],u[E+3]=A[m+1]-l[1]}u[0]=A[p]-l[0],u[1]=A[p+1]-l[1];for(var y=n/t,w=-n/2;w<=n/2;w+=y){for(var I=Math.sin(w),Q=Math.cos(w),x=0,E=0;E<A.length;E+=2){var U=u[E],b=u[E+1],C=s[E]-c[0],D=s[E+1]-c[1],F=C*Q-D*I,H=C*I+D*Q;d[E]=F,d[E+1]=H;var X=F-U,q=H-b;x+=X*X+q*q}if(x<g){g=x,h=w;for(var re=0;re<d.length;re++)f[re]=d[re]}}i.push({from:u,to:f,fromCp:l,toCp:c,rotation:-h})}return i}function Xw(r){return r.__isCombineMorphing}var mee="__mOriginal_";function Zw(r,e,t){var n=mee+e,i=r[n]||r[e];r[n]||(r[n]=r[e]);var a=t.replace,o=t.after,A=t.before;r[e]=function(){var s=arguments,l;return A&&A.apply(this,s),a?l=a.apply(this,s):l=i.apply(this,s),o&&o.apply(this,s),l}}function hE(r,e){var t=mee+e;r[t]&&(r[e]=r[t],r[t]=null)}function yee(r,e){for(var t=0;t<r.length;t++)for(var n=r[t],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function wee(r,e){var t=r.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=sYe(oT(t),oT(n)),a=i[0],o=i[1],A=r.getComputedTransform(),s=e.getComputedTransform();function l(){this.transform=null}A&&yee(a,A),s&&yee(o,s),Zw(e,"updateTransform",{replace:l}),e.transform=null;var c=uYe(a,o,10,Math.PI),u=[];Zw(e,"buildPath",{replace:function(f){for(var h=e.__morphT,g=1-h,d=[],v=0;v<c.length;v++){var p=c[v],B=p.from,E=p.to,m=p.rotation*h,y=p.fromCp,w=p.toCp,I=Math.sin(m),Q=Math.cos(m);d4(d,y,w,h);for(var x=0;x<B.length;x+=2){var U=B[x],b=B[x+1],C=E[x],D=E[x+1],F=U*g+C*h,H=b*g+D*h;u[x]=F*Q-H*I+d[0],u[x+1]=F*I+H*Q+d[1]}var X=u[0],q=u[1];f.moveTo(X,q);for(var x=2;x<B.length;){var C=u[x++],D=u[x++],re=u[x++],ie=u[x++],ge=u[x++],he=u[x++];X===C&&q===D&&re===ge&&ie===he?f.lineTo(ge,he):f.bezierCurveTo(C,D,re,ie,ge,he),X=ge,q=he}}}})}function sT(r,e,t){if(!r||!e)return e;var n=t.done,i=t.during;wee(r,e),e.__morphT=0;function a(){hE(e,"buildPath"),hE(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},Sr({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},t)),e}function hYe(r,e,t,n,i,a){var o=16;r=i===t?0:Math.round(32767*(r-t)/(i-t)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var A=0,s,l=(1<<o)/2;l>0;l/=2){var c=0,u=0;(r&l)>0&&(c=1),(e&l)>0&&(u=1),A+=l*l*(3*c^u),u===0&&(c===1&&(r=l-1-r,e=l-1-e),s=r,r=e,e=s)}return A}function qw(r){var e=1/0,t=1/0,n=-1/0,i=-1/0,a=It(r,function(A){var s=A.getBoundingRect(),l=A.getComputedTransform(),c=s.x+s.width/2+(l?l[4]:0),u=s.y+s.height/2+(l?l[5]:0);return e=Math.min(c,e),t=Math.min(u,t),n=Math.max(c,n),i=Math.max(u,i),[c,u]}),o=It(a,function(A,s){return{cp:A,z:hYe(A[0],A[1],e,t,n,i),path:r[s]}});return o.sort(function(A,s){return A.z-s.z}).map(function(A){return A.path})}function Iee(r){return oYe(r.path,r.count)}function lT(){return{fromIndividuals:[],toIndividuals:[],count:0}}function fYe(r,e,t){var n=[];function i(y){for(var w=0;w<y.length;w++){var I=y[w];Xw(I)?i(I.childrenRef()):I instanceof pn&&n.push(I)}}i(r);var a=n.length;if(!a)return lT();var o=t.dividePath||Iee,A=o({path:e,count:a});if(A.length!==a)return console.error("Invalid morphing: unmatched splitted path"),lT();n=qw(n),A=qw(A);for(var s=t.done,l=t.during,c=t.individualDelay,u=new lu,f=0;f<a;f++){var h=n[f],g=A[f];g.parent=e,g.copyTransform(u),c||wee(h,g)}e.__isCombineMorphing=!0,e.childrenRef=function(){return A};function d(y){for(var w=0;w<A.length;w++)A[w].addSelfToZr(y)}Zw(e,"addSelfToZr",{after:function(y){d(y)}}),Zw(e,"removeSelfFromZr",{after:function(y){for(var w=0;w<A.length;w++)A[w].removeSelfFromZr(y)}});function v(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,hE(e,"addSelfToZr"),hE(e,"removeSelfFromZr")}var p=A.length;if(c)for(var B=p,E=function(){B--,B===0&&(v(),s&&s())},f=0;f<p;f++){var m=c?Sr({delay:(t.delay||0)+c(f,p,n[f],A[f]),done:E},t):t;sT(n[f],A[f],m)}else e.__morphT=0,e.animateTo({__morphT:1},Sr({during:function(y){for(var w=0;w<p;w++){var I=A[w];I.__morphT=e.__morphT,I.dirtyShape()}l&&l(y)},done:function(){v();for(var y=0;y<r.length;y++)hE(r[y],"updateTransform");s&&s()}},t));return e.__zr&&d(e.__zr),{fromIndividuals:n,toIndividuals:A,count:p}}function gYe(r,e,t){var n=e.length,i=[],a=t.dividePath||Iee;function o(h){for(var g=0;g<h.length;g++){var d=h[g];Xw(d)?o(d.childrenRef()):d instanceof pn&&i.push(d)}}if(Xw(r)){o(r.childrenRef());var A=i.length;if(A<n)for(var s=0,l=A;l<n;l++)i.push(LM(i[s++%A]));i.length=n}else{i=a({path:r,count:n});for(var c=r.getComputedTransform(),l=0;l<i.length;l++)i[l].setLocalTransform(c);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),lT()}i=qw(i),e=qw(e);for(var u=t.individualDelay,l=0;l<n;l++){var f=u?Sr({delay:(t.delay||0)+u(l,n,i[l],e[l])},t):t;sT(i[l],e[l],f)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function xee(r){return wt(r[0])}function Mee(r,e){for(var t=[],n=r.length,i=0;i<n;i++)t.push({one:r[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)t[o%n].many.push(e[i][o])}for(var A=0,i=n-1;i>=0;i--)if(!t[i].many.length){var s=t[A].many;if(s.length<=1)if(A)A=0;else return t;var a=s.length,l=Math.ceil(a/2);t[i].many=s.slice(l,a),t[A].many=s.slice(0,l),A++}return t}var dYe={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),n=0;n<r.count;n++){var i=LM(r.path);i.setStyle("opacity",t),e.push(i)}return e},split:null};function cT(r,e,t,n,i,a){if(!r.length||!e.length)return;var o=ud("update",n,i);if(!(o&&o.duration>0))return;var A=n.getModel("universalTransition").get("delay"),s=Object.assign({setToFinal:!0},o),l,c;xee(r)&&(l=r,c=e),xee(e)&&(l=e,c=r);function u(p,B,E,m,y){var w=p.many,I=p.one;if(w.length===1&&!y){var Q=B?w[0]:I,x=B?I:w[0];if(Xw(Q))u({many:[Q],one:x},!0,E,m,!0);else{var U=A?Sr({delay:A(E,m)},s):s;sT(Q,x,U),a(Q,x,Q,x,U)}}else for(var b=Sr({dividePath:dYe[t],individualDelay:A&&function(q,re,ie,ge){return A(q+E,m)}},s),C=B?fYe(w,I,b):gYe(I,w,b),D=C.fromIndividuals,F=C.toIndividuals,H=D.length,X=0;X<H;X++){var U=A?Sr({delay:A(X,H)},s):s;a(D[X],F[X],B?w[X]:p.one,B?p.one:w[X],U)}}for(var f=l?l===r:r.length>e.length,h=l?Mee(c,l):Mee(f?e:r,[f?r:e]),g=0,d=0;d<h.length;d++)g+=h[d].many.length;for(var v=0,d=0;d<h.length;d++)u(h[d],f,v,g),v+=h[d].many.length}function B1(r){if(!r)return[];if(wt(r)){for(var e=[],t=0;t<r.length;t++)e.push(B1(r[t]));return e}var n=[];return r.traverse(function(i){i instanceof pn&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var Qee=1e4,pYe=0,Cee=1,See=2,vYe=hn();function BYe(r,e){for(var t=r.dimensions,n=0;n<t.length;n++){var i=r.getDimensionInfo(t[n]);if(i&&i.otherDims[e]===0)return t[n]}}function EYe(r,e,t){var n=r.getDimensionInfo(t),i=n&&n.ordinalMeta;if(n){var a=r.get(n.name,e);return i&&i.categories[a]||a+""}}function Fee(r,e,t,n){var i=n?"itemChildGroupId":"itemGroupId",a=BYe(r,i);if(a){var o=EYe(r,e,a);return o}var A=r.getRawDataItem(e),s=n?"childGroupId":"groupId";if(A&&A[s])return A[s]+"";if(!n)return t||r.getId(e)}function Tee(r){var e=[];return ce(r,function(t){var n=t.data,i=t.dataGroupId;if(n.count()>Qee){process.env.NODE_ENV!=="production"&&Li("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:Fee(n,o,i,!1),childGroupId:Fee(n,o,i,!0),divide:t.divide,dataIndex:o})}),e}function uT(r,e,t){r.traverse(function(n){n instanceof pn&&Ii(n,{style:{opacity:0}},e,{dataIndex:t,isFrom:!0})})}function hT(r){if(r.parent){var e=r.getComputedTransform();r.setLocalTransform(e),r.parent.remove(r)}}function fp(r){r.stopAnimation(),r.isGroup&&r.traverse(function(e){e.stopAnimation()})}function mYe(r,e,t){var n=ud("update",t,e);n&&r.traverse(function(i){if(i instanceof u0){var a=Uwe(i);a&&i.animateFrom({style:a},n)}})}function yYe(r,e){var t=r.length;if(t!==e.length)return!1;for(var n=0;n<t;n++){var i=r[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function Ree(r,e,t){var n=Tee(r),i=Tee(e);function a(E,m,y,w,I){(y||E)&&m.animateFrom({style:y&&y!==E?Et(Et({},y.style),E.style):E.style},I)}var o=!1,A=pYe,s=ur(),l=ur();n.forEach(function(E){E.groupId&&s.set(E.groupId,!0),E.childGroupId&&l.set(E.childGroupId,!0)});for(var c=0;c<i.length;c++){var u=i[c].groupId;if(l.get(u)){A=Cee;break}var f=i[c].childGroupId;if(f&&s.get(f)){A=See;break}}function h(E,m){return function(y){var w=y.data,I=y.dataIndex;return m?w.getId(I):E?A===Cee?y.childGroupId:y.groupId:A===See?y.childGroupId:y.groupId}}var g=yYe(n,i),d={};if(!g)for(var c=0;c<i.length;c++){var v=i[c],p=v.data.getItemGraphicEl(v.dataIndex);p&&(d[p.id]=!0)}function B(E,m){var y=n[m],w=i[E],I=w.data.hostModel,Q=y.data.getItemGraphicEl(y.dataIndex),x=w.data.getItemGraphicEl(w.dataIndex);if(Q===x){x&&mYe(x,w.dataIndex,I);return}Q&&d[Q.id]||x&&(fp(x),Q?(fp(Q),hT(Q),o=!0,cT(B1(Q),B1(x),w.divide,I,E,a)):uT(x,I,E))}new mu(n,i,h(!0,g),h(!1,g),null,"multiple").update(B).updateManyToOne(function(E,m){var y=i[E],w=y.data,I=w.hostModel,Q=w.getItemGraphicEl(y.dataIndex),x=zn(It(m,function(U){return n[U].data.getItemGraphicEl(n[U].dataIndex)}),function(U){return U&&U!==Q&&!d[U.id]});Q&&(fp(Q),x.length?(ce(x,function(U){fp(U),hT(U)}),o=!0,cT(B1(x),B1(Q),y.divide,I,E,a)):uT(Q,I,y.dataIndex))}).updateOneToMany(function(E,m){var y=n[m],w=y.data.getItemGraphicEl(y.dataIndex);if(!(w&&d[w.id])){var I=zn(It(E,function(x){return i[x].data.getItemGraphicEl(i[x].dataIndex)}),function(x){return x&&x!==w}),Q=i[E[0]].data.hostModel;I.length&&(ce(I,function(x){return fp(x)}),w?(fp(w),hT(w),o=!0,cT(B1(w),B1(I),y.divide,Q,E[0],a)):ce(I,function(x){return uT(x,Q,E[0])}))}}).updateManyToMany(function(E,m){new mu(m,E,function(y){return n[y].data.getId(n[y].dataIndex)},function(y){return i[y].data.getId(i[y].dataIndex)}).update(function(y,w){B(E[y],m[w])}).execute()}).execute(),o&&ce(e,function(E){var m=E.data,y=m.hostModel,w=y&&t.getViewOfSeriesModel(y),I=ud("update",y,0);w&&y.isAnimationEnabled()&&I&&I.duration>0&&w.group.traverse(function(Q){Q instanceof pn&&!Q.animators.length&&Q.animateFrom({style:{opacity:0}},I)})})}function bee(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function Dee(r){return wt(r)?r.sort().join(","):r}function Z2(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function wYe(r,e){var t=ur(),n=ur(),i=ur();ce(r.oldSeries,function(o,A){var s=r.oldDataGroupIds[A],l=r.oldData[A],c=bee(o),u=Dee(c);n.set(u,{dataGroupId:s,data:l}),wt(c)&&ce(c,function(f){i.set(f,{key:u,dataGroupId:s,data:l})})});function a(o){t.get(o)&&Li("Duplicated seriesKey in universalTransition "+o)}return ce(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var A=o.get("dataGroupId"),s=o.getData(),l=bee(o),c=Dee(l),u=n.get(c);if(u)process.env.NODE_ENV!=="production"&&a(c),t.set(c,{oldSeries:[{dataGroupId:u.dataGroupId,divide:Z2(u.data),data:u.data}],newSeries:[{dataGroupId:A,divide:Z2(s),data:s}]});else if(wt(l)){process.env.NODE_ENV!=="production"&&a(c);var f=[];ce(l,function(d){var v=n.get(d);v.data&&f.push({dataGroupId:v.dataGroupId,divide:Z2(v.data),data:v.data})}),f.length&&t.set(c,{oldSeries:f,newSeries:[{dataGroupId:A,data:s,divide:Z2(s)}]})}else{var h=i.get(l);if(h){var g=t.get(h.key);g||(g={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Z2(h.data)}],newSeries:[]},t.set(h.key,g)),g.newSeries.push({dataGroupId:A,data:s,divide:Z2(s)})}}}}),t}function Nee(r,e){for(var t=0;t<r.length;t++){var n=e.seriesIndex!=null&&e.seriesIndex===r[t].seriesIndex||e.seriesId!=null&&e.seriesId===r[t].id;if(n)return t}}function IYe(r,e,t,n){var i=[],a=[];ce(li(r.from),function(o){var A=Nee(e.oldSeries,o);A>=0&&i.push({dataGroupId:e.oldDataGroupIds[A],data:e.oldData[A],divide:Z2(e.oldData[A]),groupIdDim:o.dimension})}),ce(li(r.to),function(o){var A=Nee(t.updatedSeries,o);if(A>=0){var s=t.updatedSeries[A].getData();a.push({dataGroupId:e.oldDataGroupIds[A],data:s,divide:Z2(s),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&Ree(i,a,n)}function xYe(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,n){ce(li(n.seriesTransition),function(i){ce(li(i.to),function(a){for(var o=n.updatedSeries,A=0;A<o.length;A++)(a.seriesIndex!=null&&a.seriesIndex===o[A].seriesIndex||a.seriesId!=null&&a.seriesId===o[A].id)&&(o[A][Xm]=!0)})})}),r.registerUpdateLifecycle("series:transition",function(e,t,n){var i=vYe(t);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)ce(li(a),function(h){IYe(h,i,n,t)});else{var o=wYe(i,n);ce(o.keys(),function(h){var g=o.get(h);Ree(g.oldSeries,g.newSeries,t)})}ce(n.updatedSeries,function(h){h[Xm]&&(h[Xm]=!1)})}for(var A=e.getSeries(),s=i.oldSeries=[],l=i.oldDataGroupIds=[],c=i.oldData=[],u=0;u<A.length;u++){var f=A[u].getData();f.count()<Qee&&(s.push(A[u]),l.push(A[u].get("dataGroupId")),c.push(f))}})}var MYe=function(){function r(){this.breaks=[],this._elapsedExtent=[1/0,-1/0]}return r.prototype.setBreaks=function(e){this.breaks=e.breaks},r.prototype.update=function(e){CYe(this,e);var t=this._elapsedExtent;t[0]=this.elapse(e[0]),t[1]=this.elapse(e[1])},r.prototype.hasBreaks=function(){return!!this.breaks.length},r.prototype.calcNiceTickMultiple=function(e,t){for(var n=0;n<this.breaks.length;n++){var i=this.breaks[n];if(i.vmin<e&&e<i.vmax){var a=t(e,i.vmax);return process.env.NODE_ENV!=="production"&&or(a>=0&&Math.round(a)===a),a}}return 0},r.prototype.getExtentSpan=function(){return this._elapsedExtent[1]-this._elapsedExtent[0]},r.prototype.normalize=function(e){var t=this._elapsedExtent[1]-this._elapsedExtent[0];return t===0?.5:(this.elapse(e)-this._elapsedExtent[0])/t},r.prototype.scale=function(e){return this.unelapse(e*(this._elapsedExtent[1]-this._elapsedExtent[0])+this._elapsedExtent[0])},r.prototype.elapse=function(e){for(var t=Uee,n=_ee,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?t+=o.vmin-n+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:t+=e-n,n=o.vmax,i=!1;break}t+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(t+=e-n),t},r.prototype.unelapse=function(e){for(var t=Uee,n=_ee,i=!0,a=0,o=0;o<this.breaks.length;o++){var A=this.breaks[o],s=t+A.vmin-n,l=s+A.gapReal;if(e<=l){e>s?a=A.vmin+(e-s)/(l-s)*(A.vmax-A.vmin):a=n+e-t,n=A.vmax,i=!1;break}t=l,n=A.vmax}return i&&(a=n+e-t),a},r}();function QYe(){return new MYe}var Uee=0,_ee=0;function CYe(r,e){var t=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};ce(r.breaks,function(A){var s=A.gapParsed;s.type==="tpPrct"&&(t+=s.val);var l=fT(A,e);if(l){var c=l.vmin!==A.vmin,u=l.vmax!==A.vmax,f=l.vmax-l.vmin;if(!(c&&u))if(c||u){var h=c?"S":"E";a[h][s.type].has=!0,a[h][s.type].span=f,a[h][s.type].inExtFrac=f/(A.vmax-A.vmin),a[h][s.type].val=s.val}else n[s.type].span+=f,n[s.type].val+=s.val}});var o=t*(0+(e[1]-e[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));ce(r.breaks,function(A){var s=A.gapParsed;s.type==="tpPrct"&&(A.gapReal=t!==0?Math.max(o,0)*s.val/t:0),s.type==="tpAbs"&&(A.gapReal=s.val),A.gapReal==null&&(A.gapReal=0)})}function SYe(r,e,t,n,i,a){r!=="no"&&ce(t,function(o){var A=fT(o,a);if(A)for(var s=e.length-1;s>=0;s--){var l=e[s],c=n(l),u=i*3/4;c>A.vmin-u&&c<A.vmax+u&&(r!=="preserve_extent_bound"||c!==a[0]&&c!==a[1])&&e.splice(s,1)}})}function FYe(r,e,t,n){ce(e,function(i){var a=fT(i,t);a&&(r.push({value:a.vmin,break:{type:"vmin",parsedBreak:a},time:n?n(a):void 0}),r.push({value:a.vmax,break:{type:"vmax",parsedBreak:a},time:n?n(a):void 0}))}),e.length&&r.sort(function(i,a){return i.value-a.value})}function fT(r,e){var t=Math.max(r.vmin,e[0]),n=Math.min(r.vmax,e[1]);return t<n||t===n&&t>e[0]&&t<e[1]?{vmin:t,vmax:n,breakOption:r.breakOption,gapParsed:r.gapParsed,gapReal:r.gapReal}:null}function gT(r,e,t){var n=[];if(!r)return{breaks:n};function i(o,A){return o>=0&&o<1-1e-5?!0:(process.env.NODE_ENV!=="production"&&bn(A+" must be >= 0 and < 1, rather than "+o+" ."),!1)}ce(r,function(o){if(!o||o.start==null||o.end==null){process.env.NODE_ENV!=="production"&&bn("The input axis breaks start/end should not be empty.");return}if(!o.isExpanded){var A={breakOption:Ir(o),vmin:e(o.start),vmax:e(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var s=!1;if(Zt(o.gap)){var l=Cs(o.gap);if(l.match(/%$/)){var c=parseFloat(l)/100;i(c,"Percent gap")||(c=0),A.gapParsed.type="tpPrct",A.gapParsed.val=c,s=!0}}if(!s){var u=e(o.gap);(!isFinite(u)||u<0)&&(process.env.NODE_ENV!=="production"&&bn("Axis breaks gap must positive finite rather than ("+o.gap+")."),u=0),A.gapParsed.type="tpAbs",A.gapParsed.val=u}}if(A.vmin===A.vmax&&(A.gapParsed.type="tpAbs",A.gapParsed.val=0),t&&t.noNegative&&ce(["vmin","vmax"],function(h){A[h]<0&&(process.env.NODE_ENV!=="production"&&bn("Axis break."+h+" must not be negative."),A[h]=0)}),A.vmin>A.vmax){var f=A.vmax;A.vmax=A.vmin,A.vmin=f}n.push(A)}}),n.sort(function(o,A){return o.vmin-A.vmin});var a=-1/0;return ce(n,function(o,A){a>o.vmin&&(process.env.NODE_ENV!=="production"&&bn("Axis breaks must not overlap."),n[A]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function dT(r,e){return pT(e)===pT(r)}function pT(r){return r.start+"_\0_"+r.end}function TYe(r,e,t){var n=[];ce(r,function(a,o){var A=e(a);A&&A.type==="vmin"&&n.push([o])}),ce(r,function(a,o){var A=e(a);if(A&&A.type==="vmax"){var s=h2(n,function(l){return dT(e(r[l[0]]).parsedBreak.breakOption,A.parsedBreak.breakOption)});s&&s.push(o)}});var i=[];return ce(n,function(a){a.length===2&&i.push(t?a:[r[a[0]],r[a[1]]])}),i}function RYe(r,e,t,n){var i,a;if(r.break){var o=r.break.parsedBreak,A=h2(t,function(u){return dT(u.breakOption,r.break.parsedBreak.breakOption)}),s=n(Math.pow(e,o.vmin),A.vmin),l=n(Math.pow(e,o.vmax),A.vmax),c={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?Ba(Math.pow(e,o.vmin+o.gapParsed.val))-s:o.gapParsed.val};i={type:r.break.type,parsedBreak:{breakOption:o.breakOption,vmin:s,vmax:l,gapParsed:c,gapReal:o.gapReal}},a=A[r.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function bYe(r,e,t){var n={noNegative:!0},i=gT(r,t,n),a=gT(r,t,n),o=Math.log(e);return a.breaks=It(a.breaks,function(A){var s=Math.log(A.vmin)/o,l=Math.log(A.vmax)/o,c={type:A.gapParsed.type,val:A.gapParsed.type==="tpAbs"?Math.log(A.vmin+A.gapParsed.val)/o-s:A.gapParsed.val};return{vmin:s,vmax:l,gapParsed:c,gapReal:A.gapReal,breakOption:A.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var DYe={vmin:"start",vmax:"end"};function NYe(r,e){return e&&(r=r||{},r.break={type:DYe[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),r}function UYe(){t8e({createScaleBreakContext:QYe,pruneTicksByBreak:SYe,addBreaksToTicks:FYe,parseAxisBreakOption:gT,identifyAxisBreak:dT,serializeAxisBreakIdentifier:pT,retrieveAxisBreakPairs:TYe,getTicksLogTransformBreak:RYe,logarithmicParseBreaksFromOption:bYe,makeAxisLabelFormatterParamBreak:NYe})}var kee=hn();function _Ye(r,e){var t=h2(r,function(n){return Na().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return t||r.push(t={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),t}function kYe(r){ce(r,function(e){return e.shouldRemove=!0})}function YYe(r){for(var e=r.length-1;e>=0;e--)r[e].shouldRemove&&r.splice(e,1)}function PYe(r,e,t,n,i){var a=t.axis;if(a.scale.isBlank()||!Na())return;var o=Na().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(x){return x.break},!1);if(!o.length)return;var A=t.getModel("breakArea"),s=A.get("zigzagAmplitude"),l=A.get("zigzagMinSpan"),c=A.get("zigzagMaxSpan");l=Math.max(2,l||0),c=Math.max(l,c||0);var u=A.get("expandOnClick"),f=A.get("zigzagZ"),h=A.getModel("itemStyle"),g=h.getItemStyle(),d=g.stroke,v=g.lineWidth,p=g.lineDash,B=g.fill,E=new Mr({ignoreModelZ:!0}),m=a.isHorizontal(),y=kee(e).visualList||(kee(e).visualList=[]);kYe(y);for(var w=function(x){var U=o[x][0].break.parsedBreak,b=[];b[0]=a.toGlobalCoord(a.dataToCoord(U.vmin,!0)),b[1]=a.toGlobalCoord(a.dataToCoord(U.vmax,!0)),b[1]<b[0]&&b.reverse();var C=_Ye(y,U);C.shouldRemove=!1;var D=new Mr;Q(C.zigzagRandomList,D,b[0],b[1],m,U),u&&D.on("click",function(){var F={type:Hy,breaks:[{start:U.breakOption.start,end:U.breakOption.end}]};F[a.dim+"AxisIndex"]=t.componentIndex,i.dispatchAction(F)}),D.silent=!u,E.add(D)},I=0;I<o.length;I++)w(I);r.add(E),YYe(y);function Q(x,U,b,C,D,F){var H={stroke:d,lineWidth:v,lineDash:p,fill:"none"},X=D?0:1,q=1-X,re=n[Vr[q]]+n[Da[q]];function ie(Fe){var W=[],xe=[];W[X]=xe[X]=Fe,W[q]=n[Vr[q]],xe[q]=re;var z={x1:W[0],y1:W[1],x2:xe[0],y2:xe[1]};return gm(z,z,{lineWidth:1}),W[0]=z.x1,W[1]=z.y1,W[X]}b=ie(b),C=ie(C);for(var ge=[],he=[],R=!0,V=n[Vr[q]],J=0;;J++){var ee=V===n[Vr[q]],ae=V>=re;ae&&(V=re);var j=[],G=[];j[X]=b,G[X]=C,!ee&&!ae&&(j[X]+=R?-s:s,G[X]-=R?s:-s),j[q]=V,G[q]=V,ge.push(j),he.push(G);var oe=void 0;if(J<x.length?oe=x[J]:(oe=Math.random(),x.push(oe)),V+=oe*(c-l)+l,R=!R,ae)break}var se=Na().serializeAxisBreakIdentifier(F.breakOption);if(U.add(new xo({anid:"break_a_"+se,shape:{points:ge},style:H,z:f})),F.gapReal!==0){U.add(new xo({anid:"break_b_"+se,shape:{points:he},style:H,z:f}));var ne=he.slice();ne.reverse();var le=ge.concat(ne);U.add(new Go({anid:"break_c_"+se,shape:{points:le},style:{fill:B,opacity:g.opacity},z:f}))}}}function OYe(r,e,t,n){var i=r.axis,a=t.transform;or(n.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var A=Na().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:"only_break"}),function(v){return v.break},!1),s=It(A,function(v){var p=v[0].break.parsedBreak,B=[i.dataToCoord(p.vmin,!0),i.dataToCoord(p.vmax,!0)];return B[0]>B[1]&&B.reverse(),{coordPair:B,brkId:Na().serializeAxisBreakIdentifier(p.breakOption)}});s.sort(function(v,p){return v.coordPair[0]-p.coordPair[0]});for(var l=o[0],c=null,u=0;u<s.length;u++){var f=s[u],h=Math.max(f.coordPair[0],o[0]),g=Math.min(f.coordPair[1],o[1]);l<=h&&d(l,h,c,f),l=g,c=f}l<=o[1]&&d(l,o[1],c,null);function d(v,p,B,E){function m(b,C){a&&(oa(b,b,a),oa(C,C,a))}function y(b,C){var D={x1:b[0],y1:b[1],x2:C[0],y2:C[1]};gm(D,D,n.style),b[0]=D.x1,b[1]=D.y1,C[0]=D.x2,C[1]=D.y2}var w=[v,0],I=[p,0],Q=[v,5],x=[p,5];m(w,Q),y(w,Q),m(I,x),y(I,x),y(w,I);var U=new ma(Et({shape:{x1:w[0],y1:w[1],x2:I[0],y2:I[1]}},n));e.add(U),U.anid="breakLine_"+(B?B.brkId:"\0")+"_\0_"+(E?E.brkId:"\0")}}function LYe(r,e,t){if(h2(t,function(B){return!B}))return;var n=new Tr;if(!by(t[0],t[1],n,{direction:-(r?e+Math.PI:e),touchThreshold:0,bidirectional:!1}))return;var i=Ao();au(i,i,-e);var a=It(t,function(B){return B.transform?V0(Ao(),i,B.transform):i});function o(B){var E=t[0].localRect,m=new Tr(E[Da[B]]*a[0][0],E[Da[B]]*a[0][1]);return Math.abs(m.y)<1e-5}var A=.5;if(o(0)||o(1)){var s=It(t,function(B,E){var m=B.localRect.clone();return m.applyTransform(a[E]),m}),l=new Tr;l.copy(t[0].label).add(t[1].label).scale(.5),l.transform(i);var c=n.clone().transform(i),u=s[0].x+s[1].x+(c.x>=0?s[0].width:s[1].width),f=(u+c.x)/2-l.x,h=Math.min(f,f-c.x),g=Math.max(f,f-c.x),d=g<0?g:h>0?h:0;A=(f-d)/c.x}var v=new Tr,p=new Tr;Tr.scale(v,n,-A),Tr.scale(p,n,1-A),GQ(t[0],v),GQ(t[1],p)}function GYe(r,e){var t={breaks:[]};return ce(e.breaks,function(n){if(n){var i=h2(r.get("breaks",!0),function(A){return Na().identifyAxisBreak(A,n)});if(!i){process.env.NODE_ENV!=="production"&&Li("Can not find axis break by start: "+n.start+", end: "+n.end);return}var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===Hy?!0:a===JJ?!1:a===KJ?!i.isExpanded:i.isExpanded,t.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}),t}function zYe(){P7e({adjustBreakLabelPair:LYe,buildAxisBreakLine:OYe,rectCoordBuildBreakAxis:PYe,updateModelAxisBreak:GYe})}function HYe(r){j7e(r),UYe(),zYe()}function jYe(){hQe(VYe)}function VYe(r,e){ce(r,function(t){if(!t.model.get(["axisLabel","inside"])){var n=JYe(t);if(n){var i=t.isHorizontal()?"height":"width",a=t.model.get(["axisLabel","margin"]);e[i]-=n[i]+a,t.position==="top"?e.y+=n.height+a:t.position==="left"&&(e.x+=n.width+a)}}})}function JYe(r){var e=r.model,t=r.scale;if(!e.get(["axisLabel","show"])||t.isBlank())return;var n,i,a=t.getExtent();t instanceof Yd?i=t.count():(n=t.getTicks(),i=n.length);var o=r.getLabelModel(),A=Pd(r),s,l=1;i>40&&(l=Math.ceil(i/40));for(var c=0;c<i;c+=l){var u=n?n[c]:{value:a[0]+c},f=A(u,c),h=o.getTextRect(f),g=d(h,o.get("rotate")||0);s?s.union(g):s=g}return s;function d(v,p){var B=p*Math.PI/180,E=v.width,m=v.height,y=E*Math.abs(Math.cos(B))+Math.abs(m*Math.sin(B)),w=E*Math.abs(Math.sin(B))+Math.abs(m*Math.cos(B)),I=new Rr(v.x,v.y,y,w);return I}}tn([kMe]),tn([bMe]),tn([n7e,B7e,S7e,RQe,GQe,RCe,iSe,LSe,sFe,dFe,yFe,FFe,wTe,VTe,nRe,ERe,IRe,DRe,ORe,ZRe,nbe,fbe,Xbe]),tn(dDe),tn(ODe),tn(rW),tn(qDe),tn(CX),tn(rNe),tn(wNe),tn(RNe),tn(vUe),tn(_Ue),tn(tE),tn(qUe),tn(t_e),tn(u_e),tn(E_e),tn(M_e),tn(R_e),tn(L_e),tn(oke),tn(L$),tn(z$),tn(Qke),tn(aee),tn(Aee),tn(Tke),tn(Uke),tn(Kke),tn(Zke),tn(xYe),tn(qxe),tn(HYe),tn(jYe),tn(bQe);const KYe=Object.freeze(Object.defineProperty({__proto__:null,Axis:E0,ChartView:Xn,ComponentModel:on,ComponentView:ui,List:sA,Model:vn,PRIORITY:aj,SeriesModel:ri,color:K3e,connect:e9e,dataTool:s9e,dependencies:kIe,disConnect:t9e,disconnect:mj,dispose:r9e,env:En,extendChartView:kxe,extendComponentModel:Nxe,extendComponentView:Uxe,extendSeriesModel:_xe,format:Exe,getCoordinateSystemDimensions:i9e,getInstanceByDom:gQ,getInstanceById:n9e,getMap:A9e,graphic:Bxe,helper:cxe,init:fQ,innerDrawElementOnCanvas:q7,matrix:I3e,number:pxe,parseGeoJSON:_Q,parseGeoJson:_Q,registerAction:il,registerCoordinateSystem:Ij,registerCustomSeries:a9e,registerLayout:xj,registerLoading:EQ,registerLocale:o7,registerMap:Qj,registerPostInit:yj,registerPostUpdate:wj,registerPreprocessor:pQ,registerProcessor:vQ,registerTheme:dQ,registerTransform:Cj,registerUpdateLifecycle:py,registerVisual:U2,setCanvasCreator:o9e,setPlatformAPI:zP,throttle:qm,time:vxe,use:tn,util:mxe,vector:s3e,version:_Ie,zrUtil:t3e,zrender:Tme},Symbol.toStringTag,{value:"Module"})),WYe=L.defineComponent({__name:"ChartRenderer",props:{config:{type:Object},data:{type:Array}},setup(r,{expose:e}){const t=r,n=L.ref(null);let i=null;const a=L.computed(()=>{const A=t.config,s=t.data||[],l=s.map(f=>f[A.categoryField]??""),c=A.valueFields.map((f,h)=>{var v;const g=((v=A.colorPalette)==null?void 0:v[h%A.colorPalette.length])||void 0,d={name:f.label,type:A.chartType==="doughnut"?"pie":A.chartType==="area"?"line":A.chartType,data:s.map(p=>Number(p[f.binding])||0)};return g&&(d.itemStyle={color:g}),A.chartType==="area"&&(d.areaStyle={opacity:.3}),(A.chartType==="doughnut"||A.chartType==="pie")&&(d.data=s.map((p,B)=>{var E;return{name:l[B],value:Number(p[f.binding])||0,itemStyle:{color:(E=A.colorPalette)==null?void 0:E[B%A.colorPalette.length]}}}),d.radius=A.chartType==="doughnut"?[A.donutInnerRadius||"40%","70%"]:"70%"),A.chartType==="bar"&&(d.barMaxWidth=60),A.smoothLine&&(A.chartType==="line"||A.chartType==="area")&&(d.smooth=!0),d}),u={title:{text:A.title||"",left:"center",textStyle:{fontSize:14}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:A.showLegend?{show:!0,orient:A.legendPosition==="left"||A.legendPosition==="right"?"vertical":"horizontal",[A.legendPosition]:10}:{show:!1},grid:{left:40,right:20,top:A.title?60:30,bottom:30}};return A.chartType==="pie"||A.chartType==="doughnut"?u.series=c:(u.xAxis={type:"category",data:l,axisLabel:{interval:0,rotate:l.length>10?30:0}},u.yAxis={type:"value",splitLine:{show:A.showGrid!==!1}},u.series=c,A.stacked&&u.series.forEach(f=>f.stack="total")),u});function o(){n.value&&(i&&i.dispose(),i=fQ(n.value),i.setOption(a.value))}return L.onMounted(()=>{o(),window.addEventListener("resize",()=>i==null?void 0:i.resize())}),L.watch(a,()=>i==null?void 0:i.setOption(a.value),{deep:!0}),e({resize:()=>i==null?void 0:i.resize()}),(A,s)=>(L.openBlock(),L.createElementBlock("div",{ref_key:"chartContainerRef",ref:n,class:"nexa-chart"},null,512))}}),XYe=".nexa-chart[data-v-c3983e68]{width:100%;height:100%}",$w=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t},ZYe=$w(WYe,[["styles",[XYe]],["__scopeId","data-v-c3983e68"]]),qYe={class:"nexa-crosstab"},$Ye={class:"crosstab-cell-value"},ePe={key:0,class:"crosstab-totals-row"},tPe={class:"crosstab-cell-value"},rPe=$w(L.defineComponent({__name:"CrosstabRenderer",props:{config:{type:Object},data:{type:Array}},setup(r){const e=r;function t(i,a){if(i.length===0)return 0;switch(a){case"sum":return i.reduce((o,A)=>o+A,0);case"count":return i.length;case"avg":return i.reduce((o,A)=>o+A,0)/i.length;case"min":return Math.min(...i);case"max":return Math.max(...i);case"first":return i[0];case"last":return i[i.length-1];default:return 0}}const n=L.computed(()=>{const i=e.config,a=e.data||[];if(a.length===0||!i.columnField||i.valueFields.length===0)return{rowHeaders:[],colHeaders:[],cells:[],rowTotals:[],colTotals:[],grandTotal:{value:0}};const o=i.valueFields.length>1,A=p=>o?p.map((B,E)=>{var m;return`${((m=i.valueFields[E])==null?void 0:m.label)||`V${E+1}`}: ${B}`}).join(`
|
|
184
|
-
`):p[0]??0,s=[...new Set(a.map(p=>p[i.columnField]))].map(String).sort(),l=i.showTotals?[...s,i.totalsLabel||"Total"]:s,c=new Map,u=[];for(const p of a){const B=i.rowFields.map(E=>String(p[E.binding]??"")).join("|||");c.has(B)||(c.set(B,[]),u.push(i.rowFields.map(E=>String(p[E.binding]??"")))),c.get(B).push(p)}const f=[],h=[],g=Array.from(c.keys());for(let p=0;p<u.length;p++){const B=g[p],E=c.get(B)||[],m=[],y=new Array(i.valueFields.length).fill(0);for(const w of s){const I=E.filter(U=>String(U[i.columnField])===w),Q=I.length>0?I:E.filter(()=>!1),x=i.valueFields.map((U,b)=>{const C=Q.map(F=>Number(F[U.binding])||0),D=t(C,U.aggregation);return y[b]+=D,D});m.push({value:A(x)})}i.showTotals&&m.push({value:A(y),isTotal:!0}),h.push({value:A(y)}),f.push(m)}const d=[],v=new Array(i.valueFields.length).fill(0);for(let p=0;p<s.length;p++){const B=new Array(i.valueFields.length).fill(0);for(let E=0;E<u.length;E++){const m=g[E],y=c.get(m)||[],w=y.filter(Q=>String(Q[i.columnField])===s[p]),I=w.length>0?w:y.filter(()=>!1);i.valueFields.forEach((Q,x)=>{const U=I.map(C=>Number(C[Q.binding])||0),b=t(U,Q.aggregation);B[x]+=b})}B.forEach((E,m)=>v[m]+=E),d.push({value:A(B)})}return i.showTotals&&d.push({value:A(v),isTotal:!0}),{rowHeaders:u,colHeaders:l,cells:f,rowTotals:h,colTotals:d,grandTotal:{value:A(v)}}});return(i,a)=>(L.openBlock(),L.createElementBlock("table",qYe,[L.createElementVNode("thead",null,[L.createElementVNode("tr",null,[(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(i.config.rowFields,(o,A)=>(L.openBlock(),L.createElementBlock("th",{key:"rh-"+A,class:"crosstab-row-header"},L.toDisplayString(o.label),1))),128)),(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(n.value.colHeaders,(o,A)=>(L.openBlock(),L.createElementBlock("th",{key:"ch-"+A,class:"crosstab-col-header"},L.toDisplayString(o),1))),128))])]),L.createElementVNode("tbody",null,[(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(n.value.cells,(o,A)=>(L.openBlock(),L.createElementBlock("tr",{key:"r-"+A},[(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(n.value.rowHeaders[A]||[],(s,l)=>(L.openBlock(),L.createElementBlock("td",{key:"rh-"+A+"-"+l,class:"crosstab-row-cell"},L.toDisplayString(s),1))),128)),(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(o,(s,l)=>(L.openBlock(),L.createElementBlock("td",{key:"c-"+A+"-"+l,class:L.normalizeClass({"crosstab-total":s.isTotal})},[L.createElementVNode("span",$Ye,L.toDisplayString(s.value),1)],2))),128))]))),128)),i.config.showTotals||i.config.showGrandTotals?(L.openBlock(),L.createElementBlock("tr",ePe,[(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(i.config.rowFields,(o,A)=>(L.openBlock(),L.createElementBlock("td",{key:"ft-"+A,class:"crosstab-row-cell crosstab-total-label"},L.toDisplayString(A===0?i.config.totalsLabel||"Total":""),1))),128)),(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(n.value.colTotals,(o,A)=>(L.openBlock(),L.createElementBlock("td",{key:"fc-"+A,class:"crosstab-total"},[L.createElementVNode("span",tPe,L.toDisplayString(o.value),1)]))),128))])):L.createCommentVNode("",!0)])]))}}),[["styles",[".nexa-crosstab[data-v-7dd0c592]{width:100%;border-collapse:collapse;font-size:inherit;table-layout:fixed}.nexa-crosstab th[data-v-7dd0c592],.nexa-crosstab td[data-v-7dd0c592]{border:1px solid #d1d5db;padding:4px 8px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-word}.nexa-crosstab th[data-v-7dd0c592]{background:#f3f4f6;font-weight:700;border-bottom:2px solid #9ca3af;white-space:nowrap}.crosstab-row-header[data-v-7dd0c592]{background:#fafafa;font-weight:600}.crosstab-col-header[data-v-7dd0c592]{text-align:center}.crosstab-cell-value[data-v-7dd0c592]{white-space:pre-line}.crosstab-total[data-v-7dd0c592]{background:#e8f4fd!important;font-weight:700}.crosstab-total-label[data-v-7dd0c592]{font-weight:700;background:#f3f4f6}.crosstab-totals-row td[data-v-7dd0c592]{font-weight:700;background:#f3f4f6;border-top:2px solid #9ca3af}"]],["__scopeId","data-v-7dd0c592"]]),nPe={class:"nexa-widget-content-root"},iPe={key:0,class:"nexa-indicator-box"},aPe={key:0,class:"nexa-ind-pre"},oPe={key:1,class:"nexa-ind-suf"},APe={class:"nexa-ind-label"},sPe={key:2,class:"nexa-widget-fallback"},lPe=$w(L.defineComponent({__name:"DashboardWidgetRenderer",props:{widget:{type:Object},data:{type:Array}},setup(r,{expose:e}){const t=r,n=L.ref(null);let i=null;const a=L.computed(()=>t.widget.type==="Chart"||t.widget.type==="Gauge"),o=L.computed(()=>{var u;const{type:s,config:l}=t.widget,c=t.data||[];if(s==="Chart"){const f=l.chartType||"bar",h=c.map(d=>String(d[l.argumentField]||"")),g=c.map(d=>Number(d[l.valueField])||0);return{grid:{top:10,right:10,bottom:20,left:40,containLabel:!0},tooltip:{trigger:"axis"},xAxis:{type:"category",data:h},yAxis:{type:"value"},series:[{data:g,type:f==="area"?"line":f,smooth:!0,areaStyle:f==="area"?{opacity:.3}:void 0,itemStyle:{color:"#6366f1"}}]}}else if(s==="Gauge"){const f=Number((u=c[0])==null?void 0:u[l.valueField])||0;return{series:[{type:"gauge",startAngle:180,endAngle:0,center:["50%","75%"],radius:"90%",min:l.min||0,max:l.max||100,progress:{show:!0,width:12},axisLine:{lineStyle:{width:12}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},pointer:{show:!0,length:"60%",width:4},detail:{valueAnimation:!0,formatter:"{value}",offsetCenter:[0,"15%"],fontSize:18,fontWeight:"bold"},data:[{value:f}]}]}}return{}});function A(){!n.value||!a.value||(i&&i.dispose(),i=fQ(n.value),i.setOption(o.value))}return L.onMounted(()=>{a.value&&A()}),L.watch(()=>t.widget,()=>{a.value&&A()},{deep:!0}),L.watch(()=>t.data,()=>{i&&i.setOption(o.value)},{deep:!0}),e({resize:()=>i==null?void 0:i.resize()}),(s,l)=>{var c;return L.openBlock(),L.createElementBlock("div",nPe,[s.widget.type==="Indicator"?(L.openBlock(),L.createElementBlock("div",iPe,[L.createElementVNode("div",{class:"nexa-ind-value",style:L.normalizeStyle({color:s.widget.config.color||"#3b82f6"})},[s.widget.config.prefix?(L.openBlock(),L.createElementBlock("span",aPe,L.toDisplayString(s.widget.config.prefix),1)):L.createCommentVNode("",!0),L.createTextVNode(" "+L.toDisplayString(((c=s.data[0])==null?void 0:c[s.widget.config.valueField])||"0")+" ",1),s.widget.config.suffix?(L.openBlock(),L.createElementBlock("span",oPe,L.toDisplayString(s.widget.config.suffix),1)):L.createCommentVNode("",!0)],4),L.createElementVNode("div",APe,L.toDisplayString(s.widget.config.label||"Métrica"),1)])):a.value?(L.openBlock(),L.createElementBlock("div",{key:1,ref_key:"chartContainerRef",ref:n,class:"nexa-widget-chart-container"},null,512)):(L.openBlock(),L.createElementBlock("div",sPe,[l[0]||(l[0]=L.createElementVNode("i",{class:"pi pi-box mb-2"},null,-1)),L.createElementVNode("span",null,L.toDisplayString(s.widget.type),1)]))])}}}),[["styles",[".nexa-widget-content-root[data-v-51dec67b]{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden}.nexa-indicator-box[data-v-51dec67b]{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.nexa-ind-value[data-v-51dec67b]{font-size:2.2rem;font-weight:800;line-height:1;margin-bottom:4px}.nexa-ind-pre[data-v-51dec67b],.nexa-ind-suf[data-v-51dec67b]{font-size:1rem;font-weight:600;opacity:.6}.nexa-ind-label[data-v-51dec67b]{font-size:.75rem;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.05em}.nexa-widget-chart-container[data-v-51dec67b]{flex:1;width:100%;height:100%}.nexa-widget-fallback[data-v-51dec67b]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#94a3b8;font-size:.8rem}"]],["__scopeId","data-v-51dec67b"]]);function vT(r,e){return e.reduce((t,n)=>t+(Number(sl(r,n))||0),0)}function Yee(r,e){return!r||r==="*"?e.length:e.filter(t=>sl(r,t)!==null&&sl(r,t)!==void 0).length}function cPe(r,e){const t=Yee(r,e);return t===0?0:vT(r,e)/t}function uPe(r,e){const t=e.map(n=>Number(sl(r,n))).filter(n=>!isNaN(n));return t.length===0?0:Math.min(...t)}function hPe(r,e){const t=e.map(n=>Number(sl(r,n))).filter(n=>!isNaN(n));return t.length===0?0:Math.max(...t)}function fPe(r,e){return e.length>0?sl(r,e[0]):null}function gPe(r,e){return e.length>0?sl(r,e[e.length-1]):null}function sl(r,e){return e?r.split(".").reduce((t,n)=>t==null?void 0:t[n.trim()],e):null}function ll(r){const e=Number(r);return isNaN(e)?0:e}function is(r){return r==null?"":String(r)}function Pee(r){const e=r.trim();return/^-?\d+(\.\d+)?$/.test(e)}function dPe(r){if(r==null)return"null";if(typeof r=="number")return isFinite(r)?String(r):"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return Pee(r)?r.trim():`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;const e=Number(r);if(Number.isFinite(e))return String(e);const t=String(r);return Pee(t)?t.trim():`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function pPe(r,e,t){let n="",i=0,a=!1,o="";const A=l=>/[A-Za-z_]/.test(l),s=l=>/[A-Za-z0-9_.]/.test(l);for(;i<r.length;){const l=r[i];if(a){if(n+=l,l==="\\"&&i+1<r.length){n+=r[i+1],i+=2;continue}l===o&&(a=!1,o=""),i++;continue}if(l==='"'||l==="'"){a=!0,o=l,n+=l,i++;continue}if(!A(l)){n+=l,i++;continue}const c=i;for(i++;i<r.length&&s(r[i]);)i++;const u=r.slice(c,i),f=u.toLowerCase();let h=i;for(;h<r.length&&/\s/.test(r[h]);)h++;if((h<r.length?r[h]:"")==="("||t.has(f)){n+=u;continue}const d=sl(u,e);if(d==null){n+=u;continue}n+=dPe(d)}return n}function gp(r){if(r=r.trim(),r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);if(r==="true")return!0;if(r==="false")return!1;if(r==="null"||r==="undefined")return null;if(/^-?\d+(\.\d+)?$/.test(r))return Number(r);const e=r.match(/\(([^()]+)\)/);if(e){const n=gp(e[1]);return gp(r.slice(0,e.index)+String(n)+r.slice(e.index+e[0].length))}const t=[{regex:/\|\|/,fn:(n,i)=>n||i},{regex:/&&/,fn:(n,i)=>n&&i},{regex:/==/,fn:(n,i)=>n==i},{regex:/!=/,fn:(n,i)=>n!=i},{regex:/<=/,fn:(n,i)=>Number(n)<=Number(i)},{regex:/>=/,fn:(n,i)=>Number(n)>=Number(i)},{regex:/</,fn:(n,i)=>Number(n)<Number(i)},{regex:/>/,fn:(n,i)=>Number(n)>Number(i)},{regex:/\+/,fn:(n,i)=>Number(n)+Number(i)},{regex:new RegExp("(?<!\\w)-(?!\\w)"),fn:(n,i)=>Number(n)-Number(i)},{regex:/\*/,fn:(n,i)=>Number(n)*Number(i)},{regex:/\//,fn:(n,i)=>Number(i)!==0?Number(n)/Number(i):0},{regex:/%/,fn:(n,i)=>Number(n)%Number(i)}];for(const n of t){const i=r.match(n.regex);if(i&&i.index!==void 0&&i.index>0){if(n.regex.source.includes("-")&&i.index===0)continue;const a=r.slice(0,i.index).trim(),o=r.slice(i.index+i[0].length).trim();if(a&&o){const A=gp(a),s=gp(o);return n.fn(A,s)}}}return r}function vPe(r,e){if(!r.trim())return[];const t=[];let n=0,i="",a=!1,o="";for(let A=0;A<r.length;A++){const s=r[A];a?(i+=s,s===o&&(a=!1)):s==='"'||s==="'"?(a=!0,o=s,i+=s):s==="("?(n++,i+=s):s===")"?(n--,i+=s):s===","&&n===0?(t.push(i.trim()),i=""):i+=s}return i.trim()&&t.push(i.trim()),t.map(A=>BPe(A,e))}function BPe(r,e){var t;if(r=r.trim(),r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);if(/^-?\d+(\.\d+)?$/.test(r))return Number(r);if(r==="true")return!0;if(r==="false")return!1;if(r==="null"||r==="undefined")return null;if(e.row){const n=sl(r,e.row);if(n!=null)return n}if(r.startsWith("$")){const n=r.slice(1);return((t=e.parameters)==null?void 0:t[n])??null}return r}function EPe(r,e={}){if(!r)return"";r=r.trim();const t=e.data||[],n=e.row||{},i=new Date,a=r.match(/\b(sum|count|avg|min|max|first|last)\s*\(\s*([\w.*]+)\s*\)/i);if(a){const l=a[1].toLowerCase(),c=a[2];return({sum:vT,count:Yee,avg:cPe,min:uPe,max:hPe,first:fPe,last:gPe}[l]||vT)(c,t)}const o=r.match(/^(\w+)\s*\((.+)\)$/s);if(o){const l=o[1].toLowerCase(),c=o[2],u=vPe(c,e);switch(l){case"concat":return u.map(is).join("");case"upper":return is(u[0]).toUpperCase();case"lower":return is(u[0]).toLowerCase();case"len":return is(u[0]).length;case"trim":return is(u[0]).trim();case"substring":return is(u[0]).substring(ll(u[1]),ll(u[1])+ll(u[2]));case"left":return is(u[0]).substring(0,ll(u[1]));case"right":{const f=is(u[0]);return f.substring(f.length-ll(u[1]))}case"replace":return is(u[0]).replaceAll(is(u[1]),is(u[2]));case"round":return Math.round(ll(u[0]));case"abs":return Math.abs(ll(u[0]));case"floor":return Math.floor(ll(u[0]));case"ceil":return Math.ceil(ll(u[0]));case"formatnumber":{const f=ll(u[0]);return isNaN(f)?"0":f.toLocaleString("es-ES")}case"formatdate":{const f=new Date(u[0]);if(isNaN(f.getTime()))return"";const h=is(u[1]).replace(/"/g,""),g=String(f.getDate()).padStart(2,"0"),d=String(f.getMonth()+1).padStart(2,"0"),v=f.getFullYear();return h.replace("dd",g).replace("MM",d).replace("yyyy",String(v))}case"formatcurrency":{const f=ll(u[0]),h=is(u[1]).replace(/"/g,"")||"USD";return isNaN(f)?"":f.toLocaleString("es-ES",{style:"currency",currency:h})}case"if":case"iif":return gp(is(u[0]))?u[1]:u[2];case"isnull":{const f=u[0];return f==null||f===""?u[1]:u[0]}case"now":return i.toISOString();case"today":return i.toISOString().split("T")[0];default:return r}}r=r.replace(/\$\{?(\w+)\}?/g,(l,c)=>{var f;const u=(f=e.parameters)==null?void 0:f[c];return u!==void 0?typeof u=="string"?`"${u}"`:String(u):"null"}),r=r.replace(/\{\{(\w+(?:\.\w+)*)\}\}/g,(l,c)=>{const u=sl(c,n);return u==null?"null":typeof u=="string"?`"${u}"`:String(u)});const A={Page:()=>String(e.page||1),TotalPages:()=>String(e.totalPages||1),FirstPage:()=>String((e.page||1)===1),LastPage:()=>String((e.page||1)>=(e.totalPages||1)),Today:()=>`"${i.toISOString().split("T")[0]}"`,Now:()=>`"${i.toISOString().replace("T"," ").split(".")[0]}"`,Year:()=>String(i.getFullYear()),Month:()=>String(i.getMonth()+1),Day:()=>String(i.getDate()),ReportName:()=>`"${e.reportName||""}"`,ReportAuthor:()=>`"${e.reportAuthor||""}"`,ReportDescription:()=>`"${e.reportDescription||""}"`,ReportCreated:()=>`"${e.reportCreated||""}"`,RowNumber:()=>String(e.rowNumber||1),TotalRows:()=>String(e.totalRows||0),FirstRow:()=>String(e.rowNumber===1),LastRow:()=>String(e.rowNumber===e.totalRows),EvenRow:()=>String((e.rowNumber||1)%2===0),OddRow:()=>String((e.rowNumber||1)%2!==0),groupKey:()=>`"${e.groupKey||""}"`,groupCount:()=>String(e.groupCount||0)};for(const[l,c]of Object.entries(A)){const u=new RegExp(`\\b${l}\\b`,"gi");r=r.replace(u,c)}return r=r.replace(/\bpage\s*\(\s*\)/gi,()=>String(e.page||1)),r=r.replace(/\btotalPages\s*\(\s*\)/gi,()=>String(e.totalPages||1)),r=r.replace(/\btotal\s*\(\s*\)/gi,()=>String(t.length)),r=pPe(r,n,new Set(["true","false","null","undefined","sum","count","avg","min","max","first","last","concat","upper","lower","len","trim","substring","left","right","replace","round","abs","floor","ceil","formatnumber","formatdate","formatcurrency","if","iif","isnull","now","today","page","totalpages","total","page","totalpages","totalrows","rownumber","firstrow","lastrow","evenrow","oddrow","year","month","day","today","now","reportname","reportauthor","reportdescription","reportcreated","groupkey","groupcount"])),gp(r)}function jo(r,e={}){return r?(r=r.replace(/\{\[(.*?)\]\}/g,(t,n)=>{try{const i=EPe(n,e);return i!=null?String(i):`[${n}]`}catch{return`[${n}]`}}),r=r.replace(/\{\{(\w+(?:\.\w+)*)\}\}/g,(t,n)=>{const i=n;if(i==="Page")return String(e.page||1);if(i==="TotalPages")return String(e.totalPages||1);if(i==="FirstPage")return String((e.page||1)===1);if(i==="LastPage")return String((e.page||1)>=(e.totalPages||1));if(i==="Today")return new Date().toISOString().split("T")[0];if(i==="Now")return new Date().toISOString().replace("T"," ").split(".")[0];if(i==="Year")return String(new Date().getFullYear());if(i==="Month")return String(new Date().getMonth()+1);if(i==="Day")return String(new Date().getDate());if(i==="ReportName")return e.reportName||"";if(i==="ReportAuthor")return e.reportAuthor||"";if(i==="ReportDescription")return e.reportDescription||"";if(i==="ReportCreated")return e.reportCreated||"";if(i==="RowNumber")return String(e.rowNumber||1);if(i==="TotalRows")return String(e.totalRows||0);if(i==="GroupKey")return String(e.groupKey||"");if(i==="GroupCount")return String(e.groupCount||0);if(i==="FirstRow")return String((e.rowNumber||1)===1);if(i==="LastRow")return String((e.rowNumber||1)===(e.totalRows||0));if(i==="EvenRow")return String((e.rowNumber||1)%2===0);if(i==="OddRow")return String((e.rowNumber||1)%2!==0);const a=sl(n,e.row||{});return a!=null&&a!==""?String(a):`[${n}]`}),r):""}var mPe=Object.defineProperty,yPe=Object.defineProperties,wPe=Object.getOwnPropertyDescriptors,Oee=Object.getOwnPropertySymbols,IPe=Object.prototype.hasOwnProperty,xPe=Object.prototype.propertyIsEnumerable,BT=(r,e,t)=>e in r?mPe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,fn=(r,e)=>{for(var t in e||(e={}))IPe.call(e,t)&&BT(r,t,e[t]);if(Oee)for(var t of Oee(e))xPe.call(e,t)&&BT(r,t,e[t]);return r},lA=(r,e)=>yPe(r,wPe(e)),Tt=(r,e,t)=>BT(r,typeof e!="symbol"?e+"":e,t),MPe=(r,e,t)=>new Promise((n,i)=>{var a=s=>{try{A(t.next(s))}catch(l){i(l)}},o=s=>{try{A(t.throw(s))}catch(l){i(l)}},A=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,o);A((t=t.apply(r,e)).next())});class e8{constructor(e){Tt(this,"rootKey"),this.rootKey=e}}const QPe=Object.seal({});class Ot extends e8{constructor(e){super(e),Tt(this,"root"),this.root=new Array}prepForXml(e){var t;e.stack.push(this);const n=this.root.map(i=>i instanceof e8?i.prepForXml(e):i).filter(i=>i!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&((t=n[0])!=null&&t._attr)?n[0]:n:QPe}}addChildElement(e){return this.root.push(e),this}}class q2 extends Ot{constructor(e,t){super(e),Tt(this,"includeIfEmpty"),this.includeIfEmpty=t}prepForXml(e){const t=super.prepForXml(e);if(this.includeIfEmpty||t&&(typeof t[this.rootKey]!="object"||Object.keys(t[this.rootKey]).length))return t}}class gn extends e8{constructor(e){super("_attr"),Tt(this,"xmlKeys"),this.root=e}prepForXml(e){const t={};return Object.entries(this.root).forEach(([n,i])=>{if(i!==void 0){const a=this.xmlKeys&&this.xmlKeys[n]||n;t[a]=i}}),{_attr:t}}}class Lee extends e8{constructor(e){super("_attr"),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:n})=>n!==void 0).reduce((n,{key:i,value:a})=>lA(fn({},n),{[i]:a}),{})}}}class cA extends gn{constructor(){super(...arguments),Tt(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}}var M0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ET(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var mT={},t8={exports:{}},Gee;function yT(){if(Gee)return t8.exports;Gee=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(y,w,I){return Function.prototype.apply.call(y,w,I)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:t=function(y){return Object.getOwnPropertyNames(y)};function n(m){console&&console.warn&&console.warn(m)}var i=Number.isNaN||function(y){return y!==y};function a(){a.init.call(this)}t8.exports=a,t8.exports.once=p,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function A(m){if(typeof m!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof m)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(m){if(typeof m!="number"||m<0||i(m))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+m+".");o=m}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(y){if(typeof y!="number"||y<0||i(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this};function s(m){return m._maxListeners===void 0?a.defaultMaxListeners:m._maxListeners}a.prototype.getMaxListeners=function(){return s(this)},a.prototype.emit=function(y){for(var w=[],I=1;I<arguments.length;I++)w.push(arguments[I]);var Q=y==="error",x=this._events;if(x!==void 0)Q=Q&&x.error===void 0;else if(!Q)return!1;if(Q){var U;if(w.length>0&&(U=w[0]),U instanceof Error)throw U;var b=new Error("Unhandled error."+(U?" ("+U.message+")":""));throw b.context=U,b}var C=x[y];if(C===void 0)return!1;if(typeof C=="function")e(C,this,w);else for(var D=C.length,F=g(C,D),I=0;I<D;++I)e(F[I],this,w);return!0};function l(m,y,w,I){var Q,x,U;if(A(w),x=m._events,x===void 0?(x=m._events=Object.create(null),m._eventsCount=0):(x.newListener!==void 0&&(m.emit("newListener",y,w.listener?w.listener:w),x=m._events),U=x[y]),U===void 0)U=x[y]=w,++m._eventsCount;else if(typeof U=="function"?U=x[y]=I?[w,U]:[U,w]:I?U.unshift(w):U.push(w),Q=s(m),Q>0&&U.length>Q&&!U.warned){U.warned=!0;var b=new Error("Possible EventEmitter memory leak detected. "+U.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");b.name="MaxListenersExceededWarning",b.emitter=m,b.type=y,b.count=U.length,n(b)}return m}a.prototype.addListener=function(y,w){return l(this,y,w,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(y,w){return l(this,y,w,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(m,y,w){var I={fired:!1,wrapFn:void 0,target:m,type:y,listener:w},Q=c.bind(I);return Q.listener=w,I.wrapFn=Q,Q}a.prototype.once=function(y,w){return A(w),this.on(y,u(this,y,w)),this},a.prototype.prependOnceListener=function(y,w){return A(w),this.prependListener(y,u(this,y,w)),this},a.prototype.removeListener=function(y,w){var I,Q,x,U,b;if(A(w),Q=this._events,Q===void 0)return this;if(I=Q[y],I===void 0)return this;if(I===w||I.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete Q[y],Q.removeListener&&this.emit("removeListener",y,I.listener||w));else if(typeof I!="function"){for(x=-1,U=I.length-1;U>=0;U--)if(I[U]===w||I[U].listener===w){b=I[U].listener,x=U;break}if(x<0)return this;x===0?I.shift():d(I,x),I.length===1&&(Q[y]=I[0]),Q.removeListener!==void 0&&this.emit("removeListener",y,b||w)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(y){var w,I,Q;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[y]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[y]),this;if(arguments.length===0){var x=Object.keys(I),U;for(Q=0;Q<x.length;++Q)U=x[Q],U!=="removeListener"&&this.removeAllListeners(U);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(w=I[y],typeof w=="function")this.removeListener(y,w);else if(w!==void 0)for(Q=w.length-1;Q>=0;Q--)this.removeListener(y,w[Q]);return this};function f(m,y,w){var I=m._events;if(I===void 0)return[];var Q=I[y];return Q===void 0?[]:typeof Q=="function"?w?[Q.listener||Q]:[Q]:w?v(Q):g(Q,Q.length)}a.prototype.listeners=function(y){return f(this,y,!0)},a.prototype.rawListeners=function(y){return f(this,y,!1)},a.listenerCount=function(m,y){return typeof m.listenerCount=="function"?m.listenerCount(y):h.call(m,y)},a.prototype.listenerCount=h;function h(m){var y=this._events;if(y!==void 0){var w=y[m];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function g(m,y){for(var w=new Array(y),I=0;I<y;++I)w[I]=m[I];return w}function d(m,y){for(;y+1<m.length;y++)m[y]=m[y+1];m.pop()}function v(m){for(var y=new Array(m.length),w=0;w<y.length;++w)y[w]=m[w].listener||m[w];return y}function p(m,y){return new Promise(function(w,I){function Q(U){m.removeListener(y,x),I(U)}function x(){typeof m.removeListener=="function"&&m.removeListener("error",Q),w([].slice.call(arguments))}E(m,y,x,{once:!0}),y!=="error"&&B(m,Q,{once:!0})})}function B(m,y,w){typeof m.on=="function"&&E(m,"error",y,w)}function E(m,y,w,I){if(typeof m.on=="function")I.once?m.once(y,w):m.on(y,w);else if(typeof m.addEventListener=="function")m.addEventListener(y,function Q(x){I.once&&m.removeEventListener(y,Q),w(x)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof m)}return t8.exports}var r8={exports:{}},zee;function $2(){return zee||(zee=1,typeof Object.create=="function"?r8.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r8.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),r8.exports}function CPe(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Hee={exports:{}},ka=Hee.exports={},mc,yc;function wT(){throw new Error("setTimeout has not been defined")}function IT(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?mc=setTimeout:mc=wT}catch{mc=wT}try{typeof clearTimeout=="function"?yc=clearTimeout:yc=IT}catch{yc=IT}})();function jee(r){if(mc===setTimeout)return setTimeout(r,0);if((mc===wT||!mc)&&setTimeout)return mc=setTimeout,setTimeout(r,0);try{return mc(r,0)}catch{try{return mc.call(null,r,0)}catch{return mc.call(this,r,0)}}}function SPe(r){if(yc===clearTimeout)return clearTimeout(r);if((yc===IT||!yc)&&clearTimeout)return yc=clearTimeout,clearTimeout(r);try{return yc(r)}catch{try{return yc.call(null,r)}catch{return yc.call(this,r)}}}var Ru=[],dp=!1,E1,n8=-1;function FPe(){!dp||!E1||(dp=!1,E1.length?Ru=E1.concat(Ru):n8=-1,Ru.length&&Vee())}function Vee(){if(!dp){var r=jee(FPe);dp=!0;for(var e=Ru.length;e;){for(E1=Ru,Ru=[];++n8<e;)E1&&E1[n8].run();n8=-1,e=Ru.length}E1=null,dp=!1,SPe(r)}}ka.nextTick=function(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Ru.push(new Jee(r,e)),Ru.length===1&&!dp&&jee(Vee)};function Jee(r,e){this.fun=r,this.array=e}Jee.prototype.run=function(){this.fun.apply(null,this.array)},ka.title="browser",ka.browser=!0,ka.env={},ka.argv=[],ka.version="",ka.versions={};function bu(){}ka.on=bu,ka.addListener=bu,ka.once=bu,ka.off=bu,ka.removeListener=bu,ka.removeAllListeners=bu,ka.emit=bu,ka.prependListener=bu,ka.prependOnceListener=bu,ka.listeners=function(r){return[]},ka.binding=function(r){throw new Error("process.binding is not supported")},ka.cwd=function(){return"/"},ka.chdir=function(r){throw new Error("process.chdir is not supported")},ka.umask=function(){return 0};var TPe=Hee.exports;const Hn=CPe(TPe);var xT,Kee;function Wee(){return Kee||(Kee=1,xT=yT().EventEmitter),xT}var MT={},fE={},Xee;function RPe(){if(Xee)return fE;Xee=1,fE.byteLength=A,fE.toByteArray=l,fE.fromByteArray=f;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=n.length;i<a;++i)r[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(h){var g=h.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var d=h.indexOf("=");d===-1&&(d=g);var v=d===g?0:4-d%4;return[d,v]}function A(h){var g=o(h),d=g[0],v=g[1];return(d+v)*3/4-v}function s(h,g,d){return(g+d)*3/4-d}function l(h){var g,d=o(h),v=d[0],p=d[1],B=new t(s(h,v,p)),E=0,m=p>0?v-4:v,y;for(y=0;y<m;y+=4)g=e[h.charCodeAt(y)]<<18|e[h.charCodeAt(y+1)]<<12|e[h.charCodeAt(y+2)]<<6|e[h.charCodeAt(y+3)],B[E++]=g>>16&255,B[E++]=g>>8&255,B[E++]=g&255;return p===2&&(g=e[h.charCodeAt(y)]<<2|e[h.charCodeAt(y+1)]>>4,B[E++]=g&255),p===1&&(g=e[h.charCodeAt(y)]<<10|e[h.charCodeAt(y+1)]<<4|e[h.charCodeAt(y+2)]>>2,B[E++]=g>>8&255,B[E++]=g&255),B}function c(h){return r[h>>18&63]+r[h>>12&63]+r[h>>6&63]+r[h&63]}function u(h,g,d){for(var v,p=[],B=g;B<d;B+=3)v=(h[B]<<16&16711680)+(h[B+1]<<8&65280)+(h[B+2]&255),p.push(c(v));return p.join("")}function f(h){for(var g,d=h.length,v=d%3,p=[],B=16383,E=0,m=d-v;E<m;E+=B)p.push(u(h,E,E+B>m?m:E+B));return v===1?(g=h[d-1],p.push(r[g>>2]+r[g<<4&63]+"==")):v===2&&(g=(h[d-2]<<8)+h[d-1],p.push(r[g>>10]+r[g>>4&63]+r[g<<2&63]+"=")),p.join("")}return fE}var i8={},Zee;function bPe(){return Zee||(Zee=1,i8.read=function(r,e,t,n,i){var a,o,A=i*8-n-1,s=(1<<A)-1,l=s>>1,c=-7,u=t?i-1:0,f=t?-1:1,h=r[e+u];for(u+=f,a=h&(1<<-c)-1,h>>=-c,c+=A;c>0;a=a*256+r[e+u],u+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=o*256+r[e+u],u+=f,c-=8);if(a===0)a=1-l;else{if(a===s)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(h?-1:1)*o*Math.pow(2,a-n)},i8.write=function(r,e,t,n,i,a){var o,A,s,l=a*8-i-1,c=(1<<l)-1,u=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,g=n?1:-1,d=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(A=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),o+u>=1?e+=f/s:e+=f*Math.pow(2,1-u),e*s>=2&&(o++,s/=2),o+u>=c?(A=0,o=c):o+u>=1?(A=(e*s-1)*Math.pow(2,i),o=o+u):(A=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+h]=A&255,h+=g,A/=256,i-=8);for(o=o<<i|A,l+=i;l>0;r[t+h]=o&255,h+=g,o/=256,l-=8);r[t+h-g]|=d*128}),i8}var qee;function a8(){return qee||(qee=1,function(r){var e=RPe(),t=bPe(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=A,r.SlowBuffer=B,r.INSPECT_MAX_BYTES=50;var i=2147483647;r.kMaxLength=i,A.TYPED_ARRAY_SUPPORT=a(),!A.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{var z=new Uint8Array(1),Y={foo:function(){return 42}};return Object.setPrototypeOf(Y,Uint8Array.prototype),Object.setPrototypeOf(z,Y),z.foo()===42}catch{return!1}}Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.buffer}}),Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.byteOffset}});function o(z){if(z>i)throw new RangeError('The value "'+z+'" is invalid for option "size"');var Y=new Uint8Array(z);return Object.setPrototypeOf(Y,A.prototype),Y}function A(z,Y,O){if(typeof z=="number"){if(typeof Y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(z)}return s(z,Y,O)}A.poolSize=8192;function s(z,Y,O){if(typeof z=="string")return f(z,Y);if(ArrayBuffer.isView(z))return g(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(Fe(z,ArrayBuffer)||z&&Fe(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Fe(z,SharedArrayBuffer)||z&&Fe(z.buffer,SharedArrayBuffer)))return d(z,Y,O);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Z=z.valueOf&&z.valueOf();if(Z!=null&&Z!==z)return A.from(Z,Y,O);var Be=v(z);if(Be)return Be;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return A.from(z[Symbol.toPrimitive]("string"),Y,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}A.from=function(z,Y,O){return s(z,Y,O)},Object.setPrototypeOf(A.prototype,Uint8Array.prototype),Object.setPrototypeOf(A,Uint8Array);function l(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function c(z,Y,O){return l(z),z<=0?o(z):Y!==void 0?typeof O=="string"?o(z).fill(Y,O):o(z).fill(Y):o(z)}A.alloc=function(z,Y,O){return c(z,Y,O)};function u(z){return l(z),o(z<0?0:p(z)|0)}A.allocUnsafe=function(z){return u(z)},A.allocUnsafeSlow=function(z){return u(z)};function f(z,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!A.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);var O=E(z,Y)|0,Z=o(O),Be=Z.write(z,Y);return Be!==O&&(Z=Z.slice(0,Be)),Z}function h(z){for(var Y=z.length<0?0:p(z.length)|0,O=o(Y),Z=0;Z<Y;Z+=1)O[Z]=z[Z]&255;return O}function g(z){if(Fe(z,Uint8Array)){var Y=new Uint8Array(z);return d(Y.buffer,Y.byteOffset,Y.byteLength)}return h(z)}function d(z,Y,O){if(Y<0||z.byteLength<Y)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<Y+(O||0))throw new RangeError('"length" is outside of buffer bounds');var Z;return Y===void 0&&O===void 0?Z=new Uint8Array(z):O===void 0?Z=new Uint8Array(z,Y):Z=new Uint8Array(z,Y,O),Object.setPrototypeOf(Z,A.prototype),Z}function v(z){if(A.isBuffer(z)){var Y=p(z.length)|0,O=o(Y);return O.length===0||z.copy(O,0,0,Y),O}if(z.length!==void 0)return typeof z.length!="number"||W(z.length)?o(0):h(z);if(z.type==="Buffer"&&Array.isArray(z.data))return h(z.data)}function p(z){if(z>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return z|0}function B(z){return+z!=z&&(z=0),A.alloc(+z)}A.isBuffer=function(Y){return Y!=null&&Y._isBuffer===!0&&Y!==A.prototype},A.compare=function(Y,O){if(Fe(Y,Uint8Array)&&(Y=A.from(Y,Y.offset,Y.byteLength)),Fe(O,Uint8Array)&&(O=A.from(O,O.offset,O.byteLength)),!A.isBuffer(Y)||!A.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Y===O)return 0;for(var Z=Y.length,Be=O.length,Ce=0,Ie=Math.min(Z,Be);Ce<Ie;++Ce)if(Y[Ce]!==O[Ce]){Z=Y[Ce],Be=O[Ce];break}return Z<Be?-1:Be<Z?1:0},A.isEncoding=function(Y){switch(String(Y).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.concat=function(Y,O){if(!Array.isArray(Y))throw new TypeError('"list" argument must be an Array of Buffers');if(Y.length===0)return A.alloc(0);var Z;if(O===void 0)for(O=0,Z=0;Z<Y.length;++Z)O+=Y[Z].length;var Be=A.allocUnsafe(O),Ce=0;for(Z=0;Z<Y.length;++Z){var Ie=Y[Z];if(Fe(Ie,Uint8Array))Ce+Ie.length>Be.length?A.from(Ie).copy(Be,Ce):Uint8Array.prototype.set.call(Be,Ie,Ce);else if(A.isBuffer(Ie))Ie.copy(Be,Ce);else throw new TypeError('"list" argument must be an Array of Buffers');Ce+=Ie.length}return Be};function E(z,Y){if(A.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||Fe(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);var O=z.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&O===0)return 0;for(var Be=!1;;)switch(Y){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return G(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ne(z).length;default:if(Be)return Z?-1:G(z).length;Y=(""+Y).toLowerCase(),Be=!0}}A.byteLength=E;function m(z,Y,O){var Z=!1;if((Y===void 0||Y<0)&&(Y=0),Y>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,Y>>>=0,O<=Y))return"";for(z||(z="utf8");;)switch(z){case"hex":return ie(this,Y,O);case"utf8":case"utf-8":return F(this,Y,O);case"ascii":return q(this,Y,O);case"latin1":case"binary":return re(this,Y,O);case"base64":return D(this,Y,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,Y,O);default:if(Z)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),Z=!0}}A.prototype._isBuffer=!0;function y(z,Y,O){var Z=z[Y];z[Y]=z[O],z[O]=Z}A.prototype.swap16=function(){var Y=this.length;if(Y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var O=0;O<Y;O+=2)y(this,O,O+1);return this},A.prototype.swap32=function(){var Y=this.length;if(Y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var O=0;O<Y;O+=4)y(this,O,O+3),y(this,O+1,O+2);return this},A.prototype.swap64=function(){var Y=this.length;if(Y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var O=0;O<Y;O+=8)y(this,O,O+7),y(this,O+1,O+6),y(this,O+2,O+5),y(this,O+3,O+4);return this},A.prototype.toString=function(){var Y=this.length;return Y===0?"":arguments.length===0?F(this,0,Y):m.apply(this,arguments)},A.prototype.toLocaleString=A.prototype.toString,A.prototype.equals=function(Y){if(!A.isBuffer(Y))throw new TypeError("Argument must be a Buffer");return this===Y?!0:A.compare(this,Y)===0},A.prototype.inspect=function(){var Y="",O=r.INSPECT_MAX_BYTES;return Y=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(Y+=" ... "),"<Buffer "+Y+">"},n&&(A.prototype[n]=A.prototype.inspect),A.prototype.compare=function(Y,O,Z,Be,Ce){if(Fe(Y,Uint8Array)&&(Y=A.from(Y,Y.offset,Y.byteLength)),!A.isBuffer(Y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Y);if(O===void 0&&(O=0),Z===void 0&&(Z=Y?Y.length:0),Be===void 0&&(Be=0),Ce===void 0&&(Ce=this.length),O<0||Z>Y.length||Be<0||Ce>this.length)throw new RangeError("out of range index");if(Be>=Ce&&O>=Z)return 0;if(Be>=Ce)return-1;if(O>=Z)return 1;if(O>>>=0,Z>>>=0,Be>>>=0,Ce>>>=0,this===Y)return 0;for(var Ie=Ce-Be,je=Z-O,qe=Math.min(Ie,je),et=this.slice(Be,Ce),yt=Y.slice(O,Z),Yt=0;Yt<qe;++Yt)if(et[Yt]!==yt[Yt]){Ie=et[Yt],je=yt[Yt];break}return Ie<je?-1:je<Ie?1:0};function w(z,Y,O,Z,Be){if(z.length===0)return-1;if(typeof O=="string"?(Z=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,W(O)&&(O=Be?0:z.length-1),O<0&&(O=z.length+O),O>=z.length){if(Be)return-1;O=z.length-1}else if(O<0)if(Be)O=0;else return-1;if(typeof Y=="string"&&(Y=A.from(Y,Z)),A.isBuffer(Y))return Y.length===0?-1:I(z,Y,O,Z,Be);if(typeof Y=="number")return Y=Y&255,typeof Uint8Array.prototype.indexOf=="function"?Be?Uint8Array.prototype.indexOf.call(z,Y,O):Uint8Array.prototype.lastIndexOf.call(z,Y,O):I(z,[Y],O,Z,Be);throw new TypeError("val must be string, number or Buffer")}function I(z,Y,O,Z,Be){var Ce=1,Ie=z.length,je=Y.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(z.length<2||Y.length<2)return-1;Ce=2,Ie/=2,je/=2,O/=2}function qe(gr,tt){return Ce===1?gr[tt]:gr.readUInt16BE(tt*Ce)}var et;if(Be){var yt=-1;for(et=O;et<Ie;et++)if(qe(z,et)===qe(Y,yt===-1?0:et-yt)){if(yt===-1&&(yt=et),et-yt+1===je)return yt*Ce}else yt!==-1&&(et-=et-yt),yt=-1}else for(O+je>Ie&&(O=Ie-je),et=O;et>=0;et--){for(var Yt=!0,kt=0;kt<je;kt++)if(qe(z,et+kt)!==qe(Y,kt)){Yt=!1;break}if(Yt)return et}return-1}A.prototype.includes=function(Y,O,Z){return this.indexOf(Y,O,Z)!==-1},A.prototype.indexOf=function(Y,O,Z){return w(this,Y,O,Z,!0)},A.prototype.lastIndexOf=function(Y,O,Z){return w(this,Y,O,Z,!1)};function Q(z,Y,O,Z){O=Number(O)||0;var Be=z.length-O;Z?(Z=Number(Z),Z>Be&&(Z=Be)):Z=Be;var Ce=Y.length;Z>Ce/2&&(Z=Ce/2);for(var Ie=0;Ie<Z;++Ie){var je=parseInt(Y.substr(Ie*2,2),16);if(W(je))return Ie;z[O+Ie]=je}return Ie}function x(z,Y,O,Z){return le(G(Y,z.length-O),z,O,Z)}function U(z,Y,O,Z){return le(oe(Y),z,O,Z)}function b(z,Y,O,Z){return le(ne(Y),z,O,Z)}function C(z,Y,O,Z){return le(se(Y,z.length-O),z,O,Z)}A.prototype.write=function(Y,O,Z,Be){if(O===void 0)Be="utf8",Z=this.length,O=0;else if(Z===void 0&&typeof O=="string")Be=O,Z=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(Z)?(Z=Z>>>0,Be===void 0&&(Be="utf8")):(Be=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ce=this.length-O;if((Z===void 0||Z>Ce)&&(Z=Ce),Y.length>0&&(Z<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");Be||(Be="utf8");for(var Ie=!1;;)switch(Be){case"hex":return Q(this,Y,O,Z);case"utf8":case"utf-8":return x(this,Y,O,Z);case"ascii":case"latin1":case"binary":return U(this,Y,O,Z);case"base64":return b(this,Y,O,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,Y,O,Z);default:if(Ie)throw new TypeError("Unknown encoding: "+Be);Be=(""+Be).toLowerCase(),Ie=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(z,Y,O){return Y===0&&O===z.length?e.fromByteArray(z):e.fromByteArray(z.slice(Y,O))}function F(z,Y,O){O=Math.min(z.length,O);for(var Z=[],Be=Y;Be<O;){var Ce=z[Be],Ie=null,je=Ce>239?4:Ce>223?3:Ce>191?2:1;if(Be+je<=O){var qe,et,yt,Yt;switch(je){case 1:Ce<128&&(Ie=Ce);break;case 2:qe=z[Be+1],(qe&192)===128&&(Yt=(Ce&31)<<6|qe&63,Yt>127&&(Ie=Yt));break;case 3:qe=z[Be+1],et=z[Be+2],(qe&192)===128&&(et&192)===128&&(Yt=(Ce&15)<<12|(qe&63)<<6|et&63,Yt>2047&&(Yt<55296||Yt>57343)&&(Ie=Yt));break;case 4:qe=z[Be+1],et=z[Be+2],yt=z[Be+3],(qe&192)===128&&(et&192)===128&&(yt&192)===128&&(Yt=(Ce&15)<<18|(qe&63)<<12|(et&63)<<6|yt&63,Yt>65535&&Yt<1114112&&(Ie=Yt))}}Ie===null?(Ie=65533,je=1):Ie>65535&&(Ie-=65536,Z.push(Ie>>>10&1023|55296),Ie=56320|Ie&1023),Z.push(Ie),Be+=je}return X(Z)}var H=4096;function X(z){var Y=z.length;if(Y<=H)return String.fromCharCode.apply(String,z);for(var O="",Z=0;Z<Y;)O+=String.fromCharCode.apply(String,z.slice(Z,Z+=H));return O}function q(z,Y,O){var Z="";O=Math.min(z.length,O);for(var Be=Y;Be<O;++Be)Z+=String.fromCharCode(z[Be]&127);return Z}function re(z,Y,O){var Z="";O=Math.min(z.length,O);for(var Be=Y;Be<O;++Be)Z+=String.fromCharCode(z[Be]);return Z}function ie(z,Y,O){var Z=z.length;(!Y||Y<0)&&(Y=0),(!O||O<0||O>Z)&&(O=Z);for(var Be="",Ce=Y;Ce<O;++Ce)Be+=xe[z[Ce]];return Be}function ge(z,Y,O){for(var Z=z.slice(Y,O),Be="",Ce=0;Ce<Z.length-1;Ce+=2)Be+=String.fromCharCode(Z[Ce]+Z[Ce+1]*256);return Be}A.prototype.slice=function(Y,O){var Z=this.length;Y=~~Y,O=O===void 0?Z:~~O,Y<0?(Y+=Z,Y<0&&(Y=0)):Y>Z&&(Y=Z),O<0?(O+=Z,O<0&&(O=0)):O>Z&&(O=Z),O<Y&&(O=Y);var Be=this.subarray(Y,O);return Object.setPrototypeOf(Be,A.prototype),Be};function he(z,Y,O){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+Y>O)throw new RangeError("Trying to access beyond buffer length")}A.prototype.readUintLE=A.prototype.readUIntLE=function(Y,O,Z){Y=Y>>>0,O=O>>>0,Z||he(Y,O,this.length);for(var Be=this[Y],Ce=1,Ie=0;++Ie<O&&(Ce*=256);)Be+=this[Y+Ie]*Ce;return Be},A.prototype.readUintBE=A.prototype.readUIntBE=function(Y,O,Z){Y=Y>>>0,O=O>>>0,Z||he(Y,O,this.length);for(var Be=this[Y+--O],Ce=1;O>0&&(Ce*=256);)Be+=this[Y+--O]*Ce;return Be},A.prototype.readUint8=A.prototype.readUInt8=function(Y,O){return Y=Y>>>0,O||he(Y,1,this.length),this[Y]},A.prototype.readUint16LE=A.prototype.readUInt16LE=function(Y,O){return Y=Y>>>0,O||he(Y,2,this.length),this[Y]|this[Y+1]<<8},A.prototype.readUint16BE=A.prototype.readUInt16BE=function(Y,O){return Y=Y>>>0,O||he(Y,2,this.length),this[Y]<<8|this[Y+1]},A.prototype.readUint32LE=A.prototype.readUInt32LE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),(this[Y]|this[Y+1]<<8|this[Y+2]<<16)+this[Y+3]*16777216},A.prototype.readUint32BE=A.prototype.readUInt32BE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),this[Y]*16777216+(this[Y+1]<<16|this[Y+2]<<8|this[Y+3])},A.prototype.readIntLE=function(Y,O,Z){Y=Y>>>0,O=O>>>0,Z||he(Y,O,this.length);for(var Be=this[Y],Ce=1,Ie=0;++Ie<O&&(Ce*=256);)Be+=this[Y+Ie]*Ce;return Ce*=128,Be>=Ce&&(Be-=Math.pow(2,8*O)),Be},A.prototype.readIntBE=function(Y,O,Z){Y=Y>>>0,O=O>>>0,Z||he(Y,O,this.length);for(var Be=O,Ce=1,Ie=this[Y+--Be];Be>0&&(Ce*=256);)Ie+=this[Y+--Be]*Ce;return Ce*=128,Ie>=Ce&&(Ie-=Math.pow(2,8*O)),Ie},A.prototype.readInt8=function(Y,O){return Y=Y>>>0,O||he(Y,1,this.length),this[Y]&128?(255-this[Y]+1)*-1:this[Y]},A.prototype.readInt16LE=function(Y,O){Y=Y>>>0,O||he(Y,2,this.length);var Z=this[Y]|this[Y+1]<<8;return Z&32768?Z|4294901760:Z},A.prototype.readInt16BE=function(Y,O){Y=Y>>>0,O||he(Y,2,this.length);var Z=this[Y+1]|this[Y]<<8;return Z&32768?Z|4294901760:Z},A.prototype.readInt32LE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),this[Y]|this[Y+1]<<8|this[Y+2]<<16|this[Y+3]<<24},A.prototype.readInt32BE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),this[Y]<<24|this[Y+1]<<16|this[Y+2]<<8|this[Y+3]},A.prototype.readFloatLE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),t.read(this,Y,!0,23,4)},A.prototype.readFloatBE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),t.read(this,Y,!1,23,4)},A.prototype.readDoubleLE=function(Y,O){return Y=Y>>>0,O||he(Y,8,this.length),t.read(this,Y,!0,52,8)},A.prototype.readDoubleBE=function(Y,O){return Y=Y>>>0,O||he(Y,8,this.length),t.read(this,Y,!1,52,8)};function R(z,Y,O,Z,Be,Ce){if(!A.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(Y>Be||Y<Ce)throw new RangeError('"value" argument is out of bounds');if(O+Z>z.length)throw new RangeError("Index out of range")}A.prototype.writeUintLE=A.prototype.writeUIntLE=function(Y,O,Z,Be){if(Y=+Y,O=O>>>0,Z=Z>>>0,!Be){var Ce=Math.pow(2,8*Z)-1;R(this,Y,O,Z,Ce,0)}var Ie=1,je=0;for(this[O]=Y&255;++je<Z&&(Ie*=256);)this[O+je]=Y/Ie&255;return O+Z},A.prototype.writeUintBE=A.prototype.writeUIntBE=function(Y,O,Z,Be){if(Y=+Y,O=O>>>0,Z=Z>>>0,!Be){var Ce=Math.pow(2,8*Z)-1;R(this,Y,O,Z,Ce,0)}var Ie=Z-1,je=1;for(this[O+Ie]=Y&255;--Ie>=0&&(je*=256);)this[O+Ie]=Y/je&255;return O+Z},A.prototype.writeUint8=A.prototype.writeUInt8=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,1,255,0),this[O]=Y&255,O+1},A.prototype.writeUint16LE=A.prototype.writeUInt16LE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,2,65535,0),this[O]=Y&255,this[O+1]=Y>>>8,O+2},A.prototype.writeUint16BE=A.prototype.writeUInt16BE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,2,65535,0),this[O]=Y>>>8,this[O+1]=Y&255,O+2},A.prototype.writeUint32LE=A.prototype.writeUInt32LE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,4,4294967295,0),this[O+3]=Y>>>24,this[O+2]=Y>>>16,this[O+1]=Y>>>8,this[O]=Y&255,O+4},A.prototype.writeUint32BE=A.prototype.writeUInt32BE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,4,4294967295,0),this[O]=Y>>>24,this[O+1]=Y>>>16,this[O+2]=Y>>>8,this[O+3]=Y&255,O+4},A.prototype.writeIntLE=function(Y,O,Z,Be){if(Y=+Y,O=O>>>0,!Be){var Ce=Math.pow(2,8*Z-1);R(this,Y,O,Z,Ce-1,-Ce)}var Ie=0,je=1,qe=0;for(this[O]=Y&255;++Ie<Z&&(je*=256);)Y<0&&qe===0&&this[O+Ie-1]!==0&&(qe=1),this[O+Ie]=(Y/je>>0)-qe&255;return O+Z},A.prototype.writeIntBE=function(Y,O,Z,Be){if(Y=+Y,O=O>>>0,!Be){var Ce=Math.pow(2,8*Z-1);R(this,Y,O,Z,Ce-1,-Ce)}var Ie=Z-1,je=1,qe=0;for(this[O+Ie]=Y&255;--Ie>=0&&(je*=256);)Y<0&&qe===0&&this[O+Ie+1]!==0&&(qe=1),this[O+Ie]=(Y/je>>0)-qe&255;return O+Z},A.prototype.writeInt8=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,1,127,-128),Y<0&&(Y=255+Y+1),this[O]=Y&255,O+1},A.prototype.writeInt16LE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,2,32767,-32768),this[O]=Y&255,this[O+1]=Y>>>8,O+2},A.prototype.writeInt16BE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,2,32767,-32768),this[O]=Y>>>8,this[O+1]=Y&255,O+2},A.prototype.writeInt32LE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,4,2147483647,-2147483648),this[O]=Y&255,this[O+1]=Y>>>8,this[O+2]=Y>>>16,this[O+3]=Y>>>24,O+4},A.prototype.writeInt32BE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,4,2147483647,-2147483648),Y<0&&(Y=4294967295+Y+1),this[O]=Y>>>24,this[O+1]=Y>>>16,this[O+2]=Y>>>8,this[O+3]=Y&255,O+4};function V(z,Y,O,Z,Be,Ce){if(O+Z>z.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function J(z,Y,O,Z,Be){return Y=+Y,O=O>>>0,Be||V(z,Y,O,4),t.write(z,Y,O,Z,23,4),O+4}A.prototype.writeFloatLE=function(Y,O,Z){return J(this,Y,O,!0,Z)},A.prototype.writeFloatBE=function(Y,O,Z){return J(this,Y,O,!1,Z)};function ee(z,Y,O,Z,Be){return Y=+Y,O=O>>>0,Be||V(z,Y,O,8),t.write(z,Y,O,Z,52,8),O+8}A.prototype.writeDoubleLE=function(Y,O,Z){return ee(this,Y,O,!0,Z)},A.prototype.writeDoubleBE=function(Y,O,Z){return ee(this,Y,O,!1,Z)},A.prototype.copy=function(Y,O,Z,Be){if(!A.isBuffer(Y))throw new TypeError("argument should be a Buffer");if(Z||(Z=0),!Be&&Be!==0&&(Be=this.length),O>=Y.length&&(O=Y.length),O||(O=0),Be>0&&Be<Z&&(Be=Z),Be===Z||Y.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("Index out of range");if(Be<0)throw new RangeError("sourceEnd out of bounds");Be>this.length&&(Be=this.length),Y.length-O<Be-Z&&(Be=Y.length-O+Z);var Ce=Be-Z;return this===Y&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,Z,Be):Uint8Array.prototype.set.call(Y,this.subarray(Z,Be),O),Ce},A.prototype.fill=function(Y,O,Z,Be){if(typeof Y=="string"){if(typeof O=="string"?(Be=O,O=0,Z=this.length):typeof Z=="string"&&(Be=Z,Z=this.length),Be!==void 0&&typeof Be!="string")throw new TypeError("encoding must be a string");if(typeof Be=="string"&&!A.isEncoding(Be))throw new TypeError("Unknown encoding: "+Be);if(Y.length===1){var Ce=Y.charCodeAt(0);(Be==="utf8"&&Ce<128||Be==="latin1")&&(Y=Ce)}}else typeof Y=="number"?Y=Y&255:typeof Y=="boolean"&&(Y=Number(Y));if(O<0||this.length<O||this.length<Z)throw new RangeError("Out of range index");if(Z<=O)return this;O=O>>>0,Z=Z===void 0?this.length:Z>>>0,Y||(Y=0);var Ie;if(typeof Y=="number")for(Ie=O;Ie<Z;++Ie)this[Ie]=Y;else{var je=A.isBuffer(Y)?Y:A.from(Y,Be),qe=je.length;if(qe===0)throw new TypeError('The value "'+Y+'" is invalid for argument "value"');for(Ie=0;Ie<Z-O;++Ie)this[Ie+O]=je[Ie%qe]}return this};var ae=/[^+/0-9A-Za-z-_]/g;function j(z){if(z=z.split("=")[0],z=z.trim().replace(ae,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function G(z,Y){Y=Y||1/0;for(var O,Z=z.length,Be=null,Ce=[],Ie=0;Ie<Z;++Ie){if(O=z.charCodeAt(Ie),O>55295&&O<57344){if(!Be){if(O>56319){(Y-=3)>-1&&Ce.push(239,191,189);continue}else if(Ie+1===Z){(Y-=3)>-1&&Ce.push(239,191,189);continue}Be=O;continue}if(O<56320){(Y-=3)>-1&&Ce.push(239,191,189),Be=O;continue}O=(Be-55296<<10|O-56320)+65536}else Be&&(Y-=3)>-1&&Ce.push(239,191,189);if(Be=null,O<128){if((Y-=1)<0)break;Ce.push(O)}else if(O<2048){if((Y-=2)<0)break;Ce.push(O>>6|192,O&63|128)}else if(O<65536){if((Y-=3)<0)break;Ce.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((Y-=4)<0)break;Ce.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return Ce}function oe(z){for(var Y=[],O=0;O<z.length;++O)Y.push(z.charCodeAt(O)&255);return Y}function se(z,Y){for(var O,Z,Be,Ce=[],Ie=0;Ie<z.length&&!((Y-=2)<0);++Ie)O=z.charCodeAt(Ie),Z=O>>8,Be=O%256,Ce.push(Be),Ce.push(Z);return Ce}function ne(z){return e.toByteArray(j(z))}function le(z,Y,O,Z){for(var Be=0;Be<Z&&!(Be+O>=Y.length||Be>=z.length);++Be)Y[Be+O]=z[Be];return Be}function Fe(z,Y){return z instanceof Y||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===Y.name}function W(z){return z!==z}var xe=function(){for(var z="0123456789abcdef",Y=new Array(256),O=0;O<16;++O)for(var Z=O*16,Be=0;Be<16;++Be)Y[Z+Be]=z[O]+z[Be];return Y}()}(MT)),MT}var QT={},CT={},ST,$ee;function ete(){return $ee||($ee=1,ST=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var A=Object.getOwnPropertyDescriptor(e,t);if(A.value!==i||A.enumerable!==!0)return!1}return!0}),ST}var FT,tte;function TT(){if(tte)return FT;tte=1;var r=ete();return FT=function(){return r()&&!!Symbol.toStringTag},FT}var RT,rte;function nte(){return rte||(rte=1,RT=Object),RT}var bT,ite;function DPe(){return ite||(ite=1,bT=Error),bT}var DT,ate;function NPe(){return ate||(ate=1,DT=EvalError),DT}var NT,ote;function UPe(){return ote||(ote=1,NT=RangeError),NT}var UT,Ate;function _Pe(){return Ate||(Ate=1,UT=ReferenceError),UT}var _T,ste;function lte(){return ste||(ste=1,_T=SyntaxError),_T}var kT,cte;function o8(){return cte||(cte=1,kT=TypeError),kT}var YT,ute;function kPe(){return ute||(ute=1,YT=URIError),YT}var PT,hte;function YPe(){return hte||(hte=1,PT=Math.abs),PT}var OT,fte;function PPe(){return fte||(fte=1,OT=Math.floor),OT}var LT,gte;function OPe(){return gte||(gte=1,LT=Math.max),LT}var GT,dte;function LPe(){return dte||(dte=1,GT=Math.min),GT}var zT,pte;function GPe(){return pte||(pte=1,zT=Math.pow),zT}var HT,vte;function zPe(){return vte||(vte=1,HT=Math.round),HT}var jT,Bte;function HPe(){return Bte||(Bte=1,jT=Number.isNaN||function(e){return e!==e}),jT}var VT,Ete;function jPe(){if(Ete)return VT;Ete=1;var r=HPe();return VT=function(t){return r(t)||t===0?t:t<0?-1:1},VT}var JT,mte;function VPe(){return mte||(mte=1,JT=Object.getOwnPropertyDescriptor),JT}var KT,yte;function gE(){if(yte)return KT;yte=1;var r=VPe();if(r)try{r([],"length")}catch{r=null}return KT=r,KT}var WT,wte;function A8(){if(wte)return WT;wte=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return WT=r,WT}var XT,Ite;function JPe(){if(Ite)return XT;Ite=1;var r=typeof Symbol<"u"&&Symbol,e=ete();return XT=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},XT}var ZT,xte;function Mte(){return xte||(xte=1,ZT=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),ZT}var qT,Qte;function Cte(){if(Qte)return qT;Qte=1;var r=nte();return qT=r.getPrototypeOf||null,qT}var $T,Ste;function KPe(){if(Ste)return $T;Ste=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(s,l){for(var c=[],u=0;u<s.length;u+=1)c[u]=s[u];for(var f=0;f<l.length;f+=1)c[f+s.length]=l[f];return c},a=function(s,l){for(var c=[],u=l,f=0;u<s.length;u+=1,f+=1)c[f]=s[u];return c},o=function(A,s){for(var l="",c=0;c<A.length;c+=1)l+=A[c],c+1<A.length&&(l+=s);return l};return $T=function(s){var l=this;if(typeof l!="function"||e.apply(l)!==n)throw new TypeError(r+l);for(var c=a(arguments,1),u,f=function(){if(this instanceof u){var p=l.apply(this,i(c,arguments));return Object(p)===p?p:this}return l.apply(s,i(c,arguments))},h=t(0,l.length-c.length),g=[],d=0;d<h;d++)g[d]="$"+d;if(u=Function("binder","return function ("+o(g,",")+"){ return binder.apply(this,arguments); }")(f),l.prototype){var v=function(){};v.prototype=l.prototype,u.prototype=new v,v.prototype=null}return u},$T}var eR,Fte;function dE(){if(Fte)return eR;Fte=1;var r=KPe();return eR=Function.prototype.bind||r,eR}var tR,Tte;function rR(){return Tte||(Tte=1,tR=Function.prototype.call),tR}var nR,Rte;function iR(){return Rte||(Rte=1,nR=Function.prototype.apply),nR}var aR,bte;function WPe(){return bte||(bte=1,aR=typeof Reflect<"u"&&Reflect&&Reflect.apply),aR}var oR,Dte;function Nte(){if(Dte)return oR;Dte=1;var r=dE(),e=iR(),t=rR(),n=WPe();return oR=n||r.call(t,e),oR}var AR,Ute;function sR(){if(Ute)return AR;Ute=1;var r=dE(),e=o8(),t=rR(),n=Nte();return AR=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},AR}var lR,_te;function XPe(){if(_te)return lR;_te=1;var r=sR(),e=gE(),t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return lR=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(A){return a(A==null?A:i(A))}:!1,lR}var cR,kte;function Yte(){if(kte)return cR;kte=1;var r=Mte(),e=Cte(),t=XPe();return cR=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,cR}var uR,Pte;function ZPe(){if(Pte)return uR;Pte=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=dE();return uR=t.call(r,e),uR}var hR,Ote;function Lte(){if(Ote)return hR;Ote=1;var r,e=nte(),t=DPe(),n=NPe(),i=UPe(),a=_Pe(),o=lte(),A=o8(),s=kPe(),l=YPe(),c=PPe(),u=OPe(),f=LPe(),h=GPe(),g=zPe(),d=jPe(),v=Function,p=function(oe){try{return v('"use strict"; return ('+oe+").constructor;")()}catch{}},B=gE(),E=A8(),m=function(){throw new A},y=B?function(){try{return arguments.callee,m}catch{try{return B(arguments,"callee").get}catch{return m}}}():m,w=JPe()(),I=Yte(),Q=Cte(),x=Mte(),U=iR(),b=rR(),C={},D=typeof Uint8Array>"u"||!I?r:I(Uint8Array),F={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":w&&I?I([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&I?I(I([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!w||!I?r:I(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":B,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!w||!I?r:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&I?I(""[Symbol.iterator]()):r,"%Symbol%":w?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":y,"%TypedArray%":D,"%TypeError%":A,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":b,"%Function.prototype.apply%":U,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":Q,"%Math.abs%":l,"%Math.floor%":c,"%Math.max%":u,"%Math.min%":f,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":d,"%Reflect.getPrototypeOf%":x};if(I)try{null.error}catch(oe){var H=I(I(oe));F["%Error.prototype%"]=H}var X=function oe(se){var ne;if(se==="%AsyncFunction%")ne=p("async function () {}");else if(se==="%GeneratorFunction%")ne=p("function* () {}");else if(se==="%AsyncGeneratorFunction%")ne=p("async function* () {}");else if(se==="%AsyncGenerator%"){var le=oe("%AsyncGeneratorFunction%");le&&(ne=le.prototype)}else if(se==="%AsyncIteratorPrototype%"){var Fe=oe("%AsyncGenerator%");Fe&&I&&(ne=I(Fe.prototype))}return F[se]=ne,ne},q={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},re=dE(),ie=ZPe(),ge=re.call(b,Array.prototype.concat),he=re.call(U,Array.prototype.splice),R=re.call(b,String.prototype.replace),V=re.call(b,String.prototype.slice),J=re.call(b,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ae=/\\(\\)?/g,j=function(se){var ne=V(se,0,1),le=V(se,-1);if(ne==="%"&&le!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(le==="%"&&ne!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Fe=[];return R(se,ee,function(W,xe,z,Y){Fe[Fe.length]=z?R(Y,ae,"$1"):xe||W}),Fe},G=function(se,ne){var le=se,Fe;if(ie(q,le)&&(Fe=q[le],le="%"+Fe[0]+"%"),ie(F,le)){var W=F[le];if(W===C&&(W=X(le)),typeof W>"u"&&!ne)throw new A("intrinsic "+se+" exists, but is not available. Please file an issue!");return{alias:Fe,name:le,value:W}}throw new o("intrinsic "+se+" does not exist!")};return hR=function(se,ne){if(typeof se!="string"||se.length===0)throw new A("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ne!="boolean")throw new A('"allowMissing" argument must be a boolean');if(J(/^%?[^%]*%?$/,se)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var le=j(se),Fe=le.length>0?le[0]:"",W=G("%"+Fe+"%",ne),xe=W.name,z=W.value,Y=!1,O=W.alias;O&&(Fe=O[0],he(le,ge([0,1],O)));for(var Z=1,Be=!0;Z<le.length;Z+=1){var Ce=le[Z],Ie=V(Ce,0,1),je=V(Ce,-1);if((Ie==='"'||Ie==="'"||Ie==="`"||je==='"'||je==="'"||je==="`")&&Ie!==je)throw new o("property names with quotes must have matching quotes");if((Ce==="constructor"||!Be)&&(Y=!0),Fe+="."+Ce,xe="%"+Fe+"%",ie(F,xe))z=F[xe];else if(z!=null){if(!(Ce in z)){if(!ne)throw new A("base intrinsic for "+se+" exists, but the property is not available.");return}if(B&&Z+1>=le.length){var qe=B(z,Ce);Be=!!qe,Be&&"get"in qe&&!("originalValue"in qe.get)?z=qe.get:z=z[Ce]}else Be=ie(z,Ce),z=z[Ce];Be&&!Y&&(F[xe]=z)}}return z},hR}var fR,Gte;function zte(){if(Gte)return fR;Gte=1;var r=Lte(),e=sR(),t=e([r("%String.prototype.indexOf%")]);return fR=function(i,a){var o=r(i,!!a);return typeof o=="function"&&t(i,".prototype.")>-1?e([o]):o},fR}var gR,Hte;function qPe(){if(Hte)return gR;Hte=1;var r=TT()(),e=zte(),t=e("Object.prototype.toString"),n=function(A){return r&&A&&typeof A=="object"&&Symbol.toStringTag in A?!1:t(A)==="[object Arguments]"},i=function(A){return n(A)?!0:A!==null&&typeof A=="object"&&"length"in A&&typeof A.length=="number"&&A.length>=0&&t(A)!=="[object Array]"&&"callee"in A&&t(A.callee)==="[object Function]"},a=function(){return n(arguments)}();return n.isLegacyArguments=i,gR=a?n:i,gR}var dR,jte;function $Pe(){if(jte)return dR;jte=1;var r=Object.prototype.toString,e=Function.prototype.toString,t=/^\s*(?:function)?\*/,n=TT()(),i=Object.getPrototypeOf,a=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},o;return dR=function(s){if(typeof s!="function")return!1;if(t.test(e.call(s)))return!0;if(!n){var l=r.call(s);return l==="[object GeneratorFunction]"}if(!i)return!1;if(typeof o>"u"){var c=a();o=c?i(c):!1}return i(s)===o},dR}var pR,Vte;function eOe(){if(Vte)return pR;Vte=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,t)}catch(B){B!==n&&(e=null)}else e=null;var i=/^\s*class\b/,a=function(E){try{var m=r.call(E);return i.test(m)}catch{return!1}},o=function(E){try{return a(E)?!1:(r.call(E),!0)}catch{return!1}},A=Object.prototype.toString,s="[object Object]",l="[object Function]",c="[object GeneratorFunction]",u="[object HTMLAllCollection]",f="[object HTML document.all class]",h="[object HTMLCollection]",g=typeof Symbol=="function"&&!!Symbol.toStringTag,d=!(0 in[,]),v=function(){return!1};if(typeof document=="object"){var p=document.all;A.call(p)===A.call(document.all)&&(v=function(E){if((d||!E)&&(typeof E>"u"||typeof E=="object"))try{var m=A.call(E);return(m===u||m===f||m===h||m===s)&&E("")==null}catch{}return!1})}return pR=e?function(E){if(v(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{e(E,null,t)}catch(m){if(m!==n)return!1}return!a(E)&&o(E)}:function(E){if(v(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(g)return o(E);if(a(E))return!1;var m=A.call(E);return m!==l&&m!==c&&!/^\[object HTML/.test(m)?!1:o(E)},pR}var vR,Jte;function tOe(){if(Jte)return vR;Jte=1;var r=eOe(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(s,l,c){for(var u=0,f=s.length;u<f;u++)t.call(s,u)&&(c==null?l(s[u],u,s):l.call(c,s[u],u,s))},i=function(s,l,c){for(var u=0,f=s.length;u<f;u++)c==null?l(s.charAt(u),u,s):l.call(c,s.charAt(u),u,s)},a=function(s,l,c){for(var u in s)t.call(s,u)&&(c==null?l(s[u],u,s):l.call(c,s[u],u,s))};function o(A){return e.call(A)==="[object Array]"}return vR=function(s,l,c){if(!r(l))throw new TypeError("iterator must be a function");var u;arguments.length>=3&&(u=c),o(s)?n(s,l,u):typeof s=="string"?i(s,l,u):a(s,l,u)},vR}var BR,Kte;function rOe(){return Kte||(Kte=1,BR=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),BR}var ER,Wte;function nOe(){if(Wte)return ER;Wte=1;var r=rOe(),e=typeof globalThis>"u"?M0:globalThis;return ER=function(){for(var n=[],i=0;i<r.length;i++)typeof e[r[i]]=="function"&&(n[n.length]=r[i]);return n},ER}var mR={exports:{}},yR,Xte;function iOe(){if(Xte)return yR;Xte=1;var r=A8(),e=lte(),t=o8(),n=gE();return yR=function(a,o,A){if(!a||typeof a!="object"&&typeof a!="function")throw new t("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,f=!!n&&n(a,o);if(r)r(a,o,{configurable:c===null&&f?f.configurable:!c,enumerable:s===null&&f?f.enumerable:!s,value:A,writable:l===null&&f?f.writable:!l});else if(u||!s&&!l&&!c)a[o]=A;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},yR}var wR,Zte;function aOe(){if(Zte)return wR;Zte=1;var r=A8(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},wR=e,wR}var IR,qte;function oOe(){if(qte)return IR;qte=1;var r=Lte(),e=iOe(),t=aOe()(),n=gE(),i=o8(),a=r("%Math.floor%");return IR=function(A,s){if(typeof A!="function")throw new i("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||a(s)!==s)throw new i("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],c=!0,u=!0;if("length"in A&&n){var f=n(A,"length");f&&!f.configurable&&(c=!1),f&&!f.writable&&(u=!1)}return(c||u||!l)&&(t?e(A,"length",s,!0,!0):e(A,"length",s)),A},IR}var xR,$te;function AOe(){if($te)return xR;$te=1;var r=dE(),e=iR(),t=Nte();return xR=function(){return t(r,e,arguments)},xR}var ere;function sOe(){return ere||(ere=1,function(r){var e=oOe(),t=A8(),n=sR(),i=AOe();r.exports=function(o){var A=n(arguments),s=o.length-(arguments.length-1);return e(A,1+(s>0?s:0),!0)},t?t(r.exports,"apply",{value:i}):r.exports.apply=i}(mR)),mR.exports}var MR,tre;function rre(){if(tre)return MR;tre=1;var r=tOe(),e=nOe(),t=sOe(),n=zte(),i=gE(),a=Yte(),o=n("Object.prototype.toString"),A=TT()(),s=typeof globalThis>"u"?M0:globalThis,l=e(),c=n("String.prototype.slice"),u=n("Array.prototype.indexOf",!0)||function(v,p){for(var B=0;B<v.length;B+=1)if(v[B]===p)return B;return-1},f={__proto__:null};A&&i&&a?r(l,function(d){var v=new s[d];if(Symbol.toStringTag in v&&a){var p=a(v),B=i(p,Symbol.toStringTag);if(!B&&p){var E=a(p);B=i(E,Symbol.toStringTag)}f["$"+d]=t(B.get)}}):r(l,function(d){var v=new s[d],p=v.slice||v.set;p&&(f["$"+d]=t(p))});var h=function(v){var p=!1;return r(f,function(B,E){if(!p)try{"$"+B(v)===E&&(p=c(E,1))}catch{}}),p},g=function(v){var p=!1;return r(f,function(B,E){if(!p)try{B(v),p=c(E,1)}catch{}}),p};return MR=function(v){if(!v||typeof v!="object")return!1;if(!A){var p=c(o(v),8,-1);return u(l,p)>-1?p:p!=="Object"?!1:g(v)}return i?h(v):null},MR}var QR,nre;function lOe(){if(nre)return QR;nre=1;var r=rre();return QR=function(t){return!!r(t)},QR}var ire;function cOe(){return ire||(ire=1,function(r){var e=qPe(),t=$Pe(),n=rre(),i=lOe();function a(Z){return Z.call.bind(Z)}var o=typeof BigInt<"u",A=typeof Symbol<"u",s=a(Object.prototype.toString),l=a(Number.prototype.valueOf),c=a(String.prototype.valueOf),u=a(Boolean.prototype.valueOf);if(o)var f=a(BigInt.prototype.valueOf);if(A)var h=a(Symbol.prototype.valueOf);function g(Z,Be){if(typeof Z!="object")return!1;try{return Be(Z),!0}catch{return!1}}r.isArgumentsObject=e,r.isGeneratorFunction=t,r.isTypedArray=i;function d(Z){return typeof Promise<"u"&&Z instanceof Promise||Z!==null&&typeof Z=="object"&&typeof Z.then=="function"&&typeof Z.catch=="function"}r.isPromise=d;function v(Z){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Z):i(Z)||V(Z)}r.isArrayBufferView=v;function p(Z){return n(Z)==="Uint8Array"}r.isUint8Array=p;function B(Z){return n(Z)==="Uint8ClampedArray"}r.isUint8ClampedArray=B;function E(Z){return n(Z)==="Uint16Array"}r.isUint16Array=E;function m(Z){return n(Z)==="Uint32Array"}r.isUint32Array=m;function y(Z){return n(Z)==="Int8Array"}r.isInt8Array=y;function w(Z){return n(Z)==="Int16Array"}r.isInt16Array=w;function I(Z){return n(Z)==="Int32Array"}r.isInt32Array=I;function Q(Z){return n(Z)==="Float32Array"}r.isFloat32Array=Q;function x(Z){return n(Z)==="Float64Array"}r.isFloat64Array=x;function U(Z){return n(Z)==="BigInt64Array"}r.isBigInt64Array=U;function b(Z){return n(Z)==="BigUint64Array"}r.isBigUint64Array=b;function C(Z){return s(Z)==="[object Map]"}C.working=typeof Map<"u"&&C(new Map);function D(Z){return typeof Map>"u"?!1:C.working?C(Z):Z instanceof Map}r.isMap=D;function F(Z){return s(Z)==="[object Set]"}F.working=typeof Set<"u"&&F(new Set);function H(Z){return typeof Set>"u"?!1:F.working?F(Z):Z instanceof Set}r.isSet=H;function X(Z){return s(Z)==="[object WeakMap]"}X.working=typeof WeakMap<"u"&&X(new WeakMap);function q(Z){return typeof WeakMap>"u"?!1:X.working?X(Z):Z instanceof WeakMap}r.isWeakMap=q;function re(Z){return s(Z)==="[object WeakSet]"}re.working=typeof WeakSet<"u"&&re(new WeakSet);function ie(Z){return re(Z)}r.isWeakSet=ie;function ge(Z){return s(Z)==="[object ArrayBuffer]"}ge.working=typeof ArrayBuffer<"u"&&ge(new ArrayBuffer);function he(Z){return typeof ArrayBuffer>"u"?!1:ge.working?ge(Z):Z instanceof ArrayBuffer}r.isArrayBuffer=he;function R(Z){return s(Z)==="[object DataView]"}R.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&R(new DataView(new ArrayBuffer(1),0,1));function V(Z){return typeof DataView>"u"?!1:R.working?R(Z):Z instanceof DataView}r.isDataView=V;var J=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ee(Z){return s(Z)==="[object SharedArrayBuffer]"}function ae(Z){return typeof J>"u"?!1:(typeof ee.working>"u"&&(ee.working=ee(new J)),ee.working?ee(Z):Z instanceof J)}r.isSharedArrayBuffer=ae;function j(Z){return s(Z)==="[object AsyncFunction]"}r.isAsyncFunction=j;function G(Z){return s(Z)==="[object Map Iterator]"}r.isMapIterator=G;function oe(Z){return s(Z)==="[object Set Iterator]"}r.isSetIterator=oe;function se(Z){return s(Z)==="[object Generator]"}r.isGeneratorObject=se;function ne(Z){return s(Z)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=ne;function le(Z){return g(Z,l)}r.isNumberObject=le;function Fe(Z){return g(Z,c)}r.isStringObject=Fe;function W(Z){return g(Z,u)}r.isBooleanObject=W;function xe(Z){return o&&g(Z,f)}r.isBigIntObject=xe;function z(Z){return A&&g(Z,h)}r.isSymbolObject=z;function Y(Z){return le(Z)||Fe(Z)||W(Z)||xe(Z)||z(Z)}r.isBoxedPrimitive=Y;function O(Z){return typeof Uint8Array<"u"&&(he(Z)||ae(Z))}r.isAnyArrayBuffer=O,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Z){Object.defineProperty(r,Z,{enumerable:!1,value:function(){throw new Error(Z+" is not supported in userland")}})})}(CT)),CT}var CR,are;function uOe(){return are||(are=1,CR=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),CR}var ore;function Are(){return ore||(ore=1,function(r){var e=Object.getOwnPropertyDescriptors||function(V){for(var J=Object.keys(V),ee={},ae=0;ae<J.length;ae++)ee[J[ae]]=Object.getOwnPropertyDescriptor(V,J[ae]);return ee},t=/%[sdj%]/g;r.format=function(R){if(!y(R)){for(var V=[],J=0;J<arguments.length;J++)V.push(o(arguments[J]));return V.join(" ")}for(var J=1,ee=arguments,ae=ee.length,j=String(R).replace(t,function(oe){if(oe==="%%")return"%";if(J>=ae)return oe;switch(oe){case"%s":return String(ee[J++]);case"%d":return Number(ee[J++]);case"%j":try{return JSON.stringify(ee[J++])}catch{return"[Circular]"}default:return oe}}),G=ee[J];J<ae;G=ee[++J])B(G)||!x(G)?j+=" "+G:j+=" "+o(G);return j},r.deprecate=function(R,V){if(typeof Hn<"u"&&Hn.noDeprecation===!0)return R;if(typeof Hn>"u")return function(){return r.deprecate(R,V).apply(this,arguments)};var J=!1;function ee(){if(!J){if(Hn.throwDeprecation)throw new Error(V);Hn.traceDeprecation?console.trace(V):console.error(V),J=!0}return R.apply(this,arguments)}return ee};var n={},i=/^$/;if(Hn.env.NODE_DEBUG){var a=Hn.env.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+a+"$","i")}r.debuglog=function(R){if(R=R.toUpperCase(),!n[R])if(i.test(R)){var V=Hn.pid;n[R]=function(){var J=r.format.apply(r,arguments);console.error("%s %d: %s",R,V,J)}}else n[R]=function(){};return n[R]};function o(R,V){var J={seen:[],stylize:s};return arguments.length>=3&&(J.depth=arguments[2]),arguments.length>=4&&(J.colors=arguments[3]),p(V)?J.showHidden=V:V&&r._extend(J,V),I(J.showHidden)&&(J.showHidden=!1),I(J.depth)&&(J.depth=2),I(J.colors)&&(J.colors=!1),I(J.customInspect)&&(J.customInspect=!0),J.colors&&(J.stylize=A),c(J,R,J.depth)}r.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function A(R,V){var J=o.styles[V];return J?"\x1B["+o.colors[J][0]+"m"+R+"\x1B["+o.colors[J][1]+"m":R}function s(R,V){return R}function l(R){var V={};return R.forEach(function(J,ee){V[J]=!0}),V}function c(R,V,J){if(R.customInspect&&V&&C(V.inspect)&&V.inspect!==r.inspect&&!(V.constructor&&V.constructor.prototype===V)){var ee=V.inspect(J,R);return y(ee)||(ee=c(R,ee,J)),ee}var ae=u(R,V);if(ae)return ae;var j=Object.keys(V),G=l(j);if(R.showHidden&&(j=Object.getOwnPropertyNames(V)),b(V)&&(j.indexOf("message")>=0||j.indexOf("description")>=0))return f(V);if(j.length===0){if(C(V)){var oe=V.name?": "+V.name:"";return R.stylize("[Function"+oe+"]","special")}if(Q(V))return R.stylize(RegExp.prototype.toString.call(V),"regexp");if(U(V))return R.stylize(Date.prototype.toString.call(V),"date");if(b(V))return f(V)}var se="",ne=!1,le=["{","}"];if(v(V)&&(ne=!0,le=["[","]"]),C(V)){var Fe=V.name?": "+V.name:"";se=" [Function"+Fe+"]"}if(Q(V)&&(se=" "+RegExp.prototype.toString.call(V)),U(V)&&(se=" "+Date.prototype.toUTCString.call(V)),b(V)&&(se=" "+f(V)),j.length===0&&(!ne||V.length==0))return le[0]+se+le[1];if(J<0)return Q(V)?R.stylize(RegExp.prototype.toString.call(V),"regexp"):R.stylize("[Object]","special");R.seen.push(V);var W;return ne?W=h(R,V,J,G,j):W=j.map(function(xe){return g(R,V,J,G,xe,ne)}),R.seen.pop(),d(W,se,le)}function u(R,V){if(I(V))return R.stylize("undefined","undefined");if(y(V)){var J="'"+JSON.stringify(V).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return R.stylize(J,"string")}if(m(V))return R.stylize(""+V,"number");if(p(V))return R.stylize(""+V,"boolean");if(B(V))return R.stylize("null","null")}function f(R){return"["+Error.prototype.toString.call(R)+"]"}function h(R,V,J,ee,ae){for(var j=[],G=0,oe=V.length;G<oe;++G)re(V,String(G))?j.push(g(R,V,J,ee,String(G),!0)):j.push("");return ae.forEach(function(se){se.match(/^\d+$/)||j.push(g(R,V,J,ee,se,!0))}),j}function g(R,V,J,ee,ae,j){var G,oe,se;if(se=Object.getOwnPropertyDescriptor(V,ae)||{value:V[ae]},se.get?se.set?oe=R.stylize("[Getter/Setter]","special"):oe=R.stylize("[Getter]","special"):se.set&&(oe=R.stylize("[Setter]","special")),re(ee,ae)||(G="["+ae+"]"),oe||(R.seen.indexOf(se.value)<0?(B(J)?oe=c(R,se.value,null):oe=c(R,se.value,J-1),oe.indexOf(`
|
|
184
|
+
`):p[0]??0,s=[...new Set(a.map(p=>p[i.columnField]))].map(String).sort(),l=i.showTotals?[...s,i.totalsLabel||"Total"]:s,c=new Map,u=[];for(const p of a){const B=i.rowFields.map(E=>String(p[E.binding]??"")).join("|||");c.has(B)||(c.set(B,[]),u.push(i.rowFields.map(E=>String(p[E.binding]??"")))),c.get(B).push(p)}const f=[],h=[],g=Array.from(c.keys());for(let p=0;p<u.length;p++){const B=g[p],E=c.get(B)||[],m=[],y=new Array(i.valueFields.length).fill(0);for(const w of s){const I=E.filter(U=>String(U[i.columnField])===w),Q=I.length>0?I:E.filter(()=>!1),x=i.valueFields.map((U,b)=>{const C=Q.map(F=>Number(F[U.binding])||0),D=t(C,U.aggregation);return y[b]+=D,D});m.push({value:A(x)})}i.showTotals&&m.push({value:A(y),isTotal:!0}),h.push({value:A(y)}),f.push(m)}const d=[],v=new Array(i.valueFields.length).fill(0);for(let p=0;p<s.length;p++){const B=new Array(i.valueFields.length).fill(0);for(let E=0;E<u.length;E++){const m=g[E],y=c.get(m)||[],w=y.filter(Q=>String(Q[i.columnField])===s[p]),I=w.length>0?w:y.filter(()=>!1);i.valueFields.forEach((Q,x)=>{const U=I.map(C=>Number(C[Q.binding])||0),b=t(U,Q.aggregation);B[x]+=b})}B.forEach((E,m)=>v[m]+=E),d.push({value:A(B)})}return i.showTotals&&d.push({value:A(v),isTotal:!0}),{rowHeaders:u,colHeaders:l,cells:f,rowTotals:h,colTotals:d,grandTotal:{value:A(v)}}});return(i,a)=>(L.openBlock(),L.createElementBlock("table",qYe,[L.createElementVNode("thead",null,[L.createElementVNode("tr",null,[(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(i.config.rowFields,(o,A)=>(L.openBlock(),L.createElementBlock("th",{key:"rh-"+A,class:"crosstab-row-header"},L.toDisplayString(o.label),1))),128)),(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(n.value.colHeaders,(o,A)=>(L.openBlock(),L.createElementBlock("th",{key:"ch-"+A,class:"crosstab-col-header"},L.toDisplayString(o),1))),128))])]),L.createElementVNode("tbody",null,[(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(n.value.cells,(o,A)=>(L.openBlock(),L.createElementBlock("tr",{key:"r-"+A},[(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(n.value.rowHeaders[A]||[],(s,l)=>(L.openBlock(),L.createElementBlock("td",{key:"rh-"+A+"-"+l,class:"crosstab-row-cell"},L.toDisplayString(s),1))),128)),(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(o,(s,l)=>(L.openBlock(),L.createElementBlock("td",{key:"c-"+A+"-"+l,class:L.normalizeClass({"crosstab-total":s.isTotal})},[L.createElementVNode("span",$Ye,L.toDisplayString(s.value),1)],2))),128))]))),128)),i.config.showTotals||i.config.showGrandTotals?(L.openBlock(),L.createElementBlock("tr",ePe,[(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(i.config.rowFields,(o,A)=>(L.openBlock(),L.createElementBlock("td",{key:"ft-"+A,class:"crosstab-row-cell crosstab-total-label"},L.toDisplayString(A===0?i.config.totalsLabel||"Total":""),1))),128)),(L.openBlock(!0),L.createElementBlock(L.Fragment,null,L.renderList(n.value.colTotals,(o,A)=>(L.openBlock(),L.createElementBlock("td",{key:"fc-"+A,class:"crosstab-total"},[L.createElementVNode("span",tPe,L.toDisplayString(o.value),1)]))),128))])):L.createCommentVNode("",!0)])]))}}),[["styles",[".nexa-crosstab[data-v-7dd0c592]{width:100%;border-collapse:collapse;font-size:inherit;table-layout:fixed}.nexa-crosstab th[data-v-7dd0c592],.nexa-crosstab td[data-v-7dd0c592]{border:1px solid #d1d5db;padding:4px 8px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-word}.nexa-crosstab th[data-v-7dd0c592]{background:#f3f4f6;font-weight:700;border-bottom:2px solid #9ca3af;white-space:nowrap}.crosstab-row-header[data-v-7dd0c592]{background:#fafafa;font-weight:600}.crosstab-col-header[data-v-7dd0c592]{text-align:center}.crosstab-cell-value[data-v-7dd0c592]{white-space:pre-line}.crosstab-total[data-v-7dd0c592]{background:#e8f4fd!important;font-weight:700}.crosstab-total-label[data-v-7dd0c592]{font-weight:700;background:#f3f4f6}.crosstab-totals-row td[data-v-7dd0c592]{font-weight:700;background:#f3f4f6;border-top:2px solid #9ca3af}"]],["__scopeId","data-v-7dd0c592"]]),nPe={class:"nexa-widget-content-root"},iPe={key:0,class:"nexa-indicator-box"},aPe={key:0,class:"nexa-ind-pre"},oPe={key:1,class:"nexa-ind-suf"},APe={class:"nexa-ind-label"},sPe={key:2,class:"nexa-widget-fallback"},lPe=$w(L.defineComponent({__name:"DashboardWidgetRenderer",props:{widget:{type:Object},data:{type:Array}},setup(r,{expose:e}){const t=r,n=L.ref(null);let i=null;const a=L.computed(()=>t.widget.type==="Chart"||t.widget.type==="Gauge"),o=L.computed(()=>{var u;const{type:s,config:l}=t.widget,c=t.data||[];if(s==="Chart"){const f=l.chartType||"bar",h=["#6366f1","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#ec4899"];if(f==="pie"||f==="doughnut")return{color:h,tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)"},legend:{bottom:5,left:"center",itemWidth:10,itemHeight:10,textStyle:{fontSize:10}},series:[{type:"pie",radius:f==="doughnut"?["45%","75%"]:"75%",center:["50%","45%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:6,borderColor:"#fff",borderWidth:2},label:{show:!1},emphasis:{label:{show:!0,fontWeight:"bold"}},data:c.map(v=>({name:String(v[l.argumentField]||""),value:Number(v[l.valueField])||0}))}]};const g=c.map(v=>String(v[l.argumentField]||"")),d=c.map(v=>Number(v[l.valueField])||0);return{color:h,grid:{top:20,right:10,bottom:40,left:40,containLabel:!0},tooltip:{trigger:"axis"},xAxis:{type:"category",data:g,axisLabel:{fontSize:10}},yAxis:{type:"value",axisLabel:{fontSize:10}},series:[{data:d,type:f==="area"?"line":f,smooth:!0,areaStyle:f==="area"?{opacity:.3}:void 0,itemStyle:{borderRadius:[4,4,0,0]}}]}}else if(s==="Gauge"){const f=Number((u=c[0])==null?void 0:u[l.valueField])||0;return{series:[{type:"gauge",startAngle:180,endAngle:0,center:["50%","75%"],radius:"100%",min:l.min||0,max:l.max||100,progress:{show:!0,width:12,itemStyle:{color:"#6366f1"}},axisLine:{lineStyle:{width:12,color:[[1,"#e2e8f0"]]}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},pointer:{show:!0,length:"60%",width:4,itemStyle:{color:"#475569"}},detail:{valueAnimation:!0,formatter:"{value}",offsetCenter:[0,"15%"],fontSize:20,fontWeight:"bold",color:"#1e293b"},data:[{value:f}]}]}}return{}});function A(){!n.value||!a.value||(i&&i.dispose(),i=fQ(n.value),i.setOption(o.value))}return L.onMounted(()=>{a.value&&A()}),L.watch(()=>t.widget,()=>{a.value&&A()},{deep:!0}),L.watch(()=>t.data,()=>{i&&i.setOption(o.value)},{deep:!0}),e({resize:()=>i==null?void 0:i.resize()}),(s,l)=>{var c;return L.openBlock(),L.createElementBlock("div",nPe,[s.widget.type==="Indicator"?(L.openBlock(),L.createElementBlock("div",iPe,[L.createElementVNode("div",{class:"nexa-ind-value",style:L.normalizeStyle({color:s.widget.config.color||"#3b82f6"})},[s.widget.config.prefix?(L.openBlock(),L.createElementBlock("span",aPe,L.toDisplayString(s.widget.config.prefix),1)):L.createCommentVNode("",!0),L.createTextVNode(" "+L.toDisplayString(((c=s.data[0])==null?void 0:c[s.widget.config.valueField])||"0")+" ",1),s.widget.config.suffix?(L.openBlock(),L.createElementBlock("span",oPe,L.toDisplayString(s.widget.config.suffix),1)):L.createCommentVNode("",!0)],4),L.createElementVNode("div",APe,L.toDisplayString(s.widget.config.label||"Métrica"),1)])):a.value?(L.openBlock(),L.createElementBlock("div",{key:1,ref_key:"chartContainerRef",ref:n,class:"nexa-widget-chart-container"},null,512)):(L.openBlock(),L.createElementBlock("div",sPe,[l[0]||(l[0]=L.createElementVNode("i",{class:"pi pi-box mb-2"},null,-1)),L.createElementVNode("span",null,L.toDisplayString(s.widget.type),1)]))])}}}),[["styles",[".nexa-widget-content-root[data-v-8181effa]{width:100%;height:100%;display:flex;flex-direction:column;overflow:hidden}.nexa-indicator-box[data-v-8181effa]{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.nexa-ind-value[data-v-8181effa]{font-size:2.2rem;font-weight:800;line-height:1;margin-bottom:4px}.nexa-ind-pre[data-v-8181effa],.nexa-ind-suf[data-v-8181effa]{font-size:1rem;font-weight:600;opacity:.6}.nexa-ind-label[data-v-8181effa]{font-size:.75rem;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.05em}.nexa-widget-chart-container[data-v-8181effa]{flex:1;width:100%;height:100%}.nexa-widget-fallback[data-v-8181effa]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#94a3b8;font-size:.8rem}"]],["__scopeId","data-v-8181effa"]]);function vT(r,e){return e.reduce((t,n)=>t+(Number(sl(r,n))||0),0)}function Yee(r,e){return!r||r==="*"?e.length:e.filter(t=>sl(r,t)!==null&&sl(r,t)!==void 0).length}function cPe(r,e){const t=Yee(r,e);return t===0?0:vT(r,e)/t}function uPe(r,e){const t=e.map(n=>Number(sl(r,n))).filter(n=>!isNaN(n));return t.length===0?0:Math.min(...t)}function hPe(r,e){const t=e.map(n=>Number(sl(r,n))).filter(n=>!isNaN(n));return t.length===0?0:Math.max(...t)}function fPe(r,e){return e.length>0?sl(r,e[0]):null}function gPe(r,e){return e.length>0?sl(r,e[e.length-1]):null}function sl(r,e){return e?r.split(".").reduce((t,n)=>t==null?void 0:t[n.trim()],e):null}function ll(r){const e=Number(r);return isNaN(e)?0:e}function is(r){return r==null?"":String(r)}function Pee(r){const e=r.trim();return/^-?\d+(\.\d+)?$/.test(e)}function dPe(r){if(r==null)return"null";if(typeof r=="number")return isFinite(r)?String(r):"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return Pee(r)?r.trim():`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;const e=Number(r);if(Number.isFinite(e))return String(e);const t=String(r);return Pee(t)?t.trim():`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function pPe(r,e,t){let n="",i=0,a=!1,o="";const A=l=>/[A-Za-z_]/.test(l),s=l=>/[A-Za-z0-9_.]/.test(l);for(;i<r.length;){const l=r[i];if(a){if(n+=l,l==="\\"&&i+1<r.length){n+=r[i+1],i+=2;continue}l===o&&(a=!1,o=""),i++;continue}if(l==='"'||l==="'"){a=!0,o=l,n+=l,i++;continue}if(!A(l)){n+=l,i++;continue}const c=i;for(i++;i<r.length&&s(r[i]);)i++;const u=r.slice(c,i),f=u.toLowerCase();let h=i;for(;h<r.length&&/\s/.test(r[h]);)h++;if((h<r.length?r[h]:"")==="("||t.has(f)){n+=u;continue}const d=sl(u,e);if(d==null){n+=u;continue}n+=dPe(d)}return n}function gp(r){if(r=r.trim(),r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);if(r==="true")return!0;if(r==="false")return!1;if(r==="null"||r==="undefined")return null;if(/^-?\d+(\.\d+)?$/.test(r))return Number(r);const e=r.match(/\(([^()]+)\)/);if(e){const n=gp(e[1]);return gp(r.slice(0,e.index)+String(n)+r.slice(e.index+e[0].length))}const t=[{regex:/\|\|/,fn:(n,i)=>n||i},{regex:/&&/,fn:(n,i)=>n&&i},{regex:/==/,fn:(n,i)=>n==i},{regex:/!=/,fn:(n,i)=>n!=i},{regex:/<=/,fn:(n,i)=>Number(n)<=Number(i)},{regex:/>=/,fn:(n,i)=>Number(n)>=Number(i)},{regex:/</,fn:(n,i)=>Number(n)<Number(i)},{regex:/>/,fn:(n,i)=>Number(n)>Number(i)},{regex:/\+/,fn:(n,i)=>Number(n)+Number(i)},{regex:new RegExp("(?<!\\w)-(?!\\w)"),fn:(n,i)=>Number(n)-Number(i)},{regex:/\*/,fn:(n,i)=>Number(n)*Number(i)},{regex:/\//,fn:(n,i)=>Number(i)!==0?Number(n)/Number(i):0},{regex:/%/,fn:(n,i)=>Number(n)%Number(i)}];for(const n of t){const i=r.match(n.regex);if(i&&i.index!==void 0&&i.index>0){if(n.regex.source.includes("-")&&i.index===0)continue;const a=r.slice(0,i.index).trim(),o=r.slice(i.index+i[0].length).trim();if(a&&o){const A=gp(a),s=gp(o);return n.fn(A,s)}}}return r}function vPe(r,e){if(!r.trim())return[];const t=[];let n=0,i="",a=!1,o="";for(let A=0;A<r.length;A++){const s=r[A];a?(i+=s,s===o&&(a=!1)):s==='"'||s==="'"?(a=!0,o=s,i+=s):s==="("?(n++,i+=s):s===")"?(n--,i+=s):s===","&&n===0?(t.push(i.trim()),i=""):i+=s}return i.trim()&&t.push(i.trim()),t.map(A=>BPe(A,e))}function BPe(r,e){var t;if(r=r.trim(),r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);if(/^-?\d+(\.\d+)?$/.test(r))return Number(r);if(r==="true")return!0;if(r==="false")return!1;if(r==="null"||r==="undefined")return null;if(e.row){const n=sl(r,e.row);if(n!=null)return n}if(r.startsWith("$")){const n=r.slice(1);return((t=e.parameters)==null?void 0:t[n])??null}return r}function EPe(r,e={}){if(!r)return"";r=r.trim();const t=e.data||[],n=e.row||{},i=new Date,a=r.match(/\b(sum|count|avg|min|max|first|last)\s*\(\s*([\w.*]+)\s*\)/i);if(a){const l=a[1].toLowerCase(),c=a[2];return({sum:vT,count:Yee,avg:cPe,min:uPe,max:hPe,first:fPe,last:gPe}[l]||vT)(c,t)}const o=r.match(/^(\w+)\s*\((.+)\)$/s);if(o){const l=o[1].toLowerCase(),c=o[2],u=vPe(c,e);switch(l){case"concat":return u.map(is).join("");case"upper":return is(u[0]).toUpperCase();case"lower":return is(u[0]).toLowerCase();case"len":return is(u[0]).length;case"trim":return is(u[0]).trim();case"substring":return is(u[0]).substring(ll(u[1]),ll(u[1])+ll(u[2]));case"left":return is(u[0]).substring(0,ll(u[1]));case"right":{const f=is(u[0]);return f.substring(f.length-ll(u[1]))}case"replace":return is(u[0]).replaceAll(is(u[1]),is(u[2]));case"round":return Math.round(ll(u[0]));case"abs":return Math.abs(ll(u[0]));case"floor":return Math.floor(ll(u[0]));case"ceil":return Math.ceil(ll(u[0]));case"formatnumber":{const f=ll(u[0]);return isNaN(f)?"0":f.toLocaleString("es-ES")}case"formatdate":{const f=new Date(u[0]);if(isNaN(f.getTime()))return"";const h=is(u[1]).replace(/"/g,""),g=String(f.getDate()).padStart(2,"0"),d=String(f.getMonth()+1).padStart(2,"0"),v=f.getFullYear();return h.replace("dd",g).replace("MM",d).replace("yyyy",String(v))}case"formatcurrency":{const f=ll(u[0]),h=is(u[1]).replace(/"/g,"")||"USD";return isNaN(f)?"":f.toLocaleString("es-ES",{style:"currency",currency:h})}case"if":case"iif":return gp(is(u[0]))?u[1]:u[2];case"isnull":{const f=u[0];return f==null||f===""?u[1]:u[0]}case"now":return i.toISOString();case"today":return i.toISOString().split("T")[0];default:return r}}r=r.replace(/\$\{?(\w+)\}?/g,(l,c)=>{var f;const u=(f=e.parameters)==null?void 0:f[c];return u!==void 0?typeof u=="string"?`"${u}"`:String(u):"null"}),r=r.replace(/\{\{(\w+(?:\.\w+)*)\}\}/g,(l,c)=>{const u=sl(c,n);return u==null?"null":typeof u=="string"?`"${u}"`:String(u)});const A={Page:()=>String(e.page||1),TotalPages:()=>String(e.totalPages||1),FirstPage:()=>String((e.page||1)===1),LastPage:()=>String((e.page||1)>=(e.totalPages||1)),Today:()=>`"${i.toISOString().split("T")[0]}"`,Now:()=>`"${i.toISOString().replace("T"," ").split(".")[0]}"`,Year:()=>String(i.getFullYear()),Month:()=>String(i.getMonth()+1),Day:()=>String(i.getDate()),ReportName:()=>`"${e.reportName||""}"`,ReportAuthor:()=>`"${e.reportAuthor||""}"`,ReportDescription:()=>`"${e.reportDescription||""}"`,ReportCreated:()=>`"${e.reportCreated||""}"`,RowNumber:()=>String(e.rowNumber||1),TotalRows:()=>String(e.totalRows||0),FirstRow:()=>String(e.rowNumber===1),LastRow:()=>String(e.rowNumber===e.totalRows),EvenRow:()=>String((e.rowNumber||1)%2===0),OddRow:()=>String((e.rowNumber||1)%2!==0),groupKey:()=>`"${e.groupKey||""}"`,groupCount:()=>String(e.groupCount||0)};for(const[l,c]of Object.entries(A)){const u=new RegExp(`\\b${l}\\b`,"gi");r=r.replace(u,c)}return r=r.replace(/\bpage\s*\(\s*\)/gi,()=>String(e.page||1)),r=r.replace(/\btotalPages\s*\(\s*\)/gi,()=>String(e.totalPages||1)),r=r.replace(/\btotal\s*\(\s*\)/gi,()=>String(t.length)),r=pPe(r,n,new Set(["true","false","null","undefined","sum","count","avg","min","max","first","last","concat","upper","lower","len","trim","substring","left","right","replace","round","abs","floor","ceil","formatnumber","formatdate","formatcurrency","if","iif","isnull","now","today","page","totalpages","total","page","totalpages","totalrows","rownumber","firstrow","lastrow","evenrow","oddrow","year","month","day","today","now","reportname","reportauthor","reportdescription","reportcreated","groupkey","groupcount"])),gp(r)}function jo(r,e={}){return r?(r=r.replace(/\{\[(.*?)\]\}/g,(t,n)=>{try{const i=EPe(n,e);return i!=null?String(i):`[${n}]`}catch{return`[${n}]`}}),r=r.replace(/\{\{(\w+(?:\.\w+)*)\}\}/g,(t,n)=>{const i=n;if(i==="Page")return String(e.page||1);if(i==="TotalPages")return String(e.totalPages||1);if(i==="FirstPage")return String((e.page||1)===1);if(i==="LastPage")return String((e.page||1)>=(e.totalPages||1));if(i==="Today")return new Date().toISOString().split("T")[0];if(i==="Now")return new Date().toISOString().replace("T"," ").split(".")[0];if(i==="Year")return String(new Date().getFullYear());if(i==="Month")return String(new Date().getMonth()+1);if(i==="Day")return String(new Date().getDate());if(i==="ReportName")return e.reportName||"";if(i==="ReportAuthor")return e.reportAuthor||"";if(i==="ReportDescription")return e.reportDescription||"";if(i==="ReportCreated")return e.reportCreated||"";if(i==="RowNumber")return String(e.rowNumber||1);if(i==="TotalRows")return String(e.totalRows||0);if(i==="GroupKey")return String(e.groupKey||"");if(i==="GroupCount")return String(e.groupCount||0);if(i==="FirstRow")return String((e.rowNumber||1)===1);if(i==="LastRow")return String((e.rowNumber||1)===(e.totalRows||0));if(i==="EvenRow")return String((e.rowNumber||1)%2===0);if(i==="OddRow")return String((e.rowNumber||1)%2!==0);const a=sl(n,e.row||{});return a!=null&&a!==""?String(a):`[${n}]`}),r):""}var mPe=Object.defineProperty,yPe=Object.defineProperties,wPe=Object.getOwnPropertyDescriptors,Oee=Object.getOwnPropertySymbols,IPe=Object.prototype.hasOwnProperty,xPe=Object.prototype.propertyIsEnumerable,BT=(r,e,t)=>e in r?mPe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,fn=(r,e)=>{for(var t in e||(e={}))IPe.call(e,t)&&BT(r,t,e[t]);if(Oee)for(var t of Oee(e))xPe.call(e,t)&&BT(r,t,e[t]);return r},lA=(r,e)=>yPe(r,wPe(e)),Tt=(r,e,t)=>BT(r,typeof e!="symbol"?e+"":e,t),MPe=(r,e,t)=>new Promise((n,i)=>{var a=s=>{try{A(t.next(s))}catch(l){i(l)}},o=s=>{try{A(t.throw(s))}catch(l){i(l)}},A=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,o);A((t=t.apply(r,e)).next())});class e8{constructor(e){Tt(this,"rootKey"),this.rootKey=e}}const QPe=Object.seal({});class Ot extends e8{constructor(e){super(e),Tt(this,"root"),this.root=new Array}prepForXml(e){var t;e.stack.push(this);const n=this.root.map(i=>i instanceof e8?i.prepForXml(e):i).filter(i=>i!==void 0);return e.stack.pop(),{[this.rootKey]:n.length?n.length===1&&((t=n[0])!=null&&t._attr)?n[0]:n:QPe}}addChildElement(e){return this.root.push(e),this}}class q2 extends Ot{constructor(e,t){super(e),Tt(this,"includeIfEmpty"),this.includeIfEmpty=t}prepForXml(e){const t=super.prepForXml(e);if(this.includeIfEmpty||t&&(typeof t[this.rootKey]!="object"||Object.keys(t[this.rootKey]).length))return t}}class gn extends e8{constructor(e){super("_attr"),Tt(this,"xmlKeys"),this.root=e}prepForXml(e){const t={};return Object.entries(this.root).forEach(([n,i])=>{if(i!==void 0){const a=this.xmlKeys&&this.xmlKeys[n]||n;t[a]=i}}),{_attr:t}}}class Lee extends e8{constructor(e){super("_attr"),this.root=e}prepForXml(e){return{_attr:Object.values(this.root).filter(({value:n})=>n!==void 0).reduce((n,{key:i,value:a})=>lA(fn({},n),{[i]:a}),{})}}}class cA extends gn{constructor(){super(...arguments),Tt(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}}var M0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ET(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var mT={},t8={exports:{}},Gee;function yT(){if(Gee)return t8.exports;Gee=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(y,w,I){return Function.prototype.apply.call(y,w,I)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(y){return Object.getOwnPropertyNames(y).concat(Object.getOwnPropertySymbols(y))}:t=function(y){return Object.getOwnPropertyNames(y)};function n(m){console&&console.warn&&console.warn(m)}var i=Number.isNaN||function(y){return y!==y};function a(){a.init.call(this)}t8.exports=a,t8.exports.once=p,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function A(m){if(typeof m!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof m)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(m){if(typeof m!="number"||m<0||i(m))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+m+".");o=m}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(y){if(typeof y!="number"||y<0||i(y))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+y+".");return this._maxListeners=y,this};function s(m){return m._maxListeners===void 0?a.defaultMaxListeners:m._maxListeners}a.prototype.getMaxListeners=function(){return s(this)},a.prototype.emit=function(y){for(var w=[],I=1;I<arguments.length;I++)w.push(arguments[I]);var Q=y==="error",x=this._events;if(x!==void 0)Q=Q&&x.error===void 0;else if(!Q)return!1;if(Q){var U;if(w.length>0&&(U=w[0]),U instanceof Error)throw U;var b=new Error("Unhandled error."+(U?" ("+U.message+")":""));throw b.context=U,b}var C=x[y];if(C===void 0)return!1;if(typeof C=="function")e(C,this,w);else for(var D=C.length,F=g(C,D),I=0;I<D;++I)e(F[I],this,w);return!0};function l(m,y,w,I){var Q,x,U;if(A(w),x=m._events,x===void 0?(x=m._events=Object.create(null),m._eventsCount=0):(x.newListener!==void 0&&(m.emit("newListener",y,w.listener?w.listener:w),x=m._events),U=x[y]),U===void 0)U=x[y]=w,++m._eventsCount;else if(typeof U=="function"?U=x[y]=I?[w,U]:[U,w]:I?U.unshift(w):U.push(w),Q=s(m),Q>0&&U.length>Q&&!U.warned){U.warned=!0;var b=new Error("Possible EventEmitter memory leak detected. "+U.length+" "+String(y)+" listeners added. Use emitter.setMaxListeners() to increase limit");b.name="MaxListenersExceededWarning",b.emitter=m,b.type=y,b.count=U.length,n(b)}return m}a.prototype.addListener=function(y,w){return l(this,y,w,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(y,w){return l(this,y,w,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(m,y,w){var I={fired:!1,wrapFn:void 0,target:m,type:y,listener:w},Q=c.bind(I);return Q.listener=w,I.wrapFn=Q,Q}a.prototype.once=function(y,w){return A(w),this.on(y,u(this,y,w)),this},a.prototype.prependOnceListener=function(y,w){return A(w),this.prependListener(y,u(this,y,w)),this},a.prototype.removeListener=function(y,w){var I,Q,x,U,b;if(A(w),Q=this._events,Q===void 0)return this;if(I=Q[y],I===void 0)return this;if(I===w||I.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete Q[y],Q.removeListener&&this.emit("removeListener",y,I.listener||w));else if(typeof I!="function"){for(x=-1,U=I.length-1;U>=0;U--)if(I[U]===w||I[U].listener===w){b=I[U].listener,x=U;break}if(x<0)return this;x===0?I.shift():d(I,x),I.length===1&&(Q[y]=I[0]),Q.removeListener!==void 0&&this.emit("removeListener",y,b||w)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(y){var w,I,Q;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[y]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[y]),this;if(arguments.length===0){var x=Object.keys(I),U;for(Q=0;Q<x.length;++Q)U=x[Q],U!=="removeListener"&&this.removeAllListeners(U);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(w=I[y],typeof w=="function")this.removeListener(y,w);else if(w!==void 0)for(Q=w.length-1;Q>=0;Q--)this.removeListener(y,w[Q]);return this};function f(m,y,w){var I=m._events;if(I===void 0)return[];var Q=I[y];return Q===void 0?[]:typeof Q=="function"?w?[Q.listener||Q]:[Q]:w?v(Q):g(Q,Q.length)}a.prototype.listeners=function(y){return f(this,y,!0)},a.prototype.rawListeners=function(y){return f(this,y,!1)},a.listenerCount=function(m,y){return typeof m.listenerCount=="function"?m.listenerCount(y):h.call(m,y)},a.prototype.listenerCount=h;function h(m){var y=this._events;if(y!==void 0){var w=y[m];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function g(m,y){for(var w=new Array(y),I=0;I<y;++I)w[I]=m[I];return w}function d(m,y){for(;y+1<m.length;y++)m[y]=m[y+1];m.pop()}function v(m){for(var y=new Array(m.length),w=0;w<y.length;++w)y[w]=m[w].listener||m[w];return y}function p(m,y){return new Promise(function(w,I){function Q(U){m.removeListener(y,x),I(U)}function x(){typeof m.removeListener=="function"&&m.removeListener("error",Q),w([].slice.call(arguments))}E(m,y,x,{once:!0}),y!=="error"&&B(m,Q,{once:!0})})}function B(m,y,w){typeof m.on=="function"&&E(m,"error",y,w)}function E(m,y,w,I){if(typeof m.on=="function")I.once?m.once(y,w):m.on(y,w);else if(typeof m.addEventListener=="function")m.addEventListener(y,function Q(x){I.once&&m.removeEventListener(y,Q),w(x)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof m)}return t8.exports}var r8={exports:{}},zee;function $2(){return zee||(zee=1,typeof Object.create=="function"?r8.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r8.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),r8.exports}function CPe(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Hee={exports:{}},ka=Hee.exports={},mc,yc;function wT(){throw new Error("setTimeout has not been defined")}function IT(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?mc=setTimeout:mc=wT}catch{mc=wT}try{typeof clearTimeout=="function"?yc=clearTimeout:yc=IT}catch{yc=IT}})();function jee(r){if(mc===setTimeout)return setTimeout(r,0);if((mc===wT||!mc)&&setTimeout)return mc=setTimeout,setTimeout(r,0);try{return mc(r,0)}catch{try{return mc.call(null,r,0)}catch{return mc.call(this,r,0)}}}function SPe(r){if(yc===clearTimeout)return clearTimeout(r);if((yc===IT||!yc)&&clearTimeout)return yc=clearTimeout,clearTimeout(r);try{return yc(r)}catch{try{return yc.call(null,r)}catch{return yc.call(this,r)}}}var Ru=[],dp=!1,E1,n8=-1;function FPe(){!dp||!E1||(dp=!1,E1.length?Ru=E1.concat(Ru):n8=-1,Ru.length&&Vee())}function Vee(){if(!dp){var r=jee(FPe);dp=!0;for(var e=Ru.length;e;){for(E1=Ru,Ru=[];++n8<e;)E1&&E1[n8].run();n8=-1,e=Ru.length}E1=null,dp=!1,SPe(r)}}ka.nextTick=function(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Ru.push(new Jee(r,e)),Ru.length===1&&!dp&&jee(Vee)};function Jee(r,e){this.fun=r,this.array=e}Jee.prototype.run=function(){this.fun.apply(null,this.array)},ka.title="browser",ka.browser=!0,ka.env={},ka.argv=[],ka.version="",ka.versions={};function bu(){}ka.on=bu,ka.addListener=bu,ka.once=bu,ka.off=bu,ka.removeListener=bu,ka.removeAllListeners=bu,ka.emit=bu,ka.prependListener=bu,ka.prependOnceListener=bu,ka.listeners=function(r){return[]},ka.binding=function(r){throw new Error("process.binding is not supported")},ka.cwd=function(){return"/"},ka.chdir=function(r){throw new Error("process.chdir is not supported")},ka.umask=function(){return 0};var TPe=Hee.exports;const Hn=CPe(TPe);var xT,Kee;function Wee(){return Kee||(Kee=1,xT=yT().EventEmitter),xT}var MT={},fE={},Xee;function RPe(){if(Xee)return fE;Xee=1,fE.byteLength=A,fE.toByteArray=l,fE.fromByteArray=f;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=n.length;i<a;++i)r[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(h){var g=h.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var d=h.indexOf("=");d===-1&&(d=g);var v=d===g?0:4-d%4;return[d,v]}function A(h){var g=o(h),d=g[0],v=g[1];return(d+v)*3/4-v}function s(h,g,d){return(g+d)*3/4-d}function l(h){var g,d=o(h),v=d[0],p=d[1],B=new t(s(h,v,p)),E=0,m=p>0?v-4:v,y;for(y=0;y<m;y+=4)g=e[h.charCodeAt(y)]<<18|e[h.charCodeAt(y+1)]<<12|e[h.charCodeAt(y+2)]<<6|e[h.charCodeAt(y+3)],B[E++]=g>>16&255,B[E++]=g>>8&255,B[E++]=g&255;return p===2&&(g=e[h.charCodeAt(y)]<<2|e[h.charCodeAt(y+1)]>>4,B[E++]=g&255),p===1&&(g=e[h.charCodeAt(y)]<<10|e[h.charCodeAt(y+1)]<<4|e[h.charCodeAt(y+2)]>>2,B[E++]=g>>8&255,B[E++]=g&255),B}function c(h){return r[h>>18&63]+r[h>>12&63]+r[h>>6&63]+r[h&63]}function u(h,g,d){for(var v,p=[],B=g;B<d;B+=3)v=(h[B]<<16&16711680)+(h[B+1]<<8&65280)+(h[B+2]&255),p.push(c(v));return p.join("")}function f(h){for(var g,d=h.length,v=d%3,p=[],B=16383,E=0,m=d-v;E<m;E+=B)p.push(u(h,E,E+B>m?m:E+B));return v===1?(g=h[d-1],p.push(r[g>>2]+r[g<<4&63]+"==")):v===2&&(g=(h[d-2]<<8)+h[d-1],p.push(r[g>>10]+r[g>>4&63]+r[g<<2&63]+"=")),p.join("")}return fE}var i8={},Zee;function bPe(){return Zee||(Zee=1,i8.read=function(r,e,t,n,i){var a,o,A=i*8-n-1,s=(1<<A)-1,l=s>>1,c=-7,u=t?i-1:0,f=t?-1:1,h=r[e+u];for(u+=f,a=h&(1<<-c)-1,h>>=-c,c+=A;c>0;a=a*256+r[e+u],u+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=o*256+r[e+u],u+=f,c-=8);if(a===0)a=1-l;else{if(a===s)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(h?-1:1)*o*Math.pow(2,a-n)},i8.write=function(r,e,t,n,i,a){var o,A,s,l=a*8-i-1,c=(1<<l)-1,u=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,g=n?1:-1,d=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(A=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-o))<1&&(o--,s*=2),o+u>=1?e+=f/s:e+=f*Math.pow(2,1-u),e*s>=2&&(o++,s/=2),o+u>=c?(A=0,o=c):o+u>=1?(A=(e*s-1)*Math.pow(2,i),o=o+u):(A=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+h]=A&255,h+=g,A/=256,i-=8);for(o=o<<i|A,l+=i;l>0;r[t+h]=o&255,h+=g,o/=256,l-=8);r[t+h-g]|=d*128}),i8}var qee;function a8(){return qee||(qee=1,function(r){var e=RPe(),t=bPe(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=A,r.SlowBuffer=B,r.INSPECT_MAX_BYTES=50;var i=2147483647;r.kMaxLength=i,A.TYPED_ARRAY_SUPPORT=a(),!A.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{var z=new Uint8Array(1),Y={foo:function(){return 42}};return Object.setPrototypeOf(Y,Uint8Array.prototype),Object.setPrototypeOf(z,Y),z.foo()===42}catch{return!1}}Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.buffer}}),Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.byteOffset}});function o(z){if(z>i)throw new RangeError('The value "'+z+'" is invalid for option "size"');var Y=new Uint8Array(z);return Object.setPrototypeOf(Y,A.prototype),Y}function A(z,Y,O){if(typeof z=="number"){if(typeof Y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(z)}return s(z,Y,O)}A.poolSize=8192;function s(z,Y,O){if(typeof z=="string")return f(z,Y);if(ArrayBuffer.isView(z))return g(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(Fe(z,ArrayBuffer)||z&&Fe(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Fe(z,SharedArrayBuffer)||z&&Fe(z.buffer,SharedArrayBuffer)))return d(z,Y,O);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Z=z.valueOf&&z.valueOf();if(Z!=null&&Z!==z)return A.from(Z,Y,O);var Be=v(z);if(Be)return Be;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return A.from(z[Symbol.toPrimitive]("string"),Y,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}A.from=function(z,Y,O){return s(z,Y,O)},Object.setPrototypeOf(A.prototype,Uint8Array.prototype),Object.setPrototypeOf(A,Uint8Array);function l(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function c(z,Y,O){return l(z),z<=0?o(z):Y!==void 0?typeof O=="string"?o(z).fill(Y,O):o(z).fill(Y):o(z)}A.alloc=function(z,Y,O){return c(z,Y,O)};function u(z){return l(z),o(z<0?0:p(z)|0)}A.allocUnsafe=function(z){return u(z)},A.allocUnsafeSlow=function(z){return u(z)};function f(z,Y){if((typeof Y!="string"||Y==="")&&(Y="utf8"),!A.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);var O=E(z,Y)|0,Z=o(O),Be=Z.write(z,Y);return Be!==O&&(Z=Z.slice(0,Be)),Z}function h(z){for(var Y=z.length<0?0:p(z.length)|0,O=o(Y),Z=0;Z<Y;Z+=1)O[Z]=z[Z]&255;return O}function g(z){if(Fe(z,Uint8Array)){var Y=new Uint8Array(z);return d(Y.buffer,Y.byteOffset,Y.byteLength)}return h(z)}function d(z,Y,O){if(Y<0||z.byteLength<Y)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<Y+(O||0))throw new RangeError('"length" is outside of buffer bounds');var Z;return Y===void 0&&O===void 0?Z=new Uint8Array(z):O===void 0?Z=new Uint8Array(z,Y):Z=new Uint8Array(z,Y,O),Object.setPrototypeOf(Z,A.prototype),Z}function v(z){if(A.isBuffer(z)){var Y=p(z.length)|0,O=o(Y);return O.length===0||z.copy(O,0,0,Y),O}if(z.length!==void 0)return typeof z.length!="number"||W(z.length)?o(0):h(z);if(z.type==="Buffer"&&Array.isArray(z.data))return h(z.data)}function p(z){if(z>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return z|0}function B(z){return+z!=z&&(z=0),A.alloc(+z)}A.isBuffer=function(Y){return Y!=null&&Y._isBuffer===!0&&Y!==A.prototype},A.compare=function(Y,O){if(Fe(Y,Uint8Array)&&(Y=A.from(Y,Y.offset,Y.byteLength)),Fe(O,Uint8Array)&&(O=A.from(O,O.offset,O.byteLength)),!A.isBuffer(Y)||!A.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Y===O)return 0;for(var Z=Y.length,Be=O.length,Ce=0,Ie=Math.min(Z,Be);Ce<Ie;++Ce)if(Y[Ce]!==O[Ce]){Z=Y[Ce],Be=O[Ce];break}return Z<Be?-1:Be<Z?1:0},A.isEncoding=function(Y){switch(String(Y).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.concat=function(Y,O){if(!Array.isArray(Y))throw new TypeError('"list" argument must be an Array of Buffers');if(Y.length===0)return A.alloc(0);var Z;if(O===void 0)for(O=0,Z=0;Z<Y.length;++Z)O+=Y[Z].length;var Be=A.allocUnsafe(O),Ce=0;for(Z=0;Z<Y.length;++Z){var Ie=Y[Z];if(Fe(Ie,Uint8Array))Ce+Ie.length>Be.length?A.from(Ie).copy(Be,Ce):Uint8Array.prototype.set.call(Be,Ie,Ce);else if(A.isBuffer(Ie))Ie.copy(Be,Ce);else throw new TypeError('"list" argument must be an Array of Buffers');Ce+=Ie.length}return Be};function E(z,Y){if(A.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||Fe(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);var O=z.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&O===0)return 0;for(var Be=!1;;)switch(Y){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return G(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ne(z).length;default:if(Be)return Z?-1:G(z).length;Y=(""+Y).toLowerCase(),Be=!0}}A.byteLength=E;function m(z,Y,O){var Z=!1;if((Y===void 0||Y<0)&&(Y=0),Y>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,Y>>>=0,O<=Y))return"";for(z||(z="utf8");;)switch(z){case"hex":return ie(this,Y,O);case"utf8":case"utf-8":return F(this,Y,O);case"ascii":return q(this,Y,O);case"latin1":case"binary":return re(this,Y,O);case"base64":return D(this,Y,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,Y,O);default:if(Z)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),Z=!0}}A.prototype._isBuffer=!0;function y(z,Y,O){var Z=z[Y];z[Y]=z[O],z[O]=Z}A.prototype.swap16=function(){var Y=this.length;if(Y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var O=0;O<Y;O+=2)y(this,O,O+1);return this},A.prototype.swap32=function(){var Y=this.length;if(Y%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var O=0;O<Y;O+=4)y(this,O,O+3),y(this,O+1,O+2);return this},A.prototype.swap64=function(){var Y=this.length;if(Y%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var O=0;O<Y;O+=8)y(this,O,O+7),y(this,O+1,O+6),y(this,O+2,O+5),y(this,O+3,O+4);return this},A.prototype.toString=function(){var Y=this.length;return Y===0?"":arguments.length===0?F(this,0,Y):m.apply(this,arguments)},A.prototype.toLocaleString=A.prototype.toString,A.prototype.equals=function(Y){if(!A.isBuffer(Y))throw new TypeError("Argument must be a Buffer");return this===Y?!0:A.compare(this,Y)===0},A.prototype.inspect=function(){var Y="",O=r.INSPECT_MAX_BYTES;return Y=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(Y+=" ... "),"<Buffer "+Y+">"},n&&(A.prototype[n]=A.prototype.inspect),A.prototype.compare=function(Y,O,Z,Be,Ce){if(Fe(Y,Uint8Array)&&(Y=A.from(Y,Y.offset,Y.byteLength)),!A.isBuffer(Y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Y);if(O===void 0&&(O=0),Z===void 0&&(Z=Y?Y.length:0),Be===void 0&&(Be=0),Ce===void 0&&(Ce=this.length),O<0||Z>Y.length||Be<0||Ce>this.length)throw new RangeError("out of range index");if(Be>=Ce&&O>=Z)return 0;if(Be>=Ce)return-1;if(O>=Z)return 1;if(O>>>=0,Z>>>=0,Be>>>=0,Ce>>>=0,this===Y)return 0;for(var Ie=Ce-Be,je=Z-O,qe=Math.min(Ie,je),et=this.slice(Be,Ce),yt=Y.slice(O,Z),Yt=0;Yt<qe;++Yt)if(et[Yt]!==yt[Yt]){Ie=et[Yt],je=yt[Yt];break}return Ie<je?-1:je<Ie?1:0};function w(z,Y,O,Z,Be){if(z.length===0)return-1;if(typeof O=="string"?(Z=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,W(O)&&(O=Be?0:z.length-1),O<0&&(O=z.length+O),O>=z.length){if(Be)return-1;O=z.length-1}else if(O<0)if(Be)O=0;else return-1;if(typeof Y=="string"&&(Y=A.from(Y,Z)),A.isBuffer(Y))return Y.length===0?-1:I(z,Y,O,Z,Be);if(typeof Y=="number")return Y=Y&255,typeof Uint8Array.prototype.indexOf=="function"?Be?Uint8Array.prototype.indexOf.call(z,Y,O):Uint8Array.prototype.lastIndexOf.call(z,Y,O):I(z,[Y],O,Z,Be);throw new TypeError("val must be string, number or Buffer")}function I(z,Y,O,Z,Be){var Ce=1,Ie=z.length,je=Y.length;if(Z!==void 0&&(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le")){if(z.length<2||Y.length<2)return-1;Ce=2,Ie/=2,je/=2,O/=2}function qe(gr,tt){return Ce===1?gr[tt]:gr.readUInt16BE(tt*Ce)}var et;if(Be){var yt=-1;for(et=O;et<Ie;et++)if(qe(z,et)===qe(Y,yt===-1?0:et-yt)){if(yt===-1&&(yt=et),et-yt+1===je)return yt*Ce}else yt!==-1&&(et-=et-yt),yt=-1}else for(O+je>Ie&&(O=Ie-je),et=O;et>=0;et--){for(var Yt=!0,kt=0;kt<je;kt++)if(qe(z,et+kt)!==qe(Y,kt)){Yt=!1;break}if(Yt)return et}return-1}A.prototype.includes=function(Y,O,Z){return this.indexOf(Y,O,Z)!==-1},A.prototype.indexOf=function(Y,O,Z){return w(this,Y,O,Z,!0)},A.prototype.lastIndexOf=function(Y,O,Z){return w(this,Y,O,Z,!1)};function Q(z,Y,O,Z){O=Number(O)||0;var Be=z.length-O;Z?(Z=Number(Z),Z>Be&&(Z=Be)):Z=Be;var Ce=Y.length;Z>Ce/2&&(Z=Ce/2);for(var Ie=0;Ie<Z;++Ie){var je=parseInt(Y.substr(Ie*2,2),16);if(W(je))return Ie;z[O+Ie]=je}return Ie}function x(z,Y,O,Z){return le(G(Y,z.length-O),z,O,Z)}function U(z,Y,O,Z){return le(oe(Y),z,O,Z)}function b(z,Y,O,Z){return le(ne(Y),z,O,Z)}function C(z,Y,O,Z){return le(se(Y,z.length-O),z,O,Z)}A.prototype.write=function(Y,O,Z,Be){if(O===void 0)Be="utf8",Z=this.length,O=0;else if(Z===void 0&&typeof O=="string")Be=O,Z=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(Z)?(Z=Z>>>0,Be===void 0&&(Be="utf8")):(Be=Z,Z=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ce=this.length-O;if((Z===void 0||Z>Ce)&&(Z=Ce),Y.length>0&&(Z<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");Be||(Be="utf8");for(var Ie=!1;;)switch(Be){case"hex":return Q(this,Y,O,Z);case"utf8":case"utf-8":return x(this,Y,O,Z);case"ascii":case"latin1":case"binary":return U(this,Y,O,Z);case"base64":return b(this,Y,O,Z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,Y,O,Z);default:if(Ie)throw new TypeError("Unknown encoding: "+Be);Be=(""+Be).toLowerCase(),Ie=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(z,Y,O){return Y===0&&O===z.length?e.fromByteArray(z):e.fromByteArray(z.slice(Y,O))}function F(z,Y,O){O=Math.min(z.length,O);for(var Z=[],Be=Y;Be<O;){var Ce=z[Be],Ie=null,je=Ce>239?4:Ce>223?3:Ce>191?2:1;if(Be+je<=O){var qe,et,yt,Yt;switch(je){case 1:Ce<128&&(Ie=Ce);break;case 2:qe=z[Be+1],(qe&192)===128&&(Yt=(Ce&31)<<6|qe&63,Yt>127&&(Ie=Yt));break;case 3:qe=z[Be+1],et=z[Be+2],(qe&192)===128&&(et&192)===128&&(Yt=(Ce&15)<<12|(qe&63)<<6|et&63,Yt>2047&&(Yt<55296||Yt>57343)&&(Ie=Yt));break;case 4:qe=z[Be+1],et=z[Be+2],yt=z[Be+3],(qe&192)===128&&(et&192)===128&&(yt&192)===128&&(Yt=(Ce&15)<<18|(qe&63)<<12|(et&63)<<6|yt&63,Yt>65535&&Yt<1114112&&(Ie=Yt))}}Ie===null?(Ie=65533,je=1):Ie>65535&&(Ie-=65536,Z.push(Ie>>>10&1023|55296),Ie=56320|Ie&1023),Z.push(Ie),Be+=je}return X(Z)}var H=4096;function X(z){var Y=z.length;if(Y<=H)return String.fromCharCode.apply(String,z);for(var O="",Z=0;Z<Y;)O+=String.fromCharCode.apply(String,z.slice(Z,Z+=H));return O}function q(z,Y,O){var Z="";O=Math.min(z.length,O);for(var Be=Y;Be<O;++Be)Z+=String.fromCharCode(z[Be]&127);return Z}function re(z,Y,O){var Z="";O=Math.min(z.length,O);for(var Be=Y;Be<O;++Be)Z+=String.fromCharCode(z[Be]);return Z}function ie(z,Y,O){var Z=z.length;(!Y||Y<0)&&(Y=0),(!O||O<0||O>Z)&&(O=Z);for(var Be="",Ce=Y;Ce<O;++Ce)Be+=xe[z[Ce]];return Be}function ge(z,Y,O){for(var Z=z.slice(Y,O),Be="",Ce=0;Ce<Z.length-1;Ce+=2)Be+=String.fromCharCode(Z[Ce]+Z[Ce+1]*256);return Be}A.prototype.slice=function(Y,O){var Z=this.length;Y=~~Y,O=O===void 0?Z:~~O,Y<0?(Y+=Z,Y<0&&(Y=0)):Y>Z&&(Y=Z),O<0?(O+=Z,O<0&&(O=0)):O>Z&&(O=Z),O<Y&&(O=Y);var Be=this.subarray(Y,O);return Object.setPrototypeOf(Be,A.prototype),Be};function he(z,Y,O){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+Y>O)throw new RangeError("Trying to access beyond buffer length")}A.prototype.readUintLE=A.prototype.readUIntLE=function(Y,O,Z){Y=Y>>>0,O=O>>>0,Z||he(Y,O,this.length);for(var Be=this[Y],Ce=1,Ie=0;++Ie<O&&(Ce*=256);)Be+=this[Y+Ie]*Ce;return Be},A.prototype.readUintBE=A.prototype.readUIntBE=function(Y,O,Z){Y=Y>>>0,O=O>>>0,Z||he(Y,O,this.length);for(var Be=this[Y+--O],Ce=1;O>0&&(Ce*=256);)Be+=this[Y+--O]*Ce;return Be},A.prototype.readUint8=A.prototype.readUInt8=function(Y,O){return Y=Y>>>0,O||he(Y,1,this.length),this[Y]},A.prototype.readUint16LE=A.prototype.readUInt16LE=function(Y,O){return Y=Y>>>0,O||he(Y,2,this.length),this[Y]|this[Y+1]<<8},A.prototype.readUint16BE=A.prototype.readUInt16BE=function(Y,O){return Y=Y>>>0,O||he(Y,2,this.length),this[Y]<<8|this[Y+1]},A.prototype.readUint32LE=A.prototype.readUInt32LE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),(this[Y]|this[Y+1]<<8|this[Y+2]<<16)+this[Y+3]*16777216},A.prototype.readUint32BE=A.prototype.readUInt32BE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),this[Y]*16777216+(this[Y+1]<<16|this[Y+2]<<8|this[Y+3])},A.prototype.readIntLE=function(Y,O,Z){Y=Y>>>0,O=O>>>0,Z||he(Y,O,this.length);for(var Be=this[Y],Ce=1,Ie=0;++Ie<O&&(Ce*=256);)Be+=this[Y+Ie]*Ce;return Ce*=128,Be>=Ce&&(Be-=Math.pow(2,8*O)),Be},A.prototype.readIntBE=function(Y,O,Z){Y=Y>>>0,O=O>>>0,Z||he(Y,O,this.length);for(var Be=O,Ce=1,Ie=this[Y+--Be];Be>0&&(Ce*=256);)Ie+=this[Y+--Be]*Ce;return Ce*=128,Ie>=Ce&&(Ie-=Math.pow(2,8*O)),Ie},A.prototype.readInt8=function(Y,O){return Y=Y>>>0,O||he(Y,1,this.length),this[Y]&128?(255-this[Y]+1)*-1:this[Y]},A.prototype.readInt16LE=function(Y,O){Y=Y>>>0,O||he(Y,2,this.length);var Z=this[Y]|this[Y+1]<<8;return Z&32768?Z|4294901760:Z},A.prototype.readInt16BE=function(Y,O){Y=Y>>>0,O||he(Y,2,this.length);var Z=this[Y+1]|this[Y]<<8;return Z&32768?Z|4294901760:Z},A.prototype.readInt32LE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),this[Y]|this[Y+1]<<8|this[Y+2]<<16|this[Y+3]<<24},A.prototype.readInt32BE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),this[Y]<<24|this[Y+1]<<16|this[Y+2]<<8|this[Y+3]},A.prototype.readFloatLE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),t.read(this,Y,!0,23,4)},A.prototype.readFloatBE=function(Y,O){return Y=Y>>>0,O||he(Y,4,this.length),t.read(this,Y,!1,23,4)},A.prototype.readDoubleLE=function(Y,O){return Y=Y>>>0,O||he(Y,8,this.length),t.read(this,Y,!0,52,8)},A.prototype.readDoubleBE=function(Y,O){return Y=Y>>>0,O||he(Y,8,this.length),t.read(this,Y,!1,52,8)};function R(z,Y,O,Z,Be,Ce){if(!A.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(Y>Be||Y<Ce)throw new RangeError('"value" argument is out of bounds');if(O+Z>z.length)throw new RangeError("Index out of range")}A.prototype.writeUintLE=A.prototype.writeUIntLE=function(Y,O,Z,Be){if(Y=+Y,O=O>>>0,Z=Z>>>0,!Be){var Ce=Math.pow(2,8*Z)-1;R(this,Y,O,Z,Ce,0)}var Ie=1,je=0;for(this[O]=Y&255;++je<Z&&(Ie*=256);)this[O+je]=Y/Ie&255;return O+Z},A.prototype.writeUintBE=A.prototype.writeUIntBE=function(Y,O,Z,Be){if(Y=+Y,O=O>>>0,Z=Z>>>0,!Be){var Ce=Math.pow(2,8*Z)-1;R(this,Y,O,Z,Ce,0)}var Ie=Z-1,je=1;for(this[O+Ie]=Y&255;--Ie>=0&&(je*=256);)this[O+Ie]=Y/je&255;return O+Z},A.prototype.writeUint8=A.prototype.writeUInt8=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,1,255,0),this[O]=Y&255,O+1},A.prototype.writeUint16LE=A.prototype.writeUInt16LE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,2,65535,0),this[O]=Y&255,this[O+1]=Y>>>8,O+2},A.prototype.writeUint16BE=A.prototype.writeUInt16BE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,2,65535,0),this[O]=Y>>>8,this[O+1]=Y&255,O+2},A.prototype.writeUint32LE=A.prototype.writeUInt32LE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,4,4294967295,0),this[O+3]=Y>>>24,this[O+2]=Y>>>16,this[O+1]=Y>>>8,this[O]=Y&255,O+4},A.prototype.writeUint32BE=A.prototype.writeUInt32BE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,4,4294967295,0),this[O]=Y>>>24,this[O+1]=Y>>>16,this[O+2]=Y>>>8,this[O+3]=Y&255,O+4},A.prototype.writeIntLE=function(Y,O,Z,Be){if(Y=+Y,O=O>>>0,!Be){var Ce=Math.pow(2,8*Z-1);R(this,Y,O,Z,Ce-1,-Ce)}var Ie=0,je=1,qe=0;for(this[O]=Y&255;++Ie<Z&&(je*=256);)Y<0&&qe===0&&this[O+Ie-1]!==0&&(qe=1),this[O+Ie]=(Y/je>>0)-qe&255;return O+Z},A.prototype.writeIntBE=function(Y,O,Z,Be){if(Y=+Y,O=O>>>0,!Be){var Ce=Math.pow(2,8*Z-1);R(this,Y,O,Z,Ce-1,-Ce)}var Ie=Z-1,je=1,qe=0;for(this[O+Ie]=Y&255;--Ie>=0&&(je*=256);)Y<0&&qe===0&&this[O+Ie+1]!==0&&(qe=1),this[O+Ie]=(Y/je>>0)-qe&255;return O+Z},A.prototype.writeInt8=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,1,127,-128),Y<0&&(Y=255+Y+1),this[O]=Y&255,O+1},A.prototype.writeInt16LE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,2,32767,-32768),this[O]=Y&255,this[O+1]=Y>>>8,O+2},A.prototype.writeInt16BE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,2,32767,-32768),this[O]=Y>>>8,this[O+1]=Y&255,O+2},A.prototype.writeInt32LE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,4,2147483647,-2147483648),this[O]=Y&255,this[O+1]=Y>>>8,this[O+2]=Y>>>16,this[O+3]=Y>>>24,O+4},A.prototype.writeInt32BE=function(Y,O,Z){return Y=+Y,O=O>>>0,Z||R(this,Y,O,4,2147483647,-2147483648),Y<0&&(Y=4294967295+Y+1),this[O]=Y>>>24,this[O+1]=Y>>>16,this[O+2]=Y>>>8,this[O+3]=Y&255,O+4};function V(z,Y,O,Z,Be,Ce){if(O+Z>z.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function J(z,Y,O,Z,Be){return Y=+Y,O=O>>>0,Be||V(z,Y,O,4),t.write(z,Y,O,Z,23,4),O+4}A.prototype.writeFloatLE=function(Y,O,Z){return J(this,Y,O,!0,Z)},A.prototype.writeFloatBE=function(Y,O,Z){return J(this,Y,O,!1,Z)};function ee(z,Y,O,Z,Be){return Y=+Y,O=O>>>0,Be||V(z,Y,O,8),t.write(z,Y,O,Z,52,8),O+8}A.prototype.writeDoubleLE=function(Y,O,Z){return ee(this,Y,O,!0,Z)},A.prototype.writeDoubleBE=function(Y,O,Z){return ee(this,Y,O,!1,Z)},A.prototype.copy=function(Y,O,Z,Be){if(!A.isBuffer(Y))throw new TypeError("argument should be a Buffer");if(Z||(Z=0),!Be&&Be!==0&&(Be=this.length),O>=Y.length&&(O=Y.length),O||(O=0),Be>0&&Be<Z&&(Be=Z),Be===Z||Y.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(Z<0||Z>=this.length)throw new RangeError("Index out of range");if(Be<0)throw new RangeError("sourceEnd out of bounds");Be>this.length&&(Be=this.length),Y.length-O<Be-Z&&(Be=Y.length-O+Z);var Ce=Be-Z;return this===Y&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,Z,Be):Uint8Array.prototype.set.call(Y,this.subarray(Z,Be),O),Ce},A.prototype.fill=function(Y,O,Z,Be){if(typeof Y=="string"){if(typeof O=="string"?(Be=O,O=0,Z=this.length):typeof Z=="string"&&(Be=Z,Z=this.length),Be!==void 0&&typeof Be!="string")throw new TypeError("encoding must be a string");if(typeof Be=="string"&&!A.isEncoding(Be))throw new TypeError("Unknown encoding: "+Be);if(Y.length===1){var Ce=Y.charCodeAt(0);(Be==="utf8"&&Ce<128||Be==="latin1")&&(Y=Ce)}}else typeof Y=="number"?Y=Y&255:typeof Y=="boolean"&&(Y=Number(Y));if(O<0||this.length<O||this.length<Z)throw new RangeError("Out of range index");if(Z<=O)return this;O=O>>>0,Z=Z===void 0?this.length:Z>>>0,Y||(Y=0);var Ie;if(typeof Y=="number")for(Ie=O;Ie<Z;++Ie)this[Ie]=Y;else{var je=A.isBuffer(Y)?Y:A.from(Y,Be),qe=je.length;if(qe===0)throw new TypeError('The value "'+Y+'" is invalid for argument "value"');for(Ie=0;Ie<Z-O;++Ie)this[Ie+O]=je[Ie%qe]}return this};var ae=/[^+/0-9A-Za-z-_]/g;function j(z){if(z=z.split("=")[0],z=z.trim().replace(ae,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function G(z,Y){Y=Y||1/0;for(var O,Z=z.length,Be=null,Ce=[],Ie=0;Ie<Z;++Ie){if(O=z.charCodeAt(Ie),O>55295&&O<57344){if(!Be){if(O>56319){(Y-=3)>-1&&Ce.push(239,191,189);continue}else if(Ie+1===Z){(Y-=3)>-1&&Ce.push(239,191,189);continue}Be=O;continue}if(O<56320){(Y-=3)>-1&&Ce.push(239,191,189),Be=O;continue}O=(Be-55296<<10|O-56320)+65536}else Be&&(Y-=3)>-1&&Ce.push(239,191,189);if(Be=null,O<128){if((Y-=1)<0)break;Ce.push(O)}else if(O<2048){if((Y-=2)<0)break;Ce.push(O>>6|192,O&63|128)}else if(O<65536){if((Y-=3)<0)break;Ce.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((Y-=4)<0)break;Ce.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return Ce}function oe(z){for(var Y=[],O=0;O<z.length;++O)Y.push(z.charCodeAt(O)&255);return Y}function se(z,Y){for(var O,Z,Be,Ce=[],Ie=0;Ie<z.length&&!((Y-=2)<0);++Ie)O=z.charCodeAt(Ie),Z=O>>8,Be=O%256,Ce.push(Be),Ce.push(Z);return Ce}function ne(z){return e.toByteArray(j(z))}function le(z,Y,O,Z){for(var Be=0;Be<Z&&!(Be+O>=Y.length||Be>=z.length);++Be)Y[Be+O]=z[Be];return Be}function Fe(z,Y){return z instanceof Y||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===Y.name}function W(z){return z!==z}var xe=function(){for(var z="0123456789abcdef",Y=new Array(256),O=0;O<16;++O)for(var Z=O*16,Be=0;Be<16;++Be)Y[Z+Be]=z[O]+z[Be];return Y}()}(MT)),MT}var QT={},CT={},ST,$ee;function ete(){return $ee||($ee=1,ST=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var A=Object.getOwnPropertyDescriptor(e,t);if(A.value!==i||A.enumerable!==!0)return!1}return!0}),ST}var FT,tte;function TT(){if(tte)return FT;tte=1;var r=ete();return FT=function(){return r()&&!!Symbol.toStringTag},FT}var RT,rte;function nte(){return rte||(rte=1,RT=Object),RT}var bT,ite;function DPe(){return ite||(ite=1,bT=Error),bT}var DT,ate;function NPe(){return ate||(ate=1,DT=EvalError),DT}var NT,ote;function UPe(){return ote||(ote=1,NT=RangeError),NT}var UT,Ate;function _Pe(){return Ate||(Ate=1,UT=ReferenceError),UT}var _T,ste;function lte(){return ste||(ste=1,_T=SyntaxError),_T}var kT,cte;function o8(){return cte||(cte=1,kT=TypeError),kT}var YT,ute;function kPe(){return ute||(ute=1,YT=URIError),YT}var PT,hte;function YPe(){return hte||(hte=1,PT=Math.abs),PT}var OT,fte;function PPe(){return fte||(fte=1,OT=Math.floor),OT}var LT,gte;function OPe(){return gte||(gte=1,LT=Math.max),LT}var GT,dte;function LPe(){return dte||(dte=1,GT=Math.min),GT}var zT,pte;function GPe(){return pte||(pte=1,zT=Math.pow),zT}var HT,vte;function zPe(){return vte||(vte=1,HT=Math.round),HT}var jT,Bte;function HPe(){return Bte||(Bte=1,jT=Number.isNaN||function(e){return e!==e}),jT}var VT,Ete;function jPe(){if(Ete)return VT;Ete=1;var r=HPe();return VT=function(t){return r(t)||t===0?t:t<0?-1:1},VT}var JT,mte;function VPe(){return mte||(mte=1,JT=Object.getOwnPropertyDescriptor),JT}var KT,yte;function gE(){if(yte)return KT;yte=1;var r=VPe();if(r)try{r([],"length")}catch{r=null}return KT=r,KT}var WT,wte;function A8(){if(wte)return WT;wte=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return WT=r,WT}var XT,Ite;function JPe(){if(Ite)return XT;Ite=1;var r=typeof Symbol<"u"&&Symbol,e=ete();return XT=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},XT}var ZT,xte;function Mte(){return xte||(xte=1,ZT=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),ZT}var qT,Qte;function Cte(){if(Qte)return qT;Qte=1;var r=nte();return qT=r.getPrototypeOf||null,qT}var $T,Ste;function KPe(){if(Ste)return $T;Ste=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(s,l){for(var c=[],u=0;u<s.length;u+=1)c[u]=s[u];for(var f=0;f<l.length;f+=1)c[f+s.length]=l[f];return c},a=function(s,l){for(var c=[],u=l,f=0;u<s.length;u+=1,f+=1)c[f]=s[u];return c},o=function(A,s){for(var l="",c=0;c<A.length;c+=1)l+=A[c],c+1<A.length&&(l+=s);return l};return $T=function(s){var l=this;if(typeof l!="function"||e.apply(l)!==n)throw new TypeError(r+l);for(var c=a(arguments,1),u,f=function(){if(this instanceof u){var p=l.apply(this,i(c,arguments));return Object(p)===p?p:this}return l.apply(s,i(c,arguments))},h=t(0,l.length-c.length),g=[],d=0;d<h;d++)g[d]="$"+d;if(u=Function("binder","return function ("+o(g,",")+"){ return binder.apply(this,arguments); }")(f),l.prototype){var v=function(){};v.prototype=l.prototype,u.prototype=new v,v.prototype=null}return u},$T}var eR,Fte;function dE(){if(Fte)return eR;Fte=1;var r=KPe();return eR=Function.prototype.bind||r,eR}var tR,Tte;function rR(){return Tte||(Tte=1,tR=Function.prototype.call),tR}var nR,Rte;function iR(){return Rte||(Rte=1,nR=Function.prototype.apply),nR}var aR,bte;function WPe(){return bte||(bte=1,aR=typeof Reflect<"u"&&Reflect&&Reflect.apply),aR}var oR,Dte;function Nte(){if(Dte)return oR;Dte=1;var r=dE(),e=iR(),t=rR(),n=WPe();return oR=n||r.call(t,e),oR}var AR,Ute;function sR(){if(Ute)return AR;Ute=1;var r=dE(),e=o8(),t=rR(),n=Nte();return AR=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},AR}var lR,_te;function XPe(){if(_te)return lR;_te=1;var r=sR(),e=gE(),t;try{t=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return lR=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(A){return a(A==null?A:i(A))}:!1,lR}var cR,kte;function Yte(){if(kte)return cR;kte=1;var r=Mte(),e=Cte(),t=XPe();return cR=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,cR}var uR,Pte;function ZPe(){if(Pte)return uR;Pte=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=dE();return uR=t.call(r,e),uR}var hR,Ote;function Lte(){if(Ote)return hR;Ote=1;var r,e=nte(),t=DPe(),n=NPe(),i=UPe(),a=_Pe(),o=lte(),A=o8(),s=kPe(),l=YPe(),c=PPe(),u=OPe(),f=LPe(),h=GPe(),g=zPe(),d=jPe(),v=Function,p=function(oe){try{return v('"use strict"; return ('+oe+").constructor;")()}catch{}},B=gE(),E=A8(),m=function(){throw new A},y=B?function(){try{return arguments.callee,m}catch{try{return B(arguments,"callee").get}catch{return m}}}():m,w=JPe()(),I=Yte(),Q=Cte(),x=Mte(),U=iR(),b=rR(),C={},D=typeof Uint8Array>"u"||!I?r:I(Uint8Array),F={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":w&&I?I([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":C,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&I?I(I([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!w||!I?r:I(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":B,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!w||!I?r:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&I?I(""[Symbol.iterator]()):r,"%Symbol%":w?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":y,"%TypedArray%":D,"%TypeError%":A,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":s,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":b,"%Function.prototype.apply%":U,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":Q,"%Math.abs%":l,"%Math.floor%":c,"%Math.max%":u,"%Math.min%":f,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":d,"%Reflect.getPrototypeOf%":x};if(I)try{null.error}catch(oe){var H=I(I(oe));F["%Error.prototype%"]=H}var X=function oe(se){var ne;if(se==="%AsyncFunction%")ne=p("async function () {}");else if(se==="%GeneratorFunction%")ne=p("function* () {}");else if(se==="%AsyncGeneratorFunction%")ne=p("async function* () {}");else if(se==="%AsyncGenerator%"){var le=oe("%AsyncGeneratorFunction%");le&&(ne=le.prototype)}else if(se==="%AsyncIteratorPrototype%"){var Fe=oe("%AsyncGenerator%");Fe&&I&&(ne=I(Fe.prototype))}return F[se]=ne,ne},q={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},re=dE(),ie=ZPe(),ge=re.call(b,Array.prototype.concat),he=re.call(U,Array.prototype.splice),R=re.call(b,String.prototype.replace),V=re.call(b,String.prototype.slice),J=re.call(b,RegExp.prototype.exec),ee=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ae=/\\(\\)?/g,j=function(se){var ne=V(se,0,1),le=V(se,-1);if(ne==="%"&&le!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(le==="%"&&ne!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var Fe=[];return R(se,ee,function(W,xe,z,Y){Fe[Fe.length]=z?R(Y,ae,"$1"):xe||W}),Fe},G=function(se,ne){var le=se,Fe;if(ie(q,le)&&(Fe=q[le],le="%"+Fe[0]+"%"),ie(F,le)){var W=F[le];if(W===C&&(W=X(le)),typeof W>"u"&&!ne)throw new A("intrinsic "+se+" exists, but is not available. Please file an issue!");return{alias:Fe,name:le,value:W}}throw new o("intrinsic "+se+" does not exist!")};return hR=function(se,ne){if(typeof se!="string"||se.length===0)throw new A("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ne!="boolean")throw new A('"allowMissing" argument must be a boolean');if(J(/^%?[^%]*%?$/,se)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var le=j(se),Fe=le.length>0?le[0]:"",W=G("%"+Fe+"%",ne),xe=W.name,z=W.value,Y=!1,O=W.alias;O&&(Fe=O[0],he(le,ge([0,1],O)));for(var Z=1,Be=!0;Z<le.length;Z+=1){var Ce=le[Z],Ie=V(Ce,0,1),je=V(Ce,-1);if((Ie==='"'||Ie==="'"||Ie==="`"||je==='"'||je==="'"||je==="`")&&Ie!==je)throw new o("property names with quotes must have matching quotes");if((Ce==="constructor"||!Be)&&(Y=!0),Fe+="."+Ce,xe="%"+Fe+"%",ie(F,xe))z=F[xe];else if(z!=null){if(!(Ce in z)){if(!ne)throw new A("base intrinsic for "+se+" exists, but the property is not available.");return}if(B&&Z+1>=le.length){var qe=B(z,Ce);Be=!!qe,Be&&"get"in qe&&!("originalValue"in qe.get)?z=qe.get:z=z[Ce]}else Be=ie(z,Ce),z=z[Ce];Be&&!Y&&(F[xe]=z)}}return z},hR}var fR,Gte;function zte(){if(Gte)return fR;Gte=1;var r=Lte(),e=sR(),t=e([r("%String.prototype.indexOf%")]);return fR=function(i,a){var o=r(i,!!a);return typeof o=="function"&&t(i,".prototype.")>-1?e([o]):o},fR}var gR,Hte;function qPe(){if(Hte)return gR;Hte=1;var r=TT()(),e=zte(),t=e("Object.prototype.toString"),n=function(A){return r&&A&&typeof A=="object"&&Symbol.toStringTag in A?!1:t(A)==="[object Arguments]"},i=function(A){return n(A)?!0:A!==null&&typeof A=="object"&&"length"in A&&typeof A.length=="number"&&A.length>=0&&t(A)!=="[object Array]"&&"callee"in A&&t(A.callee)==="[object Function]"},a=function(){return n(arguments)}();return n.isLegacyArguments=i,gR=a?n:i,gR}var dR,jte;function $Pe(){if(jte)return dR;jte=1;var r=Object.prototype.toString,e=Function.prototype.toString,t=/^\s*(?:function)?\*/,n=TT()(),i=Object.getPrototypeOf,a=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},o;return dR=function(s){if(typeof s!="function")return!1;if(t.test(e.call(s)))return!0;if(!n){var l=r.call(s);return l==="[object GeneratorFunction]"}if(!i)return!1;if(typeof o>"u"){var c=a();o=c?i(c):!1}return i(s)===o},dR}var pR,Vte;function eOe(){if(Vte)return pR;Vte=1;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,t)}catch(B){B!==n&&(e=null)}else e=null;var i=/^\s*class\b/,a=function(E){try{var m=r.call(E);return i.test(m)}catch{return!1}},o=function(E){try{return a(E)?!1:(r.call(E),!0)}catch{return!1}},A=Object.prototype.toString,s="[object Object]",l="[object Function]",c="[object GeneratorFunction]",u="[object HTMLAllCollection]",f="[object HTML document.all class]",h="[object HTMLCollection]",g=typeof Symbol=="function"&&!!Symbol.toStringTag,d=!(0 in[,]),v=function(){return!1};if(typeof document=="object"){var p=document.all;A.call(p)===A.call(document.all)&&(v=function(E){if((d||!E)&&(typeof E>"u"||typeof E=="object"))try{var m=A.call(E);return(m===u||m===f||m===h||m===s)&&E("")==null}catch{}return!1})}return pR=e?function(E){if(v(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{e(E,null,t)}catch(m){if(m!==n)return!1}return!a(E)&&o(E)}:function(E){if(v(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(g)return o(E);if(a(E))return!1;var m=A.call(E);return m!==l&&m!==c&&!/^\[object HTML/.test(m)?!1:o(E)},pR}var vR,Jte;function tOe(){if(Jte)return vR;Jte=1;var r=eOe(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(s,l,c){for(var u=0,f=s.length;u<f;u++)t.call(s,u)&&(c==null?l(s[u],u,s):l.call(c,s[u],u,s))},i=function(s,l,c){for(var u=0,f=s.length;u<f;u++)c==null?l(s.charAt(u),u,s):l.call(c,s.charAt(u),u,s)},a=function(s,l,c){for(var u in s)t.call(s,u)&&(c==null?l(s[u],u,s):l.call(c,s[u],u,s))};function o(A){return e.call(A)==="[object Array]"}return vR=function(s,l,c){if(!r(l))throw new TypeError("iterator must be a function");var u;arguments.length>=3&&(u=c),o(s)?n(s,l,u):typeof s=="string"?i(s,l,u):a(s,l,u)},vR}var BR,Kte;function rOe(){return Kte||(Kte=1,BR=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),BR}var ER,Wte;function nOe(){if(Wte)return ER;Wte=1;var r=rOe(),e=typeof globalThis>"u"?M0:globalThis;return ER=function(){for(var n=[],i=0;i<r.length;i++)typeof e[r[i]]=="function"&&(n[n.length]=r[i]);return n},ER}var mR={exports:{}},yR,Xte;function iOe(){if(Xte)return yR;Xte=1;var r=A8(),e=lte(),t=o8(),n=gE();return yR=function(a,o,A){if(!a||typeof a!="object"&&typeof a!="function")throw new t("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,f=!!n&&n(a,o);if(r)r(a,o,{configurable:c===null&&f?f.configurable:!c,enumerable:s===null&&f?f.enumerable:!s,value:A,writable:l===null&&f?f.writable:!l});else if(u||!s&&!l&&!c)a[o]=A;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},yR}var wR,Zte;function aOe(){if(Zte)return wR;Zte=1;var r=A8(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},wR=e,wR}var IR,qte;function oOe(){if(qte)return IR;qte=1;var r=Lte(),e=iOe(),t=aOe()(),n=gE(),i=o8(),a=r("%Math.floor%");return IR=function(A,s){if(typeof A!="function")throw new i("`fn` is not a function");if(typeof s!="number"||s<0||s>4294967295||a(s)!==s)throw new i("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],c=!0,u=!0;if("length"in A&&n){var f=n(A,"length");f&&!f.configurable&&(c=!1),f&&!f.writable&&(u=!1)}return(c||u||!l)&&(t?e(A,"length",s,!0,!0):e(A,"length",s)),A},IR}var xR,$te;function AOe(){if($te)return xR;$te=1;var r=dE(),e=iR(),t=Nte();return xR=function(){return t(r,e,arguments)},xR}var ere;function sOe(){return ere||(ere=1,function(r){var e=oOe(),t=A8(),n=sR(),i=AOe();r.exports=function(o){var A=n(arguments),s=o.length-(arguments.length-1);return e(A,1+(s>0?s:0),!0)},t?t(r.exports,"apply",{value:i}):r.exports.apply=i}(mR)),mR.exports}var MR,tre;function rre(){if(tre)return MR;tre=1;var r=tOe(),e=nOe(),t=sOe(),n=zte(),i=gE(),a=Yte(),o=n("Object.prototype.toString"),A=TT()(),s=typeof globalThis>"u"?M0:globalThis,l=e(),c=n("String.prototype.slice"),u=n("Array.prototype.indexOf",!0)||function(v,p){for(var B=0;B<v.length;B+=1)if(v[B]===p)return B;return-1},f={__proto__:null};A&&i&&a?r(l,function(d){var v=new s[d];if(Symbol.toStringTag in v&&a){var p=a(v),B=i(p,Symbol.toStringTag);if(!B&&p){var E=a(p);B=i(E,Symbol.toStringTag)}f["$"+d]=t(B.get)}}):r(l,function(d){var v=new s[d],p=v.slice||v.set;p&&(f["$"+d]=t(p))});var h=function(v){var p=!1;return r(f,function(B,E){if(!p)try{"$"+B(v)===E&&(p=c(E,1))}catch{}}),p},g=function(v){var p=!1;return r(f,function(B,E){if(!p)try{B(v),p=c(E,1)}catch{}}),p};return MR=function(v){if(!v||typeof v!="object")return!1;if(!A){var p=c(o(v),8,-1);return u(l,p)>-1?p:p!=="Object"?!1:g(v)}return i?h(v):null},MR}var QR,nre;function lOe(){if(nre)return QR;nre=1;var r=rre();return QR=function(t){return!!r(t)},QR}var ire;function cOe(){return ire||(ire=1,function(r){var e=qPe(),t=$Pe(),n=rre(),i=lOe();function a(Z){return Z.call.bind(Z)}var o=typeof BigInt<"u",A=typeof Symbol<"u",s=a(Object.prototype.toString),l=a(Number.prototype.valueOf),c=a(String.prototype.valueOf),u=a(Boolean.prototype.valueOf);if(o)var f=a(BigInt.prototype.valueOf);if(A)var h=a(Symbol.prototype.valueOf);function g(Z,Be){if(typeof Z!="object")return!1;try{return Be(Z),!0}catch{return!1}}r.isArgumentsObject=e,r.isGeneratorFunction=t,r.isTypedArray=i;function d(Z){return typeof Promise<"u"&&Z instanceof Promise||Z!==null&&typeof Z=="object"&&typeof Z.then=="function"&&typeof Z.catch=="function"}r.isPromise=d;function v(Z){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Z):i(Z)||V(Z)}r.isArrayBufferView=v;function p(Z){return n(Z)==="Uint8Array"}r.isUint8Array=p;function B(Z){return n(Z)==="Uint8ClampedArray"}r.isUint8ClampedArray=B;function E(Z){return n(Z)==="Uint16Array"}r.isUint16Array=E;function m(Z){return n(Z)==="Uint32Array"}r.isUint32Array=m;function y(Z){return n(Z)==="Int8Array"}r.isInt8Array=y;function w(Z){return n(Z)==="Int16Array"}r.isInt16Array=w;function I(Z){return n(Z)==="Int32Array"}r.isInt32Array=I;function Q(Z){return n(Z)==="Float32Array"}r.isFloat32Array=Q;function x(Z){return n(Z)==="Float64Array"}r.isFloat64Array=x;function U(Z){return n(Z)==="BigInt64Array"}r.isBigInt64Array=U;function b(Z){return n(Z)==="BigUint64Array"}r.isBigUint64Array=b;function C(Z){return s(Z)==="[object Map]"}C.working=typeof Map<"u"&&C(new Map);function D(Z){return typeof Map>"u"?!1:C.working?C(Z):Z instanceof Map}r.isMap=D;function F(Z){return s(Z)==="[object Set]"}F.working=typeof Set<"u"&&F(new Set);function H(Z){return typeof Set>"u"?!1:F.working?F(Z):Z instanceof Set}r.isSet=H;function X(Z){return s(Z)==="[object WeakMap]"}X.working=typeof WeakMap<"u"&&X(new WeakMap);function q(Z){return typeof WeakMap>"u"?!1:X.working?X(Z):Z instanceof WeakMap}r.isWeakMap=q;function re(Z){return s(Z)==="[object WeakSet]"}re.working=typeof WeakSet<"u"&&re(new WeakSet);function ie(Z){return re(Z)}r.isWeakSet=ie;function ge(Z){return s(Z)==="[object ArrayBuffer]"}ge.working=typeof ArrayBuffer<"u"&&ge(new ArrayBuffer);function he(Z){return typeof ArrayBuffer>"u"?!1:ge.working?ge(Z):Z instanceof ArrayBuffer}r.isArrayBuffer=he;function R(Z){return s(Z)==="[object DataView]"}R.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&R(new DataView(new ArrayBuffer(1),0,1));function V(Z){return typeof DataView>"u"?!1:R.working?R(Z):Z instanceof DataView}r.isDataView=V;var J=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ee(Z){return s(Z)==="[object SharedArrayBuffer]"}function ae(Z){return typeof J>"u"?!1:(typeof ee.working>"u"&&(ee.working=ee(new J)),ee.working?ee(Z):Z instanceof J)}r.isSharedArrayBuffer=ae;function j(Z){return s(Z)==="[object AsyncFunction]"}r.isAsyncFunction=j;function G(Z){return s(Z)==="[object Map Iterator]"}r.isMapIterator=G;function oe(Z){return s(Z)==="[object Set Iterator]"}r.isSetIterator=oe;function se(Z){return s(Z)==="[object Generator]"}r.isGeneratorObject=se;function ne(Z){return s(Z)==="[object WebAssembly.Module]"}r.isWebAssemblyCompiledModule=ne;function le(Z){return g(Z,l)}r.isNumberObject=le;function Fe(Z){return g(Z,c)}r.isStringObject=Fe;function W(Z){return g(Z,u)}r.isBooleanObject=W;function xe(Z){return o&&g(Z,f)}r.isBigIntObject=xe;function z(Z){return A&&g(Z,h)}r.isSymbolObject=z;function Y(Z){return le(Z)||Fe(Z)||W(Z)||xe(Z)||z(Z)}r.isBoxedPrimitive=Y;function O(Z){return typeof Uint8Array<"u"&&(he(Z)||ae(Z))}r.isAnyArrayBuffer=O,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Z){Object.defineProperty(r,Z,{enumerable:!1,value:function(){throw new Error(Z+" is not supported in userland")}})})}(CT)),CT}var CR,are;function uOe(){return are||(are=1,CR=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),CR}var ore;function Are(){return ore||(ore=1,function(r){var e=Object.getOwnPropertyDescriptors||function(V){for(var J=Object.keys(V),ee={},ae=0;ae<J.length;ae++)ee[J[ae]]=Object.getOwnPropertyDescriptor(V,J[ae]);return ee},t=/%[sdj%]/g;r.format=function(R){if(!y(R)){for(var V=[],J=0;J<arguments.length;J++)V.push(o(arguments[J]));return V.join(" ")}for(var J=1,ee=arguments,ae=ee.length,j=String(R).replace(t,function(oe){if(oe==="%%")return"%";if(J>=ae)return oe;switch(oe){case"%s":return String(ee[J++]);case"%d":return Number(ee[J++]);case"%j":try{return JSON.stringify(ee[J++])}catch{return"[Circular]"}default:return oe}}),G=ee[J];J<ae;G=ee[++J])B(G)||!x(G)?j+=" "+G:j+=" "+o(G);return j},r.deprecate=function(R,V){if(typeof Hn<"u"&&Hn.noDeprecation===!0)return R;if(typeof Hn>"u")return function(){return r.deprecate(R,V).apply(this,arguments)};var J=!1;function ee(){if(!J){if(Hn.throwDeprecation)throw new Error(V);Hn.traceDeprecation?console.trace(V):console.error(V),J=!0}return R.apply(this,arguments)}return ee};var n={},i=/^$/;if(Hn.env.NODE_DEBUG){var a=Hn.env.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+a+"$","i")}r.debuglog=function(R){if(R=R.toUpperCase(),!n[R])if(i.test(R)){var V=Hn.pid;n[R]=function(){var J=r.format.apply(r,arguments);console.error("%s %d: %s",R,V,J)}}else n[R]=function(){};return n[R]};function o(R,V){var J={seen:[],stylize:s};return arguments.length>=3&&(J.depth=arguments[2]),arguments.length>=4&&(J.colors=arguments[3]),p(V)?J.showHidden=V:V&&r._extend(J,V),I(J.showHidden)&&(J.showHidden=!1),I(J.depth)&&(J.depth=2),I(J.colors)&&(J.colors=!1),I(J.customInspect)&&(J.customInspect=!0),J.colors&&(J.stylize=A),c(J,R,J.depth)}r.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function A(R,V){var J=o.styles[V];return J?"\x1B["+o.colors[J][0]+"m"+R+"\x1B["+o.colors[J][1]+"m":R}function s(R,V){return R}function l(R){var V={};return R.forEach(function(J,ee){V[J]=!0}),V}function c(R,V,J){if(R.customInspect&&V&&C(V.inspect)&&V.inspect!==r.inspect&&!(V.constructor&&V.constructor.prototype===V)){var ee=V.inspect(J,R);return y(ee)||(ee=c(R,ee,J)),ee}var ae=u(R,V);if(ae)return ae;var j=Object.keys(V),G=l(j);if(R.showHidden&&(j=Object.getOwnPropertyNames(V)),b(V)&&(j.indexOf("message")>=0||j.indexOf("description")>=0))return f(V);if(j.length===0){if(C(V)){var oe=V.name?": "+V.name:"";return R.stylize("[Function"+oe+"]","special")}if(Q(V))return R.stylize(RegExp.prototype.toString.call(V),"regexp");if(U(V))return R.stylize(Date.prototype.toString.call(V),"date");if(b(V))return f(V)}var se="",ne=!1,le=["{","}"];if(v(V)&&(ne=!0,le=["[","]"]),C(V)){var Fe=V.name?": "+V.name:"";se=" [Function"+Fe+"]"}if(Q(V)&&(se=" "+RegExp.prototype.toString.call(V)),U(V)&&(se=" "+Date.prototype.toUTCString.call(V)),b(V)&&(se=" "+f(V)),j.length===0&&(!ne||V.length==0))return le[0]+se+le[1];if(J<0)return Q(V)?R.stylize(RegExp.prototype.toString.call(V),"regexp"):R.stylize("[Object]","special");R.seen.push(V);var W;return ne?W=h(R,V,J,G,j):W=j.map(function(xe){return g(R,V,J,G,xe,ne)}),R.seen.pop(),d(W,se,le)}function u(R,V){if(I(V))return R.stylize("undefined","undefined");if(y(V)){var J="'"+JSON.stringify(V).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return R.stylize(J,"string")}if(m(V))return R.stylize(""+V,"number");if(p(V))return R.stylize(""+V,"boolean");if(B(V))return R.stylize("null","null")}function f(R){return"["+Error.prototype.toString.call(R)+"]"}function h(R,V,J,ee,ae){for(var j=[],G=0,oe=V.length;G<oe;++G)re(V,String(G))?j.push(g(R,V,J,ee,String(G),!0)):j.push("");return ae.forEach(function(se){se.match(/^\d+$/)||j.push(g(R,V,J,ee,se,!0))}),j}function g(R,V,J,ee,ae,j){var G,oe,se;if(se=Object.getOwnPropertyDescriptor(V,ae)||{value:V[ae]},se.get?se.set?oe=R.stylize("[Getter/Setter]","special"):oe=R.stylize("[Getter]","special"):se.set&&(oe=R.stylize("[Setter]","special")),re(ee,ae)||(G="["+ae+"]"),oe||(R.seen.indexOf(se.value)<0?(B(J)?oe=c(R,se.value,null):oe=c(R,se.value,J-1),oe.indexOf(`
|
|
185
185
|
`)>-1&&(j?oe=oe.split(`
|
|
186
186
|
`).map(function(ne){return" "+ne}).join(`
|
|
187
187
|
`).slice(2):oe=`
|
|
@@ -204,7 +204,7 @@ Actual: `+j.attribValue);else{var ne=j.tag,le=j.tags[j.tags.length-1]||j;ne.ns==
|
|
|
204
204
|
\0`,J+=a(he,2),J+=w.magic,J+=a(E,2),J+=a(m,2),J+=a(ge.crc32,4),J+=a(ge.compressedSize,4),J+=a(ge.uncompressedSize,4),J+=a(Q.length,2),J+=a(H.length,2),{fileRecord:u.LOCAL_FILE_HEADER+J+Q+H,dirRecord:u.CENTRAL_FILE_HEADER+a(V,2)+J+a(b.length,2)+"\0\0\0\0"+a(R,4)+a(v,4)+Q+H+b}}var A=t("../utils"),s=t("../stream/GenericWorker"),l=t("../utf8"),c=t("../crc32"),u=t("../signature");function f(h,g,d,v){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=d,this.encodeFileName=v,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}A.inherits(f,s),f.prototype.push=function(h){var g=h.meta.percent||0,d=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,s.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:d?(g+100*(d-v-1))/d:100}}))},f.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var g=this.streamFiles&&!h.file.dir;if(g){var d=o(h,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:d.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(h){this.accumulate=!1;var g=this.streamFiles&&!h.file.dir,d=o(h,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(d.dirRecord),g)this.push({data:function(v){return u.DATA_DESCRIPTOR+a(v.crc32,4)+a(v.compressedSize,4)+a(v.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:d.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var h=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var d=this.bytesWritten-h,v=function(p,B,E,m,y){var w=A.transformTo("string",y(m));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(p,2)+a(p,2)+a(B,4)+a(E,4)+a(w.length,2)+w}(this.dirRecords.length,d,h,this.zipComment,this.encodeFileName);this.push({data:v,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(h){this._sources.push(h);var g=this;return h.on("data",function(d){g.processChunk(d)}),h.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),h.on("error",function(d){g.error(d)}),this},f.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(h){var g=this._sources;if(!s.prototype.error.call(this,h))return!1;for(var d=0;d<g.length;d++)try{g[d].error(h)}catch{}return!0},f.prototype.lock=function(){s.prototype.lock.call(this);for(var h=this._sources,g=0;g<h.length;g++)h[g].lock()},n.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,n,i){var a=t("../compressions"),o=t("./ZipFileWorker");i.generateWorker=function(A,s,l){var c=new o(s.streamFiles,l,s.platform,s.encodeFileName),u=0;try{A.forEach(function(f,h){u++;var g=function(B,E){var m=B||E,y=a[m];if(!y)throw new Error(m+" is not a valid compression method !");return y}(h.options.compression,s.compression),d=h.options.compressionOptions||s.compressionOptions||{},v=h.dir,p=h.date;h._compressWorker(g,d).withStreamInfo("file",{name:f,dir:v,date:p,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(c)}),c.entriesCount=u}catch(f){c.error(f)}return c}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,n,i){function a(){if(!(this instanceof a))return new a;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new a;for(var A in this)typeof this[A]!="function"&&(o[A]=this[A]);return o}}(a.prototype=t("./object")).loadAsync=t("./load"),a.support=t("./support"),a.defaults=t("./defaults"),a.version="3.10.1",a.loadAsync=function(o,A){return new a().loadAsync(o,A)},a.external=t("./external"),n.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,n,i){var a=t("./utils"),o=t("./external"),A=t("./utf8"),s=t("./zipEntries"),l=t("./stream/Crc32Probe"),c=t("./nodejsUtils");function u(f){return new o.Promise(function(h,g){var d=f.decompressed.getContentWorker().pipe(new l);d.on("error",function(v){g(v)}).on("end",function(){d.streamInfo.crc32!==f.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}n.exports=function(f,h){var g=this;return h=a.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:A.utf8decode}),c.isNode&&c.isStream(f)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",f,!0,h.optimizedBinaryString,h.base64).then(function(d){var v=new s(h);return v.load(d),v}).then(function(d){var v=[o.Promise.resolve(d)],p=d.files;if(h.checkCRC32)for(var B=0;B<p.length;B++)v.push(u(p[B]));return o.Promise.all(v)}).then(function(d){for(var v=d.shift(),p=v.files,B=0;B<p.length;B++){var E=p[B],m=E.fileNameStr,y=a.resolve(E.fileNameStr);g.file(y,E.decompressed,{binary:!0,optimizedBinaryString:!0,date:E.date,dir:E.dir,comment:E.fileCommentStr.length?E.fileCommentStr:null,unixPermissions:E.unixPermissions,dosPermissions:E.dosPermissions,createFolders:h.createFolders}),E.dir||(g.file(y).unsafeOriginalName=m)}return v.zipComment.length&&(g.comment=v.zipComment),g})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,n,i){var a=t("../utils"),o=t("../stream/GenericWorker");function A(s,l){o.call(this,"Nodejs stream input adapter for "+s),this._upstreamEnded=!1,this._bindStream(l)}a.inherits(A,o),A.prototype._bindStream=function(s){var l=this;(this._stream=s).pause(),s.on("data",function(c){l.push({data:c,meta:{percent:0}})}).on("error",function(c){l.isPaused?this.generatedError=c:l.error(c)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},A.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},A.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=A},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,n,i){var a=t("readable-stream").Readable;function o(A,s,l){a.call(this,s),this._helper=A;var c=this;A.on("data",function(u,f){c.push(u)||c._helper.pause(),l&&l(f)}).on("error",function(u){c.emit("error",u)}).on("end",function(){c.push(null)})}t("../utils").inherits(o,a),o.prototype._read=function(){this._helper.resume()},n.exports=o},{"../utils":32,"readable-stream":16}],14:[function(t,n,i){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(a,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,o);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,o)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var o=new Buffer(a);return o.fill(0),o},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(t,n,i){function a(y,w,I){var Q,x=A.getTypeOf(w),U=A.extend(I||{},c);U.date=U.date||new Date,U.compression!==null&&(U.compression=U.compression.toUpperCase()),typeof U.unixPermissions=="string"&&(U.unixPermissions=parseInt(U.unixPermissions,8)),U.unixPermissions&&16384&U.unixPermissions&&(U.dir=!0),U.dosPermissions&&16&U.dosPermissions&&(U.dir=!0),U.dir&&(y=p(y)),U.createFolders&&(Q=v(y))&&B.call(this,Q,!0);var b=x==="string"&&U.binary===!1&&U.base64===!1;I&&I.binary!==void 0||(U.binary=!b),(w instanceof u&&w.uncompressedSize===0||U.dir||!w||w.length===0)&&(U.base64=!1,U.binary=!0,w="",U.compression="STORE",x="string");var C=null;C=w instanceof u||w instanceof s?w:g.isNode&&g.isStream(w)?new d(y,w):A.prepareContent(y,w,U.binary,U.optimizedBinaryString,U.base64);var D=new f(y,C,U);this.files[y]=D}var o=t("./utf8"),A=t("./utils"),s=t("./stream/GenericWorker"),l=t("./stream/StreamHelper"),c=t("./defaults"),u=t("./compressedObject"),f=t("./zipObject"),h=t("./generate"),g=t("./nodejsUtils"),d=t("./nodejs/NodejsStreamInputAdapter"),v=function(y){y.slice(-1)==="/"&&(y=y.substring(0,y.length-1));var w=y.lastIndexOf("/");return 0<w?y.substring(0,w):""},p=function(y){return y.slice(-1)!=="/"&&(y+="/"),y},B=function(y,w){return w=w!==void 0?w:c.createFolders,y=p(y),this.files[y]||a.call(this,y,null,{dir:!0,createFolders:w}),this.files[y]};function E(y){return Object.prototype.toString.call(y)==="[object RegExp]"}var m={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(y){var w,I,Q;for(w in this.files)Q=this.files[w],(I=w.slice(this.root.length,w.length))&&w.slice(0,this.root.length)===this.root&&y(I,Q)},filter:function(y){var w=[];return this.forEach(function(I,Q){y(I,Q)&&w.push(Q)}),w},file:function(y,w,I){if(arguments.length!==1)return y=this.root+y,a.call(this,y,w,I),this;if(E(y)){var Q=y;return this.filter(function(U,b){return!b.dir&&Q.test(U)})}var x=this.files[this.root+y];return x&&!x.dir?x:null},folder:function(y){if(!y)return this;if(E(y))return this.filter(function(x,U){return U.dir&&y.test(x)});var w=this.root+y,I=B.call(this,w),Q=this.clone();return Q.root=I.name,Q},remove:function(y){y=this.root+y;var w=this.files[y];if(w||(y.slice(-1)!=="/"&&(y+="/"),w=this.files[y]),w&&!w.dir)delete this.files[y];else for(var I=this.filter(function(x,U){return U.name.slice(0,y.length)===y}),Q=0;Q<I.length;Q++)delete this.files[I[Q].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(y){var w,I={};try{if((I=A.extend(y||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=I.type.toLowerCase(),I.compression=I.compression.toUpperCase(),I.type==="binarystring"&&(I.type="string"),!I.type)throw new Error("No output type specified.");A.checkSupport(I.type),I.platform!=="darwin"&&I.platform!=="freebsd"&&I.platform!=="linux"&&I.platform!=="sunos"||(I.platform="UNIX"),I.platform==="win32"&&(I.platform="DOS");var Q=I.comment||this.comment||"";w=h.generateWorker(this,I,Q)}catch(x){(w=new s("error")).error(x)}return new l(w,I.type||"string",I.mimeType)},generateAsync:function(y,w){return this.generateInternalStream(y).accumulate(w)},generateNodeStream:function(y,w){return(y=y||{}).type||(y.type="nodebuffer"),this.generateInternalStream(y).toNodejsStream(w)}};n.exports=m},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,n,i){n.exports=t("stream")},{stream:void 0}],17:[function(t,n,i){var a=t("./DataReader");function o(A){a.call(this,A);for(var s=0;s<this.data.length;s++)A[s]=255&A[s]}t("../utils").inherits(o,a),o.prototype.byteAt=function(A){return this.data[this.zero+A]},o.prototype.lastIndexOfSignature=function(A){for(var s=A.charCodeAt(0),l=A.charCodeAt(1),c=A.charCodeAt(2),u=A.charCodeAt(3),f=this.length-4;0<=f;--f)if(this.data[f]===s&&this.data[f+1]===l&&this.data[f+2]===c&&this.data[f+3]===u)return f-this.zero;return-1},o.prototype.readAndCheckSignature=function(A){var s=A.charCodeAt(0),l=A.charCodeAt(1),c=A.charCodeAt(2),u=A.charCodeAt(3),f=this.readData(4);return s===f[0]&&l===f[1]&&c===f[2]&&u===f[3]},o.prototype.readData=function(A){if(this.checkOffset(A),A===0)return[];var s=this.data.slice(this.zero+this.index,this.zero+this.index+A);return this.index+=A,s},n.exports=o},{"../utils":32,"./DataReader":18}],18:[function(t,n,i){var a=t("../utils");function o(A){this.data=A,this.length=A.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(A){this.checkIndex(this.index+A)},checkIndex:function(A){if(this.length<this.zero+A||A<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+A+"). Corrupted zip ?")},setIndex:function(A){this.checkIndex(A),this.index=A},skip:function(A){this.setIndex(this.index+A)},byteAt:function(){},readInt:function(A){var s,l=0;for(this.checkOffset(A),s=this.index+A-1;s>=this.index;s--)l=(l<<8)+this.byteAt(s);return this.index+=A,l},readString:function(A){return a.transformTo("string",this.readData(A))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var A=this.readInt(4);return new Date(Date.UTC(1980+(A>>25&127),(A>>21&15)-1,A>>16&31,A>>11&31,A>>5&63,(31&A)<<1))}},n.exports=o},{"../utils":32}],19:[function(t,n,i){var a=t("./Uint8ArrayReader");function o(A){a.call(this,A)}t("../utils").inherits(o,a),o.prototype.readData=function(A){this.checkOffset(A);var s=this.data.slice(this.zero+this.index,this.zero+this.index+A);return this.index+=A,s},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,i){var a=t("./DataReader");function o(A){a.call(this,A)}t("../utils").inherits(o,a),o.prototype.byteAt=function(A){return this.data.charCodeAt(this.zero+A)},o.prototype.lastIndexOfSignature=function(A){return this.data.lastIndexOf(A)-this.zero},o.prototype.readAndCheckSignature=function(A){return A===this.readData(4)},o.prototype.readData=function(A){this.checkOffset(A);var s=this.data.slice(this.zero+this.index,this.zero+this.index+A);return this.index+=A,s},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,n,i){var a=t("./ArrayReader");function o(A){a.call(this,A)}t("../utils").inherits(o,a),o.prototype.readData=function(A){if(this.checkOffset(A),A===0)return new Uint8Array(0);var s=this.data.subarray(this.zero+this.index,this.zero+this.index+A);return this.index+=A,s},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,i){var a=t("../utils"),o=t("../support"),A=t("./ArrayReader"),s=t("./StringReader"),l=t("./NodeBufferReader"),c=t("./Uint8ArrayReader");n.exports=function(u){var f=a.getTypeOf(u);return a.checkSupport(f),f!=="string"||o.uint8array?f==="nodebuffer"?new l(u):o.uint8array?new c(a.transformTo("uint8array",u)):new A(a.transformTo("array",u)):new s(u)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,i){var a=t("./GenericWorker"),o=t("../utils");function A(s){a.call(this,"ConvertWorker to "+s),this.destType=s}o.inherits(A,a),A.prototype.processChunk=function(s){this.push({data:o.transformTo(this.destType,s.data),meta:s.meta})},n.exports=A},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,i){var a=t("./GenericWorker"),o=t("../crc32");function A(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(A,a),A.prototype.processChunk=function(s){this.streamInfo.crc32=o(s.data,this.streamInfo.crc32||0),this.push(s)},n.exports=A},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,i){var a=t("../utils"),o=t("./GenericWorker");function A(s){o.call(this,"DataLengthProbe for "+s),this.propName=s,this.withStreamInfo(s,0)}a.inherits(A,o),A.prototype.processChunk=function(s){if(s){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+s.data.length}o.prototype.processChunk.call(this,s)},n.exports=A},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,i){var a=t("../utils"),o=t("./GenericWorker");function A(s){o.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,s.then(function(c){l.dataIsReady=!0,l.data=c,l.max=c&&c.length||0,l.type=a.getTypeOf(c),l.isPaused||l._tickAndRepeat()},function(c){l.error(c)})}a.inherits(A,o),A.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},A.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},A.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},A.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var s=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":s=this.data.substring(this.index,l);break;case"uint8array":s=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":s=this.data.slice(this.index,l)}return this.index=l,this.push({data:s,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=A},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,i){function a(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,A){return this._listeners[o].push(A),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,A){if(this._listeners[o])for(var s=0;s<this._listeners[o].length;s++)this._listeners[o][s].call(this,A)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var A=this;return o.on("data",function(s){A.processChunk(s)}),o.on("end",function(){A.end()}),o.on("error",function(s){A.error(s)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,A){return this.extraStreamInfo[o]=A,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},n.exports=a},{}],29:[function(t,n,i){var a=t("../utils"),o=t("./ConvertWorker"),A=t("./GenericWorker"),s=t("../base64"),l=t("../support"),c=t("../external"),u=null;if(l.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function f(g,d){return new c.Promise(function(v,p){var B=[],E=g._internalType,m=g._outputType,y=g._mimeType;g.on("data",function(w,I){B.push(w),d&&d(I)}).on("error",function(w){B=[],p(w)}).on("end",function(){try{var w=function(I,Q,x){switch(I){case"blob":return a.newBlob(a.transformTo("arraybuffer",Q),x);case"base64":return s.encode(Q);default:return a.transformTo(I,Q)}}(m,function(I,Q){var x,U=0,b=null,C=0;for(x=0;x<Q.length;x++)C+=Q[x].length;switch(I){case"string":return Q.join("");case"array":return Array.prototype.concat.apply([],Q);case"uint8array":for(b=new Uint8Array(C),x=0;x<Q.length;x++)b.set(Q[x],U),U+=Q[x].length;return b;case"nodebuffer":return Buffer.concat(Q);default:throw new Error("concat : unsupported type '"+I+"'")}}(E,B),y);v(w)}catch(I){p(I)}B=[]}).resume()})}function h(g,d,v){var p=d;switch(d){case"blob":case"arraybuffer":p="uint8array";break;case"base64":p="string"}try{this._internalType=p,this._outputType=d,this._mimeType=v,a.checkSupport(p),this._worker=g.pipe(new o(p)),g.lock()}catch(B){this._worker=new A("error"),this._worker.error(B)}}h.prototype={accumulate:function(g){return f(this,g)},on:function(g,d){var v=this;return g==="data"?this._worker.on(g,function(p){d.call(v,p.data,p.meta)}):this._worker.on(g,function(){a.delay(d,arguments,v)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(g){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:this._outputType!=="nodebuffer"},g)}},n.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,n,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var a=new ArrayBuffer(0);try{i.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,n,i){for(var a=t("./utils"),o=t("./support"),A=t("./nodejsUtils"),s=t("./stream/GenericWorker"),l=new Array(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;l[254]=l[254]=1;function u(){s.call(this,"utf-8 decode"),this.leftOver=null}function f(){s.call(this,"utf-8 encode")}i.utf8encode=function(h){return o.nodebuffer?A.newBufferFrom(h,"utf-8"):function(g){var d,v,p,B,E,m=g.length,y=0;for(B=0;B<m;B++)(64512&(v=g.charCodeAt(B)))==55296&&B+1<m&&(64512&(p=g.charCodeAt(B+1)))==56320&&(v=65536+(v-55296<<10)+(p-56320),B++),y+=v<128?1:v<2048?2:v<65536?3:4;for(d=o.uint8array?new Uint8Array(y):new Array(y),B=E=0;E<y;B++)(64512&(v=g.charCodeAt(B)))==55296&&B+1<m&&(64512&(p=g.charCodeAt(B+1)))==56320&&(v=65536+(v-55296<<10)+(p-56320),B++),v<128?d[E++]=v:(v<2048?d[E++]=192|v>>>6:(v<65536?d[E++]=224|v>>>12:(d[E++]=240|v>>>18,d[E++]=128|v>>>12&63),d[E++]=128|v>>>6&63),d[E++]=128|63&v);return d}(h)},i.utf8decode=function(h){return o.nodebuffer?a.transformTo("nodebuffer",h).toString("utf-8"):function(g){var d,v,p,B,E=g.length,m=new Array(2*E);for(d=v=0;d<E;)if((p=g[d++])<128)m[v++]=p;else if(4<(B=l[p]))m[v++]=65533,d+=B-1;else{for(p&=B===2?31:B===3?15:7;1<B&&d<E;)p=p<<6|63&g[d++],B--;1<B?m[v++]=65533:p<65536?m[v++]=p:(p-=65536,m[v++]=55296|p>>10&1023,m[v++]=56320|1023&p)}return m.length!==v&&(m.subarray?m=m.subarray(0,v):m.length=v),a.applyFromCharCode(m)}(h=a.transformTo(o.uint8array?"uint8array":"array",h))},a.inherits(u,s),u.prototype.processChunk=function(h){var g=a.transformTo(o.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var d=g;(g=new Uint8Array(d.length+this.leftOver.length)).set(this.leftOver,0),g.set(d,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var v=function(B,E){var m;for((E=E||B.length)>B.length&&(E=B.length),m=E-1;0<=m&&(192&B[m])==128;)m--;return m<0||m===0?E:m+l[B[m]]>E?m:E}(g),p=g;v!==g.length&&(o.uint8array?(p=g.subarray(0,v),this.leftOver=g.subarray(v,g.length)):(p=g.slice(0,v),this.leftOver=g.slice(v,g.length))),this.push({data:i.utf8decode(p),meta:h.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=u,a.inherits(f,s),f.prototype.processChunk=function(h){this.push({data:i.utf8encode(h.data),meta:h.meta})},i.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){var a=t("./support"),o=t("./base64"),A=t("./nodejsUtils"),s=t("./external");function l(d){return d}function c(d,v){for(var p=0;p<d.length;++p)v[p]=255&d.charCodeAt(p);return v}t("setimmediate"),i.newBlob=function(d,v){i.checkSupport("blob");try{return new Blob([d],{type:v})}catch{try{var p=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return p.append(d),p.getBlob(v)}catch{throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(d,v,p){var B=[],E=0,m=d.length;if(m<=p)return String.fromCharCode.apply(null,d);for(;E<m;)v==="array"||v==="nodebuffer"?B.push(String.fromCharCode.apply(null,d.slice(E,Math.min(E+p,m)))):B.push(String.fromCharCode.apply(null,d.subarray(E,Math.min(E+p,m)))),E+=p;return B.join("")},stringifyByChar:function(d){for(var v="",p=0;p<d.length;p++)v+=String.fromCharCode(d[p]);return v},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,A.allocBuffer(1)).length===1}catch{return!1}}()}};function f(d){var v=65536,p=i.getTypeOf(d),B=!0;if(p==="uint8array"?B=u.applyCanBeUsed.uint8array:p==="nodebuffer"&&(B=u.applyCanBeUsed.nodebuffer),B)for(;1<v;)try{return u.stringifyByChunk(d,p,v)}catch{v=Math.floor(v/2)}return u.stringifyByChar(d)}function h(d,v){for(var p=0;p<d.length;p++)v[p]=d[p];return v}i.applyFromCharCode=f;var g={};g.string={string:l,array:function(d){return c(d,new Array(d.length))},arraybuffer:function(d){return g.string.uint8array(d).buffer},uint8array:function(d){return c(d,new Uint8Array(d.length))},nodebuffer:function(d){return c(d,A.allocBuffer(d.length))}},g.array={string:f,array:l,arraybuffer:function(d){return new Uint8Array(d).buffer},uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return A.newBufferFrom(d)}},g.arraybuffer={string:function(d){return f(new Uint8Array(d))},array:function(d){return h(new Uint8Array(d),new Array(d.byteLength))},arraybuffer:l,uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return A.newBufferFrom(new Uint8Array(d))}},g.uint8array={string:f,array:function(d){return h(d,new Array(d.length))},arraybuffer:function(d){return d.buffer},uint8array:l,nodebuffer:function(d){return A.newBufferFrom(d)}},g.nodebuffer={string:f,array:function(d){return h(d,new Array(d.length))},arraybuffer:function(d){return g.nodebuffer.uint8array(d).buffer},uint8array:function(d){return h(d,new Uint8Array(d.length))},nodebuffer:l},i.transformTo=function(d,v){if(v=v||"",!d)return v;i.checkSupport(d);var p=i.getTypeOf(v);return g[p][d](v)},i.resolve=function(d){for(var v=d.split("/"),p=[],B=0;B<v.length;B++){var E=v[B];E==="."||E===""&&B!==0&&B!==v.length-1||(E===".."?p.pop():p.push(E))}return p.join("/")},i.getTypeOf=function(d){return typeof d=="string"?"string":Object.prototype.toString.call(d)==="[object Array]"?"array":a.nodebuffer&&A.isBuffer(d)?"nodebuffer":a.uint8array&&d instanceof Uint8Array?"uint8array":a.arraybuffer&&d instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(d){if(!a[d.toLowerCase()])throw new Error(d+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(d){var v,p,B="";for(p=0;p<(d||"").length;p++)B+="\\x"+((v=d.charCodeAt(p))<16?"0":"")+v.toString(16).toUpperCase();return B},i.delay=function(d,v,p){setImmediate(function(){d.apply(p||null,v||[])})},i.inherits=function(d,v){function p(){}p.prototype=v.prototype,d.prototype=new p},i.extend=function(){var d,v,p={};for(d=0;d<arguments.length;d++)for(v in arguments[d])Object.prototype.hasOwnProperty.call(arguments[d],v)&&p[v]===void 0&&(p[v]=arguments[d][v]);return p},i.prepareContent=function(d,v,p,B,E){return s.Promise.resolve(v).then(function(m){return a.blob&&(m instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(m))!==-1)&&typeof FileReader<"u"?new s.Promise(function(y,w){var I=new FileReader;I.onload=function(Q){y(Q.target.result)},I.onerror=function(Q){w(Q.target.error)},I.readAsArrayBuffer(m)}):m}).then(function(m){var y=i.getTypeOf(m);return y?(y==="arraybuffer"?m=i.transformTo("uint8array",m):y==="string"&&(E?m=o.decode(m):p&&B!==!0&&(m=function(w){return c(w,a.uint8array?new Uint8Array(w.length):new Array(w.length))}(m))),m):s.Promise.reject(new Error("Can't read the data of '"+d+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,n,i){var a=t("./reader/readerFor"),o=t("./utils"),A=t("./signature"),s=t("./zipEntry"),l=t("./support");function c(u){this.files=[],this.loadOptions=u}c.prototype={checkSignature:function(u){if(!this.reader.readAndCheckSignature(u)){this.reader.index-=4;var f=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(f)+", expected "+o.pretty(u)+")")}},isSignature:function(u,f){var h=this.reader.index;this.reader.setIndex(u);var g=this.reader.readString(4)===f;return this.reader.setIndex(h),g},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var u=this.reader.readData(this.zipCommentLength),f=l.uint8array?"uint8array":"array",h=o.transformTo(f,u);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var u,f,h,g=this.zip64EndOfCentralSize-44;0<g;)u=this.reader.readInt(2),f=this.reader.readInt(4),h=this.reader.readData(f),this.zip64ExtensibleData[u]={id:u,length:f,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var u,f;for(u=0;u<this.files.length;u++)f=this.files[u],this.reader.setIndex(f.localHeaderOffset),this.checkSignature(A.LOCAL_FILE_HEADER),f.readLocalPart(this.reader),f.handleUTF8(),f.processAttributes()},readCentralDir:function(){var u;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(A.CENTRAL_FILE_HEADER);)(u=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(u);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var u=this.reader.lastIndexOfSignature(A.CENTRAL_DIRECTORY_END);if(u<0)throw this.isSignature(0,A.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(u);var f=u;if(this.checkSignature(A.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(u=this.reader.lastIndexOfSignature(A.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(u),this.checkSignature(A.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,A.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(A.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(A.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var g=f-h;if(0<g)this.isSignature(f,A.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(u){this.reader=a(u)},load:function(u){this.prepareReader(u),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,n,i){var a=t("./reader/readerFor"),o=t("./utils"),A=t("./compressedObject"),s=t("./crc32"),l=t("./utf8"),c=t("./compressions"),u=t("./support");function f(h,g){this.options=h,this.loadOptions=g}f.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var g,d;if(h.skip(22),this.fileNameLength=h.readInt(2),d=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(d),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((g=function(v){for(var p in c)if(Object.prototype.hasOwnProperty.call(c,p)&&c[p].magic===v)return c[p];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new A(this.compressedSize,this.uncompressedSize,this.crc32,g,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var g=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(g),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var g,d,v,p=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<p;)g=h.readInt(2),d=h.readInt(2),v=h.readData(d),this.extraFields[g]={id:g,length:d,value:v};h.setIndex(p)},handleUTF8:function(){var h=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var d=o.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(d)}var v=this.findExtraFieldUnicodeComment();if(v!==null)this.fileCommentStr=v;else{var p=o.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(p)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var g=a(h.value);return g.readInt(1)!==1||s(this.fileName)!==g.readInt(4)?null:l.utf8decode(g.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var g=a(h.value);return g.readInt(1)!==1||s(this.fileComment)!==g.readInt(4)?null:l.utf8decode(g.readData(h.length-5))}return null}},n.exports=f},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,n,i){function a(g,d,v){this.name=g,this.dir=v.dir,this.date=v.date,this.comment=v.comment,this.unixPermissions=v.unixPermissions,this.dosPermissions=v.dosPermissions,this._data=d,this._dataBinary=v.binary,this.options={compression:v.compression,compressionOptions:v.compressionOptions}}var o=t("./stream/StreamHelper"),A=t("./stream/DataWorker"),s=t("./utf8"),l=t("./compressedObject"),c=t("./stream/GenericWorker");a.prototype={internalStream:function(g){var d=null,v="string";try{if(!g)throw new Error("No output type specified.");var p=(v=g.toLowerCase())==="string"||v==="text";v!=="binarystring"&&v!=="text"||(v="string"),d=this._decompressWorker();var B=!this._dataBinary;B&&!p&&(d=d.pipe(new s.Utf8EncodeWorker)),!B&&p&&(d=d.pipe(new s.Utf8DecodeWorker))}catch(E){(d=new c("error")).error(E)}return new o(d,v,"")},async:function(g,d){return this.internalStream(g).accumulate(d)},nodeStream:function(g,d){return this.internalStream(g||"nodebuffer").toNodejsStream(d)},_compressWorker:function(g,d){if(this._data instanceof l&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var v=this._decompressWorker();return this._dataBinary||(v=v.pipe(new s.Utf8EncodeWorker)),l.createWorkerFrom(v,g,d)},_decompressWorker:function(){return this._data instanceof l?this._data.getContentWorker():this._data instanceof c?this._data:new A(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<u.length;h++)a.prototype[u[h]]=f;n.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,n,i){(function(a){var o,A,s=a.MutationObserver||a.WebKitMutationObserver;if(s){var l=0,c=new s(g),u=a.document.createTextNode("");c.observe(u,{characterData:!0}),o=function(){u.data=l=++l%2}}else if(a.setImmediate||a.MessageChannel===void 0)o="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var d=a.document.createElement("script");d.onreadystatechange=function(){g(),d.onreadystatechange=null,d.parentNode.removeChild(d),d=null},a.document.documentElement.appendChild(d)}:function(){setTimeout(g,0)};else{var f=new a.MessageChannel;f.port1.onmessage=g,o=function(){f.port2.postMessage(0)}}var h=[];function g(){var d,v;A=!0;for(var p=h.length;p;){for(v=h,h=[],d=-1;++d<p;)v[d]();p=h.length}A=!1}n.exports=function(d){h.push(d)!==1||A||o()}}).call(this,typeof M0<"u"?M0:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,n,i){var a=t("immediate");function o(){}var A={},s=["REJECTED"],l=["FULFILLED"],c=["PENDING"];function u(p){if(typeof p!="function")throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,p!==o&&d(this,p)}function f(p,B,E){this.promise=p,typeof B=="function"&&(this.onFulfilled=B,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}function h(p,B,E){a(function(){var m;try{m=B(E)}catch(y){return A.reject(p,y)}m===p?A.reject(p,new TypeError("Cannot resolve promise with itself")):A.resolve(p,m)})}function g(p){var B=p&&p.then;if(p&&(typeof p=="object"||typeof p=="function")&&typeof B=="function")return function(){B.apply(p,arguments)}}function d(p,B){var E=!1;function m(I){E||(E=!0,A.reject(p,I))}function y(I){E||(E=!0,A.resolve(p,I))}var w=v(function(){B(y,m)});w.status==="error"&&m(w.value)}function v(p,B){var E={};try{E.value=p(B),E.status="success"}catch(m){E.status="error",E.value=m}return E}(n.exports=u).prototype.finally=function(p){if(typeof p!="function")return this;var B=this.constructor;return this.then(function(E){return B.resolve(p()).then(function(){return E})},function(E){return B.resolve(p()).then(function(){throw E})})},u.prototype.catch=function(p){return this.then(null,p)},u.prototype.then=function(p,B){if(typeof p!="function"&&this.state===l||typeof B!="function"&&this.state===s)return this;var E=new this.constructor(o);return this.state!==c?h(E,this.state===l?p:B,this.outcome):this.queue.push(new f(E,p,B)),E},f.prototype.callFulfilled=function(p){A.resolve(this.promise,p)},f.prototype.otherCallFulfilled=function(p){h(this.promise,this.onFulfilled,p)},f.prototype.callRejected=function(p){A.reject(this.promise,p)},f.prototype.otherCallRejected=function(p){h(this.promise,this.onRejected,p)},A.resolve=function(p,B){var E=v(g,B);if(E.status==="error")return A.reject(p,E.value);var m=E.value;if(m)d(p,m);else{p.state=l,p.outcome=B;for(var y=-1,w=p.queue.length;++y<w;)p.queue[y].callFulfilled(B)}return p},A.reject=function(p,B){p.state=s,p.outcome=B;for(var E=-1,m=p.queue.length;++E<m;)p.queue[E].callRejected(B);return p},u.resolve=function(p){return p instanceof this?p:A.resolve(new this(o),p)},u.reject=function(p){var B=new this(o);return A.reject(B,p)},u.all=function(p){var B=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=p.length,m=!1;if(!E)return this.resolve([]);for(var y=new Array(E),w=0,I=-1,Q=new this(o);++I<E;)x(p[I],I);return Q;function x(U,b){B.resolve(U).then(function(C){y[b]=C,++w!==E||m||(m=!0,A.resolve(Q,y))},function(C){m||(m=!0,A.reject(Q,C))})}},u.race=function(p){var B=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=p.length,m=!1;if(!E)return this.resolve([]);for(var y=-1,w=new this(o);++y<E;)I=p[y],B.resolve(I).then(function(Q){m||(m=!0,A.resolve(w,Q))},function(Q){m||(m=!0,A.reject(w,Q))});var I;return w}},{immediate:36}],38:[function(t,n,i){var a={};(0,t("./lib/utils/common").assign)(a,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),n.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,n,i){var a=t("./zlib/deflate"),o=t("./utils/common"),A=t("./utils/strings"),s=t("./zlib/messages"),l=t("./zlib/zstream"),c=Object.prototype.toString,u=0,f=-1,h=0,g=8;function d(p){if(!(this instanceof d))return new d(p);this.options=o.assign({level:f,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},p||{});var B=this.options;B.raw&&0<B.windowBits?B.windowBits=-B.windowBits:B.gzip&&0<B.windowBits&&B.windowBits<16&&(B.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var E=a.deflateInit2(this.strm,B.level,B.method,B.windowBits,B.memLevel,B.strategy);if(E!==u)throw new Error(s[E]);if(B.header&&a.deflateSetHeader(this.strm,B.header),B.dictionary){var m;if(m=typeof B.dictionary=="string"?A.string2buf(B.dictionary):c.call(B.dictionary)==="[object ArrayBuffer]"?new Uint8Array(B.dictionary):B.dictionary,(E=a.deflateSetDictionary(this.strm,m))!==u)throw new Error(s[E]);this._dict_set=!0}}function v(p,B){var E=new d(B);if(E.push(p,!0),E.err)throw E.msg||s[E.err];return E.result}d.prototype.push=function(p,B){var E,m,y=this.strm,w=this.options.chunkSize;if(this.ended)return!1;m=B===~~B?B:B===!0?4:0,typeof p=="string"?y.input=A.string2buf(p):c.call(p)==="[object ArrayBuffer]"?y.input=new Uint8Array(p):y.input=p,y.next_in=0,y.avail_in=y.input.length;do{if(y.avail_out===0&&(y.output=new o.Buf8(w),y.next_out=0,y.avail_out=w),(E=a.deflate(y,m))!==1&&E!==u)return this.onEnd(E),!(this.ended=!0);y.avail_out!==0&&(y.avail_in!==0||m!==4&&m!==2)||(this.options.to==="string"?this.onData(A.buf2binstring(o.shrinkBuf(y.output,y.next_out))):this.onData(o.shrinkBuf(y.output,y.next_out)))}while((0<y.avail_in||y.avail_out===0)&&E!==1);return m===4?(E=a.deflateEnd(this.strm),this.onEnd(E),this.ended=!0,E===u):m!==2||(this.onEnd(u),!(y.avail_out=0))},d.prototype.onData=function(p){this.chunks.push(p)},d.prototype.onEnd=function(p){p===u&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},i.Deflate=d,i.deflate=v,i.deflateRaw=function(p,B){return(B=B||{}).raw=!0,v(p,B)},i.gzip=function(p,B){return(B=B||{}).gzip=!0,v(p,B)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,n,i){var a=t("./zlib/inflate"),o=t("./utils/common"),A=t("./utils/strings"),s=t("./zlib/constants"),l=t("./zlib/messages"),c=t("./zlib/zstream"),u=t("./zlib/gzheader"),f=Object.prototype.toString;function h(d){if(!(this instanceof h))return new h(d);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},d||{});var v=this.options;v.raw&&0<=v.windowBits&&v.windowBits<16&&(v.windowBits=-v.windowBits,v.windowBits===0&&(v.windowBits=-15)),!(0<=v.windowBits&&v.windowBits<16)||d&&d.windowBits||(v.windowBits+=32),15<v.windowBits&&v.windowBits<48&&!(15&v.windowBits)&&(v.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var p=a.inflateInit2(this.strm,v.windowBits);if(p!==s.Z_OK)throw new Error(l[p]);this.header=new u,a.inflateGetHeader(this.strm,this.header)}function g(d,v){var p=new h(v);if(p.push(d,!0),p.err)throw p.msg||l[p.err];return p.result}h.prototype.push=function(d,v){var p,B,E,m,y,w,I=this.strm,Q=this.options.chunkSize,x=this.options.dictionary,U=!1;if(this.ended)return!1;B=v===~~v?v:v===!0?s.Z_FINISH:s.Z_NO_FLUSH,typeof d=="string"?I.input=A.binstring2buf(d):f.call(d)==="[object ArrayBuffer]"?I.input=new Uint8Array(d):I.input=d,I.next_in=0,I.avail_in=I.input.length;do{if(I.avail_out===0&&(I.output=new o.Buf8(Q),I.next_out=0,I.avail_out=Q),(p=a.inflate(I,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&x&&(w=typeof x=="string"?A.string2buf(x):f.call(x)==="[object ArrayBuffer]"?new Uint8Array(x):x,p=a.inflateSetDictionary(this.strm,w)),p===s.Z_BUF_ERROR&&U===!0&&(p=s.Z_OK,U=!1),p!==s.Z_STREAM_END&&p!==s.Z_OK)return this.onEnd(p),!(this.ended=!0);I.next_out&&(I.avail_out!==0&&p!==s.Z_STREAM_END&&(I.avail_in!==0||B!==s.Z_FINISH&&B!==s.Z_SYNC_FLUSH)||(this.options.to==="string"?(E=A.utf8border(I.output,I.next_out),m=I.next_out-E,y=A.buf2string(I.output,E),I.next_out=m,I.avail_out=Q-m,m&&o.arraySet(I.output,I.output,E,m,0),this.onData(y)):this.onData(o.shrinkBuf(I.output,I.next_out)))),I.avail_in===0&&I.avail_out===0&&(U=!0)}while((0<I.avail_in||I.avail_out===0)&&p!==s.Z_STREAM_END);return p===s.Z_STREAM_END&&(B=s.Z_FINISH),B===s.Z_FINISH?(p=a.inflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===s.Z_OK):B!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),!(I.avail_out=0))},h.prototype.onData=function(d){this.chunks.push(d)},h.prototype.onEnd=function(d){d===s.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=d,this.msg=this.strm.msg},i.Inflate=h,i.inflate=g,i.inflateRaw=function(d,v){return(v=v||{}).raw=!0,g(d,v)},i.ungzip=g},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,n,i){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(s){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var c=l.shift();if(c){if(typeof c!="object")throw new TypeError(c+"must be non-object");for(var u in c)c.hasOwnProperty(u)&&(s[u]=c[u])}}return s},i.shrinkBuf=function(s,l){return s.length===l?s:s.subarray?s.subarray(0,l):(s.length=l,s)};var o={arraySet:function(s,l,c,u,f){if(l.subarray&&s.subarray)s.set(l.subarray(c,c+u),f);else for(var h=0;h<u;h++)s[f+h]=l[c+h]},flattenChunks:function(s){var l,c,u,f,h,g;for(l=u=0,c=s.length;l<c;l++)u+=s[l].length;for(g=new Uint8Array(u),l=f=0,c=s.length;l<c;l++)h=s[l],g.set(h,f),f+=h.length;return g}},A={arraySet:function(s,l,c,u,f){for(var h=0;h<u;h++)s[f+h]=l[c+h]},flattenChunks:function(s){return[].concat.apply([],s)}};i.setTyped=function(s){s?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,o)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,A))},i.setTyped(a)},{}],42:[function(t,n,i){var a=t("./common"),o=!0,A=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{A=!1}for(var s=new a.Buf8(256),l=0;l<256;l++)s[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(u,f){if(f<65537&&(u.subarray&&A||!u.subarray&&o))return String.fromCharCode.apply(null,a.shrinkBuf(u,f));for(var h="",g=0;g<f;g++)h+=String.fromCharCode(u[g]);return h}s[254]=s[254]=1,i.string2buf=function(u){var f,h,g,d,v,p=u.length,B=0;for(d=0;d<p;d++)(64512&(h=u.charCodeAt(d)))==55296&&d+1<p&&(64512&(g=u.charCodeAt(d+1)))==56320&&(h=65536+(h-55296<<10)+(g-56320),d++),B+=h<128?1:h<2048?2:h<65536?3:4;for(f=new a.Buf8(B),d=v=0;v<B;d++)(64512&(h=u.charCodeAt(d)))==55296&&d+1<p&&(64512&(g=u.charCodeAt(d+1)))==56320&&(h=65536+(h-55296<<10)+(g-56320),d++),h<128?f[v++]=h:(h<2048?f[v++]=192|h>>>6:(h<65536?f[v++]=224|h>>>12:(f[v++]=240|h>>>18,f[v++]=128|h>>>12&63),f[v++]=128|h>>>6&63),f[v++]=128|63&h);return f},i.buf2binstring=function(u){return c(u,u.length)},i.binstring2buf=function(u){for(var f=new a.Buf8(u.length),h=0,g=f.length;h<g;h++)f[h]=u.charCodeAt(h);return f},i.buf2string=function(u,f){var h,g,d,v,p=f||u.length,B=new Array(2*p);for(h=g=0;h<p;)if((d=u[h++])<128)B[g++]=d;else if(4<(v=s[d]))B[g++]=65533,h+=v-1;else{for(d&=v===2?31:v===3?15:7;1<v&&h<p;)d=d<<6|63&u[h++],v--;1<v?B[g++]=65533:d<65536?B[g++]=d:(d-=65536,B[g++]=55296|d>>10&1023,B[g++]=56320|1023&d)}return c(B,g)},i.utf8border=function(u,f){var h;for((f=f||u.length)>u.length&&(f=u.length),h=f-1;0<=h&&(192&u[h])==128;)h--;return h<0||h===0?f:h+s[u[h]]>f?h:f}},{"./common":41}],43:[function(t,n,i){n.exports=function(a,o,A,s){for(var l=65535&a|0,c=a>>>16&65535|0,u=0;A!==0;){for(A-=u=2e3<A?2e3:A;c=c+(l=l+o[s++]|0)|0,--u;);l%=65521,c%=65521}return l|c<<16|0}},{}],44:[function(t,n,i){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,n,i){var a=function(){for(var o,A=[],s=0;s<256;s++){o=s;for(var l=0;l<8;l++)o=1&o?3988292384^o>>>1:o>>>1;A[s]=o}return A}();n.exports=function(o,A,s,l){var c=a,u=l+s;o^=-1;for(var f=l;f<u;f++)o=o>>>8^c[255&(o^A[f])];return-1^o}},{}],46:[function(t,n,i){var a,o=t("../utils/common"),A=t("./trees"),s=t("./adler32"),l=t("./crc32"),c=t("./messages"),u=0,f=4,h=0,g=-2,d=-1,v=4,p=2,B=8,E=9,m=286,y=30,w=19,I=2*m+1,Q=15,x=3,U=258,b=U+x+1,C=42,D=113,F=1,H=2,X=3,q=4;function re(W,xe){return W.msg=c[xe],xe}function ie(W){return(W<<1)-(4<W?9:0)}function ge(W){for(var xe=W.length;0<=--xe;)W[xe]=0}function he(W){var xe=W.state,z=xe.pending;z>W.avail_out&&(z=W.avail_out),z!==0&&(o.arraySet(W.output,xe.pending_buf,xe.pending_out,z,W.next_out),W.next_out+=z,xe.pending_out+=z,W.total_out+=z,W.avail_out-=z,xe.pending-=z,xe.pending===0&&(xe.pending_out=0))}function R(W,xe){A._tr_flush_block(W,0<=W.block_start?W.block_start:-1,W.strstart-W.block_start,xe),W.block_start=W.strstart,he(W.strm)}function V(W,xe){W.pending_buf[W.pending++]=xe}function J(W,xe){W.pending_buf[W.pending++]=xe>>>8&255,W.pending_buf[W.pending++]=255&xe}function ee(W,xe){var z,Y,O=W.max_chain_length,Z=W.strstart,Be=W.prev_length,Ce=W.nice_match,Ie=W.strstart>W.w_size-b?W.strstart-(W.w_size-b):0,je=W.window,qe=W.w_mask,et=W.prev,yt=W.strstart+U,Yt=je[Z+Be-1],kt=je[Z+Be];W.prev_length>=W.good_match&&(O>>=2),Ce>W.lookahead&&(Ce=W.lookahead);do if(je[(z=xe)+Be]===kt&&je[z+Be-1]===Yt&&je[z]===je[Z]&&je[++z]===je[Z+1]){Z+=2,z++;do;while(je[++Z]===je[++z]&&je[++Z]===je[++z]&&je[++Z]===je[++z]&&je[++Z]===je[++z]&&je[++Z]===je[++z]&&je[++Z]===je[++z]&&je[++Z]===je[++z]&&je[++Z]===je[++z]&&Z<yt);if(Y=U-(yt-Z),Z=yt-U,Be<Y){if(W.match_start=xe,Ce<=(Be=Y))break;Yt=je[Z+Be-1],kt=je[Z+Be]}}while((xe=et[xe&qe])>Ie&&--O!=0);return Be<=W.lookahead?Be:W.lookahead}function ae(W){var xe,z,Y,O,Z,Be,Ce,Ie,je,qe,et=W.w_size;do{if(O=W.window_size-W.lookahead-W.strstart,W.strstart>=et+(et-b)){for(o.arraySet(W.window,W.window,et,et,0),W.match_start-=et,W.strstart-=et,W.block_start-=et,xe=z=W.hash_size;Y=W.head[--xe],W.head[xe]=et<=Y?Y-et:0,--z;);for(xe=z=et;Y=W.prev[--xe],W.prev[xe]=et<=Y?Y-et:0,--z;);O+=et}if(W.strm.avail_in===0)break;if(Be=W.strm,Ce=W.window,Ie=W.strstart+W.lookahead,je=O,qe=void 0,qe=Be.avail_in,je<qe&&(qe=je),z=qe===0?0:(Be.avail_in-=qe,o.arraySet(Ce,Be.input,Be.next_in,qe,Ie),Be.state.wrap===1?Be.adler=s(Be.adler,Ce,qe,Ie):Be.state.wrap===2&&(Be.adler=l(Be.adler,Ce,qe,Ie)),Be.next_in+=qe,Be.total_in+=qe,qe),W.lookahead+=z,W.lookahead+W.insert>=x)for(Z=W.strstart-W.insert,W.ins_h=W.window[Z],W.ins_h=(W.ins_h<<W.hash_shift^W.window[Z+1])&W.hash_mask;W.insert&&(W.ins_h=(W.ins_h<<W.hash_shift^W.window[Z+x-1])&W.hash_mask,W.prev[Z&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=Z,Z++,W.insert--,!(W.lookahead+W.insert<x)););}while(W.lookahead<b&&W.strm.avail_in!==0)}function j(W,xe){for(var z,Y;;){if(W.lookahead<b){if(ae(W),W.lookahead<b&&xe===u)return F;if(W.lookahead===0)break}if(z=0,W.lookahead>=x&&(W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+x-1])&W.hash_mask,z=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart),z!==0&&W.strstart-z<=W.w_size-b&&(W.match_length=ee(W,z)),W.match_length>=x)if(Y=A._tr_tally(W,W.strstart-W.match_start,W.match_length-x),W.lookahead-=W.match_length,W.match_length<=W.max_lazy_match&&W.lookahead>=x){for(W.match_length--;W.strstart++,W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+x-1])&W.hash_mask,z=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart,--W.match_length!=0;);W.strstart++}else W.strstart+=W.match_length,W.match_length=0,W.ins_h=W.window[W.strstart],W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+1])&W.hash_mask;else Y=A._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++;if(Y&&(R(W,!1),W.strm.avail_out===0))return F}return W.insert=W.strstart<x-1?W.strstart:x-1,xe===f?(R(W,!0),W.strm.avail_out===0?X:q):W.last_lit&&(R(W,!1),W.strm.avail_out===0)?F:H}function G(W,xe){for(var z,Y,O;;){if(W.lookahead<b){if(ae(W),W.lookahead<b&&xe===u)return F;if(W.lookahead===0)break}if(z=0,W.lookahead>=x&&(W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+x-1])&W.hash_mask,z=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart),W.prev_length=W.match_length,W.prev_match=W.match_start,W.match_length=x-1,z!==0&&W.prev_length<W.max_lazy_match&&W.strstart-z<=W.w_size-b&&(W.match_length=ee(W,z),W.match_length<=5&&(W.strategy===1||W.match_length===x&&4096<W.strstart-W.match_start)&&(W.match_length=x-1)),W.prev_length>=x&&W.match_length<=W.prev_length){for(O=W.strstart+W.lookahead-x,Y=A._tr_tally(W,W.strstart-1-W.prev_match,W.prev_length-x),W.lookahead-=W.prev_length-1,W.prev_length-=2;++W.strstart<=O&&(W.ins_h=(W.ins_h<<W.hash_shift^W.window[W.strstart+x-1])&W.hash_mask,z=W.prev[W.strstart&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=W.strstart),--W.prev_length!=0;);if(W.match_available=0,W.match_length=x-1,W.strstart++,Y&&(R(W,!1),W.strm.avail_out===0))return F}else if(W.match_available){if((Y=A._tr_tally(W,0,W.window[W.strstart-1]))&&R(W,!1),W.strstart++,W.lookahead--,W.strm.avail_out===0)return F}else W.match_available=1,W.strstart++,W.lookahead--}return W.match_available&&(Y=A._tr_tally(W,0,W.window[W.strstart-1]),W.match_available=0),W.insert=W.strstart<x-1?W.strstart:x-1,xe===f?(R(W,!0),W.strm.avail_out===0?X:q):W.last_lit&&(R(W,!1),W.strm.avail_out===0)?F:H}function oe(W,xe,z,Y,O){this.good_length=W,this.max_lazy=xe,this.nice_length=z,this.max_chain=Y,this.func=O}function se(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=B,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*I),this.dyn_dtree=new o.Buf16(2*(2*y+1)),this.bl_tree=new o.Buf16(2*(2*w+1)),ge(this.dyn_ltree),ge(this.dyn_dtree),ge(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(Q+1),this.heap=new o.Buf16(2*m+1),ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*m+1),ge(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ne(W){var xe;return W&&W.state?(W.total_in=W.total_out=0,W.data_type=p,(xe=W.state).pending=0,xe.pending_out=0,xe.wrap<0&&(xe.wrap=-xe.wrap),xe.status=xe.wrap?C:D,W.adler=xe.wrap===2?0:1,xe.last_flush=u,A._tr_init(xe),h):re(W,g)}function le(W){var xe=ne(W);return xe===h&&function(z){z.window_size=2*z.w_size,ge(z.head),z.max_lazy_match=a[z.level].max_lazy,z.good_match=a[z.level].good_length,z.nice_match=a[z.level].nice_length,z.max_chain_length=a[z.level].max_chain,z.strstart=0,z.block_start=0,z.lookahead=0,z.insert=0,z.match_length=z.prev_length=x-1,z.match_available=0,z.ins_h=0}(W.state),xe}function Fe(W,xe,z,Y,O,Z){if(!W)return g;var Be=1;if(xe===d&&(xe=6),Y<0?(Be=0,Y=-Y):15<Y&&(Be=2,Y-=16),O<1||E<O||z!==B||Y<8||15<Y||xe<0||9<xe||Z<0||v<Z)return re(W,g);Y===8&&(Y=9);var Ce=new se;return(W.state=Ce).strm=W,Ce.wrap=Be,Ce.gzhead=null,Ce.w_bits=Y,Ce.w_size=1<<Ce.w_bits,Ce.w_mask=Ce.w_size-1,Ce.hash_bits=O+7,Ce.hash_size=1<<Ce.hash_bits,Ce.hash_mask=Ce.hash_size-1,Ce.hash_shift=~~((Ce.hash_bits+x-1)/x),Ce.window=new o.Buf8(2*Ce.w_size),Ce.head=new o.Buf16(Ce.hash_size),Ce.prev=new o.Buf16(Ce.w_size),Ce.lit_bufsize=1<<O+6,Ce.pending_buf_size=4*Ce.lit_bufsize,Ce.pending_buf=new o.Buf8(Ce.pending_buf_size),Ce.d_buf=1*Ce.lit_bufsize,Ce.l_buf=3*Ce.lit_bufsize,Ce.level=xe,Ce.strategy=Z,Ce.method=z,le(W)}a=[new oe(0,0,0,0,function(W,xe){var z=65535;for(z>W.pending_buf_size-5&&(z=W.pending_buf_size-5);;){if(W.lookahead<=1){if(ae(W),W.lookahead===0&&xe===u)return F;if(W.lookahead===0)break}W.strstart+=W.lookahead,W.lookahead=0;var Y=W.block_start+z;if((W.strstart===0||W.strstart>=Y)&&(W.lookahead=W.strstart-Y,W.strstart=Y,R(W,!1),W.strm.avail_out===0)||W.strstart-W.block_start>=W.w_size-b&&(R(W,!1),W.strm.avail_out===0))return F}return W.insert=0,xe===f?(R(W,!0),W.strm.avail_out===0?X:q):(W.strstart>W.block_start&&(R(W,!1),W.strm.avail_out),F)}),new oe(4,4,8,4,j),new oe(4,5,16,8,j),new oe(4,6,32,32,j),new oe(4,4,16,16,G),new oe(8,16,32,32,G),new oe(8,16,128,128,G),new oe(8,32,128,256,G),new oe(32,128,258,1024,G),new oe(32,258,258,4096,G)],i.deflateInit=function(W,xe){return Fe(W,xe,B,15,8,0)},i.deflateInit2=Fe,i.deflateReset=le,i.deflateResetKeep=ne,i.deflateSetHeader=function(W,xe){return W&&W.state?W.state.wrap!==2?g:(W.state.gzhead=xe,h):g},i.deflate=function(W,xe){var z,Y,O,Z;if(!W||!W.state||5<xe||xe<0)return W?re(W,g):g;if(Y=W.state,!W.output||!W.input&&W.avail_in!==0||Y.status===666&&xe!==f)return re(W,W.avail_out===0?-5:g);if(Y.strm=W,z=Y.last_flush,Y.last_flush=xe,Y.status===C)if(Y.wrap===2)W.adler=0,V(Y,31),V(Y,139),V(Y,8),Y.gzhead?(V(Y,(Y.gzhead.text?1:0)+(Y.gzhead.hcrc?2:0)+(Y.gzhead.extra?4:0)+(Y.gzhead.name?8:0)+(Y.gzhead.comment?16:0)),V(Y,255&Y.gzhead.time),V(Y,Y.gzhead.time>>8&255),V(Y,Y.gzhead.time>>16&255),V(Y,Y.gzhead.time>>24&255),V(Y,Y.level===9?2:2<=Y.strategy||Y.level<2?4:0),V(Y,255&Y.gzhead.os),Y.gzhead.extra&&Y.gzhead.extra.length&&(V(Y,255&Y.gzhead.extra.length),V(Y,Y.gzhead.extra.length>>8&255)),Y.gzhead.hcrc&&(W.adler=l(W.adler,Y.pending_buf,Y.pending,0)),Y.gzindex=0,Y.status=69):(V(Y,0),V(Y,0),V(Y,0),V(Y,0),V(Y,0),V(Y,Y.level===9?2:2<=Y.strategy||Y.level<2?4:0),V(Y,3),Y.status=D);else{var Be=B+(Y.w_bits-8<<4)<<8;Be|=(2<=Y.strategy||Y.level<2?0:Y.level<6?1:Y.level===6?2:3)<<6,Y.strstart!==0&&(Be|=32),Be+=31-Be%31,Y.status=D,J(Y,Be),Y.strstart!==0&&(J(Y,W.adler>>>16),J(Y,65535&W.adler)),W.adler=1}if(Y.status===69)if(Y.gzhead.extra){for(O=Y.pending;Y.gzindex<(65535&Y.gzhead.extra.length)&&(Y.pending!==Y.pending_buf_size||(Y.gzhead.hcrc&&Y.pending>O&&(W.adler=l(W.adler,Y.pending_buf,Y.pending-O,O)),he(W),O=Y.pending,Y.pending!==Y.pending_buf_size));)V(Y,255&Y.gzhead.extra[Y.gzindex]),Y.gzindex++;Y.gzhead.hcrc&&Y.pending>O&&(W.adler=l(W.adler,Y.pending_buf,Y.pending-O,O)),Y.gzindex===Y.gzhead.extra.length&&(Y.gzindex=0,Y.status=73)}else Y.status=73;if(Y.status===73)if(Y.gzhead.name){O=Y.pending;do{if(Y.pending===Y.pending_buf_size&&(Y.gzhead.hcrc&&Y.pending>O&&(W.adler=l(W.adler,Y.pending_buf,Y.pending-O,O)),he(W),O=Y.pending,Y.pending===Y.pending_buf_size)){Z=1;break}Z=Y.gzindex<Y.gzhead.name.length?255&Y.gzhead.name.charCodeAt(Y.gzindex++):0,V(Y,Z)}while(Z!==0);Y.gzhead.hcrc&&Y.pending>O&&(W.adler=l(W.adler,Y.pending_buf,Y.pending-O,O)),Z===0&&(Y.gzindex=0,Y.status=91)}else Y.status=91;if(Y.status===91)if(Y.gzhead.comment){O=Y.pending;do{if(Y.pending===Y.pending_buf_size&&(Y.gzhead.hcrc&&Y.pending>O&&(W.adler=l(W.adler,Y.pending_buf,Y.pending-O,O)),he(W),O=Y.pending,Y.pending===Y.pending_buf_size)){Z=1;break}Z=Y.gzindex<Y.gzhead.comment.length?255&Y.gzhead.comment.charCodeAt(Y.gzindex++):0,V(Y,Z)}while(Z!==0);Y.gzhead.hcrc&&Y.pending>O&&(W.adler=l(W.adler,Y.pending_buf,Y.pending-O,O)),Z===0&&(Y.status=103)}else Y.status=103;if(Y.status===103&&(Y.gzhead.hcrc?(Y.pending+2>Y.pending_buf_size&&he(W),Y.pending+2<=Y.pending_buf_size&&(V(Y,255&W.adler),V(Y,W.adler>>8&255),W.adler=0,Y.status=D)):Y.status=D),Y.pending!==0){if(he(W),W.avail_out===0)return Y.last_flush=-1,h}else if(W.avail_in===0&&ie(xe)<=ie(z)&&xe!==f)return re(W,-5);if(Y.status===666&&W.avail_in!==0)return re(W,-5);if(W.avail_in!==0||Y.lookahead!==0||xe!==u&&Y.status!==666){var Ce=Y.strategy===2?function(Ie,je){for(var qe;;){if(Ie.lookahead===0&&(ae(Ie),Ie.lookahead===0)){if(je===u)return F;break}if(Ie.match_length=0,qe=A._tr_tally(Ie,0,Ie.window[Ie.strstart]),Ie.lookahead--,Ie.strstart++,qe&&(R(Ie,!1),Ie.strm.avail_out===0))return F}return Ie.insert=0,je===f?(R(Ie,!0),Ie.strm.avail_out===0?X:q):Ie.last_lit&&(R(Ie,!1),Ie.strm.avail_out===0)?F:H}(Y,xe):Y.strategy===3?function(Ie,je){for(var qe,et,yt,Yt,kt=Ie.window;;){if(Ie.lookahead<=U){if(ae(Ie),Ie.lookahead<=U&&je===u)return F;if(Ie.lookahead===0)break}if(Ie.match_length=0,Ie.lookahead>=x&&0<Ie.strstart&&(et=kt[yt=Ie.strstart-1])===kt[++yt]&&et===kt[++yt]&&et===kt[++yt]){Yt=Ie.strstart+U;do;while(et===kt[++yt]&&et===kt[++yt]&&et===kt[++yt]&&et===kt[++yt]&&et===kt[++yt]&&et===kt[++yt]&&et===kt[++yt]&&et===kt[++yt]&&yt<Yt);Ie.match_length=U-(Yt-yt),Ie.match_length>Ie.lookahead&&(Ie.match_length=Ie.lookahead)}if(Ie.match_length>=x?(qe=A._tr_tally(Ie,1,Ie.match_length-x),Ie.lookahead-=Ie.match_length,Ie.strstart+=Ie.match_length,Ie.match_length=0):(qe=A._tr_tally(Ie,0,Ie.window[Ie.strstart]),Ie.lookahead--,Ie.strstart++),qe&&(R(Ie,!1),Ie.strm.avail_out===0))return F}return Ie.insert=0,je===f?(R(Ie,!0),Ie.strm.avail_out===0?X:q):Ie.last_lit&&(R(Ie,!1),Ie.strm.avail_out===0)?F:H}(Y,xe):a[Y.level].func(Y,xe);if(Ce!==X&&Ce!==q||(Y.status=666),Ce===F||Ce===X)return W.avail_out===0&&(Y.last_flush=-1),h;if(Ce===H&&(xe===1?A._tr_align(Y):xe!==5&&(A._tr_stored_block(Y,0,0,!1),xe===3&&(ge(Y.head),Y.lookahead===0&&(Y.strstart=0,Y.block_start=0,Y.insert=0))),he(W),W.avail_out===0))return Y.last_flush=-1,h}return xe!==f?h:Y.wrap<=0?1:(Y.wrap===2?(V(Y,255&W.adler),V(Y,W.adler>>8&255),V(Y,W.adler>>16&255),V(Y,W.adler>>24&255),V(Y,255&W.total_in),V(Y,W.total_in>>8&255),V(Y,W.total_in>>16&255),V(Y,W.total_in>>24&255)):(J(Y,W.adler>>>16),J(Y,65535&W.adler)),he(W),0<Y.wrap&&(Y.wrap=-Y.wrap),Y.pending!==0?h:1)},i.deflateEnd=function(W){var xe;return W&&W.state?(xe=W.state.status)!==C&&xe!==69&&xe!==73&&xe!==91&&xe!==103&&xe!==D&&xe!==666?re(W,g):(W.state=null,xe===D?re(W,-3):h):g},i.deflateSetDictionary=function(W,xe){var z,Y,O,Z,Be,Ce,Ie,je,qe=xe.length;if(!W||!W.state||(Z=(z=W.state).wrap)===2||Z===1&&z.status!==C||z.lookahead)return g;for(Z===1&&(W.adler=s(W.adler,xe,qe,0)),z.wrap=0,qe>=z.w_size&&(Z===0&&(ge(z.head),z.strstart=0,z.block_start=0,z.insert=0),je=new o.Buf8(z.w_size),o.arraySet(je,xe,qe-z.w_size,z.w_size,0),xe=je,qe=z.w_size),Be=W.avail_in,Ce=W.next_in,Ie=W.input,W.avail_in=qe,W.next_in=0,W.input=xe,ae(z);z.lookahead>=x;){for(Y=z.strstart,O=z.lookahead-(x-1);z.ins_h=(z.ins_h<<z.hash_shift^z.window[Y+x-1])&z.hash_mask,z.prev[Y&z.w_mask]=z.head[z.ins_h],z.head[z.ins_h]=Y,Y++,--O;);z.strstart=Y,z.lookahead=x-1,ae(z)}return z.strstart+=z.lookahead,z.block_start=z.strstart,z.insert=z.lookahead,z.lookahead=0,z.match_length=z.prev_length=x-1,z.match_available=0,W.next_in=Ce,W.input=Ie,W.avail_in=Be,z.wrap=Z,h},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,n,i){n.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,n,i){n.exports=function(a,o){var A,s,l,c,u,f,h,g,d,v,p,B,E,m,y,w,I,Q,x,U,b,C,D,F,H;A=a.state,s=a.next_in,F=a.input,l=s+(a.avail_in-5),c=a.next_out,H=a.output,u=c-(o-a.avail_out),f=c+(a.avail_out-257),h=A.dmax,g=A.wsize,d=A.whave,v=A.wnext,p=A.window,B=A.hold,E=A.bits,m=A.lencode,y=A.distcode,w=(1<<A.lenbits)-1,I=(1<<A.distbits)-1;e:do{E<15&&(B+=F[s++]<<E,E+=8,B+=F[s++]<<E,E+=8),Q=m[B&w];t:for(;;){if(B>>>=x=Q>>>24,E-=x,(x=Q>>>16&255)===0)H[c++]=65535&Q;else{if(!(16&x)){if(!(64&x)){Q=m[(65535&Q)+(B&(1<<x)-1)];continue t}if(32&x){A.mode=12;break e}a.msg="invalid literal/length code",A.mode=30;break e}U=65535&Q,(x&=15)&&(E<x&&(B+=F[s++]<<E,E+=8),U+=B&(1<<x)-1,B>>>=x,E-=x),E<15&&(B+=F[s++]<<E,E+=8,B+=F[s++]<<E,E+=8),Q=y[B&I];r:for(;;){if(B>>>=x=Q>>>24,E-=x,!(16&(x=Q>>>16&255))){if(!(64&x)){Q=y[(65535&Q)+(B&(1<<x)-1)];continue r}a.msg="invalid distance code",A.mode=30;break e}if(b=65535&Q,E<(x&=15)&&(B+=F[s++]<<E,(E+=8)<x&&(B+=F[s++]<<E,E+=8)),h<(b+=B&(1<<x)-1)){a.msg="invalid distance too far back",A.mode=30;break e}if(B>>>=x,E-=x,(x=c-u)<b){if(d<(x=b-x)&&A.sane){a.msg="invalid distance too far back",A.mode=30;break e}if(D=p,(C=0)===v){if(C+=g-x,x<U){for(U-=x;H[c++]=p[C++],--x;);C=c-b,D=H}}else if(v<x){if(C+=g+v-x,(x-=v)<U){for(U-=x;H[c++]=p[C++],--x;);if(C=0,v<U){for(U-=x=v;H[c++]=p[C++],--x;);C=c-b,D=H}}}else if(C+=v-x,x<U){for(U-=x;H[c++]=p[C++],--x;);C=c-b,D=H}for(;2<U;)H[c++]=D[C++],H[c++]=D[C++],H[c++]=D[C++],U-=3;U&&(H[c++]=D[C++],1<U&&(H[c++]=D[C++]))}else{for(C=c-b;H[c++]=H[C++],H[c++]=H[C++],H[c++]=H[C++],2<(U-=3););U&&(H[c++]=H[C++],1<U&&(H[c++]=H[C++]))}break}}break}}while(s<l&&c<f);s-=U=E>>3,B&=(1<<(E-=U<<3))-1,a.next_in=s,a.next_out=c,a.avail_in=s<l?l-s+5:5-(s-l),a.avail_out=c<f?f-c+257:257-(c-f),A.hold=B,A.bits=E}},{}],49:[function(t,n,i){var a=t("../utils/common"),o=t("./adler32"),A=t("./crc32"),s=t("./inffast"),l=t("./inftrees"),c=1,u=2,f=0,h=-2,g=1,d=852,v=592;function p(C){return(C>>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function B(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function E(C){var D;return C&&C.state?(D=C.state,C.total_in=C.total_out=D.total=0,C.msg="",D.wrap&&(C.adler=1&D.wrap),D.mode=g,D.last=0,D.havedict=0,D.dmax=32768,D.head=null,D.hold=0,D.bits=0,D.lencode=D.lendyn=new a.Buf32(d),D.distcode=D.distdyn=new a.Buf32(v),D.sane=1,D.back=-1,f):h}function m(C){var D;return C&&C.state?((D=C.state).wsize=0,D.whave=0,D.wnext=0,E(C)):h}function y(C,D){var F,H;return C&&C.state?(H=C.state,D<0?(F=0,D=-D):(F=1+(D>>4),D<48&&(D&=15)),D&&(D<8||15<D)?h:(H.window!==null&&H.wbits!==D&&(H.window=null),H.wrap=F,H.wbits=D,m(C))):h}function w(C,D){var F,H;return C?(H=new B,(C.state=H).window=null,(F=y(C,D))!==f&&(C.state=null),F):h}var I,Q,x=!0;function U(C){if(x){var D;for(I=new a.Buf32(512),Q=new a.Buf32(32),D=0;D<144;)C.lens[D++]=8;for(;D<256;)C.lens[D++]=9;for(;D<280;)C.lens[D++]=7;for(;D<288;)C.lens[D++]=8;for(l(c,C.lens,0,288,I,0,C.work,{bits:9}),D=0;D<32;)C.lens[D++]=5;l(u,C.lens,0,32,Q,0,C.work,{bits:5}),x=!1}C.lencode=I,C.lenbits=9,C.distcode=Q,C.distbits=5}function b(C,D,F,H){var X,q=C.state;return q.window===null&&(q.wsize=1<<q.wbits,q.wnext=0,q.whave=0,q.window=new a.Buf8(q.wsize)),H>=q.wsize?(a.arraySet(q.window,D,F-q.wsize,q.wsize,0),q.wnext=0,q.whave=q.wsize):(H<(X=q.wsize-q.wnext)&&(X=H),a.arraySet(q.window,D,F-H,X,q.wnext),(H-=X)?(a.arraySet(q.window,D,F-H,H,0),q.wnext=H,q.whave=q.wsize):(q.wnext+=X,q.wnext===q.wsize&&(q.wnext=0),q.whave<q.wsize&&(q.whave+=X))),0}i.inflateReset=m,i.inflateReset2=y,i.inflateResetKeep=E,i.inflateInit=function(C){return w(C,15)},i.inflateInit2=w,i.inflate=function(C,D){var F,H,X,q,re,ie,ge,he,R,V,J,ee,ae,j,G,oe,se,ne,le,Fe,W,xe,z,Y,O=0,Z=new a.Buf8(4),Be=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!C||!C.state||!C.output||!C.input&&C.avail_in!==0)return h;(F=C.state).mode===12&&(F.mode=13),re=C.next_out,X=C.output,ge=C.avail_out,q=C.next_in,H=C.input,ie=C.avail_in,he=F.hold,R=F.bits,V=ie,J=ge,xe=f;e:for(;;)switch(F.mode){case g:if(F.wrap===0){F.mode=13;break}for(;R<16;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(2&F.wrap&&he===35615){Z[F.check=0]=255&he,Z[1]=he>>>8&255,F.check=A(F.check,Z,2,0),R=he=0,F.mode=2;break}if(F.flags=0,F.head&&(F.head.done=!1),!(1&F.wrap)||(((255&he)<<8)+(he>>8))%31){C.msg="incorrect header check",F.mode=30;break}if((15&he)!=8){C.msg="unknown compression method",F.mode=30;break}if(R-=4,W=8+(15&(he>>>=4)),F.wbits===0)F.wbits=W;else if(W>F.wbits){C.msg="invalid window size",F.mode=30;break}F.dmax=1<<W,C.adler=F.check=1,F.mode=512&he?10:12,R=he=0;break;case 2:for(;R<16;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(F.flags=he,(255&F.flags)!=8){C.msg="unknown compression method",F.mode=30;break}if(57344&F.flags){C.msg="unknown header flags set",F.mode=30;break}F.head&&(F.head.text=he>>8&1),512&F.flags&&(Z[0]=255&he,Z[1]=he>>>8&255,F.check=A(F.check,Z,2,0)),R=he=0,F.mode=3;case 3:for(;R<32;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}F.head&&(F.head.time=he),512&F.flags&&(Z[0]=255&he,Z[1]=he>>>8&255,Z[2]=he>>>16&255,Z[3]=he>>>24&255,F.check=A(F.check,Z,4,0)),R=he=0,F.mode=4;case 4:for(;R<16;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}F.head&&(F.head.xflags=255&he,F.head.os=he>>8),512&F.flags&&(Z[0]=255&he,Z[1]=he>>>8&255,F.check=A(F.check,Z,2,0)),R=he=0,F.mode=5;case 5:if(1024&F.flags){for(;R<16;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}F.length=he,F.head&&(F.head.extra_len=he),512&F.flags&&(Z[0]=255&he,Z[1]=he>>>8&255,F.check=A(F.check,Z,2,0)),R=he=0}else F.head&&(F.head.extra=null);F.mode=6;case 6:if(1024&F.flags&&(ie<(ee=F.length)&&(ee=ie),ee&&(F.head&&(W=F.head.extra_len-F.length,F.head.extra||(F.head.extra=new Array(F.head.extra_len)),a.arraySet(F.head.extra,H,q,ee,W)),512&F.flags&&(F.check=A(F.check,H,ee,q)),ie-=ee,q+=ee,F.length-=ee),F.length))break e;F.length=0,F.mode=7;case 7:if(2048&F.flags){if(ie===0)break e;for(ee=0;W=H[q+ee++],F.head&&W&&F.length<65536&&(F.head.name+=String.fromCharCode(W)),W&&ee<ie;);if(512&F.flags&&(F.check=A(F.check,H,ee,q)),ie-=ee,q+=ee,W)break e}else F.head&&(F.head.name=null);F.length=0,F.mode=8;case 8:if(4096&F.flags){if(ie===0)break e;for(ee=0;W=H[q+ee++],F.head&&W&&F.length<65536&&(F.head.comment+=String.fromCharCode(W)),W&&ee<ie;);if(512&F.flags&&(F.check=A(F.check,H,ee,q)),ie-=ee,q+=ee,W)break e}else F.head&&(F.head.comment=null);F.mode=9;case 9:if(512&F.flags){for(;R<16;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(he!==(65535&F.check)){C.msg="header crc mismatch",F.mode=30;break}R=he=0}F.head&&(F.head.hcrc=F.flags>>9&1,F.head.done=!0),C.adler=F.check=0,F.mode=12;break;case 10:for(;R<32;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}C.adler=F.check=p(he),R=he=0,F.mode=11;case 11:if(F.havedict===0)return C.next_out=re,C.avail_out=ge,C.next_in=q,C.avail_in=ie,F.hold=he,F.bits=R,2;C.adler=F.check=1,F.mode=12;case 12:if(D===5||D===6)break e;case 13:if(F.last){he>>>=7&R,R-=7&R,F.mode=27;break}for(;R<3;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}switch(F.last=1&he,R-=1,3&(he>>>=1)){case 0:F.mode=14;break;case 1:if(U(F),F.mode=20,D!==6)break;he>>>=2,R-=2;break e;case 2:F.mode=17;break;case 3:C.msg="invalid block type",F.mode=30}he>>>=2,R-=2;break;case 14:for(he>>>=7&R,R-=7&R;R<32;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if((65535&he)!=(he>>>16^65535)){C.msg="invalid stored block lengths",F.mode=30;break}if(F.length=65535&he,R=he=0,F.mode=15,D===6)break e;case 15:F.mode=16;case 16:if(ee=F.length){if(ie<ee&&(ee=ie),ge<ee&&(ee=ge),ee===0)break e;a.arraySet(X,H,q,ee,re),ie-=ee,q+=ee,ge-=ee,re+=ee,F.length-=ee;break}F.mode=12;break;case 17:for(;R<14;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(F.nlen=257+(31&he),he>>>=5,R-=5,F.ndist=1+(31&he),he>>>=5,R-=5,F.ncode=4+(15&he),he>>>=4,R-=4,286<F.nlen||30<F.ndist){C.msg="too many length or distance symbols",F.mode=30;break}F.have=0,F.mode=18;case 18:for(;F.have<F.ncode;){for(;R<3;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}F.lens[Be[F.have++]]=7&he,he>>>=3,R-=3}for(;F.have<19;)F.lens[Be[F.have++]]=0;if(F.lencode=F.lendyn,F.lenbits=7,z={bits:F.lenbits},xe=l(0,F.lens,0,19,F.lencode,0,F.work,z),F.lenbits=z.bits,xe){C.msg="invalid code lengths set",F.mode=30;break}F.have=0,F.mode=19;case 19:for(;F.have<F.nlen+F.ndist;){for(;oe=(O=F.lencode[he&(1<<F.lenbits)-1])>>>16&255,se=65535&O,!((G=O>>>24)<=R);){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(se<16)he>>>=G,R-=G,F.lens[F.have++]=se;else{if(se===16){for(Y=G+2;R<Y;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(he>>>=G,R-=G,F.have===0){C.msg="invalid bit length repeat",F.mode=30;break}W=F.lens[F.have-1],ee=3+(3&he),he>>>=2,R-=2}else if(se===17){for(Y=G+3;R<Y;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}R-=G,W=0,ee=3+(7&(he>>>=G)),he>>>=3,R-=3}else{for(Y=G+7;R<Y;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}R-=G,W=0,ee=11+(127&(he>>>=G)),he>>>=7,R-=7}if(F.have+ee>F.nlen+F.ndist){C.msg="invalid bit length repeat",F.mode=30;break}for(;ee--;)F.lens[F.have++]=W}}if(F.mode===30)break;if(F.lens[256]===0){C.msg="invalid code -- missing end-of-block",F.mode=30;break}if(F.lenbits=9,z={bits:F.lenbits},xe=l(c,F.lens,0,F.nlen,F.lencode,0,F.work,z),F.lenbits=z.bits,xe){C.msg="invalid literal/lengths set",F.mode=30;break}if(F.distbits=6,F.distcode=F.distdyn,z={bits:F.distbits},xe=l(u,F.lens,F.nlen,F.ndist,F.distcode,0,F.work,z),F.distbits=z.bits,xe){C.msg="invalid distances set",F.mode=30;break}if(F.mode=20,D===6)break e;case 20:F.mode=21;case 21:if(6<=ie&&258<=ge){C.next_out=re,C.avail_out=ge,C.next_in=q,C.avail_in=ie,F.hold=he,F.bits=R,s(C,J),re=C.next_out,X=C.output,ge=C.avail_out,q=C.next_in,H=C.input,ie=C.avail_in,he=F.hold,R=F.bits,F.mode===12&&(F.back=-1);break}for(F.back=0;oe=(O=F.lencode[he&(1<<F.lenbits)-1])>>>16&255,se=65535&O,!((G=O>>>24)<=R);){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(oe&&!(240&oe)){for(ne=G,le=oe,Fe=se;oe=(O=F.lencode[Fe+((he&(1<<ne+le)-1)>>ne)])>>>16&255,se=65535&O,!(ne+(G=O>>>24)<=R);){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}he>>>=ne,R-=ne,F.back+=ne}if(he>>>=G,R-=G,F.back+=G,F.length=se,oe===0){F.mode=26;break}if(32&oe){F.back=-1,F.mode=12;break}if(64&oe){C.msg="invalid literal/length code",F.mode=30;break}F.extra=15&oe,F.mode=22;case 22:if(F.extra){for(Y=F.extra;R<Y;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}F.length+=he&(1<<F.extra)-1,he>>>=F.extra,R-=F.extra,F.back+=F.extra}F.was=F.length,F.mode=23;case 23:for(;oe=(O=F.distcode[he&(1<<F.distbits)-1])>>>16&255,se=65535&O,!((G=O>>>24)<=R);){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(!(240&oe)){for(ne=G,le=oe,Fe=se;oe=(O=F.distcode[Fe+((he&(1<<ne+le)-1)>>ne)])>>>16&255,se=65535&O,!(ne+(G=O>>>24)<=R);){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}he>>>=ne,R-=ne,F.back+=ne}if(he>>>=G,R-=G,F.back+=G,64&oe){C.msg="invalid distance code",F.mode=30;break}F.offset=se,F.extra=15&oe,F.mode=24;case 24:if(F.extra){for(Y=F.extra;R<Y;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}F.offset+=he&(1<<F.extra)-1,he>>>=F.extra,R-=F.extra,F.back+=F.extra}if(F.offset>F.dmax){C.msg="invalid distance too far back",F.mode=30;break}F.mode=25;case 25:if(ge===0)break e;if(ee=J-ge,F.offset>ee){if((ee=F.offset-ee)>F.whave&&F.sane){C.msg="invalid distance too far back",F.mode=30;break}ae=ee>F.wnext?(ee-=F.wnext,F.wsize-ee):F.wnext-ee,ee>F.length&&(ee=F.length),j=F.window}else j=X,ae=re-F.offset,ee=F.length;for(ge<ee&&(ee=ge),ge-=ee,F.length-=ee;X[re++]=j[ae++],--ee;);F.length===0&&(F.mode=21);break;case 26:if(ge===0)break e;X[re++]=F.length,ge--,F.mode=21;break;case 27:if(F.wrap){for(;R<32;){if(ie===0)break e;ie--,he|=H[q++]<<R,R+=8}if(J-=ge,C.total_out+=J,F.total+=J,J&&(C.adler=F.check=F.flags?A(F.check,X,J,re-J):o(F.check,X,J,re-J)),J=ge,(F.flags?he:p(he))!==F.check){C.msg="incorrect data check",F.mode=30;break}R=he=0}F.mode=28;case 28:if(F.wrap&&F.flags){for(;R<32;){if(ie===0)break e;ie--,he+=H[q++]<<R,R+=8}if(he!==(4294967295&F.total)){C.msg="incorrect length check",F.mode=30;break}R=he=0}F.mode=29;case 29:xe=1;break e;case 30:xe=-3;break e;case 31:return-4;case 32:default:return h}return C.next_out=re,C.avail_out=ge,C.next_in=q,C.avail_in=ie,F.hold=he,F.bits=R,(F.wsize||J!==C.avail_out&&F.mode<30&&(F.mode<27||D!==4))&&b(C,C.output,C.next_out,J-C.avail_out)?(F.mode=31,-4):(V-=C.avail_in,J-=C.avail_out,C.total_in+=V,C.total_out+=J,F.total+=J,F.wrap&&J&&(C.adler=F.check=F.flags?A(F.check,X,J,C.next_out-J):o(F.check,X,J,C.next_out-J)),C.data_type=F.bits+(F.last?64:0)+(F.mode===12?128:0)+(F.mode===20||F.mode===15?256:0),(V==0&&J===0||D===4)&&xe===f&&(xe=-5),xe)},i.inflateEnd=function(C){if(!C||!C.state)return h;var D=C.state;return D.window&&(D.window=null),C.state=null,f},i.inflateGetHeader=function(C,D){var F;return C&&C.state&&2&(F=C.state).wrap?((F.head=D).done=!1,f):h},i.inflateSetDictionary=function(C,D){var F,H=D.length;return C&&C.state?(F=C.state).wrap!==0&&F.mode!==11?h:F.mode===11&&o(1,D,H,0)!==F.check?-3:b(C,D,H,H)?(F.mode=31,-4):(F.havedict=1,f):h},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,n,i){var a=t("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],A=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(c,u,f,h,g,d,v,p){var B,E,m,y,w,I,Q,x,U,b=p.bits,C=0,D=0,F=0,H=0,X=0,q=0,re=0,ie=0,ge=0,he=0,R=null,V=0,J=new a.Buf16(16),ee=new a.Buf16(16),ae=null,j=0;for(C=0;C<=15;C++)J[C]=0;for(D=0;D<h;D++)J[u[f+D]]++;for(X=b,H=15;1<=H&&J[H]===0;H--);if(H<X&&(X=H),H===0)return g[d++]=20971520,g[d++]=20971520,p.bits=1,0;for(F=1;F<H&&J[F]===0;F++);for(X<F&&(X=F),C=ie=1;C<=15;C++)if(ie<<=1,(ie-=J[C])<0)return-1;if(0<ie&&(c===0||H!==1))return-1;for(ee[1]=0,C=1;C<15;C++)ee[C+1]=ee[C]+J[C];for(D=0;D<h;D++)u[f+D]!==0&&(v[ee[u[f+D]]++]=D);if(I=c===0?(R=ae=v,19):c===1?(R=o,V-=257,ae=A,j-=257,256):(R=s,ae=l,-1),C=F,w=d,re=D=he=0,m=-1,y=(ge=1<<(q=X))-1,c===1&&852<ge||c===2&&592<ge)return 1;for(;;){for(Q=C-re,U=v[D]<I?(x=0,v[D]):v[D]>I?(x=ae[j+v[D]],R[V+v[D]]):(x=96,0),B=1<<C-re,F=E=1<<q;g[w+(he>>re)+(E-=B)]=Q<<24|x<<16|U|0,E!==0;);for(B=1<<C-1;he&B;)B>>=1;if(B!==0?(he&=B-1,he+=B):he=0,D++,--J[C]==0){if(C===H)break;C=u[f+v[D]]}if(X<C&&(he&y)!==m){for(re===0&&(re=X),w+=F,ie=1<<(q=C-re);q+re<H&&!((ie-=J[q+re])<=0);)q++,ie<<=1;if(ge+=1<<q,c===1&&852<ge||c===2&&592<ge)return 1;g[m=he&y]=X<<24|q<<16|w-d|0}}return he!==0&&(g[w+he]=C-re<<24|64<<16|0),p.bits=X,0}},{"../utils/common":41}],51:[function(t,n,i){n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,n,i){var a=t("../utils/common"),o=0,A=1;function s(O){for(var Z=O.length;0<=--Z;)O[Z]=0}var l=0,c=29,u=256,f=u+1+c,h=30,g=19,d=2*f+1,v=15,p=16,B=7,E=256,m=16,y=17,w=18,I=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Q=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],b=new Array(2*(f+2));s(b);var C=new Array(2*h);s(C);var D=new Array(512);s(D);var F=new Array(256);s(F);var H=new Array(c);s(H);var X,q,re,ie=new Array(h);function ge(O,Z,Be,Ce,Ie){this.static_tree=O,this.extra_bits=Z,this.extra_base=Be,this.elems=Ce,this.max_length=Ie,this.has_stree=O&&O.length}function he(O,Z){this.dyn_tree=O,this.max_code=0,this.stat_desc=Z}function R(O){return O<256?D[O]:D[256+(O>>>7)]}function V(O,Z){O.pending_buf[O.pending++]=255&Z,O.pending_buf[O.pending++]=Z>>>8&255}function J(O,Z,Be){O.bi_valid>p-Be?(O.bi_buf|=Z<<O.bi_valid&65535,V(O,O.bi_buf),O.bi_buf=Z>>p-O.bi_valid,O.bi_valid+=Be-p):(O.bi_buf|=Z<<O.bi_valid&65535,O.bi_valid+=Be)}function ee(O,Z,Be){J(O,Be[2*Z],Be[2*Z+1])}function ae(O,Z){for(var Be=0;Be|=1&O,O>>>=1,Be<<=1,0<--Z;);return Be>>>1}function j(O,Z,Be){var Ce,Ie,je=new Array(v+1),qe=0;for(Ce=1;Ce<=v;Ce++)je[Ce]=qe=qe+Be[Ce-1]<<1;for(Ie=0;Ie<=Z;Ie++){var et=O[2*Ie+1];et!==0&&(O[2*Ie]=ae(je[et]++,et))}}function G(O){var Z;for(Z=0;Z<f;Z++)O.dyn_ltree[2*Z]=0;for(Z=0;Z<h;Z++)O.dyn_dtree[2*Z]=0;for(Z=0;Z<g;Z++)O.bl_tree[2*Z]=0;O.dyn_ltree[2*E]=1,O.opt_len=O.static_len=0,O.last_lit=O.matches=0}function oe(O){8<O.bi_valid?V(O,O.bi_buf):0<O.bi_valid&&(O.pending_buf[O.pending++]=O.bi_buf),O.bi_buf=0,O.bi_valid=0}function se(O,Z,Be,Ce){var Ie=2*Z,je=2*Be;return O[Ie]<O[je]||O[Ie]===O[je]&&Ce[Z]<=Ce[Be]}function ne(O,Z,Be){for(var Ce=O.heap[Be],Ie=Be<<1;Ie<=O.heap_len&&(Ie<O.heap_len&&se(Z,O.heap[Ie+1],O.heap[Ie],O.depth)&&Ie++,!se(Z,Ce,O.heap[Ie],O.depth));)O.heap[Be]=O.heap[Ie],Be=Ie,Ie<<=1;O.heap[Be]=Ce}function le(O,Z,Be){var Ce,Ie,je,qe,et=0;if(O.last_lit!==0)for(;Ce=O.pending_buf[O.d_buf+2*et]<<8|O.pending_buf[O.d_buf+2*et+1],Ie=O.pending_buf[O.l_buf+et],et++,Ce===0?ee(O,Ie,Z):(ee(O,(je=F[Ie])+u+1,Z),(qe=I[je])!==0&&J(O,Ie-=H[je],qe),ee(O,je=R(--Ce),Be),(qe=Q[je])!==0&&J(O,Ce-=ie[je],qe)),et<O.last_lit;);ee(O,E,Z)}function Fe(O,Z){var Be,Ce,Ie,je=Z.dyn_tree,qe=Z.stat_desc.static_tree,et=Z.stat_desc.has_stree,yt=Z.stat_desc.elems,Yt=-1;for(O.heap_len=0,O.heap_max=d,Be=0;Be<yt;Be++)je[2*Be]!==0?(O.heap[++O.heap_len]=Yt=Be,O.depth[Be]=0):je[2*Be+1]=0;for(;O.heap_len<2;)je[2*(Ie=O.heap[++O.heap_len]=Yt<2?++Yt:0)]=1,O.depth[Ie]=0,O.opt_len--,et&&(O.static_len-=qe[2*Ie+1]);for(Z.max_code=Yt,Be=O.heap_len>>1;1<=Be;Be--)ne(O,je,Be);for(Ie=yt;Be=O.heap[1],O.heap[1]=O.heap[O.heap_len--],ne(O,je,1),Ce=O.heap[1],O.heap[--O.heap_max]=Be,O.heap[--O.heap_max]=Ce,je[2*Ie]=je[2*Be]+je[2*Ce],O.depth[Ie]=(O.depth[Be]>=O.depth[Ce]?O.depth[Be]:O.depth[Ce])+1,je[2*Be+1]=je[2*Ce+1]=Ie,O.heap[1]=Ie++,ne(O,je,1),2<=O.heap_len;);O.heap[--O.heap_max]=O.heap[1],function(kt,gr){var tt,nt,Ut,Qt,dr,ar,pr=gr.dyn_tree,Un=gr.max_code,jr=gr.stat_desc.static_tree,Zn=gr.stat_desc.has_stree,An=gr.stat_desc.extra_bits,jn=gr.stat_desc.extra_base,Fr=gr.stat_desc.max_length,rr=0;for(Qt=0;Qt<=v;Qt++)kt.bl_count[Qt]=0;for(pr[2*kt.heap[kt.heap_max]+1]=0,tt=kt.heap_max+1;tt<d;tt++)Fr<(Qt=pr[2*pr[2*(nt=kt.heap[tt])+1]+1]+1)&&(Qt=Fr,rr++),pr[2*nt+1]=Qt,Un<nt||(kt.bl_count[Qt]++,dr=0,jn<=nt&&(dr=An[nt-jn]),ar=pr[2*nt],kt.opt_len+=ar*(Qt+dr),Zn&&(kt.static_len+=ar*(jr[2*nt+1]+dr)));if(rr!==0){do{for(Qt=Fr-1;kt.bl_count[Qt]===0;)Qt--;kt.bl_count[Qt]--,kt.bl_count[Qt+1]+=2,kt.bl_count[Fr]--,rr-=2}while(0<rr);for(Qt=Fr;Qt!==0;Qt--)for(nt=kt.bl_count[Qt];nt!==0;)Un<(Ut=kt.heap[--tt])||(pr[2*Ut+1]!==Qt&&(kt.opt_len+=(Qt-pr[2*Ut+1])*pr[2*Ut],pr[2*Ut+1]=Qt),nt--)}}(O,Z),j(je,Yt,O.bl_count)}function W(O,Z,Be){var Ce,Ie,je=-1,qe=Z[1],et=0,yt=7,Yt=4;for(qe===0&&(yt=138,Yt=3),Z[2*(Be+1)+1]=65535,Ce=0;Ce<=Be;Ce++)Ie=qe,qe=Z[2*(Ce+1)+1],++et<yt&&Ie===qe||(et<Yt?O.bl_tree[2*Ie]+=et:Ie!==0?(Ie!==je&&O.bl_tree[2*Ie]++,O.bl_tree[2*m]++):et<=10?O.bl_tree[2*y]++:O.bl_tree[2*w]++,je=Ie,Yt=(et=0)===qe?(yt=138,3):Ie===qe?(yt=6,3):(yt=7,4))}function xe(O,Z,Be){var Ce,Ie,je=-1,qe=Z[1],et=0,yt=7,Yt=4;for(qe===0&&(yt=138,Yt=3),Ce=0;Ce<=Be;Ce++)if(Ie=qe,qe=Z[2*(Ce+1)+1],!(++et<yt&&Ie===qe)){if(et<Yt)for(;ee(O,Ie,O.bl_tree),--et!=0;);else Ie!==0?(Ie!==je&&(ee(O,Ie,O.bl_tree),et--),ee(O,m,O.bl_tree),J(O,et-3,2)):et<=10?(ee(O,y,O.bl_tree),J(O,et-3,3)):(ee(O,w,O.bl_tree),J(O,et-11,7));je=Ie,Yt=(et=0)===qe?(yt=138,3):Ie===qe?(yt=6,3):(yt=7,4)}}s(ie);var z=!1;function Y(O,Z,Be,Ce){J(O,(l<<1)+(Ce?1:0),3),function(Ie,je,qe,et){oe(Ie),V(Ie,qe),V(Ie,~qe),a.arraySet(Ie.pending_buf,Ie.window,je,qe,Ie.pending),Ie.pending+=qe}(O,Z,Be)}i._tr_init=function(O){z||(function(){var Z,Be,Ce,Ie,je,qe=new Array(v+1);for(Ie=Ce=0;Ie<c-1;Ie++)for(H[Ie]=Ce,Z=0;Z<1<<I[Ie];Z++)F[Ce++]=Ie;for(F[Ce-1]=Ie,Ie=je=0;Ie<16;Ie++)for(ie[Ie]=je,Z=0;Z<1<<Q[Ie];Z++)D[je++]=Ie;for(je>>=7;Ie<h;Ie++)for(ie[Ie]=je<<7,Z=0;Z<1<<Q[Ie]-7;Z++)D[256+je++]=Ie;for(Be=0;Be<=v;Be++)qe[Be]=0;for(Z=0;Z<=143;)b[2*Z+1]=8,Z++,qe[8]++;for(;Z<=255;)b[2*Z+1]=9,Z++,qe[9]++;for(;Z<=279;)b[2*Z+1]=7,Z++,qe[7]++;for(;Z<=287;)b[2*Z+1]=8,Z++,qe[8]++;for(j(b,f+1,qe),Z=0;Z<h;Z++)C[2*Z+1]=5,C[2*Z]=ae(Z,5);X=new ge(b,I,u+1,f,v),q=new ge(C,Q,0,h,v),re=new ge(new Array(0),x,0,g,B)}(),z=!0),O.l_desc=new he(O.dyn_ltree,X),O.d_desc=new he(O.dyn_dtree,q),O.bl_desc=new he(O.bl_tree,re),O.bi_buf=0,O.bi_valid=0,G(O)},i._tr_stored_block=Y,i._tr_flush_block=function(O,Z,Be,Ce){var Ie,je,qe=0;0<O.level?(O.strm.data_type===2&&(O.strm.data_type=function(et){var yt,Yt=4093624447;for(yt=0;yt<=31;yt++,Yt>>>=1)if(1&Yt&&et.dyn_ltree[2*yt]!==0)return o;if(et.dyn_ltree[18]!==0||et.dyn_ltree[20]!==0||et.dyn_ltree[26]!==0)return A;for(yt=32;yt<u;yt++)if(et.dyn_ltree[2*yt]!==0)return A;return o}(O)),Fe(O,O.l_desc),Fe(O,O.d_desc),qe=function(et){var yt;for(W(et,et.dyn_ltree,et.l_desc.max_code),W(et,et.dyn_dtree,et.d_desc.max_code),Fe(et,et.bl_desc),yt=g-1;3<=yt&&et.bl_tree[2*U[yt]+1]===0;yt--);return et.opt_len+=3*(yt+1)+5+5+4,yt}(O),Ie=O.opt_len+3+7>>>3,(je=O.static_len+3+7>>>3)<=Ie&&(Ie=je)):Ie=je=Be+5,Be+4<=Ie&&Z!==-1?Y(O,Z,Be,Ce):O.strategy===4||je===Ie?(J(O,2+(Ce?1:0),3),le(O,b,C)):(J(O,4+(Ce?1:0),3),function(et,yt,Yt,kt){var gr;for(J(et,yt-257,5),J(et,Yt-1,5),J(et,kt-4,4),gr=0;gr<kt;gr++)J(et,et.bl_tree[2*U[gr]+1],3);xe(et,et.dyn_ltree,yt-1),xe(et,et.dyn_dtree,Yt-1)}(O,O.l_desc.max_code+1,O.d_desc.max_code+1,qe+1),le(O,O.dyn_ltree,O.dyn_dtree)),G(O),Ce&&oe(O)},i._tr_tally=function(O,Z,Be){return O.pending_buf[O.d_buf+2*O.last_lit]=Z>>>8&255,O.pending_buf[O.d_buf+2*O.last_lit+1]=255&Z,O.pending_buf[O.l_buf+O.last_lit]=255&Be,O.last_lit++,Z===0?O.dyn_ltree[2*Be]++:(O.matches++,Z--,O.dyn_ltree[2*(F[Be]+u+1)]++,O.dyn_dtree[2*R(Z)]++),O.last_lit===O.lit_bufsize-1},i._tr_align=function(O){J(O,2,3),ee(O,E,b),function(Z){Z.bi_valid===16?(V(Z,Z.bi_buf),Z.bi_buf=0,Z.bi_valid=0):8<=Z.bi_valid&&(Z.pending_buf[Z.pending++]=255&Z.bi_buf,Z.bi_buf>>=8,Z.bi_valid-=8)}(O)}},{"../utils/common":41}],53:[function(t,n,i){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,i){(function(a){(function(o,A){if(!o.setImmediate){var s,l,c,u,f=1,h={},g=!1,d=o.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(o);v=v&&v.setTimeout?v:o,s={}.toString.call(o.process)==="[object process]"?function(m){Hn.nextTick(function(){B(m)})}:function(){if(o.postMessage&&!o.importScripts){var m=!0,y=o.onmessage;return o.onmessage=function(){m=!1},o.postMessage("","*"),o.onmessage=y,m}}()?(u="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",E,!1):o.attachEvent("onmessage",E),function(m){o.postMessage(u+m,"*")}):o.MessageChannel?((c=new MessageChannel).port1.onmessage=function(m){B(m.data)},function(m){c.port2.postMessage(m)}):d&&"onreadystatechange"in d.createElement("script")?(l=d.documentElement,function(m){var y=d.createElement("script");y.onreadystatechange=function(){B(m),y.onreadystatechange=null,l.removeChild(y),y=null},l.appendChild(y)}):function(m){setTimeout(B,0,m)},v.setImmediate=function(m){typeof m!="function"&&(m=new Function(""+m));for(var y=new Array(arguments.length-1),w=0;w<y.length;w++)y[w]=arguments[w+1];var I={callback:m,args:y};return h[f]=I,s(f),f++},v.clearImmediate=p}function p(m){delete h[m]}function B(m){if(g)setTimeout(B,0,m);else{var y=h[m];if(y){g=!0;try{(function(w){var I=w.callback,Q=w.args;switch(Q.length){case 0:I();break;case 1:I(Q[0]);break;case 2:I(Q[0],Q[1]);break;case 3:I(Q[0],Q[1],Q[2]);break;default:I.apply(A,Q)}})(y)}finally{p(m),g=!1}}}}function E(m){m.source===o&&typeof m.data=="string"&&m.data.indexOf(u)===0&&B(+m.data.slice(u.length))}})(typeof self>"u"?a===void 0?this:a:self)}).call(this,typeof M0<"u"?M0:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(bb)),bb.exports}var oje=aje();const Aje=ET(oje);var wE={exports:{}},Db,rie;function sje(){if(rie)return Db;rie=1;var r={"&":"&",'"':""","'":"'","<":"<",">":">"};function e(t){return t&&t.replace?t.replace(/([&"<>'])/g,function(n,i){return r[i]}):t}return Db=e,Db}var nie;function lje(){if(nie)return wE.exports;nie=1;var r=sje(),e=VR().Stream,t=" ";function n(l,c){typeof c!="object"&&(c={indent:c});var u=c.stream?new e:null,f="",h=!1,g=c.indent?c.indent===!0?t:c.indent:"",d=!0;function v(y){d?Hn.nextTick(y):y()}function p(y,w){if(w!==void 0&&(f+=w),y&&!h&&(u=u||new e,h=!0),y&&h){var I=f;v(function(){u.emit("data",I)}),f=""}}function B(y,w){A(p,o(y,g,g?1:0),w)}function E(){if(u){var y=f;v(function(){u.emit("data",y),u.emit("end"),u.readable=!1,u.emit("close")})}}function m(y){var w=y.encoding||"UTF-8",I={version:"1.0",encoding:w};y.standalone&&(I.standalone=y.standalone),B({"?xml":{_attr:I}}),f=f.replace("/>","?>")}return v(function(){d=!1}),c.declaration&&m(c.declaration),l&&l.forEach?l.forEach(function(y,w){var I;w+1===l.length&&(I=E),B(y,I)}):B(l,E),u?(u.readable=!0,u):f}function i(){var l=Array.prototype.slice.call(arguments),c={_elem:o(l)};return c.push=function(u){if(!this.append)throw new Error("not assigned to a parent!");var f=this,h=this._elem.indent;A(this.append,o(u,h,this._elem.icount+(h?1:0)),function(){f.append(!0)})},c.close=function(u){u!==void 0&&this.push(u),this.end&&this.end()},c}function a(l,c){return new Array(c||0).join(l||"")}function o(l,c,u){u=u||0;var f=a(c,u),h,g=l,d=!1;if(typeof l=="object"){var v=Object.keys(l);if(h=v[0],g=l[h],g&&g._elem)return g._elem.name=h,g._elem.icount=u,g._elem.indent=c,g._elem.indents=f,g._elem.interrupt=g,g._elem}var p=[],B=[],E;function m(y){var w=Object.keys(y);w.forEach(function(I){p.push(s(I,y[I]))})}switch(typeof g){case"object":if(g===null)break;g._attr&&m(g._attr),g._cdata&&B.push(("<![CDATA["+g._cdata).replace(/\]\]>/g,"]]]]><![CDATA[>")+"]]>"),g.forEach&&(E=!1,B.push(""),g.forEach(function(y){if(typeof y=="object"){var w=Object.keys(y)[0];w=="_attr"?m(y._attr):B.push(o(y,c,u+1))}else B.pop(),E=!0,B.push(r(y))}),E||B.push(""));break;default:B.push(r(g))}return{name:h,interrupt:d,attributes:p,content:B,icount:u,indents:f,indent:c}}function A(l,c,u){if(typeof c!="object")return l(!1,c);var f=c.interrupt?1:c.content.length;function h(){for(;c.content.length;){var d=c.content.shift();if(d!==void 0){if(g(d))return;A(l,d)}}l(!1,(f>1?c.indents:"")+(c.name?"</"+c.name+">":"")+(c.indent&&!u?`
|
|
205
205
|
`:"")),u&&u()}function g(d){return d.interrupt?(d.interrupt.append=l,d.interrupt.end=h,d.interrupt=!1,l(!0),!0):!1}if(l(!1,c.indents+(c.name?"<"+c.name:"")+(c.attributes.length?" "+c.attributes.join(" "):"")+(f?c.name?">":"":c.name?"/>":"")+(c.indent&&f>1?`
|
|
206
206
|
`:"")),!f)return l(!1,c.indent?`
|
|
207
|
-
`:"");g(c)||h()}function s(l,c){return l+'="'+r(c)+'"'}return wE.exports=n,wE.exports.element=wE.exports.Element=i,wE.exports}var cje=lje();const Zi=ET(cje),IE=0,Nb=32,uje=32,hje=(r,e)=>{const t=e.replace(/-/g,"");if(t.length!==uje)throw new Error(`Error: Cannot extract GUID from font filename: ${e}`);const i=t.replace(/(..)/g,"$1 ").trim().split(" ").map(s=>parseInt(s,16));i.reverse();const o=r.slice(IE,Nb).map((s,l)=>s^i[l%i.length]),A=new Uint8Array(IE+o.length+Math.max(0,r.length-Nb));return A.set(r.slice(0,IE)),A.set(o,IE),A.set(r.slice(Nb),IE+o.length),A};class fje{format(e,t={stack:[]}){const n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}}class gje{replace(e,t,n){let i=e;return t.forEach((a,o)=>{i=i.replace(new RegExp(`{${a.fileName}}`,"g"),(n+o).toString())}),i}getMediaData(e,t){return t.Array.filter(n=>e.search(`{${n.fileName}}`)>0)}}class dje{replace(e,t){let n=e;for(const i of t)n=n.replace(new RegExp(`{${i.reference}-${i.instance}}`,"g"),i.numId.toString());return n}}class pje{constructor(){Tt(this,"formatter"),Tt(this,"imageReplacer"),Tt(this,"numberingReplacer"),this.formatter=new fje,this.imageReplacer=new gje,this.numberingReplacer=new dje}compile(e,t,n=[]){const i=new Aje,a=this.xmlifyFile(e,t),o=new Map(Object.entries(a));for(const[,A]of o)if(Array.isArray(A))for(const s of A)i.file(s.path,Eb(s.data));else i.file(A.path,Eb(A.data));for(const A of n)i.file(A.path,Eb(A.data));for(const A of e.Media.Array)A.type!=="svg"?i.file(`word/media/${A.fileName}`,A.data):(i.file(`word/media/${A.fileName}`,A.data),i.file(`word/media/${A.fallback.fileName}`,A.fallback.data));for(const{data:A,name:s,fontKey:l}of e.FontTable.fontOptionsWithKey){const[c]=s.split(".");i.file(`word/fonts/${c}.odttf`,hje(A,l))}return i}xmlifyFile(e,t){const n=e.Document.Relationships.RelationshipCount+1,i=Zi(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=e.Comments.Relationships.RelationshipCount+1,o=Zi(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),A=e.FootNotes.Relationships.RelationshipCount+1,s=Zi(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),l=this.imageReplacer.getMediaData(i,e.Media),c=this.imageReplacer.getMediaData(o,e.Media),u=this.imageReplacer.getMediaData(s,e.Media);return{Relationships:{data:(l.forEach((f,h)=>{e.Document.Relationships.addRelationship(n+h,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${f.fileName}`)}),e.Document.Relationships.addRelationship(e.Document.Relationships.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),Zi(this.formatter.format(e.Document.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{const f=this.imageReplacer.replace(i,l,n);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{const f=Zi(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:Zi(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:Zi(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:Zi(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((f,h)=>{const g=Zi(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(g,e.Media).forEach((v,p)=>{f.Relationships.addRelationship(p,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${v.fileName}`)}),{data:Zi(this.formatter.format(f.Relationships,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${h+1}.xml.rels`}}),FooterRelationships:e.Footers.map((f,h)=>{const g=Zi(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(g,e.Media).forEach((v,p)=>{f.Relationships.addRelationship(p,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${v.fileName}`)}),{data:Zi(this.formatter.format(f.Relationships,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${h+1}.xml.rels`}}),Headers:e.Headers.map((f,h)=>{const g=Zi(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),d=this.imageReplacer.getMediaData(g,e.Media),v=this.imageReplacer.replace(g,d,0);return{data:this.numberingReplacer.replace(v,e.Numbering.ConcreteNumbering),path:`word/header${h+1}.xml`}}),Footers:e.Footers.map((f,h)=>{const g=Zi(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),d=this.imageReplacer.getMediaData(g,e.Media),v=this.imageReplacer.replace(g,d,0);return{data:this.numberingReplacer.replace(v,e.Numbering.ConcreteNumbering),path:`word/footer${h+1}.xml`}}),ContentTypes:{data:Zi(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:Zi(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:Zi(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{const f=this.imageReplacer.replace(s,u,A);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(u.forEach((f,h)=>{e.FootNotes.Relationships.addRelationship(A+h,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${f.fileName}`)}),Zi(this.formatter.format(e.FootNotes.Relationships,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:Zi(this.formatter.format(e.Endnotes.View,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/endnotes.xml"},EndnotesRelationships:{data:Zi(this.formatter.format(e.Endnotes.Relationships,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/endnotes.xml.rels"},Settings:{data:Zi(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:(()=>{const f=this.imageReplacer.replace(o,c,a);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(c.forEach((f,h)=>{e.Comments.Relationships.addRelationship(a+h,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${f.fileName}`)}),Zi(this.formatter.format(e.Comments.Relationships,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})),path:"word/_rels/comments.xml.rels"},FontTable:{data:Zi(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:Zi(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"}}}}const vje={WITH_2_BLANKS:" "},iie=r=>r===!0?vje.WITH_2_BLANKS:r===!1?void 0:r,aie=class Fv{static pack(e,t,n){return MPe(this,arguments,function*(i,a,o,A=[]){return this.compiler.compile(i,iie(o),A).generateAsync({type:a,mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toString(e,t,n=[]){return Fv.pack(e,"string",t,n)}static toBuffer(e,t,n=[]){return Fv.pack(e,"nodebuffer",t,n)}static toBase64String(e,t,n=[]){return Fv.pack(e,"base64",t,n)}static toBlob(e,t,n=[]){return Fv.pack(e,"blob",t,n)}static toArrayBuffer(e,t,n=[]){return Fv.pack(e,"arraybuffer",t,n)}static toStream(e,t,n=[]){const i=new ije.Stream;return this.compiler.compile(e,iie(t),n).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then(o=>{i.emit("data",o),i.emit("end")}),i}};Tt(aie,"compiler",new pje);let Bje=aie;const Eje={key:0,class:"viewer-toolbar no-print"},mje={class:"viewer-toolbar-row"},yje={class:"viewer-toolbar-group viewer-toolbar-nav"},wje=["disabled"],Ije={class:"nav-page"},xje=["max"],Mje={class:"nav-total"},Qje=["disabled"],Cje={class:"nav-zoom"},Sje={class:"nav-search"},Fje=["disabled"],Tje=["disabled"],Rje=["title"],bje={class:"viewer-body"},Dje={key:0,class:"viewer-sidebar no-print"},Nje={class:"sidebar-header"},Uje={class:"sidebar-body"},_je={key:0,class:"thumb-list"},kje=["onClick"],Yje={class:"thumb-paper"},Pje={class:"thumb-num"},Oje=["src"],Lje={key:0,class:"thumb-more"},Gje={key:1,class:"thumb-more"},zje={key:1,class:"toc-side"},Hje=["onClick"],jje={class:"toc-side-title"},Vje={class:"toc-side-page"},Jje={key:0,class:"toc-side-empty"},Kje={key:0,class:"no-data"},Wje={key:1,class:"no-data"},Xje={key:0,class:"widget-header"},Zje={class:"widget-title-text"},qje={key:0,class:"pi pi-chart-bar text-xs opacity-40"},$je={key:1,class:"pi pi-bolt text-xs opacity-40"},eVe={class:"widget-content"},tVe=["data-page-number"],rVe={key:0,class:"watermark-tile"},nVe={key:1,class:"toc-page"},iVe={class:"toc-list"},aVe=["onClick"],oVe={class:"toc-label"},AVe={class:"toc-page-num"},sVe={key:0,class:"toc-empty"},lVe={key:2,class:"p-4 text-center text-red-500 font-bold border-2 border-dashed border-red-200 m-4"},cVe=["data-band-id"],uVe={key:0,class:"nexa-table"},hVe={key:1,class:"no-data"},fVe=["data-el-id"],gVe={key:1,class:"no-data"},dVe={key:1,class:"no-data"},pVe={class:"subreport-wrapper"},vVe=["onClick"],BVe={class:"subreport-toggle"},EVe={class:"subreport-title"},mVe={class:"subreport-content"},yVe=["definition","data","api-base-url","api-key"],wVe={key:1,class:"no-data"},IVe={key:2,class:"no-data"},xVe={key:3,class:"no-data"},MVe=["data-el-id"],QVe=["src"],CVe=["data-value","data-format","data-display-value"],SVe=["data-band-id","data-row-idx"],FVe=["data-el-id","data-row-idx"],TVe=["src"],RVe=["data-value","data-format","data-display-value"],bVe=["width","height","stroke","stroke-width","stroke-dasharray"],DVe=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],NVe=["y1","x2","y2","stroke","stroke-width","stroke-dasharray"],UVe=["y1","x2","y2","stroke","stroke-width"],_Ve=["src"],kVe=["title","onClick"],YVe={class:"drilldown-content"},PVe=["data-band-id","data-row-idx"],OVe=["data-el-id","data-row-idx"],LVe=["src"],GVe=["data-value","data-format","data-display-value"],zVe=["width","height","stroke","stroke-width","stroke-dasharray"],HVe=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],jVe=["y1","x2","y2","stroke","stroke-width","stroke-dasharray"],VVe=["y1","x2","y2","stroke","stroke-width"],JVe=["src"],KVe=["data-band-id"],WVe=["data-el-id"],XVe=["src"],ZVe=["data-value","data-format","data-display-value"],qVe=["width","height","stroke","stroke-width","stroke-dasharray"],$Ve=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],eJe=["y1","x2","y2","stroke","stroke-width","stroke-dasharray"],tJe=["y1","x2","y2","stroke","stroke-width"],rJe={key:1,class:"params-overlay"},nJe={class:"params-dialog"},iJe={class:"params-dialog-header"},aJe={class:"params-header-content"},oJe={class:"params-header-desc"},AJe={class:"params-dialog-body"},sJe={key:0,class:"params-error-banner"},lJe={class:"params-label"},cJe={key:0,class:"params-required",title:"Requerido"},uJe={key:1,class:"params-optional"},hJe={key:0,class:"params-desc"},fJe=["onUpdate:modelValue"],gJe=["value"],dJe=["onUpdate:modelValue","placeholder"],pJe=["onUpdate:modelValue"],vJe={key:4,class:"params-toggle-label"},BJe=["onClick"],EJe=["onUpdate:modelValue","placeholder"],mJe={key:6,class:"params-error-msg"},yJe={class:"params-dialog-footer"},wJe={class:"drilldown-modal-header"},IJe={class:"drilldown-modal-body"},xJe={key:0,class:"no-data"},MJe={key:1,class:"no-data"},QJe=["definition","data","parameters"],CJe={key:3,class:"no-data"},SJe={class:"about-modal"},FJe={class:"about-modal-header"},TJe={class:"about-title"},RJe={class:"about-h2"},bJe={class:"about-modal-body"},DJe={class:"about-row"},NJe={key:0,class:"about-row"},UJe={class:"about-modal-footer"},_Je=80,kJe=12,YJe=37.8,PJe=60,OJe=$w(L.defineComponent({__name:"NexaViewer.ce",props:{definition:{type:[String,Object]},data:{type:[String,Array,Object]},minimal:{type:[Boolean,String]},showThumbs:{type:[Boolean,String]},showToolbar:{type:[Boolean,String]},parameters:{type:Object},skipParamsDialog:{type:Boolean},currentPage:{type:Number},apiBaseUrl:{type:String},apiKey:{type:String}},emits:["data-request","drill-click","subreport-toggle","page-change"],setup(r,{expose:e,emit:t}){const n=r,i=t;function a(ue){if(ue===!0)return!0;if(ue===!1||ue==null)return!1;if(typeof ue=="string"){const pe=ue.trim().toLowerCase();if(pe==="")return!0;if(pe==="false"||pe==="0"||pe==="no"||pe==="off"||pe==="null"||pe==="undefined")return!1;if(pe==="true"||pe==="1"||pe==="yes"||pe==="on")return!0}return!!ue}const o=L.computed(()=>a(n.minimal)),A=L.computed(()=>!o.value||a(n.showThumbs)),s=L.computed(()=>!o.value||a(n.showToolbar)),l=L.ref(!1),c=L.computed(()=>"0.1.1"),u=L.computed(()=>"2026-04-29T03:19:47.668Z"),f=L.ref(1),h=L.computed(()=>{if(n.currentPage===void 0||n.currentPage===null)return;const ue=Number(n.currentPage);if(!(!Number.isFinite(ue)||ue<1))return Math.floor(ue)}),g=L.computed(()=>h.value!==void 0),d=L.computed(()=>h.value??f.value);async function v(ue,pe=2){const Pe=Math.max(1,Math.floor(Number(ue)||1));for(let ze=0;ze<=pe;ze++){await L.nextTick(),await new Promise(Oe=>setTimeout(Oe,30));const He=B.value,Ze=E.value;if(!He||!Ze)return;const ut=He.querySelector(`.report-page[data-page-number="${Pe}"]`);if(ut){const Oe=Ze.getBoundingClientRect(),_t=ut.getBoundingClientRect(),Mt=Math.max(0,Ze.scrollTop+(_t.top-Oe.top)-8);Ze.scrollTo({top:Mt,behavior:"smooth"});return}}}function p(ue){const pe=Math.max(1,Math.min(Math.floor(Number(ue)||1),be.value));i("page-change",pe);const Pe=g.value;Pe||(f.value=pe),v(pe,Pe?4:2)}const B=L.ref(null),E=L.ref(null),m=L.ref(null),y=L.ref(!1),w=L.ref(!1),I=L.ref(null),Q=L.ref(100),x=L.ref("continuous"),U=L.ref(null);function b(ue){const pe=Math.floor(Number(ue)||100);return Math.min(250,Math.max(25,pe))}function C(){const ue=E.value;if(!ue)return;const pe=Fa().width,Pe=Math.max(1,ue.clientWidth-40);Q.value=b(Math.floor(Pe/pe*100))}const D=L.computed(()=>{if(y.value||w.value)return{"--nv-scale":"1",transform:"none",transformOrigin:"top left"};const ue=b(Q.value);return{"--nv-scale":String(ue/100),transform:`scale(${ue/100})`,transformOrigin:"top center"}}),F=L.computed({get:()=>d.value,set:ue=>p(Number(ue))}),H=L.ref(""),X=L.ref([]),q=L.ref(0),re=L.ref(null),ie=L.ref(null),ge=L.ref(!1),he=L.ref(!0),R=L.ref("pages"),V=L.ref(""),J=L.ref({}),ee=L.ref(null),ae=new Set,j=L.ref([]),G=L.ref(!1),oe=L.ref(null),se=L.ref(!1),ne=L.ref(1),le=L.ref(!1);let Fe=null,W=null;const xe=L.computed(()=>{const ue=(V.value||"").trim().toLowerCase();return ue?b0.value.filter(pe=>(pe.title||"").toLowerCase().includes(ue)):b0.value});function z(){se.value=!0,Fe&&clearTimeout(Fe),Fe=setTimeout(()=>{se.value=!1},180)}let Y=null;async function O(){if(Y)return Y;const ue=await Promise.resolve().then(()=>eae);return Y=(ue==null?void 0:ue.default)||ue,Y}async function Z(ue){var ze;if(J.value[ue]||ae.has(ue))return;const pe=B.value;if(!pe)return;let Pe=pe.querySelector(`.report-page[data-page-number="${ue}"]`);if(!Pe&&(oe.value=ue,await L.nextTick(),await new Promise(He=>setTimeout(He,80)),Pe=pe.querySelector(`.report-page[data-page-number="${ue}"]`),!Pe)){oe.value=null;return}ae.add(ue);try{ee.value=null,typeof document<"u"&&((ze=document.fonts)!=null&&ze.ready)&&await document.fonts.ready;const He=await O();if(!He)return;const Ze=Math.max(1,Pe.offsetWidth||794),ut=Math.max(1,Pe.offsetHeight||1123),_t=.35*(typeof window<"u"?Math.min(2,Math.max(1,Number(window.devicePixelRatio)||1)):1),jt=await He().set({margin:0,image:{type:"jpeg",quality:.75},html2canvas:{scale:_t,useCORS:!0,backgroundColor:"#ffffff",logging:!1,imageTimeout:15e3,windowWidth:Ze,windowHeight:ut,onclone:de=>{try{const Te=de.querySelector(".report-pages-root");Te&&(Te.style.transform="none",Te.style.transformOrigin="top left");const Le=de.querySelector(".thumb-offscreen-page");Le&&(Le.style.position="absolute",Le.style.left="0px",Le.style.top="0px",Le.style.margin="0",Le.style.boxShadow="none",Le.style.pointerEvents="none")}catch{}}},jsPDF:{unit:"px",format:[Ze,ut],hotfixes:["px_scaling"]}}).from(Pe).toCanvas().get("canvas");if(!jt)return;const P=jt.toDataURL("image/jpeg",.75);J.value={...J.value,[ue]:P}}catch(He){const Ze=He!=null&&He.message?String(He.message):"";ee.value=Ze?`No se pudieron generar miniaturas: ${Ze}`:"No se pudieron generar miniaturas"}finally{ae.delete(ue),oe.value===ue&&(oe.value=null)}}function Be(ue){const pe=Math.max(1,Number(be.value||1)),Pe=Math.min(500,pe),ze=new Set(j.value);for(const He of ue){const Ze=Math.floor(Number(He)||0);Ze<1||Ze>Pe||J.value[Ze]||ze.has(Ze)||(j.value.push(Ze),ze.add(Ze))}je()}function Ce(ue){const pe=Math.max(1,Number(be.value||1)),Pe=Math.min(500,pe),ze=new Set(j.value),He=[];for(const Ze of ue){const ut=Math.floor(Number(Ze)||0);ut<1||ut>Pe||J.value[ut]||ze.has(ut)||(He.push(ut),ze.add(ut))}He.length>0&&(j.value=He.concat(j.value)),je()}function Ie(){if(!le.value)return;const ue=Math.max(1,Number(be.value||1)),pe=Math.min(500,ue);ne.value<1&&(ne.value=1);const Pe=[],ze=30;if(!(j.value.length>=200)){for(;Pe.length<ze&&ne.value<=pe;){const Ze=ne.value++;J.value[Ze]||Pe.push(Ze)}Pe.length>0&&Be(Pe)}}async function je(){if(!G.value){G.value=!0;try{for(;j.value.length>0&&!(!A.value||!he.value||R.value!=="pages");){if(se.value){await new Promise(pe=>setTimeout(pe,120));continue}const ue=j.value.shift();J.value[ue]||(await Z(ue),Ie(),await new Promise(pe=>setTimeout(pe,250)))}}finally{G.value=!1}}}let qe=null;function et(){qe&&clearTimeout(qe),qe=setTimeout(async()=>{if(!A.value||!he.value||R.value!=="pages")return;await L.nextTick();const ue=Ye.value||[];for(const pe of ue){const Pe=Number(pe.pageNumber)||1;Be([Pe])}},120)}function yt(){L.watch([()=>he.value,()=>R.value,()=>d.value,()=>x.value],()=>{et()}),L.watch(()=>Ye.value.map(ue=>ue.pageNumber).join(","),()=>{et()}),L.watch([()=>he.value,()=>R.value,()=>be.value],()=>{if(!A.value||!he.value||R.value!=="pages")return;j.value=[],le.value=!0,ne.value=1;const ue=d.value||1;Ce([ue,ue-1,ue+1,ue-2,ue+2]),Ie()},{immediate:!0})}async function Yt(){if(typeof document>"u")return;const ue=m.value;if(ue)try{document.fullscreenElement?await document.exitFullscreen():ue.requestFullscreen&&await ue.requestFullscreen()}catch{}}function kt(){typeof document>"u"||(ge.value=!!document.fullscreenElement)}function gr(){const ue=E.value;if(!ue)return;const pe=Fa(),Pe=Math.max(1,ue.clientWidth-40),ze=Math.max(1,ue.clientHeight-40),He=Math.min(Pe/pe.width,ze/pe.height);Q.value=b(Math.floor(He*100))}function tt(){if(o.value)return;const ue=ie.value;ue&&(ue.focus(),ue.select())}function nt(){if(o.value)return;const ue=U.value;ue&&(ue.focus(),ue.select())}function Ut(){H.value="",X.value=[],q.value=0,re.value=null}function Qt(){he.value=!he.value}const dr=L.computed(()=>{const ue=Math.max(1,Number(be.value||1)),Pe=Math.min(ue,500);return Array.from({length:Pe},(ze,He)=>({page:He+1}))});function ar(){const ue=document.activeElement;if(!ue)return!1;if(ue.isContentEditable)return!0;const pe=(ue.tagName||"").toUpperCase();return pe==="INPUT"||pe==="TEXTAREA"||pe==="SELECT"}function pr(ue){var pe,Pe;if(!(ar()&&ue.key!=="Escape")){if(ue.key==="PageDown"){ue.preventDefault(),p(d.value+1);return}if(ue.key==="PageUp"){ue.preventDefault(),p(d.value-1);return}if(ue.key==="Home"){ue.preventDefault(),p(1);return}if(ue.key==="End"){ue.preventDefault(),p(be.value);return}if((ue.ctrlKey||ue.metaKey)&&(ue.key==="+"||ue.key==="=")){ue.preventDefault(),Q.value=b(Q.value+10);return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="-"){ue.preventDefault(),Q.value=b(Q.value-10);return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="0"){ue.preventDefault(),Q.value=100;return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="f"){ue.preventDefault(),tt();return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="g"){ue.preventDefault(),nt();return}if(ue.key==="/"&&!ue.ctrlKey&&!ue.metaKey&&!ue.altKey){ue.preventDefault(),tt();return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="b"){ue.preventDefault(),Qt();return}if(ue.key==="F11"){ue.preventDefault(),Yt();return}if(ue.key==="Escape"){if(document.activeElement===ie.value){(Pe=(pe=ie.value)==null?void 0:pe.blur)==null||Pe.call(pe);return}if(H.value){Ut();return}}}}L.onMounted(()=>{typeof window<"u"&&(window.addEventListener("keydown",pr),document.addEventListener("fullscreenchange",kt),kt())}),L.onUnmounted(()=>{typeof window<"u"&&(window.removeEventListener("keydown",pr),document.removeEventListener("fullscreenchange",kt)),W&&(W.removeEventListener("scroll",z),W=null)});const Un=L.computed(()=>{if(X.value.length===0)return null;const ue=Math.min(Math.max(0,q.value),X.value.length-1);return X.value[ue]||null});function jr(ue){return(ue??"").toString()}function Zn(ue){const pe=jr(ue),Pe=(H.value||"").trim();if(!Pe)return[{t:pe,m:!1}];const ze=pe.toLowerCase(),He=Pe.toLowerCase();if(!He)return[{t:pe,m:!1}];const Ze=[];let ut=0;for(;ut<pe.length;){const Oe=ze.indexOf(He,ut);if(Oe===-1){Ze.push({t:pe.slice(ut),m:!1});break}Oe>ut&&Ze.push({t:pe.slice(ut,Oe),m:!1}),Ze.push({t:pe.slice(Oe,Oe+Pe.length),m:!0}),ut=Oe+Pe.length}return Ze.length>0?Ze:[{t:pe,m:!1}]}function An(ue,pe){const Pe=Un.value;return!Pe||Pe.elId!==ue?!1:Pe.rowIdx===void 0&&pe===void 0?!0:Number(Pe.rowIdx)===Number(pe)}async function jn(ue){if(X.value.length===0)return;q.value=Math.min(Math.max(0,ue),X.value.length-1);const pe=Un.value;if(!pe)return;p(pe.page),await L.nextTick(),await new Promise(Ze=>setTimeout(Ze,30));const Pe=B.value;if(!Pe)return;const ze=pe.rowIdx!==void 0?`[data-el-id="${pe.elId}"][data-row-idx="${pe.rowIdx}"]`:`[data-el-id="${pe.elId}"]`,He=Pe.querySelector(ze);He&&He.scrollIntoView({behavior:"smooth",block:"center"})}function Fr(){jn(q.value+1)}function rr(){jn(q.value-1)}async function Gt(){if(typeof window>"u")return;const ue=w.value;w.value=!0,await L.nextTick(),await new Promise(Pe=>setTimeout(Pe,50));const pe=()=>{window.removeEventListener("afterprint",pe),w.value=ue};window.addEventListener("afterprint",pe),window.print()}const ir=L.computed(()=>{let ue=I.value??n.data;if(typeof ue=="string")try{ue=JSON.parse(ue)}catch{ue={}}const pe={},Pe=Dr.value.dataSources||[];for(const ze of Pe)ze.isManual&&ze.manualData&&Array.isArray(ze.manualData)&&(pe[ze.alias]=ze.manualData.length>0?ze.manualData:[{}]);if(Array.isArray(ue))pe.main=ue.length>0?ue:pe.main||[{}];else if(ue&&typeof ue=="object")for(const[ze,He]of Object.entries(ue))pe[ze]=Array.isArray(He)&&He.length>0?He:[{}];return Object.keys(pe).length===0&&(pe.main=[{}]),pe}),Jr=L.computed(()=>{var Pe;const ue=Dr.value.dataSources,pe=((Pe=ue==null?void 0:ue[0])==null?void 0:Pe.alias)||"main";return ir.value[pe]||ir.value.main||[{}]});function Rn(ue){var pe,Pe,ze,He;if(ue.dataSource&&ir.value[ue.dataSource]){const Ze=ir.value[ue.dataSource],ut=(pe=Dr.value.dataSources)==null?void 0:pe.find(_t=>_t.alias===ue.dataSource);let Oe=Ze;return(Pe=ut==null?void 0:ut.joins)!=null&&Pe.length&&(Oe=_e(Oe,ut.joins)),(ze=ut==null?void 0:ut.filters)!=null&&ze.length&&(Oe=Cn(Oe,ut.filters)),(He=ut==null?void 0:ut.sort)!=null&&He.length&&(Oe=Ee(Oe,ut.sort)),Oe}return Jr.value}const Pi=L.computed(()=>({width:"100%",minHeight:"100%",padding:"24px",display:"grid",gridTemplateColumns:`repeat(${kJe}, 1fr)`,gridAutoRows:`${_Je}px`,gap:"16px",background:"#f8fafc"}));function sa(ue){return{gridColumn:`${ue.x+1} / span ${ue.w}`,gridRow:`${ue.y+1} / span ${ue.h}`,display:"flex",flexDirection:"column",background:"#fff",borderRadius:"12px",overflow:"hidden",border:"1px solid #e2e8f0",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",transition:"transform 0.2s, box-shadow 0.2s"}}function Pr(ue){return ue?ue<=10?ue*YJe:ue:0}function Fa(){const ue=Dr.value.layout.page;let pe=794,Pe=1123;return ue.format==="Letter"?(pe=816,Pe=1056):ue.format==="Ticket"&&(pe=302,Pe=800),ue.orientation==="landscape"?{width:Pe,height:pe}:{width:pe,height:Pe}}function $i(){const ue=Dr.value.layout.page.margins;return ue?{top:Pr(ue.top),right:Pr(ue.right),bottom:Pr(ue.bottom),left:Pr(ue.left)}:{top:0,right:0,bottom:0,left:0}}function Ji(){const{height:ue}=Fa(),pe=$i();return Math.max(1,ue-pe.top-pe.bottom)}function Gr(ue,pe,Pe,ze){const He=ut=>ut==null?"":String(ut),Ze=ut=>Number(ut);switch(pe){case"eq":return He(ue)===He(Pe);case"ne":return He(ue)!==He(Pe);case"gt":return Ze(ue)>Ze(Pe);case"gte":return Ze(ue)>=Ze(Pe);case"lt":return Ze(ue)<Ze(Pe);case"lte":return Ze(ue)<=Ze(Pe);case"contains":return He(ue).includes(He(Pe));case"starts_with":return He(ue).startsWith(He(Pe));case"is_null":return ue==null||ue==="";case"is_not_null":return ue!=null&&ue!=="";case"between":return Ze(ue)>=Ze(Pe)&&Ze(ue)<=Ze(ze);case"regex":try{return new RegExp(String(Pe||""),"i").test(He(ue))}catch{return!1}default:return!1}}function Cn(ue,pe){return!pe||pe.length===0?ue:ue.filter(Pe=>{for(const ze of pe){const He=hi(ze.field,Pe);if(!Gr(He,ze.operator,ze.value,ze.value2))return!1}return!0})}function Ee(ue,pe){if(!pe||pe.length===0)return ue;const Pe=ue.map((He,Ze)=>({r:He,i:Ze})),ze=He=>He==="desc"?-1:1;return Pe.sort((He,Ze)=>{for(const ut of pe){const Oe=hi(ut.field,He.r),_t=hi(ut.field,Ze.r),Mt=Number(Oe),jt=Number(_t);let P=0;if(!isNaN(Mt)&&!isNaN(jt))P=Mt===jt?0:Mt<jt?-1:1;else{const de=Oe==null?"":String(Oe),Te=_t==null?"":String(_t);P=de.localeCompare(Te,void 0,{numeric:!0,sensitivity:"base"})}if(P!==0)return P*ze(ut.direction)}return He.i-Ze.i}),Pe.map(He=>He.r)}function _e(ue,pe){if(!pe||pe.length===0)return ue;let Pe=ue;for(const ze of pe){const He=ir.value[ze.alias]||ir.value[ze.collection]||[];if(!Array.isArray(He)||He.length===0)continue;const Ze=new Map;for(const Oe of He){const _t=(hi(ze.foreignField,Oe)??"").toString(),Mt=Ze.get(_t)||[];Mt.push(Oe),Ze.set(_t,Mt)}const ut=[];for(const Oe of Pe){const _t=(hi(ze.localField,Oe)??"").toString(),Mt=Ze.get(_t)||[];if(ze.joinType==="inner"&&Mt.length===0)continue;const jt={...Oe};jt[ze.alias]===void 0&&(jt[ze.alias]=Mt.length>0?Mt[0]:null),ut.push(jt)}Pe=ut}return Pe}function Se(ue){var pe,Pe,ze,He,Ze,ut,Oe,_t;if(ue.dataSource&&ir.value[ue.dataSource]){const Mt=ir.value[ue.dataSource];if(Mt&&Mt.length>0){const jt=(pe=Dr.value.dataSources)==null?void 0:pe.find(de=>de.alias===ue.dataSource);let P=Mt;return(Pe=jt==null?void 0:jt.joins)!=null&&Pe.length&&(P=_e(P,jt.joins)),(ze=jt==null?void 0:jt.filters)!=null&&ze.length&&(P=Cn(P,jt.filters)),ue.filter&&(P=Cn(P,[ue.filter])),(He=jt==null?void 0:jt.sort)!=null&&He.length&&(P=Ee(P,jt.sort)),P}}for(const Mt of Object.keys(ir.value)){const jt=ir.value[Mt];if(jt&&jt.length>0){const P=(Ze=Dr.value.dataSources)==null?void 0:Ze.find(Te=>Te.alias===Mt);let de=jt;return(ut=P==null?void 0:P.joins)!=null&&ut.length&&(de=_e(de,P.joins)),(Oe=P==null?void 0:P.filters)!=null&&Oe.length&&(de=Cn(de,P.filters)),(_t=P==null?void 0:P.sort)!=null&&_t.length&&(de=Ee(de,P.sort)),de}}return[]}const Re=L.computed(()=>{var Vt,gt;const ue=Dr.value.layout.bands||[],pe=Ji(),Pe=ue.find(zt=>zt.type==="ReportHeader"),ze=ue.find(zt=>zt.type==="PageHeader"),He=ue.find(zt=>zt.type==="PageFooter"),Ze=ue.find(zt=>zt.type==="ReportFooter"),ut=ue.filter(zt=>!["ReportHeader","PageHeader","PageFooter","ReportFooter"].includes(zt.type)),Oe=ut.filter(zt=>zt.type==="DataBand"),_t=ut.filter(zt=>zt.type==="DetailBand"),Mt=ut.find(zt=>zt.type==="GroupHeader"&&zt.masterField),jt=ut.find(zt=>zt.type==="GroupFooter"&&zt.masterField),P=Mt==null?void 0:Mt.masterField,de=ut.filter(zt=>!["DataBand","DetailBand","GroupHeader","GroupFooter"].includes(zt.type)),Te=(Pe==null?void 0:Pe.height)||0,Le=(ze==null?void 0:ze.height)||0,Ke=(He==null?void 0:He.height)||0,mt=de.reduce((zt,lr)=>zt+(lr.height||0),0),Rt=[],Ge=Oe[0],qt=Ge?Se(Ge):Jr.value,rt=!!(Pe!=null&&Pe.pageBreakAfter&&qt.length>0),wr=(Ge==null?void 0:Ge.dataSource)||((gt=(Vt=Dr.value.dataSources)==null?void 0:Vt[0])==null?void 0:gt.alias)||"main",bt=Ge?_t.filter(zt=>!zt.dataSource||!zt.childField||!zt.masterField?!1:(zt.parentDataSource||wr)===wr):[];if(!!(Ge&&!Ro(Ge)&&(bt.length>0||P))){const zt=zr=>zr==null?"":String(zr),lr=new Map;if(P)for(const zr of qt){const kn=zt(hi(P,zr));lr.set(kn,(lr.get(kn)||0)+1)}const Er=zr=>pe-Ke-Le-mt-(zr?Te:0),hr=(zr,kn)=>{const ua=Se(zr),Vs=zr.masterField,Ui=zr.childField;if(!Vs||!Ui)return ua.length;const Wo=zt(hi(Vs,kn));let EA=0;for(const Ki of ua)zt(hi(Ui,Ki))===Wo&&EA++;return EA},en=zr=>{let kn=(Ge==null?void 0:Ge.height)||0;for(const ua of bt)kn+=(ua.height||0)*hr(ua,zr);return kn};let _n=1,Ln=!rt;const dn=()=>{const zr=[];Ln&&Pe&&zr.push({band:Pe}),ze&&zr.push({band:ze});for(const kn of de)zr.push({band:kn});return zr};if(rt){const zr=[];Pe&&zr.push({band:Pe}),ze&&zr.push({band:ze});for(const kn of de)zr.push({band:kn});He&&zr.push({band:He}),Rt.push({pageNumber:_n,bands:zr}),_n++}let yn=dn(),In=Er(Ln),ln=0,rn=null,xn=null;const cn=()=>{He&&yn.push({band:He}),Rt.push({pageNumber:_n,bands:yn}),_n++,Ln=!1,yn=dn(),In=Er(Ln),ln=0,xn=null},ni=zr=>{zr<=In-ln||cn()},Ci=(zr,kn)=>{!Mt||!P||xn!==kn&&(ni(Mt.height||0),yn.push({band:Mt,rows:[zr],groupKey:kn,groupCount:lr.get(kn)||0}),ln+=Mt.height||0,xn=kn)},Ra=(zr,kn)=>{!jt||!P||(ni(jt.height||0),yn.push({band:jt,rows:[zr],groupKey:kn,groupCount:lr.get(kn)||0}),ln+=jt.height||0)};for(let zr=0;zr<qt.length;zr++){const kn=qt[zr],ua=P?zt(hi(P,kn)):"";P&&(rn===null&&(rn=ua),ua!==rn&&(Ra(qt[zr-1]||kn,rn),rn=ua,xn=null),Ci(kn,ua));const Vs=en(kn);ni(Vs),yn.push({band:Ge,rows:[kn],rowIndex:zr,totalRows:qt.length,groupKey:ua,groupCount:lr.get(ua)||0}),ln+=Vs}P&&rn!==null&&Ra(qt[qt.length-1]||{},rn),yn.length>0&&cn()}else{const zt=ln=>Ro(ln)&&ln.elements.some(rn=>rn.type==="Chart"||rn.type==="Crosstab"||rn.type==="SubReport")&&!ln.elements.some(rn=>rn.type==="Table"),lr=Oe.reduce((ln,rn)=>ln+(rn.height||0),0),Er=pe-Le-Ke-Te-mt,hr=pe-Le-Ke-mt,en=rt?hr:Math.min(Er,hr);let _n=lr>0?Math.max(1,Math.floor(en/lr)):qt.length;if(Ge&&Ro(Ge)){const ln=Mh(Ge,Math.max(1,en));ln&&(_n=ln)}ut.some(ln=>ln.pageBreakBefore||ln.pageBreakAfter)&&(_n=1);const Ln=!!(Ge&&zt(Ge));Ln&&(_n=Math.max(1,qt.length));const dn=Ln?1:Math.ceil(qt.length/_n),yn=[];Pe&&yn.push({band:Pe}),ze&&yn.push({band:ze});for(const ln of de)yn.push({band:ln});if(!rt&&Oe.length>0&&qt.length>0){const ln=Math.min(_n,qt.length);for(const rn of Oe){const xn=Se(rn),cn=Ro(rn)?Math.max(1,Er):void 0;yn.push({band:rn,rows:zt(rn)?xn:xn.slice(0,ln),heightOverride:cn})}}He&&yn.push({band:He}),Rt.push({pageNumber:1,bands:yn});const In=rt?0:1;for(let ln=In;ln<dn;ln++){const rn=[];ze&&rn.push({band:ze});for(const ni of de)rn.push({band:ni});const xn=ln*_n,cn=Math.min((ln+1)*_n,qt.length);for(const ni of Oe){if(zt(ni)&&xn>0)continue;const Ci=Se(ni),Ra=Ro(ni)?Math.max(1,hr):void 0;rn.push({band:ni,rows:zt(ni)?Ci:Ci.slice(xn,cn),heightOverride:Ra})}He&&rn.push({band:He}),Rt.push({pageNumber:Rt.length+1,bands:rn})}}if(Ze&&Rt.length>0){const zt=Rt[Rt.length-1],lr=zt.bands.findIndex(Er=>Er.band.type==="PageFooter");lr>=0?zt.bands.splice(lr,0,{band:Ze}):zt.bands.push({band:Ze})}return{pages:Rt,totalPages:Math.max(1,Rt.length),pageHeight:pe}}),be=L.computed(()=>Re.value.totalPages),Ye=L.computed(()=>{const ue=Re.value.pages;if(y.value||w.value)return ue;if(ue.length===0)return[];const pe=Math.min(Math.max(1,d.value),ue.length);let Pe=[];if(x.value==="continuous")if(n.currentPage===void 0&&ue.length<=PJe)Pe=ue;else{const He=Math.max(1,pe-1),Ze=Math.min(ue.length,pe+1);Pe=ue.slice(He-1,Ze)}else Pe=[ue[pe-1]];const ze=oe.value;if(ze&&he.value&&R.value==="pages"){const He=ue[ze-1]||ue.find(Ze=>Number(Ze.pageNumber)===ze);He&&!Pe.some(Ze=>Number(Ze.pageNumber)===ze)&&(Pe=Pe.concat([He]))}return Pe});let ht=null;function xt(){const ue=(H.value||"").trim().toLowerCase();if(re.value=null,X.value=[],q.value=0,!ue)return;const pe=Re.value.pages||[],Pe=250,ze=Math.min(Pe,pe.length);pe.length>Pe&&(re.value=`Búsqueda limitada a las primeras ${Pe} páginas`);const He=[];for(let Ze=0;Ze<ze;Ze++){const ut=pe[Ze],Oe=Number(ut.pageNumber||Ze+1),_t=Array.isArray(ut.bands)?ut.bands:[];for(const Mt of _t){const jt=Mt.band;if(!jt||!Array.isArray(jt.elements))continue;const P=jt.type==="DataBand",de=P&&Ro(jt);if(P&&!de){const Te=Array.isArray(Mt.rows)?Mt.rows:[],Le=Number(Mt.totalRows??Te.length);for(let Ke=0;Ke<Te.length;Ke++){const mt=Te[Ke],Rt=Number(Mt.rowIndex??Ke);for(const Ge of jt.elements){if(Ge.type!=="Text")continue;const qt=jr(Qi(Ge,mt,Rt,Le,Oe,Mt.groupKey,Mt.groupCount));if(qt&&qt.toLowerCase().includes(ue)&&(He.push({page:Oe,elId:Ge.id,rowIdx:Rt}),He.length>=500))break}if(He.length>=500)break}}else{const Te=Array.isArray(Mt.rows)?Mt.rows[0]:void 0;for(const Le of jt.elements){if(Le.type!=="Text")continue;const Ke=jr(Qi(Le,Te,0,1,Oe,Mt.groupKey,Mt.groupCount));if(Ke&&Ke.toLowerCase().includes(ue)&&(He.push({page:Oe,elId:Le.id}),He.length>=500))break}}if(He.length>=500)break}if(He.length>=500)break}X.value=He}L.watch(()=>H.value,()=>{ht&&clearTimeout(ht),ht=setTimeout(()=>xt(),200)});const st=L.ref({}),ft=L.ref(!1),pt=L.ref([]),At=L.ref({}),Ue=L.ref([]),lt=L.ref(!1),ct=L.ref(null);L.onErrorCaptured(ue=>{try{ct.value=ue!=null&&ue.message?String(ue.message):String(ue)}catch{ct.value="Error de render"}return!1}),L.onMounted(async()=>{await L.nextTick(),!W&&E.value&&(W=E.value,W.addEventListener("scroll",z,{passive:!0})),yt()});function Ht(ue){const pe=ue.parameters||[];if(pe.length===0){st.value=n.parameters||{},ft.value=!1,lt.value=!0;return}pt.value=pe;const Pe={};for(const ze of pe)Pe[ze.name]=n.parameters&&ze.name in n.parameters?n.parameters[ze.name]:ze.defaultValue??(ze.type==="boolean"?!1:"");At.value={...Pe},st.value={...Pe},lt.value=!0,ft.value=!n.skipParamsDialog}L.onMounted(()=>{Ue.value=[],Ht(Dr.value),hs()});function Or(){Ue.value=[];for(const ue of pt.value){if(!ue.required)continue;const pe=At.value[ue.name];(pe===""||pe===null||pe===void 0)&&Ue.value.push(ue.name)}return Ue.value.length===0}function $r(){Or()&&sn()}function sn(){for(const ue of pt.value)if(ue.required&&(At.value[ue.name]===""||At.value[ue.name]===null||At.value[ue.name]===void 0))return;st.value={...At.value},ft.value=!1,lt.value=!0}const Dr=L.computed(()=>{var pe;let ue=n.definition;if(typeof ue=="string")try{ue=JSON.parse(ue)}catch{return Kn()}return(pe=ue==null?void 0:ue.layout)!=null&&pe.bands?Ga(ue):Kn()});function Kn(){return{metadata:{name:"Error",version:"1.0",createdAt:""},layout:{page:{format:"A4",orientation:"portrait"},bands:[]},dataSources:[]}}function Ga(ue){var ze,He,Ze;const pe=((ze=ue==null?void 0:ue.layout)==null?void 0:ze.page)||{};return{metadata:(ue==null?void 0:ue.metadata)||{name:"",version:"1.0",createdAt:""},documentType:(ue==null?void 0:ue.documentType)||"Report",layout:{page:{format:pe.format||"A4",orientation:pe.orientation||"portrait",margins:pe.margins},bands:Array.isArray((He=ue==null?void 0:ue.layout)==null?void 0:He.bands)?ue.layout.bands.filter(Boolean).map(ut=>({id:String(ut.id||`b_${Math.random().toString(36).slice(2)}`),type:ut.type,height:Number(ut.height||0),elements:Array.isArray(ut.elements)?ut.elements.filter(Boolean).map(Oe=>({...Oe,id:String(Oe.id||`el_${Math.random().toString(36).slice(2)}`),x:Number(Oe.x||0),y:Number(Oe.y||0),width:Number(Oe.width||0),height:Number(Oe.height||0)})):[],dataSource:ut.dataSource,parentDataSource:ut.parentDataSource,masterField:ut.masterField,childField:ut.childField,filter:ut.filter,pageBreakBefore:!!ut.pageBreakBefore,pageBreakAfter:!!ut.pageBreakAfter})):[],widgets:Array.isArray((Ze=ue==null?void 0:ue.layout)==null?void 0:Ze.widgets)?ue.layout.widgets.filter(Boolean).map(ut=>({...ut,id:String(ut.id||`w_${Math.random().toString(36).slice(2)}`),x:Number(ut.x||0),y:Number(ut.y||0),w:Number(ut.w||1),h:Number(ut.h||1)})):[]},dataSources:Array.isArray(ue==null?void 0:ue.dataSources)?ue.dataSources:[],parameters:Array.isArray(ue==null?void 0:ue.parameters)?ue.parameters:[],dictionary:(ue==null?void 0:ue.dictionary)||{dataSources:[]}}}function hi(ue,pe){return ue.split(".").reduce((Pe,ze)=>Pe==null?void 0:Pe[ze.trim()],pe)}function go(ue,pe,Pe,ze,He,Ze,ut,Oe){var de,Te,Le;const _t=Ke=>{const mt=(Ke??"").toString().trim();return!mt||/^\[.*\]$/.test(mt)?"":/^\{\{[\s\S]*\}\}$/.test(mt)?mt.slice(2,-2).trim():mt},Mt=_t((de=ue.options)==null?void 0:de.imageUrl);if((((Te=ue.options)==null?void 0:Te.imageSource)||((Le=ue.options)==null?void 0:Le.source)||"url").toString()==="binding"){const Ke=_t(ue.binding),mt=pe||Oe||Jr.value[0]||{};if(Ke){const Rt=hi(Ke,mt),Ge=_t(Rt);if(Ge)return Ge}return Mt}const P=_t(ue.content);return Mt||P}function Ta(ue,pe,Pe,ze,He,Ze,ut,Oe){const _t=(ue.binding||"").trim();if(!_t)return"";const jt=(jo(`{{${_t}}}`,qn(pe,Pe,ze,He,Ze,ut,Oe))??"").toString().trim();return!jt||/^\[.*\]$/.test(jt)?"":jt}const ea=L.ref({}),Mi=L.ref({});async function ph(ue){const pe=ue.trim();if(!pe||ea.value[pe]||Mi.value[pe])return;Mi.value={...Mi.value,[pe]:!0};try{const He=await Promise.resolve().then(()=>mae),ut=await((He==null?void 0:He.default)||He).toDataURL(pe,{margin:1,width:256,errorCorrectionLevel:"M"});typeof ut=="string"&&ut.startsWith("data:")&&(ea.value={...ea.value,[pe]:ut})}catch{}const{[pe]:Pe,...ze}=Mi.value;Mi.value=ze}function xl(ue,pe,Pe,ze,He,Ze,ut,Oe){const _t=(ue.binding||"").trim();if(_t){const jt=(jo(`{{${_t}}}`,qn(pe,Pe,ze,He,Ze,ut,Oe))??"").toString().trim();if(jt&&!/^\[.*\]$/.test(jt))return jt}if(ue.content){const jt=(jo(ue.content,qn(pe,Pe,ze,He,Ze,ut,Oe))??"").toString().trim();if(jt&&!/^\[.*\]$/.test(jt))return jt}return""}function T0(ue){const pe=(ue||"").trim();if(!pe)return"";const Pe=ea.value[pe];return Pe||(ph(pe),"")}function zs(ue,pe){const Pe=(ue||"").trim();if(!Pe)return"";const ze=Pe.match(/^\[(.*)\]$/s),He=ze?(ze[1]||"").trim():Pe;return(ze?!0:/[\s+\-*/()%<>=!&|]/.test(He))?jo(`{[${He}]}`,pe):jo(`{{${He}}}`,pe)}function Ml(ue,pe){const Pe=(ue||"").trim();if(!Pe)return"";if(/\{\[.*?\]\}/s.test(Pe)||/\{\{.*?\}\}/s.test(Pe))return jo(Pe,pe);const ze=Pe.match(/^\[(.*)\]$/s);return ze?jo(`{[${(ze[1]||"").trim()}]}`,pe):Pe}const Qi=(ue,pe,Pe,ze,He,Ze,ut,Oe)=>{const _t=qn(pe,Pe,ze,He,Ze,ut,Oe);return ue.content?Ml(ue.content,_t):ue.binding?zs(ue.binding,_t):""};function la(ue,pe,Pe,ze,He,Ze,ut,Oe){if(!ue)return"";try{return jo(ue,qn(pe,Pe,ze,He,Ze,ut,Oe))}catch{return ue}}function Fo(ue,pe){const Pe=ue.drillDownConfig;if(!Pe)return;const ze=Pe.targetReportId;if(!ze){console.warn("DrillDown: No target report specified");return}const He={};for(const Ze of Pe.parameterMappings)He[Ze.targetParameter]=hi(Ze.sourceField,pe);if(i("drill-click",{element:ue,sourceData:pe,targetReportId:ze,parameters:He,config:Pe}),Pe.showAsModal){vh(ze,He,Pe);return}if(Pe.openInNewTab){const Ze=`${window.location.pathname}?report=${ze}¶ms=${encodeURIComponent(JSON.stringify(He))}`;window.open(Ze,"_blank");return}}const Oi=L.ref(null);async function vh(ue,pe,Pe){Oi.value={targetId:ue,params:pe,config:Pe,loading:!0,error:null,definition:null,data:null};const ze=(n.apiBaseUrl||"").replace(/\/+$/,""),He={"Content-Type":"application/json"};n.apiKey&&(He["X-API-Key"]=n.apiKey);try{const Ze=await fetch(`${ze}/api/reports/${ue}`,{headers:He});if(!Ze.ok)throw new Error(`No se pudo cargar el reporte (${Ze.status})`);const ut=await Ze.json(),Oe=ut.report||ut.definition||ut,jt=(await(await fetch(`${ze}/api/reports/${ue}/render`,{method:"POST",headers:He,body:JSON.stringify({parameters:pe})})).json().catch(()=>({}))).data??null;Oi.value&&Oi.value.targetId===ue&&(Oi.value={targetId:ue,params:pe,config:Pe,loading:!1,error:null,definition:Oe,data:jt})}catch(Ze){Oi.value&&Oi.value.targetId===ue&&(Oi.value={targetId:ue,params:pe,config:Pe,loading:!1,error:(Ze==null?void 0:Ze.message)||"Error cargando drill-down",definition:null,data:null})}}function J1(ue){ue.options||(ue.options={}),ue.options.subReportCollapsed=!ue.options.subReportCollapsed,i("subreport-toggle",{subReportId:ue.subReportId||"embedded",collapsed:ue.options.subReportCollapsed})}const Bh=L.computed(()=>(Dr.value.layout.bands||[]).filter(ue=>ue.type==="DetailBand"));function K1(ue){var Pe,ze;const pe=ue.dataSource||((ze=(Pe=Dr.value.dataSources)==null?void 0:Pe[0])==null?void 0:ze.alias)||"main";return Bh.value.filter(He=>!He.dataSource||!He.childField||!He.masterField?!1:(He.parentDataSource||pe)===pe)}function PA(ue,pe){const Pe=Se(ue);if(!ue.masterField||!ue.childField)return Pe;const ze=hi(ue.masterField,pe),He=ut=>ut==null?"":String(ut);return Pe.filter(ut=>He(hi(ue.childField,ut))===He(ze))}const Ql=L.ref(new Map),OA=L.ref(new Set),ju=L.ref(new Map);async function Eh(ue){if(!ue||Ql.value.has(ue)||OA.value.has(ue)||!n.apiBaseUrl)return;OA.value.add(ue),ju.value.delete(ue);const pe=n.apiBaseUrl.replace(/\/+$/,""),Pe={"Content-Type":"application/json"};n.apiKey&&(Pe["X-API-Key"]=n.apiKey);try{const ze=await fetch(`${pe}/api/reports/${ue}`,{headers:Pe});if(!ze.ok)throw new Error(`No se pudo cargar subreporte (${ze.status})`);const He=await ze.json(),Ze=He.report||He.definition||He,_t=(await(await fetch(`${pe}/api/reports/${ue}/render`,{method:"POST",headers:Pe,body:JSON.stringify({parameters:st.value||{}})})).json().catch(()=>({}))).data??null;Ql.value.set(ue,{definition:Ze,data:_t})}catch(ze){ju.value.set(ue,(ze==null?void 0:ze.message)||"Error cargando subreporte")}finally{OA.value.delete(ue)}}const W1=L.computed(()=>{const ue=new Set,pe=Ye.value;for(const Pe of pe)for(const ze of Pe.bands){const He=ze.band;for(const Ze of He.elements||[])Ze.type==="SubReport"&&Ze.subReportId&&!Ze.subReportDefinition&&!Ql.value.has(Ze.subReportId)&&ue.add(Ze.subReportId)}return Array.from(ue)});L.watch(W1,ue=>{for(const pe of ue)Eh(pe)},{immediate:!0});function ss(ue){var pe;return ue&&((pe=Ql.value.get(ue))==null?void 0:pe.definition)||null}function Cl(ue){var pe;return ue?((pe=Ql.value.get(ue))==null?void 0:pe.data)??null:null}function R0(ue){return ue?OA.value.has(ue):!1}function LA(ue){return ue&&ju.value.get(ue)||""}function qn(ue,pe,Pe,ze,He,Ze,ut){var jt,P,de,Te;const Oe=Dr.value,_t=ue||Jr.value[0]||{},Mt={row:_t,data:Jr.value,page:ze??d.value,totalPages:be.value,rowNumber:pe!==void 0?pe+1:1,totalRows:Pe||Jr.value.length,parameters:st.value,groupKey:He??"",groupCount:Ze??0,reportName:((jt=Oe.metadata)==null?void 0:jt.name)||"",reportAuthor:((P=Oe.metadata)==null?void 0:P.author)||"",reportDescription:((de=Oe.metadata)==null?void 0:de.description)||"",reportCreated:((Te=Oe.metadata)==null?void 0:Te.createdAt)||""};if(Object.keys(_t).forEach(Le=>{Mt[Le]=_t[Le]}),ut&&typeof ut=="object")for(const Le of Object.keys(ut))Mt[Le]===void 0&&(Mt[Le]=ut[Le]);return Mt}function X1(ue,pe,Pe,ze,He,Ze,ut,Oe){if(!ue.conditionalFormats||ue.conditionalFormats.length===0)return{};const _t=qn(pe,Pe,ze,He,Ze,ut,Oe);for(const Mt of ue.conditionalFormats){if(!Mt.enabled)continue;const jt=Mt.condition,P=hi(jt.field,_t.row);if(Gr(P,jt.operator,jt.value,jt.value2)){const Te={};return Mt.style.backgroundColor&&(Te.backgroundColor=Mt.style.backgroundColor),Mt.style.color&&(Te.color=Mt.style.color),Mt.style.fontWeight&&(Te.fontWeight=Mt.style.fontWeight),Mt.style.fontStyle&&(Te.fontStyle=Mt.style.fontStyle),Mt.style.fontSize&&(Te.fontSize=Mt.style.fontSize),Mt.style.border&&(Te.border=Mt.style.border),Te}}return{}}function Sl(ue,pe,Pe,ze,He,Ze,ut,Oe){const _t=Cr(ue),Mt=X1(ue,pe,Pe,ze,He,Ze,ut,Oe);return{..._t,...Mt}}function Cr(ue){const pe=ue.style||{};return{position:"absolute",left:ue.x+"px",top:ue.y+"px",width:ue.width+"px",height:ue.height+"px",fontSize:pe.fontSize||"14px",color:pe.color||"#000",fontWeight:pe.fontWeight||"normal",fontStyle:pe.fontStyle||"normal",fontFamily:pe.fontFamily||"Inter, Arial, sans-serif",textAlign:pe.textAlign||"left",backgroundColor:pe.backgroundColor||"transparent",border:pe.border||"none",overflow:"hidden",whiteSpace:"pre-wrap",lineHeight:"1.2",padding:pe.padding?pe.padding+"px":"2px",boxSizing:"border-box"}}const Z1=L.computed(()=>$i()),q1=L.computed(()=>{const ue=Fa();return{width:ue.width+"px",minHeight:ue.height+"px"}}),ls=L.computed(()=>{const ue=Z1.value;return{paddingTop:ue.top+"px",paddingRight:ue.right+"px",paddingBottom:ue.bottom+"px",paddingLeft:ue.left+"px"}});function mh(ue){var ze,He;const pe=(He=(ze=Dr.value)==null?void 0:ze.layout)==null?void 0:He.watermark;if(!(pe!=null&&pe.text))return!1;const Pe=be.value;return pe.pages==="first"?ue===1:pe.pages==="last"?ue===Pe:pe.pages==="except-first"?ue>1:pe.pages==="except-last"?ue<Pe:!0}const yh=L.computed(()=>{var pe,Pe;const ue=(Pe=(pe=Dr.value)==null?void 0:pe.layout)==null?void 0:Pe.watermark;return ue?{opacity:ue.opacity??.15,zIndex:ue.behindContent?-1:10,pointerEvents:"none"}:{}}),Rc=L.computed(()=>{var pe,Pe;const ue=(Pe=(pe=Dr.value)==null?void 0:pe.layout)==null?void 0:Pe.watermark;return ue?{color:ue.color||"#cccccc",fontSize:ue.fontSize||72,fontWeight:"bold",transform:`rotate(${ue.rotation??-45}deg)`,whiteSpace:"nowrap"}:{}}),To=L.computed(()=>{var pe,Pe;const ue=(Pe=(pe=Dr.value)==null?void 0:pe.layout)==null?void 0:Pe.watermark;return ue?{color:ue.color||"#cccccc",fontSize:(ue.fontSize||48)*.6,fontWeight:"bold",transform:`rotate(${ue.rotation??-45}deg)`}:{}}),wh=L.computed(()=>{var Pe,ze;const ue=(ze=(Pe=Dr.value)==null?void 0:Pe.layout)==null?void 0:ze.watermark;if(!ue)return{};const pe={center:{top:"50%",left:"50%",transform:"translate(-50%, -50%)"},"top-left":{top:"10%",left:"10%"},"top-right":{top:"10%",right:"10%"},"bottom-left":{bottom:"10%",left:"10%"},"bottom-right":{bottom:"10%",right:"10%"}};return pe[ue.position]||pe.center}),Ih=L.computed(()=>{var ue,pe;return(pe=(ue=Dr.value)==null?void 0:ue.layout)==null?void 0:pe.generateTOC}),Vu=L.computed(()=>{var Pe;const ue=new Map,pe=Re.value.pages||[];for(const ze of pe){const He=Number(ze.pageNumber)||1,Ze=Array.isArray(ze.bands)?ze.bands:[];for(const ut of Ze){const Oe=(Pe=ut==null?void 0:ut.band)==null?void 0:Pe.id;Oe&&(ue.has(Oe)||ue.set(Oe,He))}}return ue}),b0=L.computed(()=>{var ze,He;const ue=[],pe=((He=(ze=Dr.value)==null?void 0:ze.layout)==null?void 0:He.bands)||[],Pe=Vu.value;for(const Ze of pe)if(Ze.type==="ReportHeader"||Ze.type==="GroupHeader"){const ut=Ze.elements.find(Mt=>Mt.type==="Text"&&Mt.content),Oe=(ut==null?void 0:ut.content)||Ze.type,_t=Ze.type==="ReportHeader"?0:1;ue.push({bandId:Ze.id,title:Oe,level:_t,pageNumber:Pe.get(Ze.id)||1})}return ue});async function D0(ue){const pe=Vu.value.get(ue);pe&&p(pe),await L.nextTick(),await new Promise(He=>setTimeout(He,30));const Pe=B.value;if(!Pe)return;const ze=Pe.querySelector(`[data-band-id="${ue}"]`);ze&&ze.scrollIntoView({behavior:"smooth",block:"start"})}function Hs(ue){const pe={height:ue.height+"px",position:"relative",overflow:"hidden",width:"100%"};return ue.pageBreakBefore&&(pe.pageBreakBefore="always"),ue.pageBreakAfter&&(pe.pageBreakAfter="always"),pe}function bc(ue){const pe=Hs(ue.band),Pe=Number(ue.heightOverride);return Number.isFinite(Pe)&&Pe>0&&(pe.height=Pe+"px"),pe}function Ro(ue){return Array.isArray(ue.elements)?ue.elements.some(pe=>["Table","Chart","Crosstab","SubReport"].includes(pe.type)):!1}function Fl(ue,pe){const Pe=Cr(ue),ze=Number(pe.height)||0;Pe.top="0px";const He=Math.max(0,ze),Ze=Number(ue.height)||0;return He>0&&(Ze===0||Ze<He)&&(Pe.height=He+"px"),Pe.overflow="hidden",Pe}function Tl(ue){if(!ue)return 14;const pe=String(ue).trim().match(/^(\d+(?:\.\d+)?)px$/i);if(!pe)return 14;const Pe=Number(pe[1]);return isNaN(Pe)?14:Pe}function xh(ue){var ze;const pe=Tl((ze=ue.style)==null?void 0:ze.fontSize);return Math.ceil(pe*1.25)+12}function ca(ue){var ze;const pe=Tl((ze=ue.style)==null?void 0:ze.fontSize);return Math.ceil(pe*1.25)+12}function Mh(ue,pe){const Pe=ue.elements.find(Oe=>Oe.type==="Table");if(!Pe)return null;const ze=Math.max(1,pe),He=xh(Pe),Ze=ca(Pe),ut=Math.max(1,ze-He);return Math.max(1,Math.floor(ut/Ze))}function cs(ue,pe,Pe,ze,He){const Ze=He===void 0?void 0:Number(He);return zs(ue,qn(pe,Pe,ze,Ze))}function us(ue,pe,Pe,ze,He,Ze){if(!Pe||Pe.length===0)return{};const ut=jo(`{{${ue}}}`,qn(pe,ze,He,Ze));for(const Oe of Pe){if(!Oe.enabled)continue;const _t=Oe.condition,Mt=_t.field===ue?ut:hi(_t.field,pe);if(Gr(Mt,_t.operator,_t.value,_t.value2)){const P={};return Oe.style.backgroundColor&&(P.backgroundColor=Oe.style.backgroundColor),Oe.style.color&&(P.color=Oe.style.color),Oe.style.fontWeight&&(P.fontWeight=Oe.style.fontWeight),Oe.style.fontStyle&&(P.fontStyle=Oe.style.fontStyle),P}}return{}}function hs(){L.nextTick(()=>{var Pe,ze;const ue=B.value;if(!ue)return;const pe=Array.from(ue.querySelectorAll("svg.barcode-svg"));for(const He of pe){const Ze=(He.getAttribute("data-value")||"").trim();if(!(!Ze||/^\[.*\]$/.test(Ze)))try{const ut=He.clientHeight||Number((ze=(Pe=He.style)==null?void 0:Pe.height)==null?void 0:ze.replace("px",""))||50,Oe=Math.max(24,Math.floor(ut*.65));g9(He,Ze,{format:He.getAttribute("data-format")||"CODE128",displayValue:He.getAttribute("data-display-value")==="true",width:2,height:Oe,margin:0})}catch(ut){console.warn("[NexaViewer] Barcode render error:",ut)}}})}const Qh=()=>{const ue=$c.book_new(),pe=[],Pe=[];for(const ze of Dr.value.layout.bands||[]){const He=Se(ze);for(const Ze of ze.elements){if(Ze.type==="Table"&&Ze.tableColumns&&Ze.tableColumns.length>0){const ut=Ze.tableColumns,Oe=ut.map(Mt=>Mt.title),_t=He.map((Mt,jt)=>ut.map(P=>String(jo(`{{${P.binding}}}`,qn(Mt,jt,He.length))||"")));pe.push({name:Ze.content||"Tabla",headers:Oe,rows:_t})}if(Ze.type==="Barcode"||Ze.type==="QRCode")for(let ut=0;ut<Math.min(50,He.length);ut++){const Oe=He[ut],_t=Ze.type==="Barcode"?Ta(Ze,Oe,ut,He.length):xl(Ze,Oe,ut,He.length);_t&&Pe.push([ze.id,Ze.id,Ze.type,_t])}}}if(pe.length>0)for(const ze of pe){const He=[ze.headers,...ze.rows],Ze=$c.aoa_to_sheet(He);$c.book_append_sheet(ue,Ze,ze.name.substring(0,31))}if(Pe.length>0){const ze=$c.aoa_to_sheet([["bandId","elementId","type","value"],...Pe]);$c.book_append_sheet(ue,ze,"Codes")}for(const[ze]of Object.entries(ir.value)){const He=Se({dataSource:ze});if(He&&He.length>0&&Object.keys(He[0]||{}).length>0){const Ze=$c.json_to_sheet(He);$c.book_append_sheet(ue,Ze,ze.substring(0,31))}}if(ue.SheetNames.length===0){const ze=$c.json_to_sheet([{info:"Sin datos"}]);$c.book_append_sheet(ue,ze,"Vacío")}M5e(ue,(Dr.value.metadata.name||"report")+".xlsx")},js=async()=>{var Ke,mt,Rt,Ge,qt,rt,wr,bt;const ue=Dr.value,pe=[],Pe=St=>{const Vt=St.indexOf(","),gt=Vt>=0?St.slice(Vt+1):St,zt=atob(gt),lr=new Uint8Array(zt.length);for(let Er=0;Er<zt.length;Er++)lr[Er]=zt.charCodeAt(Er);return lr},ze=(St,Vt,gt)=>{const zt=Math.max(120,Math.min(720,Math.floor(Vt||320))),lr=Math.max(40,Math.min(240,Math.floor(gt||80))),Er=document.createElement("canvas");try{g9(Er,St,{format:"CODE128",displayValue:!0,margin:0,width:2,height:Math.max(24,Math.floor(lr*.65))})}catch{}const hr=Er.toDataURL("image/png");return new Cne({type:"png",data:Pe(hr),transformation:{width:zt,height:lr}})},He=async(St,Vt,gt)=>{const zt=Math.max(80,Math.min(300,Math.floor(Vt||160))),lr=Math.max(80,Math.min(300,Math.floor(gt||160))),Er=await Promise.resolve().then(()=>mae);return await((Er==null?void 0:Er.default)||Er).toDataURL(St,{margin:1,width:Math.max(zt,lr),errorCorrectionLevel:"M"})};pe.push(new xa({children:[new UA({text:((Ke=ue.metadata)==null?void 0:Ke.name)||"Reporte",bold:!0,size:32})],spacing:{after:400}}));const Ze=ue.layout.bands||[],ut=Ze.find(St=>St.type==="ReportHeader");ut&&ut.elements.forEach(St=>{var Vt,gt,zt,lr,Er;if(St.type==="Text"){const hr=qn(),en=St.binding?jo(`{{${St.binding}}}`,hr):St.content||"";en&&!en.includes("{{")&&pe.push(new xa({children:[new UA({text:en,bold:((Vt=St.style)==null?void 0:Vt.fontWeight)==="bold",size:parseInt(((gt=St.style)==null?void 0:gt.fontSize)||"12")*2,font:((zt=St.style)==null?void 0:zt.fontFamily)||"Arial"})],alignment:((lr=St.style)==null?void 0:lr.textAlign)==="center"?hA.CENTER:((Er=St.style)==null?void 0:Er.textAlign)==="right"?hA.RIGHT:hA.LEFT,spacing:{after:200}}))}});const Oe=Ze.find(St=>St.type==="PageHeader");Oe&&Oe.elements.forEach(St=>{var Vt,gt;if(St.type==="Text"){const zt=qn(),lr=St.binding?jo(`{{${St.binding}}}`,zt):St.content||"";lr&&!lr.includes("{{")&&pe.push(new xa({children:[new UA({text:lr,bold:((Vt=St.style)==null?void 0:Vt.fontWeight)==="bold",size:parseInt(((gt=St.style)==null?void 0:gt.fontSize)||"10")*2})],spacing:{after:100}}))}});const _t=Ze.filter(St=>St.type==="DataBand");for(const St of _t){const Vt=Se(St),gt=St.elements.find(zt=>zt.type==="Table");if(gt!=null&>.tableColumns&>.tableColumns.length>0){const zt=gt.tableColumns,lr=new dze({width:{size:100,type:B8.PERCENTAGE},rows:[new Lne({children:zt.map(Er=>new m8({children:[new xa({children:[new UA({text:Er.title,bold:!0})]})],shading:{fill:"F3F4F6"}}))}),...Vt.map((Er,hr)=>new Lne({children:zt.map(en=>new m8({children:[new xa({children:[new UA({text:String(jo(`{{${en.binding}}}`,qn(Er,hr,Vt.length))||"")})]})]}))}))]});pe.push(lr);continue}for(let zt=0;zt<Vt.length;zt++){const lr=Vt[zt];for(const Er of St.elements)if(Er.type==="Text"){const hr=qn(lr,zt,Vt.length),en=Er.binding?jo(`{{${Er.binding}}}`,hr):Er.content||"";en&&!en.includes("{{")&&pe.push(new xa({children:[new UA({text:en,size:parseInt(((mt=Er.style)==null?void 0:mt.fontSize)||"10")*2})],spacing:{after:100}}))}else if(Er.type==="Barcode"){const hr=Ta(Er,lr,zt,Vt.length);hr&&pe.push(new xa({children:[ze(hr,Er.width,Er.height)]}))}else if(Er.type==="QRCode"){const hr=xl(Er,lr,zt,Vt.length);if(hr){const en=await He(hr,Er.width,Er.height);pe.push(new xa({children:[new Cne({type:"png",data:Pe(en),transformation:{width:Math.max(80,Math.floor(Er.width||160)),height:Math.max(80,Math.floor(Er.height||160))}})]}))}}pe.push(new xa({spacing:{after:200}}))}}const Mt=Ze.find(St=>St.type==="PageFooter");Mt&&(pe.push(new xa({spacing:{before:400}})),Mt.elements.forEach(St=>{if(St.type==="Text"){const Vt=qn(),gt=St.binding?jo(`{{${St.binding}}}`,Vt):St.content||"";gt&&!gt.includes("{{")&&pe.push(new xa({children:[new UA({text:gt,size:18,color:"666666"})],alignment:hA.CENTER}))}}));const jt=Ze.find(St=>St.type==="ReportFooter");jt&&(pe.push(new xa({spacing:{before:400}})),jt.elements.forEach(St=>{if(St.type==="Text"){const Vt=qn(),gt=St.binding?jo(`{{${St.binding}}}`,Vt):St.content||"";gt&&!gt.includes("{{")&&pe.push(new xa({children:[new UA({text:gt,bold:!0,size:20})],alignment:hA.CENTER}))}}));const P=new tje({sections:[{properties:{page:{margin:{top:(((Rt=ue.layout.page.margins)==null?void 0:Rt.top)||1)*567,right:(((Ge=ue.layout.page.margins)==null?void 0:Ge.right)||1)*567,bottom:(((qt=ue.layout.page.margins)==null?void 0:qt.bottom)||1)*567,left:(((rt=ue.layout.page.margins)==null?void 0:rt.left)||1)*567}}},headers:{default:new rje({children:[new xa({children:[new UA({text:((wr=ue.metadata)==null?void 0:wr.name)||"",size:16,color:"999999"})]})]})},footers:{default:new nje({children:[new xa({children:[new UA("Página "),new UA({children:[yp.CURRENT],size:16}),new UA(" de "),new UA({children:[yp.TOTAL_PAGES],size:16})],alignment:hA.CENTER})]})},children:pe}]}),de=await Bje.toBlob(P),Te=URL.createObjectURL(de),Le=document.createElement("a");Le.href=Te,Le.download=(((bt=ue.metadata)==null?void 0:bt.name)||"reporte")+".docx",document.body.appendChild(Le),Le.click(),document.body.removeChild(Le),URL.revokeObjectURL(Te)},po=()=>{var Ze;const ue=Dr.value;let pe="";for(const ut of ue.layout.bands||[]){const Oe=ut.elements.find(_t=>_t.type==="Table");if(Oe!=null&&Oe.tableColumns&&Oe.tableColumns.length>0){const _t=Oe.tableColumns;pe+=_t.map(Mt=>`"${Mt.title.replace(/"/g,'""')}"`).join(",")+`
|
|
207
|
+
`:"");g(c)||h()}function s(l,c){return l+'="'+r(c)+'"'}return wE.exports=n,wE.exports.element=wE.exports.Element=i,wE.exports}var cje=lje();const Zi=ET(cje),IE=0,Nb=32,uje=32,hje=(r,e)=>{const t=e.replace(/-/g,"");if(t.length!==uje)throw new Error(`Error: Cannot extract GUID from font filename: ${e}`);const i=t.replace(/(..)/g,"$1 ").trim().split(" ").map(s=>parseInt(s,16));i.reverse();const o=r.slice(IE,Nb).map((s,l)=>s^i[l%i.length]),A=new Uint8Array(IE+o.length+Math.max(0,r.length-Nb));return A.set(r.slice(0,IE)),A.set(o,IE),A.set(r.slice(Nb),IE+o.length),A};class fje{format(e,t={stack:[]}){const n=e.prepForXml(t);if(n)return n;throw Error("XMLComponent did not format correctly")}}class gje{replace(e,t,n){let i=e;return t.forEach((a,o)=>{i=i.replace(new RegExp(`{${a.fileName}}`,"g"),(n+o).toString())}),i}getMediaData(e,t){return t.Array.filter(n=>e.search(`{${n.fileName}}`)>0)}}class dje{replace(e,t){let n=e;for(const i of t)n=n.replace(new RegExp(`{${i.reference}-${i.instance}}`,"g"),i.numId.toString());return n}}class pje{constructor(){Tt(this,"formatter"),Tt(this,"imageReplacer"),Tt(this,"numberingReplacer"),this.formatter=new fje,this.imageReplacer=new gje,this.numberingReplacer=new dje}compile(e,t,n=[]){const i=new Aje,a=this.xmlifyFile(e,t),o=new Map(Object.entries(a));for(const[,A]of o)if(Array.isArray(A))for(const s of A)i.file(s.path,Eb(s.data));else i.file(A.path,Eb(A.data));for(const A of n)i.file(A.path,Eb(A.data));for(const A of e.Media.Array)A.type!=="svg"?i.file(`word/media/${A.fileName}`,A.data):(i.file(`word/media/${A.fileName}`,A.data),i.file(`word/media/${A.fallback.fileName}`,A.fallback.data));for(const{data:A,name:s,fontKey:l}of e.FontTable.fontOptionsWithKey){const[c]=s.split(".");i.file(`word/fonts/${c}.odttf`,hje(A,l))}return i}xmlifyFile(e,t){const n=e.Document.Relationships.RelationshipCount+1,i=Zi(this.formatter.format(e.Document.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),a=e.Comments.Relationships.RelationshipCount+1,o=Zi(this.formatter.format(e.Comments,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),A=e.FootNotes.Relationships.RelationshipCount+1,s=Zi(this.formatter.format(e.FootNotes.View,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),l=this.imageReplacer.getMediaData(i,e.Media),c=this.imageReplacer.getMediaData(o,e.Media),u=this.imageReplacer.getMediaData(s,e.Media);return{Relationships:{data:(l.forEach((f,h)=>{e.Document.Relationships.addRelationship(n+h,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${f.fileName}`)}),e.Document.Relationships.addRelationship(e.Document.Relationships.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),Zi(this.formatter.format(e.Document.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{const f=this.imageReplacer.replace(i,l,n);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{const f=Zi(this.formatter.format(e.Styles,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:Zi(this.formatter.format(e.CoreProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:Zi(this.formatter.format(e.Numbering,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:Zi(this.formatter.format(e.FileRelationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:e.Headers.map((f,h)=>{const g=Zi(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(g,e.Media).forEach((v,p)=>{f.Relationships.addRelationship(p,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${v.fileName}`)}),{data:Zi(this.formatter.format(f.Relationships,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${h+1}.xml.rels`}}),FooterRelationships:e.Footers.map((f,h)=>{const g=Zi(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(g,e.Media).forEach((v,p)=>{f.Relationships.addRelationship(p,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${v.fileName}`)}),{data:Zi(this.formatter.format(f.Relationships,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${h+1}.xml.rels`}}),Headers:e.Headers.map((f,h)=>{const g=Zi(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),d=this.imageReplacer.getMediaData(g,e.Media),v=this.imageReplacer.replace(g,d,0);return{data:this.numberingReplacer.replace(v,e.Numbering.ConcreteNumbering),path:`word/header${h+1}.xml`}}),Footers:e.Footers.map((f,h)=>{const g=Zi(this.formatter.format(f.View,{viewWrapper:f,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),d=this.imageReplacer.getMediaData(g,e.Media),v=this.imageReplacer.replace(g,d,0);return{data:this.numberingReplacer.replace(v,e.Numbering.ConcreteNumbering),path:`word/footer${h+1}.xml`}}),ContentTypes:{data:Zi(this.formatter.format(e.ContentTypes,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:Zi(this.formatter.format(e.CustomProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:Zi(this.formatter.format(e.AppProperties,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{const f=this.imageReplacer.replace(s,u,A);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(u.forEach((f,h)=>{e.FootNotes.Relationships.addRelationship(A+h,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${f.fileName}`)}),Zi(this.formatter.format(e.FootNotes.Relationships,{viewWrapper:e.FootNotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:Zi(this.formatter.format(e.Endnotes.View,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/endnotes.xml"},EndnotesRelationships:{data:Zi(this.formatter.format(e.Endnotes.Relationships,{viewWrapper:e.Endnotes,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/endnotes.xml.rels"},Settings:{data:Zi(this.formatter.format(e.Settings,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:(()=>{const f=this.imageReplacer.replace(o,c,a);return this.numberingReplacer.replace(f,e.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(c.forEach((f,h)=>{e.Comments.Relationships.addRelationship(a+h,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${f.fileName}`)}),Zi(this.formatter.format(e.Comments.Relationships,{viewWrapper:{View:e.Comments,Relationships:e.Comments.Relationships},file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}})),path:"word/_rels/comments.xml.rels"},FontTable:{data:Zi(this.formatter.format(e.FontTable.View,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:Zi(this.formatter.format(e.FontTable.Relationships,{viewWrapper:e.Document,file:e,stack:[]}),{indent:t,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"}}}}const vje={WITH_2_BLANKS:" "},iie=r=>r===!0?vje.WITH_2_BLANKS:r===!1?void 0:r,aie=class Fv{static pack(e,t,n){return MPe(this,arguments,function*(i,a,o,A=[]){return this.compiler.compile(i,iie(o),A).generateAsync({type:a,mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toString(e,t,n=[]){return Fv.pack(e,"string",t,n)}static toBuffer(e,t,n=[]){return Fv.pack(e,"nodebuffer",t,n)}static toBase64String(e,t,n=[]){return Fv.pack(e,"base64",t,n)}static toBlob(e,t,n=[]){return Fv.pack(e,"blob",t,n)}static toArrayBuffer(e,t,n=[]){return Fv.pack(e,"arraybuffer",t,n)}static toStream(e,t,n=[]){const i=new ije.Stream;return this.compiler.compile(e,iie(t),n).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then(o=>{i.emit("data",o),i.emit("end")}),i}};Tt(aie,"compiler",new pje);let Bje=aie;const Eje={key:0,class:"viewer-toolbar no-print"},mje={class:"viewer-toolbar-row"},yje={class:"viewer-toolbar-group viewer-toolbar-nav"},wje=["disabled"],Ije={class:"nav-page"},xje=["max"],Mje={class:"nav-total"},Qje=["disabled"],Cje={class:"nav-zoom"},Sje={class:"nav-search"},Fje=["disabled"],Tje=["disabled"],Rje=["title"],bje={class:"viewer-body"},Dje={key:0,class:"viewer-sidebar no-print"},Nje={class:"sidebar-header"},Uje={class:"sidebar-body"},_je={key:0,class:"thumb-list"},kje=["onClick"],Yje={class:"thumb-paper"},Pje={class:"thumb-num"},Oje=["src"],Lje={key:0,class:"thumb-more"},Gje={key:1,class:"thumb-more"},zje={key:1,class:"toc-side"},Hje=["onClick"],jje={class:"toc-side-title"},Vje={class:"toc-side-page"},Jje={key:0,class:"toc-side-empty"},Kje={key:0,class:"no-data"},Wje={key:1,class:"no-data"},Xje={key:0,class:"widget-header"},Zje={class:"widget-title-text"},qje={key:0,class:"pi pi-chart-bar text-xs opacity-40"},$je={key:1,class:"pi pi-bolt text-xs opacity-40"},eVe={class:"widget-content"},tVe=["data-page-number"],rVe={key:0,class:"watermark-tile"},nVe={key:1,class:"toc-page"},iVe={class:"toc-list"},aVe=["onClick"],oVe={class:"toc-label"},AVe={class:"toc-page-num"},sVe={key:0,class:"toc-empty"},lVe={key:2,class:"p-4 text-center text-red-500 font-bold border-2 border-dashed border-red-200 m-4"},cVe=["data-band-id"],uVe={key:0,class:"nexa-table"},hVe={key:1,class:"no-data"},fVe=["data-el-id"],gVe={key:1,class:"no-data"},dVe={key:1,class:"no-data"},pVe={class:"subreport-wrapper"},vVe=["onClick"],BVe={class:"subreport-toggle"},EVe={class:"subreport-title"},mVe={class:"subreport-content"},yVe=["definition","data","api-base-url","api-key"],wVe={key:1,class:"no-data"},IVe={key:2,class:"no-data"},xVe={key:3,class:"no-data"},MVe=["data-el-id"],QVe=["src"],CVe=["data-value","data-format","data-display-value"],SVe=["data-band-id","data-row-idx"],FVe=["data-el-id","data-row-idx"],TVe=["src"],RVe=["data-value","data-format","data-display-value"],bVe=["width","height","stroke","stroke-width","stroke-dasharray"],DVe=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],NVe=["y1","x2","y2","stroke","stroke-width","stroke-dasharray"],UVe=["y1","x2","y2","stroke","stroke-width"],_Ve=["src"],kVe=["title","onClick"],YVe={class:"drilldown-content"},PVe=["data-band-id","data-row-idx"],OVe=["data-el-id","data-row-idx"],LVe=["src"],GVe=["data-value","data-format","data-display-value"],zVe=["width","height","stroke","stroke-width","stroke-dasharray"],HVe=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],jVe=["y1","x2","y2","stroke","stroke-width","stroke-dasharray"],VVe=["y1","x2","y2","stroke","stroke-width"],JVe=["src"],KVe=["data-band-id"],WVe=["data-el-id"],XVe=["src"],ZVe=["data-value","data-format","data-display-value"],qVe=["width","height","stroke","stroke-width","stroke-dasharray"],$Ve=["cx","cy","rx","ry","stroke","stroke-width","stroke-dasharray"],eJe=["y1","x2","y2","stroke","stroke-width","stroke-dasharray"],tJe=["y1","x2","y2","stroke","stroke-width"],rJe={key:1,class:"params-overlay"},nJe={class:"params-dialog"},iJe={class:"params-dialog-header"},aJe={class:"params-header-content"},oJe={class:"params-header-desc"},AJe={class:"params-dialog-body"},sJe={key:0,class:"params-error-banner"},lJe={class:"params-label"},cJe={key:0,class:"params-required",title:"Requerido"},uJe={key:1,class:"params-optional"},hJe={key:0,class:"params-desc"},fJe=["onUpdate:modelValue"],gJe=["value"],dJe=["onUpdate:modelValue","placeholder"],pJe=["onUpdate:modelValue"],vJe={key:4,class:"params-toggle-label"},BJe=["onClick"],EJe=["onUpdate:modelValue","placeholder"],mJe={key:6,class:"params-error-msg"},yJe={class:"params-dialog-footer"},wJe={class:"drilldown-modal-header"},IJe={class:"drilldown-modal-body"},xJe={key:0,class:"no-data"},MJe={key:1,class:"no-data"},QJe=["definition","data","parameters"],CJe={key:3,class:"no-data"},SJe={class:"about-modal"},FJe={class:"about-modal-header"},TJe={class:"about-title"},RJe={class:"about-h2"},bJe={class:"about-modal-body"},DJe={class:"about-row"},NJe={key:0,class:"about-row"},UJe={class:"about-modal-footer"},_Je=80,kJe=12,YJe=37.8,PJe=60,OJe=$w(L.defineComponent({__name:"NexaViewer.ce",props:{definition:{type:[String,Object]},data:{type:[String,Array,Object]},minimal:{type:[Boolean,String]},showThumbs:{type:[Boolean,String]},showToolbar:{type:[Boolean,String]},parameters:{type:Object},skipParamsDialog:{type:Boolean},currentPage:{type:Number},apiBaseUrl:{type:String},apiKey:{type:String}},emits:["data-request","drill-click","subreport-toggle","page-change"],setup(r,{expose:e,emit:t}){const n=r,i=t;function a(ue){if(ue===!0)return!0;if(ue===!1||ue==null)return!1;if(typeof ue=="string"){const pe=ue.trim().toLowerCase();if(pe==="")return!0;if(pe==="false"||pe==="0"||pe==="no"||pe==="off"||pe==="null"||pe==="undefined")return!1;if(pe==="true"||pe==="1"||pe==="yes"||pe==="on")return!0}return!!ue}const o=L.computed(()=>a(n.minimal)),A=L.computed(()=>!o.value||a(n.showThumbs)),s=L.computed(()=>!o.value||a(n.showToolbar)),l=L.ref(!1),c=L.computed(()=>"0.1.2"),u=L.computed(()=>"2026-05-02T23:21:41.475Z"),f=L.ref(1),h=L.computed(()=>{if(n.currentPage===void 0||n.currentPage===null)return;const ue=Number(n.currentPage);if(!(!Number.isFinite(ue)||ue<1))return Math.floor(ue)}),g=L.computed(()=>h.value!==void 0),d=L.computed(()=>h.value??f.value);async function v(ue,pe=2){const Pe=Math.max(1,Math.floor(Number(ue)||1));for(let ze=0;ze<=pe;ze++){await L.nextTick(),await new Promise(Oe=>setTimeout(Oe,30));const He=B.value,Ze=E.value;if(!He||!Ze)return;const ut=He.querySelector(`.report-page[data-page-number="${Pe}"]`);if(ut){const Oe=Ze.getBoundingClientRect(),_t=ut.getBoundingClientRect(),Mt=Math.max(0,Ze.scrollTop+(_t.top-Oe.top)-8);Ze.scrollTo({top:Mt,behavior:"smooth"});return}}}function p(ue){const pe=Math.max(1,Math.min(Math.floor(Number(ue)||1),be.value));i("page-change",pe);const Pe=g.value;Pe||(f.value=pe),v(pe,Pe?4:2)}const B=L.ref(null),E=L.ref(null),m=L.ref(null),y=L.ref(!1),w=L.ref(!1),I=L.ref(null),Q=L.ref(100),x=L.ref("continuous"),U=L.ref(null);function b(ue){const pe=Math.floor(Number(ue)||100);return Math.min(250,Math.max(25,pe))}function C(){const ue=E.value;if(!ue)return;const pe=Fa().width,Pe=Math.max(1,ue.clientWidth-40);Q.value=b(Math.floor(Pe/pe*100))}const D=L.computed(()=>{if(y.value||w.value)return{"--nv-scale":"1",transform:"none",transformOrigin:"top left"};const ue=b(Q.value);return{"--nv-scale":String(ue/100),transform:`scale(${ue/100})`,transformOrigin:"top center"}}),F=L.computed({get:()=>d.value,set:ue=>p(Number(ue))}),H=L.ref(""),X=L.ref([]),q=L.ref(0),re=L.ref(null),ie=L.ref(null),ge=L.ref(!1),he=L.ref(!0),R=L.ref("pages"),V=L.ref(""),J=L.ref({}),ee=L.ref(null),ae=new Set,j=L.ref([]),G=L.ref(!1),oe=L.ref(null),se=L.ref(!1),ne=L.ref(1),le=L.ref(!1);let Fe=null,W=null;const xe=L.computed(()=>{const ue=(V.value||"").trim().toLowerCase();return ue?b0.value.filter(pe=>(pe.title||"").toLowerCase().includes(ue)):b0.value});function z(){se.value=!0,Fe&&clearTimeout(Fe),Fe=setTimeout(()=>{se.value=!1},180)}let Y=null;async function O(){if(Y)return Y;const ue=await Promise.resolve().then(()=>eae);return Y=(ue==null?void 0:ue.default)||ue,Y}async function Z(ue){var ze;if(J.value[ue]||ae.has(ue))return;const pe=B.value;if(!pe)return;let Pe=pe.querySelector(`.report-page[data-page-number="${ue}"]`);if(!Pe&&(oe.value=ue,await L.nextTick(),await new Promise(He=>setTimeout(He,80)),Pe=pe.querySelector(`.report-page[data-page-number="${ue}"]`),!Pe)){oe.value=null;return}ae.add(ue);try{ee.value=null,typeof document<"u"&&((ze=document.fonts)!=null&&ze.ready)&&await document.fonts.ready;const He=await O();if(!He)return;const Ze=Math.max(1,Pe.offsetWidth||794),ut=Math.max(1,Pe.offsetHeight||1123),_t=.35*(typeof window<"u"?Math.min(2,Math.max(1,Number(window.devicePixelRatio)||1)):1),jt=await He().set({margin:0,image:{type:"jpeg",quality:.75},html2canvas:{scale:_t,useCORS:!0,backgroundColor:"#ffffff",logging:!1,imageTimeout:15e3,windowWidth:Ze,windowHeight:ut,onclone:de=>{try{const Te=de.querySelector(".report-pages-root");Te&&(Te.style.transform="none",Te.style.transformOrigin="top left");const Le=de.querySelector(".thumb-offscreen-page");Le&&(Le.style.position="absolute",Le.style.left="0px",Le.style.top="0px",Le.style.margin="0",Le.style.boxShadow="none",Le.style.pointerEvents="none")}catch{}}},jsPDF:{unit:"px",format:[Ze,ut],hotfixes:["px_scaling"]}}).from(Pe).toCanvas().get("canvas");if(!jt)return;const P=jt.toDataURL("image/jpeg",.75);J.value={...J.value,[ue]:P}}catch(He){const Ze=He!=null&&He.message?String(He.message):"";ee.value=Ze?`No se pudieron generar miniaturas: ${Ze}`:"No se pudieron generar miniaturas"}finally{ae.delete(ue),oe.value===ue&&(oe.value=null)}}function Be(ue){const pe=Math.max(1,Number(be.value||1)),Pe=Math.min(500,pe),ze=new Set(j.value);for(const He of ue){const Ze=Math.floor(Number(He)||0);Ze<1||Ze>Pe||J.value[Ze]||ze.has(Ze)||(j.value.push(Ze),ze.add(Ze))}je()}function Ce(ue){const pe=Math.max(1,Number(be.value||1)),Pe=Math.min(500,pe),ze=new Set(j.value),He=[];for(const Ze of ue){const ut=Math.floor(Number(Ze)||0);ut<1||ut>Pe||J.value[ut]||ze.has(ut)||(He.push(ut),ze.add(ut))}He.length>0&&(j.value=He.concat(j.value)),je()}function Ie(){if(!le.value)return;const ue=Math.max(1,Number(be.value||1)),pe=Math.min(500,ue);ne.value<1&&(ne.value=1);const Pe=[],ze=30;if(!(j.value.length>=200)){for(;Pe.length<ze&&ne.value<=pe;){const Ze=ne.value++;J.value[Ze]||Pe.push(Ze)}Pe.length>0&&Be(Pe)}}async function je(){if(!G.value){G.value=!0;try{for(;j.value.length>0&&!(!A.value||!he.value||R.value!=="pages");){if(se.value){await new Promise(pe=>setTimeout(pe,120));continue}const ue=j.value.shift();J.value[ue]||(await Z(ue),Ie(),await new Promise(pe=>setTimeout(pe,250)))}}finally{G.value=!1}}}let qe=null;function et(){qe&&clearTimeout(qe),qe=setTimeout(async()=>{if(!A.value||!he.value||R.value!=="pages")return;await L.nextTick();const ue=Ye.value||[];for(const pe of ue){const Pe=Number(pe.pageNumber)||1;Be([Pe])}},120)}function yt(){L.watch([()=>he.value,()=>R.value,()=>d.value,()=>x.value],()=>{et()}),L.watch(()=>Ye.value.map(ue=>ue.pageNumber).join(","),()=>{et()}),L.watch([()=>he.value,()=>R.value,()=>be.value],()=>{if(!A.value||!he.value||R.value!=="pages")return;j.value=[],le.value=!0,ne.value=1;const ue=d.value||1;Ce([ue,ue-1,ue+1,ue-2,ue+2]),Ie()},{immediate:!0})}async function Yt(){if(typeof document>"u")return;const ue=m.value;if(ue)try{document.fullscreenElement?await document.exitFullscreen():ue.requestFullscreen&&await ue.requestFullscreen()}catch{}}function kt(){typeof document>"u"||(ge.value=!!document.fullscreenElement)}function gr(){const ue=E.value;if(!ue)return;const pe=Fa(),Pe=Math.max(1,ue.clientWidth-40),ze=Math.max(1,ue.clientHeight-40),He=Math.min(Pe/pe.width,ze/pe.height);Q.value=b(Math.floor(He*100))}function tt(){if(o.value)return;const ue=ie.value;ue&&(ue.focus(),ue.select())}function nt(){if(o.value)return;const ue=U.value;ue&&(ue.focus(),ue.select())}function Ut(){H.value="",X.value=[],q.value=0,re.value=null}function Qt(){he.value=!he.value}const dr=L.computed(()=>{const ue=Math.max(1,Number(be.value||1)),Pe=Math.min(ue,500);return Array.from({length:Pe},(ze,He)=>({page:He+1}))});function ar(){const ue=document.activeElement;if(!ue)return!1;if(ue.isContentEditable)return!0;const pe=(ue.tagName||"").toUpperCase();return pe==="INPUT"||pe==="TEXTAREA"||pe==="SELECT"}function pr(ue){var pe,Pe;if(!(ar()&&ue.key!=="Escape")){if(ue.key==="PageDown"){ue.preventDefault(),p(d.value+1);return}if(ue.key==="PageUp"){ue.preventDefault(),p(d.value-1);return}if(ue.key==="Home"){ue.preventDefault(),p(1);return}if(ue.key==="End"){ue.preventDefault(),p(be.value);return}if((ue.ctrlKey||ue.metaKey)&&(ue.key==="+"||ue.key==="=")){ue.preventDefault(),Q.value=b(Q.value+10);return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="-"){ue.preventDefault(),Q.value=b(Q.value-10);return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="0"){ue.preventDefault(),Q.value=100;return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="f"){ue.preventDefault(),tt();return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="g"){ue.preventDefault(),nt();return}if(ue.key==="/"&&!ue.ctrlKey&&!ue.metaKey&&!ue.altKey){ue.preventDefault(),tt();return}if((ue.ctrlKey||ue.metaKey)&&ue.key==="b"){ue.preventDefault(),Qt();return}if(ue.key==="F11"){ue.preventDefault(),Yt();return}if(ue.key==="Escape"){if(document.activeElement===ie.value){(Pe=(pe=ie.value)==null?void 0:pe.blur)==null||Pe.call(pe);return}if(H.value){Ut();return}}}}L.onMounted(()=>{typeof window<"u"&&(window.addEventListener("keydown",pr),document.addEventListener("fullscreenchange",kt),kt())}),L.onUnmounted(()=>{typeof window<"u"&&(window.removeEventListener("keydown",pr),document.removeEventListener("fullscreenchange",kt)),W&&(W.removeEventListener("scroll",z),W=null)});const Un=L.computed(()=>{if(X.value.length===0)return null;const ue=Math.min(Math.max(0,q.value),X.value.length-1);return X.value[ue]||null});function jr(ue){return(ue??"").toString()}function Zn(ue){const pe=jr(ue),Pe=(H.value||"").trim();if(!Pe)return[{t:pe,m:!1}];const ze=pe.toLowerCase(),He=Pe.toLowerCase();if(!He)return[{t:pe,m:!1}];const Ze=[];let ut=0;for(;ut<pe.length;){const Oe=ze.indexOf(He,ut);if(Oe===-1){Ze.push({t:pe.slice(ut),m:!1});break}Oe>ut&&Ze.push({t:pe.slice(ut,Oe),m:!1}),Ze.push({t:pe.slice(Oe,Oe+Pe.length),m:!0}),ut=Oe+Pe.length}return Ze.length>0?Ze:[{t:pe,m:!1}]}function An(ue,pe){const Pe=Un.value;return!Pe||Pe.elId!==ue?!1:Pe.rowIdx===void 0&&pe===void 0?!0:Number(Pe.rowIdx)===Number(pe)}async function jn(ue){if(X.value.length===0)return;q.value=Math.min(Math.max(0,ue),X.value.length-1);const pe=Un.value;if(!pe)return;p(pe.page),await L.nextTick(),await new Promise(Ze=>setTimeout(Ze,30));const Pe=B.value;if(!Pe)return;const ze=pe.rowIdx!==void 0?`[data-el-id="${pe.elId}"][data-row-idx="${pe.rowIdx}"]`:`[data-el-id="${pe.elId}"]`,He=Pe.querySelector(ze);He&&He.scrollIntoView({behavior:"smooth",block:"center"})}function Fr(){jn(q.value+1)}function rr(){jn(q.value-1)}async function Gt(){if(typeof window>"u")return;const ue=w.value;w.value=!0,await L.nextTick(),await new Promise(Pe=>setTimeout(Pe,50));const pe=()=>{window.removeEventListener("afterprint",pe),w.value=ue};window.addEventListener("afterprint",pe),window.print()}const ir=L.computed(()=>{let ue=I.value??n.data;if(typeof ue=="string")try{ue=JSON.parse(ue)}catch{ue={}}const pe={},Pe=Dr.value.dataSources||[];for(const ze of Pe)ze.isManual&&ze.manualData&&Array.isArray(ze.manualData)&&(pe[ze.alias]=ze.manualData.length>0?ze.manualData:[{}]);if(Array.isArray(ue))pe.main=ue.length>0?ue:pe.main||[{}];else if(ue&&typeof ue=="object")for(const[ze,He]of Object.entries(ue))pe[ze]=Array.isArray(He)&&He.length>0?He:[{}];return Object.keys(pe).length===0&&(pe.main=[{}]),pe}),Jr=L.computed(()=>{var Pe;const ue=Dr.value.dataSources,pe=((Pe=ue==null?void 0:ue[0])==null?void 0:Pe.alias)||"main";return ir.value[pe]||ir.value.main||[{}]});function Rn(ue){var pe,Pe,ze,He;if(ue.dataSource&&ir.value[ue.dataSource]){const Ze=ir.value[ue.dataSource],ut=(pe=Dr.value.dataSources)==null?void 0:pe.find(_t=>_t.alias===ue.dataSource);let Oe=Ze;return(Pe=ut==null?void 0:ut.joins)!=null&&Pe.length&&(Oe=_e(Oe,ut.joins)),(ze=ut==null?void 0:ut.filters)!=null&&ze.length&&(Oe=Cn(Oe,ut.filters)),(He=ut==null?void 0:ut.sort)!=null&&He.length&&(Oe=Ee(Oe,ut.sort)),Oe}return Jr.value}const Pi=L.computed(()=>({width:"100%",minHeight:"100%",padding:"24px",display:"grid",gridTemplateColumns:`repeat(${kJe}, 1fr)`,gridAutoRows:`${_Je}px`,gap:"16px",background:"#f8fafc"}));function sa(ue){return{gridColumn:`${ue.x+1} / span ${ue.w}`,gridRow:`${ue.y+1} / span ${ue.h}`,display:"flex",flexDirection:"column",background:"#fff",borderRadius:"12px",overflow:"hidden",border:"1px solid #e2e8f0",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",transition:"transform 0.2s, box-shadow 0.2s"}}function Pr(ue){return ue?ue<=10?ue*YJe:ue:0}function Fa(){const ue=Dr.value.layout.page;let pe=794,Pe=1123;return ue.format==="Letter"?(pe=816,Pe=1056):ue.format==="Ticket"&&(pe=302,Pe=800),ue.orientation==="landscape"?{width:Pe,height:pe}:{width:pe,height:Pe}}function $i(){const ue=Dr.value.layout.page.margins;return ue?{top:Pr(ue.top),right:Pr(ue.right),bottom:Pr(ue.bottom),left:Pr(ue.left)}:{top:0,right:0,bottom:0,left:0}}function Ji(){const{height:ue}=Fa(),pe=$i();return Math.max(1,ue-pe.top-pe.bottom)}function Gr(ue,pe,Pe,ze){const He=ut=>ut==null?"":String(ut),Ze=ut=>Number(ut);switch(pe){case"eq":return He(ue)===He(Pe);case"ne":return He(ue)!==He(Pe);case"gt":return Ze(ue)>Ze(Pe);case"gte":return Ze(ue)>=Ze(Pe);case"lt":return Ze(ue)<Ze(Pe);case"lte":return Ze(ue)<=Ze(Pe);case"contains":return He(ue).includes(He(Pe));case"starts_with":return He(ue).startsWith(He(Pe));case"is_null":return ue==null||ue==="";case"is_not_null":return ue!=null&&ue!=="";case"between":return Ze(ue)>=Ze(Pe)&&Ze(ue)<=Ze(ze);case"regex":try{return new RegExp(String(Pe||""),"i").test(He(ue))}catch{return!1}default:return!1}}function Cn(ue,pe){return!pe||pe.length===0?ue:ue.filter(Pe=>{for(const ze of pe){const He=hi(ze.field,Pe);if(!Gr(He,ze.operator,ze.value,ze.value2))return!1}return!0})}function Ee(ue,pe){if(!pe||pe.length===0)return ue;const Pe=ue.map((He,Ze)=>({r:He,i:Ze})),ze=He=>He==="desc"?-1:1;return Pe.sort((He,Ze)=>{for(const ut of pe){const Oe=hi(ut.field,He.r),_t=hi(ut.field,Ze.r),Mt=Number(Oe),jt=Number(_t);let P=0;if(!isNaN(Mt)&&!isNaN(jt))P=Mt===jt?0:Mt<jt?-1:1;else{const de=Oe==null?"":String(Oe),Te=_t==null?"":String(_t);P=de.localeCompare(Te,void 0,{numeric:!0,sensitivity:"base"})}if(P!==0)return P*ze(ut.direction)}return He.i-Ze.i}),Pe.map(He=>He.r)}function _e(ue,pe){if(!pe||pe.length===0)return ue;let Pe=ue;for(const ze of pe){const He=ir.value[ze.alias]||ir.value[ze.collection]||[];if(!Array.isArray(He)||He.length===0)continue;const Ze=new Map;for(const Oe of He){const _t=(hi(ze.foreignField,Oe)??"").toString(),Mt=Ze.get(_t)||[];Mt.push(Oe),Ze.set(_t,Mt)}const ut=[];for(const Oe of Pe){const _t=(hi(ze.localField,Oe)??"").toString(),Mt=Ze.get(_t)||[];if(ze.joinType==="inner"&&Mt.length===0)continue;const jt={...Oe};jt[ze.alias]===void 0&&(jt[ze.alias]=Mt.length>0?Mt[0]:null),ut.push(jt)}Pe=ut}return Pe}function Se(ue){var pe,Pe,ze,He,Ze,ut,Oe,_t;if(ue.dataSource&&ir.value[ue.dataSource]){const Mt=ir.value[ue.dataSource];if(Mt&&Mt.length>0){const jt=(pe=Dr.value.dataSources)==null?void 0:pe.find(de=>de.alias===ue.dataSource);let P=Mt;return(Pe=jt==null?void 0:jt.joins)!=null&&Pe.length&&(P=_e(P,jt.joins)),(ze=jt==null?void 0:jt.filters)!=null&&ze.length&&(P=Cn(P,jt.filters)),ue.filter&&(P=Cn(P,[ue.filter])),(He=jt==null?void 0:jt.sort)!=null&&He.length&&(P=Ee(P,jt.sort)),P}}for(const Mt of Object.keys(ir.value)){const jt=ir.value[Mt];if(jt&&jt.length>0){const P=(Ze=Dr.value.dataSources)==null?void 0:Ze.find(Te=>Te.alias===Mt);let de=jt;return(ut=P==null?void 0:P.joins)!=null&&ut.length&&(de=_e(de,P.joins)),(Oe=P==null?void 0:P.filters)!=null&&Oe.length&&(de=Cn(de,P.filters)),(_t=P==null?void 0:P.sort)!=null&&_t.length&&(de=Ee(de,P.sort)),de}}return[]}const Re=L.computed(()=>{var Vt,gt;const ue=Dr.value.layout.bands||[],pe=Ji(),Pe=ue.find(zt=>zt.type==="ReportHeader"),ze=ue.find(zt=>zt.type==="PageHeader"),He=ue.find(zt=>zt.type==="PageFooter"),Ze=ue.find(zt=>zt.type==="ReportFooter"),ut=ue.filter(zt=>!["ReportHeader","PageHeader","PageFooter","ReportFooter"].includes(zt.type)),Oe=ut.filter(zt=>zt.type==="DataBand"),_t=ut.filter(zt=>zt.type==="DetailBand"),Mt=ut.find(zt=>zt.type==="GroupHeader"&&zt.masterField),jt=ut.find(zt=>zt.type==="GroupFooter"&&zt.masterField),P=Mt==null?void 0:Mt.masterField,de=ut.filter(zt=>!["DataBand","DetailBand","GroupHeader","GroupFooter"].includes(zt.type)),Te=(Pe==null?void 0:Pe.height)||0,Le=(ze==null?void 0:ze.height)||0,Ke=(He==null?void 0:He.height)||0,mt=de.reduce((zt,lr)=>zt+(lr.height||0),0),Rt=[],Ge=Oe[0],qt=Ge?Se(Ge):Jr.value,rt=!!(Pe!=null&&Pe.pageBreakAfter&&qt.length>0),wr=(Ge==null?void 0:Ge.dataSource)||((gt=(Vt=Dr.value.dataSources)==null?void 0:Vt[0])==null?void 0:gt.alias)||"main",bt=Ge?_t.filter(zt=>!zt.dataSource||!zt.childField||!zt.masterField?!1:(zt.parentDataSource||wr)===wr):[];if(!!(Ge&&!Ro(Ge)&&(bt.length>0||P))){const zt=zr=>zr==null?"":String(zr),lr=new Map;if(P)for(const zr of qt){const kn=zt(hi(P,zr));lr.set(kn,(lr.get(kn)||0)+1)}const Er=zr=>pe-Ke-Le-mt-(zr?Te:0),hr=(zr,kn)=>{const ua=Se(zr),Vs=zr.masterField,Ui=zr.childField;if(!Vs||!Ui)return ua.length;const Wo=zt(hi(Vs,kn));let EA=0;for(const Ki of ua)zt(hi(Ui,Ki))===Wo&&EA++;return EA},en=zr=>{let kn=(Ge==null?void 0:Ge.height)||0;for(const ua of bt)kn+=(ua.height||0)*hr(ua,zr);return kn};let _n=1,Ln=!rt;const dn=()=>{const zr=[];Ln&&Pe&&zr.push({band:Pe}),ze&&zr.push({band:ze});for(const kn of de)zr.push({band:kn});return zr};if(rt){const zr=[];Pe&&zr.push({band:Pe}),ze&&zr.push({band:ze});for(const kn of de)zr.push({band:kn});He&&zr.push({band:He}),Rt.push({pageNumber:_n,bands:zr}),_n++}let yn=dn(),In=Er(Ln),ln=0,rn=null,xn=null;const cn=()=>{He&&yn.push({band:He}),Rt.push({pageNumber:_n,bands:yn}),_n++,Ln=!1,yn=dn(),In=Er(Ln),ln=0,xn=null},ni=zr=>{zr<=In-ln||cn()},Ci=(zr,kn)=>{!Mt||!P||xn!==kn&&(ni(Mt.height||0),yn.push({band:Mt,rows:[zr],groupKey:kn,groupCount:lr.get(kn)||0}),ln+=Mt.height||0,xn=kn)},Ra=(zr,kn)=>{!jt||!P||(ni(jt.height||0),yn.push({band:jt,rows:[zr],groupKey:kn,groupCount:lr.get(kn)||0}),ln+=jt.height||0)};for(let zr=0;zr<qt.length;zr++){const kn=qt[zr],ua=P?zt(hi(P,kn)):"";P&&(rn===null&&(rn=ua),ua!==rn&&(Ra(qt[zr-1]||kn,rn),rn=ua,xn=null),Ci(kn,ua));const Vs=en(kn);ni(Vs),yn.push({band:Ge,rows:[kn],rowIndex:zr,totalRows:qt.length,groupKey:ua,groupCount:lr.get(ua)||0}),ln+=Vs}P&&rn!==null&&Ra(qt[qt.length-1]||{},rn),yn.length>0&&cn()}else{const zt=ln=>Ro(ln)&&ln.elements.some(rn=>rn.type==="Chart"||rn.type==="Crosstab"||rn.type==="SubReport")&&!ln.elements.some(rn=>rn.type==="Table"),lr=Oe.reduce((ln,rn)=>ln+(rn.height||0),0),Er=pe-Le-Ke-Te-mt,hr=pe-Le-Ke-mt,en=rt?hr:Math.min(Er,hr);let _n=lr>0?Math.max(1,Math.floor(en/lr)):qt.length;if(Ge&&Ro(Ge)){const ln=Mh(Ge,Math.max(1,en));ln&&(_n=ln)}ut.some(ln=>ln.pageBreakBefore||ln.pageBreakAfter)&&(_n=1);const Ln=!!(Ge&&zt(Ge));Ln&&(_n=Math.max(1,qt.length));const dn=Ln?1:Math.ceil(qt.length/_n),yn=[];Pe&&yn.push({band:Pe}),ze&&yn.push({band:ze});for(const ln of de)yn.push({band:ln});if(!rt&&Oe.length>0&&qt.length>0){const ln=Math.min(_n,qt.length);for(const rn of Oe){const xn=Se(rn),cn=Ro(rn)?Math.max(1,Er):void 0;yn.push({band:rn,rows:zt(rn)?xn:xn.slice(0,ln),heightOverride:cn})}}He&&yn.push({band:He}),Rt.push({pageNumber:1,bands:yn});const In=rt?0:1;for(let ln=In;ln<dn;ln++){const rn=[];ze&&rn.push({band:ze});for(const ni of de)rn.push({band:ni});const xn=ln*_n,cn=Math.min((ln+1)*_n,qt.length);for(const ni of Oe){if(zt(ni)&&xn>0)continue;const Ci=Se(ni),Ra=Ro(ni)?Math.max(1,hr):void 0;rn.push({band:ni,rows:zt(ni)?Ci:Ci.slice(xn,cn),heightOverride:Ra})}He&&rn.push({band:He}),Rt.push({pageNumber:Rt.length+1,bands:rn})}}if(Ze&&Rt.length>0){const zt=Rt[Rt.length-1],lr=zt.bands.findIndex(Er=>Er.band.type==="PageFooter");lr>=0?zt.bands.splice(lr,0,{band:Ze}):zt.bands.push({band:Ze})}return{pages:Rt,totalPages:Math.max(1,Rt.length),pageHeight:pe}}),be=L.computed(()=>Re.value.totalPages),Ye=L.computed(()=>{const ue=Re.value.pages;if(y.value||w.value)return ue;if(ue.length===0)return[];const pe=Math.min(Math.max(1,d.value),ue.length);let Pe=[];if(x.value==="continuous")if(n.currentPage===void 0&&ue.length<=PJe)Pe=ue;else{const He=Math.max(1,pe-1),Ze=Math.min(ue.length,pe+1);Pe=ue.slice(He-1,Ze)}else Pe=[ue[pe-1]];const ze=oe.value;if(ze&&he.value&&R.value==="pages"){const He=ue[ze-1]||ue.find(Ze=>Number(Ze.pageNumber)===ze);He&&!Pe.some(Ze=>Number(Ze.pageNumber)===ze)&&(Pe=Pe.concat([He]))}return Pe});let ht=null;function xt(){const ue=(H.value||"").trim().toLowerCase();if(re.value=null,X.value=[],q.value=0,!ue)return;const pe=Re.value.pages||[],Pe=250,ze=Math.min(Pe,pe.length);pe.length>Pe&&(re.value=`Búsqueda limitada a las primeras ${Pe} páginas`);const He=[];for(let Ze=0;Ze<ze;Ze++){const ut=pe[Ze],Oe=Number(ut.pageNumber||Ze+1),_t=Array.isArray(ut.bands)?ut.bands:[];for(const Mt of _t){const jt=Mt.band;if(!jt||!Array.isArray(jt.elements))continue;const P=jt.type==="DataBand",de=P&&Ro(jt);if(P&&!de){const Te=Array.isArray(Mt.rows)?Mt.rows:[],Le=Number(Mt.totalRows??Te.length);for(let Ke=0;Ke<Te.length;Ke++){const mt=Te[Ke],Rt=Number(Mt.rowIndex??Ke);for(const Ge of jt.elements){if(Ge.type!=="Text")continue;const qt=jr(Qi(Ge,mt,Rt,Le,Oe,Mt.groupKey,Mt.groupCount));if(qt&&qt.toLowerCase().includes(ue)&&(He.push({page:Oe,elId:Ge.id,rowIdx:Rt}),He.length>=500))break}if(He.length>=500)break}}else{const Te=Array.isArray(Mt.rows)?Mt.rows[0]:void 0;for(const Le of jt.elements){if(Le.type!=="Text")continue;const Ke=jr(Qi(Le,Te,0,1,Oe,Mt.groupKey,Mt.groupCount));if(Ke&&Ke.toLowerCase().includes(ue)&&(He.push({page:Oe,elId:Le.id}),He.length>=500))break}}if(He.length>=500)break}if(He.length>=500)break}X.value=He}L.watch(()=>H.value,()=>{ht&&clearTimeout(ht),ht=setTimeout(()=>xt(),200)});const st=L.ref({}),ft=L.ref(!1),pt=L.ref([]),At=L.ref({}),Ue=L.ref([]),lt=L.ref(!1),ct=L.ref(null);L.onErrorCaptured(ue=>{try{ct.value=ue!=null&&ue.message?String(ue.message):String(ue)}catch{ct.value="Error de render"}return!1}),L.onMounted(async()=>{await L.nextTick(),!W&&E.value&&(W=E.value,W.addEventListener("scroll",z,{passive:!0})),yt()});function Ht(ue){const pe=ue.parameters||[];if(pe.length===0){st.value=n.parameters||{},ft.value=!1,lt.value=!0;return}pt.value=pe;const Pe={};for(const ze of pe)Pe[ze.name]=n.parameters&&ze.name in n.parameters?n.parameters[ze.name]:ze.defaultValue??(ze.type==="boolean"?!1:"");At.value={...Pe},st.value={...Pe},lt.value=!0,ft.value=!n.skipParamsDialog}L.onMounted(()=>{Ue.value=[],Ht(Dr.value),hs()});function Or(){Ue.value=[];for(const ue of pt.value){if(!ue.required)continue;const pe=At.value[ue.name];(pe===""||pe===null||pe===void 0)&&Ue.value.push(ue.name)}return Ue.value.length===0}function $r(){Or()&&sn()}function sn(){for(const ue of pt.value)if(ue.required&&(At.value[ue.name]===""||At.value[ue.name]===null||At.value[ue.name]===void 0))return;st.value={...At.value},ft.value=!1,lt.value=!0}const Dr=L.computed(()=>{var pe;let ue=n.definition;if(typeof ue=="string")try{ue=JSON.parse(ue)}catch{return Kn()}return(pe=ue==null?void 0:ue.layout)!=null&&pe.bands?Ga(ue):Kn()});function Kn(){return{metadata:{name:"Error",version:"1.0",createdAt:""},layout:{page:{format:"A4",orientation:"portrait"},bands:[]},dataSources:[]}}function Ga(ue){var ze,He,Ze;const pe=((ze=ue==null?void 0:ue.layout)==null?void 0:ze.page)||{};return{metadata:(ue==null?void 0:ue.metadata)||{name:"",version:"1.0",createdAt:""},documentType:(ue==null?void 0:ue.documentType)||"Report",layout:{page:{format:pe.format||"A4",orientation:pe.orientation||"portrait",margins:pe.margins},bands:Array.isArray((He=ue==null?void 0:ue.layout)==null?void 0:He.bands)?ue.layout.bands.filter(Boolean).map(ut=>({id:String(ut.id||`b_${Math.random().toString(36).slice(2)}`),type:ut.type,height:Number(ut.height||0),elements:Array.isArray(ut.elements)?ut.elements.filter(Boolean).map(Oe=>({...Oe,id:String(Oe.id||`el_${Math.random().toString(36).slice(2)}`),x:Number(Oe.x||0),y:Number(Oe.y||0),width:Number(Oe.width||0),height:Number(Oe.height||0)})):[],dataSource:ut.dataSource,parentDataSource:ut.parentDataSource,masterField:ut.masterField,childField:ut.childField,filter:ut.filter,pageBreakBefore:!!ut.pageBreakBefore,pageBreakAfter:!!ut.pageBreakAfter})):[],widgets:Array.isArray((Ze=ue==null?void 0:ue.layout)==null?void 0:Ze.widgets)?ue.layout.widgets.filter(Boolean).map(ut=>({...ut,id:String(ut.id||`w_${Math.random().toString(36).slice(2)}`),x:Number(ut.x||0),y:Number(ut.y||0),w:Number(ut.w||1),h:Number(ut.h||1)})):[]},dataSources:Array.isArray(ue==null?void 0:ue.dataSources)?ue.dataSources:[],parameters:Array.isArray(ue==null?void 0:ue.parameters)?ue.parameters:[],dictionary:(ue==null?void 0:ue.dictionary)||{dataSources:[]}}}function hi(ue,pe){return ue.split(".").reduce((Pe,ze)=>Pe==null?void 0:Pe[ze.trim()],pe)}function go(ue,pe,Pe,ze,He,Ze,ut,Oe){var de,Te,Le;const _t=Ke=>{const mt=(Ke??"").toString().trim();return!mt||/^\[.*\]$/.test(mt)?"":/^\{\{[\s\S]*\}\}$/.test(mt)?mt.slice(2,-2).trim():mt},Mt=_t((de=ue.options)==null?void 0:de.imageUrl);if((((Te=ue.options)==null?void 0:Te.imageSource)||((Le=ue.options)==null?void 0:Le.source)||"url").toString()==="binding"){const Ke=_t(ue.binding),mt=pe||Oe||Jr.value[0]||{};if(Ke){const Rt=hi(Ke,mt),Ge=_t(Rt);if(Ge)return Ge}return Mt}const P=_t(ue.content);return Mt||P}function Ta(ue,pe,Pe,ze,He,Ze,ut,Oe){const _t=(ue.binding||"").trim();if(!_t)return"";const jt=(jo(`{{${_t}}}`,qn(pe,Pe,ze,He,Ze,ut,Oe))??"").toString().trim();return!jt||/^\[.*\]$/.test(jt)?"":jt}const ea=L.ref({}),Mi=L.ref({});async function ph(ue){const pe=ue.trim();if(!pe||ea.value[pe]||Mi.value[pe])return;Mi.value={...Mi.value,[pe]:!0};try{const He=await Promise.resolve().then(()=>mae),ut=await((He==null?void 0:He.default)||He).toDataURL(pe,{margin:1,width:256,errorCorrectionLevel:"M"});typeof ut=="string"&&ut.startsWith("data:")&&(ea.value={...ea.value,[pe]:ut})}catch{}const{[pe]:Pe,...ze}=Mi.value;Mi.value=ze}function xl(ue,pe,Pe,ze,He,Ze,ut,Oe){const _t=(ue.binding||"").trim();if(_t){const jt=(jo(`{{${_t}}}`,qn(pe,Pe,ze,He,Ze,ut,Oe))??"").toString().trim();if(jt&&!/^\[.*\]$/.test(jt))return jt}if(ue.content){const jt=(jo(ue.content,qn(pe,Pe,ze,He,Ze,ut,Oe))??"").toString().trim();if(jt&&!/^\[.*\]$/.test(jt))return jt}return""}function T0(ue){const pe=(ue||"").trim();if(!pe)return"";const Pe=ea.value[pe];return Pe||(ph(pe),"")}function zs(ue,pe){const Pe=(ue||"").trim();if(!Pe)return"";const ze=Pe.match(/^\[(.*)\]$/s),He=ze?(ze[1]||"").trim():Pe;return(ze?!0:/[\s+\-*/()%<>=!&|]/.test(He))?jo(`{[${He}]}`,pe):jo(`{{${He}}}`,pe)}function Ml(ue,pe){const Pe=(ue||"").trim();if(!Pe)return"";if(/\{\[.*?\]\}/s.test(Pe)||/\{\{.*?\}\}/s.test(Pe))return jo(Pe,pe);const ze=Pe.match(/^\[(.*)\]$/s);return ze?jo(`{[${(ze[1]||"").trim()}]}`,pe):Pe}const Qi=(ue,pe,Pe,ze,He,Ze,ut,Oe)=>{const _t=qn(pe,Pe,ze,He,Ze,ut,Oe);return ue.content?Ml(ue.content,_t):ue.binding?zs(ue.binding,_t):""};function la(ue,pe,Pe,ze,He,Ze,ut,Oe){if(!ue)return"";try{return jo(ue,qn(pe,Pe,ze,He,Ze,ut,Oe))}catch{return ue}}function Fo(ue,pe){const Pe=ue.drillDownConfig;if(!Pe)return;const ze=Pe.targetReportId;if(!ze){console.warn("DrillDown: No target report specified");return}const He={};for(const Ze of Pe.parameterMappings)He[Ze.targetParameter]=hi(Ze.sourceField,pe);if(i("drill-click",{element:ue,sourceData:pe,targetReportId:ze,parameters:He,config:Pe}),Pe.showAsModal){vh(ze,He,Pe);return}if(Pe.openInNewTab){const Ze=`${window.location.pathname}?report=${ze}¶ms=${encodeURIComponent(JSON.stringify(He))}`;window.open(Ze,"_blank");return}}const Oi=L.ref(null);async function vh(ue,pe,Pe){Oi.value={targetId:ue,params:pe,config:Pe,loading:!0,error:null,definition:null,data:null};const ze=(n.apiBaseUrl||"").replace(/\/+$/,""),He={"Content-Type":"application/json"};n.apiKey&&(He["X-API-Key"]=n.apiKey);try{const Ze=await fetch(`${ze}/api/reports/${ue}`,{headers:He});if(!Ze.ok)throw new Error(`No se pudo cargar el reporte (${Ze.status})`);const ut=await Ze.json(),Oe=ut.report||ut.definition||ut,jt=(await(await fetch(`${ze}/api/reports/${ue}/render`,{method:"POST",headers:He,body:JSON.stringify({parameters:pe})})).json().catch(()=>({}))).data??null;Oi.value&&Oi.value.targetId===ue&&(Oi.value={targetId:ue,params:pe,config:Pe,loading:!1,error:null,definition:Oe,data:jt})}catch(Ze){Oi.value&&Oi.value.targetId===ue&&(Oi.value={targetId:ue,params:pe,config:Pe,loading:!1,error:(Ze==null?void 0:Ze.message)||"Error cargando drill-down",definition:null,data:null})}}function J1(ue){ue.options||(ue.options={}),ue.options.subReportCollapsed=!ue.options.subReportCollapsed,i("subreport-toggle",{subReportId:ue.subReportId||"embedded",collapsed:ue.options.subReportCollapsed})}const Bh=L.computed(()=>(Dr.value.layout.bands||[]).filter(ue=>ue.type==="DetailBand"));function K1(ue){var Pe,ze;const pe=ue.dataSource||((ze=(Pe=Dr.value.dataSources)==null?void 0:Pe[0])==null?void 0:ze.alias)||"main";return Bh.value.filter(He=>!He.dataSource||!He.childField||!He.masterField?!1:(He.parentDataSource||pe)===pe)}function PA(ue,pe){const Pe=Se(ue);if(!ue.masterField||!ue.childField)return Pe;const ze=hi(ue.masterField,pe),He=ut=>ut==null?"":String(ut);return Pe.filter(ut=>He(hi(ue.childField,ut))===He(ze))}const Ql=L.ref(new Map),OA=L.ref(new Set),ju=L.ref(new Map);async function Eh(ue){if(!ue||Ql.value.has(ue)||OA.value.has(ue)||!n.apiBaseUrl)return;OA.value.add(ue),ju.value.delete(ue);const pe=n.apiBaseUrl.replace(/\/+$/,""),Pe={"Content-Type":"application/json"};n.apiKey&&(Pe["X-API-Key"]=n.apiKey);try{const ze=await fetch(`${pe}/api/reports/${ue}`,{headers:Pe});if(!ze.ok)throw new Error(`No se pudo cargar subreporte (${ze.status})`);const He=await ze.json(),Ze=He.report||He.definition||He,_t=(await(await fetch(`${pe}/api/reports/${ue}/render`,{method:"POST",headers:Pe,body:JSON.stringify({parameters:st.value||{}})})).json().catch(()=>({}))).data??null;Ql.value.set(ue,{definition:Ze,data:_t})}catch(ze){ju.value.set(ue,(ze==null?void 0:ze.message)||"Error cargando subreporte")}finally{OA.value.delete(ue)}}const W1=L.computed(()=>{const ue=new Set,pe=Ye.value;for(const Pe of pe)for(const ze of Pe.bands){const He=ze.band;for(const Ze of He.elements||[])Ze.type==="SubReport"&&Ze.subReportId&&!Ze.subReportDefinition&&!Ql.value.has(Ze.subReportId)&&ue.add(Ze.subReportId)}return Array.from(ue)});L.watch(W1,ue=>{for(const pe of ue)Eh(pe)},{immediate:!0});function ss(ue){var pe;return ue&&((pe=Ql.value.get(ue))==null?void 0:pe.definition)||null}function Cl(ue){var pe;return ue?((pe=Ql.value.get(ue))==null?void 0:pe.data)??null:null}function R0(ue){return ue?OA.value.has(ue):!1}function LA(ue){return ue&&ju.value.get(ue)||""}function qn(ue,pe,Pe,ze,He,Ze,ut){var jt,P,de,Te;const Oe=Dr.value,_t=ue||Jr.value[0]||{},Mt={row:_t,data:Jr.value,page:ze??d.value,totalPages:be.value,rowNumber:pe!==void 0?pe+1:1,totalRows:Pe||Jr.value.length,parameters:st.value,groupKey:He??"",groupCount:Ze??0,reportName:((jt=Oe.metadata)==null?void 0:jt.name)||"",reportAuthor:((P=Oe.metadata)==null?void 0:P.author)||"",reportDescription:((de=Oe.metadata)==null?void 0:de.description)||"",reportCreated:((Te=Oe.metadata)==null?void 0:Te.createdAt)||""};if(Object.keys(_t).forEach(Le=>{Mt[Le]=_t[Le]}),ut&&typeof ut=="object")for(const Le of Object.keys(ut))Mt[Le]===void 0&&(Mt[Le]=ut[Le]);return Mt}function X1(ue,pe,Pe,ze,He,Ze,ut,Oe){if(!ue.conditionalFormats||ue.conditionalFormats.length===0)return{};const _t=qn(pe,Pe,ze,He,Ze,ut,Oe);for(const Mt of ue.conditionalFormats){if(!Mt.enabled)continue;const jt=Mt.condition,P=hi(jt.field,_t.row);if(Gr(P,jt.operator,jt.value,jt.value2)){const Te={};return Mt.style.backgroundColor&&(Te.backgroundColor=Mt.style.backgroundColor),Mt.style.color&&(Te.color=Mt.style.color),Mt.style.fontWeight&&(Te.fontWeight=Mt.style.fontWeight),Mt.style.fontStyle&&(Te.fontStyle=Mt.style.fontStyle),Mt.style.fontSize&&(Te.fontSize=Mt.style.fontSize),Mt.style.border&&(Te.border=Mt.style.border),Te}}return{}}function Sl(ue,pe,Pe,ze,He,Ze,ut,Oe){const _t=Cr(ue),Mt=X1(ue,pe,Pe,ze,He,Ze,ut,Oe);return{..._t,...Mt}}function Cr(ue){const pe=ue.style||{};return{position:"absolute",left:ue.x+"px",top:ue.y+"px",width:ue.width+"px",height:ue.height+"px",fontSize:pe.fontSize||"14px",color:pe.color||"#000",fontWeight:pe.fontWeight||"normal",fontStyle:pe.fontStyle||"normal",fontFamily:pe.fontFamily||"Inter, Arial, sans-serif",textAlign:pe.textAlign||"left",backgroundColor:pe.backgroundColor||"transparent",border:pe.border||"none",overflow:"hidden",whiteSpace:"pre-wrap",lineHeight:"1.2",padding:pe.padding?pe.padding+"px":"2px",boxSizing:"border-box"}}const Z1=L.computed(()=>$i()),q1=L.computed(()=>{const ue=Fa();return{width:ue.width+"px",minHeight:ue.height+"px"}}),ls=L.computed(()=>{const ue=Z1.value;return{paddingTop:ue.top+"px",paddingRight:ue.right+"px",paddingBottom:ue.bottom+"px",paddingLeft:ue.left+"px"}});function mh(ue){var ze,He;const pe=(He=(ze=Dr.value)==null?void 0:ze.layout)==null?void 0:He.watermark;if(!(pe!=null&&pe.text))return!1;const Pe=be.value;return pe.pages==="first"?ue===1:pe.pages==="last"?ue===Pe:pe.pages==="except-first"?ue>1:pe.pages==="except-last"?ue<Pe:!0}const yh=L.computed(()=>{var pe,Pe;const ue=(Pe=(pe=Dr.value)==null?void 0:pe.layout)==null?void 0:Pe.watermark;return ue?{opacity:ue.opacity??.15,zIndex:ue.behindContent?-1:10,pointerEvents:"none"}:{}}),Rc=L.computed(()=>{var pe,Pe;const ue=(Pe=(pe=Dr.value)==null?void 0:pe.layout)==null?void 0:Pe.watermark;return ue?{color:ue.color||"#cccccc",fontSize:ue.fontSize||72,fontWeight:"bold",transform:`rotate(${ue.rotation??-45}deg)`,whiteSpace:"nowrap"}:{}}),To=L.computed(()=>{var pe,Pe;const ue=(Pe=(pe=Dr.value)==null?void 0:pe.layout)==null?void 0:Pe.watermark;return ue?{color:ue.color||"#cccccc",fontSize:(ue.fontSize||48)*.6,fontWeight:"bold",transform:`rotate(${ue.rotation??-45}deg)`}:{}}),wh=L.computed(()=>{var Pe,ze;const ue=(ze=(Pe=Dr.value)==null?void 0:Pe.layout)==null?void 0:ze.watermark;if(!ue)return{};const pe={center:{top:"50%",left:"50%",transform:"translate(-50%, -50%)"},"top-left":{top:"10%",left:"10%"},"top-right":{top:"10%",right:"10%"},"bottom-left":{bottom:"10%",left:"10%"},"bottom-right":{bottom:"10%",right:"10%"}};return pe[ue.position]||pe.center}),Ih=L.computed(()=>{var ue,pe;return(pe=(ue=Dr.value)==null?void 0:ue.layout)==null?void 0:pe.generateTOC}),Vu=L.computed(()=>{var Pe;const ue=new Map,pe=Re.value.pages||[];for(const ze of pe){const He=Number(ze.pageNumber)||1,Ze=Array.isArray(ze.bands)?ze.bands:[];for(const ut of Ze){const Oe=(Pe=ut==null?void 0:ut.band)==null?void 0:Pe.id;Oe&&(ue.has(Oe)||ue.set(Oe,He))}}return ue}),b0=L.computed(()=>{var ze,He;const ue=[],pe=((He=(ze=Dr.value)==null?void 0:ze.layout)==null?void 0:He.bands)||[],Pe=Vu.value;for(const Ze of pe)if(Ze.type==="ReportHeader"||Ze.type==="GroupHeader"){const ut=Ze.elements.find(Mt=>Mt.type==="Text"&&Mt.content),Oe=(ut==null?void 0:ut.content)||Ze.type,_t=Ze.type==="ReportHeader"?0:1;ue.push({bandId:Ze.id,title:Oe,level:_t,pageNumber:Pe.get(Ze.id)||1})}return ue});async function D0(ue){const pe=Vu.value.get(ue);pe&&p(pe),await L.nextTick(),await new Promise(He=>setTimeout(He,30));const Pe=B.value;if(!Pe)return;const ze=Pe.querySelector(`[data-band-id="${ue}"]`);ze&&ze.scrollIntoView({behavior:"smooth",block:"start"})}function Hs(ue){const pe={height:ue.height+"px",position:"relative",overflow:"hidden",width:"100%"};return ue.pageBreakBefore&&(pe.pageBreakBefore="always"),ue.pageBreakAfter&&(pe.pageBreakAfter="always"),pe}function bc(ue){const pe=Hs(ue.band),Pe=Number(ue.heightOverride);return Number.isFinite(Pe)&&Pe>0&&(pe.height=Pe+"px"),pe}function Ro(ue){return Array.isArray(ue.elements)?ue.elements.some(pe=>["Table","Chart","Crosstab","SubReport"].includes(pe.type)):!1}function Fl(ue,pe){const Pe=Cr(ue),ze=Number(pe.height)||0;Pe.top="0px";const He=Math.max(0,ze),Ze=Number(ue.height)||0;return He>0&&(Ze===0||Ze<He)&&(Pe.height=He+"px"),Pe.overflow="hidden",Pe}function Tl(ue){if(!ue)return 14;const pe=String(ue).trim().match(/^(\d+(?:\.\d+)?)px$/i);if(!pe)return 14;const Pe=Number(pe[1]);return isNaN(Pe)?14:Pe}function xh(ue){var ze;const pe=Tl((ze=ue.style)==null?void 0:ze.fontSize);return Math.ceil(pe*1.25)+12}function ca(ue){var ze;const pe=Tl((ze=ue.style)==null?void 0:ze.fontSize);return Math.ceil(pe*1.25)+12}function Mh(ue,pe){const Pe=ue.elements.find(Oe=>Oe.type==="Table");if(!Pe)return null;const ze=Math.max(1,pe),He=xh(Pe),Ze=ca(Pe),ut=Math.max(1,ze-He);return Math.max(1,Math.floor(ut/Ze))}function cs(ue,pe,Pe,ze,He){const Ze=He===void 0?void 0:Number(He);return zs(ue,qn(pe,Pe,ze,Ze))}function us(ue,pe,Pe,ze,He,Ze){if(!Pe||Pe.length===0)return{};const ut=jo(`{{${ue}}}`,qn(pe,ze,He,Ze));for(const Oe of Pe){if(!Oe.enabled)continue;const _t=Oe.condition,Mt=_t.field===ue?ut:hi(_t.field,pe);if(Gr(Mt,_t.operator,_t.value,_t.value2)){const P={};return Oe.style.backgroundColor&&(P.backgroundColor=Oe.style.backgroundColor),Oe.style.color&&(P.color=Oe.style.color),Oe.style.fontWeight&&(P.fontWeight=Oe.style.fontWeight),Oe.style.fontStyle&&(P.fontStyle=Oe.style.fontStyle),P}}return{}}function hs(){L.nextTick(()=>{var Pe,ze;const ue=B.value;if(!ue)return;const pe=Array.from(ue.querySelectorAll("svg.barcode-svg"));for(const He of pe){const Ze=(He.getAttribute("data-value")||"").trim();if(!(!Ze||/^\[.*\]$/.test(Ze)))try{const ut=He.clientHeight||Number((ze=(Pe=He.style)==null?void 0:Pe.height)==null?void 0:ze.replace("px",""))||50,Oe=Math.max(24,Math.floor(ut*.65));g9(He,Ze,{format:He.getAttribute("data-format")||"CODE128",displayValue:He.getAttribute("data-display-value")==="true",width:2,height:Oe,margin:0})}catch(ut){console.warn("[NexaViewer] Barcode render error:",ut)}}})}const Qh=()=>{const ue=$c.book_new(),pe=[],Pe=[];for(const ze of Dr.value.layout.bands||[]){const He=Se(ze);for(const Ze of ze.elements){if(Ze.type==="Table"&&Ze.tableColumns&&Ze.tableColumns.length>0){const ut=Ze.tableColumns,Oe=ut.map(Mt=>Mt.title),_t=He.map((Mt,jt)=>ut.map(P=>String(jo(`{{${P.binding}}}`,qn(Mt,jt,He.length))||"")));pe.push({name:Ze.content||"Tabla",headers:Oe,rows:_t})}if(Ze.type==="Barcode"||Ze.type==="QRCode")for(let ut=0;ut<Math.min(50,He.length);ut++){const Oe=He[ut],_t=Ze.type==="Barcode"?Ta(Ze,Oe,ut,He.length):xl(Ze,Oe,ut,He.length);_t&&Pe.push([ze.id,Ze.id,Ze.type,_t])}}}if(pe.length>0)for(const ze of pe){const He=[ze.headers,...ze.rows],Ze=$c.aoa_to_sheet(He);$c.book_append_sheet(ue,Ze,ze.name.substring(0,31))}if(Pe.length>0){const ze=$c.aoa_to_sheet([["bandId","elementId","type","value"],...Pe]);$c.book_append_sheet(ue,ze,"Codes")}for(const[ze]of Object.entries(ir.value)){const He=Se({dataSource:ze});if(He&&He.length>0&&Object.keys(He[0]||{}).length>0){const Ze=$c.json_to_sheet(He);$c.book_append_sheet(ue,Ze,ze.substring(0,31))}}if(ue.SheetNames.length===0){const ze=$c.json_to_sheet([{info:"Sin datos"}]);$c.book_append_sheet(ue,ze,"Vacío")}M5e(ue,(Dr.value.metadata.name||"report")+".xlsx")},js=async()=>{var Ke,mt,Rt,Ge,qt,rt,wr,bt;const ue=Dr.value,pe=[],Pe=St=>{const Vt=St.indexOf(","),gt=Vt>=0?St.slice(Vt+1):St,zt=atob(gt),lr=new Uint8Array(zt.length);for(let Er=0;Er<zt.length;Er++)lr[Er]=zt.charCodeAt(Er);return lr},ze=(St,Vt,gt)=>{const zt=Math.max(120,Math.min(720,Math.floor(Vt||320))),lr=Math.max(40,Math.min(240,Math.floor(gt||80))),Er=document.createElement("canvas");try{g9(Er,St,{format:"CODE128",displayValue:!0,margin:0,width:2,height:Math.max(24,Math.floor(lr*.65))})}catch{}const hr=Er.toDataURL("image/png");return new Cne({type:"png",data:Pe(hr),transformation:{width:zt,height:lr}})},He=async(St,Vt,gt)=>{const zt=Math.max(80,Math.min(300,Math.floor(Vt||160))),lr=Math.max(80,Math.min(300,Math.floor(gt||160))),Er=await Promise.resolve().then(()=>mae);return await((Er==null?void 0:Er.default)||Er).toDataURL(St,{margin:1,width:Math.max(zt,lr),errorCorrectionLevel:"M"})};pe.push(new xa({children:[new UA({text:((Ke=ue.metadata)==null?void 0:Ke.name)||"Reporte",bold:!0,size:32})],spacing:{after:400}}));const Ze=ue.layout.bands||[],ut=Ze.find(St=>St.type==="ReportHeader");ut&&ut.elements.forEach(St=>{var Vt,gt,zt,lr,Er;if(St.type==="Text"){const hr=qn(),en=St.binding?jo(`{{${St.binding}}}`,hr):St.content||"";en&&!en.includes("{{")&&pe.push(new xa({children:[new UA({text:en,bold:((Vt=St.style)==null?void 0:Vt.fontWeight)==="bold",size:parseInt(((gt=St.style)==null?void 0:gt.fontSize)||"12")*2,font:((zt=St.style)==null?void 0:zt.fontFamily)||"Arial"})],alignment:((lr=St.style)==null?void 0:lr.textAlign)==="center"?hA.CENTER:((Er=St.style)==null?void 0:Er.textAlign)==="right"?hA.RIGHT:hA.LEFT,spacing:{after:200}}))}});const Oe=Ze.find(St=>St.type==="PageHeader");Oe&&Oe.elements.forEach(St=>{var Vt,gt;if(St.type==="Text"){const zt=qn(),lr=St.binding?jo(`{{${St.binding}}}`,zt):St.content||"";lr&&!lr.includes("{{")&&pe.push(new xa({children:[new UA({text:lr,bold:((Vt=St.style)==null?void 0:Vt.fontWeight)==="bold",size:parseInt(((gt=St.style)==null?void 0:gt.fontSize)||"10")*2})],spacing:{after:100}}))}});const _t=Ze.filter(St=>St.type==="DataBand");for(const St of _t){const Vt=Se(St),gt=St.elements.find(zt=>zt.type==="Table");if(gt!=null&>.tableColumns&>.tableColumns.length>0){const zt=gt.tableColumns,lr=new dze({width:{size:100,type:B8.PERCENTAGE},rows:[new Lne({children:zt.map(Er=>new m8({children:[new xa({children:[new UA({text:Er.title,bold:!0})]})],shading:{fill:"F3F4F6"}}))}),...Vt.map((Er,hr)=>new Lne({children:zt.map(en=>new m8({children:[new xa({children:[new UA({text:String(jo(`{{${en.binding}}}`,qn(Er,hr,Vt.length))||"")})]})]}))}))]});pe.push(lr);continue}for(let zt=0;zt<Vt.length;zt++){const lr=Vt[zt];for(const Er of St.elements)if(Er.type==="Text"){const hr=qn(lr,zt,Vt.length),en=Er.binding?jo(`{{${Er.binding}}}`,hr):Er.content||"";en&&!en.includes("{{")&&pe.push(new xa({children:[new UA({text:en,size:parseInt(((mt=Er.style)==null?void 0:mt.fontSize)||"10")*2})],spacing:{after:100}}))}else if(Er.type==="Barcode"){const hr=Ta(Er,lr,zt,Vt.length);hr&&pe.push(new xa({children:[ze(hr,Er.width,Er.height)]}))}else if(Er.type==="QRCode"){const hr=xl(Er,lr,zt,Vt.length);if(hr){const en=await He(hr,Er.width,Er.height);pe.push(new xa({children:[new Cne({type:"png",data:Pe(en),transformation:{width:Math.max(80,Math.floor(Er.width||160)),height:Math.max(80,Math.floor(Er.height||160))}})]}))}}pe.push(new xa({spacing:{after:200}}))}}const Mt=Ze.find(St=>St.type==="PageFooter");Mt&&(pe.push(new xa({spacing:{before:400}})),Mt.elements.forEach(St=>{if(St.type==="Text"){const Vt=qn(),gt=St.binding?jo(`{{${St.binding}}}`,Vt):St.content||"";gt&&!gt.includes("{{")&&pe.push(new xa({children:[new UA({text:gt,size:18,color:"666666"})],alignment:hA.CENTER}))}}));const jt=Ze.find(St=>St.type==="ReportFooter");jt&&(pe.push(new xa({spacing:{before:400}})),jt.elements.forEach(St=>{if(St.type==="Text"){const Vt=qn(),gt=St.binding?jo(`{{${St.binding}}}`,Vt):St.content||"";gt&&!gt.includes("{{")&&pe.push(new xa({children:[new UA({text:gt,bold:!0,size:20})],alignment:hA.CENTER}))}}));const P=new tje({sections:[{properties:{page:{margin:{top:(((Rt=ue.layout.page.margins)==null?void 0:Rt.top)||1)*567,right:(((Ge=ue.layout.page.margins)==null?void 0:Ge.right)||1)*567,bottom:(((qt=ue.layout.page.margins)==null?void 0:qt.bottom)||1)*567,left:(((rt=ue.layout.page.margins)==null?void 0:rt.left)||1)*567}}},headers:{default:new rje({children:[new xa({children:[new UA({text:((wr=ue.metadata)==null?void 0:wr.name)||"",size:16,color:"999999"})]})]})},footers:{default:new nje({children:[new xa({children:[new UA("Página "),new UA({children:[yp.CURRENT],size:16}),new UA(" de "),new UA({children:[yp.TOTAL_PAGES],size:16})],alignment:hA.CENTER})]})},children:pe}]}),de=await Bje.toBlob(P),Te=URL.createObjectURL(de),Le=document.createElement("a");Le.href=Te,Le.download=(((bt=ue.metadata)==null?void 0:bt.name)||"reporte")+".docx",document.body.appendChild(Le),Le.click(),document.body.removeChild(Le),URL.revokeObjectURL(Te)},po=()=>{var Ze;const ue=Dr.value;let pe="";for(const ut of ue.layout.bands||[]){const Oe=ut.elements.find(_t=>_t.type==="Table");if(Oe!=null&&Oe.tableColumns&&Oe.tableColumns.length>0){const _t=Oe.tableColumns;pe+=_t.map(Mt=>`"${Mt.title.replace(/"/g,'""')}"`).join(",")+`
|
|
208
208
|
`;for(const Mt of Jr.value)pe+=_t.map(jt=>`"${String(cs(jt.binding,Mt)).replace(/"/g,'""')}"`).join(",")+`
|
|
209
209
|
`}}if(!pe&&Jr.value.length>0){const ut=Object.keys(Jr.value[0]);pe+=ut.map(Oe=>`"${Oe.replace(/"/g,'""')}"`).join(",")+`
|
|
210
210
|
`;for(const Oe of Jr.value)pe+=ut.map(_t=>`"${String(Oe[_t]??"").replace(/"/g,'""')}"`).join(",")+`
|