@genome-spy/app 0.42.1 → 0.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +470 -470
- package/dist/index.js +55 -55
- package/package.json +3 -3
package/dist/index.js
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
(function(me,_e){typeof exports=="object"&&typeof module<"u"?_e(exports):typeof define=="function"&&define.amd?define(["exports"],_e):(me=typeof globalThis<"u"?globalThis:me||self,_e(me.genomeSpyApp={}))})(this,function(me){"use strict";var KJ=Object.defineProperty;var JJ=(me,_e,De)=>_e in me?KJ(me,_e,{enumerable:!0,configurable:!0,writable:!0,value:De}):me[_e]=De;var ar=(me,_e,De)=>(JJ(me,typeof _e!="symbol"?_e+"":_e,De),De),V2=(me,_e,De)=>{if(!_e.has(me))throw TypeError("Cannot "+De)};var P=(me,_e,De)=>(V2(me,_e,"read from private field"),De?De.call(me):_e.get(me)),Z=(me,_e,De)=>{if(_e.has(me))throw TypeError("Cannot add the same private member more than once");_e instanceof WeakSet?_e.add(me):_e.set(me,De)},le=(me,_e,De,Vo)=>(V2(me,_e,"write to private field"),Vo?Vo.call(me,De):_e.set(me,De),De);var OT=(me,_e,De,Vo)=>({set _(Df){le(me,_e,Df,De)},get _(){return P(me,_e,Vo)}}),J=(me,_e,De)=>(V2(me,_e,"access private method"),De);var tf,j2,nf,q2,rf,W2,lc,af,of,Po,kf,sf,Y2,ai,uc,Ot,
|
1
|
+
(function(me,_e){typeof exports=="object"&&typeof module<"u"?_e(exports):typeof define=="function"&&define.amd?define(["exports"],_e):(me=typeof globalThis<"u"?globalThis:me||self,_e(me.genomeSpyApp={}))})(this,function(me){"use strict";var KJ=Object.defineProperty;var JJ=(me,_e,De)=>_e in me?KJ(me,_e,{enumerable:!0,configurable:!0,writable:!0,value:De}):me[_e]=De;var ar=(me,_e,De)=>(JJ(me,typeof _e!="symbol"?_e+"":_e,De),De),V2=(me,_e,De)=>{if(!_e.has(me))throw TypeError("Cannot "+De)};var P=(me,_e,De)=>(V2(me,_e,"read from private field"),De?De.call(me):_e.get(me)),Z=(me,_e,De)=>{if(_e.has(me))throw TypeError("Cannot add the same private member more than once");_e instanceof WeakSet?_e.add(me):_e.set(me,De)},le=(me,_e,De,Vo)=>(V2(me,_e,"write to private field"),Vo?Vo.call(me,De):_e.set(me,De),De);var OT=(me,_e,De,Vo)=>({set _(Df){le(me,_e,Df,De)},get _(){return P(me,_e,Vo)}}),J=(me,_e,De)=>(V2(me,_e,"access private method"),De);var tf,j2,nf,q2,rf,W2,lc,af,of,Po,kf,sf,Y2,ai,uc,Ot,Rr,ya,V0,NT,fc,dp,oi,Ho,cf,Z2,j0,zT,U2,eee,lf,Q2,hc,uf,dc,pc,Mo,ff,hf,df,si,gc,mc,vn,Oo,bc,ci,Go,q0,UT,Lo,Tf,pf,X2,gf,K2,mf,J2,W0,$T,yc,pp,Y0,HT,vc,wc,No,bf,zo,xT,xc,li,la,yf,Z0,GT,Q0,VT,vf,ev,X0,jT,et,K0,qT,J0,WT,ep,YT,tp,ZT,Uo,Rf,np,QT,rp,XT,Ln,ua,$o,Ac,Ec,ui,Sc,It,wf,xf,tv,ot,Ht,Af,_c,ip,KT,ap,JT,op,eI,Ef,nv,sp,tI,cp,nI,lp,rI,Sf,_f,rv;function _e(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function De(e,t,n){return e.fields=t||[],e.fname=n,e}function Vo(e){return e==null?null:e.fname}function Df(e){return e==null?null:e.fields}function iI(e){return e.length===1?aI(e[0]):oI(e)}const aI=e=>function(t){return t[e]},oI=e=>{const t=e.length;return function(n){for(let r=0;r<t;++r)n=n[e[r]];return n}};function it(e){throw Error(e)}function sI(e){const t=[],n=e.length;let r=null,i=0,a="",o,s,c;e=e+"";function l(){t.push(a+e.substring(o,s)),a="",o=s+1}for(o=s=0;s<n;++s)if(c=e[s],c==="\\")a+=e.substring(o,s),a+=e.substring(++s,++s),o=s;else if(c===r)l(),r=null,i=-1;else{if(r)continue;o===i&&c==='"'||o===i&&c==="'"?(o=s+1,r=c):c==="."&&!i?s>o?l():o=s+1:c==="["?(s>o&&l(),i=o=s+1):c==="]"&&(i||it("Access path missing open bracket: "+e),i>0&&l(),i=0,o=s+1)}return i&&it("Access path missing closing bracket: "+e),r&&it("Access path missing closing quote: "+e),s>o&&(s++,l()),t}function Bf(e,t,n){const r=sI(e);return e=r.length===1?r[0]:e,De((n&&n.get||iI)(r),[e],t||e)}Bf("id");const Ff=De(e=>e,[],"identity");De(()=>0,[],"zero"),De(()=>1,[],"one"),De(()=>!0,[],"true"),De(()=>!1,[],"false");var Qt=Array.isArray;function Xt(e){return e===Object(e)}function zn(e){return e[e.length-1]}function Cc(e){return e==null||e===""?null:+e}const iv=e=>t=>e*Math.exp(t),av=e=>t=>Math.log(e*t),cI=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),lI=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Pf=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function gp(e,t,n,r){const i=n(e[0]),a=n(zn(e)),o=(a-i)*t;return[r(i-o),r(a-o)]}function uI(e,t){return gp(e,t,Cc,Ff)}function fI(e,t){var n=Math.sign(e[0]);return gp(e,t,av(n),iv(n))}function hI(e,t,n){return gp(e,t,Pf(n),Pf(1/n))}function Mf(e,t,n,r,i){const a=r(e[0]),o=r(zn(e)),s=t!=null?r(t):(a+o)/2;return[i(s+(a-s)*n),i(s+(o-s)*n)]}function mp(e,t,n){return Mf(e,t,n,Cc,Ff)}function ov(e,t,n){const r=Math.sign(e[0]);return Mf(e,t,n,av(r),iv(r))}function bp(e,t,n,r){return Mf(e,t,n,Pf(r),Pf(1/r))}function dI(e,t,n,r){return Mf(e,t,n,cI(r),lI(r))}function yp(e){return e!=null?Qt(e)?e:[e]:[]}function pI(e,t,n){let r=e[0],i=e[1],a;return i<r&&(a=i,i=r,r=a),a=i-r,a>=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-a),r+a]}function Kt(e){return typeof e=="function"}const gI="descending";function sv(e,t,n){n=n||{},t=yp(t)||[];const r=[],i=[],a={},o=n.comparator||mI;return yp(e).forEach((s,c)=>{s!=null&&(r.push(t[c]===gI?-1:1),i.push(s=Kt(s)?s:Bf(s,null,n)),(Df(s)||[]).forEach(l=>a[l]=1))}),i.length===0?null:De(o(i,r),Object.keys(a))}const cv=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),mI=(e,t)=>e.length===1?bI(e[0],t[0]):yI(e,t,e.length),bI=(e,t)=>function(n,r){return cv(e(n),e(r))*t},yI=(e,t,n)=>(t.push(0),function(r,i){let a,o=0,s=-1;for(;o===0&&++s<n;)a=e[s],o=cv(a(r),a(i));return o*t[s]});function vI(e){return Kt(e)?e:()=>e}function vp(e){for(let t,n,r=1,i=arguments.length;r<i;++r){t=arguments[r];for(n in t)e[n]=t[n]}return e}const wI=Object.prototype.hasOwnProperty;function va(e,t){return wI.call(e,t)}function kc(e){return typeof e=="boolean"}function xI(e){return Object.prototype.toString.call(e)==="[object Date]"}function AI(e){return e&&Kt(e[Symbol.iterator])}function ft(e){return typeof e=="number"}function EI(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Me(e){return typeof e=="string"}function lv(e,t){const n=e[0],r=zn(e),i=+t;return i?i===1?r:n+i*(r-n):n}function Of(e){return e&&zn(e)-e[0]||0}function Lf(e){return Qt(e)?"["+e.map(Lf)+"]":Xt(e)||Me(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function SI(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const _I=e=>ft(e)||xI(e)?e:Date.parse(e);function CI(e,t){return t=t||_I,e==null||e===""?null:t(e)}function kI(e){return e==null||e===""?null:e+""}function Nf(e){const t={},n=e.length;for(let r=0;r<n;++r)t[e[r]]=!0;return t}var uv={},wp={},xp=34,Tc=10,Ap=13;function fv(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function TI(e,t){var n=fv(e);return function(r,i){return t(n(r),i,e)}}function hv(e){var t=Object.create(null),n=[];return e.forEach(function(r){for(var i in r)i in t||n.push(t[i]=i)}),n}function Jt(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function II(e){return e<0?"-"+Jt(-e,6):e>9999?"+"+Jt(e,6):Jt(e,4)}function RI(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":II(e.getUTCFullYear())+"-"+Jt(e.getUTCMonth()+1,2)+"-"+Jt(e.getUTCDate(),2)+(i?"T"+Jt(t,2)+":"+Jt(n,2)+":"+Jt(r,2)+"."+Jt(i,3)+"Z":r?"T"+Jt(t,2)+":"+Jt(n,2)+":"+Jt(r,2)+"Z":n||t?"T"+Jt(t,2)+":"+Jt(n,2)+"Z":"")}function dv(e){var t=new RegExp('["'+e+`
|
2
2
|
\r]`),n=e.charCodeAt(0);function r(f,h){var d,p,g=i(f,function(b,v){if(d)return d(b,v-1);p=b,d=h?TI(b,h):fv(b)});return g.columns=p||[],g}function i(f,h){var d=[],p=f.length,g=0,b=0,v,x=p<=0,A=!1;f.charCodeAt(p-1)===Tc&&--p,f.charCodeAt(p-1)===Ap&&--p;function w(){if(x)return wp;if(A)return A=!1,uv;var C,I=g,D;if(f.charCodeAt(I)===xp){for(;g++<p&&f.charCodeAt(g)!==xp||f.charCodeAt(++g)===xp;);return(C=g)>=p?x=!0:(D=f.charCodeAt(g++))===Tc?A=!0:D===Ap&&(A=!0,f.charCodeAt(g)===Tc&&++g),f.slice(I+1,C-1).replace(/""/g,'"')}for(;g<p;){if((D=f.charCodeAt(C=g++))===Tc)A=!0;else if(D===Ap)A=!0,f.charCodeAt(g)===Tc&&++g;else if(D!==n)continue;return f.slice(I,C)}return x=!0,f.slice(I,p)}for(;(v=w())!==wp;){for(var _=[];v!==uv&&v!==wp;)_.push(v),v=w();h&&(_=h(_,b++))==null||d.push(_)}return d}function a(f,h){return f.map(function(d){return h.map(function(p){return u(d[p])}).join(e)})}function o(f,h){return h==null&&(h=hv(f)),[h.map(u).join(e)].concat(a(f,h)).join(`
|
3
3
|
`)}function s(f,h){return h==null&&(h=hv(f)),a(f,h).join(`
|
4
4
|
`)}function c(f){return f.map(l).join(`
|
5
|
-
`)}function l(f){return f.map(u).join(e)}function u(f){return f==null?"":f instanceof Date?RI(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:o,formatBody:s,formatRows:c,formatRow:l,formatValue:u}}var DI=dv(" "),BI=DI.parseRows;function FI(e){return e}function PI(e){if(e==null)return FI;var t,n,r=e.scale[0],i=e.scale[1],a=e.translate[0],o=e.translate[1];return function(s,c){c||(t=n=0);var l=2,u=s.length,f=new Array(u);for(f[0]=(t+=s[0])*r+a,f[1]=(n+=s[1])*i+o;l<u;)f[l]=s[l],++l;return f}}function MI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function OI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return pv(e,n)})}:pv(e,t)}function pv(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,a=gv(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:a}:r==null?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function gv(e,t){var n=PI(e.transform),r=e.arcs;function i(u,f){f.length&&f.pop();for(var h=r[u<0?~u:u],d=0,p=h.length;d<p;++d)f.push(n(h[d],d));u<0&&MI(f,p)}function a(u){return n(u)}function o(u){for(var f=[],h=0,d=u.length;h<d;++h)i(u[h],f);return f.length<2&&f.push(f[0]),f}function s(u){for(var f=o(u);f.length<4;)f.push(f[0]);return f}function c(u){return u.map(s)}function l(u){var f=u.type,h;switch(f){case"GeometryCollection":return{type:f,geometries:u.geometries.map(l)};case"Point":h=a(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(a);break;case"LineString":h=o(u.arcs);break;case"MultiLineString":h=u.arcs.map(o);break;case"Polygon":h=c(u.arcs);break;case"MultiPolygon":h=u.arcs.map(c);break;default:return null}return{type:f,coordinates:h}}return l(t)}function LI(e,t){var n={},r={},i={},a=[],o=-1;t.forEach(function(l,u){var f=e.arcs[l<0?~l:l],h;f.length<3&&!f[1][0]&&!f[1][1]&&(h=t[++o],t[o]=l,t[u]=h)}),t.forEach(function(l){var u=s(l),f=u[0],h=u[1],d,p;if(d=i[f])if(delete i[d.end],d.push(l),d.end=h,p=r[h]){delete r[p.start];var g=p===d?d:d.concat(p);r[g.start=d.start]=i[g.end=p.end]=g}else r[d.start]=i[d.end]=d;else if(d=r[h])if(delete r[d.start],d.unshift(l),d.start=f,p=i[f]){delete i[p.end];var b=p===d?d:p.concat(d);r[b.start=p.start]=i[b.end=d.end]=b}else r[d.start]=i[d.end]=d;else d=[l],r[d.start=f]=i[d.end=h]=d});function s(l){var u=e.arcs[l<0?~l:l],f=u[0],h;return e.transform?(h=[0,0],u.forEach(function(d){h[0]+=d[0],h[1]+=d[1]})):h=u[u.length-1],l<0?[h,f]:[f,h]}function c(l,u){for(var f in l){var h=l[f];delete u[h.start],delete h.start,delete h.end,h.forEach(function(d){n[d<0?~d:d]=1}),a.push(h)}}return c(i,r),c(r,i),t.forEach(function(l){n[l<0?~l:l]||a.push([l])}),a}function NI(e){return gv(e,zI.apply(this,arguments))}function zI(e,t,n){var r,i,a;if(arguments.length>1)r=UI(e,t,n);else for(i=0,r=new Array(a=e.arcs.length);i<a;++i)r[i]=i;return{type:"MultiLineString",arcs:LI(e,r)}}function UI(e,t,n){var r=[],i=[],a;function o(f){var h=f<0?~f:f;(i[h]||(i[h]=[])).push({i:f,g:a})}function s(f){f.forEach(o)}function c(f){f.forEach(s)}function l(f){f.forEach(c)}function u(f){switch(a=f,f.type){case"GeometryCollection":f.geometries.forEach(u);break;case"LineString":s(f.arcs);break;case"MultiLineString":case"Polygon":c(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return u(t),i.forEach(n==null?function(f){r.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&r.push(f[0].i)}),r}function va(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $I(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zf(e){let t,n,r;e.length!==2?(t=va,n=(s,c)=>va(e(s),c),r=(s,c)=>e(s)-c):(t=e===va||e===$I?e:HI,n=e,r=e);function i(s,c,l=0,u=s.length){if(l<u){if(t(c,c)!==0)return u;do{const f=l+u>>>1;n(s[f],c)<0?l=f+1:u=f}while(l<u)}return l}function a(s,c,l=0,u=s.length){if(l<u){if(t(c,c)!==0)return u;do{const f=l+u>>>1;n(s[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function o(s,c,l=0,u=s.length){const f=i(s,c,l,u-1);return f>l&&r(s[f-1],c)>-r(s[f],c)?f-1:f}return{left:i,center:o,right:a}}function HI(){return 0}function mv(e){return e===null?NaN:+e}const bv=zf(va),Pr=bv.right;bv.left,zf(mv).center;function GI(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function Uf(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}class gi extends Map{constructor(t,n=qI){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(yv(this,t))}has(t){return super.has(yv(this,t))}set(t,n){return super.set(VI(this,t),n)}delete(t){return super.delete(jI(this,t))}}function yv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function VI({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function jI({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function qI(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ic(e){return e}function Rc(e,...t){return Ep(e,Ic,Ic,t)}function WI(e,...t){return Ep(e,Array.from,Ic,t)}function YI(e,t,...n){return Ep(e,Ic,t,n)}function Ep(e,t,n,r){return function i(a,o){if(o>=r.length)return n(a);const s=new gi,c=r[o++];let l=-1;for(const u of a){const f=c(u,++l,a),h=s.get(f);h?h.push(u):s.set(f,[u])}for(const[u,f]of s)s.set(u,i(f,o));return t(s)}(e,0)}function ZI(e,t){return Array.from(t,n=>e[n])}function QI(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){const r=Uint32Array.from(e,(i,a)=>a);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,a)=>{for(const o of t){const s=Sp(o[i],o[a]);if(s)return s}})):(n=e.map(n),r.sort((i,a)=>Sp(n[i],n[a]))),ZI(e,r)}return e.sort(XI(n))}function XI(e=va){if(e===va)return Sp;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Sp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var KI=Array.prototype,JI=KI.slice;function $f(e){return()=>e}var _p=Math.sqrt(50),Cp=Math.sqrt(10),kp=Math.sqrt(2);function Dc(e,t,n){var r,i=-1,a,o,s;if(t=+t,e=+e,n=+n,e===t&&n>0)return[e];if((r=t<e)&&(a=e,e=t,t=a),(s=Bc(e,t,n))===0||!isFinite(s))return[];if(s>0){let c=Math.round(e/s),l=Math.round(t/s);for(c*s<e&&++c,l*s>t&&--l,o=new Array(a=l-c+1);++i<a;)o[i]=(c+i)*s}else{s=-s;let c=Math.round(e*s),l=Math.round(t*s);for(c/s<e&&++c,l/s>t&&--l,o=new Array(a=l-c+1);++i<a;)o[i]=(c+i)/s}return r&&o.reverse(),o}function Bc(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=_p?10:a>=Cp?5:a>=kp?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=_p?10:a>=Cp?5:a>=kp?2:1)}function wa(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=_p?i*=10:a>=Cp?i*=5:a>=kp&&(i*=2),t<e?-i:i}function eR(e,t,n){let r;for(;;){const i=Bc(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function tR(e){return Math.ceil(Math.log(GI(e))/Math.LN2)+1}function nR(){var e=Ic,t=Uf,n=tR;function r(i){Array.isArray(i)||(i=Array.from(i));var a,o=i.length,s,c,l=new Array(o);for(a=0;a<o;++a)l[a]=e(i[a],a,i);var u=t(l),f=u[0],h=u[1],d=n(l,f,h);if(!Array.isArray(d)){const v=h,x=+d;if(t===Uf&&([f,h]=eR(f,h,x)),d=Dc(f,h,x),d[0]<=f&&(c=Bc(f,h,x)),d[d.length-1]>=h)if(v>=h&&t===Uf){const A=Bc(f,h,x);isFinite(A)&&(A>0?h=(Math.floor(h/A)+1)*A:A<0&&(h=(Math.ceil(h*-A)+1)/-A))}else d.pop()}for(var p=d.length;d[0]<=f;)d.shift(),--p;for(;d[p-1]>h;)d.pop(),--p;var g=new Array(p+1),b;for(a=0;a<=p;++a)b=g[a]=[],b.x0=a>0?d[a-1]:f,b.x1=a<p?d[a]:h;if(isFinite(c)){if(c>0)for(a=0;a<o;++a)(s=l[a])!=null&&f<=s&&s<=h&&g[Math.min(p,Math.floor((s-f)/c))].push(i[a]);else if(c<0){for(a=0;a<o;++a)if((s=l[a])!=null&&f<=s&&s<=h){const v=Math.floor((f-s)*c);g[Math.min(p,v+(d[v]<=s))].push(i[a])}}}else for(a=0;a<o;++a)(s=l[a])!=null&&f<=s&&s<=h&&g[Pr(d,s,0,p)].push(i[a]);return g}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:$f(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:$f([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Array.isArray(i)?$f(JI.call(i)):$f(i),r):n},r}function Tp(e,t,n=mv){if(r=e.length){if((t=+t)<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),s=+n(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function mi(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Hf(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function rR(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Gf(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function jo(e){return e=Gf(Math.abs(e)),e?e[1]:NaN}function iR(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function aR(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var oR=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bi(e){if(!(t=oR.exec(e)))throw new Error("invalid format: "+e);var t;return new Ip({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}bi.prototype=Ip.prototype;function Ip(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ip.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function sR(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var vv;function cR(e,t){var n=Gf(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(vv=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Gf(e,Math.max(0,t+a-1))[0]}function wv(e,t){var n=Gf(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const xv={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:rR,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>wv(e*100,t),r:wv,s:cR,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Av(e){return e}var Ev=Array.prototype.map,Sv=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lR(e){var t=e.grouping===void 0||e.thousands===void 0?Av:iR(Ev.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Av:aR(Ev.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(f){f=bi(f);var h=f.fill,d=f.align,p=f.sign,g=f.symbol,b=f.zero,v=f.width,x=f.comma,A=f.precision,w=f.trim,_=f.type;_==="n"?(x=!0,_="g"):xv[_]||(A===void 0&&(A=12),w=!0,_="g"),(b||h==="0"&&d==="=")&&(b=!0,h="0",d="=");var C=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",I=g==="$"?r:/[%p]/.test(_)?o:"",D=xv[_],B=/[defgprs%]/.test(_);A=A===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function G(z){var ae=C,se=I,ve,Pe,st;if(_==="c")se=D(z)+se,z="";else{z=+z;var Ne=z<0||1/z<0;if(z=isNaN(z)?c:D(Math.abs(z),A),w&&(z=sR(z)),Ne&&+z==0&&p!=="+"&&(Ne=!1),ae=(Ne?p==="("?p:s:p==="-"||p==="("?"":p)+ae,se=(_==="s"?Sv[8+vv/3]:"")+se+(Ne&&p==="("?")":""),B){for(ve=-1,Pe=z.length;++ve<Pe;)if(st=z.charCodeAt(ve),48>st||st>57){se=(st===46?i+z.slice(ve+1):z.slice(ve))+se,z=z.slice(0,ve);break}}}x&&!b&&(z=t(z,1/0));var lt=ae.length+z.length+se.length,tt=lt<v?new Array(v-lt+1).join(h):"";switch(x&&b&&(z=t(tt+z,tt.length?v-se.length:1/0),tt=""),d){case"<":z=ae+z+se+tt;break;case"=":z=ae+tt+z+se;break;case"^":z=tt.slice(0,lt=tt.length>>1)+ae+z+se+tt.slice(lt);break;default:z=tt+ae+z+se;break}return a(z)}return G.toString=function(){return f+""},G}function u(f,h){var d=l((f=bi(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(jo(h)/3)))*3,g=Math.pow(10,-p),b=Sv[8+p/3];return function(v){return d(g*v)+b}}return{format:l,formatPrefix:u}}var Vf,pt,Rp;uR({thousands:",",grouping:[3],currency:["$",""]});function uR(e){return Vf=lR(e),pt=Vf.format,Rp=Vf.formatPrefix,Vf}function _v(e){return Math.max(0,-jo(Math.abs(e)))}function Cv(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(jo(t)/3)))*3-jo(Math.abs(e)))}function kv(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,jo(t)-jo(e))+1}var Dp=new Date,Bp=new Date;function wt(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=function(a){return e(a=new Date(+a)),a},i.ceil=function(a){return e(a=new Date(a-1)),t(a,1),e(a),a},i.round=function(a){var o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=function(a,o){return t(a=new Date(+a),o==null?1:Math.floor(o)),a},i.range=function(a,o,s){var c=[],l;if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return c;do c.push(l=new Date(+a)),t(a,s),e(a);while(l<a&&a<o);return c},i.filter=function(a){return wt(function(o){if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},function(o,s){if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););})},n&&(i.count=function(a,o){return Dp.setTime(+a),Bp.setTime(+o),e(Dp),e(Bp),Math.floor(n(Dp,Bp))},i.every=function(a){return a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?function(o){return r(o)%a===0}:function(o){return i.count(0,o)%a===0}):i}),i}var jf=wt(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});jf.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?wt(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):jf};const Fp=jf;jf.range;const Mr=1e3,wn=Mr*60,Or=wn*60,xa=Or*24,Pp=xa*7,Tv=xa*30,Mp=xa*365;var Iv=wt(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*Mr)},function(e,t){return(t-e)/Mr},function(e){return e.getUTCSeconds()});const yi=Iv;Iv.range;var Rv=wt(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Mr)},function(e,t){e.setTime(+e+t*wn)},function(e,t){return(t-e)/wn},function(e){return e.getMinutes()});const Op=Rv;Rv.range;var Dv=wt(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Mr-e.getMinutes()*wn)},function(e,t){e.setTime(+e+t*Or)},function(e,t){return(t-e)/Or},function(e){return e.getHours()});const Lp=Dv;Dv.range;var Bv=wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wn)/xa,e=>e.getDate()-1);const Aa=Bv;Bv.range;function Ea(e){return wt(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*wn)/Pp})}var Fc=Ea(0),qf=Ea(1),fR=Ea(2),hR=Ea(3),qo=Ea(4),dR=Ea(5),pR=Ea(6);Fc.range,qf.range,fR.range,hR.range,qo.range,dR.range,pR.range;var Pc=wt(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});Pc.range;var Np=wt(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});Np.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:wt(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};const vi=Np;Np.range;var Fv=wt(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*wn)},function(e,t){return(t-e)/wn},function(e){return e.getUTCMinutes()});const zp=Fv;Fv.range;var Pv=wt(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Or)},function(e,t){return(t-e)/Or},function(e){return e.getUTCHours()});const Up=Pv;Pv.range;var Mv=wt(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/xa},function(e){return e.getUTCDate()-1});const Sa=Mv;Mv.range;function _a(e){return wt(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/Pp})}var Mc=_a(0),Wf=_a(1),gR=_a(2),mR=_a(3),Wo=_a(4),bR=_a(5),yR=_a(6);Mc.range,Wf.range,gR.range,mR.range,Wo.range,bR.range,yR.range;var Oc=wt(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});Oc.range;var $p=wt(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});$p.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:wt(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};const wi=$p;$p.range;function Ov(e,t,n,r,i,a){const o=[[yi,1,Mr],[yi,5,5*Mr],[yi,15,15*Mr],[yi,30,30*Mr],[a,1,wn],[a,5,5*wn],[a,15,15*wn],[a,30,30*wn],[i,1,Or],[i,3,3*Or],[i,6,6*Or],[i,12,12*Or],[r,1,xa],[r,2,2*xa],[n,1,Pp],[t,1,Tv],[t,3,3*Tv],[e,1,Mp]];function s(l,u,f){const h=u<l;h&&([l,u]=[u,l]);const d=f&&typeof f.range=="function"?f:c(l,u,f),p=d?d.range(l,+u+1):[];return h?p.reverse():p}function c(l,u,f){const h=Math.abs(u-l)/f,d=zf(([,,b])=>b).right(o,h);if(d===o.length)return e.every(wa(l/Mp,u/Mp,f));if(d===0)return Fp.every(Math.max(wa(l,u,f),1));const[p,g]=o[h/o[d-1][2]<o[d][2]/h?d-1:d];return p.every(g)}return[s,c]}const[vR,wR]=Ov(wi,Oc,Mc,Sa,Up,zp),[xR,AR]=Ov(vi,Pc,Fc,Aa,Lp,Op),Lc="year",Nc="quarter",zc="month",Uc="week",$c="date",Yf="day",Hp="dayofyear",Hc="hours",Gc="minutes",Vc="seconds",Zf="milliseconds";[Lc,Nc,zc,Uc,$c,Yf,Hp,Hc,Gc,Vc,Zf].reduce((e,t,n)=>(e[t]=1+n,e),{});const ER={[Lc]:vi,[Nc]:Pc.every(3),[zc]:Pc,[Uc]:Fc,[$c]:Aa,[Yf]:Aa,[Hp]:Aa,[Hc]:Lp,[Gc]:Op,[Vc]:yi,[Zf]:Fp},SR={[Lc]:wi,[Nc]:Oc.every(3),[zc]:Oc,[Uc]:Mc,[$c]:Sa,[Yf]:Sa,[Hp]:Sa,[Hc]:Up,[Gc]:zp,[Vc]:yi,[Zf]:Fp};function _R(e){return ER[e]}function CR(e){return SR[e]}function Gp(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Vp(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function jc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Lv(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=qc(i),u=Wc(i),f=qc(a),h=Wc(a),d=qc(o),p=Wc(o),g=qc(s),b=Wc(s),v=qc(c),x=Wc(c),A={a:Ne,A:lt,b:tt,B:ut,c:null,d:Gv,e:Gv,f:ZR,g:a9,G:s9,H:qR,I:WR,j:YR,L:Vv,m:QR,M:XR,p:Te,q:Ie,Q:Qv,s:Xv,S:KR,u:JR,U:e9,V:t9,w:n9,W:r9,x:null,X:null,y:i9,Y:o9,Z:c9,"%":Zv},w={a:Rt,A:ln,b:Ve,B:L,c:null,d:qv,e:qv,f:h9,g:A9,G:S9,H:l9,I:u9,j:f9,L:Wv,m:d9,M:p9,p:O,q:W,Q:Qv,s:Xv,S:g9,u:m9,U:b9,V:y9,w:v9,W:w9,x:null,X:null,y:x9,Y:E9,Z:_9,"%":Zv},_={a:G,A:z,b:ae,B:se,c:ve,d:$v,e:$v,f:HR,g:Uv,G:zv,H:Hv,I:Hv,j:NR,L:$R,m:LR,M:zR,p:B,q:OR,Q:VR,s:jR,S:UR,u:DR,U:BR,V:FR,w:RR,W:PR,x:Pe,X:st,y:Uv,Y:zv,Z:MR,"%":GR};A.x=C(n,A),A.X=C(r,A),A.c=C(t,A),w.x=C(n,w),w.X=C(r,w),w.c=C(t,w);function C(j,Q){return function(T){var S=[],V=-1,Y=0,de=j.length,ie,pe,un;for(T instanceof Date||(T=new Date(+T));++V<de;)j.charCodeAt(V)===37&&(S.push(j.slice(Y,V)),(pe=Nv[ie=j.charAt(++V)])!=null?ie=j.charAt(++V):pe=ie==="e"?" ":"0",(un=Q[ie])&&(ie=un(T,pe)),S.push(ie),Y=V+1);return S.push(j.slice(Y,V)),S.join("")}}function I(j,Q){return function(T){var S=jc(1900,void 0,1),V=D(S,j,T+="",0),Y,de;if(V!=T.length)return null;if("Q"in S)return new Date(S.Q);if("s"in S)return new Date(S.s*1e3+("L"in S?S.L:0));if(Q&&!("Z"in S)&&(S.Z=0),"p"in S&&(S.H=S.H%12+S.p*12),S.m===void 0&&(S.m="q"in S?S.q:0),"V"in S){if(S.V<1||S.V>53)return null;"w"in S||(S.w=1),"Z"in S?(Y=Vp(jc(S.y,0,1)),de=Y.getUTCDay(),Y=de>4||de===0?Wf.ceil(Y):Wf(Y),Y=Sa.offset(Y,(S.V-1)*7),S.y=Y.getUTCFullYear(),S.m=Y.getUTCMonth(),S.d=Y.getUTCDate()+(S.w+6)%7):(Y=Gp(jc(S.y,0,1)),de=Y.getDay(),Y=de>4||de===0?qf.ceil(Y):qf(Y),Y=Aa.offset(Y,(S.V-1)*7),S.y=Y.getFullYear(),S.m=Y.getMonth(),S.d=Y.getDate()+(S.w+6)%7)}else("W"in S||"U"in S)&&("w"in S||(S.w="u"in S?S.u%7:"W"in S?1:0),de="Z"in S?Vp(jc(S.y,0,1)).getUTCDay():Gp(jc(S.y,0,1)).getDay(),S.m=0,S.d="W"in S?(S.w+6)%7+S.W*7-(de+5)%7:S.w+S.U*7-(de+6)%7);return"Z"in S?(S.H+=S.Z/100|0,S.M+=S.Z%100,Vp(S)):Gp(S)}}function D(j,Q,T,S){for(var V=0,Y=Q.length,de=T.length,ie,pe;V<Y;){if(S>=de)return-1;if(ie=Q.charCodeAt(V++),ie===37){if(ie=Q.charAt(V++),pe=_[ie in Nv?Q.charAt(V++):ie],!pe||(S=pe(j,T,S))<0)return-1}else if(ie!=T.charCodeAt(S++))return-1}return S}function B(j,Q,T){var S=l.exec(Q.slice(T));return S?(j.p=u.get(S[0].toLowerCase()),T+S[0].length):-1}function G(j,Q,T){var S=d.exec(Q.slice(T));return S?(j.w=p.get(S[0].toLowerCase()),T+S[0].length):-1}function z(j,Q,T){var S=f.exec(Q.slice(T));return S?(j.w=h.get(S[0].toLowerCase()),T+S[0].length):-1}function ae(j,Q,T){var S=v.exec(Q.slice(T));return S?(j.m=x.get(S[0].toLowerCase()),T+S[0].length):-1}function se(j,Q,T){var S=g.exec(Q.slice(T));return S?(j.m=b.get(S[0].toLowerCase()),T+S[0].length):-1}function ve(j,Q,T){return D(j,t,Q,T)}function Pe(j,Q,T){return D(j,n,Q,T)}function st(j,Q,T){return D(j,r,Q,T)}function Ne(j){return o[j.getDay()]}function lt(j){return a[j.getDay()]}function tt(j){return c[j.getMonth()]}function ut(j){return s[j.getMonth()]}function Te(j){return i[+(j.getHours()>=12)]}function Ie(j){return 1+~~(j.getMonth()/3)}function Rt(j){return o[j.getUTCDay()]}function ln(j){return a[j.getUTCDay()]}function Ve(j){return c[j.getUTCMonth()]}function L(j){return s[j.getUTCMonth()]}function O(j){return i[+(j.getUTCHours()>=12)]}function W(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var Q=C(j+="",A);return Q.toString=function(){return j},Q},parse:function(j){var Q=I(j+="",!1);return Q.toString=function(){return j},Q},utcFormat:function(j){var Q=C(j+="",w);return Q.toString=function(){return j},Q},utcParse:function(j){var Q=I(j+="",!0);return Q.toString=function(){return j},Q}}}var Nv={"-":"",_:" ",0:"0"},xt=/^\s*\d+/,kR=/^%/,TR=/[\\^$*+?|[\]().{}]/g;function Ae(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function IR(e){return e.replace(TR,"\\$&")}function qc(e){return new RegExp("^(?:"+e.map(IR).join("|")+")","i")}function Wc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function RR(e,t,n){var r=xt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function DR(e,t,n){var r=xt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function BR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function FR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function PR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function zv(e,t,n){var r=xt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Uv(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function MR(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function OR(e,t,n){var r=xt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function LR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function $v(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function NR(e,t,n){var r=xt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Hv(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function zR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function UR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function $R(e,t,n){var r=xt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function HR(e,t,n){var r=xt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function GR(e,t,n){var r=kR.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function VR(e,t,n){var r=xt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function jR(e,t,n){var r=xt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Gv(e,t){return Ae(e.getDate(),t,2)}function qR(e,t){return Ae(e.getHours(),t,2)}function WR(e,t){return Ae(e.getHours()%12||12,t,2)}function YR(e,t){return Ae(1+Aa.count(vi(e),e),t,3)}function Vv(e,t){return Ae(e.getMilliseconds(),t,3)}function ZR(e,t){return Vv(e,t)+"000"}function QR(e,t){return Ae(e.getMonth()+1,t,2)}function XR(e,t){return Ae(e.getMinutes(),t,2)}function KR(e,t){return Ae(e.getSeconds(),t,2)}function JR(e){var t=e.getDay();return t===0?7:t}function e9(e,t){return Ae(Fc.count(vi(e)-1,e),t,2)}function jv(e){var t=e.getDay();return t>=4||t===0?qo(e):qo.ceil(e)}function t9(e,t){return e=jv(e),Ae(qo.count(vi(e),e)+(vi(e).getDay()===4),t,2)}function n9(e){return e.getDay()}function r9(e,t){return Ae(qf.count(vi(e)-1,e),t,2)}function i9(e,t){return Ae(e.getFullYear()%100,t,2)}function a9(e,t){return e=jv(e),Ae(e.getFullYear()%100,t,2)}function o9(e,t){return Ae(e.getFullYear()%1e4,t,4)}function s9(e,t){var n=e.getDay();return e=n>=4||n===0?qo(e):qo.ceil(e),Ae(e.getFullYear()%1e4,t,4)}function c9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ae(t/60|0,"0",2)+Ae(t%60,"0",2)}function qv(e,t){return Ae(e.getUTCDate(),t,2)}function l9(e,t){return Ae(e.getUTCHours(),t,2)}function u9(e,t){return Ae(e.getUTCHours()%12||12,t,2)}function f9(e,t){return Ae(1+Sa.count(wi(e),e),t,3)}function Wv(e,t){return Ae(e.getUTCMilliseconds(),t,3)}function h9(e,t){return Wv(e,t)+"000"}function d9(e,t){return Ae(e.getUTCMonth()+1,t,2)}function p9(e,t){return Ae(e.getUTCMinutes(),t,2)}function g9(e,t){return Ae(e.getUTCSeconds(),t,2)}function m9(e){var t=e.getUTCDay();return t===0?7:t}function b9(e,t){return Ae(Mc.count(wi(e)-1,e),t,2)}function Yv(e){var t=e.getUTCDay();return t>=4||t===0?Wo(e):Wo.ceil(e)}function y9(e,t){return e=Yv(e),Ae(Wo.count(wi(e),e)+(wi(e).getUTCDay()===4),t,2)}function v9(e){return e.getUTCDay()}function w9(e,t){return Ae(Wf.count(wi(e)-1,e),t,2)}function x9(e,t){return Ae(e.getUTCFullYear()%100,t,2)}function A9(e,t){return e=Yv(e),Ae(e.getUTCFullYear()%100,t,2)}function E9(e,t){return Ae(e.getUTCFullYear()%1e4,t,4)}function S9(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Wo(e):Wo.ceil(e),Ae(e.getUTCFullYear()%1e4,t,4)}function _9(){return"+0000"}function Zv(){return"%"}function Qv(e){return+e}function Xv(e){return Math.floor(+e/1e3)}var Yo,jp,Kv,qp,Jv;C9({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function C9(e){return Yo=Lv(e),jp=Yo.format,Kv=Yo.parse,qp=Yo.utcFormat,Jv=Yo.utcParse,Yo}function Yc(e){const t={};return n=>t[n]||(t[n]=e(n))}function k9(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let a=T9(r,i);const o=a<r.length?r.slice(a):"";for(;--a>i;)if(r[a]!=="0"){++a;break}return r.slice(0,a)+o}}function T9(e,t){let n=e.lastIndexOf("e"),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function I9(e){const t=Yc(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(r){const i=bi(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return k9(t(i),t(".1f")(1)[1])}else return t(i)},formatSpan(r,i,a,o){o=bi(o??",f");const s=wa(r,i,a),c=Math.max(Math.abs(r),Math.abs(i));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=Cv(s,c))||(o.precision=l),n(o,c);case"":case"e":case"g":case"p":case"r":{isNaN(l=kv(s,c))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=_v(s))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}R9();function R9(){return I9({format:pt,formatPrefix:Rp})}function ew(e,t,n){n=n||{},Xt(n)||it("Invalid time multi-format specifier: ".concat(n));const r=t(Vc),i=t(Gc),a=t(Hc),o=t($c),s=t(Uc),c=t(zc),l=t(Nc),u=t(Lc),f=e(n[Zf]||".%L"),h=e(n[Vc]||":%S"),d=e(n[Gc]||"%I:%M"),p=e(n[Hc]||"%I %p"),g=e(n[$c]||n[Yf]||"%a %d"),b=e(n[Uc]||"%b %d"),v=e(n[zc]||"%B"),x=e(n[Nc]||"%B"),A=e(n[Lc]||"%Y");return w=>(r(w)<w?f:i(w)<w?h:a(w)<w?d:o(w)<w?p:c(w)<w?s(w)<w?g:b:u(w)<w?l(w)<w?v:x:A)(w)}function tw(e){const t=Yc(e.format),n=Yc(e.utcFormat);return{timeFormat:r=>Me(r)?t(r):ew(t,_R,r),utcFormat:r=>Me(r)?n(r):ew(n,CR,r),timeParse:Yc(e.parse),utcParse:Yc(e.utcParse)}}let Wp;D9();function D9(){return Wp=tw({format:jp,parse:Kv,utcFormat:qp,utcParse:Jv})}function B9(e){return tw(Lv(e))}function F9(e){return arguments.length?Wp=B9(e):Wp}const P9=/^(data:|([A-Za-z]+:)?\/\/)/,M9=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,O9=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,nw="file://";function L9(e,t){return n=>({options:n||{},sanitize:z9,load:N9,fileAccess:!!t,file:U9(t),http:H9(e)})}async function N9(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function z9(e,t){t=vp({},this.options,t);const n=this.fileAccess,r={href:null};let i,a,o;const s=M9.test(e.replace(O9,""));(e==null||typeof e!="string"||!s)&&it("Sanitize failure, invalid URI: "+Lf(e));const c=P9.test(e);return(o=t.baseURL)&&!c&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),a=(i=e.startsWith(nw))||t.mode==="file"||t.mode!=="http"&&!c&&n,i?e=e.slice(nw.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),a=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!a}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function U9(e){return e?t=>new Promise((n,r)=>{e.readFile(t,(i,a)=>{i?r(i):n(a)})}):$9}async function $9(){it("No file system access.")}function H9(e){return e?async function(t,n){const r=vp({},this.options.http,n),i=n&&n.response,a=await e(t,r);return a.ok?Kt(a[i])?a[i]():a.text():it(a.status+""+a.statusText)}:G9}async function G9(){it("No HTTP fetch method available.")}const V9=e=>e!=null&&e===e,j9=e=>e==="true"||e==="false"||e===!0||e===!1,q9=e=>!Number.isNaN(Date.parse(e)),rw=e=>!Number.isNaN(+e)&&!(e instanceof Date),W9=e=>rw(e)&&Number.isInteger(+e),iw={boolean:SI,integer:Cc,number:Cc,date:CI,string:kI,unknown:Ff},Qf=[j9,W9,rw,q9],Y9=["boolean","integer","number","date"];function aw(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=Qf.length,i=Qf.map((a,o)=>o+1);for(let a=0,o=0,s,c;a<n;++a)for(c=t?e[a][t]:e[a],s=0;s<r;++s)if(i[s]&&V9(c)&&!Qf[s](c)&&(i[s]=0,++o,o===Qf.length))return"string";return Y9[i.reduce((a,o)=>a===0?o:a,0)-1]}function Z9(e,t){return t.reduce((n,r)=>(n[r]=aw(e,r),n),{})}function ow(e){const t=function(n,r){const i={delimiter:e};return Yp(n,r?vp(r,i):i)};return t.responseType="text",t}function Yp(e,t){return t.header&&(e=t.header.map(Lf).join(t.delimiter)+`
|
6
|
-
`+e),dv(t.delimiter).parse(e+"")}Yp.responseType="text";function Q9(e){return typeof Buffer=="function"&&Kt(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Zp(e,t){const n=t&&t.property?Bf(t.property):Ff;return Xt(e)&&!Q9(e)?X9(n(e),t):n(JSON.parse(e))}Zp.responseType="json";function X9(e,t){return!Qt(e)&&AI(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const K9={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function sw(e,t){let n,r,i,a;return e=Zp(e,t),t&&t.feature?(n=OI,i=t.feature):t&&t.mesh?(n=NI,i=t.mesh,a=K9[t.filter]):it("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,a):it("Invalid TopoJSON object: "+i),r&&r.features||[r]}sw.responseType="json";const Qp={dsv:Yp,csv:ow(","),tsv:ow(" "),json:Zp,topojson:sw};function cw(e,t){return arguments.length>1?(Qp[e]=t,this):
|
5
|
+
`)}function l(f){return f.map(u).join(e)}function u(f){return f==null?"":f instanceof Date?RI(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:r,parseRows:i,format:o,formatBody:s,formatRows:c,formatRow:l,formatValue:u}}var DI=dv(" "),BI=DI.parseRows;function FI(e){return e}function PI(e){if(e==null)return FI;var t,n,r=e.scale[0],i=e.scale[1],a=e.translate[0],o=e.translate[1];return function(s,c){c||(t=n=0);var l=2,u=s.length,f=new Array(u);for(f[0]=(t+=s[0])*r+a,f[1]=(n+=s[1])*i+o;l<u;)f[l]=s[l],++l;return f}}function MI(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function OI(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return pv(e,n)})}:pv(e,t)}function pv(e,t){var n=t.id,r=t.bbox,i=t.properties==null?{}:t.properties,a=gv(e,t);return n==null&&r==null?{type:"Feature",properties:i,geometry:a}:r==null?{type:"Feature",id:n,properties:i,geometry:a}:{type:"Feature",id:n,bbox:r,properties:i,geometry:a}}function gv(e,t){var n=PI(e.transform),r=e.arcs;function i(u,f){f.length&&f.pop();for(var h=r[u<0?~u:u],d=0,p=h.length;d<p;++d)f.push(n(h[d],d));u<0&&MI(f,p)}function a(u){return n(u)}function o(u){for(var f=[],h=0,d=u.length;h<d;++h)i(u[h],f);return f.length<2&&f.push(f[0]),f}function s(u){for(var f=o(u);f.length<4;)f.push(f[0]);return f}function c(u){return u.map(s)}function l(u){var f=u.type,h;switch(f){case"GeometryCollection":return{type:f,geometries:u.geometries.map(l)};case"Point":h=a(u.coordinates);break;case"MultiPoint":h=u.coordinates.map(a);break;case"LineString":h=o(u.arcs);break;case"MultiLineString":h=u.arcs.map(o);break;case"Polygon":h=c(u.arcs);break;case"MultiPolygon":h=u.arcs.map(c);break;default:return null}return{type:f,coordinates:h}}return l(t)}function LI(e,t){var n={},r={},i={},a=[],o=-1;t.forEach(function(l,u){var f=e.arcs[l<0?~l:l],h;f.length<3&&!f[1][0]&&!f[1][1]&&(h=t[++o],t[o]=l,t[u]=h)}),t.forEach(function(l){var u=s(l),f=u[0],h=u[1],d,p;if(d=i[f])if(delete i[d.end],d.push(l),d.end=h,p=r[h]){delete r[p.start];var g=p===d?d:d.concat(p);r[g.start=d.start]=i[g.end=p.end]=g}else r[d.start]=i[d.end]=d;else if(d=r[h])if(delete r[d.start],d.unshift(l),d.start=f,p=i[f]){delete i[p.end];var b=p===d?d:p.concat(d);r[b.start=p.start]=i[b.end=d.end]=b}else r[d.start]=i[d.end]=d;else d=[l],r[d.start=f]=i[d.end=h]=d});function s(l){var u=e.arcs[l<0?~l:l],f=u[0],h;return e.transform?(h=[0,0],u.forEach(function(d){h[0]+=d[0],h[1]+=d[1]})):h=u[u.length-1],l<0?[h,f]:[f,h]}function c(l,u){for(var f in l){var h=l[f];delete u[h.start],delete h.start,delete h.end,h.forEach(function(d){n[d<0?~d:d]=1}),a.push(h)}}return c(i,r),c(r,i),t.forEach(function(l){n[l<0?~l:l]||a.push([l])}),a}function NI(e){return gv(e,zI.apply(this,arguments))}function zI(e,t,n){var r,i,a;if(arguments.length>1)r=UI(e,t,n);else for(i=0,r=new Array(a=e.arcs.length);i<a;++i)r[i]=i;return{type:"MultiLineString",arcs:LI(e,r)}}function UI(e,t,n){var r=[],i=[],a;function o(f){var h=f<0?~f:f;(i[h]||(i[h]=[])).push({i:f,g:a})}function s(f){f.forEach(o)}function c(f){f.forEach(s)}function l(f){f.forEach(c)}function u(f){switch(a=f,f.type){case"GeometryCollection":f.geometries.forEach(u);break;case"LineString":s(f.arcs);break;case"MultiLineString":case"Polygon":c(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return u(t),i.forEach(n==null?function(f){r.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&r.push(f[0].i)}),r}function wa(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $I(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function zf(e){let t,n,r;e.length!==2?(t=wa,n=(s,c)=>wa(e(s),c),r=(s,c)=>e(s)-c):(t=e===wa||e===$I?e:HI,n=e,r=e);function i(s,c,l=0,u=s.length){if(l<u){if(t(c,c)!==0)return u;do{const f=l+u>>>1;n(s[f],c)<0?l=f+1:u=f}while(l<u)}return l}function a(s,c,l=0,u=s.length){if(l<u){if(t(c,c)!==0)return u;do{const f=l+u>>>1;n(s[f],c)<=0?l=f+1:u=f}while(l<u)}return l}function o(s,c,l=0,u=s.length){const f=i(s,c,l,u-1);return f>l&&r(s[f-1],c)>-r(s[f],c)?f-1:f}return{left:i,center:o,right:a}}function HI(){return 0}function mv(e){return e===null?NaN:+e}const bv=zf(wa),Fr=bv.right;bv.left,zf(mv).center;function GI(e,t){let n=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&++n;else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(i=+i)>=i&&++n}return n}function Uf(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let a of e)(a=t(a,++i,e))!=null&&(n===void 0?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}class gi extends Map{constructor(t,n=qI){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(yv(this,t))}has(t){return super.has(yv(this,t))}set(t,n){return super.set(VI(this,t),n)}delete(t){return super.delete(jI(this,t))}}function yv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function VI({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function jI({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function qI(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ic(e){return e}function Rc(e,...t){return Ep(e,Ic,Ic,t)}function WI(e,...t){return Ep(e,Array.from,Ic,t)}function YI(e,t,...n){return Ep(e,Ic,t,n)}function Ep(e,t,n,r){return function i(a,o){if(o>=r.length)return n(a);const s=new gi,c=r[o++];let l=-1;for(const u of a){const f=c(u,++l,a),h=s.get(f);h?h.push(u):s.set(f,[u])}for(const[u,f]of s)s.set(u,i(f,o));return t(s)}(e,0)}function ZI(e,t){return Array.from(t,n=>e[n])}function QI(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){const r=Uint32Array.from(e,(i,a)=>a);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,a)=>{for(const o of t){const s=Sp(o[i],o[a]);if(s)return s}})):(n=e.map(n),r.sort((i,a)=>Sp(n[i],n[a]))),ZI(e,r)}return e.sort(XI(n))}function XI(e=wa){if(e===wa)return Sp;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Sp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var KI=Array.prototype,JI=KI.slice;function $f(e){return()=>e}var _p=Math.sqrt(50),Cp=Math.sqrt(10),kp=Math.sqrt(2);function Dc(e,t,n){var r,i=-1,a,o,s;if(t=+t,e=+e,n=+n,e===t&&n>0)return[e];if((r=t<e)&&(a=e,e=t,t=a),(s=Bc(e,t,n))===0||!isFinite(s))return[];if(s>0){let c=Math.round(e/s),l=Math.round(t/s);for(c*s<e&&++c,l*s>t&&--l,o=new Array(a=l-c+1);++i<a;)o[i]=(c+i)*s}else{s=-s;let c=Math.round(e*s),l=Math.round(t*s);for(c/s<e&&++c,l/s>t&&--l,o=new Array(a=l-c+1);++i<a;)o[i]=(c+i)/s}return r&&o.reverse(),o}function Bc(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),a=r/Math.pow(10,i);return i>=0?(a>=_p?10:a>=Cp?5:a>=kp?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=_p?10:a>=Cp?5:a>=kp?2:1)}function xa(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),a=r/i;return a>=_p?i*=10:a>=Cp?i*=5:a>=kp&&(i*=2),t<e?-i:i}function eR(e,t,n){let r;for(;;){const i=Bc(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function tR(e){return Math.ceil(Math.log(GI(e))/Math.LN2)+1}function nR(){var e=Ic,t=Uf,n=tR;function r(i){Array.isArray(i)||(i=Array.from(i));var a,o=i.length,s,c,l=new Array(o);for(a=0;a<o;++a)l[a]=e(i[a],a,i);var u=t(l),f=u[0],h=u[1],d=n(l,f,h);if(!Array.isArray(d)){const v=h,x=+d;if(t===Uf&&([f,h]=eR(f,h,x)),d=Dc(f,h,x),d[0]<=f&&(c=Bc(f,h,x)),d[d.length-1]>=h)if(v>=h&&t===Uf){const A=Bc(f,h,x);isFinite(A)&&(A>0?h=(Math.floor(h/A)+1)*A:A<0&&(h=(Math.ceil(h*-A)+1)/-A))}else d.pop()}for(var p=d.length;d[0]<=f;)d.shift(),--p;for(;d[p-1]>h;)d.pop(),--p;var g=new Array(p+1),b;for(a=0;a<=p;++a)b=g[a]=[],b.x0=a>0?d[a-1]:f,b.x1=a<p?d[a]:h;if(isFinite(c)){if(c>0)for(a=0;a<o;++a)(s=l[a])!=null&&f<=s&&s<=h&&g[Math.min(p,Math.floor((s-f)/c))].push(i[a]);else if(c<0){for(a=0;a<o;++a)if((s=l[a])!=null&&f<=s&&s<=h){const v=Math.floor((f-s)*c);g[Math.min(p,v+(d[v]<=s))].push(i[a])}}}else for(a=0;a<o;++a)(s=l[a])!=null&&f<=s&&s<=h&&g[Fr(d,s,0,p)].push(i[a]);return g}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:$f(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:$f([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Array.isArray(i)?$f(JI.call(i)):$f(i),r):n},r}function Tp(e,t,n=mv){if(r=e.length){if((t=+t)<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),s=+n(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function mi(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Hf(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}function rR(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Gf(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function jo(e){return e=Gf(Math.abs(e)),e?e[1]:NaN}function iR(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function aR(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var oR=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function bi(e){if(!(t=oR.exec(e)))throw new Error("invalid format: "+e);var t;return new Ip({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}bi.prototype=Ip.prototype;function Ip(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ip.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function sR(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var vv;function cR(e,t){var n=Gf(e,t);if(!n)return e+"";var r=n[0],i=n[1],a=i-(vv=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Gf(e,Math.max(0,t+a-1))[0]}function wv(e,t){var n=Gf(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const xv={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:rR,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>wv(e*100,t),r:wv,s:cR,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Av(e){return e}var Ev=Array.prototype.map,Sv=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lR(e){var t=e.grouping===void 0||e.thousands===void 0?Av:iR(Ev.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?Av:aR(Ev.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function l(f){f=bi(f);var h=f.fill,d=f.align,p=f.sign,g=f.symbol,b=f.zero,v=f.width,x=f.comma,A=f.precision,w=f.trim,_=f.type;_==="n"?(x=!0,_="g"):xv[_]||(A===void 0&&(A=12),w=!0,_="g"),(b||h==="0"&&d==="=")&&(b=!0,h="0",d="=");var C=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",I=g==="$"?r:/[%p]/.test(_)?o:"",D=xv[_],B=/[defgprs%]/.test(_);A=A===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function G(z){var ae=C,se=I,ve,Pe,st;if(_==="c")se=D(z)+se,z="";else{z=+z;var Ne=z<0||1/z<0;if(z=isNaN(z)?c:D(Math.abs(z),A),w&&(z=sR(z)),Ne&&+z==0&&p!=="+"&&(Ne=!1),ae=(Ne?p==="("?p:s:p==="-"||p==="("?"":p)+ae,se=(_==="s"?Sv[8+vv/3]:"")+se+(Ne&&p==="("?")":""),B){for(ve=-1,Pe=z.length;++ve<Pe;)if(st=z.charCodeAt(ve),48>st||st>57){se=(st===46?i+z.slice(ve+1):z.slice(ve))+se,z=z.slice(0,ve);break}}}x&&!b&&(z=t(z,1/0));var lt=ae.length+z.length+se.length,tt=lt<v?new Array(v-lt+1).join(h):"";switch(x&&b&&(z=t(tt+z,tt.length?v-se.length:1/0),tt=""),d){case"<":z=ae+z+se+tt;break;case"=":z=ae+tt+z+se;break;case"^":z=tt.slice(0,lt=tt.length>>1)+ae+z+se+tt.slice(lt);break;default:z=tt+ae+z+se;break}return a(z)}return G.toString=function(){return f+""},G}function u(f,h){var d=l((f=bi(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(jo(h)/3)))*3,g=Math.pow(10,-p),b=Sv[8+p/3];return function(v){return d(g*v)+b}}return{format:l,formatPrefix:u}}var Vf,pt,Rp;uR({thousands:",",grouping:[3],currency:["$",""]});function uR(e){return Vf=lR(e),pt=Vf.format,Rp=Vf.formatPrefix,Vf}function _v(e){return Math.max(0,-jo(Math.abs(e)))}function Cv(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(jo(t)/3)))*3-jo(Math.abs(e)))}function kv(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,jo(t)-jo(e))+1}var Dp=new Date,Bp=new Date;function wt(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=function(a){return e(a=new Date(+a)),a},i.ceil=function(a){return e(a=new Date(a-1)),t(a,1),e(a),a},i.round=function(a){var o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=function(a,o){return t(a=new Date(+a),o==null?1:Math.floor(o)),a},i.range=function(a,o,s){var c=[],l;if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return c;do c.push(l=new Date(+a)),t(a,s),e(a);while(l<a&&a<o);return c},i.filter=function(a){return wt(function(o){if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},function(o,s){if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););})},n&&(i.count=function(a,o){return Dp.setTime(+a),Bp.setTime(+o),e(Dp),e(Bp),Math.floor(n(Dp,Bp))},i.every=function(a){return a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?function(o){return r(o)%a===0}:function(o){return i.count(0,o)%a===0}):i}),i}var jf=wt(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});jf.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?wt(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):jf};const Fp=jf;jf.range;const Pr=1e3,wn=Pr*60,Mr=wn*60,Aa=Mr*24,Pp=Aa*7,Tv=Aa*30,Mp=Aa*365;var Iv=wt(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*Pr)},function(e,t){return(t-e)/Pr},function(e){return e.getUTCSeconds()});const yi=Iv;Iv.range;var Rv=wt(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Pr)},function(e,t){e.setTime(+e+t*wn)},function(e,t){return(t-e)/wn},function(e){return e.getMinutes()});const Op=Rv;Rv.range;var Dv=wt(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Pr-e.getMinutes()*wn)},function(e,t){e.setTime(+e+t*Mr)},function(e,t){return(t-e)/Mr},function(e){return e.getHours()});const Lp=Dv;Dv.range;var Bv=wt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wn)/Aa,e=>e.getDate()-1);const Ea=Bv;Bv.range;function Sa(e){return wt(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*wn)/Pp})}var Fc=Sa(0),qf=Sa(1),fR=Sa(2),hR=Sa(3),qo=Sa(4),dR=Sa(5),pR=Sa(6);Fc.range,qf.range,fR.range,hR.range,qo.range,dR.range,pR.range;var Pc=wt(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});Pc.range;var Np=wt(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});Np.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:wt(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};const vi=Np;Np.range;var Fv=wt(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*wn)},function(e,t){return(t-e)/wn},function(e){return e.getUTCMinutes()});const zp=Fv;Fv.range;var Pv=wt(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Mr)},function(e,t){return(t-e)/Mr},function(e){return e.getUTCHours()});const Up=Pv;Pv.range;var Mv=wt(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Aa},function(e){return e.getUTCDate()-1});const _a=Mv;Mv.range;function Ca(e){return wt(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/Pp})}var Mc=Ca(0),Wf=Ca(1),gR=Ca(2),mR=Ca(3),Wo=Ca(4),bR=Ca(5),yR=Ca(6);Mc.range,Wf.range,gR.range,mR.range,Wo.range,bR.range,yR.range;var Oc=wt(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});Oc.range;var $p=wt(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});$p.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:wt(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};const wi=$p;$p.range;function Ov(e,t,n,r,i,a){const o=[[yi,1,Pr],[yi,5,5*Pr],[yi,15,15*Pr],[yi,30,30*Pr],[a,1,wn],[a,5,5*wn],[a,15,15*wn],[a,30,30*wn],[i,1,Mr],[i,3,3*Mr],[i,6,6*Mr],[i,12,12*Mr],[r,1,Aa],[r,2,2*Aa],[n,1,Pp],[t,1,Tv],[t,3,3*Tv],[e,1,Mp]];function s(l,u,f){const h=u<l;h&&([l,u]=[u,l]);const d=f&&typeof f.range=="function"?f:c(l,u,f),p=d?d.range(l,+u+1):[];return h?p.reverse():p}function c(l,u,f){const h=Math.abs(u-l)/f,d=zf(([,,b])=>b).right(o,h);if(d===o.length)return e.every(xa(l/Mp,u/Mp,f));if(d===0)return Fp.every(Math.max(xa(l,u,f),1));const[p,g]=o[h/o[d-1][2]<o[d][2]/h?d-1:d];return p.every(g)}return[s,c]}const[vR,wR]=Ov(wi,Oc,Mc,_a,Up,zp),[xR,AR]=Ov(vi,Pc,Fc,Ea,Lp,Op),Lc="year",Nc="quarter",zc="month",Uc="week",$c="date",Yf="day",Hp="dayofyear",Hc="hours",Gc="minutes",Vc="seconds",Zf="milliseconds";[Lc,Nc,zc,Uc,$c,Yf,Hp,Hc,Gc,Vc,Zf].reduce((e,t,n)=>(e[t]=1+n,e),{});const ER={[Lc]:vi,[Nc]:Pc.every(3),[zc]:Pc,[Uc]:Fc,[$c]:Ea,[Yf]:Ea,[Hp]:Ea,[Hc]:Lp,[Gc]:Op,[Vc]:yi,[Zf]:Fp},SR={[Lc]:wi,[Nc]:Oc.every(3),[zc]:Oc,[Uc]:Mc,[$c]:_a,[Yf]:_a,[Hp]:_a,[Hc]:Up,[Gc]:zp,[Vc]:yi,[Zf]:Fp};function _R(e){return ER[e]}function CR(e){return SR[e]}function Gp(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Vp(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function jc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Lv(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=qc(i),u=Wc(i),f=qc(a),h=Wc(a),d=qc(o),p=Wc(o),g=qc(s),b=Wc(s),v=qc(c),x=Wc(c),A={a:Ne,A:lt,b:tt,B:ut,c:null,d:Gv,e:Gv,f:ZR,g:a9,G:s9,H:qR,I:WR,j:YR,L:Vv,m:QR,M:XR,p:Te,q:Ie,Q:Qv,s:Xv,S:KR,u:JR,U:e9,V:t9,w:n9,W:r9,x:null,X:null,y:i9,Y:o9,Z:c9,"%":Zv},w={a:Rt,A:ln,b:Ve,B:L,c:null,d:qv,e:qv,f:h9,g:A9,G:S9,H:l9,I:u9,j:f9,L:Wv,m:d9,M:p9,p:O,q:W,Q:Qv,s:Xv,S:g9,u:m9,U:b9,V:y9,w:v9,W:w9,x:null,X:null,y:x9,Y:E9,Z:_9,"%":Zv},_={a:G,A:z,b:ae,B:se,c:ve,d:$v,e:$v,f:HR,g:Uv,G:zv,H:Hv,I:Hv,j:NR,L:$R,m:LR,M:zR,p:B,q:OR,Q:VR,s:jR,S:UR,u:DR,U:BR,V:FR,w:RR,W:PR,x:Pe,X:st,y:Uv,Y:zv,Z:MR,"%":GR};A.x=C(n,A),A.X=C(r,A),A.c=C(t,A),w.x=C(n,w),w.X=C(r,w),w.c=C(t,w);function C(j,Q){return function(T){var S=[],V=-1,Y=0,de=j.length,ie,pe,un;for(T instanceof Date||(T=new Date(+T));++V<de;)j.charCodeAt(V)===37&&(S.push(j.slice(Y,V)),(pe=Nv[ie=j.charAt(++V)])!=null?ie=j.charAt(++V):pe=ie==="e"?" ":"0",(un=Q[ie])&&(ie=un(T,pe)),S.push(ie),Y=V+1);return S.push(j.slice(Y,V)),S.join("")}}function I(j,Q){return function(T){var S=jc(1900,void 0,1),V=D(S,j,T+="",0),Y,de;if(V!=T.length)return null;if("Q"in S)return new Date(S.Q);if("s"in S)return new Date(S.s*1e3+("L"in S?S.L:0));if(Q&&!("Z"in S)&&(S.Z=0),"p"in S&&(S.H=S.H%12+S.p*12),S.m===void 0&&(S.m="q"in S?S.q:0),"V"in S){if(S.V<1||S.V>53)return null;"w"in S||(S.w=1),"Z"in S?(Y=Vp(jc(S.y,0,1)),de=Y.getUTCDay(),Y=de>4||de===0?Wf.ceil(Y):Wf(Y),Y=_a.offset(Y,(S.V-1)*7),S.y=Y.getUTCFullYear(),S.m=Y.getUTCMonth(),S.d=Y.getUTCDate()+(S.w+6)%7):(Y=Gp(jc(S.y,0,1)),de=Y.getDay(),Y=de>4||de===0?qf.ceil(Y):qf(Y),Y=Ea.offset(Y,(S.V-1)*7),S.y=Y.getFullYear(),S.m=Y.getMonth(),S.d=Y.getDate()+(S.w+6)%7)}else("W"in S||"U"in S)&&("w"in S||(S.w="u"in S?S.u%7:"W"in S?1:0),de="Z"in S?Vp(jc(S.y,0,1)).getUTCDay():Gp(jc(S.y,0,1)).getDay(),S.m=0,S.d="W"in S?(S.w+6)%7+S.W*7-(de+5)%7:S.w+S.U*7-(de+6)%7);return"Z"in S?(S.H+=S.Z/100|0,S.M+=S.Z%100,Vp(S)):Gp(S)}}function D(j,Q,T,S){for(var V=0,Y=Q.length,de=T.length,ie,pe;V<Y;){if(S>=de)return-1;if(ie=Q.charCodeAt(V++),ie===37){if(ie=Q.charAt(V++),pe=_[ie in Nv?Q.charAt(V++):ie],!pe||(S=pe(j,T,S))<0)return-1}else if(ie!=T.charCodeAt(S++))return-1}return S}function B(j,Q,T){var S=l.exec(Q.slice(T));return S?(j.p=u.get(S[0].toLowerCase()),T+S[0].length):-1}function G(j,Q,T){var S=d.exec(Q.slice(T));return S?(j.w=p.get(S[0].toLowerCase()),T+S[0].length):-1}function z(j,Q,T){var S=f.exec(Q.slice(T));return S?(j.w=h.get(S[0].toLowerCase()),T+S[0].length):-1}function ae(j,Q,T){var S=v.exec(Q.slice(T));return S?(j.m=x.get(S[0].toLowerCase()),T+S[0].length):-1}function se(j,Q,T){var S=g.exec(Q.slice(T));return S?(j.m=b.get(S[0].toLowerCase()),T+S[0].length):-1}function ve(j,Q,T){return D(j,t,Q,T)}function Pe(j,Q,T){return D(j,n,Q,T)}function st(j,Q,T){return D(j,r,Q,T)}function Ne(j){return o[j.getDay()]}function lt(j){return a[j.getDay()]}function tt(j){return c[j.getMonth()]}function ut(j){return s[j.getMonth()]}function Te(j){return i[+(j.getHours()>=12)]}function Ie(j){return 1+~~(j.getMonth()/3)}function Rt(j){return o[j.getUTCDay()]}function ln(j){return a[j.getUTCDay()]}function Ve(j){return c[j.getUTCMonth()]}function L(j){return s[j.getUTCMonth()]}function O(j){return i[+(j.getUTCHours()>=12)]}function W(j){return 1+~~(j.getUTCMonth()/3)}return{format:function(j){var Q=C(j+="",A);return Q.toString=function(){return j},Q},parse:function(j){var Q=I(j+="",!1);return Q.toString=function(){return j},Q},utcFormat:function(j){var Q=C(j+="",w);return Q.toString=function(){return j},Q},utcParse:function(j){var Q=I(j+="",!0);return Q.toString=function(){return j},Q}}}var Nv={"-":"",_:" ",0:"0"},xt=/^\s*\d+/,kR=/^%/,TR=/[\\^$*+?|[\]().{}]/g;function Ae(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function IR(e){return e.replace(TR,"\\$&")}function qc(e){return new RegExp("^(?:"+e.map(IR).join("|")+")","i")}function Wc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function RR(e,t,n){var r=xt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function DR(e,t,n){var r=xt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function BR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function FR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function PR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function zv(e,t,n){var r=xt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Uv(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function MR(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function OR(e,t,n){var r=xt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function LR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function $v(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function NR(e,t,n){var r=xt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Hv(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function zR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function UR(e,t,n){var r=xt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function $R(e,t,n){var r=xt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function HR(e,t,n){var r=xt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function GR(e,t,n){var r=kR.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function VR(e,t,n){var r=xt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function jR(e,t,n){var r=xt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Gv(e,t){return Ae(e.getDate(),t,2)}function qR(e,t){return Ae(e.getHours(),t,2)}function WR(e,t){return Ae(e.getHours()%12||12,t,2)}function YR(e,t){return Ae(1+Ea.count(vi(e),e),t,3)}function Vv(e,t){return Ae(e.getMilliseconds(),t,3)}function ZR(e,t){return Vv(e,t)+"000"}function QR(e,t){return Ae(e.getMonth()+1,t,2)}function XR(e,t){return Ae(e.getMinutes(),t,2)}function KR(e,t){return Ae(e.getSeconds(),t,2)}function JR(e){var t=e.getDay();return t===0?7:t}function e9(e,t){return Ae(Fc.count(vi(e)-1,e),t,2)}function jv(e){var t=e.getDay();return t>=4||t===0?qo(e):qo.ceil(e)}function t9(e,t){return e=jv(e),Ae(qo.count(vi(e),e)+(vi(e).getDay()===4),t,2)}function n9(e){return e.getDay()}function r9(e,t){return Ae(qf.count(vi(e)-1,e),t,2)}function i9(e,t){return Ae(e.getFullYear()%100,t,2)}function a9(e,t){return e=jv(e),Ae(e.getFullYear()%100,t,2)}function o9(e,t){return Ae(e.getFullYear()%1e4,t,4)}function s9(e,t){var n=e.getDay();return e=n>=4||n===0?qo(e):qo.ceil(e),Ae(e.getFullYear()%1e4,t,4)}function c9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ae(t/60|0,"0",2)+Ae(t%60,"0",2)}function qv(e,t){return Ae(e.getUTCDate(),t,2)}function l9(e,t){return Ae(e.getUTCHours(),t,2)}function u9(e,t){return Ae(e.getUTCHours()%12||12,t,2)}function f9(e,t){return Ae(1+_a.count(wi(e),e),t,3)}function Wv(e,t){return Ae(e.getUTCMilliseconds(),t,3)}function h9(e,t){return Wv(e,t)+"000"}function d9(e,t){return Ae(e.getUTCMonth()+1,t,2)}function p9(e,t){return Ae(e.getUTCMinutes(),t,2)}function g9(e,t){return Ae(e.getUTCSeconds(),t,2)}function m9(e){var t=e.getUTCDay();return t===0?7:t}function b9(e,t){return Ae(Mc.count(wi(e)-1,e),t,2)}function Yv(e){var t=e.getUTCDay();return t>=4||t===0?Wo(e):Wo.ceil(e)}function y9(e,t){return e=Yv(e),Ae(Wo.count(wi(e),e)+(wi(e).getUTCDay()===4),t,2)}function v9(e){return e.getUTCDay()}function w9(e,t){return Ae(Wf.count(wi(e)-1,e),t,2)}function x9(e,t){return Ae(e.getUTCFullYear()%100,t,2)}function A9(e,t){return e=Yv(e),Ae(e.getUTCFullYear()%100,t,2)}function E9(e,t){return Ae(e.getUTCFullYear()%1e4,t,4)}function S9(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Wo(e):Wo.ceil(e),Ae(e.getUTCFullYear()%1e4,t,4)}function _9(){return"+0000"}function Zv(){return"%"}function Qv(e){return+e}function Xv(e){return Math.floor(+e/1e3)}var Yo,jp,Kv,qp,Jv;C9({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function C9(e){return Yo=Lv(e),jp=Yo.format,Kv=Yo.parse,qp=Yo.utcFormat,Jv=Yo.utcParse,Yo}function Yc(e){const t={};return n=>t[n]||(t[n]=e(n))}function k9(e,t){return n=>{const r=e(n),i=r.indexOf(t);if(i<0)return r;let a=T9(r,i);const o=a<r.length?r.slice(a):"";for(;--a>i;)if(r[a]!=="0"){++a;break}return r.slice(0,a)+o}}function T9(e,t){let n=e.lastIndexOf("e"),r;if(n>0)return n;for(n=e.length;--n>t;)if(r=e.charCodeAt(n),r>=48&&r<=57)return n+1}function I9(e){const t=Yc(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(r){const i=bi(r||",");if(i.precision==null){switch(i.precision=12,i.type){case"%":i.precision-=2;break;case"e":i.precision-=1;break}return k9(t(i),t(".1f")(1)[1])}else return t(i)},formatSpan(r,i,a,o){o=bi(o??",f");const s=xa(r,i,a),c=Math.max(Math.abs(r),Math.abs(i));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=Cv(s,c))||(o.precision=l),n(o,c);case"":case"e":case"g":case"p":case"r":{isNaN(l=kv(s,c))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=_v(s))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}R9();function R9(){return I9({format:pt,formatPrefix:Rp})}function ew(e,t,n){n=n||{},Xt(n)||it("Invalid time multi-format specifier: ".concat(n));const r=t(Vc),i=t(Gc),a=t(Hc),o=t($c),s=t(Uc),c=t(zc),l=t(Nc),u=t(Lc),f=e(n[Zf]||".%L"),h=e(n[Vc]||":%S"),d=e(n[Gc]||"%I:%M"),p=e(n[Hc]||"%I %p"),g=e(n[$c]||n[Yf]||"%a %d"),b=e(n[Uc]||"%b %d"),v=e(n[zc]||"%B"),x=e(n[Nc]||"%B"),A=e(n[Lc]||"%Y");return w=>(r(w)<w?f:i(w)<w?h:a(w)<w?d:o(w)<w?p:c(w)<w?s(w)<w?g:b:u(w)<w?l(w)<w?v:x:A)(w)}function tw(e){const t=Yc(e.format),n=Yc(e.utcFormat);return{timeFormat:r=>Me(r)?t(r):ew(t,_R,r),utcFormat:r=>Me(r)?n(r):ew(n,CR,r),timeParse:Yc(e.parse),utcParse:Yc(e.utcParse)}}let Wp;D9();function D9(){return Wp=tw({format:jp,parse:Kv,utcFormat:qp,utcParse:Jv})}function B9(e){return tw(Lv(e))}function F9(e){return arguments.length?Wp=B9(e):Wp}const P9=/^(data:|([A-Za-z]+:)?\/\/)/,M9=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,O9=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,nw="file://";function L9(e,t){return n=>({options:n||{},sanitize:z9,load:N9,fileAccess:!!t,file:U9(t),http:H9(e)})}async function N9(e,t){const n=await this.sanitize(e,t),r=n.href;return n.localFile?this.file(r):this.http(r,t)}async function z9(e,t){t=vp({},this.options,t);const n=this.fileAccess,r={href:null};let i,a,o;const s=M9.test(e.replace(O9,""));(e==null||typeof e!="string"||!s)&&it("Sanitize failure, invalid URI: "+Lf(e));const c=P9.test(e);return(o=t.baseURL)&&!c&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),a=(i=e.startsWith(nw))||t.mode==="file"||t.mode!=="http"&&!c&&n,i?e=e.slice(nw.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),a=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(r,"localFile",{value:!!a}),r.href=e,t.target&&(r.target=t.target+""),t.rel&&(r.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+""),r}function U9(e){return e?t=>new Promise((n,r)=>{e.readFile(t,(i,a)=>{i?r(i):n(a)})}):$9}async function $9(){it("No file system access.")}function H9(e){return e?async function(t,n){const r=vp({},this.options.http,n),i=n&&n.response,a=await e(t,r);return a.ok?Kt(a[i])?a[i]():a.text():it(a.status+""+a.statusText)}:G9}async function G9(){it("No HTTP fetch method available.")}const V9=e=>e!=null&&e===e,j9=e=>e==="true"||e==="false"||e===!0||e===!1,q9=e=>!Number.isNaN(Date.parse(e)),rw=e=>!Number.isNaN(+e)&&!(e instanceof Date),W9=e=>rw(e)&&Number.isInteger(+e),iw={boolean:SI,integer:Cc,number:Cc,date:CI,string:kI,unknown:Ff},Qf=[j9,W9,rw,q9],Y9=["boolean","integer","number","date"];function aw(e,t){if(!e||!e.length)return"unknown";const n=e.length,r=Qf.length,i=Qf.map((a,o)=>o+1);for(let a=0,o=0,s,c;a<n;++a)for(c=t?e[a][t]:e[a],s=0;s<r;++s)if(i[s]&&V9(c)&&!Qf[s](c)&&(i[s]=0,++o,o===Qf.length))return"string";return Y9[i.reduce((a,o)=>a===0?o:a,0)-1]}function Z9(e,t){return t.reduce((n,r)=>(n[r]=aw(e,r),n),{})}function ow(e){const t=function(n,r){const i={delimiter:e};return Yp(n,r?vp(r,i):i)};return t.responseType="text",t}function Yp(e,t){return t.header&&(e=t.header.map(Lf).join(t.delimiter)+`
|
6
|
+
`+e),dv(t.delimiter).parse(e+"")}Yp.responseType="text";function Q9(e){return typeof Buffer=="function"&&Kt(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function Zp(e,t){const n=t&&t.property?Bf(t.property):Ff;return Xt(e)&&!Q9(e)?X9(n(e),t):n(JSON.parse(e))}Zp.responseType="json";function X9(e,t){return!Qt(e)&&AI(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const K9={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function sw(e,t){let n,r,i,a;return e=Zp(e,t),t&&t.feature?(n=OI,i=t.feature):t&&t.mesh?(n=NI,i=t.mesh,a=K9[t.filter]):it("Missing TopoJSON feature or mesh parameter."),r=(r=e.objects[i])?n(e,r,a):it("Invalid TopoJSON object: "+i),r&&r.features||[r]}sw.responseType="json";const Qp={dsv:Yp,csv:ow(","),tsv:ow(" "),json:Zp,topojson:sw};function cw(e,t){return arguments.length>1?(Qp[e]=t,this):va(Qp,e)?Qp[e]:null}function lw(e,t,n,r){t=t||{};const i=cw(t.type||"json");return i||it("Unknown data format type: "+t.type),e=i(e,t),t.parse&&J9(e,t.parse,n,r),va(e,"columns")&&delete e.columns,e}function J9(e,t,n,r){if(!e.length)return;const i=F9();n=n||i.timeParse,r=r||i.utcParse;let a=e.columns||Object.keys(e[0]),o,s,c,l,u,f;t==="auto"&&(t=Z9(e,a)),a=Object.keys(t);const h=a.map(d=>{const p=t[d];let g,b;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),b=g[1],(b[0]==="'"&&b[b.length-1]==="'"||b[0]==='"'&&b[b.length-1]==='"')&&(b=b.slice(1,-1)),(g[0]==="utc"?r:n)(b);if(!iw[p])throw Error("Illegal format pattern: "+d+":"+p);return iw[p]});for(c=0,u=e.length,f=a.length;c<u;++c)for(o=e[c],l=0;l<f;++l)s=a[l],o[s]=h[l](o[s])}const Zc=L9(typeof fetch<"u"&&fetch,null);/**
|
7
7
|
* @license
|
8
8
|
* Copyright 2017 Google LLC
|
9
9
|
* SPDX-License-Identifier: BSD-3-Clause
|
10
|
-
*/const Qc=globalThis,Xf=Qc.trustedTypes,uw=Xf?Xf.createPolicy("lit-html",{createHTML:e=>e}):void 0,Xp="$lit$",
|
11
|
-
\f\r]`,Jc=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dw=/-->/g,pw=/>/g,
|
12
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),gw=/'/g,mw=/"/g,bw=/^(?:script|style|textarea|title)$/i,tD=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),$=tD(1),Dt=Symbol.for("lit-noChange"),ue=Symbol.for("lit-nothing"),yw=new WeakMap,
|
10
|
+
*/const Qc=globalThis,Xf=Qc.trustedTypes,uw=Xf?Xf.createPolicy("lit-html",{createHTML:e=>e}):void 0,Xp="$lit$",Or=`lit$${(Math.random()+"").slice(9)}$`,Kp="?"+Or,eD=`<${Kp}>`,ka=document,Xc=()=>ka.createComment(""),Kc=e=>e===null||typeof e!="object"&&typeof e!="function",fw=Array.isArray,hw=e=>fw(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Jp=`[
|
11
|
+
\f\r]`,Jc=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dw=/-->/g,pw=/>/g,Ta=RegExp(`>|${Jp}(?:([^\\s"'>=/]+)(${Jp}*=${Jp}*(?:[^
|
12
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),gw=/'/g,mw=/"/g,bw=/^(?:script|style|textarea|title)$/i,tD=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),$=tD(1),Dt=Symbol.for("lit-noChange"),ue=Symbol.for("lit-nothing"),yw=new WeakMap,Ia=ka.createTreeWalker(ka,129);function vw(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return uw!==void 0?uw.createHTML(t):t}const ww=(e,t)=>{const n=e.length-1,r=[];let i,a=t===2?"<svg>":"",o=Jc;for(let s=0;s<n;s++){const c=e[s];let l,u,f=-1,h=0;for(;h<c.length&&(o.lastIndex=h,u=o.exec(c),u!==null);)h=o.lastIndex,o===Jc?u[1]==="!--"?o=dw:u[1]!==void 0?o=pw:u[2]!==void 0?(bw.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=Ta):u[3]!==void 0&&(o=Ta):o===Ta?u[0]===">"?(o=i??Jc,f=-1):u[1]===void 0?f=-2:(f=o.lastIndex-u[2].length,l=u[1],o=u[3]===void 0?Ta:u[3]==='"'?mw:gw):o===mw||o===gw?o=Ta:o===dw||o===pw?o=Jc:(o=Ta,i=void 0);const d=o===Ta&&e[s+1].startsWith("/>")?" ":"";a+=o===Jc?c+eD:f>=0?(r.push(l),c.slice(0,f)+Xp+c.slice(f)+Or+d):c+Or+(f===-2?s:d)}return[vw(e,a+(e[n]||"<?>")+(t===2?"</svg>":"")),r]};class el{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0;const s=t.length-1,c=this.parts,[l,u]=ww(t,n);if(this.el=el.createElement(l,r),Ia.currentNode=this.el.content,n===2){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=Ia.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(const f of i.getAttributeNames())if(f.endsWith(Xp)){const h=u[o++],d=i.getAttribute(f).split(Or),p=/([.?@])?(.*)/.exec(h);c.push({type:1,index:a,name:p[2],strings:d,ctor:p[1]==="."?Aw:p[1]==="?"?Ew:p[1]==="@"?Sw:tl}),i.removeAttribute(f)}else f.startsWith(Or)&&(c.push({type:6,index:a}),i.removeAttribute(f));if(bw.test(i.tagName)){const f=i.textContent.split(Or),h=f.length-1;if(h>0){i.textContent=Xf?Xf.emptyScript:"";for(let d=0;d<h;d++)i.append(f[d],Xc()),Ia.nextNode(),c.push({type:2,index:++a});i.append(f[h],Xc())}}}else if(i.nodeType===8)if(i.data===Kp)c.push({type:2,index:a});else{let f=-1;for(;(f=i.data.indexOf(Or,f+1))!==-1;)c.push({type:7,index:a}),f+=Or.length-1}a++}}static createElement(t,n){const r=ka.createElement("template");return r.innerHTML=t,r}}function Ra(e,t,n=e,r){var o,s;if(t===Dt)return t;let i=r!==void 0?(o=n._$Co)==null?void 0:o[r]:n._$Cl;const a=Kc(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==a&&((s=i==null?void 0:i._$AO)==null||s.call(i,!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r!==void 0?(n._$Co??(n._$Co=[]))[r]=i:n._$Cl=i),i!==void 0&&(t=Ra(e,i._$AS(e,t.values),i,r)),t}let xw=class{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:r}=this._$AD,i=((t==null?void 0:t.creationScope)??ka).importNode(n,!0);Ia.currentNode=i;let a=Ia.nextNode(),o=0,s=0,c=r[0];for(;c!==void 0;){if(o===c.index){let l;c.type===2?l=new Kf(a,a.nextSibling,this,t):c.type===1?l=new c.ctor(a,c.name,c.strings,this,t):c.type===6&&(l=new _w(a,this,t)),this._$AV.push(l),c=r[++s]}o!==(c==null?void 0:c.index)&&(a=Ia.nextNode(),o++)}return Ia.currentNode=ka,i}p(t){let n=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,n),n+=r.strings.length-2):r._$AI(t[n])),n++}},Kf=class LT{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,n,r,i){this.type=2,this._$AH=ue,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=Ra(this,t,n),Kc(t)?t===ue||t==null||t===""?(this._$AH!==ue&&this._$AR(),this._$AH=ue):t!==this._$AH&&t!==Dt&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):hw(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==ue&&Kc(this._$AH)?this._$AA.nextSibling.data=t:this.$(ka.createTextNode(t)),this._$AH=t}g(t){var a;const{values:n,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=el.createElement(vw(r.h,r.h[0]),this.options)),r);if(((a=this._$AH)==null?void 0:a._$AD)===i)this._$AH.p(n);else{const o=new xw(i,this),s=o.u(this.options);o.p(n),this.$(s),this._$AH=o}}_$AC(t){let n=yw.get(t.strings);return n===void 0&&yw.set(t.strings,n=new el(t)),n}T(t){fw(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let r,i=0;for(const a of t)i===n.length?n.push(r=new LT(this.k(Xc()),this.k(Xc()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(t=this._$AA.nextSibling,n){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,n);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var n;this._$AM===void 0&&(this._$Cv=t,(n=this._$AP)==null||n.call(this,t))}},tl=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,r,i,a){this.type=1,this._$AH=ue,this._$AN=void 0,this.element=t,this.name=n,this._$AM=i,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ue}_$AI(t,n=this,r,i){const a=this.strings;let o=!1;if(a===void 0)t=Ra(this,t,n,0),o=!Kc(t)||t!==this._$AH&&t!==Dt,o&&(this._$AH=t);else{const s=t;let c,l;for(t=a[0],c=0;c<a.length-1;c++)l=Ra(this,s[r+c],n,c),l===Dt&&(l=this._$AH[c]),o||(o=!Kc(l)||l!==this._$AH[c]),l===ue?t=ue:t!==ue&&(t+=(l??"")+a[c+1]),this._$AH[c]=l}o&&!i&&this.O(t)}O(t){t===ue?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}};class Aw extends tl{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===ue?void 0:t}}let Ew=class extends tl{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==ue)}},Sw=class extends tl{constructor(t,n,r,i,a){super(t,n,r,i,a),this.type=5}_$AI(t,n=this){if((t=Ra(this,t,n,0)??ue)===Dt)return;const r=this._$AH,i=t===ue&&r!==ue||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,a=t!==ue&&(r===ue||i);i&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var n;typeof this._$AH=="function"?this._$AH.call(((n=this.options)==null?void 0:n.host)??this.element,t):this._$AH.handleEvent(t)}},_w=class{constructor(t,n,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){Ra(this,t)}};const nD={j:Xp,P:Or,A:Kp,C:1,M:ww,L:xw,R:hw,V:Ra,D:Kf,I:tl,H:Ew,N:Sw,U:Aw,B:_w},eg=Qc.litHtmlPolyfillSupport;eg==null||eg(el,Kf),(Qc.litHtmlVersions??(Qc.litHtmlVersions=[])).push("3.1.0");const Vt=(e,t,n)=>{const r=(n==null?void 0:n.renderBefore)??t;let i=r._$litPart$;if(i===void 0){const a=(n==null?void 0:n.renderBefore)??null;r._$litPart$=i=new Kf(t.insertBefore(Xc(),a),a,void 0,n??{})}return i._$AI(e),i};/**
|
13
13
|
* @license
|
14
14
|
* Copyright 2017 Google LLC
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
16
|
-
*/const sr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},
|
16
|
+
*/const sr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Da=e=>(...t)=>({_$litDirective$:e,values:t});let Zo=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,n,r){this._$Ct=t,this._$AM=n,this._$Ci=r}_$AS(t,n){return this.update(t,n)}update(t,n){return this.render(...n)}};/**
|
17
17
|
* @license
|
18
18
|
* Copyright 2018 Google LLC
|
19
19
|
* SPDX-License-Identifier: BSD-3-Clause
|
20
|
-
*/const Cw="important",rD=" !"+Cw,Jf=
|
20
|
+
*/const Cw="important",rD=" !"+Cw,Jf=Da(class extends Zo{constructor(e){var t;if(super(e),e.type!==sr.ATTRIBUTE||e.name!=="style"||((t=e.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r==null?t:t+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(e,[t]){const{style:n}=e.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(t)),this.render(t);for(const r of this.ut)t[r]==null&&(this.ut.delete(r),r.includes("-")?n.removeProperty(r):n[r]=null);for(const r in t){const i=t[r];if(i!=null){this.ut.add(r);const a=typeof i=="string"&&i.endsWith(rD);r.includes("-")||a?n.setProperty(r,a?i.slice(0,-11):i,a?Cw:""):n[r]=i}}return Dt}}),iD="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e.spinner_ajPY{transform-origin:center;animation:spinner_AtaB%20.75s%20infinite%20linear}@keyframes%20spinner_AtaB{100%25{transform:rotate(360deg)}}%3c/style%3e%3cpath%20d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z'%20opacity='.25'/%3e%3cpath%20d='M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z'%20class='spinner_ajPY'/%3e%3c/svg%3e",aD=`.genome-spy {
|
21
21
|
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
22
22
|
position: relative;
|
23
23
|
}
|
@@ -157,11 +157,11 @@
|
|
157
157
|
border: 1px solid red;
|
158
158
|
padding: 10px;
|
159
159
|
background: #fff0f0;
|
160
|
-
}`;function kw(e,t){var n=e.getBoundingClientRect();return[t.clientX-n.left-e.clientLeft,t.clientY-n.top-e.clientTop]}function eh(e,t){return e.length==t.length&&e.every((n,r)=>e[r]===t[r])}function Lt(e){return Array.isArray(e)?e:typeof e<"u"?[e]:[]}function xn(e){return e[e.length-1]}const Da="gs-suppress-tooltip";class oD{constructor(t){this.container=t,this.element=document.createElement("div"),this.element.className="tooltip",this._visible=!0,this.container.appendChild(this.element),this._previousTooltipDatum=void 0,this.enabledStack=[!0],this._penaltyUntil=0,this._lastCoords=void 0,this._previousMove=0,this.clear()}set visible(t){t!=this._visible&&(this.element.style.display=t?null:"none",this._visible=t)}get visible(){return this._visible}get enabled(){return xn(this.enabledStack)??!0}pushEnabledState(t){this.enabledStack.push(t),t||(this.visible=!1)}popEnabledState(){this.enabledStack.pop()}handleMouseMove(t){this.mouseCoords=kw(this.container,t);const n=performance.now();!this.visible&&!this._isPenalty()&&n-this._previousMove>500&&(this._penaltyUntil=n+70),this._lastCoords&&sD(this.mouseCoords,this._lastCoords)>20&&(this._penaltyUntil=n+400),this._lastCoords=this.mouseCoords,this.visible&&this.updatePlacement(),this._previousMove=n}updatePlacement(){const[n,r]=this.mouseCoords;let i=n+20;i>this.container.clientWidth-this.element.offsetWidth&&(i=n-20-this.element.offsetWidth),this.element.style.left=i+"px",this.element.style.top=Math.min(r+20,this.container.clientHeight-this.element.offsetHeight)+"px"}setContent(t){if(!t||!this.enabled||this._isPenalty()){this.visible&&(Vt("",this.element),this.visible=!1),this._previousTooltipDatum=void 0;return}Vt(t,this.element),this.visible=!0,this.updatePlacement()}clear(){this._previousTooltipDatum=void 0,this.setContent(void 0)}updateWithDatum(t,n){t!==this._previousTooltipDatum&&(this._previousTooltipDatum=t,n||(n=r=>Promise.resolve($` ${JSON.stringify(r)} `)),n(t).then(r=>this.setContent(r)).catch(r=>{if(r!=="debounced")throw r}))}_isPenalty(){return this._penaltyUntil&&this._penaltyUntil>performance.now()}}function sD(e,t){let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t[r])**2;return Math.sqrt(n)}const cD="RawCode",lD="Literal",uD="Property",fD="Identifier",hD="ArrayExpression",dD="BinaryExpression",pD="CallExpression",gD="ConditionalExpression",mD="LogicalExpression",bD="MemberExpression",yD="ObjectExpression",vD="UnaryExpression";function Un(e){this.type=e}Un.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=wD(this),n=0,r=t.length;n<r;++n)if(t[n].visit(e))return 1};function wD(e){switch(e.type){case hD:return e.elements;case dD:case mD:return[e.left,e.right];case pD:return[e.callee].concat(e.arguments);case gD:return[e.test,e.consequent,e.alternate];case bD:return[e.object,e.property];case yD:return e.properties;case uD:return[e.key,e.value];case vD:return[e.argument];case fD:case lD:case cD:default:return[]}}var cr,ne,H,Nt,Be,th=1,nl=2,Ba=3,xi=4,nh=5,Fa=6,en=7,rl=8,xD=9;cr={},cr[th]="Boolean",cr[nl]="<end>",cr[Ba]="Identifier",cr[xi]="Keyword",cr[nh]="Null",cr[Fa]="Numeric",cr[en]="Punctuator",cr[rl]="String",cr[xD]="RegularExpression";var AD="ArrayExpression",ED="BinaryExpression",SD="CallExpression",_D="ConditionalExpression",Tw="Identifier",CD="Literal",kD="LogicalExpression",TD="MemberExpression",ID="ObjectExpression",RD="Property",DD="UnaryExpression",At="Unexpected token %0",BD="Unexpected number",FD="Unexpected string",PD="Unexpected identifier",MD="Unexpected reserved word",OD="Unexpected end of input",tg="Invalid regular expression",ng="Invalid regular expression: missing /",Iw="Octal literals are not allowed in strict mode.",LD="Duplicate data property in object literal not allowed in strict mode",Bt="ILLEGAL",il="Disabled.",ND=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),zD=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function rh(e,t){if(!e)throw new Error("ASSERT: "+t)}function Nr(e){return e>=48&&e<=57}function rg(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function al(e){return"01234567".indexOf(e)>=0}function UD(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function ol(e){return e===10||e===13||e===8232||e===8233}function sl(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&ND.test(String.fromCharCode(e))}function ih(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&zD.test(String.fromCharCode(e))}const $D={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function Rw(){for(;H<Nt;){const e=ne.charCodeAt(H);if(UD(e)||ol(e))++H;else break}}function ig(e){var t,n,r,i=0;for(n=e==="u"?4:2,t=0;t<n;++t)H<Nt&&rg(ne[H])?(r=ne[H++],i=i*16+"0123456789abcdef".indexOf(r.toLowerCase())):Ee({},At,Bt);return String.fromCharCode(i)}function HD(){var e,t,n,r;for(e=ne[H],t=0,e==="}"&&Ee({},At,Bt);H<Nt&&(e=ne[H++],!!rg(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Ee({},At,Bt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function Dw(){var e,t;for(e=ne.charCodeAt(H++),t=String.fromCharCode(e),e===92&&(ne.charCodeAt(H)!==117&&Ee({},At,Bt),++H,e=ig("u"),(!e||e==="\\"||!sl(e.charCodeAt(0)))&&Ee({},At,Bt),t=e);H<Nt&&(e=ne.charCodeAt(H),!!ih(e));)++H,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),ne.charCodeAt(H)!==117&&Ee({},At,Bt),++H,e=ig("u"),(!e||e==="\\"||!ih(e.charCodeAt(0)))&&Ee({},At,Bt),t+=e);return t}function GD(){var e,t;for(e=H++;H<Nt;){if(t=ne.charCodeAt(H),t===92)return H=e,Dw();if(ih(t))++H;else break}return ne.slice(e,H)}function VD(){var e,t,n;return e=H,t=ne.charCodeAt(H)===92?Dw():GD(),t.length===1?n=Ba:$D.hasOwnProperty(t)?n=xi:t==="null"?n=nh:t==="true"||t==="false"?n=th:n=Ba,{type:n,value:t,start:e,end:H}}function ag(){var e=H,t=ne.charCodeAt(H),n,r=ne[H],i,a,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++H,{type:en,value:String.fromCharCode(t),start:e,end:H};default:if(n=ne.charCodeAt(H+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return H+=2,{type:en,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:H};case 33:case 61:return H+=2,ne.charCodeAt(H)===61&&++H,{type:en,value:ne.slice(e,H),start:e,end:H}}}if(o=ne.substr(H,4),o===">>>=")return H+=4,{type:en,value:o,start:e,end:H};if(a=o.substr(0,3),a===">>>"||a==="<<="||a===">>=")return H+=3,{type:en,value:a,start:e,end:H};if(i=a.substr(0,2),r===i[1]&&"+-<>&|".indexOf(r)>=0||i==="=>")return H+=2,{type:en,value:i,start:e,end:H};if(i==="//"&&Ee({},At,Bt),"<>=!+-*%&|^/".indexOf(r)>=0)return++H,{type:en,value:r,start:e,end:H};Ee({},At,Bt)}function jD(e){let t="";for(;H<Nt&&rg(ne[H]);)t+=ne[H++];return t.length===0&&Ee({},At,Bt),sl(ne.charCodeAt(H))&&Ee({},At,Bt),{type:Fa,value:parseInt("0x"+t,16),start:e,end:H}}function qD(e){let t="0"+ne[H++];for(;H<Nt&&al(ne[H]);)t+=ne[H++];return(sl(ne.charCodeAt(H))||Nr(ne.charCodeAt(H)))&&Ee({},At,Bt),{type:Fa,value:parseInt(t,8),octal:!0,start:e,end:H}}function Bw(){var e,t,n;if(n=ne[H],rh(Nr(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=H,e="",n!=="."){if(e=ne[H++],n=ne[H],e==="0"){if(n==="x"||n==="X")return++H,jD(t);if(al(n))return qD(t);n&&Nr(n.charCodeAt(0))&&Ee({},At,Bt)}for(;Nr(ne.charCodeAt(H));)e+=ne[H++];n=ne[H]}if(n==="."){for(e+=ne[H++];Nr(ne.charCodeAt(H));)e+=ne[H++];n=ne[H]}if(n==="e"||n==="E")if(e+=ne[H++],n=ne[H],(n==="+"||n==="-")&&(e+=ne[H++]),Nr(ne.charCodeAt(H)))for(;Nr(ne.charCodeAt(H));)e+=ne[H++];else Ee({},At,Bt);return sl(ne.charCodeAt(H))&&Ee({},At,Bt),{type:Fa,value:parseFloat(e),start:t,end:H}}function WD(){var e="",t,n,r,i,a=!1;for(t=ne[H],rh(t==="'"||t==='"',"String literal must starts with a quote"),n=H,++H;H<Nt;)if(r=ne[H++],r===t){t="";break}else if(r==="\\")if(r=ne[H++],!r||!ol(r.charCodeAt(0)))switch(r){case"u":case"x":ne[H]==="{"?(++H,e+=HD()):e+=ig(r);break;case"n":e+=`
|
160
|
+
}`;function kw(e,t){var n=e.getBoundingClientRect();return[t.clientX-n.left-e.clientLeft,t.clientY-n.top-e.clientTop]}function eh(e,t){return e.length==t.length&&e.every((n,r)=>e[r]===t[r])}function Lt(e){return Array.isArray(e)?e:typeof e<"u"?[e]:[]}function xn(e){return e[e.length-1]}const Ba="gs-suppress-tooltip";class oD{constructor(t){this.container=t,this.element=document.createElement("div"),this.element.className="tooltip",this._visible=!0,this.container.appendChild(this.element),this._previousTooltipDatum=void 0,this.enabledStack=[!0],this._penaltyUntil=0,this._lastCoords=void 0,this._previousMove=0,this.clear()}set visible(t){t!=this._visible&&(this.element.style.display=t?null:"none",this._visible=t)}get visible(){return this._visible}get enabled(){return xn(this.enabledStack)??!0}pushEnabledState(t){this.enabledStack.push(t),t||(this.visible=!1)}popEnabledState(){this.enabledStack.pop()}handleMouseMove(t){this.mouseCoords=kw(this.container,t);const n=performance.now();!this.visible&&!this._isPenalty()&&n-this._previousMove>500&&(this._penaltyUntil=n+70),this._lastCoords&&sD(this.mouseCoords,this._lastCoords)>20&&(this._penaltyUntil=n+400),this._lastCoords=this.mouseCoords,this.visible&&this.updatePlacement(),this._previousMove=n}updatePlacement(){const[n,r]=this.mouseCoords;let i=n+20;i>this.container.clientWidth-this.element.offsetWidth&&(i=n-20-this.element.offsetWidth),this.element.style.left=i+"px",this.element.style.top=Math.min(r+20,this.container.clientHeight-this.element.offsetHeight)+"px"}setContent(t){if(!t||!this.enabled||this._isPenalty()){this.visible&&(Vt("",this.element),this.visible=!1),this._previousTooltipDatum=void 0;return}Vt(t,this.element),this.visible=!0,this.updatePlacement()}clear(){this._previousTooltipDatum=void 0,this.setContent(void 0)}updateWithDatum(t,n){t!==this._previousTooltipDatum&&(this._previousTooltipDatum=t,n||(n=r=>Promise.resolve($` ${JSON.stringify(r)} `)),n(t).then(r=>this.setContent(r)).catch(r=>{if(r!=="debounced")throw r}))}_isPenalty(){return this._penaltyUntil&&this._penaltyUntil>performance.now()}}function sD(e,t){let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t[r])**2;return Math.sqrt(n)}const cD="RawCode",lD="Literal",uD="Property",fD="Identifier",hD="ArrayExpression",dD="BinaryExpression",pD="CallExpression",gD="ConditionalExpression",mD="LogicalExpression",bD="MemberExpression",yD="ObjectExpression",vD="UnaryExpression";function Un(e){this.type=e}Un.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=wD(this),n=0,r=t.length;n<r;++n)if(t[n].visit(e))return 1};function wD(e){switch(e.type){case hD:return e.elements;case dD:case mD:return[e.left,e.right];case pD:return[e.callee].concat(e.arguments);case gD:return[e.test,e.consequent,e.alternate];case bD:return[e.object,e.property];case yD:return e.properties;case uD:return[e.key,e.value];case vD:return[e.argument];case fD:case lD:case cD:default:return[]}}var cr,ne,H,Nt,Be,th=1,nl=2,Fa=3,xi=4,nh=5,Pa=6,en=7,rl=8,xD=9;cr={},cr[th]="Boolean",cr[nl]="<end>",cr[Fa]="Identifier",cr[xi]="Keyword",cr[nh]="Null",cr[Pa]="Numeric",cr[en]="Punctuator",cr[rl]="String",cr[xD]="RegularExpression";var AD="ArrayExpression",ED="BinaryExpression",SD="CallExpression",_D="ConditionalExpression",Tw="Identifier",CD="Literal",kD="LogicalExpression",TD="MemberExpression",ID="ObjectExpression",RD="Property",DD="UnaryExpression",At="Unexpected token %0",BD="Unexpected number",FD="Unexpected string",PD="Unexpected identifier",MD="Unexpected reserved word",OD="Unexpected end of input",tg="Invalid regular expression",ng="Invalid regular expression: missing /",Iw="Octal literals are not allowed in strict mode.",LD="Duplicate data property in object literal not allowed in strict mode",Bt="ILLEGAL",il="Disabled.",ND=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),zD=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function rh(e,t){if(!e)throw new Error("ASSERT: "+t)}function Lr(e){return e>=48&&e<=57}function rg(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function al(e){return"01234567".indexOf(e)>=0}function UD(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function ol(e){return e===10||e===13||e===8232||e===8233}function sl(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&ND.test(String.fromCharCode(e))}function ih(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&zD.test(String.fromCharCode(e))}const $D={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function Rw(){for(;H<Nt;){const e=ne.charCodeAt(H);if(UD(e)||ol(e))++H;else break}}function ig(e){var t,n,r,i=0;for(n=e==="u"?4:2,t=0;t<n;++t)H<Nt&&rg(ne[H])?(r=ne[H++],i=i*16+"0123456789abcdef".indexOf(r.toLowerCase())):Ee({},At,Bt);return String.fromCharCode(i)}function HD(){var e,t,n,r;for(e=ne[H],t=0,e==="}"&&Ee({},At,Bt);H<Nt&&(e=ne[H++],!!rg(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&Ee({},At,Bt),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,r=(t-65536&1023)+56320,String.fromCharCode(n,r))}function Dw(){var e,t;for(e=ne.charCodeAt(H++),t=String.fromCharCode(e),e===92&&(ne.charCodeAt(H)!==117&&Ee({},At,Bt),++H,e=ig("u"),(!e||e==="\\"||!sl(e.charCodeAt(0)))&&Ee({},At,Bt),t=e);H<Nt&&(e=ne.charCodeAt(H),!!ih(e));)++H,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),ne.charCodeAt(H)!==117&&Ee({},At,Bt),++H,e=ig("u"),(!e||e==="\\"||!ih(e.charCodeAt(0)))&&Ee({},At,Bt),t+=e);return t}function GD(){var e,t;for(e=H++;H<Nt;){if(t=ne.charCodeAt(H),t===92)return H=e,Dw();if(ih(t))++H;else break}return ne.slice(e,H)}function VD(){var e,t,n;return e=H,t=ne.charCodeAt(H)===92?Dw():GD(),t.length===1?n=Fa:$D.hasOwnProperty(t)?n=xi:t==="null"?n=nh:t==="true"||t==="false"?n=th:n=Fa,{type:n,value:t,start:e,end:H}}function ag(){var e=H,t=ne.charCodeAt(H),n,r=ne[H],i,a,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++H,{type:en,value:String.fromCharCode(t),start:e,end:H};default:if(n=ne.charCodeAt(H+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return H+=2,{type:en,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:H};case 33:case 61:return H+=2,ne.charCodeAt(H)===61&&++H,{type:en,value:ne.slice(e,H),start:e,end:H}}}if(o=ne.substr(H,4),o===">>>=")return H+=4,{type:en,value:o,start:e,end:H};if(a=o.substr(0,3),a===">>>"||a==="<<="||a===">>=")return H+=3,{type:en,value:a,start:e,end:H};if(i=a.substr(0,2),r===i[1]&&"+-<>&|".indexOf(r)>=0||i==="=>")return H+=2,{type:en,value:i,start:e,end:H};if(i==="//"&&Ee({},At,Bt),"<>=!+-*%&|^/".indexOf(r)>=0)return++H,{type:en,value:r,start:e,end:H};Ee({},At,Bt)}function jD(e){let t="";for(;H<Nt&&rg(ne[H]);)t+=ne[H++];return t.length===0&&Ee({},At,Bt),sl(ne.charCodeAt(H))&&Ee({},At,Bt),{type:Pa,value:parseInt("0x"+t,16),start:e,end:H}}function qD(e){let t="0"+ne[H++];for(;H<Nt&&al(ne[H]);)t+=ne[H++];return(sl(ne.charCodeAt(H))||Lr(ne.charCodeAt(H)))&&Ee({},At,Bt),{type:Pa,value:parseInt(t,8),octal:!0,start:e,end:H}}function Bw(){var e,t,n;if(n=ne[H],rh(Lr(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=H,e="",n!=="."){if(e=ne[H++],n=ne[H],e==="0"){if(n==="x"||n==="X")return++H,jD(t);if(al(n))return qD(t);n&&Lr(n.charCodeAt(0))&&Ee({},At,Bt)}for(;Lr(ne.charCodeAt(H));)e+=ne[H++];n=ne[H]}if(n==="."){for(e+=ne[H++];Lr(ne.charCodeAt(H));)e+=ne[H++];n=ne[H]}if(n==="e"||n==="E")if(e+=ne[H++],n=ne[H],(n==="+"||n==="-")&&(e+=ne[H++]),Lr(ne.charCodeAt(H)))for(;Lr(ne.charCodeAt(H));)e+=ne[H++];else Ee({},At,Bt);return sl(ne.charCodeAt(H))&&Ee({},At,Bt),{type:Pa,value:parseFloat(e),start:t,end:H}}function WD(){var e="",t,n,r,i,a=!1;for(t=ne[H],rh(t==="'"||t==='"',"String literal must starts with a quote"),n=H,++H;H<Nt;)if(r=ne[H++],r===t){t="";break}else if(r==="\\")if(r=ne[H++],!r||!ol(r.charCodeAt(0)))switch(r){case"u":case"x":ne[H]==="{"?(++H,e+=HD()):e+=ig(r);break;case"n":e+=`
|
161
161
|
`;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:al(r)?(i="01234567".indexOf(r),i!==0&&(a=!0),H<Nt&&al(ne[H])&&(a=!0,i=i*8+"01234567".indexOf(ne[H++]),"0123".indexOf(r)>=0&&H<Nt&&al(ne[H])&&(i=i*8+"01234567".indexOf(ne[H++]))),e+=String.fromCharCode(i)):e+=r;break}else r==="\r"&&ne[H]===`
|
162
|
-
`&&++H;else{if(ol(r.charCodeAt(0)))break;e+=r}return t!==""&&Ee({},At,Bt),{type:rl,value:e,octal:a,start:n,end:H}}function YD(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(r,i)=>{if(parseInt(i,16)<=1114111)return"x";Ee({},tg)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Ee({},tg)}try{return new RegExp(e,t)}catch{return null}}function ZD(){var e,t,n,r,i;for(e=ne[H],rh(e==="/","Regular expression literal must start with a slash"),t=ne[H++],n=!1,r=!1;H<Nt;)if(e=ne[H++],t+=e,e==="\\")e=ne[H++],ol(e.charCodeAt(0))&&Ee({},ng),t+=e;else if(ol(e.charCodeAt(0)))Ee({},ng);else if(n)e==="]"&&(n=!1);else if(e==="/"){r=!0;break}else e==="["&&(n=!0);return r||Ee({},ng),i=t.substr(1,t.length-2),{value:i,literal:t}}function QD(){var e,t,n;for(t="",n="";H<Nt&&(e=ne[H],!!ih(e.charCodeAt(0)));)++H,e==="\\"&&H<Nt?Ee({},At,Bt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ee({},tg,n),{value:n,literal:t}}function XD(){var e,t,n,r;return Be=null,Rw(),e=H,t=ZD(),n=QD(),r=YD(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:H}}function KD(e){return e.type===Ba||e.type===xi||e.type===th||e.type===nh}function Fw(){if(Rw(),H>=Nt)return{type:nl,start:H,end:H};const e=ne.charCodeAt(H);return sl(e)?VD():e===40||e===41||e===59?ag():e===39||e===34?WD():e===46?Nr(ne.charCodeAt(H+1))?Bw():ag():Nr(e)?Bw():ag()}function tn(){const e=Be;return H=e.end,Be=Fw(),H=e.end,e}function Pw(){const e=H;Be=Fw(),H=e}function JD(e){const t=new Un(AD);return t.elements=e,t}function Mw(e,t,n){const r=new Un(e==="||"||e==="&&"?kD:ED);return r.operator=e,r.left=t,r.right=n,r}function e7(e,t){const n=new Un(SD);return n.callee=e,n.arguments=t,n}function t7(e,t,n){const r=new Un(_D);return r.test=e,r.consequent=t,r.alternate=n,r}function og(e){const t=new Un(Tw);return t.name=e,t}function cl(e){const t=new Un(CD);return t.value=e.value,t.raw=ne.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function Ow(e,t,n){const r=new Un(TD);return r.computed=e==="[",r.object=t,r.property=n,r.computed||(n.member=!0),r}function n7(e){const t=new Un(ID);return t.properties=e,t}function Lw(e,t,n){const r=new Un(RD);return r.key=t,r.value=n,r.kind=e,r}function r7(e,t){const n=new Un(DD);return n.operator=e,n.argument=t,n.prefix=!0,n}function Ee(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(a,o)=>(rh(o<r.length,"Message reference must be in range"),r[o]));throw n=new Error(i),n.index=H,n.description=i,n}function ah(e){e.type===nl&&Ee(e,OD),e.type===Fa&&Ee(e,BD),e.type===rl&&Ee(e,FD),e.type===Ba&&Ee(e,PD),e.type===xi&&Ee(e,MD),Ee(e,At,e.value)}function zt(e){const t=tn();(t.type!==en||t.value!==e)&&ah(t)}function qe(e){return Be.type===en&&Be.value===e}function sg(e){return Be.type===xi&&Be.value===e}function i7(){const e=[];for(H=Be.start,zt("[");!qe("]");)qe(",")?(tn(),e.push(null)):(e.push(Pa()),qe("]")||zt(","));return tn(),JD(e)}function Nw(){H=Be.start;const e=tn();return e.type===rl||e.type===Fa?(e.octal&&Ee(e,Iw),cl(e)):og(e.value)}function a7(){var e,t,n,r;if(H=Be.start,e=Be,e.type===Ba)return n=Nw(),zt(":"),r=Pa(),Lw("init",n,r);if(e.type===nl||e.type===en)ah(e);else return t=Nw(),zt(":"),r=Pa(),Lw("init",t,r)}function o7(){var e=[],t,n,r,i={},a=String;for(H=Be.start,zt("{");!qe("}");)t=a7(),t.key.type===Tw?n=t.key.name:n=a(t.key.value),r="$"+n,Object.prototype.hasOwnProperty.call(i,r)?Ee({},LD):i[r]=!0,e.push(t),qe("}")||zt(",");return zt("}"),n7(e)}function s7(){zt("(");const e=cg();return zt(")"),e}const c7={if:1};function l7(){var e,t,n;if(qe("("))return s7();if(qe("["))return i7();if(qe("{"))return o7();if(e=Be.type,H=Be.start,e===Ba||c7[Be.value])n=og(tn().value);else if(e===rl||e===Fa)Be.octal&&Ee(Be,Iw),n=cl(tn());else{if(e===xi)throw new Error(il);e===th?(t=tn(),t.value=t.value==="true",n=cl(t)):e===nh?(t=tn(),t.value=null,n=cl(t)):qe("/")||qe("/=")?(n=cl(XD()),Pw()):ah(tn())}return n}function u7(){const e=[];if(zt("("),!qe(")"))for(;H<Nt&&(e.push(Pa()),!qe(")"));)zt(",");return zt(")"),e}function f7(){H=Be.start;const e=tn();return KD(e)||ah(e),og(e.value)}function h7(){return zt("."),f7()}function d7(){zt("[");const e=cg();return zt("]"),e}function p7(){var e,t,n;for(e=l7();;)if(qe("."))n=h7(),e=Ow(".",e,n);else if(qe("("))t=u7(),e=e7(e,t);else if(qe("["))n=d7(),e=Ow("[",e,n);else break;return e}function zw(){const e=p7();if(Be.type===en&&(qe("++")||qe("--")))throw new Error(il);return e}function oh(){var e,t;if(Be.type!==en&&Be.type!==xi)t=zw();else{if(qe("++")||qe("--"))throw new Error(il);if(qe("+")||qe("-")||qe("~")||qe("!"))e=tn(),t=oh(),t=r7(e.value,t);else{if(sg("delete")||sg("void")||sg("typeof"))throw new Error(il);t=zw()}}return t}function Uw(e){let t=0;if(e.type!==en&&e.type!==xi)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function g7(){var e,t,n,r,i,a,o,s,c,l;if(e=Be,c=oh(),r=Be,i=Uw(r),i===0)return c;for(r.prec=i,tn(),t=[e,Be],o=oh(),a=[c,r,o];(i=Uw(Be))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,c=a.pop(),t.pop(),n=Mw(s,c,o),a.push(n);r=tn(),r.prec=i,a.push(r),t.push(Be),n=oh(),a.push(n)}for(l=a.length-1,n=a[l],t.pop();l>1;)t.pop(),n=Mw(a[l-1].value,a[l-2],n),l-=2;return n}function Pa(){var e,t,n;return e=g7(),qe("?")&&(tn(),t=Pa(),zt(":"),n=Pa(),e=t7(e,t,n)),e}function cg(){const e=Pa();if(qe(","))throw new Error(il);return e}function m7(e){ne=e,H=0,Nt=ne.length,Be=null,Pw();const t=cg();if(Be.type!==nl)throw new Error("Unexpect token after expression.");return t}var b7={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function $w(e){function t(o,s,c,l){let u=e(s[0]);return c&&(u=c+"("+u+")",c.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+o+(l<0?"":l===0?"()":"("+s.slice(1).map(e).join(",")+")")}function n(o,s,c){return l=>t(o,l,s,c)}const r="new Date",i="String",a="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&it("Missing arguments to clamp function."),o.length>3&&it("Too many arguments to clamp function.");const s=o.map(e);return"Math.max("+s[1]+", Math.min("+s[2]+","+s[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:a,test:n("test",a),if:function(o){o.length<3&&it("Missing arguments to if function."),o.length>3&&it("Too many arguments to if function.");const s=o.map(e);return"("+s[0]+"?"+s[1]+":"+s[2]+")"}}}function y7(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function v7(e){e=e||{};const t=e.allowed?Nf(e.allowed):{},n=e.forbidden?Nf(e.forbidden):{},r=e.constants||b7,i=(e.functions||$w)(f),a=e.globalvar,o=e.fieldvar,s=Kt(a)?a:p=>`${a}["${p}"]`;let c={},l={},u=0;function f(p){if(Me(p))return p;const g=h[p.type];return g==null&&it("Unsupported type: "+p.type),g(p)}const h={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:ya(n,g)?it("Illegal identifier: "+g):ya(r,g)?r[g]:ya(t,g)?g:(c[g]=1,s(g))},MemberExpression:p=>{const g=!p.computed,b=f(p.object);g&&(u+=1);const v=f(p.property);return b===o&&(l[y7(v)]=1),g&&(u-=1),b+(g?"."+v:"["+v+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&it("Illegal callee type: "+p.callee.type);const g=p.callee.name,b=p.arguments,v=ya(i,g)&&i[g];return v||it("Unrecognized function: "+g),Kt(v)?v(b):v+"("+b.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function d(p){const g={code:f(p),globals:Object.keys(c),fields:Object.keys(l)};return c={},l={},g}return d.functions=i,d.constants=r,d}function lg(e,t,n){return n=(n-e)/(t-e),n=Math.max(0,Math.min(1,n)),n*n*(3-2*n)}function Ai(e,t=0,n=1){return Math.max(t,Math.min(n,e))}function w7(e,t,n){return Ai((n-e)/(t-e),0,1)}const Hw={clamp:Ai,isArray:Qt,isBoolean:kc,isDefined(e){return e!==void 0},isNumber:ft,isObject:Xt,isRegExp:EI,isString:Me,isValid(e){return e!=null&&e===e},lerp:lv,linearstep:w7,smoothstep:lg};function x7(e){const t=$w(e);for(const n in Hw)t[n]=`this.${n}`;return t}const A7=v7({forbidden:[],allowed:["datum"],globalvar:"globalObject",fieldvar:"datum",functions:x7});function sh(e,t={}){try{const n=m7(e),r=A7(n),i=Function("datum","globalObject",`"use strict"; return (${r.code});`).bind(Hw),a=o=>i(o,t);return a.fields=r.fields,a.globals=r.globals,a.code=r.code,a}catch(n){throw new Error(`Invalid expression: ${e}, ${n.message}`)}}function lr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ei(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const ug=Symbol("implicit");function fg(){var e=new gi,t=[],n=[],r=ug;function i(a){let o=e.get(a);if(o===void 0){if(r!==ug)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new gi;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return fg(t,n).unknown(r)},lr.apply(i,arguments),i}function Qo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ll(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Si(){}var Ma=.7,Xo=1/Ma,Ko="\\s*([+-]?\\d+)\\s*",ul="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ur="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E7=/^#([0-9a-f]{3,8})$/,S7=new RegExp(`^rgb\\(${Ko},${Ko},${Ko}\\)$`),_7=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),C7=new RegExp(`^rgba\\(${Ko},${Ko},${Ko},${ul}\\)$`),k7=new RegExp(`^rgba\\(${ur},${ur},${ur},${ul}\\)$`),T7=new RegExp(`^hsl\\(${ul},${ur},${ur}\\)$`),I7=new RegExp(`^hsla\\(${ul},${ur},${ur},${ul}\\)$`),Gw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Qo(Si,_i,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Vw,formatHex:Vw,formatHex8:R7,formatHsl:D7,formatRgb:jw,toString:jw});function Vw(){return this.rgb().formatHex()}function R7(){return this.rgb().formatHex8()}function D7(){return Qw(this).formatHsl()}function jw(){return this.rgb().formatRgb()}function _i(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=E7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?qw(t):n===3?new Et(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ch(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ch(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=S7.exec(e))?new Et(t[1],t[2],t[3],1):(t=_7.exec(e))?new Et(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=C7.exec(e))?ch(t[1],t[2],t[3],t[4]):(t=k7.exec(e))?ch(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=T7.exec(e))?Zw(t[1],t[2]/100,t[3]/100,1):(t=I7.exec(e))?Zw(t[1],t[2]/100,t[3]/100,t[4]):Gw.hasOwnProperty(e)?qw(Gw[e]):e==="transparent"?new Et(NaN,NaN,NaN,0):null}function qw(e){return new Et(e>>16&255,e>>8&255,e&255,1)}function ch(e,t,n,r){return r<=0&&(e=t=n=NaN),new Et(e,t,n,r)}function hg(e){return e instanceof Si||(e=_i(e)),e?(e=e.rgb(),new Et(e.r,e.g,e.b,e.opacity)):new Et}function lh(e,t,n,r){return arguments.length===1?hg(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Qo(Et,lh,ll(Si,{brighter(e){return e=e==null?Xo:Math.pow(Xo,e),new Et(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ma:Math.pow(Ma,e),new Et(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Et(Oa(this.r),Oa(this.g),Oa(this.b),uh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ww,formatHex:Ww,formatHex8:B7,formatRgb:Yw,toString:Yw}));function Ww(){return`#${La(this.r)}${La(this.g)}${La(this.b)}`}function B7(){return`#${La(this.r)}${La(this.g)}${La(this.b)}${La((isNaN(this.opacity)?1:this.opacity)*255)}`}function Yw(){const e=uh(this.opacity);return`${e===1?"rgb(":"rgba("}${Oa(this.r)}, ${Oa(this.g)}, ${Oa(this.b)}${e===1?")":`, ${e})`}`}function uh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function La(e){return e=Oa(e),(e<16?"0":"")+e.toString(16)}function Zw(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $n(e,t,n,r)}function Qw(e){if(e instanceof $n)return new $n(e.h,e.s,e.l,e.opacity);if(e instanceof Si||(e=_i(e)),!e)return new $n;if(e instanceof $n)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(t===a?o=(n-r)/s+(n<r)*6:n===a?o=(r-t)/s+2:o=(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new $n(o,s,c,e.opacity)}function dg(e,t,n,r){return arguments.length===1?Qw(e):new $n(e,t,n,r??1)}function $n(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qo($n,dg,ll(Si,{brighter(e){return e=e==null?Xo:Math.pow(Xo,e),new $n(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ma:Math.pow(Ma,e),new $n(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Et(pg(e>=240?e-240:e+120,i,r),pg(e,i,r),pg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new $n(Xw(this.h),fh(this.s),fh(this.l),uh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=uh(this.opacity);return`${e===1?"hsl(":"hsla("}${Xw(this.h)}, ${fh(this.s)*100}%, ${fh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xw(e){return e=(e||0)%360,e<0?e+360:e}function fh(e){return Math.max(0,Math.min(1,e||0))}function pg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Kw=Math.PI/180,Jw=180/Math.PI,hh=18,ex=.96422,tx=1,nx=.82521,rx=4/29,Jo=6/29,ix=3*Jo*Jo,F7=Jo*Jo*Jo;function ax(e){if(e instanceof fr)return new fr(e.l,e.a,e.b,e.opacity);if(e instanceof zr)return ox(e);e instanceof Et||(e=hg(e));var t=vg(e.r),n=vg(e.g),r=vg(e.b),i=mg((.2225045*t+.7168786*n+.0606169*r)/tx),a,o;return t===n&&n===r?a=o=i:(a=mg((.4360747*t+.3850649*n+.1430804*r)/ex),o=mg((.0139322*t+.0971045*n+.7141733*r)/nx)),new fr(116*i-16,500*(a-i),200*(i-o),e.opacity)}function gg(e,t,n,r){return arguments.length===1?ax(e):new fr(e,t,n,r??1)}function fr(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Qo(fr,gg,ll(Si,{brighter(e){return new fr(this.l+hh*(e??1),this.a,this.b,this.opacity)},darker(e){return new fr(this.l-hh*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=ex*bg(t),e=tx*bg(e),n=nx*bg(n),new Et(yg(3.1338561*t-1.6168667*e-.4906146*n),yg(-.9787684*t+1.9161415*e+.033454*n),yg(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function mg(e){return e>F7?Math.pow(e,1/3):e/ix+rx}function bg(e){return e>Jo?e*e*e:ix*(e-rx)}function yg(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function vg(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function P7(e){if(e instanceof zr)return new zr(e.h,e.c,e.l,e.opacity);if(e instanceof fr||(e=ax(e)),e.a===0&&e.b===0)return new zr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Jw;return new zr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function wg(e,t,n,r){return arguments.length===1?P7(e):new zr(e,t,n,r??1)}function zr(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function ox(e){if(isNaN(e.h))return new fr(e.l,0,0,e.opacity);var t=e.h*Kw;return new fr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Qo(zr,wg,ll(Si,{brighter(e){return new zr(this.h,this.c,this.l+hh*(e??1),this.opacity)},darker(e){return new zr(this.h,this.c,this.l-hh*(e??1),this.opacity)},rgb(){return ox(this).rgb()}}));var sx=-.14861,xg=1.78277,Ag=-.29227,dh=-.90649,fl=1.97294,cx=fl*dh,lx=fl*xg,ux=xg*Ag-dh*sx;function M7(e){if(e instanceof Na)return new Na(e.h,e.s,e.l,e.opacity);e instanceof Et||(e=hg(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(ux*r+cx*t-lx*n)/(ux+cx-lx),a=r-i,o=(fl*(n-i)-Ag*a)/dh,s=Math.sqrt(o*o+a*a)/(fl*i*(1-i)),c=s?Math.atan2(o,a)*Jw-120:NaN;return new Na(c<0?c+360:c,s,i,e.opacity)}function Eg(e,t,n,r){return arguments.length===1?M7(e):new Na(e,t,n,r??1)}function Na(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qo(Na,Eg,ll(Si,{brighter(e){return e=e==null?Xo:Math.pow(Xo,e),new Na(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ma:Math.pow(Ma,e),new Na(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Kw,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Et(255*(t+n*(sx*r+xg*i)),255*(t+n*(Ag*r+dh*i)),255*(t+n*(fl*r)),this.opacity)}}));function fx(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function hx(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r<t-1?e[r+2]:2*a-i;return fx((n-r/t)*t,o,i,a,s)}}function dx(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],a=e[r%t],o=e[(r+1)%t],s=e[(r+2)%t];return fx((n-r/t)*t,i,a,o,s)}}const ph=e=>()=>e;function px(e,t){return function(n){return e+n*t}}function O7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function gh(e,t){var n=t-e;return n?px(e,n>180||n<-180?n-360*Math.round(n/360):n):ph(isNaN(e)?t:e)}function L7(e){return(e=+e)==1?St:function(t,n){return n-t?O7(t,n,e):ph(isNaN(t)?n:t)}}function St(e,t){var n=t-e;return n?px(e,n):ph(isNaN(e)?t:e)}const Sg=function e(t){var n=L7(t);function r(i,a){var o=n((i=lh(i)).r,(a=lh(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),l=St(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=e,r}(1);function gx(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o,s;for(o=0;o<n;++o)s=lh(t[o]),r[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return r=e(r),i=e(i),a=e(a),s.opacity=1,function(c){return s.r=r(c),s.g=i(c),s.b=a(c),s+""}}}var N7=gx(hx),z7=gx(dx);function _g(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function mx(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function U7(e,t){return(mx(t)?_g:bx)(e,t)}function bx(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Ci(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(s){for(o=0;o<r;++o)a[o]=i[o](s);return a}}function yx(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Hn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function vx(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Ci(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Cg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kg=new RegExp(Cg.source,"g");function $7(e){return function(){return e}}function H7(e){return function(t){return e(t)+""}}function wx(e,t){var n=Cg.lastIndex=kg.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=Cg.exec(e))&&(i=kg.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Hn(r,i)})),n=kg.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?H7(c[0].x):$7(t):(t=c.length,function(l){for(var u=0,f;u<t;++u)s[(f=c[u]).i]=f.x(l);return s.join("")})}function Ci(e,t){var n=typeof t,r;return t==null||n==="boolean"?ph(t):(n==="number"?Hn:n==="string"?(r=_i(t))?(t=r,Sg):wx:t instanceof _i?Sg:t instanceof Date?yx:mx(t)?_g:Array.isArray(t)?bx:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?vx:Hn)(e,t)}function G7(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function V7(e,t){var n=gh(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function hl(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var xx=180/Math.PI,Tg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ax(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*xx,skewX:Math.atan(c)*xx,scaleX:o,scaleY:s}}var mh;function j7(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Tg:Ax(t.a,t.b,t.c,t.d,t.e,t.f)}function q7(e){return e==null||(mh||(mh=document.createElementNS("http://www.w3.org/2000/svg","g")),mh.setAttribute("transform",e),!(e=mh.transform.baseVal.consolidate()))?Tg:(e=e.matrix,Ax(e.a,e.b,e.c,e.d,e.e,e.f))}function Ex(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,u,f,h,d,p){if(l!==f||u!==h){var g=d.push("translate(",null,t,null,n);p.push({i:g-4,x:Hn(l,f)},{i:g-2,x:Hn(u,h)})}else(f||h)&&d.push("translate("+f+t+h+n)}function o(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Hn(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function s(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Hn(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,p){if(l!==f||u!==h){var g=d.push(i(d)+"scale(",null,",",null,")");p.push({i:g-4,x:Hn(l,f)},{i:g-2,x:Hn(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),a(l.translateX,l.translateY,u.translateX,u.translateY,f,h),o(l.rotate,u.rotate,f,h),s(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var p=-1,g=h.length,b;++p<g;)f[(b=h[p]).i]=b.x(d);return f.join("")}}}var W7=Ex(j7,"px, ","px)","deg)"),Y7=Ex(q7,", ",")",")"),Z7=1e-12;function Sx(e){return((e=Math.exp(e))+1/e)/2}function Q7(e){return((e=Math.exp(e))-1/e)/2}function X7(e){return((e=Math.exp(2*e))-1)/(e+1)}const K7=function e(t,n,r){function i(a,o){var s=a[0],c=a[1],l=a[2],u=o[0],f=o[1],h=o[2],d=u-s,p=f-c,g=d*d+p*p,b,v;if(g<Z7)v=Math.log(h/l)/t,b=function(I){return[s+I*d,c+I*p,l*Math.exp(t*I*v)]};else{var x=Math.sqrt(g),A=(h*h-l*l+r*g)/(2*l*n*x),w=(h*h-l*l-r*g)/(2*h*n*x),_=Math.log(Math.sqrt(A*A+1)-A),C=Math.log(Math.sqrt(w*w+1)-w);v=(C-_)/t,b=function(I){var D=I*v,B=Sx(_),G=l/(n*x)*(B*X7(t*D+_)-Q7(_));return[s+G*d,c+G*p,l*B/Sx(t*D+_)]}}return b.duration=v*1e3*t/Math.SQRT2,b}return i.rho=function(a){var o=Math.max(.001,+a),s=o*o,c=s*s;return e(o,s,c)},i}(Math.SQRT2,2,4);function _x(e){return function(t,n){var r=e((t=dg(t)).h,(n=dg(n)).h),i=St(t.s,n.s),a=St(t.l,n.l),o=St(t.opacity,n.opacity);return function(s){return t.h=r(s),t.s=i(s),t.l=a(s),t.opacity=o(s),t+""}}}const J7=_x(gh);var eB=_x(St);function tB(e,t){var n=St((e=gg(e)).l,(t=gg(t)).l),r=St(e.a,t.a),i=St(e.b,t.b),a=St(e.opacity,t.opacity);return function(o){return e.l=n(o),e.a=r(o),e.b=i(o),e.opacity=a(o),e+""}}function Cx(e){return function(t,n){var r=e((t=wg(t)).h,(n=wg(n)).h),i=St(t.c,n.c),a=St(t.l,n.l),o=St(t.opacity,n.opacity);return function(s){return t.h=r(s),t.c=i(s),t.l=a(s),t.opacity=o(s),t+""}}}const nB=Cx(gh);var rB=Cx(St);function kx(e){return function t(n){n=+n;function r(i,a){var o=e((i=Eg(i)).h,(a=Eg(a)).h),s=St(i.s,a.s),c=St(i.l,a.l),l=St(i.opacity,a.opacity);return function(u){return i.h=o(u),i.s=s(u),i.l=c(Math.pow(u,n)),i.opacity=l(u),i+""}}return r.gamma=t,r}(1)}const iB=kx(gh);var aB=kx(St);function Ig(e,t){t===void 0&&(t=e,e=Ci);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var s=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[s](o-s)}}function oB(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const sB=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Ci,interpolateArray:U7,interpolateBasis:hx,interpolateBasisClosed:dx,interpolateCubehelix:iB,interpolateCubehelixLong:aB,interpolateDate:yx,interpolateDiscrete:G7,interpolateHcl:nB,interpolateHclLong:rB,interpolateHsl:J7,interpolateHslLong:eB,interpolateHue:V7,interpolateLab:tB,interpolateNumber:Hn,interpolateNumberArray:_g,interpolateObject:vx,interpolateRgb:Sg,interpolateRgbBasis:N7,interpolateRgbBasisClosed:z7,interpolateRound:hl,interpolateString:wx,interpolateTransformCss:W7,interpolateTransformSvg:Y7,interpolateZoom:K7,piecewise:Ig,quantize:oB},Symbol.toStringTag,{value:"Module"}));function cB(e){return function(){return e}}function Rg(e){return+e}var Tx=[0,1];function nn(e){return e}function Dg(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:cB(isNaN(t)?NaN:.5)}function lB(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function uB(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Dg(i,r),a=n(o,a)):(r=Dg(r,i),a=n(a,o)),function(s){return a(r(s))}}function fB(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Dg(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(s){var c=Pr(e,s,1,r)-1;return a[c](i[c](s))}}function dl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function bh(){var e=Tx,t=Tx,n=Ci,r,i,a,o=nn,s,c,l;function u(){var h=Math.min(e.length,t.length);return o!==nn&&(o=lB(e[0],e[h-1])),s=h>2?fB:uB,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=s(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(i((l||(l=s(t,e.map(r),Hn)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Rg),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=hl,u()},f.clamp=function(h){return arguments.length?(o=h?!0:nn,u()):o!==nn},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return r=h,i=d,u()}}function Ix(){return bh()(nn,nn)}function Rx(e,t,n,r){var i=wa(e,t,n),a;switch(r=bi(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Cv(i,o))&&(r.precision=a),Rp(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=kv(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=_v(i))&&(r.precision=a-(r.type==="%")*2);break}}return pt(r)}function za(e){var t=e.domain;return e.ticks=function(n){var r=t();return Dc(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Rx(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=Bc(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function yh(){var e=Ix();return e.copy=function(){return dl(e,yh())},lr.apply(e,arguments),za(e)}function Dx(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Rg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Dx(e).unknown(t)},e=arguments.length?Array.from(e,Rg):[0,1],za(n)}function Bx(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function Fx(e){return Math.log(e)}function Px(e){return Math.exp(e)}function hB(e){return-Math.log(-e)}function dB(e){return-Math.exp(-e)}function pB(e){return isFinite(e)?+("1e"+e):e<0?0:e}function gB(e){return e===10?pB:e===Math.E?Math.exp:t=>Math.pow(e,t)}function mB(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Mx(e){return(t,n)=>-e(-t,n)}function Bg(e){const t=e(Fx,Px),n=t.domain;let r=10,i,a;function o(){return i=mB(r),a=gB(r),n()[0]<0?(i=Mx(i),a=Mx(a),e(hB,dB)):e(Fx,Px),t}return t.base=function(s){return arguments.length?(r=+s,o()):r},t.domain=function(s){return arguments.length?(n(s),o()):n()},t.ticks=s=>{const c=n();let l=c[0],u=c[c.length-1];const f=u<l;f&&([l,u]=[u,l]);let h=i(l),d=i(u),p,g;const b=s==null?10:+s;let v=[];if(!(r%1)&&d-h<b){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(p=1;p<r;++p)if(g=h<0?p/a(-h):p*a(h),!(g<l)){if(g>u)break;v.push(g)}}else for(;h<=d;++h)for(p=r-1;p>=1;--p)if(g=h>0?p/a(-h):p*a(h),!(g<l)){if(g>u)break;v.push(g)}v.length*2<b&&(v=Dc(l,u,b))}else v=Dc(h,d,Math.min(d-h,b)).map(a);return f?v.reverse():v},t.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=bi(c)).precision==null&&(c.trim=!0),c=pt(c)),s===1/0)return c;const l=Math.max(1,r*s/t.ticks().length);return u=>{let f=u/a(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=l?c(u):""}},t.nice=()=>n(Bx(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function Fg(){const e=Bg(bh()).domain([1,10]);return e.copy=()=>dl(e,Fg()).base(e.base()),lr.apply(e,arguments),e}function Ox(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Lx(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Pg(e){var t=1,n=e(Ox(t),Lx(t));return n.constant=function(r){return arguments.length?e(Ox(t=+r),Lx(t)):t},za(n)}function Nx(){var e=Pg(bh());return e.copy=function(){return dl(e,Nx()).constant(e.constant())},lr.apply(e,arguments)}function zx(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function bB(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function yB(e){return e<0?-e*e:e*e}function Mg(e){var t=e(nn,nn),n=1;function r(){return n===1?e(nn,nn):n===.5?e(bB,yB):e(zx(n),zx(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},za(t)}function Og(){var e=Mg(bh());return e.copy=function(){return dl(e,Og()).exponent(e.exponent())},lr.apply(e,arguments),e}function vB(){return Og.apply(null,arguments).exponent(.5)}function Ux(){var e=[],t=[],n=[],r;function i(){var o=0,s=Math.max(1,t.length);for(n=new Array(s-1);++o<s;)n[o-1]=Tp(e,o/s);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Pr(n,o)]}return a.invertExtent=function(o){var s=t.indexOf(o);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let s of o)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(va),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return Ux().domain(e).range(t).unknown(r)},lr.apply(a,arguments)}function $x(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Pr(r,c,0,n)]:a}function s(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,s()):[e,t]},o.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,s()):i.slice()},o.invertExtent=function(c){var l=i.indexOf(c);return l<0?[NaN,NaN]:l<1?[e,r[0]]:l>=n?[r[n-1],t]:[r[l-1],r[l]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return $x().domain([e,t]).range(i).unknown(a)},lr.apply(za(o),arguments)}function Hx(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Pr(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Hx().domain(e).range(t).unknown(n)},lr.apply(i,arguments)}function wB(e){return new Date(e)}function xB(e){return e instanceof Date?+e:+new Date(+e)}function Lg(e,t,n,r,i,a,o,s,c,l){var u=Ix(),f=u.invert,h=u.domain,d=l(".%L"),p=l(":%S"),g=l("%I:%M"),b=l("%I %p"),v=l("%a %d"),x=l("%b %d"),A=l("%B"),w=l("%Y");function _(C){return(c(C)<C?d:s(C)<C?p:o(C)<C?g:a(C)<C?b:r(C)<C?i(C)<C?v:x:n(C)<C?A:w)(C)}return u.invert=function(C){return new Date(f(C))},u.domain=function(C){return arguments.length?h(Array.from(C,xB)):h().map(wB)},u.ticks=function(C){var I=h();return e(I[0],I[I.length-1],C??10)},u.tickFormat=function(C,I){return I==null?_:l(I)},u.nice=function(C){var I=h();return(!C||typeof C.range!="function")&&(C=t(I[0],I[I.length-1],C??10)),C?h(Bx(I,C)):u},u.copy=function(){return dl(u,Lg(e,t,n,r,i,a,o,s,c,l))},u}function AB(){return lr.apply(Lg(xR,AR,vi,Pc,Fc,Aa,Lp,Op,yi,jp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function EB(){return lr.apply(Lg(vR,wR,wi,Oc,Mc,Sa,Up,zp,yi,qp).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function vh(){var e=0,t=1,n,r,i,a,o=nn,s=!1,c;function l(f){return f==null||isNaN(f=+f)?c:o(i===0?.5:(f=(a(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(f){return arguments.length?(s=!!f,l):s},l.interpolator=function(f){return arguments.length?(o=f,l):o};function u(f){return function(h){var d,p;return arguments.length?([d,p]=h,o=f(d,p),l):[o(0),o(1)]}}return l.range=u(Ci),l.rangeRound=u(hl),l.unknown=function(f){return arguments.length?(c=f,l):c},function(f){return a=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),l}}function ki(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Ng(){var e=za(vh()(nn));return e.copy=function(){return ki(e,Ng())},Ei.apply(e,arguments)}function Gx(){var e=Bg(vh()).domain([1,10]);return e.copy=function(){return ki(e,Gx()).base(e.base())},Ei.apply(e,arguments)}function Vx(){var e=Pg(vh());return e.copy=function(){return ki(e,Vx()).constant(e.constant())},Ei.apply(e,arguments)}function zg(){var e=Mg(vh());return e.copy=function(){return ki(e,zg()).exponent(e.exponent())},Ei.apply(e,arguments)}function SB(){return zg.apply(null,arguments).exponent(.5)}function wh(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=nn,u,f=!1,h;function d(g){return isNaN(g=+g)?h:(g=.5+((g=+u(g))-a)*(r*g<r*a?s:c),l(f?Math.max(0,Math.min(1,g)):g))}d.domain=function(g){return arguments.length?([e,t,n]=g,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,d):[e,t,n]},d.clamp=function(g){return arguments.length?(f=!!g,d):f},d.interpolator=function(g){return arguments.length?(l=g,d):l};function p(g){return function(b){var v,x,A;return arguments.length?([v,x,A]=b,l=Ig(g,[v,x,A]),d):[l(0),l(.5),l(1)]}}return d.range=p(Ci),d.rangeRound=p(hl),d.unknown=function(g){return arguments.length?(h=g,d):h},function(g){return u=g,i=g(e),a=g(t),o=g(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,d}}function jx(){var e=za(wh()(nn));return e.copy=function(){return ki(e,jx())},Ei.apply(e,arguments)}function qx(){var e=Bg(wh()).domain([.1,1,10]);return e.copy=function(){return ki(e,qx()).base(e.base())},Ei.apply(e,arguments)}function Wx(){var e=Pg(wh());return e.copy=function(){return ki(e,Wx()).constant(e.constant())},Ei.apply(e,arguments)}function Ug(){var e=Mg(wh());return e.copy=function(){return ki(e,Ug()).exponent(e.exponent())},Ei.apply(e,arguments)}function _B(){return Ug.apply(null,arguments).exponent(.5)}function $g(e,t,n){const r=e-t+n*2;return e?r>0?r:1:0}const CB="identity",es="linear",Ti="log",pl="pow",gl="sqrt",xh="symlog",Yx="time",Zx="utc",hr="sequential",ts="diverging",Hg="quantile",Qx="quantize",Xx="threshold",Gg="ordinal",Vg="point",Kx="band",jg="bin-ordinal",gt="continuous",ml="discrete",bl="discretizing",An="interpolating",Jx="temporal";function kB(e){return function(t){let n=t[0],r=t[1],i;return r<n&&(i=n,n=r,r=i),[e.invert(n),e.invert(r)]}}function TB(e){return function(t){const n=e.range();let r=t[0],i=t[1],a=-1,o,s,c,l;for(i<r&&(s=r,r=i,i=s),c=0,l=n.length;c<l;++c)n[c]>=r&&n[c]<=i&&(a<0&&(a=c),o=c);if(!(a<0))return r=e.invertExtent(n[a]),i=e.invertExtent(n[o]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function qg(){const e=fg().unknown(void 0),t=e.domain,n=e.range;let r=[0,1],i,a,o=!1,s=0,c=0,l=.5;delete e.unknown;function u(){const f=t().length,h=r[1]<r[0],d=r[1-h],p=$g(f,s,c);let g=r[h-0];i=(d-g)/(p||1),o&&(i=Math.floor(i)),g+=(d-g-i*(f-s))*l,a=i*(1-s),o&&(g=Math.round(g),a=Math.round(a));const b=mi(f).map(v=>g+i*v);return n(h?b.reverse():b)}return e.domain=function(f){return arguments.length?(t(f),u()):t()},e.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},e.rangeRound=function(f){return r=[+f[0],+f[1]],o=!0,u()},e.bandwidth=function(){return a},e.step=function(){return i},e.round=function(f){return arguments.length?(o=!!f,u()):o},e.padding=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),s=c,u()):s},e.paddingInner=function(f){return arguments.length?(s=Math.max(0,Math.min(1,f)),u()):s},e.paddingOuter=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const h=r[1]<r[0],d=h?n().reverse():n(),p=d.length-1;let g=+f[0],b=+f[1],v,x,A;if(!(g!==g||b!==b)&&(b<g&&(A=g,g=b,b=A),!(b<d[0]||g>r[1-h])))return v=Math.max(0,Pr(d,g)-1),x=g===b?v:Pr(d,b)-1,g-d[v]>a+1e-10&&++v,h&&(A=v,v=p-x,x=p-A),v>x?void 0:t().slice(v,x+1)},e.invert=function(f){const h=e.invertRange([f,f]);return h&&h[0]},e.copy=function(){return qg().domain(t()).range(r).round(o).paddingInner(s).paddingOuter(c).align(l)},u()}function e3(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return e3(t())},e}function IB(){return e3(qg().paddingInner(1))}var RB=Array.prototype.map;function DB(e){return RB.call(e,Cc)}const BB=Array.prototype.slice;function t3(){let e=[],t=[];function n(r){return r==null||r!==r?void 0:t[(Pr(e,r)-1)%t.length]}return n.domain=function(r){return arguments.length?(e=DB(r),n):e.slice()},n.range=function(r){return arguments.length?(t=BB.call(r),n):t.slice()},n.tickFormat=function(r,i){return Rx(e[0],zn(e),r??10,i)},n.copy=function(){return t3().domain(n.domain()).range(n.range())},n}const Ah={};function FB(e,t,n){const r=function(){const a=t();return a.invertRange||(a.invertRange=a.invert?kB(a):a.invertExtent?TB(a):void 0),a.type=e,a};return r.metadata=Nf(yp(n)),r}function ke(e,t,n){return arguments.length>1?(Ah[e]=FB(e,t,n),this):PB(e)?Ah[e]:void 0}ke(CB,Dx),ke(es,yh,gt),ke(Ti,Fg,[gt,Ti]),ke(pl,Og,gt),ke(gl,vB,gt),ke(xh,Nx,gt),ke(Yx,AB,[gt,Jx]),ke(Zx,EB,[gt,Jx]),ke(hr,Ng,[gt,An]),ke("".concat(hr,"-").concat(es),Ng,[gt,An]),ke("".concat(hr,"-").concat(Ti),Gx,[gt,An,Ti]),ke("".concat(hr,"-").concat(pl),zg,[gt,An]),ke("".concat(hr,"-").concat(gl),SB,[gt,An]),ke("".concat(hr,"-").concat(xh),Vx,[gt,An]),ke("".concat(ts,"-").concat(es),jx,[gt,An]),ke("".concat(ts,"-").concat(Ti),qx,[gt,An,Ti]),ke("".concat(ts,"-").concat(pl),Ug,[gt,An]),ke("".concat(ts,"-").concat(gl),_B,[gt,An]),ke("".concat(ts,"-").concat(xh),Wx,[gt,An]),ke(Hg,Ux,[bl,Hg]),ke(Qx,$x,bl),ke(Xx,Hx,bl),ke(jg,t3,[ml,bl]),ke(Gg,fg,ml),ke(Kx,qg,ml),ke(Vg,IB,ml);function PB(e){return ya(Ah,e)}function yl(e,t){const n=Ah[e];return n&&n.metadata[t]}function _t(e){return yl(e,gt)}function dr(e){return yl(e,ml)}function Ua(e){return yl(e,bl)}function n3(e){return yl(e,Ti)}function Eh(e){return yl(e,An)}function MB(e,t){const n=t[0],r=zn(t)-n;return function(i){return e(n+i*r)}}function Sh(e,t,n){return Ig(r3(t||"rgb",n),e)}function OB(e,t){const n=new Array(t),r=t+1;for(let i=0;i<t;)n[i]=e(++i/r);return n}function r3(e,t){const n=sB[LB(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function LB(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const NB={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},zB={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function i3(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function a3(e,t){for(const n in e)Wg(n,t(e[n]))}const o3={};a3(zB,i3),a3(NB,e=>Sh(i3(e)));function Wg(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(o3[e]=t,this):o3[e]}function UB(){let e=0,t,n=0;const r=new Map,i=a=>(a===t||(n=r.get(a),n===void 0&&(n=e++,r.set(a,n)),t=a),n);return i.addAll=a=>{for(const o of a)i(o)},i.invert=a=>{for(const o of r.entries())if(o[1]==a)return o[0]},i.domain=()=>[...r.keys()],i}function _h(){const e=t=>t;return e.invert=t=>t,e.copy=_h,e.invertRange=()=>{},e.type="null",e}function $B(e,t){const n={};t||(t=e.encoding);for(const[r,i]of Object.entries(t)){if(!i)continue;const a=((rn(i)&&i.resolutionChannel)??(Ii(r)&&r))||void 0,o=e.unitView.getScaleResolution(a);n[r]=HB(t[r],o==null?void 0:o.getScale(),e.unitView.getAccessor(r),r)}return n}function HB(e,t,n,r){let i;if(Gn(e)){const a=e.value;i=o=>a,i.constant=!0,i.constantValue=!0,i.accessor=void 0}else if(n)if(r=="text")i=a=>{},i.accessor=n,i.constant=n.constant;else{if(!t)if(!Ii(r))t=_h();else throw new Error(`Missing scale! "${r}": ${JSON.stringify(e)}`);if(i=a=>t(n(a)),dr(t.type)){const a=UB();a.addAll(t.domain()),i.indexer=a}i.constant=n.constant,i.accessor=n,i.scale=t}else throw new Error(`Missing value or accessor (field, expr, datum) on channel "${r}": ${JSON.stringify(e)}`);return i.invert=t?a=>t.invert(a):a=>{throw new Error("No scale available, cannot invert: "+JSON.stringify(e))},i.channelDef=e,i.applyMetadata=a=>{for(const o in i)o in i&&(a[o]=i[o]);return a},i}function Gn(e){return e&&"value"in e}function Ur(e){return e&&"field"in e}function vl(e){return e&&"datum"in e}function rn(e){return Ur(e)||vl(e)||Zg(e)||s3(e)}function Yg(e,t){const n=e.mark.encoding[t];if(rn(n))return n;throw new Error("Not a channel def with scale!")}function s3(e){return e&&"chrom"in e}function Zg(e){return e&&"expr"in e}const ns=["x","y"],GB=["x2","y2"],VB=[...ns,...GB];function c3(e){return ns.includes(e)}function wl(e){return VB.includes(e)}const Qg={x:"x2",y:"y2"},l3=Object.fromEntries(Object.entries(Qg).map(e=>[e[1],e[0]]));function xl(e){return e in l3}function jB(e){const t=Qg[e];if(t)return t;throw new Error(`${e} has no secondary channel!`)}function $a(e){return l3[e]??e}function Ha(e){return["color","fill","stroke"].includes($a(e))}function Ch(e){return["shape","squeeze"].includes(e)}function Ii(e){return["x","y","x2","y2","color","fill","stroke","opacity","fillOpacity","strokeOpacity","strokeWidth","size","shape","angle","dx","dy","sample"].includes(e)}function qB(e){switch(e){case"shape":return["circle","square","cross","diamond","triangle-up","triangle-right","triangle-down","triangle-left","tick-up","tick-right","tick-down","tick-left"]}}function u3(e){if(!Ch(e))throw new Error("Not a discrete channel: "+e);const t=new Map(qB(e).map((n,r)=>[n,r]));return n=>{const r=t.get(n);if(r!==void 0)return r;throw new Error(`Invalid value for "${e}" channel: ${n}`)}}function Oe(e,t=e){if(/^[A-Za-z0-9_]+$/.test(e)){const n=new Function("datum",`return datum[${JSON.stringify(e)}]`);return De(n,[e],t)}else return Bf(e)}class WB{constructor(){this.accessorCreators=[],this.register(t=>{if(Ur(t))try{const n=Oe(t.field);return n.constant=!1,n.fields=Df(n),n}catch(n){throw new Error(`Invalid field definition: ${n.message}`)}}),this.register(t=>Zg(t)?YB(t.expr):void 0),this.register(t=>{if(vl(t)){const r=vI(t.datum);return r.constant=!0,r.fields=[],r}})}register(t){this.accessorCreators.push(t)}createAccessor(t){for(const n of this.accessorCreators){const r=n(t);if(r)return r}}}function YB(e){const n=sh(e);return n.constant=n.fields.length==0,n}/* @license twgl.js 4.22.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
|
162
|
+
`&&++H;else{if(ol(r.charCodeAt(0)))break;e+=r}return t!==""&&Ee({},At,Bt),{type:rl,value:e,octal:a,start:n,end:H}}function YD(e,t){let n=e;t.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(r,i)=>{if(parseInt(i,16)<=1114111)return"x";Ee({},tg)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{Ee({},tg)}try{return new RegExp(e,t)}catch{return null}}function ZD(){var e,t,n,r,i;for(e=ne[H],rh(e==="/","Regular expression literal must start with a slash"),t=ne[H++],n=!1,r=!1;H<Nt;)if(e=ne[H++],t+=e,e==="\\")e=ne[H++],ol(e.charCodeAt(0))&&Ee({},ng),t+=e;else if(ol(e.charCodeAt(0)))Ee({},ng);else if(n)e==="]"&&(n=!1);else if(e==="/"){r=!0;break}else e==="["&&(n=!0);return r||Ee({},ng),i=t.substr(1,t.length-2),{value:i,literal:t}}function QD(){var e,t,n;for(t="",n="";H<Nt&&(e=ne[H],!!ih(e.charCodeAt(0)));)++H,e==="\\"&&H<Nt?Ee({},At,Bt):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&Ee({},tg,n),{value:n,literal:t}}function XD(){var e,t,n,r;return Be=null,Rw(),e=H,t=ZD(),n=QD(),r=YD(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:H}}function KD(e){return e.type===Fa||e.type===xi||e.type===th||e.type===nh}function Fw(){if(Rw(),H>=Nt)return{type:nl,start:H,end:H};const e=ne.charCodeAt(H);return sl(e)?VD():e===40||e===41||e===59?ag():e===39||e===34?WD():e===46?Lr(ne.charCodeAt(H+1))?Bw():ag():Lr(e)?Bw():ag()}function tn(){const e=Be;return H=e.end,Be=Fw(),H=e.end,e}function Pw(){const e=H;Be=Fw(),H=e}function JD(e){const t=new Un(AD);return t.elements=e,t}function Mw(e,t,n){const r=new Un(e==="||"||e==="&&"?kD:ED);return r.operator=e,r.left=t,r.right=n,r}function e7(e,t){const n=new Un(SD);return n.callee=e,n.arguments=t,n}function t7(e,t,n){const r=new Un(_D);return r.test=e,r.consequent=t,r.alternate=n,r}function og(e){const t=new Un(Tw);return t.name=e,t}function cl(e){const t=new Un(CD);return t.value=e.value,t.raw=ne.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function Ow(e,t,n){const r=new Un(TD);return r.computed=e==="[",r.object=t,r.property=n,r.computed||(n.member=!0),r}function n7(e){const t=new Un(ID);return t.properties=e,t}function Lw(e,t,n){const r=new Un(RD);return r.key=t,r.value=n,r.kind=e,r}function r7(e,t){const n=new Un(DD);return n.operator=e,n.argument=t,n.prefix=!0,n}function Ee(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(a,o)=>(rh(o<r.length,"Message reference must be in range"),r[o]));throw n=new Error(i),n.index=H,n.description=i,n}function ah(e){e.type===nl&&Ee(e,OD),e.type===Pa&&Ee(e,BD),e.type===rl&&Ee(e,FD),e.type===Fa&&Ee(e,PD),e.type===xi&&Ee(e,MD),Ee(e,At,e.value)}function zt(e){const t=tn();(t.type!==en||t.value!==e)&&ah(t)}function qe(e){return Be.type===en&&Be.value===e}function sg(e){return Be.type===xi&&Be.value===e}function i7(){const e=[];for(H=Be.start,zt("[");!qe("]");)qe(",")?(tn(),e.push(null)):(e.push(Ma()),qe("]")||zt(","));return tn(),JD(e)}function Nw(){H=Be.start;const e=tn();return e.type===rl||e.type===Pa?(e.octal&&Ee(e,Iw),cl(e)):og(e.value)}function a7(){var e,t,n,r;if(H=Be.start,e=Be,e.type===Fa)return n=Nw(),zt(":"),r=Ma(),Lw("init",n,r);if(e.type===nl||e.type===en)ah(e);else return t=Nw(),zt(":"),r=Ma(),Lw("init",t,r)}function o7(){var e=[],t,n,r,i={},a=String;for(H=Be.start,zt("{");!qe("}");)t=a7(),t.key.type===Tw?n=t.key.name:n=a(t.key.value),r="$"+n,Object.prototype.hasOwnProperty.call(i,r)?Ee({},LD):i[r]=!0,e.push(t),qe("}")||zt(",");return zt("}"),n7(e)}function s7(){zt("(");const e=cg();return zt(")"),e}const c7={if:1};function l7(){var e,t,n;if(qe("("))return s7();if(qe("["))return i7();if(qe("{"))return o7();if(e=Be.type,H=Be.start,e===Fa||c7[Be.value])n=og(tn().value);else if(e===rl||e===Pa)Be.octal&&Ee(Be,Iw),n=cl(tn());else{if(e===xi)throw new Error(il);e===th?(t=tn(),t.value=t.value==="true",n=cl(t)):e===nh?(t=tn(),t.value=null,n=cl(t)):qe("/")||qe("/=")?(n=cl(XD()),Pw()):ah(tn())}return n}function u7(){const e=[];if(zt("("),!qe(")"))for(;H<Nt&&(e.push(Ma()),!qe(")"));)zt(",");return zt(")"),e}function f7(){H=Be.start;const e=tn();return KD(e)||ah(e),og(e.value)}function h7(){return zt("."),f7()}function d7(){zt("[");const e=cg();return zt("]"),e}function p7(){var e,t,n;for(e=l7();;)if(qe("."))n=h7(),e=Ow(".",e,n);else if(qe("("))t=u7(),e=e7(e,t);else if(qe("["))n=d7(),e=Ow("[",e,n);else break;return e}function zw(){const e=p7();if(Be.type===en&&(qe("++")||qe("--")))throw new Error(il);return e}function oh(){var e,t;if(Be.type!==en&&Be.type!==xi)t=zw();else{if(qe("++")||qe("--"))throw new Error(il);if(qe("+")||qe("-")||qe("~")||qe("!"))e=tn(),t=oh(),t=r7(e.value,t);else{if(sg("delete")||sg("void")||sg("typeof"))throw new Error(il);t=zw()}}return t}function Uw(e){let t=0;if(e.type!==en&&e.type!==xi)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function g7(){var e,t,n,r,i,a,o,s,c,l;if(e=Be,c=oh(),r=Be,i=Uw(r),i===0)return c;for(r.prec=i,tn(),t=[e,Be],o=oh(),a=[c,r,o];(i=Uw(Be))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,c=a.pop(),t.pop(),n=Mw(s,c,o),a.push(n);r=tn(),r.prec=i,a.push(r),t.push(Be),n=oh(),a.push(n)}for(l=a.length-1,n=a[l],t.pop();l>1;)t.pop(),n=Mw(a[l-1].value,a[l-2],n),l-=2;return n}function Ma(){var e,t,n;return e=g7(),qe("?")&&(tn(),t=Ma(),zt(":"),n=Ma(),e=t7(e,t,n)),e}function cg(){const e=Ma();if(qe(","))throw new Error(il);return e}function m7(e){ne=e,H=0,Nt=ne.length,Be=null,Pw();const t=cg();if(Be.type!==nl)throw new Error("Unexpect token after expression.");return t}var b7={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function $w(e){function t(o,s,c,l){let u=e(s[0]);return c&&(u=c+"("+u+")",c.lastIndexOf("new ",0)===0&&(u="("+u+")")),u+"."+o+(l<0?"":l===0?"()":"("+s.slice(1).map(e).join(",")+")")}function n(o,s,c){return l=>t(o,l,s,c)}const r="new Date",i="String",a="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&it("Missing arguments to clamp function."),o.length>3&&it("Too many arguments to clamp function.");const s=o.map(e);return"Math.max("+s[1]+", Math.min("+s[2]+","+s[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:r,date:n("getDate",r,0),day:n("getDay",r,0),year:n("getFullYear",r,0),month:n("getMonth",r,0),hours:n("getHours",r,0),minutes:n("getMinutes",r,0),seconds:n("getSeconds",r,0),milliseconds:n("getMilliseconds",r,0),time:n("getTime",r,0),timezoneoffset:n("getTimezoneOffset",r,0),utcdate:n("getUTCDate",r,0),utcday:n("getUTCDay",r,0),utcyear:n("getUTCFullYear",r,0),utcmonth:n("getUTCMonth",r,0),utchours:n("getUTCHours",r,0),utcminutes:n("getUTCMinutes",r,0),utcseconds:n("getUTCSeconds",r,0),utcmilliseconds:n("getUTCMilliseconds",r,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",i,0),lower:n("toLowerCase",i,0),substring:n("substring",i),split:n("split",i),trim:n("trim",i,0),regexp:a,test:n("test",a),if:function(o){o.length<3&&it("Missing arguments to if function."),o.length>3&&it("Too many arguments to if function.");const s=o.map(e);return"("+s[0]+"?"+s[1]+":"+s[2]+")"}}}function y7(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function v7(e){e=e||{};const t=e.allowed?Nf(e.allowed):{},n=e.forbidden?Nf(e.forbidden):{},r=e.constants||b7,i=(e.functions||$w)(f),a=e.globalvar,o=e.fieldvar,s=Kt(a)?a:p=>`${a}["${p}"]`;let c={},l={},u=0;function f(p){if(Me(p))return p;const g=h[p.type];return g==null&&it("Unsupported type: "+p.type),g(p)}const h={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return u>0?g:va(n,g)?it("Illegal identifier: "+g):va(r,g)?r[g]:va(t,g)?g:(c[g]=1,s(g))},MemberExpression:p=>{const g=!p.computed,b=f(p.object);g&&(u+=1);const v=f(p.property);return b===o&&(l[y7(v)]=1),g&&(u-=1),b+(g?"."+v:"["+v+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&it("Illegal callee type: "+p.callee.type);const g=p.callee.name,b=p.arguments,v=va(i,g)&&i[g];return v||it("Unrecognized function: "+g),Kt(v)?v(b):v+"("+b.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{u+=1;const g=f(p.key);return u-=1,g+":"+f(p.value)}};function d(p){const g={code:f(p),globals:Object.keys(c),fields:Object.keys(l)};return c={},l={},g}return d.functions=i,d.constants=r,d}function lg(e,t,n){return n=(n-e)/(t-e),n=Math.max(0,Math.min(1,n)),n*n*(3-2*n)}function Ai(e,t=0,n=1){return Math.max(t,Math.min(n,e))}function w7(e,t,n){return Ai((n-e)/(t-e),0,1)}const Hw={clamp:Ai,isArray:Qt,isBoolean:kc,isDefined(e){return e!==void 0},isNumber:ft,isObject:Xt,isRegExp:EI,isString:Me,isValid(e){return e!=null&&e===e},lerp:lv,linearstep:w7,smoothstep:lg};function x7(e){const t=$w(e);for(const n in Hw)t[n]=`this.${n}`;return t}const A7=v7({forbidden:[],allowed:["datum"],globalvar:"globalObject",fieldvar:"datum",functions:x7});function sh(e,t={}){try{const n=m7(e),r=A7(n),i=Function("datum","globalObject",`"use strict"; return (${r.code});`).bind(Hw),a=o=>i(o,t);return a.fields=r.fields,a.globals=r.globals,a.code=r.code,a}catch(n){throw new Error(`Invalid expression: ${e}, ${n.message}`)}}function lr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ei(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const ug=Symbol("implicit");function fg(){var e=new gi,t=[],n=[],r=ug;function i(a){let o=e.get(a);if(o===void 0){if(r!==ug)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new gi;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return fg(t,n).unknown(r)},lr.apply(i,arguments),i}function Qo(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ll(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Si(){}var Oa=.7,Xo=1/Oa,Ko="\\s*([+-]?\\d+)\\s*",ul="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ur="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E7=/^#([0-9a-f]{3,8})$/,S7=new RegExp(`^rgb\\(${Ko},${Ko},${Ko}\\)$`),_7=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),C7=new RegExp(`^rgba\\(${Ko},${Ko},${Ko},${ul}\\)$`),k7=new RegExp(`^rgba\\(${ur},${ur},${ur},${ul}\\)$`),T7=new RegExp(`^hsl\\(${ul},${ur},${ur}\\)$`),I7=new RegExp(`^hsla\\(${ul},${ur},${ur},${ul}\\)$`),Gw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Qo(Si,_i,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Vw,formatHex:Vw,formatHex8:R7,formatHsl:D7,formatRgb:jw,toString:jw});function Vw(){return this.rgb().formatHex()}function R7(){return this.rgb().formatHex8()}function D7(){return Qw(this).formatHsl()}function jw(){return this.rgb().formatRgb()}function _i(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=E7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?qw(t):n===3?new Et(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ch(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ch(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=S7.exec(e))?new Et(t[1],t[2],t[3],1):(t=_7.exec(e))?new Et(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=C7.exec(e))?ch(t[1],t[2],t[3],t[4]):(t=k7.exec(e))?ch(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=T7.exec(e))?Zw(t[1],t[2]/100,t[3]/100,1):(t=I7.exec(e))?Zw(t[1],t[2]/100,t[3]/100,t[4]):Gw.hasOwnProperty(e)?qw(Gw[e]):e==="transparent"?new Et(NaN,NaN,NaN,0):null}function qw(e){return new Et(e>>16&255,e>>8&255,e&255,1)}function ch(e,t,n,r){return r<=0&&(e=t=n=NaN),new Et(e,t,n,r)}function hg(e){return e instanceof Si||(e=_i(e)),e?(e=e.rgb(),new Et(e.r,e.g,e.b,e.opacity)):new Et}function lh(e,t,n,r){return arguments.length===1?hg(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Qo(Et,lh,ll(Si,{brighter(e){return e=e==null?Xo:Math.pow(Xo,e),new Et(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new Et(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Et(La(this.r),La(this.g),La(this.b),uh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ww,formatHex:Ww,formatHex8:B7,formatRgb:Yw,toString:Yw}));function Ww(){return`#${Na(this.r)}${Na(this.g)}${Na(this.b)}`}function B7(){return`#${Na(this.r)}${Na(this.g)}${Na(this.b)}${Na((isNaN(this.opacity)?1:this.opacity)*255)}`}function Yw(){const e=uh(this.opacity);return`${e===1?"rgb(":"rgba("}${La(this.r)}, ${La(this.g)}, ${La(this.b)}${e===1?")":`, ${e})`}`}function uh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function La(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Na(e){return e=La(e),(e<16?"0":"")+e.toString(16)}function Zw(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $n(e,t,n,r)}function Qw(e){if(e instanceof $n)return new $n(e.h,e.s,e.l,e.opacity);if(e instanceof Si||(e=_i(e)),!e)return new $n;if(e instanceof $n)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(t===a?o=(n-r)/s+(n<r)*6:n===a?o=(r-t)/s+2:o=(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new $n(o,s,c,e.opacity)}function dg(e,t,n,r){return arguments.length===1?Qw(e):new $n(e,t,n,r??1)}function $n(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qo($n,dg,ll(Si,{brighter(e){return e=e==null?Xo:Math.pow(Xo,e),new $n(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new $n(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Et(pg(e>=240?e-240:e+120,i,r),pg(e,i,r),pg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new $n(Xw(this.h),fh(this.s),fh(this.l),uh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=uh(this.opacity);return`${e===1?"hsl(":"hsla("}${Xw(this.h)}, ${fh(this.s)*100}%, ${fh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xw(e){return e=(e||0)%360,e<0?e+360:e}function fh(e){return Math.max(0,Math.min(1,e||0))}function pg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Kw=Math.PI/180,Jw=180/Math.PI,hh=18,ex=.96422,tx=1,nx=.82521,rx=4/29,Jo=6/29,ix=3*Jo*Jo,F7=Jo*Jo*Jo;function ax(e){if(e instanceof fr)return new fr(e.l,e.a,e.b,e.opacity);if(e instanceof Nr)return ox(e);e instanceof Et||(e=hg(e));var t=vg(e.r),n=vg(e.g),r=vg(e.b),i=mg((.2225045*t+.7168786*n+.0606169*r)/tx),a,o;return t===n&&n===r?a=o=i:(a=mg((.4360747*t+.3850649*n+.1430804*r)/ex),o=mg((.0139322*t+.0971045*n+.7141733*r)/nx)),new fr(116*i-16,500*(a-i),200*(i-o),e.opacity)}function gg(e,t,n,r){return arguments.length===1?ax(e):new fr(e,t,n,r??1)}function fr(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Qo(fr,gg,ll(Si,{brighter(e){return new fr(this.l+hh*(e??1),this.a,this.b,this.opacity)},darker(e){return new fr(this.l-hh*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=ex*bg(t),e=tx*bg(e),n=nx*bg(n),new Et(yg(3.1338561*t-1.6168667*e-.4906146*n),yg(-.9787684*t+1.9161415*e+.033454*n),yg(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function mg(e){return e>F7?Math.pow(e,1/3):e/ix+rx}function bg(e){return e>Jo?e*e*e:ix*(e-rx)}function yg(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function vg(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function P7(e){if(e instanceof Nr)return new Nr(e.h,e.c,e.l,e.opacity);if(e instanceof fr||(e=ax(e)),e.a===0&&e.b===0)return new Nr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Jw;return new Nr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function wg(e,t,n,r){return arguments.length===1?P7(e):new Nr(e,t,n,r??1)}function Nr(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function ox(e){if(isNaN(e.h))return new fr(e.l,0,0,e.opacity);var t=e.h*Kw;return new fr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Qo(Nr,wg,ll(Si,{brighter(e){return new Nr(this.h,this.c,this.l+hh*(e??1),this.opacity)},darker(e){return new Nr(this.h,this.c,this.l-hh*(e??1),this.opacity)},rgb(){return ox(this).rgb()}}));var sx=-.14861,xg=1.78277,Ag=-.29227,dh=-.90649,fl=1.97294,cx=fl*dh,lx=fl*xg,ux=xg*Ag-dh*sx;function M7(e){if(e instanceof za)return new za(e.h,e.s,e.l,e.opacity);e instanceof Et||(e=hg(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(ux*r+cx*t-lx*n)/(ux+cx-lx),a=r-i,o=(fl*(n-i)-Ag*a)/dh,s=Math.sqrt(o*o+a*a)/(fl*i*(1-i)),c=s?Math.atan2(o,a)*Jw-120:NaN;return new za(c<0?c+360:c,s,i,e.opacity)}function Eg(e,t,n,r){return arguments.length===1?M7(e):new za(e,t,n,r??1)}function za(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qo(za,Eg,ll(Si,{brighter(e){return e=e==null?Xo:Math.pow(Xo,e),new za(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oa:Math.pow(Oa,e),new za(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Kw,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Et(255*(t+n*(sx*r+xg*i)),255*(t+n*(Ag*r+dh*i)),255*(t+n*(fl*r)),this.opacity)}}));function fx(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function hx(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r<t-1?e[r+2]:2*a-i;return fx((n-r/t)*t,o,i,a,s)}}function dx(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],a=e[r%t],o=e[(r+1)%t],s=e[(r+2)%t];return fx((n-r/t)*t,i,a,o,s)}}const ph=e=>()=>e;function px(e,t){return function(n){return e+n*t}}function O7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function gh(e,t){var n=t-e;return n?px(e,n>180||n<-180?n-360*Math.round(n/360):n):ph(isNaN(e)?t:e)}function L7(e){return(e=+e)==1?St:function(t,n){return n-t?O7(t,n,e):ph(isNaN(t)?n:t)}}function St(e,t){var n=t-e;return n?px(e,n):ph(isNaN(e)?t:e)}const Sg=function e(t){var n=L7(t);function r(i,a){var o=n((i=lh(i)).r,(a=lh(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),l=St(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=c(u),i.opacity=l(u),i+""}}return r.gamma=e,r}(1);function gx(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o,s;for(o=0;o<n;++o)s=lh(t[o]),r[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return r=e(r),i=e(i),a=e(a),s.opacity=1,function(c){return s.r=r(c),s.g=i(c),s.b=a(c),s+""}}}var N7=gx(hx),z7=gx(dx);function _g(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function mx(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function U7(e,t){return(mx(t)?_g:bx)(e,t)}function bx(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Ci(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(s){for(o=0;o<r;++o)a[o]=i[o](s);return a}}function yx(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Hn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function vx(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Ci(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Cg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kg=new RegExp(Cg.source,"g");function $7(e){return function(){return e}}function H7(e){return function(t){return e(t)+""}}function wx(e,t){var n=Cg.lastIndex=kg.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e=e+"",t=t+"";(r=Cg.exec(e))&&(i=kg.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Hn(r,i)})),n=kg.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?H7(c[0].x):$7(t):(t=c.length,function(l){for(var u=0,f;u<t;++u)s[(f=c[u]).i]=f.x(l);return s.join("")})}function Ci(e,t){var n=typeof t,r;return t==null||n==="boolean"?ph(t):(n==="number"?Hn:n==="string"?(r=_i(t))?(t=r,Sg):wx:t instanceof _i?Sg:t instanceof Date?yx:mx(t)?_g:Array.isArray(t)?bx:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?vx:Hn)(e,t)}function G7(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function V7(e,t){var n=gh(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function hl(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var xx=180/Math.PI,Tg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ax(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*xx,skewX:Math.atan(c)*xx,scaleX:o,scaleY:s}}var mh;function j7(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Tg:Ax(t.a,t.b,t.c,t.d,t.e,t.f)}function q7(e){return e==null||(mh||(mh=document.createElementNS("http://www.w3.org/2000/svg","g")),mh.setAttribute("transform",e),!(e=mh.transform.baseVal.consolidate()))?Tg:(e=e.matrix,Ax(e.a,e.b,e.c,e.d,e.e,e.f))}function Ex(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,u,f,h,d,p){if(l!==f||u!==h){var g=d.push("translate(",null,t,null,n);p.push({i:g-4,x:Hn(l,f)},{i:g-2,x:Hn(u,h)})}else(f||h)&&d.push("translate("+f+t+h+n)}function o(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Hn(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function s(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Hn(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function c(l,u,f,h,d,p){if(l!==f||u!==h){var g=d.push(i(d)+"scale(",null,",",null,")");p.push({i:g-4,x:Hn(l,f)},{i:g-2,x:Hn(u,h)})}else(f!==1||h!==1)&&d.push(i(d)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=e(l),u=e(u),a(l.translateX,l.translateY,u.translateX,u.translateY,f,h),o(l.rotate,u.rotate,f,h),s(l.skewX,u.skewX,f,h),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(d){for(var p=-1,g=h.length,b;++p<g;)f[(b=h[p]).i]=b.x(d);return f.join("")}}}var W7=Ex(j7,"px, ","px)","deg)"),Y7=Ex(q7,", ",")",")"),Z7=1e-12;function Sx(e){return((e=Math.exp(e))+1/e)/2}function Q7(e){return((e=Math.exp(e))-1/e)/2}function X7(e){return((e=Math.exp(2*e))-1)/(e+1)}const K7=function e(t,n,r){function i(a,o){var s=a[0],c=a[1],l=a[2],u=o[0],f=o[1],h=o[2],d=u-s,p=f-c,g=d*d+p*p,b,v;if(g<Z7)v=Math.log(h/l)/t,b=function(I){return[s+I*d,c+I*p,l*Math.exp(t*I*v)]};else{var x=Math.sqrt(g),A=(h*h-l*l+r*g)/(2*l*n*x),w=(h*h-l*l-r*g)/(2*h*n*x),_=Math.log(Math.sqrt(A*A+1)-A),C=Math.log(Math.sqrt(w*w+1)-w);v=(C-_)/t,b=function(I){var D=I*v,B=Sx(_),G=l/(n*x)*(B*X7(t*D+_)-Q7(_));return[s+G*d,c+G*p,l*B/Sx(t*D+_)]}}return b.duration=v*1e3*t/Math.SQRT2,b}return i.rho=function(a){var o=Math.max(.001,+a),s=o*o,c=s*s;return e(o,s,c)},i}(Math.SQRT2,2,4);function _x(e){return function(t,n){var r=e((t=dg(t)).h,(n=dg(n)).h),i=St(t.s,n.s),a=St(t.l,n.l),o=St(t.opacity,n.opacity);return function(s){return t.h=r(s),t.s=i(s),t.l=a(s),t.opacity=o(s),t+""}}}const J7=_x(gh);var eB=_x(St);function tB(e,t){var n=St((e=gg(e)).l,(t=gg(t)).l),r=St(e.a,t.a),i=St(e.b,t.b),a=St(e.opacity,t.opacity);return function(o){return e.l=n(o),e.a=r(o),e.b=i(o),e.opacity=a(o),e+""}}function Cx(e){return function(t,n){var r=e((t=wg(t)).h,(n=wg(n)).h),i=St(t.c,n.c),a=St(t.l,n.l),o=St(t.opacity,n.opacity);return function(s){return t.h=r(s),t.c=i(s),t.l=a(s),t.opacity=o(s),t+""}}}const nB=Cx(gh);var rB=Cx(St);function kx(e){return function t(n){n=+n;function r(i,a){var o=e((i=Eg(i)).h,(a=Eg(a)).h),s=St(i.s,a.s),c=St(i.l,a.l),l=St(i.opacity,a.opacity);return function(u){return i.h=o(u),i.s=s(u),i.l=c(Math.pow(u,n)),i.opacity=l(u),i+""}}return r.gamma=t,r}(1)}const iB=kx(gh);var aB=kx(St);function Ig(e,t){t===void 0&&(t=e,e=Ci);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var s=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[s](o-s)}}function oB(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const sB=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Ci,interpolateArray:U7,interpolateBasis:hx,interpolateBasisClosed:dx,interpolateCubehelix:iB,interpolateCubehelixLong:aB,interpolateDate:yx,interpolateDiscrete:G7,interpolateHcl:nB,interpolateHclLong:rB,interpolateHsl:J7,interpolateHslLong:eB,interpolateHue:V7,interpolateLab:tB,interpolateNumber:Hn,interpolateNumberArray:_g,interpolateObject:vx,interpolateRgb:Sg,interpolateRgbBasis:N7,interpolateRgbBasisClosed:z7,interpolateRound:hl,interpolateString:wx,interpolateTransformCss:W7,interpolateTransformSvg:Y7,interpolateZoom:K7,piecewise:Ig,quantize:oB},Symbol.toStringTag,{value:"Module"}));function cB(e){return function(){return e}}function Rg(e){return+e}var Tx=[0,1];function nn(e){return e}function Dg(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:cB(isNaN(t)?NaN:.5)}function lB(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function uB(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Dg(i,r),a=n(o,a)):(r=Dg(r,i),a=n(a,o)),function(s){return a(r(s))}}function fB(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Dg(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(s){var c=Fr(e,s,1,r)-1;return a[c](i[c](s))}}function dl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function bh(){var e=Tx,t=Tx,n=Ci,r,i,a,o=nn,s,c,l;function u(){var h=Math.min(e.length,t.length);return o!==nn&&(o=lB(e[0],e[h-1])),s=h>2?fB:uB,c=l=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=s(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(i((l||(l=s(t,e.map(r),Hn)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Rg),u()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),u()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=hl,u()},f.clamp=function(h){return arguments.length?(o=h?!0:nn,u()):o!==nn},f.interpolate=function(h){return arguments.length?(n=h,u()):n},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,d){return r=h,i=d,u()}}function Ix(){return bh()(nn,nn)}function Rx(e,t,n,r){var i=xa(e,t,n),a;switch(r=bi(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Cv(i,o))&&(r.precision=a),Rp(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=kv(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=_v(i))&&(r.precision=a-(r.type==="%")*2);break}}return pt(r)}function Ua(e){var t=e.domain;return e.ticks=function(n){var r=t();return Dc(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Rx(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=Bc(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function yh(){var e=Ix();return e.copy=function(){return dl(e,yh())},lr.apply(e,arguments),Ua(e)}function Dx(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Rg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Dx(e).unknown(t)},e=arguments.length?Array.from(e,Rg):[0,1],Ua(n)}function Bx(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function Fx(e){return Math.log(e)}function Px(e){return Math.exp(e)}function hB(e){return-Math.log(-e)}function dB(e){return-Math.exp(-e)}function pB(e){return isFinite(e)?+("1e"+e):e<0?0:e}function gB(e){return e===10?pB:e===Math.E?Math.exp:t=>Math.pow(e,t)}function mB(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Mx(e){return(t,n)=>-e(-t,n)}function Bg(e){const t=e(Fx,Px),n=t.domain;let r=10,i,a;function o(){return i=mB(r),a=gB(r),n()[0]<0?(i=Mx(i),a=Mx(a),e(hB,dB)):e(Fx,Px),t}return t.base=function(s){return arguments.length?(r=+s,o()):r},t.domain=function(s){return arguments.length?(n(s),o()):n()},t.ticks=s=>{const c=n();let l=c[0],u=c[c.length-1];const f=u<l;f&&([l,u]=[u,l]);let h=i(l),d=i(u),p,g;const b=s==null?10:+s;let v=[];if(!(r%1)&&d-h<b){if(h=Math.floor(h),d=Math.ceil(d),l>0){for(;h<=d;++h)for(p=1;p<r;++p)if(g=h<0?p/a(-h):p*a(h),!(g<l)){if(g>u)break;v.push(g)}}else for(;h<=d;++h)for(p=r-1;p>=1;--p)if(g=h>0?p/a(-h):p*a(h),!(g<l)){if(g>u)break;v.push(g)}v.length*2<b&&(v=Dc(l,u,b))}else v=Dc(h,d,Math.min(d-h,b)).map(a);return f?v.reverse():v},t.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=bi(c)).precision==null&&(c.trim=!0),c=pt(c)),s===1/0)return c;const l=Math.max(1,r*s/t.ticks().length);return u=>{let f=u/a(Math.round(i(u)));return f*r<r-.5&&(f*=r),f<=l?c(u):""}},t.nice=()=>n(Bx(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function Fg(){const e=Bg(bh()).domain([1,10]);return e.copy=()=>dl(e,Fg()).base(e.base()),lr.apply(e,arguments),e}function Ox(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Lx(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Pg(e){var t=1,n=e(Ox(t),Lx(t));return n.constant=function(r){return arguments.length?e(Ox(t=+r),Lx(t)):t},Ua(n)}function Nx(){var e=Pg(bh());return e.copy=function(){return dl(e,Nx()).constant(e.constant())},lr.apply(e,arguments)}function zx(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function bB(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function yB(e){return e<0?-e*e:e*e}function Mg(e){var t=e(nn,nn),n=1;function r(){return n===1?e(nn,nn):n===.5?e(bB,yB):e(zx(n),zx(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Ua(t)}function Og(){var e=Mg(bh());return e.copy=function(){return dl(e,Og()).exponent(e.exponent())},lr.apply(e,arguments),e}function vB(){return Og.apply(null,arguments).exponent(.5)}function Ux(){var e=[],t=[],n=[],r;function i(){var o=0,s=Math.max(1,t.length);for(n=new Array(s-1);++o<s;)n[o-1]=Tp(e,o/s);return a}function a(o){return o==null||isNaN(o=+o)?r:t[Fr(n,o)]}return a.invertExtent=function(o){var s=t.indexOf(o);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let s of o)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(wa),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return Ux().domain(e).range(t).unknown(r)},lr.apply(a,arguments)}function $x(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(c){return c!=null&&c<=c?i[Fr(r,c,0,n)]:a}function s(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,s()):[e,t]},o.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,s()):i.slice()},o.invertExtent=function(c){var l=i.indexOf(c);return l<0?[NaN,NaN]:l<1?[e,r[0]]:l>=n?[r[n-1],t]:[r[l-1],r[l]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return $x().domain([e,t]).range(i).unknown(a)},lr.apply(Ua(o),arguments)}function Hx(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Fr(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Hx().domain(e).range(t).unknown(n)},lr.apply(i,arguments)}function wB(e){return new Date(e)}function xB(e){return e instanceof Date?+e:+new Date(+e)}function Lg(e,t,n,r,i,a,o,s,c,l){var u=Ix(),f=u.invert,h=u.domain,d=l(".%L"),p=l(":%S"),g=l("%I:%M"),b=l("%I %p"),v=l("%a %d"),x=l("%b %d"),A=l("%B"),w=l("%Y");function _(C){return(c(C)<C?d:s(C)<C?p:o(C)<C?g:a(C)<C?b:r(C)<C?i(C)<C?v:x:n(C)<C?A:w)(C)}return u.invert=function(C){return new Date(f(C))},u.domain=function(C){return arguments.length?h(Array.from(C,xB)):h().map(wB)},u.ticks=function(C){var I=h();return e(I[0],I[I.length-1],C??10)},u.tickFormat=function(C,I){return I==null?_:l(I)},u.nice=function(C){var I=h();return(!C||typeof C.range!="function")&&(C=t(I[0],I[I.length-1],C??10)),C?h(Bx(I,C)):u},u.copy=function(){return dl(u,Lg(e,t,n,r,i,a,o,s,c,l))},u}function AB(){return lr.apply(Lg(xR,AR,vi,Pc,Fc,Ea,Lp,Op,yi,jp).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function EB(){return lr.apply(Lg(vR,wR,wi,Oc,Mc,_a,Up,zp,yi,qp).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function vh(){var e=0,t=1,n,r,i,a,o=nn,s=!1,c;function l(f){return f==null||isNaN(f=+f)?c:o(i===0?.5:(f=(a(f)-n)*i,s?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(f){return arguments.length?(s=!!f,l):s},l.interpolator=function(f){return arguments.length?(o=f,l):o};function u(f){return function(h){var d,p;return arguments.length?([d,p]=h,o=f(d,p),l):[o(0),o(1)]}}return l.range=u(Ci),l.rangeRound=u(hl),l.unknown=function(f){return arguments.length?(c=f,l):c},function(f){return a=f,n=f(e),r=f(t),i=n===r?0:1/(r-n),l}}function ki(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Ng(){var e=Ua(vh()(nn));return e.copy=function(){return ki(e,Ng())},Ei.apply(e,arguments)}function Gx(){var e=Bg(vh()).domain([1,10]);return e.copy=function(){return ki(e,Gx()).base(e.base())},Ei.apply(e,arguments)}function Vx(){var e=Pg(vh());return e.copy=function(){return ki(e,Vx()).constant(e.constant())},Ei.apply(e,arguments)}function zg(){var e=Mg(vh());return e.copy=function(){return ki(e,zg()).exponent(e.exponent())},Ei.apply(e,arguments)}function SB(){return zg.apply(null,arguments).exponent(.5)}function wh(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=nn,u,f=!1,h;function d(g){return isNaN(g=+g)?h:(g=.5+((g=+u(g))-a)*(r*g<r*a?s:c),l(f?Math.max(0,Math.min(1,g)):g))}d.domain=function(g){return arguments.length?([e,t,n]=g,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,d):[e,t,n]},d.clamp=function(g){return arguments.length?(f=!!g,d):f},d.interpolator=function(g){return arguments.length?(l=g,d):l};function p(g){return function(b){var v,x,A;return arguments.length?([v,x,A]=b,l=Ig(g,[v,x,A]),d):[l(0),l(.5),l(1)]}}return d.range=p(Ci),d.rangeRound=p(hl),d.unknown=function(g){return arguments.length?(h=g,d):h},function(g){return u=g,i=g(e),a=g(t),o=g(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,d}}function jx(){var e=Ua(wh()(nn));return e.copy=function(){return ki(e,jx())},Ei.apply(e,arguments)}function qx(){var e=Bg(wh()).domain([.1,1,10]);return e.copy=function(){return ki(e,qx()).base(e.base())},Ei.apply(e,arguments)}function Wx(){var e=Pg(wh());return e.copy=function(){return ki(e,Wx()).constant(e.constant())},Ei.apply(e,arguments)}function Ug(){var e=Mg(wh());return e.copy=function(){return ki(e,Ug()).exponent(e.exponent())},Ei.apply(e,arguments)}function _B(){return Ug.apply(null,arguments).exponent(.5)}function $g(e,t,n){const r=e-t+n*2;return e?r>0?r:1:0}const CB="identity",es="linear",Ti="log",pl="pow",gl="sqrt",xh="symlog",Yx="time",Zx="utc",hr="sequential",ts="diverging",Hg="quantile",Qx="quantize",Xx="threshold",Gg="ordinal",Vg="point",Kx="band",jg="bin-ordinal",gt="continuous",ml="discrete",bl="discretizing",An="interpolating",Jx="temporal";function kB(e){return function(t){let n=t[0],r=t[1],i;return r<n&&(i=n,n=r,r=i),[e.invert(n),e.invert(r)]}}function TB(e){return function(t){const n=e.range();let r=t[0],i=t[1],a=-1,o,s,c,l;for(i<r&&(s=r,r=i,i=s),c=0,l=n.length;c<l;++c)n[c]>=r&&n[c]<=i&&(a<0&&(a=c),o=c);if(!(a<0))return r=e.invertExtent(n[a]),i=e.invertExtent(n[o]),[r[0]===void 0?r[1]:r[0],i[1]===void 0?i[0]:i[1]]}}function qg(){const e=fg().unknown(void 0),t=e.domain,n=e.range;let r=[0,1],i,a,o=!1,s=0,c=0,l=.5;delete e.unknown;function u(){const f=t().length,h=r[1]<r[0],d=r[1-h],p=$g(f,s,c);let g=r[h-0];i=(d-g)/(p||1),o&&(i=Math.floor(i)),g+=(d-g-i*(f-s))*l,a=i*(1-s),o&&(g=Math.round(g),a=Math.round(a));const b=mi(f).map(v=>g+i*v);return n(h?b.reverse():b)}return e.domain=function(f){return arguments.length?(t(f),u()):t()},e.range=function(f){return arguments.length?(r=[+f[0],+f[1]],u()):r.slice()},e.rangeRound=function(f){return r=[+f[0],+f[1]],o=!0,u()},e.bandwidth=function(){return a},e.step=function(){return i},e.round=function(f){return arguments.length?(o=!!f,u()):o},e.padding=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),s=c,u()):s},e.paddingInner=function(f){return arguments.length?(s=Math.max(0,Math.min(1,f)),u()):s},e.paddingOuter=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),u()):c},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),u()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const h=r[1]<r[0],d=h?n().reverse():n(),p=d.length-1;let g=+f[0],b=+f[1],v,x,A;if(!(g!==g||b!==b)&&(b<g&&(A=g,g=b,b=A),!(b<d[0]||g>r[1-h])))return v=Math.max(0,Fr(d,g)-1),x=g===b?v:Fr(d,b)-1,g-d[v]>a+1e-10&&++v,h&&(A=v,v=p-x,x=p-A),v>x?void 0:t().slice(v,x+1)},e.invert=function(f){const h=e.invertRange([f,f]);return h&&h[0]},e.copy=function(){return qg().domain(t()).range(r).round(o).paddingInner(s).paddingOuter(c).align(l)},u()}function e3(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return e3(t())},e}function IB(){return e3(qg().paddingInner(1))}var RB=Array.prototype.map;function DB(e){return RB.call(e,Cc)}const BB=Array.prototype.slice;function t3(){let e=[],t=[];function n(r){return r==null||r!==r?void 0:t[(Fr(e,r)-1)%t.length]}return n.domain=function(r){return arguments.length?(e=DB(r),n):e.slice()},n.range=function(r){return arguments.length?(t=BB.call(r),n):t.slice()},n.tickFormat=function(r,i){return Rx(e[0],zn(e),r??10,i)},n.copy=function(){return t3().domain(n.domain()).range(n.range())},n}const Ah={};function FB(e,t,n){const r=function(){const a=t();return a.invertRange||(a.invertRange=a.invert?kB(a):a.invertExtent?TB(a):void 0),a.type=e,a};return r.metadata=Nf(yp(n)),r}function ke(e,t,n){return arguments.length>1?(Ah[e]=FB(e,t,n),this):PB(e)?Ah[e]:void 0}ke(CB,Dx),ke(es,yh,gt),ke(Ti,Fg,[gt,Ti]),ke(pl,Og,gt),ke(gl,vB,gt),ke(xh,Nx,gt),ke(Yx,AB,[gt,Jx]),ke(Zx,EB,[gt,Jx]),ke(hr,Ng,[gt,An]),ke("".concat(hr,"-").concat(es),Ng,[gt,An]),ke("".concat(hr,"-").concat(Ti),Gx,[gt,An,Ti]),ke("".concat(hr,"-").concat(pl),zg,[gt,An]),ke("".concat(hr,"-").concat(gl),SB,[gt,An]),ke("".concat(hr,"-").concat(xh),Vx,[gt,An]),ke("".concat(ts,"-").concat(es),jx,[gt,An]),ke("".concat(ts,"-").concat(Ti),qx,[gt,An,Ti]),ke("".concat(ts,"-").concat(pl),Ug,[gt,An]),ke("".concat(ts,"-").concat(gl),_B,[gt,An]),ke("".concat(ts,"-").concat(xh),Wx,[gt,An]),ke(Hg,Ux,[bl,Hg]),ke(Qx,$x,bl),ke(Xx,Hx,bl),ke(jg,t3,[ml,bl]),ke(Gg,fg,ml),ke(Kx,qg,ml),ke(Vg,IB,ml);function PB(e){return va(Ah,e)}function yl(e,t){const n=Ah[e];return n&&n.metadata[t]}function _t(e){return yl(e,gt)}function zr(e){return yl(e,ml)}function Ii(e){return yl(e,bl)}function n3(e){return yl(e,Ti)}function Eh(e){return yl(e,An)}function MB(e,t){const n=t[0],r=zn(t)-n;return function(i){return e(n+i*r)}}function Sh(e,t,n){return Ig(r3(t||"rgb",n),e)}function OB(e,t){const n=new Array(t),r=t+1;for(let i=0;i<t;)n[i]=e(++i/r);return n}function r3(e,t){const n=sB[LB(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function LB(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const NB={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},zB={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function i3(e){const t=e.length/6|0,n=new Array(t);for(let r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function a3(e,t){for(const n in e)Wg(n,t(e[n]))}const o3={};a3(zB,i3),a3(NB,e=>Sh(i3(e)));function Wg(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(o3[e]=t,this):o3[e]}function UB(){let e=0,t,n=0;const r=new Map,i=a=>(a===t||(n=r.get(a),n===void 0&&(n=e++,r.set(a,n)),t=a),n);return i.addAll=a=>{for(const o of a)i(o)},i.invert=a=>{for(const o of r.entries())if(o[1]==a)return o[0]},i.domain=()=>[...r.keys()],i}function _h(){const e=t=>t;return e.invert=t=>t,e.copy=_h,e.invertRange=()=>{},e.type="null",e}function $B(e,t){const n={};t||(t=e.encoding);for(const[r,i]of Object.entries(t)){if(!i)continue;const a=((rn(i)&&i.resolutionChannel)??(Ri(r)&&r))||void 0,o=e.unitView.getScaleResolution(a);n[r]=HB(t[r],o==null?void 0:o.getScale(),e.unitView.getAccessor(r),r)}return n}function HB(e,t,n,r){let i;if(Gn(e)){const a=e.value;i=o=>a,i.constant=!0,i.constantValue=!0,i.accessor=void 0}else if(n)if(r=="text")i=a=>{},i.accessor=n,i.constant=n.constant;else{if(!t)if(!Ri(r))t=_h();else throw new Error(`Missing scale! "${r}": ${JSON.stringify(e)}`);if(i=a=>t(n(a)),zr(t.type)){const a=UB();a.addAll(t.domain()),i.indexer=a}i.constant=n.constant,i.accessor=n,i.scale=t}else throw new Error(`Missing value or accessor (field, expr, datum) on channel "${r}": ${JSON.stringify(e)}`);return i.invert=t?a=>t.invert(a):a=>{throw new Error("No scale available, cannot invert: "+JSON.stringify(e))},i.channelDef=e,i.applyMetadata=a=>{for(const o in i)o in i&&(a[o]=i[o]);return a},i}function Gn(e){return e&&"value"in e}function Ur(e){return e&&"field"in e}function vl(e){return e&&"datum"in e}function rn(e){return Ur(e)||vl(e)||Zg(e)||s3(e)}function Yg(e,t){const n=e.mark.encoding[t];if(rn(n))return n;throw new Error("Not a channel def with scale!")}function s3(e){return e&&"chrom"in e}function Zg(e){return e&&"expr"in e}const ns=["x","y"],GB=["x2","y2"],VB=[...ns,...GB];function c3(e){return ns.includes(e)}function wl(e){return VB.includes(e)}const Qg={x:"x2",y:"y2"},l3=Object.fromEntries(Object.entries(Qg).map(e=>[e[1],e[0]]));function xl(e){return e in l3}function jB(e){const t=Qg[e];if(t)return t;throw new Error(`${e} has no secondary channel!`)}function $a(e){return l3[e]??e}function Ha(e){return["color","fill","stroke"].includes($a(e))}function Ch(e){return["shape","squeeze"].includes(e)}function Ri(e){return["x","y","x2","y2","color","fill","stroke","opacity","fillOpacity","strokeOpacity","strokeWidth","size","shape","angle","dx","dy","sample"].includes(e)}function qB(e){switch(e){case"shape":return["circle","square","cross","diamond","triangle-up","triangle-right","triangle-down","triangle-left","tick-up","tick-right","tick-down","tick-left"]}}function u3(e){if(!Ch(e))throw new Error("Not a discrete channel: "+e);const t=new Map(qB(e).map((n,r)=>[n,r]));return n=>{const r=t.get(n);if(r!==void 0)return r;throw new Error(`Invalid value for "${e}" channel: ${n}`)}}function Oe(e,t=e){if(/^[A-Za-z0-9_]+$/.test(e)){const n=new Function("datum",`return datum[${JSON.stringify(e)}]`);return De(n,[e],t)}else return Bf(e)}class WB{constructor(){this.accessorCreators=[],this.register(t=>{if(Ur(t))try{const n=Oe(t.field);return n.constant=!1,n.fields=Df(n),n}catch(n){throw new Error(`Invalid field definition: ${n.message}`)}}),this.register(t=>Zg(t)?YB(t.expr):void 0),this.register(t=>{if(vl(t)){const r=vI(t.datum);return r.constant=!0,r.fields=[],r}})}register(t){this.accessorCreators.push(t)}createAccessor(t){for(const n of this.accessorCreators){const r=n(t);if(r)return r}}}function YB(e){const n=sh(e);return n.constant=n.fields.length==0,n}/* @license twgl.js 4.22.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
|
163
163
|
Available via the MIT license.
|
164
|
-
see: http://github.com/greggman/twgl.js for details */const Xg=5120,Al=5121,Kg=5122,Jg=5123,em=5124,tm=5125,nm=5126,ZB=32819,QB=32820,XB=33635,KB=5131,JB=33640,eF=35899,tF=35902,nF=36269,rF=34042,f3={};{const e=f3;e[Xg]=Int8Array,e[Al]=Uint8Array,e[Kg]=Int16Array,e[Jg]=Uint16Array,e[em]=Int32Array,e[tm]=Uint32Array,e[nm]=Float32Array,e[ZB]=Uint16Array,e[QB]=Uint16Array,e[XB]=Uint16Array,e[KB]=Uint16Array,e[JB]=Uint32Array,e[eF]=Uint32Array,e[tF]=Uint32Array,e[nF]=Uint32Array,e[rF]=Uint32Array}function rm(e){if(e instanceof Int8Array)return Xg;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return Al;if(e instanceof Int16Array)return Kg;if(e instanceof Uint16Array)return Jg;if(e instanceof Int32Array)return em;if(e instanceof Uint32Array)return tm;if(e instanceof Float32Array)return nm;throw new Error("unsupported typed array type")}function iF(e){if(e===Int8Array)return Xg;if(e===Uint8Array||e===Uint8ClampedArray)return Al;if(e===Int16Array)return Kg;if(e===Uint16Array)return Jg;if(e===Int32Array)return em;if(e===Uint32Array)return tm;if(e===Float32Array)return nm;throw new Error("unsupported typed array type")}function aF(e){const t=f3[e];if(!t)throw new Error("unknown gl type");return t}const kh=typeof SharedArrayBuffer<"u"?function(t){return t&&t.buffer&&(t.buffer instanceof ArrayBuffer||t.buffer instanceof SharedArrayBuffer)}:function(t){return t&&t.buffer&&t.buffer instanceof ArrayBuffer};function oF(...e){console.error(...e)}function h3(...e){console.warn(...e)}function sF(e,t){return typeof WebGLBuffer<"u"&&t instanceof WebGLBuffer}function d3(e,t){return typeof WebGLRenderbuffer<"u"&&t instanceof WebGLRenderbuffer}function Th(e,t){return typeof WebGLTexture<"u"&&t instanceof WebGLTexture}function cF(e,t){return typeof WebGLSampler<"u"&&t instanceof WebGLSampler}const p3=35044,pr=34962,lF=34963,uF=34660,fF=5120,hF=5121,dF=5122,pF=5123,gF=5124,mF=5125,bF=5126,g3={attribPrefix:""};function m3(e,t,n,r,i){e.bindBuffer(t,n),e.bufferData(t,r,i||p3)}function b3(e,t,n,r){if(sF(e,t))return t;n=n||pr;const i=e.createBuffer();return m3(e,n,i,t,r),i}function y3(e){return e==="indices"}function yF(e){return e instanceof Int8Array||e instanceof Uint8Array}function vF(e){return e===Int8Array||e===Uint8Array}function wF(e){return e.length?e:e.data}const xF=/coord|texture/i,AF=/color|colour/i;function v3(e,t){let n;if(xF.test(e)?n=2:AF.test(e)?n=4:n=3,t%n>0)throw new Error(`Can not guess numComponents for attribute '${e}'. Tried ${n} but ${t} values is not evenly divisible by ${n}. You should specify it.`);return n}function EF(e,t){return e.numComponents||e.size||v3(t,wF(e).length)}function im(e,t){if(kh(e))return e;if(kh(e.data))return e.data;Array.isArray(e)&&(e={data:e});let n=e.type;return n||(y3(t)?n=Uint16Array:n=Float32Array),new n(e.data)}function SF(e,t){const n={};return Object.keys(t).forEach(function(r){if(!y3(r)){const i=t[r],a=i.attrib||i.name||i.attribName||g3.attribPrefix+r;if(i.value){if(!Array.isArray(i.value)&&!kh(i.value))throw new Error("array.value is not array or typedarray");n[a]={value:i.value}}else{let o,s,c,l;if(i.buffer&&i.buffer instanceof WebGLBuffer)o=i.buffer,l=i.numComponents||i.size,s=i.type,c=i.normalize;else if(typeof i=="number"||typeof i.data=="number"){const u=i.data||i,f=i.type||Float32Array,h=u*f.BYTES_PER_ELEMENT;s=iF(f),c=i.normalize!==void 0?i.normalize:vF(f),l=i.numComponents||i.size||v3(r,u),o=e.createBuffer(),e.bindBuffer(pr,o),e.bufferData(pr,h,i.drawType||p3)}else{const u=im(i,r);o=b3(e,u,void 0,i.drawType),s=rm(u),c=i.normalize!==void 0?i.normalize:yF(u),l=EF(i,r)}n[a]={buffer:o,numComponents:l,type:s,normalize:c,stride:i.stride||0,offset:i.offset||0,divisor:i.divisor===void 0?void 0:i.divisor,drawType:i.drawType}}}}),e.bindBuffer(pr,null),n}function _F(e,t,n,r){n=im(n),r!==void 0?(e.bindBuffer(pr,t.buffer),e.bufferSubData(pr,r,n)):m3(e,pr,t.buffer,n,t.drawType)}function CF(e,t){return t===fF||t===hF?1:t===dF||t===pF?2:t===gF||t===mF||t===bF?4:0}const am=["position","positions","a_position"];function kF(e,t){let n,r;for(r=0;r<am.length&&(n=am[r],!(n in t||(n=g3.attribPrefix+n,n in t)));++r);r===am.length&&(n=Object.keys(t)[0]);const i=t[n];e.bindBuffer(pr,i.buffer);const a=e.getBufferParameter(pr,uF);e.bindBuffer(pr,null);const o=CF(e,i.type),s=a/o,c=i.numComponents||i.size,l=s/c;if(l%1!==0)throw new Error(`numComponents ${c} not correct for length ${length}`);return l}function TF(e,t,n){const r=SF(e,t),i=Object.assign({},n||{});i.attribs=Object.assign({},n?n.attribs:{},r);const a=t.indices;if(a){const o=im(a,"indices");i.indices=b3(e,o,lF),i.numElements=o.length,i.elementType=rm(o)}else i.numElements||(i.numElements=kF(e,i.attribs));return i}function rs(e){return!!e.texStorage2D}const om=function(){const e={},t={};function n(r){const i=r.constructor.name;if(!e[i]){for(const a in r)if(typeof r[a]=="number"){const o=t[r[a]];t[r[a]]=o?`${o} | ${a}`:a}e[i]=!0}}return function(i,a){return n(i),t[a]||(typeof a=="number"?`0x${a.toString(16)}`:a)}}(),Ri={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},is=kh,w3=function(){let e;return function(){return e=e||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),e}}(),x3=6406,gr=6407,Qe=6408,A3=6409,E3=6410,El=6402,S3=34041,Ih=33071,IF=9728,RF=9729,$r=3553,Hr=34067,Di=32879,Bi=35866,Rh=34069,DF=34070,BF=34071,FF=34072,PF=34073,MF=34074,sm=10241,cm=10240,Dh=10242,Bh=10243,_3=32882,OF=33082,LF=33083,NF=33084,zF=33085,lm=3317,C3=3314,k3=32878,T3=3316,I3=3315,R3=32877,UF=37443,$F=37441,HF=37440,GF=33321,VF=36756,jF=33325,qF=33326,WF=33330,YF=33329,ZF=33338,QF=33337,XF=33340,KF=33339,JF=33323,eP=36757,tP=33327,nP=33328,rP=33336,iP=33335,aP=33332,oP=33331,sP=33334,cP=33333,lP=32849,uP=35905,fP=36194,hP=36758,dP=35898,pP=35901,gP=34843,mP=34837,bP=36221,yP=36239,vP=36215,wP=36233,xP=36209,AP=36227,EP=32856,SP=35907,_P=36759,CP=32855,kP=32854,TP=32857,IP=34842,RP=34836,DP=36220,BP=36238,FP=36975,PP=36214,MP=36232,OP=36226,LP=36208,NP=33189,zP=33190,UP=36012,$P=36013,HP=35056,Fi=5120,Xe=5121,Fh=5122,as=5123,Ph=5124,Ga=5125,Ut=5126,D3=32819,B3=32820,F3=33635,Vn=5131,Sl=36193,um=33640,GP=35899,VP=35902,jP=36269,qP=34042,Mh=33319,os=33320,Oh=6403,ss=36244,cs=36248,Va=36249;let fm;function Lh(e){if(!fm){const t={};t[x3]={textureFormat:x3,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Xe,Vn,Sl,Ut]},t[A3]={textureFormat:A3,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Xe,Vn,Sl,Ut]},t[E3]={textureFormat:E3,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[Xe,Vn,Sl,Ut]},t[gr]={textureFormat:gr,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[Xe,Vn,Sl,Ut,F3]},t[Qe]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[Xe,Vn,Sl,Ut,D3,B3]},t[El]={textureFormat:El,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Ga,as]},t[GF]={textureFormat:Oh,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[Xe]},t[VF]={textureFormat:Oh,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[Fi]},t[jF]={textureFormat:Oh,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[Ut,Vn]},t[qF]={textureFormat:Oh,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[Ut]},t[WF]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Xe]},t[YF]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Fi]},t[aP]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[as]},t[oP]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Fh]},t[sP]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ga]},t[cP]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ph]},t[JF]={textureFormat:Mh,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[Xe]},t[eP]={textureFormat:Mh,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[Fi]},t[tP]={textureFormat:Mh,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[Ut,Vn]},t[nP]={textureFormat:Mh,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[Ut]},t[rP]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Xe]},t[iP]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Fi]},t[ZF]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[as]},t[QF]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Fh]},t[XF]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ga]},t[KF]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ph]},t[lP]={textureFormat:gr,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[Xe]},t[uP]={textureFormat:gr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Xe]},t[fP]={textureFormat:gr,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[Xe,F3]},t[hP]={textureFormat:gr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Fi]},t[dP]={textureFormat:gr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Ut,Vn,GP]},t[pP]={textureFormat:gr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Ut,Vn,VP]},t[gP]={textureFormat:gr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[Ut,Vn]},t[mP]={textureFormat:gr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ut]},t[bP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Xe]},t[yP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Fi]},t[vP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[as]},t[wP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Fh]},t[xP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ga]},t[AP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ph]},t[EP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Xe]},t[SP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Xe]},t[_P]={textureFormat:Qe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[Fi]},t[CP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[Xe,B3,um]},t[kP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[Xe,D3]},t[TP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[um]},t[IP]={textureFormat:Qe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[Ut,Vn]},t[RP]={textureFormat:Qe,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[Ut]},t[DP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Xe]},t[BP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Fi]},t[FP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[um]},t[PP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[as]},t[MP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Fh]},t[OP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ph]},t[LP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ga]},t[NP]={textureFormat:El,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[as,Ga]},t[zP]={textureFormat:El,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ga]},t[UP]={textureFormat:El,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ut]},t[HP]={textureFormat:S3,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[qP]},t[$P]={textureFormat:S3,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[jP]},Object.keys(t).forEach(function(n){const r=t[n];r.bytesPerElementMap={},r.bytesPerElement.forEach(function(i,a){const o=r.type[a];r.bytesPerElementMap[o]=i})}),fm=t}return fm[e]}function WP(e,t){const n=Lh(e);if(!n)throw"unknown internal format";const r=n.bytesPerElementMap[t];if(r===void 0)throw"unknown internal format";return r}function ls(e){const t=Lh(e);if(!t)throw"unknown internal format";return{format:t.textureFormat,type:t.type[0]}}function P3(e){return(e&e-1)===0}function YP(e,t,n,r){if(!rs(e))return P3(t)&&P3(n);const i=Lh(r);if(!i)throw"unknown internal format";return i.colorRenderable&&i.textureFilterable}function ZP(e){const t=Lh(e);if(!t)throw"unknown internal format";return t.textureFilterable}function M3(e,t,n){return is(t)?rm(t):n||Xe}function Nh(e,t,n,r,i){if(i%1!==0)throw"can't guess dimensions";if(!n&&!r){const a=Math.sqrt(i/(t===Hr?6:1));a%1===0?(n=a,r=a):(n=i,r=1)}else if(r){if(!n&&(n=i/r,n%1))throw"can't guess dimensions"}else if(r=i/n,r%1)throw"can't guess dimensions";return{width:n,height:r}}function us(e,t){t.colorspaceConversion!==void 0&&e.pixelStorei(UF,t.colorspaceConversion),t.premultiplyAlpha!==void 0&&e.pixelStorei($F,t.premultiplyAlpha),t.flipY!==void 0&&e.pixelStorei(HF,t.flipY)}function O3(e){e.pixelStorei(lm,4),rs(e)&&(e.pixelStorei(C3,0),e.pixelStorei(k3,0),e.pixelStorei(T3,0),e.pixelStorei(I3,0),e.pixelStorei(R3,0))}function QP(e,t,n,r){r.minMag&&(n.call(e,t,sm,r.minMag),n.call(e,t,cm,r.minMag)),r.min&&n.call(e,t,sm,r.min),r.mag&&n.call(e,t,cm,r.mag),r.wrap&&(n.call(e,t,Dh,r.wrap),n.call(e,t,Bh,r.wrap),(t===Di||cF(e,t))&&n.call(e,t,_3,r.wrap)),r.wrapR&&n.call(e,t,_3,r.wrapR),r.wrapS&&n.call(e,t,Dh,r.wrapS),r.wrapT&&n.call(e,t,Bh,r.wrapT),r.minLod&&n.call(e,t,OF,r.minLod),r.maxLod&&n.call(e,t,LF,r.maxLod),r.baseLevel&&n.call(e,t,NF,r.baseLevel),r.maxLevel&&n.call(e,t,zF,r.maxLevel)}function L3(e,t,n){const r=n.target||$r;e.bindTexture(r,t),QP(e,r,e.texParameteri,n)}function XP(e){return e=e||Ri.textureColor,is(e)?e:new Uint8Array([e[0]*255,e[1]*255,e[2]*255,e[3]*255])}function hm(e,t,n,r,i,a){n=n||Ri.textureOptions,a=a||Qe;const o=n.target||$r;if(r=r||n.width,i=i||n.height,e.bindTexture(o,t),YP(e,r,i,a))e.generateMipmap(o);else{const s=ZP(a)?RF:IF;e.texParameteri(o,sm,s),e.texParameteri(o,cm,s),e.texParameteri(o,Dh,Ih),e.texParameteri(o,Bh,Ih)}}function _l(e){return e.auto===!0||e.auto===void 0&&e.level===void 0}function dm(e,t){return t=t||{},t.cubeFaceOrder||[Rh,DF,BF,FF,PF,MF]}function pm(e,t){const r=dm(e,t).map(function(i,a){return{face:i,ndx:a}});return r.sort(function(i,a){return i.face-a.face}),r}function N3(e,t,n,r){r=r||Ri.textureOptions;const i=r.target||$r,a=r.level||0;let o=n.width,s=n.height;const c=r.internalFormat||r.format||Qe,l=ls(c),u=r.format||l.format,f=r.type||l.type;if(us(e,r),e.bindTexture(i,t),i===Hr){const h=n.width,d=n.height;let p,g;if(h/6===d)p=d,g=[0,0,1,0,2,0,3,0,4,0,5,0];else if(d/6===h)p=h,g=[0,0,0,1,0,2,0,3,0,4,0,5];else if(h/3===d/2)p=h/3,g=[0,0,1,0,2,0,0,1,1,1,2,1];else if(h/2===d/3)p=h/2,g=[0,0,1,0,0,1,1,1,0,2,1,2];else throw"can't figure out cube map from element: "+(n.src?n.src:n.nodeName);const b=w3();b?(b.canvas.width=p,b.canvas.height=p,o=p,s=p,pm(e,r).forEach(function(v){const x=g[v.ndx*2+0]*p,A=g[v.ndx*2+1]*p;b.drawImage(n,x,A,p,p,0,0,p,p),e.texImage2D(v.face,a,c,u,f,b.canvas)}),b.canvas.width=1,b.canvas.height=1):typeof createImageBitmap<"u"&&(o=p,s=p,pm(e,r).forEach(function(v){const x=g[v.ndx*2+0]*p,A=g[v.ndx*2+1]*p;e.texImage2D(v.face,a,c,p,p,0,u,f,null),createImageBitmap(n,x,A,p,p,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(w){us(e,r),e.bindTexture(i,t),e.texImage2D(v.face,a,c,u,f,w),_l(r)&&hm(e,t,r,o,s,c)})}))}else if(i===Di||i===Bi){const h=Math.min(n.width,n.height),d=Math.max(n.width,n.height),p=d/h;if(p%1!==0)throw"can not compute 3D dimensions of element";const g=n.width===d?1:0,b=n.height===d?1:0;e.pixelStorei(lm,1),e.pixelStorei(C3,n.width),e.pixelStorei(k3,0),e.pixelStorei(R3,0),e.texImage3D(i,a,c,h,h,h,0,u,f,null);for(let v=0;v<p;++v){const x=v*h*g,A=v*h*b;e.pixelStorei(T3,x),e.pixelStorei(I3,A),e.texSubImage3D(i,a,0,0,v,h,h,1,u,f,n)}O3(e)}else e.texImage2D(i,a,c,u,f,n);_l(r)&&hm(e,t,r,o,s,c),L3(e,t,r)}function Cl(){}function KP(e){if(typeof document<"u"){const t=document.createElement("a");return t.href=e,t.hostname===location.hostname&&t.port===location.port&&t.protocol===location.protocol}else{const t=new URL(location.href).origin;return new URL(e,location.href).origin===t}}function JP(e,t){return t===void 0&&!KP(e)?"anonymous":t}function eM(e,t,n){n=n||Cl;let r;if(t=t!==void 0?t:Ri.crossOrigin,t=JP(e,t),typeof Image<"u"){r=new Image,t!==void 0&&(r.crossOrigin=t);const i=function(){r.removeEventListener("error",a),r.removeEventListener("load",o),r=null},a=function(){const c="couldn't load image: "+e;oF(c),n(c,r),i()},o=function(){n(null,r),i()};return r.addEventListener("error",a),r.addEventListener("load",o),r.src=e,r}else if(typeof ImageBitmap<"u"){let i,a;const o=function(){n(i,a)},s={};t&&(s.mode="cors"),fetch(e,s).then(function(c){if(!c.ok)throw c;return c.blob()}).then(function(c){return createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(c){a=c,setTimeout(o)}).catch(function(c){i=c,setTimeout(o)}),r=null}return r}function z3(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof ImageData<"u"&&e instanceof ImageData||typeof HTMLElement<"u"&&e instanceof HTMLElement}function gm(e,t,n){return z3(e)?(setTimeout(function(){n(null,e)}),e):eM(e,t,n)}function mm(e,t,n){n=n||Ri.textureOptions;const r=n.target||$r;if(e.bindTexture(r,t),n.color===!1)return;const i=XP(n.color);if(r===Hr)for(let a=0;a<6;++a)e.texImage2D(Rh+a,0,Qe,1,1,0,Qe,Xe,i);else r===Di||r===Bi?e.texImage3D(r,0,Qe,1,1,1,0,Qe,Xe,i):e.texImage2D(r,0,Qe,1,1,0,Qe,Xe,i)}function tM(e,t,n,r){return r=r||Cl,n=n||Ri.textureOptions,mm(e,t,n),n=Object.assign({},n),gm(n.src,n.crossOrigin,function(a,o){a?r(a,t,o):(N3(e,t,o,n),r(null,t,o))})}function nM(e,t,n,r){r=r||Cl;const i=n.src;if(i.length!==6)throw"there must be 6 urls for a cubemap";const a=n.level||0,o=n.internalFormat||n.format||Qe,s=ls(o),c=n.format||s.format,l=n.type||Xe,u=n.target||$r;if(u!==Hr)throw"target must be TEXTURE_CUBE_MAP";mm(e,t,n),n=Object.assign({},n);let f=6;const h=[],d=dm(e,n);let p;function g(b){return function(v,x){--f,v?h.push(v):x.width!==x.height?h.push("cubemap face img is not a square: "+x.src):(us(e,n),e.bindTexture(u,t),f===5?dm().forEach(function(A){e.texImage2D(A,a,o,c,l,x)}):e.texImage2D(b,a,o,c,l,x),_l(n)&&e.generateMipmap(u)),f===0&&r(h.length?h:void 0,t,p)}}p=i.map(function(b,v){return gm(b,n.crossOrigin,g(d[v]))})}function rM(e,t,n,r){r=r||Cl;const i=n.src,a=n.internalFormat||n.format||Qe,o=ls(a),s=n.format||o.format,c=n.type||Xe,l=n.target||Bi;if(l!==Di&&l!==Bi)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";mm(e,t,n),n=Object.assign({},n);let u=i.length;const f=[];let h;const d=n.level||0;let p=n.width,g=n.height;const b=i.length;let v=!0;function x(A){return function(w,_){if(--u,w)f.push(w);else{if(us(e,n),e.bindTexture(l,t),v){v=!1,p=n.width||_.width,g=n.height||_.height,e.texImage3D(l,d,a,p,g,b,0,s,c,null);for(let C=0;C<b;++C)e.texSubImage3D(l,d,0,0,C,p,g,1,s,c,_)}else{let C=_,I;(_.width!==p||_.height!==g)&&(I=w3(),C=I.canvas,I.canvas.width=p,I.canvas.height=g,I.drawImage(_,0,0,p,g)),e.texSubImage3D(l,d,0,0,A,p,g,1,s,c,C),I&&C===I.canvas&&(I.canvas.width=0,I.canvas.height=0)}_l(n)&&e.generateMipmap(l)}u===0&&r(f.length?f:void 0,t,h)}}h=i.map(function(A,w){return gm(A,n.crossOrigin,x(w))})}function U3(e,t,n,r){r=r||Ri.textureOptions;const i=r.target||$r;e.bindTexture(i,t);let a=r.width,o=r.height,s=r.depth;const c=r.level||0,l=r.internalFormat||r.format||Qe,u=ls(l),f=r.format||u.format,h=r.type||M3(e,n,u.type);if(is(n))n instanceof Uint8ClampedArray&&(n=new Uint8Array(n.buffer));else{const b=aF(h);n=new b(n)}const d=WP(l,h),p=n.byteLength/d;if(p%1)throw"length wrong size for format: "+om(e,f);let g;if(i===Di||i===Bi)if(!a&&!o&&!s){const b=Math.cbrt(p);if(b%1!==0)throw"can't guess cube size of array of numElements: "+p;a=b,o=b,s=b}else a&&(!o||!s)?(g=Nh(e,i,o,s,p/a),o=g.width,s=g.height):o&&(!a||!s)?(g=Nh(e,i,a,s,p/o),a=g.width,s=g.height):(g=Nh(e,i,a,o,p/s),a=g.width,o=g.height);else g=Nh(e,i,a,o,p),a=g.width,o=g.height;if(O3(e),e.pixelStorei(lm,r.unpackAlignment||1),us(e,r),i===Hr){const b=d/n.BYTES_PER_ELEMENT,v=p/6*b;pm(e,r).forEach(x=>{const A=v*x.ndx,w=n.subarray(A,A+v);e.texImage2D(x.face,c,l,a,o,0,f,h,w)})}else i===Di||i===Bi?e.texImage3D(i,c,l,a,o,s,0,f,h,n):e.texImage2D(i,c,l,a,o,0,f,h,n);return{width:a,height:o,depth:s,type:h}}function iM(e,t,n){const r=n.target||$r;e.bindTexture(r,t);const i=n.level||0,a=n.internalFormat||n.format||Qe,o=ls(a),s=n.format||o.format,c=n.type||o.type;if(us(e,n),r===Hr)for(let l=0;l<6;++l)e.texImage2D(Rh+l,i,a,n.width,n.height,0,s,c,null);else r===Di||r===Bi?e.texImage3D(r,i,a,n.width,n.height,n.depth,0,s,c,null):e.texImage2D(r,i,a,n.width,n.height,0,s,c,null)}function kl(e,t,n){n=n||Cl,t=t||Ri.textureOptions;const r=e.createTexture(),i=t.target||$r;let a=t.width||1,o=t.height||1;const s=t.internalFormat||Qe;e.bindTexture(i,r),i===Hr&&(e.texParameteri(i,Dh,Ih),e.texParameteri(i,Bh,Ih));let c=t.src;if(c)if(typeof c=="function"&&(c=c(e,t)),typeof c=="string")tM(e,r,t,n);else if(is(c)||Array.isArray(c)&&(typeof c[0]=="number"||Array.isArray(c[0])||is(c[0]))){const l=U3(e,r,c,t);a=l.width,o=l.height}else Array.isArray(c)&&(typeof c[0]=="string"||z3(c[0]))?i===Hr?nM(e,r,t,n):rM(e,r,t,n):(N3(e,r,c,t),a=c.width,o=c.height);else iM(e,r,t);return _l(t)&&hm(e,r,t,a,o,s),L3(e,r,t),r}function aM(e,t,n,r,i,a){r=r||n.width,i=i||n.height,a=a||n.depth;const o=n.target||$r;e.bindTexture(o,t);const s=n.level||0,c=n.internalFormat||n.format||Qe,l=ls(c),u=n.format||l.format;let f;const h=n.src;if(h&&(is(h)||Array.isArray(h)&&typeof h[0]=="number")?f=n.type||M3(e,h,l.type):f=n.type||l.type,o===Hr)for(let d=0;d<6;++d)e.texImage2D(Rh+d,s,c,r,i,0,u,f,null);else o===Di||o===Bi?e.texImage3D(o,s,c,r,i,a,0,u,f,null):e.texImage2D(o,s,c,r,i,0,u,f,null)}const oM=h3,zh=33984,sM=35048,Uh=34962,cM=34963,bm=35345,$3=35718,lM=35721,uM=35971,fM=35382,hM=35396,dM=35398,pM=35392,gM=35395,$h=5126,H3=35664,G3=35665,V3=35666,ym=5124,j3=35667,q3=35668,W3=35669,Y3=35670,Z3=35671,Q3=35672,X3=35673,K3=35674,J3=35675,eA=35676,mM=35678,bM=35680,yM=35679,vM=35682,wM=35685,xM=35686,AM=35687,EM=35688,SM=35689,_M=35690,CM=36289,kM=36292,TM=36293,vm=5125,tA=36294,nA=36295,rA=36296,IM=36298,RM=36299,DM=36300,BM=36303,FM=36306,PM=36307,MM=36308,OM=36311,Hh=3553,Gh=34067,wm=32879,Vh=35866,he={};function iA(e,t){return he[t].bindPoint}function LM(e,t){return function(n){e.uniform1f(t,n)}}function NM(e,t){return function(n){e.uniform1fv(t,n)}}function zM(e,t){return function(n){e.uniform2fv(t,n)}}function UM(e,t){return function(n){e.uniform3fv(t,n)}}function $M(e,t){return function(n){e.uniform4fv(t,n)}}function aA(e,t){return function(n){e.uniform1i(t,n)}}function oA(e,t){return function(n){e.uniform1iv(t,n)}}function sA(e,t){return function(n){e.uniform2iv(t,n)}}function cA(e,t){return function(n){e.uniform3iv(t,n)}}function lA(e,t){return function(n){e.uniform4iv(t,n)}}function HM(e,t){return function(n){e.uniform1ui(t,n)}}function GM(e,t){return function(n){e.uniform1uiv(t,n)}}function VM(e,t){return function(n){e.uniform2uiv(t,n)}}function jM(e,t){return function(n){e.uniform3uiv(t,n)}}function qM(e,t){return function(n){e.uniform4uiv(t,n)}}function WM(e,t){return function(n){e.uniformMatrix2fv(t,!1,n)}}function YM(e,t){return function(n){e.uniformMatrix3fv(t,!1,n)}}function ZM(e,t){return function(n){e.uniformMatrix4fv(t,!1,n)}}function QM(e,t){return function(n){e.uniformMatrix2x3fv(t,!1,n)}}function XM(e,t){return function(n){e.uniformMatrix3x2fv(t,!1,n)}}function KM(e,t){return function(n){e.uniformMatrix2x4fv(t,!1,n)}}function JM(e,t){return function(n){e.uniformMatrix4x2fv(t,!1,n)}}function eO(e,t){return function(n){e.uniformMatrix3x4fv(t,!1,n)}}function tO(e,t){return function(n){e.uniformMatrix4x3fv(t,!1,n)}}function jt(e,t,n,r){const i=iA(e,t);return rs(e)?function(a){let o,s;Th(e,a)?(o=a,s=null):(o=a.texture,s=a.sampler),e.uniform1i(r,n),e.activeTexture(zh+n),e.bindTexture(i,o),e.bindSampler(n,s)}:function(a){e.uniform1i(r,n),e.activeTexture(zh+n),e.bindTexture(i,a)}}function qt(e,t,n,r,i){const a=iA(e,t),o=new Int32Array(i);for(let s=0;s<i;++s)o[s]=n+s;return rs(e)?function(s){e.uniform1iv(r,o),s.forEach(function(c,l){e.activeTexture(zh+o[l]);let u,f;Th(e,c)?(u=c,f=null):(u=c.texture,f=c.sampler),e.bindSampler(n,f),e.bindTexture(a,u)})}:function(s){e.uniform1iv(r,o),s.forEach(function(c,l){e.activeTexture(zh+o[l]),e.bindTexture(a,c)})}}he[$h]={Type:Float32Array,size:4,setter:LM,arraySetter:NM},he[H3]={Type:Float32Array,size:8,setter:zM,cols:2},he[G3]={Type:Float32Array,size:12,setter:UM,cols:3},he[V3]={Type:Float32Array,size:16,setter:$M,cols:4},he[ym]={Type:Int32Array,size:4,setter:aA,arraySetter:oA},he[j3]={Type:Int32Array,size:8,setter:sA,cols:2},he[q3]={Type:Int32Array,size:12,setter:cA,cols:3},he[W3]={Type:Int32Array,size:16,setter:lA,cols:4},he[vm]={Type:Uint32Array,size:4,setter:HM,arraySetter:GM},he[tA]={Type:Uint32Array,size:8,setter:VM,cols:2},he[nA]={Type:Uint32Array,size:12,setter:jM,cols:3},he[rA]={Type:Uint32Array,size:16,setter:qM,cols:4},he[Y3]={Type:Uint32Array,size:4,setter:aA,arraySetter:oA},he[Z3]={Type:Uint32Array,size:8,setter:sA,cols:2},he[Q3]={Type:Uint32Array,size:12,setter:cA,cols:3},he[X3]={Type:Uint32Array,size:16,setter:lA,cols:4},he[K3]={Type:Float32Array,size:32,setter:WM,rows:2,cols:2},he[J3]={Type:Float32Array,size:48,setter:YM,rows:3,cols:3},he[eA]={Type:Float32Array,size:64,setter:ZM,rows:4,cols:4},he[wM]={Type:Float32Array,size:32,setter:QM,rows:2,cols:3},he[xM]={Type:Float32Array,size:32,setter:KM,rows:2,cols:4},he[AM]={Type:Float32Array,size:48,setter:XM,rows:3,cols:2},he[EM]={Type:Float32Array,size:48,setter:eO,rows:3,cols:4},he[SM]={Type:Float32Array,size:64,setter:JM,rows:4,cols:2},he[_M]={Type:Float32Array,size:64,setter:tO,rows:4,cols:3},he[mM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Hh},he[bM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Gh},he[yM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:wm},he[vM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Hh},he[CM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Vh},he[kM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Vh},he[TM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Gh},he[IM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Hh},he[RM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:wm},he[DM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Gh},he[BM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Vh},he[FM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Hh},he[PM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:wm},he[MM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Gh},he[OM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Vh};function jh(e,t){return function(n){if(n.value)switch(e.disableVertexAttribArray(t),n.value.length){case 4:e.vertexAttrib4fv(t,n.value);break;case 3:e.vertexAttrib3fv(t,n.value);break;case 2:e.vertexAttrib2fv(t,n.value);break;case 1:e.vertexAttrib1fv(t,n.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else e.bindBuffer(Uh,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribPointer(t,n.numComponents||n.size,n.type||$h,n.normalize||!1,n.stride||0,n.offset||0),n.divisor!==void 0&&e.vertexAttribDivisor(t,n.divisor)}}function Pi(e,t){return function(n){if(n.value)if(e.disableVertexAttribArray(t),n.value.length===4)e.vertexAttrib4iv(t,n.value);else throw new Error("The length of an integer constant value must be 4!");else e.bindBuffer(Uh,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,n.numComponents||n.size,n.type||ym,n.stride||0,n.offset||0),n.divisor!==void 0&&e.vertexAttribDivisor(t,n.divisor)}}function qh(e,t){return function(n){if(n.value)if(e.disableVertexAttribArray(t),n.value.length===4)e.vertexAttrib4uiv(t,n.value);else throw new Error("The length of an unsigned integer constant value must be 4!");else e.bindBuffer(Uh,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,n.numComponents||n.size,n.type||vm,n.stride||0,n.offset||0),n.divisor!==void 0&&e.vertexAttribDivisor(t,n.divisor)}}function xm(e,t,n){const r=n.size,i=n.count;return function(a){e.bindBuffer(Uh,a.buffer);const o=a.size||a.numComponents||r,s=o/i,c=a.type||$h,u=he[c].size*o,f=a.normalize||!1,h=a.offset||0,d=u/i;for(let p=0;p<i;++p)e.enableVertexAttribArray(t+p),e.vertexAttribPointer(t+p,s,c,f,u,h+d*p),a.divisor!==void 0&&e.vertexAttribDivisor(t+p,a.divisor)}}const dt={};dt[$h]={size:4,setter:jh},dt[H3]={size:8,setter:jh},dt[G3]={size:12,setter:jh},dt[V3]={size:16,setter:jh},dt[ym]={size:4,setter:Pi},dt[j3]={size:8,setter:Pi},dt[q3]={size:12,setter:Pi},dt[W3]={size:16,setter:Pi},dt[vm]={size:4,setter:qh},dt[tA]={size:8,setter:qh},dt[nA]={size:12,setter:qh},dt[rA]={size:16,setter:qh},dt[Y3]={size:4,setter:Pi},dt[Z3]={size:8,setter:Pi},dt[Q3]={size:12,setter:Pi},dt[X3]={size:16,setter:Pi},dt[K3]={size:4,setter:xm,count:2},dt[J3]={size:9,setter:xm,count:3},dt[eA]={size:16,setter:xm,count:4};function uA(e){const t=e.name;return t.startsWith("gl_")||t.startsWith("webgl_")}const nO=/(\.|\[|]|\w+)/g,rO=e=>e>="0"&&e<="9";function fA(e,t,n,r){const i=e.split(nO).filter(s=>s!=="");let a=0,o="";for(;;){const s=i[a++];o+=s;const c=rO(s[0]),l=c?parseInt(s):s;if(c&&(o+=i[a++]),a===i.length){n[l]=t;break}else{const f=i[a++],h=f==="[",d=n[l]||(h?[]:{});n[l]=d,n=d,r[o]=r[o]||function(p){return function(g){pA(p,g)}}(d),o+=f}}}function iO(e,t){let n=0;function r(s,c,l){const u=c.name.endsWith("[0]"),f=c.type,h=he[f];if(!h)throw new Error(`unknown type: 0x${f.toString(16)}`);let d;if(h.bindPoint){const p=n;n+=c.size,u?d=h.arraySetter(e,f,p,l,c.size):d=h.setter(e,f,p,l,c.size)}else h.arraySetter&&u?d=h.arraySetter(e,l):d=h.setter(e,l);return d.location=l,d}const i={},a={},o=e.getProgramParameter(t,$3);for(let s=0;s<o;++s){const c=e.getActiveUniform(t,s);if(uA(c))continue;let l=c.name;l.endsWith("[0]")&&(l=l.substr(0,l.length-3));const u=e.getUniformLocation(t,c.name);if(u){const f=r(t,c,u);i[l]=f,fA(l,f,a,i)}}return i}function aO(e,t){const n={},r=e.getProgramParameter(t,uM);for(let i=0;i<r;++i){const a=e.getTransformFeedbackVarying(t,i);n[a.name]={index:i,type:a.type,size:a.size}}return n}function oO(e,t){const n=e.getProgramParameter(t,$3),r=[],i=[];for(let s=0;s<n;++s){i.push(s),r.push({});const c=e.getActiveUniform(t,s);r[s].name=c.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(s){const c=s[0],l=s[1];e.getActiveUniforms(t,i,e[c]).forEach(function(u,f){r[f][l]=u})});const a={},o=e.getProgramParameter(t,fM);for(let s=0;s<o;++s){const c=e.getActiveUniformBlockName(t,s),l={index:e.getUniformBlockIndex(t,c),usedByVertexShader:e.getActiveUniformBlockParameter(t,s,hM),usedByFragmentShader:e.getActiveUniformBlockParameter(t,s,dM),size:e.getActiveUniformBlockParameter(t,s,pM),uniformIndices:e.getActiveUniformBlockParameter(t,s,gM)};l.used=l.usedByVertexShader||l.usedByFragmentShader,a[c]=l}return{blockSpecs:a,uniformData:r}}const hA=/\[\d+\]\.$/,sO=(e,t)=>((e+(t-1))/t|0)*t;function cO(e,t,n,r){if(t||n){r=r||1;const a=e.length/4;return function(o){let s=0,c=0;for(let l=0;l<a;++l){for(let u=0;u<r;++u)e[s++]=o[c++];s+=4-r}}}else return function(i){i.length?e.set(i):e[0]=i}}function lO(e,t,n,r){const i=n.blockSpecs,a=n.uniformData,o=i[r];if(!o)return oM("no uniform block object named:",r),{name:r,uniforms:{}};const s=new ArrayBuffer(o.size),c=e.createBuffer(),l=o.index;e.bindBuffer(bm,c),e.uniformBlockBinding(t,o.index,l);let u=r+".";hA.test(u)&&(u=u.replace(hA,"."));const f={},h={},d={};return o.uniformIndices.forEach(function(p){const g=a[p];let b=g.name;b.startsWith(u)&&(b=b.substr(u.length));const v=b.endsWith("[0]");v&&(b=b.substr(0,b.length-3));const x=he[g.type],A=x.Type,w=v?sO(x.size,16)*g.size:x.size*g.size,_=new A(s,g.offset,w/A.BYTES_PER_ELEMENT);f[b]=_;const C=cO(_,v,x.rows,x.cols);h[b]=C,fA(b,C,d,h)}),{name:r,array:s,asFloat:new Float32Array(s),buffer:c,uniforms:f,setters:h}}function Am(e,t,n){return lO(e,t.program,t.uniformBlockSpec,n)}function dA(e,t,n){const i=(t.uniformBlockSpec||t).blockSpecs[n.name];if(i){const a=i.index;return e.bindBufferRange(bm,a,n.buffer,n.offset||0,n.array.byteLength),!0}return!1}function Em(e,t,n){dA(e,t,n)&&e.bufferData(bm,n.array,sM)}function fs(e,t){const n=e.setters;for(const r in t){const i=n[r];if(i){const a=t[r];i(a)}}}function pA(e,t){for(const n in t){const r=e[n];typeof r=="function"?r(t[n]):pA(e[n],t[n])}}function ja(e,...t){const n=e.uniformSetters||e,r=t.length;for(let i=0;i<r;++i){const a=t[i];if(Array.isArray(a)){const o=a.length;for(let s=0;s<o;++s)ja(n,a[s])}else for(const o in a){const s=n[o];s&&s(a[o])}}}function uO(e,t){const n={},r=e.getProgramParameter(t,lM);for(let i=0;i<r;++i){const a=e.getActiveAttrib(t,i);if(uA(a))continue;const o=e.getAttribLocation(t,a.name),s=dt[a.type],c=s.setter(e,o,s);c.location=o,n[a.name]=c}return n}function fO(e,t){for(const n in t){const r=e[n];r&&r(t[n])}}function qa(e,t,n){n.vertexArrayObject?e.bindVertexArray(n.vertexArrayObject):(fO(t.attribSetters||t,n.attribs),n.indices&&e.bindBuffer(cM,n.indices))}function hO(e,t){const n=iO(e,t),r=uO(e,t),i={program:t,uniformSetters:n,attribSetters:r};return rs(e)&&(i.uniformBlockSpec=oO(e,t),i.transformFeedbackInfo=aO(e,t)),i}const dO=4,gA=5123;function Wh(e,t,n,r,i,a){n=n===void 0?dO:n;const o=t.indices,s=t.elementType,c=r===void 0?t.numElements:r;i=i===void 0?0:i,s||o?a!==void 0?e.drawElementsInstanced(n,c,s===void 0?gA:t.elementType,i,a):e.drawElements(n,c,s===void 0?gA:t.elementType,i):a!==void 0?e.drawArraysInstanced(n,i,c,a):e.drawArrays(n,i,c)}const pO=36160,Wa=36161,gO=3553,mO=5121,bO=6402,yO=6408,vO=33190,wO=36012,xO=35056,AO=36013,EO=32854,SO=32855,_O=36194,mA=33189,bA=6401,yA=36168,Sm=34041,CO=36064,Yh=36096,vA=36128,_m=33306,Cm=33071,km=9729,wA=[{format:yO,type:mO,min:km,wrap:Cm},{format:Sm}],jn={};jn[Sm]=_m,jn[bA]=vA,jn[yA]=vA,jn[bO]=Yh,jn[mA]=Yh,jn[vO]=Yh,jn[wO]=Yh,jn[xO]=_m,jn[AO]=_m;function kO(e,t){return jn[e]||jn[t]}const Mi={};Mi[EO]=!0,Mi[SO]=!0,Mi[_O]=!0,Mi[Sm]=!0,Mi[mA]=!0,Mi[bA]=!0,Mi[yA]=!0;function TO(e){return Mi[e]}function IO(e,t,n,r){const i=pO,a=e.createFramebuffer();e.bindFramebuffer(i,a),n=n||e.drawingBufferWidth,r=r||e.drawingBufferHeight,t=t||wA;let o=0;const s={framebuffer:a,attachments:[],width:n,height:r};return t.forEach(function(c){let l=c.attachment;const u=c.samples,f=c.format;let h=c.attachmentPoint||kO(f,c.internalFormat);if(h||(h=CO+o++),!l)if(u!==void 0||TO(f))l=e.createRenderbuffer(),e.bindRenderbuffer(Wa,l),u>1?e.renderbufferStorageMultisample(Wa,u,f,n,r):e.renderbufferStorage(Wa,f,n,r);else{const d=Object.assign({},c);d.width=n,d.height=r,d.auto===void 0&&(d.auto=!1,d.min=d.min||d.minMag||km,d.mag=d.mag||d.minMag||km,d.wrapS=d.wrapS||d.wrap||Cm,d.wrapT=d.wrapT||d.wrap||Cm),l=kl(e,d)}if(d3(e,l))e.framebufferRenderbuffer(i,h,Wa,l);else if(Th(e,l))c.layer!==void 0?e.framebufferTextureLayer(i,h,l,c.level||0,c.layer):e.framebufferTexture2D(i,h,c.target||gO,l,c.level||0);else throw new Error("unknown attachment type");s.attachments.push(l)}),s}function RO(e,t,n,r,i){r=r||e.drawingBufferWidth,i=i||e.drawingBufferHeight,t.width=r,t.height=i,n=n||wA,n.forEach(function(a,o){const s=t.attachments[o],c=a.format,l=a.samples;if(l!==void 0||d3(e,s))e.bindRenderbuffer(Wa,s),l>1?e.renderbufferStorageMultisample(Wa,l,c,r,i):e.renderbufferStorage(Wa,c,r,i);else if(Th(e,s))aM(e,s,a,r,i);else throw new Error("unknown attachment type")})}function DO(e,t,n){const r=e.createVertexArray();return e.bindVertexArray(r),t.length||(t=[t]),t.forEach(function(i){qa(e,i,n)}),e.bindVertexArray(null),{numElements:n.numElements,elementType:n.elementType,vertexArrayObject:r}}const BO=/^(.*?)_/;function FO(e,t){om(e,0);const n=e.getExtension(t);if(n){const r={},i=BO.exec(t)[1],a="_"+i;for(const o in n){const s=n[o],c=typeof s=="function",l=c?i:a;let u=o;o.endsWith(l)&&(u=o.substring(0,o.length-l.length)),e[u]!==void 0?!c&&e[u]!==s&&h3(u,e[u],s,o):c?e[u]=function(f){return function(){return f.apply(n,arguments)}}(s):(e[u]=s,r[u]=s)}r.constructor={name:n.constructor.name},om(r,0)}return n}const xA=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function AA(e){for(let t=0;t<xA.length;++t)FO(e,xA[t])}function PO(e,t){const n=["webgl2","webgl","experimental-webgl"];let r=null;for(let i=0;i<n.length;++i)if(r=e.getContext(n[i],t),r){AA(r);break}return r}function MO(e,t){return PO(e,t)}const OO=`uniform Mark {
|
164
|
+
see: http://github.com/greggman/twgl.js for details */const Xg=5120,Al=5121,Kg=5122,Jg=5123,em=5124,tm=5125,nm=5126,ZB=32819,QB=32820,XB=33635,KB=5131,JB=33640,eF=35899,tF=35902,nF=36269,rF=34042,f3={};{const e=f3;e[Xg]=Int8Array,e[Al]=Uint8Array,e[Kg]=Int16Array,e[Jg]=Uint16Array,e[em]=Int32Array,e[tm]=Uint32Array,e[nm]=Float32Array,e[ZB]=Uint16Array,e[QB]=Uint16Array,e[XB]=Uint16Array,e[KB]=Uint16Array,e[JB]=Uint32Array,e[eF]=Uint32Array,e[tF]=Uint32Array,e[nF]=Uint32Array,e[rF]=Uint32Array}function rm(e){if(e instanceof Int8Array)return Xg;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)return Al;if(e instanceof Int16Array)return Kg;if(e instanceof Uint16Array)return Jg;if(e instanceof Int32Array)return em;if(e instanceof Uint32Array)return tm;if(e instanceof Float32Array)return nm;throw new Error("unsupported typed array type")}function iF(e){if(e===Int8Array)return Xg;if(e===Uint8Array||e===Uint8ClampedArray)return Al;if(e===Int16Array)return Kg;if(e===Uint16Array)return Jg;if(e===Int32Array)return em;if(e===Uint32Array)return tm;if(e===Float32Array)return nm;throw new Error("unsupported typed array type")}function aF(e){const t=f3[e];if(!t)throw new Error("unknown gl type");return t}const kh=typeof SharedArrayBuffer<"u"?function(t){return t&&t.buffer&&(t.buffer instanceof ArrayBuffer||t.buffer instanceof SharedArrayBuffer)}:function(t){return t&&t.buffer&&t.buffer instanceof ArrayBuffer};function oF(...e){console.error(...e)}function h3(...e){console.warn(...e)}function sF(e,t){return typeof WebGLBuffer<"u"&&t instanceof WebGLBuffer}function d3(e,t){return typeof WebGLRenderbuffer<"u"&&t instanceof WebGLRenderbuffer}function Th(e,t){return typeof WebGLTexture<"u"&&t instanceof WebGLTexture}function cF(e,t){return typeof WebGLSampler<"u"&&t instanceof WebGLSampler}const p3=35044,dr=34962,lF=34963,uF=34660,fF=5120,hF=5121,dF=5122,pF=5123,gF=5124,mF=5125,bF=5126,g3={attribPrefix:""};function m3(e,t,n,r,i){e.bindBuffer(t,n),e.bufferData(t,r,i||p3)}function b3(e,t,n,r){if(sF(e,t))return t;n=n||dr;const i=e.createBuffer();return m3(e,n,i,t,r),i}function y3(e){return e==="indices"}function yF(e){return e instanceof Int8Array||e instanceof Uint8Array}function vF(e){return e===Int8Array||e===Uint8Array}function wF(e){return e.length?e:e.data}const xF=/coord|texture/i,AF=/color|colour/i;function v3(e,t){let n;if(xF.test(e)?n=2:AF.test(e)?n=4:n=3,t%n>0)throw new Error(`Can not guess numComponents for attribute '${e}'. Tried ${n} but ${t} values is not evenly divisible by ${n}. You should specify it.`);return n}function EF(e,t){return e.numComponents||e.size||v3(t,wF(e).length)}function im(e,t){if(kh(e))return e;if(kh(e.data))return e.data;Array.isArray(e)&&(e={data:e});let n=e.type;return n||(y3(t)?n=Uint16Array:n=Float32Array),new n(e.data)}function SF(e,t){const n={};return Object.keys(t).forEach(function(r){if(!y3(r)){const i=t[r],a=i.attrib||i.name||i.attribName||g3.attribPrefix+r;if(i.value){if(!Array.isArray(i.value)&&!kh(i.value))throw new Error("array.value is not array or typedarray");n[a]={value:i.value}}else{let o,s,c,l;if(i.buffer&&i.buffer instanceof WebGLBuffer)o=i.buffer,l=i.numComponents||i.size,s=i.type,c=i.normalize;else if(typeof i=="number"||typeof i.data=="number"){const u=i.data||i,f=i.type||Float32Array,h=u*f.BYTES_PER_ELEMENT;s=iF(f),c=i.normalize!==void 0?i.normalize:vF(f),l=i.numComponents||i.size||v3(r,u),o=e.createBuffer(),e.bindBuffer(dr,o),e.bufferData(dr,h,i.drawType||p3)}else{const u=im(i,r);o=b3(e,u,void 0,i.drawType),s=rm(u),c=i.normalize!==void 0?i.normalize:yF(u),l=EF(i,r)}n[a]={buffer:o,numComponents:l,type:s,normalize:c,stride:i.stride||0,offset:i.offset||0,divisor:i.divisor===void 0?void 0:i.divisor,drawType:i.drawType}}}}),e.bindBuffer(dr,null),n}function _F(e,t,n,r){n=im(n),r!==void 0?(e.bindBuffer(dr,t.buffer),e.bufferSubData(dr,r,n)):m3(e,dr,t.buffer,n,t.drawType)}function CF(e,t){return t===fF||t===hF?1:t===dF||t===pF?2:t===gF||t===mF||t===bF?4:0}const am=["position","positions","a_position"];function kF(e,t){let n,r;for(r=0;r<am.length&&(n=am[r],!(n in t||(n=g3.attribPrefix+n,n in t)));++r);r===am.length&&(n=Object.keys(t)[0]);const i=t[n];e.bindBuffer(dr,i.buffer);const a=e.getBufferParameter(dr,uF);e.bindBuffer(dr,null);const o=CF(e,i.type),s=a/o,c=i.numComponents||i.size,l=s/c;if(l%1!==0)throw new Error(`numComponents ${c} not correct for length ${length}`);return l}function TF(e,t,n){const r=SF(e,t),i=Object.assign({},n||{});i.attribs=Object.assign({},n?n.attribs:{},r);const a=t.indices;if(a){const o=im(a,"indices");i.indices=b3(e,o,lF),i.numElements=o.length,i.elementType=rm(o)}else i.numElements||(i.numElements=kF(e,i.attribs));return i}function rs(e){return!!e.texStorage2D}const om=function(){const e={},t={};function n(r){const i=r.constructor.name;if(!e[i]){for(const a in r)if(typeof r[a]=="number"){const o=t[r[a]];t[r[a]]=o?`${o} | ${a}`:a}e[i]=!0}}return function(i,a){return n(i),t[a]||(typeof a=="number"?`0x${a.toString(16)}`:a)}}(),Di={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},is=kh,w3=function(){let e;return function(){return e=e||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),e}}(),x3=6406,pr=6407,Qe=6408,A3=6409,E3=6410,El=6402,S3=34041,Ih=33071,IF=9728,RF=9729,$r=3553,Hr=34067,Bi=32879,Fi=35866,Rh=34069,DF=34070,BF=34071,FF=34072,PF=34073,MF=34074,sm=10241,cm=10240,Dh=10242,Bh=10243,_3=32882,OF=33082,LF=33083,NF=33084,zF=33085,lm=3317,C3=3314,k3=32878,T3=3316,I3=3315,R3=32877,UF=37443,$F=37441,HF=37440,GF=33321,VF=36756,jF=33325,qF=33326,WF=33330,YF=33329,ZF=33338,QF=33337,XF=33340,KF=33339,JF=33323,eP=36757,tP=33327,nP=33328,rP=33336,iP=33335,aP=33332,oP=33331,sP=33334,cP=33333,lP=32849,uP=35905,fP=36194,hP=36758,dP=35898,pP=35901,gP=34843,mP=34837,bP=36221,yP=36239,vP=36215,wP=36233,xP=36209,AP=36227,EP=32856,SP=35907,_P=36759,CP=32855,kP=32854,TP=32857,IP=34842,RP=34836,DP=36220,BP=36238,FP=36975,PP=36214,MP=36232,OP=36226,LP=36208,NP=33189,zP=33190,UP=36012,$P=36013,HP=35056,Pi=5120,Xe=5121,Fh=5122,as=5123,Ph=5124,Ga=5125,Ut=5126,D3=32819,B3=32820,F3=33635,Vn=5131,Sl=36193,um=33640,GP=35899,VP=35902,jP=36269,qP=34042,Mh=33319,os=33320,Oh=6403,ss=36244,cs=36248,Va=36249;let fm;function Lh(e){if(!fm){const t={};t[x3]={textureFormat:x3,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Xe,Vn,Sl,Ut]},t[A3]={textureFormat:A3,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[Xe,Vn,Sl,Ut]},t[E3]={textureFormat:E3,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[Xe,Vn,Sl,Ut]},t[pr]={textureFormat:pr,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[Xe,Vn,Sl,Ut,F3]},t[Qe]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[Xe,Vn,Sl,Ut,D3,B3]},t[El]={textureFormat:El,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Ga,as]},t[GF]={textureFormat:Oh,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[Xe]},t[VF]={textureFormat:Oh,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[Pi]},t[jF]={textureFormat:Oh,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[Ut,Vn]},t[qF]={textureFormat:Oh,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[Ut]},t[WF]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Xe]},t[YF]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[Pi]},t[aP]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[as]},t[oP]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Fh]},t[sP]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ga]},t[cP]={textureFormat:ss,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ph]},t[JF]={textureFormat:Mh,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[Xe]},t[eP]={textureFormat:Mh,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[Pi]},t[tP]={textureFormat:Mh,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[Ut,Vn]},t[nP]={textureFormat:Mh,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[Ut]},t[rP]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Xe]},t[iP]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Pi]},t[ZF]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[as]},t[QF]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Fh]},t[XF]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ga]},t[KF]={textureFormat:os,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ph]},t[lP]={textureFormat:pr,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[Xe]},t[uP]={textureFormat:pr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Xe]},t[fP]={textureFormat:pr,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[Xe,F3]},t[hP]={textureFormat:pr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[Pi]},t[dP]={textureFormat:pr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Ut,Vn,GP]},t[pP]={textureFormat:pr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[Ut,Vn,VP]},t[gP]={textureFormat:pr,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[Ut,Vn]},t[mP]={textureFormat:pr,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ut]},t[bP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Xe]},t[yP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[Pi]},t[vP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[as]},t[wP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Fh]},t[xP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ga]},t[AP]={textureFormat:cs,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ph]},t[EP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Xe]},t[SP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[Xe]},t[_P]={textureFormat:Qe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[Pi]},t[CP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[Xe,B3,um]},t[kP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[Xe,D3]},t[TP]={textureFormat:Qe,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[um]},t[IP]={textureFormat:Qe,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[Ut,Vn]},t[RP]={textureFormat:Qe,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[Ut]},t[DP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Xe]},t[BP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Pi]},t[FP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[um]},t[PP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[as]},t[MP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Fh]},t[OP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ph]},t[LP]={textureFormat:Va,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ga]},t[NP]={textureFormat:El,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[as,Ga]},t[zP]={textureFormat:El,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ga]},t[UP]={textureFormat:El,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ut]},t[HP]={textureFormat:S3,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[qP]},t[$P]={textureFormat:S3,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[jP]},Object.keys(t).forEach(function(n){const r=t[n];r.bytesPerElementMap={},r.bytesPerElement.forEach(function(i,a){const o=r.type[a];r.bytesPerElementMap[o]=i})}),fm=t}return fm[e]}function WP(e,t){const n=Lh(e);if(!n)throw"unknown internal format";const r=n.bytesPerElementMap[t];if(r===void 0)throw"unknown internal format";return r}function ls(e){const t=Lh(e);if(!t)throw"unknown internal format";return{format:t.textureFormat,type:t.type[0]}}function P3(e){return(e&e-1)===0}function YP(e,t,n,r){if(!rs(e))return P3(t)&&P3(n);const i=Lh(r);if(!i)throw"unknown internal format";return i.colorRenderable&&i.textureFilterable}function ZP(e){const t=Lh(e);if(!t)throw"unknown internal format";return t.textureFilterable}function M3(e,t,n){return is(t)?rm(t):n||Xe}function Nh(e,t,n,r,i){if(i%1!==0)throw"can't guess dimensions";if(!n&&!r){const a=Math.sqrt(i/(t===Hr?6:1));a%1===0?(n=a,r=a):(n=i,r=1)}else if(r){if(!n&&(n=i/r,n%1))throw"can't guess dimensions"}else if(r=i/n,r%1)throw"can't guess dimensions";return{width:n,height:r}}function us(e,t){t.colorspaceConversion!==void 0&&e.pixelStorei(UF,t.colorspaceConversion),t.premultiplyAlpha!==void 0&&e.pixelStorei($F,t.premultiplyAlpha),t.flipY!==void 0&&e.pixelStorei(HF,t.flipY)}function O3(e){e.pixelStorei(lm,4),rs(e)&&(e.pixelStorei(C3,0),e.pixelStorei(k3,0),e.pixelStorei(T3,0),e.pixelStorei(I3,0),e.pixelStorei(R3,0))}function QP(e,t,n,r){r.minMag&&(n.call(e,t,sm,r.minMag),n.call(e,t,cm,r.minMag)),r.min&&n.call(e,t,sm,r.min),r.mag&&n.call(e,t,cm,r.mag),r.wrap&&(n.call(e,t,Dh,r.wrap),n.call(e,t,Bh,r.wrap),(t===Bi||cF(e,t))&&n.call(e,t,_3,r.wrap)),r.wrapR&&n.call(e,t,_3,r.wrapR),r.wrapS&&n.call(e,t,Dh,r.wrapS),r.wrapT&&n.call(e,t,Bh,r.wrapT),r.minLod&&n.call(e,t,OF,r.minLod),r.maxLod&&n.call(e,t,LF,r.maxLod),r.baseLevel&&n.call(e,t,NF,r.baseLevel),r.maxLevel&&n.call(e,t,zF,r.maxLevel)}function L3(e,t,n){const r=n.target||$r;e.bindTexture(r,t),QP(e,r,e.texParameteri,n)}function XP(e){return e=e||Di.textureColor,is(e)?e:new Uint8Array([e[0]*255,e[1]*255,e[2]*255,e[3]*255])}function hm(e,t,n,r,i,a){n=n||Di.textureOptions,a=a||Qe;const o=n.target||$r;if(r=r||n.width,i=i||n.height,e.bindTexture(o,t),YP(e,r,i,a))e.generateMipmap(o);else{const s=ZP(a)?RF:IF;e.texParameteri(o,sm,s),e.texParameteri(o,cm,s),e.texParameteri(o,Dh,Ih),e.texParameteri(o,Bh,Ih)}}function _l(e){return e.auto===!0||e.auto===void 0&&e.level===void 0}function dm(e,t){return t=t||{},t.cubeFaceOrder||[Rh,DF,BF,FF,PF,MF]}function pm(e,t){const r=dm(e,t).map(function(i,a){return{face:i,ndx:a}});return r.sort(function(i,a){return i.face-a.face}),r}function N3(e,t,n,r){r=r||Di.textureOptions;const i=r.target||$r,a=r.level||0;let o=n.width,s=n.height;const c=r.internalFormat||r.format||Qe,l=ls(c),u=r.format||l.format,f=r.type||l.type;if(us(e,r),e.bindTexture(i,t),i===Hr){const h=n.width,d=n.height;let p,g;if(h/6===d)p=d,g=[0,0,1,0,2,0,3,0,4,0,5,0];else if(d/6===h)p=h,g=[0,0,0,1,0,2,0,3,0,4,0,5];else if(h/3===d/2)p=h/3,g=[0,0,1,0,2,0,0,1,1,1,2,1];else if(h/2===d/3)p=h/2,g=[0,0,1,0,0,1,1,1,0,2,1,2];else throw"can't figure out cube map from element: "+(n.src?n.src:n.nodeName);const b=w3();b?(b.canvas.width=p,b.canvas.height=p,o=p,s=p,pm(e,r).forEach(function(v){const x=g[v.ndx*2+0]*p,A=g[v.ndx*2+1]*p;b.drawImage(n,x,A,p,p,0,0,p,p),e.texImage2D(v.face,a,c,u,f,b.canvas)}),b.canvas.width=1,b.canvas.height=1):typeof createImageBitmap<"u"&&(o=p,s=p,pm(e,r).forEach(function(v){const x=g[v.ndx*2+0]*p,A=g[v.ndx*2+1]*p;e.texImage2D(v.face,a,c,p,p,0,u,f,null),createImageBitmap(n,x,A,p,p,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(w){us(e,r),e.bindTexture(i,t),e.texImage2D(v.face,a,c,u,f,w),_l(r)&&hm(e,t,r,o,s,c)})}))}else if(i===Bi||i===Fi){const h=Math.min(n.width,n.height),d=Math.max(n.width,n.height),p=d/h;if(p%1!==0)throw"can not compute 3D dimensions of element";const g=n.width===d?1:0,b=n.height===d?1:0;e.pixelStorei(lm,1),e.pixelStorei(C3,n.width),e.pixelStorei(k3,0),e.pixelStorei(R3,0),e.texImage3D(i,a,c,h,h,h,0,u,f,null);for(let v=0;v<p;++v){const x=v*h*g,A=v*h*b;e.pixelStorei(T3,x),e.pixelStorei(I3,A),e.texSubImage3D(i,a,0,0,v,h,h,1,u,f,n)}O3(e)}else e.texImage2D(i,a,c,u,f,n);_l(r)&&hm(e,t,r,o,s,c),L3(e,t,r)}function Cl(){}function KP(e){if(typeof document<"u"){const t=document.createElement("a");return t.href=e,t.hostname===location.hostname&&t.port===location.port&&t.protocol===location.protocol}else{const t=new URL(location.href).origin;return new URL(e,location.href).origin===t}}function JP(e,t){return t===void 0&&!KP(e)?"anonymous":t}function eM(e,t,n){n=n||Cl;let r;if(t=t!==void 0?t:Di.crossOrigin,t=JP(e,t),typeof Image<"u"){r=new Image,t!==void 0&&(r.crossOrigin=t);const i=function(){r.removeEventListener("error",a),r.removeEventListener("load",o),r=null},a=function(){const c="couldn't load image: "+e;oF(c),n(c,r),i()},o=function(){n(null,r),i()};return r.addEventListener("error",a),r.addEventListener("load",o),r.src=e,r}else if(typeof ImageBitmap<"u"){let i,a;const o=function(){n(i,a)},s={};t&&(s.mode="cors"),fetch(e,s).then(function(c){if(!c.ok)throw c;return c.blob()}).then(function(c){return createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(c){a=c,setTimeout(o)}).catch(function(c){i=c,setTimeout(o)}),r=null}return r}function z3(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof ImageData<"u"&&e instanceof ImageData||typeof HTMLElement<"u"&&e instanceof HTMLElement}function gm(e,t,n){return z3(e)?(setTimeout(function(){n(null,e)}),e):eM(e,t,n)}function mm(e,t,n){n=n||Di.textureOptions;const r=n.target||$r;if(e.bindTexture(r,t),n.color===!1)return;const i=XP(n.color);if(r===Hr)for(let a=0;a<6;++a)e.texImage2D(Rh+a,0,Qe,1,1,0,Qe,Xe,i);else r===Bi||r===Fi?e.texImage3D(r,0,Qe,1,1,1,0,Qe,Xe,i):e.texImage2D(r,0,Qe,1,1,0,Qe,Xe,i)}function tM(e,t,n,r){return r=r||Cl,n=n||Di.textureOptions,mm(e,t,n),n=Object.assign({},n),gm(n.src,n.crossOrigin,function(a,o){a?r(a,t,o):(N3(e,t,o,n),r(null,t,o))})}function nM(e,t,n,r){r=r||Cl;const i=n.src;if(i.length!==6)throw"there must be 6 urls for a cubemap";const a=n.level||0,o=n.internalFormat||n.format||Qe,s=ls(o),c=n.format||s.format,l=n.type||Xe,u=n.target||$r;if(u!==Hr)throw"target must be TEXTURE_CUBE_MAP";mm(e,t,n),n=Object.assign({},n);let f=6;const h=[],d=dm(e,n);let p;function g(b){return function(v,x){--f,v?h.push(v):x.width!==x.height?h.push("cubemap face img is not a square: "+x.src):(us(e,n),e.bindTexture(u,t),f===5?dm().forEach(function(A){e.texImage2D(A,a,o,c,l,x)}):e.texImage2D(b,a,o,c,l,x),_l(n)&&e.generateMipmap(u)),f===0&&r(h.length?h:void 0,t,p)}}p=i.map(function(b,v){return gm(b,n.crossOrigin,g(d[v]))})}function rM(e,t,n,r){r=r||Cl;const i=n.src,a=n.internalFormat||n.format||Qe,o=ls(a),s=n.format||o.format,c=n.type||Xe,l=n.target||Fi;if(l!==Bi&&l!==Fi)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";mm(e,t,n),n=Object.assign({},n);let u=i.length;const f=[];let h;const d=n.level||0;let p=n.width,g=n.height;const b=i.length;let v=!0;function x(A){return function(w,_){if(--u,w)f.push(w);else{if(us(e,n),e.bindTexture(l,t),v){v=!1,p=n.width||_.width,g=n.height||_.height,e.texImage3D(l,d,a,p,g,b,0,s,c,null);for(let C=0;C<b;++C)e.texSubImage3D(l,d,0,0,C,p,g,1,s,c,_)}else{let C=_,I;(_.width!==p||_.height!==g)&&(I=w3(),C=I.canvas,I.canvas.width=p,I.canvas.height=g,I.drawImage(_,0,0,p,g)),e.texSubImage3D(l,d,0,0,A,p,g,1,s,c,C),I&&C===I.canvas&&(I.canvas.width=0,I.canvas.height=0)}_l(n)&&e.generateMipmap(l)}u===0&&r(f.length?f:void 0,t,h)}}h=i.map(function(A,w){return gm(A,n.crossOrigin,x(w))})}function U3(e,t,n,r){r=r||Di.textureOptions;const i=r.target||$r;e.bindTexture(i,t);let a=r.width,o=r.height,s=r.depth;const c=r.level||0,l=r.internalFormat||r.format||Qe,u=ls(l),f=r.format||u.format,h=r.type||M3(e,n,u.type);if(is(n))n instanceof Uint8ClampedArray&&(n=new Uint8Array(n.buffer));else{const b=aF(h);n=new b(n)}const d=WP(l,h),p=n.byteLength/d;if(p%1)throw"length wrong size for format: "+om(e,f);let g;if(i===Bi||i===Fi)if(!a&&!o&&!s){const b=Math.cbrt(p);if(b%1!==0)throw"can't guess cube size of array of numElements: "+p;a=b,o=b,s=b}else a&&(!o||!s)?(g=Nh(e,i,o,s,p/a),o=g.width,s=g.height):o&&(!a||!s)?(g=Nh(e,i,a,s,p/o),a=g.width,s=g.height):(g=Nh(e,i,a,o,p/s),a=g.width,o=g.height);else g=Nh(e,i,a,o,p),a=g.width,o=g.height;if(O3(e),e.pixelStorei(lm,r.unpackAlignment||1),us(e,r),i===Hr){const b=d/n.BYTES_PER_ELEMENT,v=p/6*b;pm(e,r).forEach(x=>{const A=v*x.ndx,w=n.subarray(A,A+v);e.texImage2D(x.face,c,l,a,o,0,f,h,w)})}else i===Bi||i===Fi?e.texImage3D(i,c,l,a,o,s,0,f,h,n):e.texImage2D(i,c,l,a,o,0,f,h,n);return{width:a,height:o,depth:s,type:h}}function iM(e,t,n){const r=n.target||$r;e.bindTexture(r,t);const i=n.level||0,a=n.internalFormat||n.format||Qe,o=ls(a),s=n.format||o.format,c=n.type||o.type;if(us(e,n),r===Hr)for(let l=0;l<6;++l)e.texImage2D(Rh+l,i,a,n.width,n.height,0,s,c,null);else r===Bi||r===Fi?e.texImage3D(r,i,a,n.width,n.height,n.depth,0,s,c,null):e.texImage2D(r,i,a,n.width,n.height,0,s,c,null)}function kl(e,t,n){n=n||Cl,t=t||Di.textureOptions;const r=e.createTexture(),i=t.target||$r;let a=t.width||1,o=t.height||1;const s=t.internalFormat||Qe;e.bindTexture(i,r),i===Hr&&(e.texParameteri(i,Dh,Ih),e.texParameteri(i,Bh,Ih));let c=t.src;if(c)if(typeof c=="function"&&(c=c(e,t)),typeof c=="string")tM(e,r,t,n);else if(is(c)||Array.isArray(c)&&(typeof c[0]=="number"||Array.isArray(c[0])||is(c[0]))){const l=U3(e,r,c,t);a=l.width,o=l.height}else Array.isArray(c)&&(typeof c[0]=="string"||z3(c[0]))?i===Hr?nM(e,r,t,n):rM(e,r,t,n):(N3(e,r,c,t),a=c.width,o=c.height);else iM(e,r,t);return _l(t)&&hm(e,r,t,a,o,s),L3(e,r,t),r}function aM(e,t,n,r,i,a){r=r||n.width,i=i||n.height,a=a||n.depth;const o=n.target||$r;e.bindTexture(o,t);const s=n.level||0,c=n.internalFormat||n.format||Qe,l=ls(c),u=n.format||l.format;let f;const h=n.src;if(h&&(is(h)||Array.isArray(h)&&typeof h[0]=="number")?f=n.type||M3(e,h,l.type):f=n.type||l.type,o===Hr)for(let d=0;d<6;++d)e.texImage2D(Rh+d,s,c,r,i,0,u,f,null);else o===Bi||o===Fi?e.texImage3D(o,s,c,r,i,a,0,u,f,null):e.texImage2D(o,s,c,r,i,0,u,f,null)}const oM=h3,zh=33984,sM=35048,Uh=34962,cM=34963,bm=35345,$3=35718,lM=35721,uM=35971,fM=35382,hM=35396,dM=35398,pM=35392,gM=35395,$h=5126,H3=35664,G3=35665,V3=35666,ym=5124,j3=35667,q3=35668,W3=35669,Y3=35670,Z3=35671,Q3=35672,X3=35673,K3=35674,J3=35675,eA=35676,mM=35678,bM=35680,yM=35679,vM=35682,wM=35685,xM=35686,AM=35687,EM=35688,SM=35689,_M=35690,CM=36289,kM=36292,TM=36293,vm=5125,tA=36294,nA=36295,rA=36296,IM=36298,RM=36299,DM=36300,BM=36303,FM=36306,PM=36307,MM=36308,OM=36311,Hh=3553,Gh=34067,wm=32879,Vh=35866,he={};function iA(e,t){return he[t].bindPoint}function LM(e,t){return function(n){e.uniform1f(t,n)}}function NM(e,t){return function(n){e.uniform1fv(t,n)}}function zM(e,t){return function(n){e.uniform2fv(t,n)}}function UM(e,t){return function(n){e.uniform3fv(t,n)}}function $M(e,t){return function(n){e.uniform4fv(t,n)}}function aA(e,t){return function(n){e.uniform1i(t,n)}}function oA(e,t){return function(n){e.uniform1iv(t,n)}}function sA(e,t){return function(n){e.uniform2iv(t,n)}}function cA(e,t){return function(n){e.uniform3iv(t,n)}}function lA(e,t){return function(n){e.uniform4iv(t,n)}}function HM(e,t){return function(n){e.uniform1ui(t,n)}}function GM(e,t){return function(n){e.uniform1uiv(t,n)}}function VM(e,t){return function(n){e.uniform2uiv(t,n)}}function jM(e,t){return function(n){e.uniform3uiv(t,n)}}function qM(e,t){return function(n){e.uniform4uiv(t,n)}}function WM(e,t){return function(n){e.uniformMatrix2fv(t,!1,n)}}function YM(e,t){return function(n){e.uniformMatrix3fv(t,!1,n)}}function ZM(e,t){return function(n){e.uniformMatrix4fv(t,!1,n)}}function QM(e,t){return function(n){e.uniformMatrix2x3fv(t,!1,n)}}function XM(e,t){return function(n){e.uniformMatrix3x2fv(t,!1,n)}}function KM(e,t){return function(n){e.uniformMatrix2x4fv(t,!1,n)}}function JM(e,t){return function(n){e.uniformMatrix4x2fv(t,!1,n)}}function eO(e,t){return function(n){e.uniformMatrix3x4fv(t,!1,n)}}function tO(e,t){return function(n){e.uniformMatrix4x3fv(t,!1,n)}}function jt(e,t,n,r){const i=iA(e,t);return rs(e)?function(a){let o,s;Th(e,a)?(o=a,s=null):(o=a.texture,s=a.sampler),e.uniform1i(r,n),e.activeTexture(zh+n),e.bindTexture(i,o),e.bindSampler(n,s)}:function(a){e.uniform1i(r,n),e.activeTexture(zh+n),e.bindTexture(i,a)}}function qt(e,t,n,r,i){const a=iA(e,t),o=new Int32Array(i);for(let s=0;s<i;++s)o[s]=n+s;return rs(e)?function(s){e.uniform1iv(r,o),s.forEach(function(c,l){e.activeTexture(zh+o[l]);let u,f;Th(e,c)?(u=c,f=null):(u=c.texture,f=c.sampler),e.bindSampler(n,f),e.bindTexture(a,u)})}:function(s){e.uniform1iv(r,o),s.forEach(function(c,l){e.activeTexture(zh+o[l]),e.bindTexture(a,c)})}}he[$h]={Type:Float32Array,size:4,setter:LM,arraySetter:NM},he[H3]={Type:Float32Array,size:8,setter:zM,cols:2},he[G3]={Type:Float32Array,size:12,setter:UM,cols:3},he[V3]={Type:Float32Array,size:16,setter:$M,cols:4},he[ym]={Type:Int32Array,size:4,setter:aA,arraySetter:oA},he[j3]={Type:Int32Array,size:8,setter:sA,cols:2},he[q3]={Type:Int32Array,size:12,setter:cA,cols:3},he[W3]={Type:Int32Array,size:16,setter:lA,cols:4},he[vm]={Type:Uint32Array,size:4,setter:HM,arraySetter:GM},he[tA]={Type:Uint32Array,size:8,setter:VM,cols:2},he[nA]={Type:Uint32Array,size:12,setter:jM,cols:3},he[rA]={Type:Uint32Array,size:16,setter:qM,cols:4},he[Y3]={Type:Uint32Array,size:4,setter:aA,arraySetter:oA},he[Z3]={Type:Uint32Array,size:8,setter:sA,cols:2},he[Q3]={Type:Uint32Array,size:12,setter:cA,cols:3},he[X3]={Type:Uint32Array,size:16,setter:lA,cols:4},he[K3]={Type:Float32Array,size:32,setter:WM,rows:2,cols:2},he[J3]={Type:Float32Array,size:48,setter:YM,rows:3,cols:3},he[eA]={Type:Float32Array,size:64,setter:ZM,rows:4,cols:4},he[wM]={Type:Float32Array,size:32,setter:QM,rows:2,cols:3},he[xM]={Type:Float32Array,size:32,setter:KM,rows:2,cols:4},he[AM]={Type:Float32Array,size:48,setter:XM,rows:3,cols:2},he[EM]={Type:Float32Array,size:48,setter:eO,rows:3,cols:4},he[SM]={Type:Float32Array,size:64,setter:JM,rows:4,cols:2},he[_M]={Type:Float32Array,size:64,setter:tO,rows:4,cols:3},he[mM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Hh},he[bM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Gh},he[yM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:wm},he[vM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Hh},he[CM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Vh},he[kM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Vh},he[TM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Gh},he[IM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Hh},he[RM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:wm},he[DM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Gh},he[BM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Vh},he[FM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Hh},he[PM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:wm},he[MM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Gh},he[OM]={Type:null,size:0,setter:jt,arraySetter:qt,bindPoint:Vh};function jh(e,t){return function(n){if(n.value)switch(e.disableVertexAttribArray(t),n.value.length){case 4:e.vertexAttrib4fv(t,n.value);break;case 3:e.vertexAttrib3fv(t,n.value);break;case 2:e.vertexAttrib2fv(t,n.value);break;case 1:e.vertexAttrib1fv(t,n.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else e.bindBuffer(Uh,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribPointer(t,n.numComponents||n.size,n.type||$h,n.normalize||!1,n.stride||0,n.offset||0),n.divisor!==void 0&&e.vertexAttribDivisor(t,n.divisor)}}function Mi(e,t){return function(n){if(n.value)if(e.disableVertexAttribArray(t),n.value.length===4)e.vertexAttrib4iv(t,n.value);else throw new Error("The length of an integer constant value must be 4!");else e.bindBuffer(Uh,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,n.numComponents||n.size,n.type||ym,n.stride||0,n.offset||0),n.divisor!==void 0&&e.vertexAttribDivisor(t,n.divisor)}}function qh(e,t){return function(n){if(n.value)if(e.disableVertexAttribArray(t),n.value.length===4)e.vertexAttrib4uiv(t,n.value);else throw new Error("The length of an unsigned integer constant value must be 4!");else e.bindBuffer(Uh,n.buffer),e.enableVertexAttribArray(t),e.vertexAttribIPointer(t,n.numComponents||n.size,n.type||vm,n.stride||0,n.offset||0),n.divisor!==void 0&&e.vertexAttribDivisor(t,n.divisor)}}function xm(e,t,n){const r=n.size,i=n.count;return function(a){e.bindBuffer(Uh,a.buffer);const o=a.size||a.numComponents||r,s=o/i,c=a.type||$h,u=he[c].size*o,f=a.normalize||!1,h=a.offset||0,d=u/i;for(let p=0;p<i;++p)e.enableVertexAttribArray(t+p),e.vertexAttribPointer(t+p,s,c,f,u,h+d*p),a.divisor!==void 0&&e.vertexAttribDivisor(t+p,a.divisor)}}const dt={};dt[$h]={size:4,setter:jh},dt[H3]={size:8,setter:jh},dt[G3]={size:12,setter:jh},dt[V3]={size:16,setter:jh},dt[ym]={size:4,setter:Mi},dt[j3]={size:8,setter:Mi},dt[q3]={size:12,setter:Mi},dt[W3]={size:16,setter:Mi},dt[vm]={size:4,setter:qh},dt[tA]={size:8,setter:qh},dt[nA]={size:12,setter:qh},dt[rA]={size:16,setter:qh},dt[Y3]={size:4,setter:Mi},dt[Z3]={size:8,setter:Mi},dt[Q3]={size:12,setter:Mi},dt[X3]={size:16,setter:Mi},dt[K3]={size:4,setter:xm,count:2},dt[J3]={size:9,setter:xm,count:3},dt[eA]={size:16,setter:xm,count:4};function uA(e){const t=e.name;return t.startsWith("gl_")||t.startsWith("webgl_")}const nO=/(\.|\[|]|\w+)/g,rO=e=>e>="0"&&e<="9";function fA(e,t,n,r){const i=e.split(nO).filter(s=>s!=="");let a=0,o="";for(;;){const s=i[a++];o+=s;const c=rO(s[0]),l=c?parseInt(s):s;if(c&&(o+=i[a++]),a===i.length){n[l]=t;break}else{const f=i[a++],h=f==="[",d=n[l]||(h?[]:{});n[l]=d,n=d,r[o]=r[o]||function(p){return function(g){pA(p,g)}}(d),o+=f}}}function iO(e,t){let n=0;function r(s,c,l){const u=c.name.endsWith("[0]"),f=c.type,h=he[f];if(!h)throw new Error(`unknown type: 0x${f.toString(16)}`);let d;if(h.bindPoint){const p=n;n+=c.size,u?d=h.arraySetter(e,f,p,l,c.size):d=h.setter(e,f,p,l,c.size)}else h.arraySetter&&u?d=h.arraySetter(e,l):d=h.setter(e,l);return d.location=l,d}const i={},a={},o=e.getProgramParameter(t,$3);for(let s=0;s<o;++s){const c=e.getActiveUniform(t,s);if(uA(c))continue;let l=c.name;l.endsWith("[0]")&&(l=l.substr(0,l.length-3));const u=e.getUniformLocation(t,c.name);if(u){const f=r(t,c,u);i[l]=f,fA(l,f,a,i)}}return i}function aO(e,t){const n={},r=e.getProgramParameter(t,uM);for(let i=0;i<r;++i){const a=e.getTransformFeedbackVarying(t,i);n[a.name]={index:i,type:a.type,size:a.size}}return n}function oO(e,t){const n=e.getProgramParameter(t,$3),r=[],i=[];for(let s=0;s<n;++s){i.push(s),r.push({});const c=e.getActiveUniform(t,s);r[s].name=c.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(s){const c=s[0],l=s[1];e.getActiveUniforms(t,i,e[c]).forEach(function(u,f){r[f][l]=u})});const a={},o=e.getProgramParameter(t,fM);for(let s=0;s<o;++s){const c=e.getActiveUniformBlockName(t,s),l={index:e.getUniformBlockIndex(t,c),usedByVertexShader:e.getActiveUniformBlockParameter(t,s,hM),usedByFragmentShader:e.getActiveUniformBlockParameter(t,s,dM),size:e.getActiveUniformBlockParameter(t,s,pM),uniformIndices:e.getActiveUniformBlockParameter(t,s,gM)};l.used=l.usedByVertexShader||l.usedByFragmentShader,a[c]=l}return{blockSpecs:a,uniformData:r}}const hA=/\[\d+\]\.$/,sO=(e,t)=>((e+(t-1))/t|0)*t;function cO(e,t,n,r){if(t||n){r=r||1;const a=e.length/4;return function(o){let s=0,c=0;for(let l=0;l<a;++l){for(let u=0;u<r;++u)e[s++]=o[c++];s+=4-r}}}else return function(i){i.length?e.set(i):e[0]=i}}function lO(e,t,n,r){const i=n.blockSpecs,a=n.uniformData,o=i[r];if(!o)return oM("no uniform block object named:",r),{name:r,uniforms:{}};const s=new ArrayBuffer(o.size),c=e.createBuffer(),l=o.index;e.bindBuffer(bm,c),e.uniformBlockBinding(t,o.index,l);let u=r+".";hA.test(u)&&(u=u.replace(hA,"."));const f={},h={},d={};return o.uniformIndices.forEach(function(p){const g=a[p];let b=g.name;b.startsWith(u)&&(b=b.substr(u.length));const v=b.endsWith("[0]");v&&(b=b.substr(0,b.length-3));const x=he[g.type],A=x.Type,w=v?sO(x.size,16)*g.size:x.size*g.size,_=new A(s,g.offset,w/A.BYTES_PER_ELEMENT);f[b]=_;const C=cO(_,v,x.rows,x.cols);h[b]=C,fA(b,C,d,h)}),{name:r,array:s,asFloat:new Float32Array(s),buffer:c,uniforms:f,setters:h}}function Am(e,t,n){return lO(e,t.program,t.uniformBlockSpec,n)}function dA(e,t,n){const i=(t.uniformBlockSpec||t).blockSpecs[n.name];if(i){const a=i.index;return e.bindBufferRange(bm,a,n.buffer,n.offset||0,n.array.byteLength),!0}return!1}function Em(e,t,n){dA(e,t,n)&&e.bufferData(bm,n.array,sM)}function fs(e,t){const n=e.setters;for(const r in t){const i=n[r];if(i){const a=t[r];i(a)}}}function pA(e,t){for(const n in t){const r=e[n];typeof r=="function"?r(t[n]):pA(e[n],t[n])}}function ja(e,...t){const n=e.uniformSetters||e,r=t.length;for(let i=0;i<r;++i){const a=t[i];if(Array.isArray(a)){const o=a.length;for(let s=0;s<o;++s)ja(n,a[s])}else for(const o in a){const s=n[o];s&&s(a[o])}}}function uO(e,t){const n={},r=e.getProgramParameter(t,lM);for(let i=0;i<r;++i){const a=e.getActiveAttrib(t,i);if(uA(a))continue;const o=e.getAttribLocation(t,a.name),s=dt[a.type],c=s.setter(e,o,s);c.location=o,n[a.name]=c}return n}function fO(e,t){for(const n in t){const r=e[n];r&&r(t[n])}}function qa(e,t,n){n.vertexArrayObject?e.bindVertexArray(n.vertexArrayObject):(fO(t.attribSetters||t,n.attribs),n.indices&&e.bindBuffer(cM,n.indices))}function hO(e,t){const n=iO(e,t),r=uO(e,t),i={program:t,uniformSetters:n,attribSetters:r};return rs(e)&&(i.uniformBlockSpec=oO(e,t),i.transformFeedbackInfo=aO(e,t)),i}const dO=4,gA=5123;function Wh(e,t,n,r,i,a){n=n===void 0?dO:n;const o=t.indices,s=t.elementType,c=r===void 0?t.numElements:r;i=i===void 0?0:i,s||o?a!==void 0?e.drawElementsInstanced(n,c,s===void 0?gA:t.elementType,i,a):e.drawElements(n,c,s===void 0?gA:t.elementType,i):a!==void 0?e.drawArraysInstanced(n,i,c,a):e.drawArrays(n,i,c)}const pO=36160,Wa=36161,gO=3553,mO=5121,bO=6402,yO=6408,vO=33190,wO=36012,xO=35056,AO=36013,EO=32854,SO=32855,_O=36194,mA=33189,bA=6401,yA=36168,Sm=34041,CO=36064,Yh=36096,vA=36128,_m=33306,Cm=33071,km=9729,wA=[{format:yO,type:mO,min:km,wrap:Cm},{format:Sm}],jn={};jn[Sm]=_m,jn[bA]=vA,jn[yA]=vA,jn[bO]=Yh,jn[mA]=Yh,jn[vO]=Yh,jn[wO]=Yh,jn[xO]=_m,jn[AO]=_m;function kO(e,t){return jn[e]||jn[t]}const Oi={};Oi[EO]=!0,Oi[SO]=!0,Oi[_O]=!0,Oi[Sm]=!0,Oi[mA]=!0,Oi[bA]=!0,Oi[yA]=!0;function TO(e){return Oi[e]}function IO(e,t,n,r){const i=pO,a=e.createFramebuffer();e.bindFramebuffer(i,a),n=n||e.drawingBufferWidth,r=r||e.drawingBufferHeight,t=t||wA;let o=0;const s={framebuffer:a,attachments:[],width:n,height:r};return t.forEach(function(c){let l=c.attachment;const u=c.samples,f=c.format;let h=c.attachmentPoint||kO(f,c.internalFormat);if(h||(h=CO+o++),!l)if(u!==void 0||TO(f))l=e.createRenderbuffer(),e.bindRenderbuffer(Wa,l),u>1?e.renderbufferStorageMultisample(Wa,u,f,n,r):e.renderbufferStorage(Wa,f,n,r);else{const d=Object.assign({},c);d.width=n,d.height=r,d.auto===void 0&&(d.auto=!1,d.min=d.min||d.minMag||km,d.mag=d.mag||d.minMag||km,d.wrapS=d.wrapS||d.wrap||Cm,d.wrapT=d.wrapT||d.wrap||Cm),l=kl(e,d)}if(d3(e,l))e.framebufferRenderbuffer(i,h,Wa,l);else if(Th(e,l))c.layer!==void 0?e.framebufferTextureLayer(i,h,l,c.level||0,c.layer):e.framebufferTexture2D(i,h,c.target||gO,l,c.level||0);else throw new Error("unknown attachment type");s.attachments.push(l)}),s}function RO(e,t,n,r,i){r=r||e.drawingBufferWidth,i=i||e.drawingBufferHeight,t.width=r,t.height=i,n=n||wA,n.forEach(function(a,o){const s=t.attachments[o],c=a.format,l=a.samples;if(l!==void 0||d3(e,s))e.bindRenderbuffer(Wa,s),l>1?e.renderbufferStorageMultisample(Wa,l,c,r,i):e.renderbufferStorage(Wa,c,r,i);else if(Th(e,s))aM(e,s,a,r,i);else throw new Error("unknown attachment type")})}function DO(e,t,n){const r=e.createVertexArray();return e.bindVertexArray(r),t.length||(t=[t]),t.forEach(function(i){qa(e,i,n)}),e.bindVertexArray(null),{numElements:n.numElements,elementType:n.elementType,vertexArrayObject:r}}const BO=/^(.*?)_/;function FO(e,t){om(e,0);const n=e.getExtension(t);if(n){const r={},i=BO.exec(t)[1],a="_"+i;for(const o in n){const s=n[o],c=typeof s=="function",l=c?i:a;let u=o;o.endsWith(l)&&(u=o.substring(0,o.length-l.length)),e[u]!==void 0?!c&&e[u]!==s&&h3(u,e[u],s,o):c?e[u]=function(f){return function(){return f.apply(n,arguments)}}(s):(e[u]=s,r[u]=s)}r.constructor={name:n.constructor.name},om(r,0)}return n}const xA=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function AA(e){for(let t=0;t<xA.length;++t)FO(e,xA[t])}function PO(e,t){const n=["webgl2","webgl","experimental-webgl"];let r=null;for(let i=0;i<n.length;++i)if(r=e.getContext(n[i],t),r){AA(r);break}return r}function MO(e,t){return PO(e,t)}const OO=`uniform Mark {
|
165
165
|
/** Minimum size (width, height) of the displayed rectangle in pixels */
|
166
166
|
uniform float uMinWidth;
|
167
167
|
uniform float uMinHeight;
|
@@ -350,7 +350,7 @@ void main(void) {
|
|
350
350
|
${n.type} ${_A}${e}() {
|
351
351
|
// Constant value
|
352
352
|
return ${n};
|
353
|
-
}`}function $O(e,t,n,r=[e]){if(Gn(n))throw new Error(`Cannot create scale for "value": ${JSON.stringify(n)}`);if(!t)throw new Error("Scale is undefined");const i=$a(e),a=Tm+DA(r),o=EA+i,s=NO+i,c=Zh(t.type),l=c?"vec2":"float",u=t.domain?t.domain().length:void 0;let f;const h=[];h.push(""),h.push("/".repeat(70)),h.push(`// Channel: ${e}`),h.push(""),h.push(`#define ${e}_DEFINED`);const{transform:d}=zO(t.type),p=(B,...G)=>GO.apply(null,[B,"value",...G]);let g;switch(d){case"linear":g=p("scaleLinear","domain",s);break;case"log":g=p("scaleLog","domain",s,t.base());break;case"symlog":g=p("scaleSymlog","domain",s,t.constant());break;case"pow":case"sqrt":g=p("scalePow","domain",s,t.exponent());break;case"index":case"locus":g=p("scaleBandHp","domain",s,t.paddingInner(),t.paddingOuter(),t.align(),n.band??.5);break;case"point":case"band":g=p("scaleBand","domain",s,t.paddingInner(),t.paddingOuter(),t.align(),n.band??.5);break;case"ordinal":case"null":case"identity":g=p("scaleIdentity");break;case"threshold":break;default:throw new Error(`Unsupported scale type: ${t.type}! ${e}: ${JSON.stringify(n)}`)}const b=Eh(t.type)||_t(t.type)&&Ha(e)?[0,1]:t.range?t.range():void 0;if(b&&e==i&&b.length&&b.every(ft)){const B=kA(b);h.push(`const ${B.type} ${s} = ${B};`)}const v=Ha(e)?"vec3":"float";let x;if(Ha(e)){const B=Im+i;if(e==i&&h.push(`uniform sampler2D ${B};`),_t(t.type))x=`getInterpolatedColor(${B}, transformed)`;else if(
|
353
|
+
}`}function $O(e,t,n,r=[e]){if(Gn(n))throw new Error(`Cannot create scale for "value": ${JSON.stringify(n)}`);if(!t)throw new Error("Scale is undefined");const i=$a(e),a=Tm+DA(r),o=EA+i,s=NO+i,c=Zh(t.type),l=c?"vec2":"float",u=t.domain?t.domain().length:void 0;let f;const h=[];h.push(""),h.push("/".repeat(70)),h.push(`// Channel: ${e}`),h.push(""),h.push(`#define ${e}_DEFINED`);const{transform:d}=zO(t.type),p=(B,...G)=>GO.apply(null,[B,"value",...G]);let g;switch(d){case"linear":g=p("scaleLinear","domain",s);break;case"log":g=p("scaleLog","domain",s,t.base());break;case"symlog":g=p("scaleSymlog","domain",s,t.constant());break;case"pow":case"sqrt":g=p("scalePow","domain",s,t.exponent());break;case"index":case"locus":g=p("scaleBandHp","domain",s,t.paddingInner(),t.paddingOuter(),t.align(),n.band??.5);break;case"point":case"band":g=p("scaleBand","domain",s,t.paddingInner(),t.paddingOuter(),t.align(),n.band??.5);break;case"ordinal":case"null":case"identity":g=p("scaleIdentity");break;case"threshold":break;default:throw new Error(`Unsupported scale type: ${t.type}! ${e}: ${JSON.stringify(n)}`)}const b=Eh(t.type)||_t(t.type)&&Ha(e)?[0,1]:t.range?t.range():void 0;if(b&&e==i&&b.length&&b.every(ft)){const B=kA(b);h.push(`const ${B.type} ${s} = ${B};`)}const v=Ha(e)?"vec3":"float";let x;if(Ha(e)){const B=Im+i;if(e==i&&h.push(`uniform sampler2D ${B};`),_t(t.type))x=`getInterpolatedColor(${B}, transformed)`;else if(zr(t.type)||Ii(t.type))x=`getDiscreteColor(${B}, int(transformed))`;else throw new Error("Problem with color scale!")}else if(t.type==="ordinal"||Ii(t.type)){const B=Im+i;e==i&&h.push(`uniform sampler2D ${B};`),x=`getDiscreteColor(${B}, int(transformed)).r`}const A=vl(n)?`uniform highp ${l} ${a};`:`in highp ${l} ${a};`,w=[],_=_t(t.type)&&u>2,C=Ii(t.type)||_;if(w.push("int slot = 0;"),C){const B=o;w.push(_?`while (slot < ${B}.length() - 2 && value >= ${B}[slot + 1]) { slot++; }`:`while (slot < ${B}.length() && value >= ${B}[slot]) { slot++; }`)}const I=_t(t.type)||Ii(t.type)||["band","point"].includes(t.type);if(g){const B=o;I&&(c?w.push(`vec3 domain = ${B};`):w.push(`vec2 domain = vec2(${B}[slot], ${B}[slot + 1]);`)),w.push(`float transformed = ${g};`),_&&w.push(`transformed = (float(slot) + transformed) / (float(${B}.length() - 1));`)}else w.push("float transformed = float(slot);");"clamp"in t&&t.clamp()&&w.push(`transformed = clampToRange(transformed, ${kA(b)});`),w.push(`return ${x??"transformed"};`),h.push(`
|
354
354
|
${v} ${SA}${e}(${l} value) {
|
355
355
|
${w.map(B=>` ${B}
|
356
356
|
`).join("")}
|
@@ -358,7 +358,7 @@ ${w.map(B=>` ${B}
|
|
358
358
|
${v} ${_A}${e}() {
|
359
359
|
return ${SA}${e}(${a});
|
360
360
|
}`);const D=h.join(`
|
361
|
-
`);if(I&&e==i){const B=_t(t.type)||
|
361
|
+
`);if(I&&e==i){const B=_t(t.type)||Ii(t.type)?u:2;f=c?`highp vec3 ${o};`:`mediump float ${o}[${B}];`}return{attributeGlsl:A,glsl:D,domainUniform:f}}function Rm(e){if(!ft(e))throw new Error(`Not a number: ${e}`);if(e==1/0)return""+CA;if(e==-1/0)return""+-CA;{let t=`${e}`;return/^(-)?\d+$/.test(t)&&(t+=".0"),t}}function Ya(e){typeof e=="number"&&(e=[e]);const t=e.length;if(t<1||t>4)throw new Error("Invalid number of components: "+t);let n,r;return t>1?(n=`vec${t}`,r=`${n}(${e.map(Rm).join(", ")})`):(n="float",r=Rm(e[0])),Object.assign(r,{type:n,numComponents:t})}function HO(e){const t=_i(e).rgb();return Ya([t.r,t.g,t.b].map(n=>n/255))}function kA(e){return Ya([e[0],xn(e)])}function GO(e,...t){const n=[];for(const r of t)ft(r)?n.push(Rm(r)):Qt(r)?n.push(Ya(r)):n.push(r);return`${e}(${n.join(", ")})`}function Zh(e){return e=="index"||e=="locus"}const TA=2**11,VO=TA-1;function IA(e,t=[]){const n=e&VO,r=e-n;return t[0]=r,t[1]=n,t}function jO(e){const t=e%TA;return[e-t,t]}function qO(e){return[...jO(e[0]),e[1]-e[0]]}function RA(e){const t=new gi([],JSON.stringify);for(const[n,r]of Object.entries(e)){const i=r.channelDef;if(Ur(i)){const o=[i.field,r.scale?(_t(r.scale.type)||Ii(r.scale.type))??!1:!1];t.set(o,[...t.get(o)??[],n])}}return t}function DA(e){return Lt(e).join("_")}class WO{constructor(t){this.size=t,this.arrays={},this.pushers=[],this.dataUpdaters=[],this.vertexCount=0}addConverter(t,n){const r=this.createUpdater(Tm+t,n.numComponents||1,n.arrayReference),i=n.f;this.dataUpdaters.push(n.arrayReference?a=>r(i(a)):a=>r(i(a)))}createUpdater(t,n,r){if(!ft(this.size))throw new Error("The number of vertices must be defined!");let i,a,o=0;const s=new Float32Array(this.size*n);if(this.arrays[t]={data:s,numComponents:n},n==1){let c=0;const l=u=>{c=+u};i=()=>{s[o++]=c},a=l}else{let c=r??[0];const l=r?u=>{}:u=>{c=u};switch(n){case 1:break;case 2:i=()=>{s[o++]=c[0],s[o++]=c[1]},a=l;break;case 3:i=()=>{s[o++]=c[0],s[o++]=c[1],s[o++]=c[2]},a=l;break;case 4:i=()=>{s[o++]=c[0],s[o++]=c[1],s[o++]=c[2],s[o++]=c[3]},a=l;break;default:throw new Error("Invalid numComponents: "+n)}}return this.pushers.push(i),a}_unrollPushAll(){let t="",n="";for(let i=0;i<this.pushers.length;i++)t+=`const p${i} = that.pushers[${i}];
|
362
362
|
`,n+=`p${i}();
|
363
363
|
`;const r=new Function("that",`${t}
|
364
364
|
|
@@ -681,18 +681,18 @@ bool setupPicking() {
|
|
681
681
|
|
682
682
|
`));const a=this.gl,o=n.replaceAll(/ {2,}|^\s*\/\/.*$/gm,"");let s=this._shaderCache.get(o);if(!s){const c=[r,i,n].join(`
|
683
683
|
|
684
|
-
`);s=a.createShader(t),a.shaderSource(s,c),a.compileShader(s),this._shaderCache.set(o,s)}return s}adjustGl(){const t=this.getLogicalCanvasSize();this.canvas.style.width=`${t.width}px`,this.canvas.style.height=`${t.height}px`;const n=this.getPhysicalCanvasSize(t);this.canvas.width=n.width,this.canvas.height=n.height,RO(this.gl,this._pickingBufferInfo,this._pickingAttachmentOptions)}finalize(){this.canvas.remove()}getPhysicalCanvasSize(t){return t=t||this.getLogicalCanvasSize(),{width:t.width*this.dpr,height:t.height*this.dpr}}getLogicalCanvasSize(){if(this._logicalCanvasSize)return this._logicalCanvasSize;const t=this._sizeSource(),n=window.getComputedStyle(this._container,null),r=t.width??this._container.clientWidth-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight),i=t.height??this._container.clientHeight-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom);return this._logicalCanvasSize={width:r,height:i},this._logicalCanvasSize}readPickingPixel(t,n){const r=this.gl;t*=this.dpr,n*=this.dpr;const i=this.getPhysicalCanvasSize().height,a=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this._pickingBufferInfo.framebuffer),r.readPixels(t,i-n-1,1,1,r.RGBA,r.UNSIGNED_BYTE,a),r.bindFramebuffer(r.FRAMEBUFFER,null),a}clearAll(){const t=this.gl,{width:n,height:r}=this.getPhysicalCanvasSize();t.viewport(0,0,n,r),t.disable(t.SCISSOR_TEST),t.clearColor(...this._clearColor),t.clear(t.COLOR_BUFFER_BIT)}createRangeTexture(t,n=!1){const r=this.rangeTextures.get(t);if(!n&&r)return;function i(o,s){return
|
684
|
+
`);s=a.createShader(t),a.shaderSource(s,c),a.compileShader(s),this._shaderCache.set(o,s)}return s}adjustGl(){const t=this.getLogicalCanvasSize();this.canvas.style.width=`${t.width}px`,this.canvas.style.height=`${t.height}px`;const n=this.getPhysicalCanvasSize(t);this.canvas.width=n.width,this.canvas.height=n.height,RO(this.gl,this._pickingBufferInfo,this._pickingAttachmentOptions)}finalize(){this.canvas.remove()}getPhysicalCanvasSize(t){return t=t||this.getLogicalCanvasSize(),{width:t.width*this.dpr,height:t.height*this.dpr}}getLogicalCanvasSize(){if(this._logicalCanvasSize)return this._logicalCanvasSize;const t=this._sizeSource(),n=window.getComputedStyle(this._container,null),r=t.width??this._container.clientWidth-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight),i=t.height??this._container.clientHeight-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom);return this._logicalCanvasSize={width:r,height:i},this._logicalCanvasSize}readPickingPixel(t,n){const r=this.gl;t*=this.dpr,n*=this.dpr;const i=this.getPhysicalCanvasSize().height,a=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this._pickingBufferInfo.framebuffer),r.readPixels(t,i-n-1,1,1,r.RGBA,r.UNSIGNED_BYTE,a),r.bindFramebuffer(r.FRAMEBUFFER,null),a}clearAll(){const t=this.gl,{width:n,height:r}=this.getPhysicalCanvasSize();t.viewport(0,0,n,r),t.disable(t.SCISSOR_TEST),t.clearColor(...this._clearColor),t.clear(t.COLOR_BUFFER_BIT)}createRangeTexture(t,n=!1){const r=this.rangeTextures.get(t);if(!n&&r)return;function i(o,s){return zr(s.type)?s.domain().length:s.type=="threshold"?s.domain().length+1:s.type=="quantize"||s.type=="quantile"?o??4:o}const a=t.channel;if(Ha(a)){const o=t.getScaleProps(),s=t.getScale(),c=s.range();let l;if(o.scheme)if(s.type=="threshold"&&c)l=Fm(c,this.gl,s.domain().length,r);else{let u=Me(o.scheme)?void 0:o.scheme.count;u=i(u,s),l=aL(o.scheme,this.gl,u,r)}else Eh(s.type)||_t(s.type)&&c.length>2?l=oL(c,o.interpolate,this.gl,r):l=Fm(c,this.gl,s.domain().length,r);this.rangeTextures.set(t,l)}else{const o=t.getScale();if(o.type==="ordinal"||Ii(o.type)){const s=Ch(a)?u3(a):l=>l,c=t.getScale().range();this.rangeTextures.set(t,sL(c.map(s),this.gl,o.domain().length,r))}}}}function lL(e,t="",n=0){const r=/ERROR:\s*\d+:(\d+)/gi,i=[...t.matchAll(r)],a=new Map(i.map((o,s)=>{const c=parseInt(o[1]),l=i[s+1],u=l?l.index:t.length,f=t.substring(o.index,u);return[c-1,f]}));return e.split(`
|
685
685
|
`).map((o,s)=>{const c=a.get(s);return`${s+1+n}: ${o}${c?`
|
686
686
|
|
687
687
|
^^^ ${c}`:""}`}).join(`
|
688
688
|
`)}function uL(e,t,n){const r=e.createProgram();e.attachShader(r,t),e.attachShader(r,n),e.linkProgram(r);function i(){let a,o;if(!e.getProgramParameter(r,e.LINK_STATUS)){a=e.getProgramInfoLog(r);for(const c of[t,n])e.getShaderParameter(c,e.COMPILE_STATUS)||(a=e.getShaderInfoLog(c),o=lL(e.getShaderSource(c),a,0)+`
|
689
|
-
Error compiling: ${a}`,e.deleteShader(c));e.deleteProgram(r)}if(a)return{message:a,detail:o}}return{program:r,getProgramErrors:i}}function Dl(e,t,n,r){return r?U3(e,r,n,t):r=kl(e,{...t,src:n}),r}function fL(...e){const t={get(n,r,i){for(const a of e){const s=a()[r];if(s!==void 0)return s}},has(n,r,i){for(const a of e){const o=a();if(r in o)return!0}return!1}};return new Proxy({},t)}function hL(e){return Me(e)||ft(e)||kc(e)}class Za extends Error{constructor(t,n){super(t),this.name="ViewError",this.view=n}}const dL="SAMPLE_FACET_UNIFORM",NA="SAMPLE_FACET_TEXTURE";class Bl{constructor(t){this.unitView=t,this.encoders=void 0,this.bufferInfo=void 0,this.programInfo=void 0,this.vertexArrayInfo=void 0,this.domainUniformInfo=void 0,this.viewUniformInfo=void 0,this.markUniformInfo=void 0,this.markUniformsAltered=!0,this.rangeMap=new pL,this.defaultProperties={get clip(){return["x","y"].map(n=>t.getScaleResolution(n)).some(n=>(n==null?void 0:n.isZoomable())??!1)},xOffset:0,yOffset:0,minBufferSize:0},this.properties=fL(typeof this.unitView.spec.mark=="object"?()=>this.unitView.spec.mark:()=>({}),()=>this.defaultProperties)}get opaque(){return!1}getAttributes(){throw new Error("Not implemented!")}getSupportedChannels(){return["sample","facetIndex","x","y","color","opacity","search","uniqueId"]}getDefaultEncoding(){const t={sample:void 0,uniqueId:void 0};return this.isPickingParticipant()&&(t.uniqueId={field:"_uniqueId"}),t}fixEncoding(t){return t}get encoding(){return ds(this,"encoding",()=>{const t=this.getDefaultEncoding(),n=this.unitView.getEncoding(),r=o=>{const s=this.properties[o];return hL(s)&&{value:s}},i=Object.fromEntries(this.getSupportedChannels().map(o=>[o,r(o)]).filter(o=>o[1].value!==void 0)),a=this.fixEncoding({...t,...i,...n});for(const o of Object.keys(a))this.getSupportedChannels().includes(o)||delete a[o];return a})}getContext(){return this.unitView.context}getType(){return this.unitView.getMarkType()}initializeData(){}initializeEncoders(){this.encoders=$B(this)}async initializeGraphics(){}updateGraphicsData(){}getSampleFacetMode(){if(this.encoders.facetIndex)return NA;if(this.unitView.getLayoutAncestors().find(t=>"samples"in t.spec))return dL}createAndLinkShaders(t,n,r=[]){const i=this.getAttributes(),a="// view: "+this.unitView.getPathString();this.domainUniforms=[];let o=[];const s=new Set,c=RA(this.encoders),l=this.getSampleFacetMode();l&&r.push(`#define ${l}`);for(const g of i){let b;if(g in this.encoding)b=g;else continue;const v=this.encoding[b];if(v)if(Gn(v))o.push(UO(b,v.value));else{const x=rn(v)&&v.resolutionChannel||b,A=
|
689
|
+
Error compiling: ${a}`,e.deleteShader(c));e.deleteProgram(r)}if(a)return{message:a,detail:o}}return{program:r,getProgramErrors:i}}function Dl(e,t,n,r){return r?U3(e,r,n,t):r=kl(e,{...t,src:n}),r}function fL(...e){const t={get(n,r,i){for(const a of e){const s=a()[r];if(s!==void 0)return s}},has(n,r,i){for(const a of e){const o=a();if(r in o)return!0}return!1}};return new Proxy({},t)}function hL(e){return Me(e)||ft(e)||kc(e)}class Za extends Error{constructor(t,n){super(t),this.name="ViewError",this.view=n}}const dL="SAMPLE_FACET_UNIFORM",NA="SAMPLE_FACET_TEXTURE";class Bl{constructor(t){this.unitView=t,this.encoders=void 0,this.bufferInfo=void 0,this.programInfo=void 0,this.vertexArrayInfo=void 0,this.domainUniformInfo=void 0,this.viewUniformInfo=void 0,this.markUniformInfo=void 0,this.markUniformsAltered=!0,this.rangeMap=new pL,this.defaultProperties={get clip(){return["x","y"].map(n=>t.getScaleResolution(n)).some(n=>(n==null?void 0:n.isZoomable())??!1)},xOffset:0,yOffset:0,minBufferSize:0},this.properties=fL(typeof this.unitView.spec.mark=="object"?()=>this.unitView.spec.mark:()=>({}),()=>this.defaultProperties)}get opaque(){return!1}getAttributes(){throw new Error("Not implemented!")}getSupportedChannels(){return["sample","facetIndex","x","y","color","opacity","search","uniqueId"]}getDefaultEncoding(){const t={sample:void 0,uniqueId:void 0};return this.isPickingParticipant()&&(t.uniqueId={field:"_uniqueId"}),t}fixEncoding(t){return t}get encoding(){return ds(this,"encoding",()=>{const t=this.getDefaultEncoding(),n=this.unitView.getEncoding(),r=o=>{const s=this.properties[o];return hL(s)&&{value:s}},i=Object.fromEntries(this.getSupportedChannels().map(o=>[o,r(o)]).filter(o=>o[1].value!==void 0)),a=this.fixEncoding({...t,...i,...n});for(const o of Object.keys(a))this.getSupportedChannels().includes(o)||delete a[o];return a})}getContext(){return this.unitView.context}getType(){return this.unitView.getMarkType()}initializeData(){}initializeEncoders(){this.encoders=$B(this)}async initializeGraphics(){}updateGraphicsData(){}getSampleFacetMode(){if(this.encoders.facetIndex)return NA;if(this.unitView.getLayoutAncestors().find(t=>"samples"in t.spec))return dL}createAndLinkShaders(t,n,r=[]){const i=this.getAttributes(),a="// view: "+this.unitView.getPathString();this.domainUniforms=[];let o=[];const s=new Set,c=RA(this.encoders),l=this.getSampleFacetMode();l&&r.push(`#define ${l}`);for(const g of i){let b;if(g in this.encoding)b=g;else continue;const v=this.encoding[b];if(v)if(Gn(v))o.push(UO(b,v.value));else{const x=rn(v)&&v.resolutionChannel||b,A=Ri(x)?this.unitView.getScaleResolution(x).getScale():_h(),w=Ur(v)?c.get([v.field,!0]):[b],_=$O(b,A,v,w);o.push(_.glsl),_.domainUniform&&this.domainUniforms.push(_.domainUniform),_.attributeGlsl&&s.add(_.attributeGlsl)}}const u=this.domainUniforms.length?`layout(std140) uniform Domains {
|
690
690
|
`+this.domainUniforms.map(g=>` ${g}
|
691
691
|
`).join("")+`};
|
692
692
|
|
693
693
|
`:"",h=[`precision highp float;
|
694
694
|
`,a,...r,FA,tL,u,[...s].join(`
|
695
|
-
`),...o,nL,rL,t],d=[a,...r,FA,iL,n],p=this.gl;this.programStatus=uL(p,this.glHelper.compileShader(p.VERTEX_SHADER,h),this.glHelper.compileShader(p.FRAGMENT_SHADER,d))}finalizeGraphicsInitialization(){const t=this.programStatus.getProgramErrors();if(t){t.detail&&console.warn(t.detail);const n=new Error("Cannot create shader program: "+t.message);throw n.view=this.unitView,n}this.programInfo=hO(this.gl,this.programStatus.program),delete this.programStatus,this.domainUniforms.length&&(this.domainUniformInfo=Am(this.gl,this.programInfo,"Domains")),this.viewUniformInfo=Am(this.gl,this.programInfo,"View"),this.markUniformInfo=Am(this.gl,this.programInfo,"Mark"),this.gl.useProgram(this.programInfo.program),this._setDatums(),ja(this.programInfo,{uSampleFacet:[0,1,0,1],uTransitionOffset:0,uZero:0})}registerMarkUniform(t,n,r=i=>i){const i=this.markUniformInfo.setters[t];if(zA(n)){const a=this.unitView.context.paramBroker.createExpression(n.expr),o=()=>{i(r(a(null))),this.markUniformsAltered=!0};a.addListener(o),o()}else i(r(n)),this.markUniformsAltered=!0}_setDatums(){for(const[t,n]of Object.entries(this.encoding))if(vl(n)){const r=this.encoders[t],i=r.indexer?r.indexer(n.datum):Zh(r.scale.type)?IA(+n.datum):+n.datum;ja(this.programInfo,{[Tm+t]:i})}}deleteGraphicsData(){if(this.bufferInfo){const t=this.gl;for(let n=0;n<8;n++)t.disableVertexAttribArray(n);Object.values(this.bufferInfo.attribs).forEach(n=>this.gl.deleteBuffer(n.buffer)),this.bufferInfo.indices&&this.gl.deleteBuffer(this.bufferInfo.indices),this.bufferInfo=void 0}}updateBufferInfo(t){if(this.gl.bindVertexArray(null),this.bufferInfo&&t.vertexCount<=this.bufferInfo.allocatedVertices)for(const[n,r]of Object.entries(t.arrays))r.data&&_F(this.gl,this.bufferInfo.attribs[n],r.data,0);else this.deleteGraphicsData(),this.bufferInfo=TF(this.gl,t.arrays,{numElements:t.vertexCount}),this.bufferInfo.allocatedVertices=t.allocatedVertices,this.vertexArrayInfo=void 0}get glHelper(){return this.getContext().glHelper}get gl(){return this.glHelper.gl}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}isReady(){return this.bufferInfo&&this.programInfo}isPickingParticipant(){if(this.properties.tooltip===null)return!1;for(const t of this.unitView.getLayoutAncestors())if(!t.isPickingSupported())return!1;return!0}bindOrSetMarkUniformBlock(){this.markUniformsAltered?(Em(this.gl,this.programInfo,this.markUniformInfo),this.markUniformsAltered=!1):dA(this.gl,this.programInfo,this.markUniformInfo)}prepareRender(t){const n=this.glHelper,r=this.gl,i=[];if(i.push(()=>{this.vertexArrayInfo||(this.vertexArrayInfo=DO(this.gl,this.programInfo,this.bufferInfo)),r.useProgram(this.programInfo.program)}),this.domainUniformInfo){for(const[o,s]of Object.entries(this.domainUniformInfo.setters)){const c=o.substring(EA.length),l=this.encoding[c],u=rn(l)&&l.resolutionChannel||c;if(
|
695
|
+
`),...o,nL,rL,t],d=[a,...r,FA,iL,n],p=this.gl;this.programStatus=uL(p,this.glHelper.compileShader(p.VERTEX_SHADER,h),this.glHelper.compileShader(p.FRAGMENT_SHADER,d))}finalizeGraphicsInitialization(){const t=this.programStatus.getProgramErrors();if(t){t.detail&&console.warn(t.detail);const n=new Error("Cannot create shader program: "+t.message);throw n.view=this.unitView,n}this.programInfo=hO(this.gl,this.programStatus.program),delete this.programStatus,this.domainUniforms.length&&(this.domainUniformInfo=Am(this.gl,this.programInfo,"Domains")),this.viewUniformInfo=Am(this.gl,this.programInfo,"View"),this.markUniformInfo=Am(this.gl,this.programInfo,"Mark"),this.gl.useProgram(this.programInfo.program),this._setDatums(),ja(this.programInfo,{uSampleFacet:[0,1,0,1],uTransitionOffset:0,uZero:0})}registerMarkUniform(t,n,r=i=>i){const i=this.markUniformInfo.setters[t];if(zA(n)){const a=this.unitView.context.paramBroker.createExpression(n.expr),o=()=>{i(r(a(null))),this.markUniformsAltered=!0};a.addListener(o),o()}else i(r(n)),this.markUniformsAltered=!0}_setDatums(){for(const[t,n]of Object.entries(this.encoding))if(vl(n)){const r=this.encoders[t],i=r.indexer?r.indexer(n.datum):Zh(r.scale.type)?IA(+n.datum):+n.datum;ja(this.programInfo,{[Tm+t]:i})}}deleteGraphicsData(){if(this.bufferInfo){const t=this.gl;for(let n=0;n<8;n++)t.disableVertexAttribArray(n);Object.values(this.bufferInfo.attribs).forEach(n=>this.gl.deleteBuffer(n.buffer)),this.bufferInfo.indices&&this.gl.deleteBuffer(this.bufferInfo.indices),this.bufferInfo=void 0}}updateBufferInfo(t){if(this.gl.bindVertexArray(null),this.bufferInfo&&t.vertexCount<=this.bufferInfo.allocatedVertices)for(const[n,r]of Object.entries(t.arrays))r.data&&_F(this.gl,this.bufferInfo.attribs[n],r.data,0);else this.deleteGraphicsData(),this.bufferInfo=TF(this.gl,t.arrays,{numElements:t.vertexCount}),this.bufferInfo.allocatedVertices=t.allocatedVertices,this.vertexArrayInfo=void 0}get glHelper(){return this.getContext().glHelper}get gl(){return this.glHelper.gl}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}isReady(){return this.bufferInfo&&this.programInfo}isPickingParticipant(){if(this.properties.tooltip===null)return!1;for(const t of this.unitView.getLayoutAncestors())if(!t.isPickingSupported())return!1;return!0}bindOrSetMarkUniformBlock(){this.markUniformsAltered?(Em(this.gl,this.programInfo,this.markUniformInfo),this.markUniformsAltered=!1):dA(this.gl,this.programInfo,this.markUniformInfo)}prepareRender(t){const n=this.glHelper,r=this.gl,i=[];if(i.push(()=>{this.vertexArrayInfo||(this.vertexArrayInfo=DO(this.gl,this.programInfo,this.bufferInfo)),r.useProgram(this.programInfo.program)}),this.domainUniformInfo){for(const[o,s]of Object.entries(this.domainUniformInfo.setters)){const c=o.substring(EA.length),l=this.encoding[c],u=rn(l)&&l.resolutionChannel||c;if(Ri(u)){const f=this.unitView.getScaleResolution(u).getScale();i.push(()=>{const h=zr(f.type)?[0,f.domain().length]:f.domain();s(Zh(f.type)?qO(h):h)})}}i.push(()=>Em(r,this.programInfo,this.domainUniformInfo))}for(const[o,s]of Object.entries(this.encoding))if(rn(s)){const c=rn(s)&&s.resolutionChannel||o;if(Ri(c)){const l=this.unitView.getScaleResolution(c),u=n.rangeTextures.get(l);u&&i.push(()=>ja(this.programInfo,{[Im+o]:u}))}}this.getSampleFacetMode()==NA&&i.push(()=>{let o;for(const s of this.unitView.getLayoutAncestors())if(o=s.getSampleFacetTexture(),o)break;if(!o)throw new Error("No facet texture available. This is bug.");ja(this.programInfo,{uSampleFacetTexture:o})});const a=(t.picking??!1)&&this.isPickingParticipant();return i.push(()=>fs(this.viewUniformInfo,{uViewOpacity:this.unitView.getEffectiveOpacity(),uPickingEnabled:a})),this.opaque||t.picking?i.push(()=>r.disable(r.BLEND)):i.push(()=>r.enable(r.BLEND)),i}prepareSampleFacetRendering(t){const n=t.sampleFacetRenderingOptions,r=this.programInfo.uniformSetters.uSampleFacet;if(n&&r){const i=n.locSize?n.locSize.location:0,a=n.locSize?n.locSize.size:1;if(i>1||i+a<0)return!1;const o=n.targetLocSize?n.targetLocSize.location:i,s=n.targetLocSize?n.targetLocSize.size:a;this.gl.uniform4f(r.location,i,a,o,s)}return!0}render(t){}createRenderCallback(t,n){var f;if(!this.bufferInfo)throw new Za(`${this.getType()} mark has no data. This is bug.`,this.unitView);const r=this;let i;const a=(f=this.unitView.getScaleResolution("x"))==null?void 0:f.getScale(),o=a&&_t(a.type),s=["index","locus"].includes(a==null?void 0:a.type)?-1:0,c=[0,0];i=h=>{if(o&&h.xIndex){const d=a.domain(),p=h.xIndex(d[0]+s,d[1],c),g=p[0],b=p[1]-g;b>0&&t(g,b)}else t(h.offset,h.count)};const l=this.rangeMap.get(void 0).count==0?n.facetId:void 0,u=this.rangeMap.get(l);return n.sampleFacetRenderingOptions?function(){u.count&&r.prepareSampleFacetRendering(n)&&i(u)}:function(){u.count&&i(u)}}setViewport(t,n){t=t.flatten();const r=this.unitView.context.devicePixelRatio,i=this.gl,a=this.properties,o=this.glHelper.getLogicalCanvasSize(),s=.5,c=(a.xOffset??0)+s,l=(a.yOffset??0)+s;let u,f=t;if(a.clip!=="never"&&(a.clip||n)){let h=0,d=0,p;if(n){if(f=t.intersect(n).flatten(),!f.isDefined())return!1;p=[t.width/f.width,t.height/f.height],d=Math.max(0,t.y2-n.y2),h=Math.min(0,t.x-n.x)}else p=[1,1];const g=[f.x,o.height-f.y2,f.width,f.height].map(A=>A*r),b=g.map(A=>Math.round(A)),[v,x]=g.map((A,w)=>A-b[w]);i.viewport(...b),i.scissor(...b),i.enable(i.SCISSOR_TEST),u={uViewOffset:[(c+h+v/r)/f.width,-(l+d-x/r)/f.height],uViewScale:p}}else{if(!t.isDefined())return!1;i.viewport(0,0,o.width*r,o.height*r),i.disable(i.SCISSOR_TEST),u={uViewOffset:[(t.x+c)/o.width,(o.height-t.y-l-t.height)/o.height],uViewScale:[t.width/o.width,t.height/o.height]}}return fs(this.viewUniformInfo,{...u,uViewportSize:[t.width,t.height],uDevicePixelRatio:r}),Em(this.gl,this.programInfo,this.viewUniformInfo),!0}findDatumAt(t,n){}}class pL extends gi{constructor(){super([],JSON.stringify)}get(t){let n=super.get(t);return n===void 0&&(n={offset:0,count:0,xIndex:void 0},super.set(t,n)),n}migrateEntries(t){for(const[n,r]of t.entries())Object.assign(this.get(n),r)}}function zA(e){return typeof e=="object"&&"expr"in e&&Me(e.expr)}function Pm(e,t){const n=jB(t);let r=e[t]&&{...e[t]},i=e[n]&&{...e[n]};if(!(Gn(r)||Gn(i))){if(r){if(!rn(e[t]))return;if(i){if(r.type!="quantitative"){const a=(1-(r.band||1))/2;r.band=a,i.band=-a}}else if(r.type=="quantitative")i={datum:0};else{i={...r};const a=(1-(r.band??1))/2;r.band=0+a,i.band=1-a}}else r={value:0},i={value:1};e[t]=r,e[n]=i}}function UA(e,t){e.stroke||(t?e.stroke={value:null}:e.stroke={resolutionChannel:"color",...e.color}),Gn(e.stroke)&&e.stroke.value===null&&(e.strokeWidth={value:0}),e.strokeOpacity||(e.strokeOpacity={resolutionChannel:"opacity",...e.opacity})}function $A(e,t){Gn(e.fill)&&e.fill.value===null?e.fillOpacity={value:0}:e.fill||(e.fill={resolutionChannel:"color",...e.color},!t&&!e.fillOpacity&&(e.fillOpacity={value:0})),e.fillOpacity||(t?e.fillOpacity={resolutionChannel:"opacity",...e.opacity}:e.fillOpacity={value:0})}class gL extends Bl{constructor(n){super(n);Z(this,tf);Z(this,nf);Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x2:void 0,y2:void 0,filled:!0,color:"#4c78a8",opacity:1,strokeWidth:3,cornerRadius:0,minWidth:.5,minHeight:.5,minOpacity:1,tessellationZoomThreshold:10,tessellationTiles:35}))}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","fill","stroke","fillOpacity","strokeOpacity","strokeWidth"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","fill","stroke","fillOpacity","strokeOpacity","strokeWidth"]}get opaque(){return ds(this,"opaque",()=>!J(this,tf,j2).call(this)&&!J(this,nf,q2).call(this)&&Gn(this.encoding.fillOpacity)&&this.encoding.fillOpacity.value==1&&this.properties.minOpacity==1)&&this.unitView.getEffectiveOpacity()==1}fixEncoding(n){return Pm(n,"x"),Pm(n,"y"),UA(n,this.properties.filled),$A(n,this.properties.filled),delete n.color,delete n.opacity,n}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}async initializeGraphics(){await super.initializeGraphics();const n=[];J(this,tf,j2).call(this)&&n.push("ROUNDED_CORNERS"),J(this,nf,q2).call(this)&&n.push("STROKED"),this.createAndLinkShaders(OO,LO,n.map(r=>"#define "+r))}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const n=this.properties;this.registerMarkUniform("uMinWidth",n.minWidth),this.registerMarkUniform("uMinHeight",n.minHeight),this.registerMarkUniform("uMinOpacity",n.minOpacity),this.registerMarkUniform("uCornerRadiusTopRight",n.cornerRadiusTopRight??n.cornerRadius??0),this.registerMarkUniform("uCornerRadiusBottomRight",n.cornerRadiusBottomRight??n.cornerRadius??0),this.registerMarkUniform("uCornerRadiusTopLeft",n.cornerRadiusTopLeft??n.cornerRadius??0),this.registerMarkUniform("uCornerRadiusBottomLeft",n.cornerRadiusBottomLeft??n.cornerRadius??0)}updateGraphicsData(){const n=this.unitView.getCollector(),r=n.getItemCount(),i=new QO({encoders:this.encoders,attributes:this.getAttributes(),numItems:r});i.addBatches(n.facetBatches);const a=i.toArrays();this.rangeMap.migrateEntries(a.rangeMap),this.updateBufferInfo(a)}prepareRender(n){const r=super.prepareRender(n);return r.push(()=>this.bindOrSetMarkUniformBlock()),r.push(()=>qa(this.gl,this.programInfo,this.vertexArrayInfo)),r}render(n){const r=this.gl;return this.createRenderCallback((i,a)=>{Wh(r,this.vertexArrayInfo,r.TRIANGLE_STRIP,a,i)},n)}findDatumAt(n,r){n=Lt(n);const i=this.unitView.getCollector().facetBatches.get(n);if(!i)return;const a=this.encoders,o=a.x.scale.type;if(zr(o)){const s=a.x.accessor;return i.find(c=>r==s(c))}else{const s=a.x.accessor,c=a.x2.accessor;return i.find(l=>r>=s(l)&&r<c(l))}}}tf=new WeakSet,j2=function(){const n=this.properties;return n.cornerRadius||n.cornerRadiusBottomLeft||n.cornerRadiusBottomRight||n.cornerRadiusTopLeft||n.cornerRadiusTopRight},nf=new WeakSet,q2=function(){const n=this.encoding.strokeWidth;return!(Gn(n)&&!n.value)};const mL=`out float vRadius;
|
696
696
|
out float vRadiusWithPadding;
|
697
697
|
out lowp vec4 vFillColor;
|
698
698
|
out lowp vec4 vStrokeColor;
|
@@ -960,7 +960,7 @@ void main() {
|
|
960
960
|
|
961
961
|
uniform mediump float uGradientStrength;
|
962
962
|
};
|
963
|
-
`,
|
963
|
+
`,gr=1,Li=2,Mm=4,vL={};class at{get behavior(){return 0}constructor(){this.children=[],this.parent=void 0,this.completed=!1}reset(){this.completed=!1;for(const t of this.children)t.reset()}initialize(){}_updatePropagator(){this._propagate=Function("children",mi(this.children.length).map(t=>`const child${t} = children[${t}];`).join(`
|
964
964
|
`)+`return function propagate(datum) {${mi(this.children.length).map(t=>`child${t}.handle(datum);`).join(`
|
965
965
|
`)}}`)(this.children)}setParent(t){this.parent=t}addChild(t){if(t.parent)throw new Error("Cannot add the child! It already has a parent.");return this.children.push(t),t.setParent(this),this._updatePropagator(),this}adopt(t){t.parent&&t.parent.removeChild(t),this.addChild(t)}adoptChildrenOf(t){for(const n of t.children)this.adopt(n)}insertAsParent(t){if(this.isRoot())throw new Error("Cannot insert a new parent for a root node!");t.parent=this.parent,this.parent.children[this.parent.children.indexOf(this)]=t,this.parent._updatePropagator(),this.parent=void 0,t.addChild(this)}removeChild(t){const n=this.children.indexOf(t);if(n>-1)this.children.splice(n,1),t.parent=void 0,this._updatePropagator();else throw new Error("Trying to remove an unknown child node!")}excise(){if(this.isRoot())throw new Error("Cannot excise root node!");if(this.isTerminal())this.parent.removeChild(this);else if(this.children.length==1){const t=this.children[0];t.setParent(this.parent),this.parent.children[this.parent.children.indexOf(this)]=t,this.parent._updatePropagator(),this.setParent(void 0),this.children.length=0}else throw new Error("Cannot excise a node that has multiple children!")}isRoot(){return!this.parent}isBranching(){return this.children.length>1}isTerminal(){return this.children.length==0}visit(t){t(this);for(const n of this.children)n.visit(t);t.afterChildren&&t.afterChildren(this)}subtreeToString(t=0){const n=this.children.map(r=>r.subtreeToString(t+1)).join("");return`${" ".repeat(t*2)}* ${this.constructor.name}${("identifier"in this&&this.identifier?": "+this.identifier:"")??""}
|
966
966
|
${n}`}getGlobalObject(){return this.parent?this.parent.getGlobalObject():vL}handle(t){this._propagate(t)}complete(){this.completed=!0;for(const t of this.children)t.complete()}beginBatch(t){for(const n of this.children)n.beginBatch(t)}_propagate(t){}}function HA(e){return e.type=="file"}function wL(e){return e.type=="facet"}class GA extends at{constructor(t){super(),this.k=t.size||500,this.reset()}reset(){super.reset(),this.reservoir=[],this.W=void 0,this.ingester=this._initialIngester}_initialIngester(t){this.reservoir.push(t),this.reservoir.length==this.k&&(this.W=Math.exp(Math.log(Math.random())/this.k),this.i=this.k,this.next=this.i,this.ingester=this._finalIngester,this._setNextStop())}_finalIngester(t){++this.i==this.next&&(this.reservoir[Math.floor(Math.random()*this.k)]=t,this.W*=Math.exp(Math.log(Math.random())/this.k),this._setNextStop())}_setNextStop(){this.next+=Math.floor(Math.log(Math.random())/Math.log(1-this.W))+1}handle(t){this.ingester(t)}complete(){for(const t of this.reservoir)this._propagate(t);super.complete()}}function VA(e,t,n){const r=new GA({type:"sample",size:e});for(const i of t)r.handle(n(i));return r.complete(),r.reservoir}const xL={};class AL extends Bl{constructor(t){super(t),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:.5,y:.5,color:"#4c78a8",filled:!0,opacity:1,size:100,semanticScore:0,shape:"circle",strokeWidth:2,fillGradientStrength:0,dx:0,dy:0,angle:0,sampleFacetPadding:.1,semanticZoomFraction:.02}))}getAttributes(){return["inwardStroke","uniqueId","facetIndex","x","y","size","semanticScore","shape","strokeWidth","gradientStrength","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"size","semanticScore","shape","strokeWidth","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getDefaultEncoding(){return{...super.getDefaultEncoding(),...xL}}fixEncoding(t){return UA(t,this.properties.filled),$A(t,this.properties.filled),delete t.color,delete t.opacity,t}initializeData(){super.initializeData();const t=this.unitView.getAccessor("semanticScore");t&&(this.sampledSemanticScores=Float32Array.from(VA(1e4,this.unitView.getCollector().getData(),t)),this.sampledSemanticScores.sort((n,r)=>n-r))}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(mL,bL,[yL])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;fs(this.markUniformInfo,{uInwardStroke:!!t.inwardStroke,uGradientStrength:+t.fillGradientStrength,uMaxRelativePointDiameter:1-2*t.sampleFacetPadding})}updateGraphicsData(){const t=this.unitView.getCollector(),n=t.getItemCount(),r=new KO({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(n,this.properties.minBufferSize||0)});r.addBatches(t.facetBatches);const i=r.toArrays();this.rangeMap.migrateEntries(i.rangeMap),this.updateBufferInfo(i)}_getGeometricScaleFactor(){const t=Math.pow(2,this.properties.geometricZoomBound||0);return Math.pow(Math.min(1,this.unitView.getZoomLevel()/t),1/3)}_getMaxPointSize(){const t=this.encoders.size;return t.constant?t(null):t.scale.range().reduce((n,r)=>Math.max(n,r))}getSemanticThreshold(){if(this.sampledSemanticScores){const t=Math.max(0,1-this.properties.semanticZoomFraction*this.unitView.getZoomLevel());if(t<=0)return-1/0;if(t>=1)return 1/0;{const n=this.sampledSemanticScores;return Tp(n,t)}}else return-1}prepareRender(t){const n=super.prepareRender(t);return n.push(()=>{fs(this.markUniformInfo,{uMaxPointSize:this._getMaxPointSize(),uScaleFactor:this._getGeometricScaleFactor(),uSemanticThreshold:this.getSemanticThreshold()}),this.markUniformsAltered=!0}),n.push(()=>this.bindOrSetMarkUniformBlock()),n.push(()=>qa(this.gl,this.programInfo,this.vertexArrayInfo)),n}render(t){const n=this.gl;return this.createRenderCallback((r,i)=>{i&&Wh(n,this.vertexArrayInfo,n.POINTS,i,r)},t)}}const EL=`// Line caps
|
@@ -1614,7 +1614,7 @@ void main() {
|
|
1614
1614
|
uniform mediump float uPaddingY;
|
1615
1615
|
uniform bool uFlushY;
|
1616
1616
|
};
|
1617
|
-
`,LL={left:-1,center:0,right:1},NL={top:-1,middle:0,bottom:1,alphabetic:1};class zL extends Bl{constructor(t){super(t),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:.5,y:.5,x2:void 0,y2:void 0,text:"",size:11,color:"black",opacity:1,font:void 0,fontStyle:void 0,fontWeight:void 0,align:"center",baseline:"middle",dx:0,dy:0,angle:0,fitToBand:!1,squeeze:!0,paddingX:0,paddingY:0,flushX:!0,flushY:!0,logoLetters:!1,viewportEdgeFadeWidthTop:0,viewportEdgeFadeWidthRight:0,viewportEdgeFadeWidthBottom:0,viewportEdgeFadeWidthLeft:0,viewportEdgeFadeDistanceTop:-1/0,viewportEdgeFadeDistanceRight:-1/0,viewportEdgeFadeDistanceBottom:-1/0,viewportEdgeFadeDistanceLeft:-1/0})),this.font=this.properties.font?t.context.fontManager.getFont(this.properties.font,this.properties.fontStyle,this.properties.fontWeight):t.context.fontManager.getDefaultFont()}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","color","size","opacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size","text","angle"]}fixEncoding(t){for(const n of ns)this.properties.fitToBand&&Pm(t,n);return t}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(PL,ML,[OL])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;this.registerMarkUniform("uSdfNumerator",{expr:"devicePixelRatio"},n=>{let r=.35;return this.properties.logoLetters&&(r/=2),this.font.metrics.common.base/(n/r)}),fs(this.markUniformInfo,{uPaddingX:t.paddingX,uPaddingY:t.paddingY,uFlushX:!!t.flushX,uFlushY:!!t.flushY,uAlign:[LL[t.align],NL[t.baseline]],uD:[t.dx,-t.dy],uLogoLetter:!!t.logoLetters,uSqueeze:!!t.squeeze,uViewportEdgeFadeWidth:[t.viewportEdgeFadeWidthTop,t.viewportEdgeFadeWidthRight,t.viewportEdgeFadeWidthBottom,t.viewportEdgeFadeWidthLeft],uViewportEdgeFadeDistance:[t.viewportEdgeFadeDistanceTop,t.viewportEdgeFadeDistanceRight,t.viewportEdgeFadeDistanceBottom,t.viewportEdgeFadeDistanceLeft]})}updateGraphicsData(){const t=this.unitView.getCollector(),n=t.getData(),r=this.encoding,i=this.encoders.text.accessor||this.encoders.text;let a=0;const o="format"in r.text?pt(r.text.format):l=>l;for(const l of n){const u=o(i(l)),f=Me(u)?u:u===null?"":""+u;a+=f&&f.length||0}const s=new eL({encoders:this.encoders,attributes:this.getAttributes(),properties:this.properties,fontMetrics:this.font.metrics,numCharacters:Math.max(a,this.properties.minBufferSize||0)});s.addBatches(t.facetBatches);const c=s.toArrays();this.rangeMap.migrateEntries(c.rangeMap),this.updateBufferInfo(c)}prepareRender(t){const n=super.prepareRender(t);return n.push(()=>{ja(this.programInfo,{uTexture:this.font.texture})}),n.push(()=>this.bindOrSetMarkUniformBlock()),n.push(()=>qa(this.gl,this.programInfo,this.vertexArrayInfo)),n}render(t){const n=this.gl;return this.createRenderCallback((r,i)=>Wh(n,this.vertexArrayInfo,n.TRIANGLES,i,r),t)}}function Fl(e,t,{spacing:n,devicePixelRatio:r,offset:i,reverse:a}={}){n=n||0,i=i||0;let o=0,s=0;for(const p of e)o+=ps(p.px)+(Om(p)?0:n),s+=ps(p.grow);o-=n;const c=Math.max(0,t-o),l=r!==void 0?p=>Math.round(p*r)/r:p=>p,u=[],f=[],h=p=>{const g=u.length;if(!g)return;const b=(p?n:0)*(a?-1:1);d-=b;for(let v=0;v<g;v++)f.push({location:d+(v+1)/(g+1)*b,size:0});d+=b,u.length=0};let d=a?Math.max(t,o):0+i;if(e.length==1&&Om(e[0]))return[{location:d,size:0}];for(let p=0;p<e.length;p++){const g=e[p];if(Om(g))u.push(g);else{h(f.length>0);const b=ps(g.px)+(s?ps(g.grow)/s*c:0);a&&(d-=b),f.push({location:l(d),size:l(b)}),a?d-=n:d+=b+n}}return d+=a?n:-n,h(!1),f}function UL(e){let t=0,n=0;for(const r of e)t=Math.max(t,r.px??0),n=Math.max(n,r.grow??0);return{px:t,grow:n}}function $L(e){const t={px:0,grow:0};for(const n of e)t.px+=ps(n.px),t.grow+=ps(n.grow);return t}const z2=class z2{constructor(t,n){Z(this,rf);this.width=t,this.height=n}addPadding(t){return J(this,rf,W2).call(this,t.width,t.height)}subtractPadding(t){return J(this,rf,W2).call(this,-t.width,-t.height)}};rf=new WeakSet,W2=function(t,n){return new z2({px:(this.width.px??0)+t,grow:this.width.grow},{px:(this.height.px??0)+n,grow:this.height.grow})};let Gr=z2;const Pl=Object.freeze({px:0,grow:0}),jA=new Gr(Pl,Pl);function Om(e){return!e.px&&!e.grow}function ps(e){return e||0}function HL(e){return e&&(ft(e.px)||ft(e.grow))}function qA(e){if(QA(e))throw new Error("parseSizeDef does not accept step-based sizes.");if(HL(e))return e;if(ft(e))return{px:e,grow:0};if(e==="container")return{px:0,grow:1};if(!e)return{px:0,grow:1};throw new Error(`Invalid sizeDef: ${e}`)}function GL(e,t,n){return{get location(){const r=n();switch(r){case 0:return e.location;case 1:return t.location;default:return r*t.location+(1-r)*e.location}},get size(){const r=n();switch(r){case 0:return e.size;case 1:return t.size;default:return r*t.size+(1-r)*e.size}}}}function VL(e,t){const n=ft(t)?()=>t:t;return{get location(){return e.location+n()},get size(){return e.size}}}function jL(e,t){const n=ft(t)?()=>t:t;return{get location(){return e.location*n()},get size(){return e.size*n()}}}function WA(e,t){return t>=e.location&&t<e.location+e.size}class Ct{constructor(t,n,r,i){this.top=t||0,this.right=n||0,this.bottom=r||0,this.left=i||0}get width(){return this.left+this.right}get height(){return this.top+this.bottom}expand(t){return t<=0?this:new Ct(this.top+t,this.right+t,this.bottom+t,this.left+t)}add(t){return new Ct(this.top+t.top,this.right+t.right,this.bottom+t.bottom,this.left+t.left)}subtract(t){return new Ct(this.top-t.top,this.right-t.right,this.bottom-t.bottom,this.left-t.left)}union(t){return new Ct(Math.max(this.top,t.top),Math.max(this.right,t.right),Math.max(this.bottom,t.bottom),Math.max(this.left,t.left))}getHorizontal(){return new Ct(0,this.right,0,this.left)}getVertical(){return new Ct(this.top,0,this.bottom,0)}get horizontalTotal(){return this.left+this.right}get verticalTotal(){return this.top+this.bottom}static createFromConfig(t){return typeof t=="number"?this.createUniformPadding(t):t?this.createFromRecord(t):Lm}static createFromRecord(t){return new Ct(t.top,t.right,t.bottom,t.left)}static zero(){return Lm}static createUniformPadding(t){return new Ct(t,t,t,t)}}const Lm=Ct.createUniformPadding(0);Object.freeze(Lm);const qL=/^([A-Za-z]+:)?\/\//;function WL(e,t){if(t&&qL.test(t))return t;const n=e();return n&&t?n.endsWith("/")?n+t:n+"/"+t:n??t}const YA="VISIT_SKIP",Qa="VISIT_STOP",ZA=e=>e;class YL{constructor(t,n,r,i,a,o={}){Z(this,Po);Z(this,sf);Z(this,lc,{});Z(this,af,{});Z(this,of,{});ar(this,"opacityFunction",ZA);ar(this,"coords");if(!t)throw new Error("View spec must be defined!");this.context=n,this.layoutParent=r,this.dataParent=i,this.name=t.name||a,this.spec=t,this.resolutions={scale:{},axis:{}},MA(this),this.options={blockEncodingInheritance:!1,contributesToScaleDomain:!0,...o},this.needsAxes={x:!1,y:!1}}getPadding(){return this._cache("size/padding",()=>Ct.createFromConfig(this.spec.padding))}getOverhang(){return Ct.zero()}isScrollable(){return this.spec.viewportWidth!=null||this.spec.viewportHeight!=null}getSize(){return this._cache("size/size",()=>this.isConfiguredVisible()?new Gr(J(this,Po,kf).call(this,"width"),J(this,Po,kf).call(this,"height")):jA)}getViewportSize(){if(!this.isScrollable())return this.getSize();if(!this.isConfiguredVisible())return jA;const t=this.getSize();return new Gr(J(this,Po,kf).call(this,"viewportWidth")??t.width,J(this,Po,kf).call(this,"viewportHeight")??t.height)}isConfiguredVisible(){return this.context.isViewConfiguredVisible(this)}isVisibleInSpec(){return this.spec.visible??!0}isVisible(){return this.getLayoutAncestors().every(t=>t.isConfiguredVisible())}getEffectiveOpacity(){var t;return this.opacityFunction(((t=this.layoutParent)==null?void 0:t.getEffectiveOpacity())??1)}getPathString(){return this.getLayoutAncestors().map(t=>t.name).reverse().join("/")}getLayoutAncestors(){return J(this,sf,Y2).call(this,"layoutParent")}getDataAncestors(){return J(this,sf,Y2).call(this,"dataParent")}handleBroadcast(t){for(const n of P(this,lc)[t.type]||[])n(t)}_addBroadcastHandler(t,n){let r=P(this,lc)[t];r||(r=[],P(this,lc)[t]=r),r.push(n)}handleInteractionEvent(t,n,r){const i=r?P(this,af):P(this,of);for(const a of i[n.type]||[])a(t,n)}addInteractionEventListener(t,n,r){const i=r?P(this,af):P(this,of);let a=i[t];a||(a=[],i[t]=a),a.push(n)}visit(t){try{const n=t(this);if(t.postOrder&&t.postOrder(this),n!==Qa)return n}catch(n){throw n.view=this,n}}getDescendants(){const t=[];return this.visit(n=>{t.push(n)}),t}configureViewOpacity(){(!this.opacityFunction||this.opacityFunction===ZA)&&(this.opacityFunction=QL(this))}onBeforeRender(){}render(t,n,r={}){this.coords=r.clipRect?n.intersect(r.clipRect):n}getEncoding(){const t=this.dataParent&&!this.options.blockEncodingInheritance?this.dataParent.getEncoding():{},n=this.spec.encoding||{},r={...t,...n};for(const[i,a]of Object.entries(r))a===null&&delete r[i];return r}getFacetAccessor(t){if(this.layoutParent)return this.layoutParent.getFacetAccessor(this)}getFacetFields(t){var r;const n=this.getEncoding().sample;return Ur(n)?[n.field]:(r=this.layoutParent)==null?void 0:r.getFacetFields(this)}getSampleFacetTexture(){}getScaleResolution(t){const n=$a(t);return this.getDataAncestors().map(r=>r.resolutions.scale[n]).find(r=>r)}getAxisResolution(t){const n=$a(t);return this.getDataAncestors().map(r=>r.resolutions.axis[n]).find(r=>r)}getConfiguredResolution(t,n){var r,i;return(i=(r=this.spec.resolve)==null?void 0:r[n])==null?void 0:i[t]}getConfiguredOrDefaultResolution(t,n){return this.getConfiguredResolution(t,n)??this.getConfiguredResolution("default",n)??this.getDefaultResolution(t,n)}getDefaultResolution(t,n){return"independent"}getBaseUrl(){return WL(()=>{var t;return(t=this.dataParent)==null?void 0:t.getBaseUrl()},this.spec.baseUrl)}isPickingSupported(){return!0}getTitleText(){const t=this.spec.title;if(t)return Me(t)?t:t.text}_cache(t,n){return ds(this,t,n)}_invalidateCacheByPrefix(t,n="self"){switch(n){case"self":Il(this,t);break;case"ancestors":for(const r of this.getLayoutAncestors())Il(r,t);break;case"progeny":this.visit(r=>Il(r,t));break}}invalidateSizeCache(){this._invalidateCacheByPrefix("size/","ancestors")}propagateInteractionEvent(t){}}lc=new WeakMap,af=new WeakMap,of=new WeakMap,Po=new WeakSet,kf=function(t){var i;let n=this.spec[t];const r=t=="viewportWidth"||t=="viewportHeight";if(QA(n)){if(r)throw new Za(`Cannot use step-based size with "${t}"!`,this);const a=n.step,o=(i=this.getScaleResolution(t=="width"?"x":"y"))==null?void 0:i.getScale();if(o){let s=0;if(dr(o.type))s=o.domain().length;else if(["locus","index"].includes(o.type)){const l=o.domain();s=xn(l)-l[0]}else throw new Za(`Cannot use step-based size with "${o.type}" scale!`,this);const c=o;return s=$g(s,c.paddingInner(),c.paddingOuter()),{px:s*a,grow:0}}else throw new Za("Cannot use 'step' size with missing scale!",this)}else return(n&&qA(n))??(r?void 0:{px:0,grow:1})},sf=new WeakSet,Y2=function(t){const n=[];let r=this;do n.push(r),r=r[t];while(r);return n};function ZL(e){return"unitsPerPixel"in e}function QL(e){const t=e.spec.opacity;if(t!==void 0){if(ft(t))return n=>n*t;if(ZL(t)){const n=a=>{var s;const o=(s=e.getScaleResolution(a))==null?void 0:s.getScale();if(["linear","index","locus"].includes(o==null?void 0:o.type))return o},r=t.channel?n(t.channel):n("x")??n("y");if(!r)throw new Za("Cannot find a resolved quantitative scale for dynamic opacity!",e);const i=Fg().domain(t.unitsPerPixel).range(t.values).clamp(!0);return a=>{const s=Of(r.domain())/1e3;return i(s)*a}}else if(zA(t)){const n=e.context.paramBroker.createExpression(t.expr);return r=>n(null)*r}}return n=>n}const QA=e=>!!(e!=null&&e.step);class qn extends YL{constructor(t,n,r,i,a,o){super(t,n,r,i,a,o),this.spec=t}async initializeChildren(){}*[Symbol.iterator](){}replaceChild(t,n){throw new Error("Not implemented")}visit(t){let n;try{n=t(this)}catch(r){throw r.view=this,r}if(n===Qa)return n;if(n!==YA){t.beforeChildren&&t.beforeChildren(this);for(const r of this){const i=r.visit(t);if(i===Qa)return i}t.afterChildren&&t.afterChildren(this),t.postOrder&&t.postOrder(this)}}findDescendantByPath(t){for(const n of this)if(n.name===t[0]){if(t.length==1)return n;if(n instanceof qn)return n.findDescendantByPath(t.slice(1))}}findChildByName(t){for(const n of this)if(n.name===t)return n}findDescendantByName(t){let n;return this.visit(r=>{if(r.name==t)return n=r,Qa}),n}getDefaultResolution(t,n){return"shared"}}const XA=1;function Nm(){let e=[0,1],t=[0,1],n=1,r=1,i=0,a=0,o=.5,s=0;const l=u=>(u+o-e[0])/n*r+t[0];return l.invert=u=>(u-t[0])/r*n+e[0]-o,l.domain=function(u){if(arguments.length){e=Uf(u),n=e[1]-e[0];const f=e[0]===0&&e[0]===0;if(n<XA&&!f){n=XA;const h=(e[0]+e[1])/2;e[0]=h-n/2,e[1]=h+n/2}return l}else return e.slice()},l.range=function(u){return arguments.length?(t=[...u],r=t[1]-t[0],l):t},l.numberingOffset=function(u){return arguments.length?(s=u,l):s},l.padding=function(u){return arguments.length?(a=u,i=Math.min(1,u),l):i},l.paddingInner=function(u){return arguments.length?(i=Math.min(1,u),l):i},l.paddingOuter=function(u){return arguments.length?(a=u,l):a},l.align=function(u){return arguments.length?(o=Math.max(0,Math.min(1,u)),l):o},l.step=()=>r/n,l.bandwidth=()=>l.step(),l.ticks=u=>{const f=l.align(),h=l.numberingOffset();return Dc(e[0]-f+h,e[1]-f+h,Math.min(u,Math.ceil(n))).filter(Number.isInteger).map(d=>d-s)},l.tickFormat=(u,f)=>{if(f)throw new Error("Index scale's tickFormat does not support a specifier!");const d=wa(e[0],e[1],Math.min(u,Math.ceil(n)))<1e5?pt(","):pt(".3s");return p=>d(p+s)},l.copy=()=>Nm().domain(e).range(t).paddingInner(i).paddingOuter(a).numberingOffset(s),l}function XL(){const e=Nm().numberingOffset(1);let t;e.genome=function(r){return arguments.length?(t=r,e):t},e.ticks=r=>{if(!t)return[];const i=e.domain(),a=e.numberingOffset(),[o,s]=[Math.max(i[0],0),Math.min(i[1],t.totalSize-1)].map(u=>t.toChromosome(u)),c=Math.max(1,wa(i[0],i[1],r)),l=[];for(let u=o.index;u<=s.index;u++){const f=t.chromosomes[u],h=Math.max(f.continuousStart+c,i[0]-(i[0]-f.continuousStart)%c),d=Math.min(f.continuousEnd-c/4,i[1]+1);for(let p=h;p<=d;p+=c){const g=p-a;g>=i[0]&&g<i[1]&&l.push(g)}}return l},e.tickFormat=(r,i)=>{if(!t)return;if(i)throw new Error("Locus scale's tickFormat does not support a specifier!");const a=e.domain(),o=a[1]-a[0],s=e.numberingOffset(),l=wa(a[0],a[1],Math.min(r,Math.ceil(o)))<1e6?pt(","):pt(".3s"),u=f=>f-t.toChromosome(f).continuousStart;return f=>l(u(f)+s)};const n=e.copy;return e.copy=()=>n().genome(t),e}function KL(e){return e.type=="locus"}function Xh(e,t,n){if(n=n||[],e.some(o=>o===null)){if(e.every(o=>o===null))return null;throw console.warn(e),new Error("Cannot merge objects with nulls!")}const r={},i=(o,s)=>o===s||gs(o)&&gs(s)||gs(o)&&s===!0||o===!0&&Xt(s),a=o=>{for(let s in o){const c=o[s];if(!n.includes(s)&&c!==void 0)if(r[s]!==void 0&&!i(r[s],c))console.warn(`Conflicting property ${s} of ${t}: (${JSON.stringify(r[s])} and ${JSON.stringify(o[s])}). Using ${JSON.stringify(r[s])}.`);else{const l=r[s];if(gs(l))gs(c)&&(r[s]=Xh([l,c],s));else if(gs(c)){if(!(l===!0||l===void 0))throw new Error("Bug in merge! Target is: "+l);r[s]=Xh([{},c],s)}else r[s]=c}}};for(const o of e)a(o);return r}function gs(e){return Xt(e)&&!Array.isArray(e)}/*!
|
1617
|
+
`,LL={left:-1,center:0,right:1},NL={top:-1,middle:0,bottom:1,alphabetic:1};class zL extends Bl{constructor(t){super(t),Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors({x:.5,y:.5,x2:void 0,y2:void 0,text:"",size:11,color:"black",opacity:1,font:void 0,fontStyle:void 0,fontWeight:void 0,align:"center",baseline:"middle",dx:0,dy:0,angle:0,fitToBand:!1,squeeze:!0,paddingX:0,paddingY:0,flushX:!0,flushY:!0,logoLetters:!1,viewportEdgeFadeWidthTop:0,viewportEdgeFadeWidthRight:0,viewportEdgeFadeWidthBottom:0,viewportEdgeFadeWidthLeft:0,viewportEdgeFadeDistanceTop:-1/0,viewportEdgeFadeDistanceRight:-1/0,viewportEdgeFadeDistanceBottom:-1/0,viewportEdgeFadeDistanceLeft:-1/0})),this.font=this.properties.font?t.context.fontManager.getFont(this.properties.font,this.properties.fontStyle,this.properties.fontWeight):t.context.fontManager.getDefaultFont()}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","color","size","opacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size","text","angle"]}fixEncoding(t){for(const n of ns)this.properties.fitToBand&&Pm(t,n);return t}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(PL,ML,[OL])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;this.registerMarkUniform("uSdfNumerator",{expr:"devicePixelRatio"},n=>{let r=.35;return this.properties.logoLetters&&(r/=2),this.font.metrics.common.base/(n/r)}),fs(this.markUniformInfo,{uPaddingX:t.paddingX,uPaddingY:t.paddingY,uFlushX:!!t.flushX,uFlushY:!!t.flushY,uAlign:[LL[t.align],NL[t.baseline]],uD:[t.dx,-t.dy],uLogoLetter:!!t.logoLetters,uSqueeze:!!t.squeeze,uViewportEdgeFadeWidth:[t.viewportEdgeFadeWidthTop,t.viewportEdgeFadeWidthRight,t.viewportEdgeFadeWidthBottom,t.viewportEdgeFadeWidthLeft],uViewportEdgeFadeDistance:[t.viewportEdgeFadeDistanceTop,t.viewportEdgeFadeDistanceRight,t.viewportEdgeFadeDistanceBottom,t.viewportEdgeFadeDistanceLeft]})}updateGraphicsData(){const t=this.unitView.getCollector(),n=t.getData(),r=this.encoding,i=this.encoders.text.accessor||this.encoders.text;let a=0;const o="format"in r.text?pt(r.text.format):l=>l;for(const l of n){const u=o(i(l)),f=Me(u)?u:u===null?"":""+u;a+=f&&f.length||0}const s=new eL({encoders:this.encoders,attributes:this.getAttributes(),properties:this.properties,fontMetrics:this.font.metrics,numCharacters:Math.max(a,this.properties.minBufferSize||0)});s.addBatches(t.facetBatches);const c=s.toArrays();this.rangeMap.migrateEntries(c.rangeMap),this.updateBufferInfo(c)}prepareRender(t){const n=super.prepareRender(t);return n.push(()=>{ja(this.programInfo,{uTexture:this.font.texture})}),n.push(()=>this.bindOrSetMarkUniformBlock()),n.push(()=>qa(this.gl,this.programInfo,this.vertexArrayInfo)),n}render(t){const n=this.gl;return this.createRenderCallback((r,i)=>Wh(n,this.vertexArrayInfo,n.TRIANGLES,i,r),t)}}function Fl(e,t,{spacing:n,devicePixelRatio:r,offset:i,reverse:a}={}){n=n||0,i=i||0;let o=0,s=0;for(const p of e)o+=ps(p.px)+(Om(p)?0:n),s+=ps(p.grow);o-=n;const c=Math.max(0,t-o),l=r!==void 0?p=>Math.round(p*r)/r:p=>p,u=[],f=[],h=p=>{const g=u.length;if(!g)return;const b=(p?n:0)*(a?-1:1);d-=b;for(let v=0;v<g;v++)f.push({location:d+(v+1)/(g+1)*b,size:0});d+=b,u.length=0};let d=a?Math.max(t,o):0+i;if(e.length==1&&Om(e[0]))return[{location:d,size:0}];for(let p=0;p<e.length;p++){const g=e[p];if(Om(g))u.push(g);else{h(f.length>0);const b=ps(g.px)+(s?ps(g.grow)/s*c:0);a&&(d-=b),f.push({location:l(d),size:l(b)}),a?d-=n:d+=b+n}}return d+=a?n:-n,h(!1),f}function UL(e){let t=0,n=0;for(const r of e)t=Math.max(t,r.px??0),n=Math.max(n,r.grow??0);return{px:t,grow:n}}function $L(e){const t={px:0,grow:0};for(const n of e)t.px+=ps(n.px),t.grow+=ps(n.grow);return t}const z2=class z2{constructor(t,n){Z(this,rf);this.width=t,this.height=n}addPadding(t){return J(this,rf,W2).call(this,t.width,t.height)}subtractPadding(t){return J(this,rf,W2).call(this,-t.width,-t.height)}};rf=new WeakSet,W2=function(t,n){return new z2({px:(this.width.px??0)+t,grow:this.width.grow},{px:(this.height.px??0)+n,grow:this.height.grow})};let Gr=z2;const Pl=Object.freeze({px:0,grow:0}),jA=new Gr(Pl,Pl);function Om(e){return!e.px&&!e.grow}function ps(e){return e||0}function HL(e){return e&&(ft(e.px)||ft(e.grow))}function qA(e){if(QA(e))throw new Error("parseSizeDef does not accept step-based sizes.");if(HL(e))return e;if(ft(e))return{px:e,grow:0};if(e==="container")return{px:0,grow:1};if(!e)return{px:0,grow:1};throw new Error(`Invalid sizeDef: ${e}`)}function GL(e,t,n){return{get location(){const r=n();switch(r){case 0:return e.location;case 1:return t.location;default:return r*t.location+(1-r)*e.location}},get size(){const r=n();switch(r){case 0:return e.size;case 1:return t.size;default:return r*t.size+(1-r)*e.size}}}}function VL(e,t){const n=ft(t)?()=>t:t;return{get location(){return e.location+n()},get size(){return e.size}}}function jL(e,t){const n=ft(t)?()=>t:t;return{get location(){return e.location*n()},get size(){return e.size*n()}}}function WA(e,t){return t>=e.location&&t<e.location+e.size}class Ct{constructor(t,n,r,i){this.top=t||0,this.right=n||0,this.bottom=r||0,this.left=i||0}get width(){return this.left+this.right}get height(){return this.top+this.bottom}expand(t){return t<=0?this:new Ct(this.top+t,this.right+t,this.bottom+t,this.left+t)}add(t){return new Ct(this.top+t.top,this.right+t.right,this.bottom+t.bottom,this.left+t.left)}subtract(t){return new Ct(this.top-t.top,this.right-t.right,this.bottom-t.bottom,this.left-t.left)}union(t){return new Ct(Math.max(this.top,t.top),Math.max(this.right,t.right),Math.max(this.bottom,t.bottom),Math.max(this.left,t.left))}getHorizontal(){return new Ct(0,this.right,0,this.left)}getVertical(){return new Ct(this.top,0,this.bottom,0)}get horizontalTotal(){return this.left+this.right}get verticalTotal(){return this.top+this.bottom}static createFromConfig(t){return typeof t=="number"?this.createUniformPadding(t):t?this.createFromRecord(t):Lm}static createFromRecord(t){return new Ct(t.top,t.right,t.bottom,t.left)}static zero(){return Lm}static createUniformPadding(t){return new Ct(t,t,t,t)}}const Lm=Ct.createUniformPadding(0);Object.freeze(Lm);const qL=/^([A-Za-z]+:)?\/\//;function WL(e,t){if(t&&qL.test(t))return t;const n=e();return n&&t?n.endsWith("/")?n+t:n+"/"+t:n??t}const YA="VISIT_SKIP",Qa="VISIT_STOP",ZA=e=>e;class YL{constructor(t,n,r,i,a,o={}){Z(this,Po);Z(this,sf);Z(this,lc,{});Z(this,af,{});Z(this,of,{});ar(this,"opacityFunction",ZA);ar(this,"coords");if(!t)throw new Error("View spec must be defined!");this.context=n,this.layoutParent=r,this.dataParent=i,this.name=t.name||a,this.spec=t,this.resolutions={scale:{},axis:{}},MA(this),this.options={blockEncodingInheritance:!1,contributesToScaleDomain:!0,...o},this.needsAxes={x:!1,y:!1}}getPadding(){return this._cache("size/padding",()=>Ct.createFromConfig(this.spec.padding))}getOverhang(){return Ct.zero()}isScrollable(){return this.spec.viewportWidth!=null||this.spec.viewportHeight!=null}getSize(){return this._cache("size/size",()=>this.isConfiguredVisible()?new Gr(J(this,Po,kf).call(this,"width"),J(this,Po,kf).call(this,"height")):jA)}getViewportSize(){if(!this.isScrollable())return this.getSize();if(!this.isConfiguredVisible())return jA;const t=this.getSize();return new Gr(J(this,Po,kf).call(this,"viewportWidth")??t.width,J(this,Po,kf).call(this,"viewportHeight")??t.height)}isConfiguredVisible(){return this.context.isViewConfiguredVisible(this)}isVisibleInSpec(){return this.spec.visible??!0}isVisible(){return this.getLayoutAncestors().every(t=>t.isConfiguredVisible())}getEffectiveOpacity(){var t;return this.opacityFunction(((t=this.layoutParent)==null?void 0:t.getEffectiveOpacity())??1)}getPathString(){return this.getLayoutAncestors().map(t=>t.name).reverse().join("/")}getLayoutAncestors(){return J(this,sf,Y2).call(this,"layoutParent")}getDataAncestors(){return J(this,sf,Y2).call(this,"dataParent")}handleBroadcast(t){for(const n of P(this,lc)[t.type]||[])n(t)}_addBroadcastHandler(t,n){let r=P(this,lc)[t];r||(r=[],P(this,lc)[t]=r),r.push(n)}handleInteractionEvent(t,n,r){const i=r?P(this,af):P(this,of);for(const a of i[n.type]||[])a(t,n)}addInteractionEventListener(t,n,r){const i=r?P(this,af):P(this,of);let a=i[t];a||(a=[],i[t]=a),a.push(n)}visit(t){try{const n=t(this);if(t.postOrder&&t.postOrder(this),n!==Qa)return n}catch(n){throw n.view=this,n}}getDescendants(){const t=[];return this.visit(n=>{t.push(n)}),t}configureViewOpacity(){(!this.opacityFunction||this.opacityFunction===ZA)&&(this.opacityFunction=QL(this))}onBeforeRender(){}render(t,n,r={}){this.coords=r.clipRect?n.intersect(r.clipRect):n}getEncoding(){const t=this.dataParent&&!this.options.blockEncodingInheritance?this.dataParent.getEncoding():{},n=this.spec.encoding||{},r={...t,...n};for(const[i,a]of Object.entries(r))a===null&&delete r[i];return r}getFacetAccessor(t){if(this.layoutParent)return this.layoutParent.getFacetAccessor(this)}getFacetFields(t){var r;const n=this.getEncoding().sample;return Ur(n)?[n.field]:(r=this.layoutParent)==null?void 0:r.getFacetFields(this)}getSampleFacetTexture(){}getScaleResolution(t){const n=$a(t);return this.getDataAncestors().map(r=>r.resolutions.scale[n]).find(r=>r)}getAxisResolution(t){const n=$a(t);return this.getDataAncestors().map(r=>r.resolutions.axis[n]).find(r=>r)}getConfiguredResolution(t,n){var r,i;return(i=(r=this.spec.resolve)==null?void 0:r[n])==null?void 0:i[t]}getConfiguredOrDefaultResolution(t,n){return this.getConfiguredResolution(t,n)??this.getConfiguredResolution("default",n)??this.getDefaultResolution(t,n)}getDefaultResolution(t,n){return"independent"}getBaseUrl(){return WL(()=>{var t;return(t=this.dataParent)==null?void 0:t.getBaseUrl()},this.spec.baseUrl)}isPickingSupported(){return!0}getTitleText(){const t=this.spec.title;if(t)return Me(t)?t:t.text}_cache(t,n){return ds(this,t,n)}_invalidateCacheByPrefix(t,n="self"){switch(n){case"self":Il(this,t);break;case"ancestors":for(const r of this.getLayoutAncestors())Il(r,t);break;case"progeny":this.visit(r=>Il(r,t));break}}invalidateSizeCache(){this._invalidateCacheByPrefix("size/","ancestors")}propagateInteractionEvent(t){}}lc=new WeakMap,af=new WeakMap,of=new WeakMap,Po=new WeakSet,kf=function(t){var i;let n=this.spec[t];const r=t=="viewportWidth"||t=="viewportHeight";if(QA(n)){if(r)throw new Za(`Cannot use step-based size with "${t}"!`,this);const a=n.step,o=(i=this.getScaleResolution(t=="width"?"x":"y"))==null?void 0:i.getScale();if(o){let s=0;if(zr(o.type))s=o.domain().length;else if(["locus","index"].includes(o.type)){const l=o.domain();s=xn(l)-l[0]}else throw new Za(`Cannot use step-based size with "${o.type}" scale!`,this);const c=o;return s=$g(s,c.paddingInner(),c.paddingOuter()),{px:s*a,grow:0}}else throw new Za("Cannot use 'step' size with missing scale!",this)}else return(n&&qA(n))??(r?void 0:{px:0,grow:1})},sf=new WeakSet,Y2=function(t){const n=[];let r=this;do n.push(r),r=r[t];while(r);return n};function ZL(e){return"unitsPerPixel"in e}function QL(e){const t=e.spec.opacity;if(t!==void 0){if(ft(t))return n=>n*t;if(ZL(t)){const n=a=>{var s;const o=(s=e.getScaleResolution(a))==null?void 0:s.getScale();if(["linear","index","locus"].includes(o==null?void 0:o.type))return o},r=t.channel?n(t.channel):n("x")??n("y");if(!r)throw new Za("Cannot find a resolved quantitative scale for dynamic opacity!",e);const i=Fg().domain(t.unitsPerPixel).range(t.values).clamp(!0);return a=>{const s=Of(r.domain())/1e3;return i(s)*a}}else if(zA(t)){const n=e.context.paramBroker.createExpression(t.expr);return r=>n(null)*r}}return n=>n}const QA=e=>!!(e!=null&&e.step);class qn extends YL{constructor(t,n,r,i,a,o){super(t,n,r,i,a,o),this.spec=t}async initializeChildren(){}*[Symbol.iterator](){}replaceChild(t,n){throw new Error("Not implemented")}visit(t){let n;try{n=t(this)}catch(r){throw r.view=this,r}if(n===Qa)return n;if(n!==YA){t.beforeChildren&&t.beforeChildren(this);for(const r of this){const i=r.visit(t);if(i===Qa)return i}t.afterChildren&&t.afterChildren(this),t.postOrder&&t.postOrder(this)}}findDescendantByPath(t){for(const n of this)if(n.name===t[0]){if(t.length==1)return n;if(n instanceof qn)return n.findDescendantByPath(t.slice(1))}}findChildByName(t){for(const n of this)if(n.name===t)return n}findDescendantByName(t){let n;return this.visit(r=>{if(r.name==t)return n=r,Qa}),n}getDefaultResolution(t,n){return"shared"}}const XA=1;function Nm(){let e=[0,1],t=[0,1],n=1,r=1,i=0,a=0,o=.5,s=0;const l=u=>(u+o-e[0])/n*r+t[0];return l.invert=u=>(u-t[0])/r*n+e[0]-o,l.domain=function(u){if(arguments.length){e=Uf(u),n=e[1]-e[0];const f=e[0]===0&&e[0]===0;if(n<XA&&!f){n=XA;const h=(e[0]+e[1])/2;e[0]=h-n/2,e[1]=h+n/2}return l}else return e.slice()},l.range=function(u){return arguments.length?(t=[...u],r=t[1]-t[0],l):t},l.numberingOffset=function(u){return arguments.length?(s=u,l):s},l.padding=function(u){return arguments.length?(a=u,i=Math.min(1,u),l):i},l.paddingInner=function(u){return arguments.length?(i=Math.min(1,u),l):i},l.paddingOuter=function(u){return arguments.length?(a=u,l):a},l.align=function(u){return arguments.length?(o=Math.max(0,Math.min(1,u)),l):o},l.step=()=>r/n,l.bandwidth=()=>l.step(),l.ticks=u=>{const f=l.align(),h=l.numberingOffset();return Dc(e[0]-f+h,e[1]-f+h,Math.min(u,Math.ceil(n))).filter(Number.isInteger).map(d=>d-s)},l.tickFormat=(u,f)=>{if(f)throw new Error("Index scale's tickFormat does not support a specifier!");const d=xa(e[0],e[1],Math.min(u,Math.ceil(n)))<1e5?pt(","):pt(".3s");return p=>d(p+s)},l.copy=()=>Nm().domain(e).range(t).paddingInner(i).paddingOuter(a).numberingOffset(s),l}function XL(){const e=Nm().numberingOffset(1);let t;e.genome=function(r){return arguments.length?(t=r,e):t},e.ticks=r=>{if(!t)return[];const i=e.domain(),a=e.numberingOffset(),[o,s]=[Math.max(i[0],0),Math.min(i[1],t.totalSize-1)].map(u=>t.toChromosome(u)),c=Math.max(1,xa(i[0],i[1],r)),l=[];for(let u=o.index;u<=s.index;u++){const f=t.chromosomes[u],h=Math.max(f.continuousStart+c,i[0]-(i[0]-f.continuousStart)%c),d=Math.min(f.continuousEnd-c/4,i[1]+1);for(let p=h;p<=d;p+=c){const g=p-a;g>=i[0]&&g<i[1]&&l.push(g)}}return l},e.tickFormat=(r,i)=>{if(!t)return;if(i)throw new Error("Locus scale's tickFormat does not support a specifier!");const a=e.domain(),o=a[1]-a[0],s=e.numberingOffset(),l=xa(a[0],a[1],Math.min(r,Math.ceil(o)))<1e6?pt(","):pt(".3s"),u=f=>f-t.toChromosome(f).continuousStart;return f=>l(u(f)+s)};const n=e.copy;return e.copy=()=>n().genome(t),e}function KL(e){return e.type=="locus"}function Xh(e,t,n){if(n=n||[],e.some(o=>o===null)){if(e.every(o=>o===null))return null;throw console.warn(e),new Error("Cannot merge objects with nulls!")}const r={},i=(o,s)=>o===s||gs(o)&&gs(s)||gs(o)&&s===!0||o===!0&&Xt(s),a=o=>{for(let s in o){const c=o[s];if(!n.includes(s)&&c!==void 0)if(r[s]!==void 0&&!i(r[s],c))console.warn(`Conflicting property ${s} of ${t}: (${JSON.stringify(r[s])} and ${JSON.stringify(o[s])}). Using ${JSON.stringify(r[s])}.`);else{const l=r[s];if(gs(l))gs(c)&&(r[s]=Xh([l,c],s));else if(gs(c)){if(!(l===!0||l===void 0))throw new Error("Bug in merge! Target is: "+l);r[s]=Xh([{},c],s)}else r[s]=c}}};for(const o of e)a(o);return r}function gs(e){return Xt(e)&&!Array.isArray(e)}/*!
|
1618
1618
|
* Adapted from vega-encode:
|
1619
1619
|
* https://github.com/vega/vega/blob/master/packages/vega-encode/src/ticks.js
|
1620
1620
|
*
|
@@ -1630,13 +1630,13 @@ void main() {
|
|
1630
1630
|
* All rights reserved.
|
1631
1631
|
*
|
1632
1632
|
* BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE
|
1633
|
-
*/const oN="locus",sN="index";var cN=5;function lN(e){const t=e.type;return!e.bins&&(t===es||t===pl||t===gl)}function eE(e){return _t(e)&&![hr,sN,oN].includes(e)}function tE(e){return e||{warn:(t,...n)=>console.warn(t,...n)}}var uN=Nf(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma","zoom","fp64","name"]);function nE(e,t,n){n=tE(n);for(const r in e)if(!uN[r]){if(r==="padding"&&eE(t.type))continue;Kt(t[r])?t[r](e[r]):n.warn("Unsupported scale property: "+r)}yN(t,e,bN(t,e,pN(t,e,n)))}function fN(e,t){const n=hN(e),r=ke(n);if(!r)throw new Error("Unknown scale type: "+n);const i=r();return!e.domain&&_t(i.type)&&(e.domain=[0,0]),nE(e,i,t),i}function hN(e){var t=e.type,n="",r;return t===hr?hr+"-"+es:(dN(e)&&(r=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=r===2?hr+"-":r===3?ts+"-":""),(n+t||es).toLowerCase())}function dN(e){const t=e.type;return _t(t)&&t!==Yx&&t!==Zx&&(e.scheme||e.range&&e.range.length&&e.range.every(Me))}function pN(e,t,n){if(!e.domain)return 0;n=tE(n);var r=gN(e,t.domainRaw,n);if(r>-1)return r;var i=t.domain,a=e.type,o=t.zero||t.zero===void 0&&lN(e),s,c;return i?(eE(a)&&t.padding&&i[0]!==zn(i)&&(i=mN(a,i,t.range,t.padding,t.exponent,t.constant)),(o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(s=(i=i.slice()).length-1||1,o&&(i[0]>0&&(i[0]=0),i[s]<0&&(i[s]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[s]=t.domainMax),t.domainMid!=null&&(c=t.domainMid,(c<i[0]||c>i[s])&&n.warn("Scale domainMid exceeds domain min or max.",c),i.splice(s,0,c))),e.domain(rE(a,i,n)),a===Gg&&e.unknown(t.domainImplicit?ug:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&KA(e,t.nice)||null),i.length):0}function gN(e,t,n){return t?(e.domain(rE(e.type,t,n)),t.length):-1}function mN(e,t,n,r,i,a){var o=Math.abs(zn(n)-n[0]),s=o/(o-2*r),c=e===Ti?ov(t,null,s):e===gl?bp(t,null,s,.5):e===pl?bp(t,null,s,i||1):e===xh?dI(t,null,s,a||1):mp(t,null,s);return t=t.slice(),t[0]=c[0],t[t.length-1]=c[1],t}function rE(e,t,n){if(n3(e)){var r=Math.abs(t.reduce(function(i,a){return i+(a<0?-1:a>0?1:0)},0));r!==t.length&&n.warn("Log scale domain includes zero: "+Lf(t))}return t}function bN(e,t,n){let r=t.bins;if(r&&!Qt(r)){const i=(r.start==null||r.stop==null)&&e.domain(),a=r.start==null?i[0]:r.start,o=r.stop==null?zn(i):r.stop,s=r.step;s||it("Scale bins parameter missing step property."),r=mi(a,o+s,s)}return r?e.bins=r:e.bins&&delete e.bins,e.type===jg&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function yN(e,t,n){var r=e.type,i=t.round||!1,a=t.range;if(t.rangeStep!=null)a=vN(r,t,n);else if(t.scheme&&(a=wN(r,t,n),Kt(a))){if(e.interpolator)return e.interpolator(a);it(`Scale type ${r} does not support interpolating color schemes.`)}if(a&&Eh(r))return e.interpolator(Sh(zm(a,t.reverse),t.interpolate,t.interpolateGamma));a&&t.interpolate&&e.interpolate?e.interpolate(r3(t.interpolate,t.interpolateGamma)):Kt(e.round)?e.round(i):Kt(e.rangeRound)&&e.interpolate(i?hl:Ci),a&&e.range(zm(a,t.reverse))}function vN(e,t,n){e!==Kx&&e!==Vg&&it("Only band and point scales support rangeStep.");var r=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,i=e===Vg?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*$g(n,i,r)]}function wN(e,t,n){var r=t.schemeExtent,i,a;return Qt(t.scheme)?a=Sh(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),a=Wg(i),a||it(`Unrecognized scheme name: ${t.scheme}`)),n=e===Xx?n+1:e===jg?n-1:e===Hg||e===Qx?+t.schemeCount||cN:n,Eh(e)?iE(a,r,t.reverse):Kt(a)?OB(iE(a,r),n):e===Gg?a:a.slice(0,n)}function iE(e,t,n){return Kt(e)&&(t||n)?MB(e,zm(t||[0,1],n)):e}function zm(e,t){return t?e.slice().reverse():e}const Um=pt(",d");function xN(e){return e.chrom+":"+Um(Math.floor(e.pos+1))}function aE(e){return!ft(e)&&"chrom"in e?xN(e):""+e}function AN(e,t){return e.chrom+":"+Um(Math.floor(e.pos+1))+"-"+(e.chrom!=t.chrom?t.chrom+":":"")+Um(Math.ceil(t.pos))}const EN="https://genomespy.app/data/genomes/";class SN{constructor(t){if(this.config=t,!this.config.contigs&&typeof this.config.name!="string")throw new Error("No name has been defined for the genome assembly!");this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,this.config.contigs&&this.setChromSizes(this.config.contigs)}get name(){return this.config.name}async load(t){if(!this.config.contigs){this.config.baseUrl?this.baseUrl=/^http(s)?/.test(this.config.baseUrl)?this.config.baseUrl:t+"/"+this.config.baseUrl:this.baseUrl=EN;try{this.setChromSizes(_N(await Zc({baseURL:this.baseUrl}).load(`${this.config.name}/${this.name}.chrom.sizes`)))}catch(n){throw new Error(`Could not load chrom sizes: ${n.message}`)}}}hasChrPrefix(){return this.chromosomes.some(t=>t.name.startsWith("chr"))}setChromSizes(t){let n=0;this.startByIndex=[0];for(let r=0;r<t.length;r++){this.startByIndex.push(n);const i=t[r].size,a={...t[r],continuousStart:n,continuousEnd:n+i,continuousInterval:[n,n+i],index:r,number:r+1,odd:!(r&1)};this.chromosomes.push(a);const o=a.name.replace(/^chr/i,"");for(const s of["chr"+o,"CHR"+o,"Chr"+o,a.number,""+a.number,o,a.name])this.cumulativeChromPositions.set(s,n),this.chromosomesByName.set(s,a);n+=a.size}this.totalSize=n}getExtent(){return[0,this.totalSize]}toContinuous(t,n){let r=this.cumulativeChromPositions.get(t);if(r===void 0)throw new Error("Unknown chromosome/contig: "+t);return r+ +n}toChromosome(t){if(t>this.totalSize)return;t=Math.floor(t);const n=Pr(this.startByIndex,t)-1;if(n>0&&n<=this.chromosomes.length)return this.chromosomes[n-1]}toChromosomal(t){const n=this.toChromosome(t);if(n)return{chrom:n.name,pos:Math.floor(t)-n.continuousStart}}getChromosome(t){return this.chromosomesByName.get(t)}formatInterval(t){return AN(...this.toChromosomalInterval(t))}toChromosomalInterval(t){const n=this.toChromosomal(t[0]+.5),r=this.toChromosomal(t[1]-.5);return r.pos+=1,[n,r]}toContinuousInterval(t){var i;let[n,r]=t;return r||(r=n),[this.toContinuous(n.chrom,n.pos??0),this.toContinuous(r.chrom,r.pos??((i=this.chromosomesByName.get(r.chrom))==null?void 0:i.size))]}toDiscreteChromosomeIntervals(t){const n=t[0],r=t[1],i=[];if(n.chrom===r.chrom)i.push({chrom:n.chrom,startPos:n.pos,endPos:r.pos});else{const a=this.chromosomes.findIndex(s=>s.name===n.chrom),o=this.chromosomes.findIndex(s=>s.name===r.chrom);i.push({chrom:n.chrom,startPos:n.pos,endPos:this.chromosomes[a].size});for(let s=a+1;s<o;s++)i.push({chrom:this.chromosomes[s].name,startPos:0,endPos:this.chromosomes[s].size});i.push({chrom:r.chrom,startPos:0,endPos:r.pos})}return i}continuousToDiscreteChromosomeIntervals(t){return this.toDiscreteChromosomeIntervals([this.toChromosomal(t[0]),this.toChromosomal(t[1])])}parseInterval(t){const n=t.match(/^(chr[0-9A-Z]+)(?::([0-9,]+)(?:-(?:(chr[0-9A-Z]+):)?([0-9,]+))?)?$/);if(n){const r=n[1];if(n.slice(2).every(s=>s===void 0)){const s=this.getChromosome(r);return s?[s.continuousStart,s.continuousEnd]:void 0}const i=n[3]||r,a=parseInt(n[2].replace(/,/g,"")),o=n[4]!==void 0?parseInt(n[4].replace(/,/g,"")):a;return[this.toContinuous(r,a-1),this.toContinuous(i,o)]}}}function _N(e){return BI(e).filter(t=>/^chr[0-9A-Z]+$/.test(t[0])).map(([t,n])=>({name:t,size:parseInt(n)}))}function Kh(e){return Xt(e)&&"chrom"in e}function CN(e){return e.every(Kh)}class Ml extends Array{constructor(){super(),this.type=void 0}extend(t){return this}extendAll(t){if(t instanceof Ml&&t.type!=this.type)throw new Error(`Cannot combine different types of domains: ${this.type} and ${t.type}`);for(const n of t)this.extend(n);return this}extendAllWithAccessor(t,n){for(const r of t)this.extend(n(r));return this}}class $m extends Ml{constructor(){super(),this.type="quantitative"}extend(t){return t==null||Number.isNaN(t)?this:(t=+t,this.length?t<this[0]?this[0]=t:t>this[1]&&(this[1]=t):(this.push(t),this.push(t)),this)}}class oE extends Ml{constructor(){super(),this.type="ordinal",this.uniqueValues=new Set}extend(t){return t==null||Number.isNaN(t)?this:(this.uniqueValues.has(t)||(this.uniqueValues.add(t),this.push(t)),this)}}class sE extends oE{constructor(){super(),this.type="nominal"}}class kN extends Ml{constructor(t){super();let n=0;for(let r=1;r<t.length;r++)n+=Math.sign(t[r]-t[r-1]);if(Math.abs(n)!=t.length-1)throw new Error("Piecewise domain must be strictly increasing or decreasing: "+JSON.stringify(t));t.forEach(r=>this.push(r))}extend(t){if(this.includes(t))return this;throw new Error("Piecewise domains are immutable and cannot be unioned!")}}const cE={quantitative:$m,index:$m,locus:$m,nominal:sE,ordinal:oE};function lE(e,t){if(e=="quantitative"&&TN(t)){const n=new kN(t);return n.type=e,n}else if(cE[e]){const n=new cE[e];return n.type=e,t&&n.extendAll(t),n}throw new Error("Unknown type: "+e)}function TN(e){return e&&e.length>0&&e.length!=2&&e.every(t=>typeof t=="number")}function IN(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function RN(e){return--e*e*e+1}function DN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function BN(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}function FN(e){return 1-BN(e)}function PN(e,t,n){return e*Math.pow(t/e,n)}ke("index",Nm,["continuous"]),ke("locus",XL,["continuous"]),ke("null",_h,[]);const uE="quantitative",Hm="ordinal",Gm="nominal",fE="locus",MN="index";class ON{constructor(t){Z(this,Dr);Z(this,V0);Z(this,fc);Z(this,oi);Z(this,cf);Z(this,j0);Z(this,U2);Z(this,lf);Z(this,ai,void 0);Z(this,uc,new Set);Z(this,Ot,void 0);this.channel=t,this.members=[],this.type=null,this.name=void 0}addEventListener(t,n){if(t!="domain")throw new Error("Unsupported event type: "+t);P(this,uc).add(n)}removeEventListener(t,n){if(t!="domain")throw new Error("Unsupported event type: "+t);P(this,uc).delete(n)}pushUnitView(t,n){var o;const r=Yg(t,n),i=r.type,a=(o=r==null?void 0:r.scale)==null?void 0:o.name;if(a){if(this.name!==void 0&&a!=this.name)throw new Error(`Shared scales have conflicting names: "${a}" vs. "${this.name}"!`);this.name=a}if(!this.type)this.type=i;else if(i!==this.type&&!xl(n))throw new Error(`Can not use shared scale for different data types: ${this.type} vs. ${i}. Use "resolve: independent" for channel ${this.channel}`);this.members.push({view:t,channel:n})}isExplicitDomain(){return!!this.getConfiguredDomain()}isDomainInitialized(){const t=P(this,Ot);if(!t)return!1;const n=t.domain();return _t(t.type)?n.length>2||n.length==2&&(n[0]!==0||n[1]!==0):n.length>0}getScaleProps(){return ds(this,"scaleProps",()=>{const t=J(this,V0,NT).call(this);if(t===null||t.type=="null")return{type:"null"};const n={...J(this,j0,zT).call(this,this.type),...t};n.type||(n.type=LN(this.channel,this.type));const r=J(this,fc,dp).call(this);return r&&r.length>0?n.domain=r:dr(n.type)&&(n.domain=new sE),!n.domain&&n.domainMid!==void 0&&(n.domain=[n.domainMin??0,n.domainMax??1]),this.channel=="y"&&dr(n.type)&&n.reverse==null&&(n.reverse=!0),n.range&&n.scheme&&delete n.scheme,!("zoom"in n)&&["index","locus"].includes(n.type)&&(n.zoom=!0),NN(n,this.channel),n})}getConfiguredDomain(){return J(this,lf,Q2).call(this,t=>xl(t.channel)?void 0:t.view.getConfiguredDomain(t.channel))}getDataDomain(){return J(this,lf,Q2).call(this,t=>xl(t.channel)?void 0:t.view.extractDataDomain(t.channel))}reconfigure(){if(P(this,Ot)&&P(this,Ot).type!="null"){const t=this.isDomainInitialized(),n=P(this,Ot).domain();PA(this,"scaleProps");const r=this.getScaleProps();if(nE(r,P(this,Ot)),_t(P(this,Ot).type)&&le(this,ai,J(this,cf,Z2).call(this)),!t){J(this,Dr,ba).call(this);return}const i=P(this,Ot).domain();eh(i,n)||(this.isZoomable()?P(this,Ot).domain(n):J(this,oi,Ho).call(this)?(P(this,Ot).domain(n),this.zoomTo(i,500)):J(this,Dr,ba).call(this))}}getScale(){if(P(this,Ot))return P(this,Ot);const t=this.getScaleProps(),n=fN(t);return le(this,Ot,n),KL(n)&&n.genome(this.getGenome()),_t(n.type)&&le(this,ai,J(this,cf,Z2).call(this)),n}getDomain(){return this.getScale().domain()}getComplexDomain(){var t;return((t=this.getGenome())==null?void 0:t.toChromosomalInterval(this.getDomain()))??this.getDomain()}isZoomed(){return J(this,oi,Ho).call(this)&&eh(J(this,fc,dp).call(this),this.getDomain())}isZoomable(){return J(this,oi,Ho).call(this)&&!!this.getScaleProps().zoom}zoom(t,n,r){if(!J(this,oi,Ho).call(this))return!1;const i=this.getScale(),a=i.domain();let o=[...a],s=i.invert(n);switch(this.getScaleProps().reverse&&(r=-r),"align"in i&&(s+=i.align()),i.type){case"linear":case"index":case"locus":o=uI(o,r||0),o=mp(o,s,t);break;case"log":o=fI(o,r||0),o=ov(o,s,t);break;case"pow":case"sqrt":{const c=i;o=hI(o,r||0,c.exponent()),o=bp(o,s,t,c.exponent());break}default:throw new Error("Zooming is not implemented for: "+i.type)}return P(this,ai)&&(o=pI(o,P(this,ai)[0],P(this,ai)[1])),[0,1].some(c=>o[c]!=a[c])?(i.domain(o),J(this,Dr,ba).call(this),!0):!1}async zoomTo(t,n=!1){var s;if(kc(n)&&(n=n?700:0),!J(this,oi,Ho).call(this))throw new Error("Not a zoomable scale!");const r=this.fromComplexInterval(t),i=(s=this.members[0])==null?void 0:s.view.context.animator,a=this.getScale(),o=a.domain();if(n>0&&o.length==2){const c=o[1]-o[0],l=o[0]+c/2,u=r[1]-r[0],f=r[0]+u/2;await i.transition({duration:n,easingFunction:DN,onUpdate:h=>{const d=PN(c,u,h),p=(c-d)/(c-u),g=p*f+(1-p)*l;a.domain([g-d/2,g+d/2]),J(this,Dr,ba).call(this)}}),a.domain(r),J(this,Dr,ba).call(this)}else a.domain(r),i==null||i.requestRender(),J(this,Dr,ba).call(this)}resetZoom(){if(!J(this,oi,Ho).call(this))throw new Error("Not a zoomable scale!");const t=this.getDomain(),n=J(this,fc,dp).call(this);return[0,1].some(r=>n[r]!=t[r])?(P(this,Ot).domain(n),J(this,Dr,ba).call(this),!0):!1}getZoomLevel(){return this.isZoomable()?Of(P(this,ai))/Of(this.getScale().domain()):1}getGenome(){var n;if(this.type!=="locus")return;const t=(n=this.members[0].view.context.genomeStore)==null?void 0:n.getGenome();if(!t)throw new Error("No genome has been defined!");return t}invertToComplex(t){const n=this.getScale();if("invert"in n){const r=n.invert(t);return this.toComplex(r)}else throw new Error("The scale does not support inverting!")}toComplex(t){const n=this.getGenome();return n?n.toChromosomal(t):t}fromComplex(t){return Kh(t)?this.getGenome().toContinuous(t.chrom,t.pos):t}fromComplexInterval(t){return this.type==="locus"&&CN(t)?this.getGenome().toContinuousInterval(t):t}}ai=new WeakMap,uc=new WeakMap,Ot=new WeakMap,Dr=new WeakSet,ba=function(){for(const t of P(this,uc).values())t({type:"domain",scaleResolution:this})},V0=new WeakSet,NT=function(){return ds(this,"mergedScaleProps",()=>{const t=this.members.map(n=>Yg(n.view,n.channel).scale).filter(n=>n!==void 0);return Xh(t,"scale",["domain"])})},fc=new WeakSet,dp=function(){return this.getConfiguredDomain()??(this.type==fE?this.getGenome().getExtent():this.getDataDomain())},oi=new WeakSet,Ho=function(){const t=this.getScale().type;return _t(t)},cf=new WeakSet,Z2=function(){const t=this.getScaleProps(),n=t.zoom;if(zN(n)&&Qt(n.extent))return this.fromComplexInterval(n.extent);if(n)return t.type=="locus"?this.getGenome().getExtent():P(this,Ot).domain()},j0=new WeakSet,zT=function(t){const n=this.channel,r={};return this.isExplicitDomain()&&(r.zero=!1),wl(n)?r.nice=!this.isExplicitDomain():Ha(n)?r.scheme=t==Gm?"tableau10":t==Hm?"blues":"viridis":Ch(n)?r.range=n=="shape"?["circle","square","triangle-up","cross","diamond"]:[]:n=="size"?r.range=[0,400]:n=="angle"&&(r.range=[0,360]),r},U2=new WeakSet,eee=function(){return this.members.map(t=>t.view.getPathString()).join(", ")},lf=new WeakSet,Q2=function(t){const n=this.members.filter(r=>!r.view.getLayoutAncestors().some(i=>!i.options.contributesToScaleDomain)).map(t).filter(r=>!!r);if(n.length)return n.reduce((r,i)=>r.extendAll(i))};function LN(e,t){if(t==MN||t==fE){if(c3(e))return t;throw new Error(`${e} does not support ${t} data type. Only positional channels do.`)}const n={x:["band","band","linear"],y:["band","band","linear"],size:[void 0,"point","linear"],opacity:[void 0,"point","linear"],fillOpacity:[void 0,"point","linear"],strokeOpacity:[void 0,"point","linear"],color:["ordinal","ordinal","linear"],fill:["ordinal","ordinal","linear"],stroke:["ordinal","ordinal","linear"],strokeWidth:[void 0,void 0,"linear"],shape:["ordinal","ordinal",void 0],dx:[void 0,void 0,"null"],dy:[void 0,void 0,"null"],angle:[void 0,void 0,"linear"]},i=["sample"].includes(e)?"null":n[e]?n[e][[Gm,Hm,uE].indexOf(t)]:t==uE?"linear":"ordinal";if(i===void 0)throw new Error(`Channel "${e}" is not compatible with "${t}" data type. Use of a proper scale may be needed.`);return i}function NN(e,t){wl(t)&&e.type!=="ordinal"&&(e.range=[0,1]),t=="opacity"&&_t(e.type)&&(e.clamp=!0)}function zN(e){return Xt(e)}function Vm(e){const t=new Set;function n(r){for(const i of Object.values(r.resolutions.scale))t.add(i)}for(const r of Lt(e)){r.visit(n);for(const i of r.getDataAncestors()){if(!i.options.contributesToScaleDomain)break;n(i)}}t.forEach(r=>r.reconfigure())}function jm(...e){for(const t of e)if(t!==void 0)return t}class UN{constructor(t){this.channel=t,this.members=[]}get scaleResolution(){var t;return(t=xn(this.members))==null?void 0:t.view.getScaleResolution(this.channel)}pushUnitView(t,n){const r=t.getScaleResolution(this.channel);if(!r)throw new Error("Cannot find a scale resolution!");if(this.scaleResolution&&r!==this.scaleResolution)throw new Error("Shared axes must have a shared scale!");this.members.push({view:t,channel:n})}getAxisProps(){return ds(this,"axisProps",()=>{const t=this.members.map(n=>{const r=n.view.mark.encoding[n.channel];return"axis"in r&&r.axis});return t.length>0&&t.some(n=>n===null)?null:Xh(t.filter(n=>n!==void 0),"axis",["title"])})}getTitle(){const t=a=>{var s;const o=Yg(a.view,a.channel);if(!Gn(o))return{member:a,explicitTitle:jm("axis"in o?(s=o.axis)==null?void 0:s.title:void 0,o.title),implicitTitle:jm(Ur(o)?o.field:void 0,Zg(o)?o.expr:void 0)}},n=this.members.map(t),r=n.filter(a=>{var o;if(xl(a.member.channel)&&!a.explicitTitle){const s=$a(a.member.channel);return((o=n.find(c=>c.member.view==a.member.view&&c.member.channel==s))==null?void 0:o.explicitTitle)===void 0}return!0}),i=new Set(r.map(a=>jm(a.explicitTitle,a.implicitTitle)).filter(Me));return i.size?[...i].join(", "):null}}const $N={point:AL,rect:gL,rule:CL,link:BL,text:zL};class mt extends qn{constructor(t,n,r,i,a,o){super(t,n,r,i,a,o),this.spec=t;const s=$N[this.getMarkType()];if(s)this.mark=new s(this);else throw new Error(`No such mark: ${this.getMarkType()}`);this.resolve(),this.needsAxes={x:!0,y:!0}}render(t,n,r={}){super.render(t,n,r),this.isConfiguredVisible()&&(t.pushView(this,n),t.renderMark(this.mark,r),t.popView(this))}getMarkType(){return typeof this.spec.mark=="object"?this.spec.mark.type:this.spec.mark}resolve(t){t||(this.resolve("scale"),this.resolve("axis"));const n=this.mark.encoding;for(const[r,i]of Object.entries(n)){if(!rn(i))continue;const a=$a(i.resolutionChannel??r);if(!Ii(a)||t=="axis"&&!wl(a))continue;let o=this;for(;(o.getConfiguredOrDefaultResolution(a,t)=="forced"||o.dataParent instanceof qn&&["shared","excluded","forced"].includes(o.dataParent.getConfiguredOrDefaultResolution(a,t)))&&o.getConfiguredOrDefaultResolution(a,t)!="excluded";)o=o.dataParent;t=="axis"&&wl(r)&&c3(a)?(o.resolutions[t][a]||(o.resolutions[t][a]=new UN(a)),o.resolutions[t][a].pushUnitView(this,r)):t=="scale"&&Ii(r)&&(o.resolutions[t][a]||(o.resolutions[t][a]=new ON(a)),o.resolutions[t][a].pushUnitView(this,r))}}getAccessor(t){return this._cache("accessor/"+t,()=>{const n=this.mark.encoding;if(n&&n[t])return this.context.accessorFactory.createAccessor(n[t])})}getFacetAccessor(t){const n=this.getAccessor("sample");return n||super.getFacetAccessor(this)}getCollector(){return this.context.dataFlow.findCollectorByKey(this)}_validateDomainQuery(t){if(xl(t))throw new Error(`getDomain(${t}), must only be called for primary channels!`);const n=this.mark.encoding[t];if(!rn(n))throw new Error("The channel has no scale, cannot get domain!");return n}getConfiguredDomain(t){const n=this._validateDomainQuery(t),r=n&&n.scale&&n.scale.domain;if(r){const i=this.getScaleResolution(n.resolutionChannel??t);return lE(n.type??"nominal",i.fromComplexInterval(r))}}extractDataDomain(t){const r=this._validateDomainQuery(t).type??"nominal",i=s=>{let c;const l=this.mark.encoding[s];if(l){const u=this.context.accessorFactory.createAccessor(l);if(u)if(c=lE(r),u.constant)c.extend(u({}));else{const f=this.getCollector();f!=null&&f.completed&&f.visitData(h=>c.extend(u(h)))}}return c};let a=i(t);const o=Qg[t];if(o){const s=i(o);s&&a.extendAll(s)}return a}getZoomLevel(){const t=n=>{var r;return((r=this.getScaleResolution(n))==null?void 0:r.getZoomLevel())??1};return ns.map(t).reduce((n,r)=>n*r,1)}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0),t.target=this,!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,n){return t=="x"?"shared":"independent"}}function*qm(e,t=[]){for(const[n,r]of e.entries())if(r instanceof Map)for(const i of qm(r,[...t,n]))yield i;else yield[[...t,n],r]}class Ol extends at{get behavior(){return Mm}constructor(t){super(),this.params=t??{type:"collect"},this.observers=[],this.facetBatches=void 0,this._init()}_init(){this._data=[],this.facetBatches=new gi([],JSON.stringify),this.facetBatches.set(void 0,this._data)}reset(){super.reset(),this._init()}handle(t){this._data.push(t)}beginBatch(t){wL(t)&&(this._data=[],this.facetBatches.set(Lt(t.facetId),this._data))}complete(){var i,a;const t=(i=this.params)==null?void 0:i.sort,n=t?sv(t.field,t.order):void 0,r=o=>{n&&o.sort(n)};if((a=this.params.groupby)!=null&&a.length){if(this.facetBatches.size>1)throw new Error("TODO: Support faceted data!");const o=this.params.groupby.map(c=>Oe(c)),s=Rc(this._data,...o);this.facetBatches.clear();for(const[c,l]of qm(s))this.facetBatches.set(c,l)}for(const o of this.facetBatches.values())r(o);if(this.children.length)for(const[o,s]of this.facetBatches.entries()){if(o){const c={type:"facet",facetId:o};for(const l of this.children)l.beginBatch(c)}for(const c of s)this._propagate(c)}super.complete();for(const o of this.observers)o(this)}getData(){switch(this._checkStatus(),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{const t=this.facetBatches;return{[Symbol.iterator]:function*(){for(const r of t.values())for(let i=0;i<r.length;i++)yield r[i]}}}}}visitData(t){this._checkStatus();for(const n of this.facetBatches.values())for(let r=0;r<n.length;r++)t(n[r])}getItemCount(){let t=0;for(const n of this.facetBatches.values())t+=n.length;return t}_checkStatus(){if(!this.completed)throw new Error("Data propagation is not completed! No data are available.")}}class Ll{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(t,n){let r=this.length++;for(;r>0;){const i=r-1>>1,a=this.values[i];if(n>=a)break;this.ids[r]=this.ids[i],this.values[r]=a,r=i}this.ids[r]=t,this.values[r]=n}pop(){if(this.length===0)return;const t=this.ids[0];if(this.length--,this.length>0){const n=this.ids[0]=this.ids[this.length],r=this.values[0]=this.values[this.length],i=this.length>>1;let a=0;for(;a<i;){let o=(a<<1)+1;const s=o+1;let c=this.ids[o],l=this.values[o];const u=this.values[s];if(s<this.length&&u<l&&(o=s,c=this.ids[s],l=u),l>=r)break;this.ids[a]=c,this.values[a]=l,a=o}this.ids[a]=n,this.values[a]=r}return t}peek(){if(this.length!==0)return this.ids[0]}peekValue(){if(this.length!==0)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}class HN extends at{get behavior(){return mr}constructor(t){super(),this.params=t,this.startAccessor=Oe(t.start),this.endAccessor=Oe(t.end),this.chromAccessor=t.chrom?Oe(t.chrom):n=>{},this.weightAccessor=t.weight?Oe(t.weight):n=>1,this.as={coverage:t.as||"coverage",start:t.asStart||t.start,end:t.asEnd||t.end,chrom:t.asChrom||t.chrom},this.createSegment=new Function("start","end","coverage","chrom","return {"+Object.entries(this.as).filter(([n,r])=>r).map(([n,r])=>`${JSON.stringify(r)}: ${n}`).join(", ")+"};"),this.ends=new Ll}reset(){super.reset(),this.initialize()}initialize(){const t=this.as.coverage,n=this.as.end,r=this.as.chrom,i=this.startAccessor,a=this.endAccessor,o=this.chromAccessor,s=this.weightAccessor;let c,l,u,f=0,h;const d=this.ends;d.clear();const p=(b,v,x)=>{if(b==v)return;let A=!1;c&&(c[t]===x?(c[n]=v,A=!0):c[t]!=0&&this._propagate(c)),A||(c=this.createSegment(b,v,x,u))},g=()=>{let b;for(;(b=d.peekValue())!==void 0;)p(h,b,f),h=b,f-=d.pop();h=void 0,c&&(this._propagate(c),c=void 0)};this.handle=b=>{const v=i(b);let x;for(;(x=d.peekValue())!==void 0&&x<v;)p(h,x,f),h=x,f-=d.pop();if(r){let w=o(b);w!==l&&(g(),u=w,l=u)}h!==void 0&&p(h,v,f),h=v;const A=s(b);f+=A,d.push(A,a(b))},this.complete=()=>{g(),super.complete()}}}function GN(e,t,n=0,r=e.length){const i=new Ll,a=r-n;let o;for(o=0;o<t&&o<a;o++)i.push(o,e[n+o]);for(;o<a;o++){const l=e[n+o];l>=i.peekValue()&&(i.push(o,l),i.pop())}const s=[];let c;for(;(c=i.pop())!==void 0;)s.push(n+c);return s.reverse()}class VN{constructor(t,n=-1/0,r=1/0){this.maxSize=t,this.lowerLimit=n,this.upperLimit=r;const i=this.maxSize*2+1;this.lowerLimits=new Float64Array(i),this.upperLimits=new Float64Array(i),this.lowerChildren=new Int32Array(i),this.upperChildren=new Int32Array(i),this.reset()}reset(){this.lowerLimits.fill(0),this.upperLimits.fill(0),this.lowerChildren.fill(0),this.upperChildren.fill(0),this.n=1,this.lowerLimits[0]=this.lowerLimit,this.upperLimits[0]=this.upperLimit}_findSlot(t,n,r=0){if(t>=this.lowerLimits[r]&&n<=this.upperLimits[r]){const i=this.lowerChildren[r];if(i){const a=this._findSlot(t,n,i);return a>=0?a:this._findSlot(t,n,this.upperChildren[r])}else return r}else return-1}reserve(t,n){if(n-t<=0)throw new Error("Cannot reserve an empty or negative-size slot!");if(this.n+1>this.lowerLimits.length)return!1;const r=this._findSlot(t,n);if(r<0)return!1;const i=this.n++,a=this.n++;return this.lowerLimits[i]=this.lowerLimits[r],this.upperLimits[i]=t,this.lowerLimits[a]=n,this.upperLimits[a]=this.upperLimits[r],this.lowerChildren[r]=i,this.upperChildren[r]=a,!0}}class jN extends at{get behavior(){return Mm}constructor(t,n){if(super(),this.params=t,this._data=[],this.channel=t.channel??"x",!["x","y"].includes(this.channel))throw new Error("Invalid channel: "+this.channel);this.posAccessor=Oe(this.params.pos),this.posBisector=zf(this.posAccessor),this.scoreAccessor=Oe(this.params.score),this.widthAccessor=Oe(this.params.width),this.laneAccessor=this.params.lane?Oe(this.params.lane):i=>0,this.padding=this.params.padding??0,this.reservationMaps=new Map,this.resolution=n.getScaleResolution(this.channel);const r=()=>this._filterAndPropagate();this.schedule=()=>n.context.animator.requestTransition(r),this.resolution.addEventListener("domain",i=>this.schedule()),n._addBroadcastHandler("layoutComputed",()=>this.schedule())}complete(){const t=this.posAccessor;this._data.sort((n,r)=>t(n)-t(r)),this._scores=this._data.map(this.scoreAccessor);for(const n of new Set(this._data.map(this.laneAccessor)))this.reservationMaps.set(n,new VN(200));this.schedule(),super.complete()}_filterAndPropagate(){var o;super.reset();const t=this.resolution.getScale(),n=(o=this.resolution.members[0].view.coords)==null?void 0:o[this.channel=="x"?"width":"height"];if(!n)return;for(const s of this.reservationMaps.values())s.reset();const r=t.domain(),i=70,a=GN(this._scores,i,this.posBisector.left(this._data,r[0]),this.posBisector.right(this._data,r[1]));for(const s of a){const c=this._data[s],l=t(this.posAccessor(c))*n,u=this.widthAccessor(c)/2+this.padding;this.reservationMaps.get(this.laneAccessor(c)).reserve(l-u,l+u)&&this._propagate(c)}super.complete()}reset(){super.reset(),this._data=[],this.groups=new Map}handle(t){this._data.push(t)}}class qN extends at{constructor(t){super(),this.params=t,this.predicate=void 0}initialize(){this.predicate=sh(this.params.expr,this.getGlobalObject())}handle(t){this.predicate(t)&&this._propagate(t)}}class WN extends at{get behavior(){return mr}constructor(t){super();const n=t.index;if(t.fields){const r=Lt(t.fields).map(a=>Oe(a)),i=Lt(t.as||t.fields);if(r.length!==i.length)throw new Error(`Lengths of "fields" (${r.length}), and "as" (${i.length}) do not match!`);this.handle=a=>{const o=r.map((c,l)=>c(a)??[]),s=o[0].length;for(let c=0;c<s;c++){const l=Object.assign({},a);for(let u=0;u<r.length;u++)l[i[u]]=c<o[u].length?o[u][c]:null;n&&(l[n]=c),this._propagate(l)}}}else this.handle=r=>{for(let i=0;i<r.length;i++){const a=Object.assign({},r[i]);n&&(a[n]=i),this._propagate(a)}}}}const YN="0".charCodeAt(0);function*ZN(e,t=","){const n=t.charCodeAt(0);let r=0;for(let i=0;i<e.length;i++){const a=e.charCodeAt(i);a==n?(yield r,r=0):r=r*10+a-YN}yield r}class QN extends at{get behavior(){return mr}constructor(t){super();const n=Oe(t.exons??"exons"),r=Oe(t.start??"start"),[i,a]=t.as||["exonStart","exonEnd"];this.handle=o=>{let s=r(o),c=s,l=!0;const u=n(o);for(const f of ZN(u)){if(l)c=s+f;else{s=c+f;const h=Object.assign({},o);h[i]=c,h[a]=s,this._propagate(h)}l=!l}}}}class XN extends at{get behavior(){return mr}constructor(t){super();const n=Lt(t.field).map(a=>Oe(a)),r=Lt(t.separator),i=Lt(t.as||t.field);if(n.length!==r.length||n.length!==i.length)throw new Error(`Lengths of "separator" (${r.length}), "fields" (${n.length}), and "as" (${i.length}) do not match!`);this.handle=a=>{if(n.some(c=>!c(a)))return;const o=n.map((c,l)=>c(a).split(r[l]));KN(o,a);const s=o[0].length;for(let c=0;c<s;c++){const l=Object.assign({},a);for(let u=0;u<n.length;u++)l[i[u]]=o[u][c];this._propagate(l)}}}}function KN(e,t){const n=e.map(r=>r.length);if(!n.every(r=>r==n[0]))throw new Error("Mismatching number of elements in the fields to be split: "+JSON.stringify(t))}class JN extends at{get behavior(){return Oi}constructor(t){super(),this.params=t,this.as=t.as,this.fn=void 0}initialize(){this.fn=sh(this.params.expr,this.getGlobalObject())}handle(t){t[this.as]=this.fn(t),this._propagate(t)}}class hE extends at{get behavior(){return Oi}constructor(t,n){super();const r=t.channel??"x";if(!["x","y"].includes(r))throw new Error("Invalid channel: "+r);const i=n.getScaleResolution(r).getGenome();if(!i)throw new Error("LinearizeGenomicCoordinate transform requires a locus scale!");const a=Oe(t.chrom),o=Lt(t.pos).map(p=>Oe(p)),s=Lt(t.as);if(o.length!=s.length)throw new Error('The number of "pos" and "as" elements must be equal!');const c=Lt(t.offset);let l;if(c.length==0)l=new Array(o.length).fill(0);else if(c.length==1)l=new Array(o.length).fill(c[0]);else if(c.length==o.length)l=c;else throw new Error(`Invalid "offset" parameter: ${JSON.stringify(t.offset)}!`);const u=new Function("datum","chromOffset","posAccessors",s.map((p,g)=>`datum[${JSON.stringify(p)}] = chromOffset + +posAccessors[${g}](datum) - ${l[g]};`).join(`
|
1634
|
-
`));let f,h=0;const d=p=>{if(p!==f){if(h=i.cumulativeChromPositions.get(p),h===void 0)throw new Error("Unknown chromosome/contig: "+p);f=p}return h};this.handle=p=>{u(p,d(a(p)),o),this._propagate(p)}}}const dE={pages:["Lato-Regular.png"],chars:[{id:87,width:53,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:43.491,chnl:15,x:0,y:0,page:0},{id:124,width:17,height:50,xoffset:0,yoffset:-32.193000000000005,xadvance:10.521,chnl:15,x:0,y:42,page:0},{id:40,width:20,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:94,page:0},{id:41,width:19,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:145,page:0},{id:36,width:32,height:49,xoffset:0,yoffset:-34.419000000000004,xadvance:24.360000000000003,chnl:15,x:0,y:196,page:0},{id:125,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:247,page:0},{id:91,width:22,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:297,page:0},{id:93,width:19,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:347,page:0},{id:123,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:397,page:0},{id:106,width:19,height:48,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:0,y:447,page:0},{id:81,width:43,height:47,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:21,y:447,page:0},{id:77,width:45,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:38.997,chnl:15,x:66,y:447,page:0},{id:64,width:43,height:44,xoffset:0,yoffset:-28.539,xadvance:35.133,chnl:15,x:23,y:397,page:0},{id:92,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:68,y:397,page:0},{id:47,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:98,y:397,page:0},{id:109,width:42,height:32,xoffset:0,yoffset:-21.609,xadvance:34.545,chnl:15,x:113,y:447,page:0},{id:119,width:42,height:31,xoffset:0,yoffset:-21.315,xadvance:32.991,chnl:15,x:157,y:447,page:0},{id:42,width:25,height:42,xoffset:0,yoffset:-31.626,xadvance:17.85,chnl:15,x:128,y:397,page:0},{id:37,width:42,height:41,xoffset:0,yoffset:-30.387,xadvance:33.663000000000004,chnl:15,x:155,y:397,page:0},{id:79,width:42,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:199,y:397,page:0},{id:102,width:24,height:41,xoffset:0,yoffset:-30.534000000000002,xadvance:14.721,chnl:15,x:243,y:397,page:0},{id:100,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:269,y:397,page:0},{id:98,width:32,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:302,y:397,page:0},{id:56,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:336,y:397,page:0},{id:38,width:40,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:29.904000000000003,chnl:15,x:370,y:397,page:0},{id:108,width:17,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:9.912,chnl:15,x:412,y:397,page:0},{id:107,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:21.336000000000002,chnl:15,x:431,y:397,page:0},{id:48,width:33,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:464,y:397,page:0},{id:71,width:38,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:30.681,chnl:15,x:21,y:347,page:0},{id:83,width:31,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:22.785,chnl:15,x:61,y:347,page:0},{id:63,width:27,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:18.795,chnl:15,x:94,y:347,page:0},{id:105,width:18,height:41,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:123,y:347,page:0},{id:51,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:143,y:347,page:0},{id:104,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.436,chnl:15,x:177,y:347,page:0},{id:67,width:37,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:28.056,chnl:15,x:210,y:347,page:0},{id:88,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.258000000000003,chnl:15,x:249,y:347,page:0},{id:68,width:40,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:31.941000000000003,chnl:15,x:288,y:347,page:0},{id:70,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:23.751,chnl:15,x:330,y:347,page:0},{id:34,width:23,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:15.561000000000002,chnl:15,x:364,y:347,page:0},{id:72,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:389,y:347,page:0},{id:73,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.760000000000002,chnl:15,x:429,y:347,page:0},{id:74,width:24,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:17.745,chnl:15,x:449,y:347,page:0},{id:75,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.825000000000003,chnl:15,x:24,y:297,page:0},{id:76,width:31,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:21.567,chnl:15,x:475,y:347,page:0},{id:66,width:35,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.153000000000002,chnl:15,x:64,y:297,page:0},{id:78,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:101,y:297,page:0},{id:33,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.298,chnl:15,x:141,y:297,page:0},{id:80,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.221,chnl:15,x:161,y:297,page:0},{id:65,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:197,y:297,page:0},{id:82,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.313000000000002,chnl:15,x:237,y:297,page:0},{id:35,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:275,y:297,page:0},{id:84,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.801000000000002,chnl:15,x:310,y:297,page:0},{id:85,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:30.891000000000002,chnl:15,x:346,y:297,page:0},{id:86,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:385,y:297,page:0},{id:39,width:16,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:8.568000000000001,chnl:15,x:425,y:297,page:0},{id:69,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.255000000000003,chnl:15,x:443,y:297,page:0},{id:89,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.208000000000002,chnl:15,x:23,y:247,page:0},{id:90,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.284000000000002,chnl:15,x:477,y:297,page:0},{id:49,width:31,height:40,xoffset:0,yoffset:-30.156000000000002,xadvance:24.360000000000003,chnl:15,x:61,y:247,page:0},{id:50,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:94,y:247,page:0},{id:57,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:128,y:247,page:0},{id:94,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:162,y:247,page:0},{id:96,width:21,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:16.8,chnl:15,x:196,y:247,page:0},{id:55,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:219,y:247,page:0},{id:54,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:254,y:247,page:0},{id:53,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:289,y:247,page:0},{id:52,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:323,y:247,page:0},{id:103,width:31,height:39,xoffset:0,yoffset:-21.630000000000003,xadvance:21.84,chnl:15,x:358,y:247,page:0},{id:112,width:32,height:39,xoffset:0,yoffset:-21.651,xadvance:23.541,chnl:15,x:391,y:247,page:0},{id:113,width:31,height:39,xoffset:0,yoffset:-21.651,xadvance:23.520000000000003,chnl:15,x:425,y:247,page:0},{id:116,width:25,height:39,xoffset:0,yoffset:-28.182000000000002,xadvance:15.057,chnl:15,x:458,y:247,page:0},{id:121,width:31,height:38,xoffset:0,yoffset:-21.273,xadvance:21.651,chnl:15,x:34,y:196,page:0},{id:59,width:18,height:36,xoffset:0,yoffset:-20.706,xadvance:10.983,chnl:15,x:485,y:247,page:0},{id:43,width:32,height:34,xoffset:0,yoffset:-24.486,xadvance:24.360000000000003,chnl:15,x:67,y:196,page:0},{id:60,width:30,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:101,y:196,page:0},{id:62,width:31,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:133,y:196,page:0},{id:117,width:30,height:32,xoffset:0,yoffset:-21.273,xadvance:23.415000000000003,chnl:15,x:166,y:196,page:0},{id:99,width:29,height:32,xoffset:0,yoffset:-21.609,xadvance:20.055,chnl:15,x:198,y:196,page:0},{id:110,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:23.436,chnl:15,x:229,y:196,page:0},{id:111,width:32,height:32,xoffset:0,yoffset:-21.609,xadvance:23.814,chnl:15,x:262,y:196,page:0},{id:126,width:32,height:26,xoffset:0,yoffset:-16.128,xadvance:24.360000000000003,chnl:15,x:201,y:447,page:0},{id:101,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:22.176000000000002,chnl:15,x:296,y:196,page:0},{id:114,width:25,height:32,xoffset:0,yoffset:-21.651,xadvance:15.288,chnl:15,x:329,y:196,page:0},{id:115,width:27,height:32,xoffset:0,yoffset:-21.609,xadvance:18.186,chnl:15,x:356,y:196,page:0},{id:97,width:28,height:32,xoffset:0,yoffset:-21.651,xadvance:20.874000000000002,chnl:15,x:385,y:196,page:0},{id:118,width:31,height:31,xoffset:0,yoffset:-21.273,xadvance:21.672,chnl:15,x:415,y:196,page:0},{id:61,width:31,height:29,xoffset:0,yoffset:-19.089000000000002,xadvance:24.360000000000003,chnl:15,x:448,y:196,page:0},{id:120,width:30,height:31,xoffset:0,yoffset:-21.273,xadvance:20.916,chnl:15,x:21,y:145,page:0},{id:58,width:18,height:31,xoffset:0,yoffset:-20.706,xadvance:10.5,chnl:15,x:53,y:145,page:0},{id:122,width:28,height:31,xoffset:0,yoffset:-21.273,xadvance:18.984,chnl:15,x:73,y:145,page:0},{id:95,width:28,height:16,xoffset:0,yoffset:0,xadvance:19.278000000000002,chnl:15,x:235,y:447,page:0},{id:45,width:23,height:24,xoffset:0,yoffset:-14.175,xadvance:15.603000000000002,chnl:15,x:481,y:196,page:0},{id:44,width:17,height:21,xoffset:0,yoffset:-4.956,xadvance:9.534,chnl:15,x:103,y:145,page:0},{id:46,width:18,height:15,xoffset:0,yoffset:-4.956,xadvance:9.912,chnl:15,x:0,y:497,page:0},{id:32,width:0,height:0,xoffset:0,yoffset:0,xadvance:10.752,chnl:15,x:20,y:497,page:0}],info:{face:"Lato Regular",size:42,bold:0,italic:0,charset:[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],unicode:1,stretchH:100,smooth:1,aa:1,padding:[0,0,0,0],spacing:[2,2]},common:{lineHeight:50.400000000000006,base:41.454,scaleW:512,scaleH:512,pages:1,packed:0,alphaChnl:0,redChnl:0,greenChnl:0,blueChnl:0},kernings:[]};class ez extends at{get behavior(){return Oi}constructor(t){super();const n=Bm(dE),r=Oe(t.field),i=t.as,a=t.fontSize;this.handle=o=>{const s=r(o);s!==void 0?o[i]=n.measureWidth(s,a):o[i]=0,this._propagate(o)}}}const tz=65536;class nz extends at{get behavior(){return Oi}constructor(t){super(),this.params=t}reset(){super.reset(),this.initialize()}initialize(){const t=this.params,n=t.as||"lane",r=ft(t.spacing)?t.spacing:1,i=Oe(t.start),a=Oe(t.end);if(!t.preference!=!t.preferredOrder)throw new Error('Must specify both "preference" and "preferredOrder"');if(t.preference){const o=new Float64Array(tz),s=Oe(t.preference),c=t.preferredOrder;let l=1/0;this.handle=u=>{const f=i(u);f<l&&o.fill(-1/0),l=f;const h=c.indexOf(s(u));let d=-1;if(h>=0&&o[h]<f)d=h;else{const p=i(u);for(d=0;d<o.length&&!(o[d]<p);d++);if(d>=o.length)throw new Error("Out of lanes!")}o[d]=a(u)+r,u[n]=d,this._propagate(u)}}else{const o=new Ll,s=new Ll;let c=-1/0,l=0;this.handle=u=>{const f=i(u);for(;o.length&&(o.peekValue()<=f||f<c);){const d=o.pop();s.push(d,d)}c=f;let h=s.pop();h===void 0&&(h=l++),u[n]=h,this._propagate(u),o.push(h,a(u)+r)}}}}class rz extends at{get behavior(){return mr}constructor(t){if(super(),t.as&&t.as.length!=t.fields.length)throw new Error('"fields" and "as" have unequal lengths!');const n=t.fields.map(i=>Oe(i)),r=t.as?t.as:n.map(Vo);this.handle=i=>{const a={};for(let o=0;o<n.length;o++)a[r[o]]=n[o](i);this._propagate(a)}}}class iz extends at{get behavior(){return Oi}constructor(t){super();const n=new RegExp(t.regex),r=typeof t.as=="string"?[t.as]:t.as,i=Oe(t.field);this.handle=a=>{const o=i(a);if(Me(o)){const s=o.match(n);if(s){if(s.length-1!=r.length)throw new Error('The number of RegEx groups and the length of "as" do not match!');for(let c=0;c<r.length;c++)a[r[c]]=s[c+1]}else if(t.skipInvalidInput)for(let c=0;c<r.length;c++)a[r[c]]=void 0;else throw new Error(`"${o}" does not match the given regex: ${n.toString()}`)}else if(!t.skipInvalidInput)throw new Error(`Trying to match a non-string field. Encountered type: ${typeof o}, field content: "${o}".`);this._propagate(a)}}}class az extends at{get behavior(){return mr}constructor(t){super();const n=Lt(t.columnRegex).map(h=>new RegExp(h)),r=Lt(t.asValue);if(n.length!=r.length)throw new Error('Lengths of "columnRegex" and "as" are not equal!');const i=t.skipRegex?new RegExp(t.skipRegex):void 0,a=t.asKey||"sample";let o,s,c;const l=h=>{var b;const d=Object.keys(h);for(const v of n)if(!d.some(x=>v.test(x)))throw new Error(`No columns matching the regex ${v.toString()} found in the data!`);const p=new Map;for(const[v,x]of n.entries())for(const A of d){const w=(b=x.exec(A))==null?void 0:b[1];if(w!==void 0){let _=p.get(w);_||(_=[],p.set(w,_)),_[v]=A}}o=[...p.entries()],s=d.filter(v=>!n.some(x=>x.test(v))&&!(i&&i.test(v)));const g=[...s.map(v=>JSON.stringify(v)+": datum["+JSON.stringify(v)+"]"),JSON.stringify(a)+": sampleId",...r.map(v=>JSON.stringify(v)+": null")];c=new Function("datum","sampleId",`return {
|
1633
|
+
*/const oN="locus",sN="index";var cN=5;function lN(e){const t=e.type;return!e.bins&&(t===es||t===pl||t===gl)}function eE(e){return _t(e)&&![hr,sN,oN].includes(e)}function tE(e){return e||{warn:(t,...n)=>console.warn(t,...n)}}var uN=Nf(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma","zoom","fp64","name"]);function nE(e,t,n){n=tE(n);for(const r in e)if(!uN[r]){if(r==="padding"&&eE(t.type))continue;Kt(t[r])?t[r](e[r]):n.warn("Unsupported scale property: "+r)}yN(t,e,bN(t,e,pN(t,e,n)))}function fN(e,t){const n=hN(e),r=ke(n);if(!r)throw new Error("Unknown scale type: "+n);const i=r();return!e.domain&&_t(i.type)&&(e.domain=[0,0]),nE(e,i,t),i}function hN(e){var t=e.type,n="",r;return t===hr?hr+"-"+es:(dN(e)&&(r=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=r===2?hr+"-":r===3?ts+"-":""),(n+t||es).toLowerCase())}function dN(e){const t=e.type;return _t(t)&&t!==Yx&&t!==Zx&&(e.scheme||e.range&&e.range.length&&e.range.every(Me))}function pN(e,t,n){if(!e.domain)return 0;n=tE(n);var r=gN(e,t.domainRaw,n);if(r>-1)return r;var i=t.domain,a=e.type,o=t.zero||t.zero===void 0&&lN(e),s,c;return i?(eE(a)&&t.padding&&i[0]!==zn(i)&&(i=mN(a,i,t.range,t.padding,t.exponent,t.constant)),(o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(s=(i=i.slice()).length-1||1,o&&(i[0]>0&&(i[0]=0),i[s]<0&&(i[s]=0)),t.domainMin!=null&&(i[0]=t.domainMin),t.domainMax!=null&&(i[s]=t.domainMax),t.domainMid!=null&&(c=t.domainMid,(c<i[0]||c>i[s])&&n.warn("Scale domainMid exceeds domain min or max.",c),i.splice(s,0,c))),e.domain(rE(a,i,n)),a===Gg&&e.unknown(t.domainImplicit?ug:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&KA(e,t.nice)||null),i.length):0}function gN(e,t,n){return t?(e.domain(rE(e.type,t,n)),t.length):-1}function mN(e,t,n,r,i,a){var o=Math.abs(zn(n)-n[0]),s=o/(o-2*r),c=e===Ti?ov(t,null,s):e===gl?bp(t,null,s,.5):e===pl?bp(t,null,s,i||1):e===xh?dI(t,null,s,a||1):mp(t,null,s);return t=t.slice(),t[0]=c[0],t[t.length-1]=c[1],t}function rE(e,t,n){if(n3(e)){var r=Math.abs(t.reduce(function(i,a){return i+(a<0?-1:a>0?1:0)},0));r!==t.length&&n.warn("Log scale domain includes zero: "+Lf(t))}return t}function bN(e,t,n){let r=t.bins;if(r&&!Qt(r)){const i=(r.start==null||r.stop==null)&&e.domain(),a=r.start==null?i[0]:r.start,o=r.stop==null?zn(i):r.stop,s=r.step;s||it("Scale bins parameter missing step property."),r=mi(a,o+s,s)}return r?e.bins=r:e.bins&&delete e.bins,e.type===jg&&(r?!t.domain&&!t.domainRaw&&(e.domain(r),n=r.length):e.bins=e.domain()),n}function yN(e,t,n){var r=e.type,i=t.round||!1,a=t.range;if(t.rangeStep!=null)a=vN(r,t,n);else if(t.scheme&&(a=wN(r,t,n),Kt(a))){if(e.interpolator)return e.interpolator(a);it(`Scale type ${r} does not support interpolating color schemes.`)}if(a&&Eh(r))return e.interpolator(Sh(zm(a,t.reverse),t.interpolate,t.interpolateGamma));a&&t.interpolate&&e.interpolate?e.interpolate(r3(t.interpolate,t.interpolateGamma)):Kt(e.round)?e.round(i):Kt(e.rangeRound)&&e.interpolate(i?hl:Ci),a&&e.range(zm(a,t.reverse))}function vN(e,t,n){e!==Kx&&e!==Vg&&it("Only band and point scales support rangeStep.");var r=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,i=e===Vg?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*$g(n,i,r)]}function wN(e,t,n){var r=t.schemeExtent,i,a;return Qt(t.scheme)?a=Sh(t.scheme,t.interpolate,t.interpolateGamma):(i=t.scheme.toLowerCase(),a=Wg(i),a||it(`Unrecognized scheme name: ${t.scheme}`)),n=e===Xx?n+1:e===jg?n-1:e===Hg||e===Qx?+t.schemeCount||cN:n,Eh(e)?iE(a,r,t.reverse):Kt(a)?OB(iE(a,r),n):e===Gg?a:a.slice(0,n)}function iE(e,t,n){return Kt(e)&&(t||n)?MB(e,zm(t||[0,1],n)):e}function zm(e,t){return t?e.slice().reverse():e}const Um=pt(",d");function xN(e){return e.chrom+":"+Um(Math.floor(e.pos+1))}function aE(e){return!ft(e)&&"chrom"in e?xN(e):""+e}function AN(e,t){return e.chrom+":"+Um(Math.floor(e.pos+1))+"-"+(e.chrom!=t.chrom?t.chrom+":":"")+Um(Math.ceil(t.pos))}const EN="https://genomespy.app/data/genomes/";class SN{constructor(t){if(this.config=t,!this.config.contigs&&typeof this.config.name!="string")throw new Error("No name has been defined for the genome assembly!");this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,this.config.contigs&&this.setChromSizes(this.config.contigs)}get name(){return this.config.name}async load(t){if(!this.config.contigs){this.config.baseUrl?this.baseUrl=/^http(s)?/.test(this.config.baseUrl)?this.config.baseUrl:t+"/"+this.config.baseUrl:this.baseUrl=EN;try{this.setChromSizes(_N(await Zc({baseURL:this.baseUrl}).load(`${this.config.name}/${this.name}.chrom.sizes`)))}catch(n){throw new Error(`Could not load chrom sizes: ${n.message}`)}}}hasChrPrefix(){return this.chromosomes.some(t=>t.name.startsWith("chr"))}setChromSizes(t){let n=0;this.startByIndex=[0];for(let r=0;r<t.length;r++){this.startByIndex.push(n);const i=t[r].size,a={...t[r],continuousStart:n,continuousEnd:n+i,continuousInterval:[n,n+i],index:r,number:r+1,odd:!(r&1)};this.chromosomes.push(a);const o=a.name.replace(/^chr/i,"");for(const s of["chr"+o,"CHR"+o,"Chr"+o,a.number,""+a.number,o,a.name])this.cumulativeChromPositions.set(s,n),this.chromosomesByName.set(s,a);n+=a.size}this.totalSize=n}getExtent(){return[0,this.totalSize]}toContinuous(t,n){let r=this.cumulativeChromPositions.get(t);if(r===void 0)throw new Error("Unknown chromosome/contig: "+t);return r+ +n}toChromosome(t){if(t>this.totalSize)return;t=Math.floor(t);const n=Fr(this.startByIndex,t)-1;if(n>0&&n<=this.chromosomes.length)return this.chromosomes[n-1]}toChromosomal(t){const n=this.toChromosome(t);if(n)return{chrom:n.name,pos:Math.floor(t)-n.continuousStart}}getChromosome(t){return this.chromosomesByName.get(t)}formatInterval(t){return AN(...this.toChromosomalInterval(t))}toChromosomalInterval(t){const n=this.toChromosomal(t[0]+.5),r=this.toChromosomal(t[1]-.5);return r.pos+=1,[n,r]}toContinuousInterval(t){var i;let[n,r]=t;return r||(r=n),[this.toContinuous(n.chrom,n.pos??0),this.toContinuous(r.chrom,r.pos??((i=this.chromosomesByName.get(r.chrom))==null?void 0:i.size))]}toDiscreteChromosomeIntervals(t){const n=t[0],r=t[1],i=[];if(n.chrom===r.chrom)i.push({chrom:n.chrom,startPos:n.pos,endPos:r.pos});else{const a=this.chromosomes.findIndex(s=>s.name===n.chrom),o=this.chromosomes.findIndex(s=>s.name===r.chrom);i.push({chrom:n.chrom,startPos:n.pos,endPos:this.chromosomes[a].size});for(let s=a+1;s<o;s++)i.push({chrom:this.chromosomes[s].name,startPos:0,endPos:this.chromosomes[s].size});i.push({chrom:r.chrom,startPos:0,endPos:r.pos})}return i}continuousToDiscreteChromosomeIntervals(t){return this.toDiscreteChromosomeIntervals([this.toChromosomal(t[0]),this.toChromosomal(t[1])])}parseInterval(t){const n=t.match(/^(chr[0-9A-Z]+)(?::([0-9,]+)(?:-(?:(chr[0-9A-Z]+):)?([0-9,]+))?)?$/);if(n){const r=n[1];if(n.slice(2).every(s=>s===void 0)){const s=this.getChromosome(r);return s?[s.continuousStart,s.continuousEnd]:void 0}const i=n[3]||r,a=parseInt(n[2].replace(/,/g,"")),o=n[4]!==void 0?parseInt(n[4].replace(/,/g,"")):a;return[this.toContinuous(r,a-1),this.toContinuous(i,o)]}}}function _N(e){return BI(e).filter(t=>/^chr[0-9A-Z]+$/.test(t[0])).map(([t,n])=>({name:t,size:parseInt(n)}))}function Kh(e){return Xt(e)&&"chrom"in e}function CN(e){return e.every(Kh)}class Ml extends Array{constructor(){super(),this.type=void 0}extend(t){return this}extendAll(t){if(t instanceof Ml&&t.type!=this.type)throw new Error(`Cannot combine different types of domains: ${this.type} and ${t.type}`);for(const n of t)this.extend(n);return this}extendAllWithAccessor(t,n){for(const r of t)this.extend(n(r));return this}}class $m extends Ml{constructor(){super(),this.type="quantitative"}extend(t){return t==null||Number.isNaN(t)?this:(t=+t,this.length?t<this[0]?this[0]=t:t>this[1]&&(this[1]=t):(this.push(t),this.push(t)),this)}}class oE extends Ml{constructor(){super(),this.type="ordinal",this.uniqueValues=new Set}extend(t){return t==null||Number.isNaN(t)?this:(this.uniqueValues.has(t)||(this.uniqueValues.add(t),this.push(t)),this)}}class sE extends oE{constructor(){super(),this.type="nominal"}}class kN extends Ml{constructor(t){super();let n=0;for(let r=1;r<t.length;r++)n+=Math.sign(t[r]-t[r-1]);if(Math.abs(n)!=t.length-1)throw new Error("Piecewise domain must be strictly increasing or decreasing: "+JSON.stringify(t));t.forEach(r=>this.push(r))}extend(t){if(this.includes(t))return this;throw new Error("Piecewise domains are immutable and cannot be unioned!")}}const cE={quantitative:$m,index:$m,locus:$m,nominal:sE,ordinal:oE};function lE(e,t){if(e=="quantitative"&&TN(t)){const n=new kN(t);return n.type=e,n}else if(cE[e]){const n=new cE[e];return n.type=e,t&&n.extendAll(t),n}throw new Error("Unknown type: "+e)}function TN(e){return e&&e.length>0&&e.length!=2&&e.every(t=>typeof t=="number")}function IN(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function RN(e){return--e*e*e+1}function DN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function BN(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}function FN(e){return 1-BN(e)}function PN(e,t,n){return e*Math.pow(t/e,n)}ke("index",Nm,["continuous"]),ke("locus",XL,["continuous"]),ke("null",_h,[]);const uE="quantitative",Hm="ordinal",Gm="nominal",fE="locus",MN="index";class ON{constructor(t){Z(this,Rr);Z(this,V0);Z(this,fc);Z(this,oi);Z(this,cf);Z(this,j0);Z(this,U2);Z(this,lf);Z(this,ai,void 0);Z(this,uc,new Set);Z(this,Ot,void 0);this.channel=t,this.members=[],this.type=null,this.name=void 0}addEventListener(t,n){if(t!="domain")throw new Error("Unsupported event type: "+t);P(this,uc).add(n)}removeEventListener(t,n){if(t!="domain")throw new Error("Unsupported event type: "+t);P(this,uc).delete(n)}pushUnitView(t,n){var o;const r=Yg(t,n),i=r.type,a=(o=r==null?void 0:r.scale)==null?void 0:o.name;if(a){if(this.name!==void 0&&a!=this.name)throw new Error(`Shared scales have conflicting names: "${a}" vs. "${this.name}"!`);this.name=a}if(!this.type)this.type=i;else if(i!==this.type&&!xl(n))throw new Error(`Can not use shared scale for different data types: ${this.type} vs. ${i}. Use "resolve: independent" for channel ${this.channel}`);this.members.push({view:t,channel:n})}isExplicitDomain(){return!!this.getConfiguredDomain()}isDomainInitialized(){const t=P(this,Ot);if(!t)return!1;const n=t.domain();return _t(t.type)?n.length>2||n.length==2&&(n[0]!==0||n[1]!==0):n.length>0}getScaleProps(){return ds(this,"scaleProps",()=>{const t=J(this,V0,NT).call(this);if(t===null||t.type=="null")return{type:"null"};const n={...J(this,j0,zT).call(this,this.type),...t};n.type||(n.type=LN(this.channel,this.type));const r=J(this,fc,dp).call(this);return r&&r.length>0?n.domain=r:zr(n.type)&&(n.domain=new sE),!n.domain&&n.domainMid!==void 0&&(n.domain=[n.domainMin??0,n.domainMax??1]),this.channel=="y"&&zr(n.type)&&n.reverse==null&&(n.reverse=!0),n.range&&n.scheme&&delete n.scheme,!("zoom"in n)&&["index","locus"].includes(n.type)&&(n.zoom=!0),NN(n,this.channel),n})}getConfiguredDomain(){return J(this,lf,Q2).call(this,t=>xl(t.channel)?void 0:t.view.getConfiguredDomain(t.channel))}getDataDomain(){return J(this,lf,Q2).call(this,t=>xl(t.channel)?void 0:t.view.extractDataDomain(t.channel))}reconfigure(){if(P(this,Ot)&&P(this,Ot).type!="null"){const t=this.isDomainInitialized(),n=P(this,Ot).domain();PA(this,"scaleProps");const r=this.getScaleProps();if(nE(r,P(this,Ot)),_t(P(this,Ot).type)&&le(this,ai,J(this,cf,Z2).call(this)),!t){J(this,Rr,ya).call(this);return}const i=P(this,Ot).domain();eh(i,n)||(this.isZoomable()?P(this,Ot).domain(n):J(this,oi,Ho).call(this)?(P(this,Ot).domain(n),this.zoomTo(i,500)):J(this,Rr,ya).call(this))}}getScale(){if(P(this,Ot))return P(this,Ot);const t=this.getScaleProps(),n=fN(t);return le(this,Ot,n),KL(n)&&n.genome(this.getGenome()),_t(n.type)&&le(this,ai,J(this,cf,Z2).call(this)),n}getDomain(){return this.getScale().domain()}getComplexDomain(){var t;return((t=this.getGenome())==null?void 0:t.toChromosomalInterval(this.getDomain()))??this.getDomain()}isZoomed(){return J(this,oi,Ho).call(this)&&eh(J(this,fc,dp).call(this),this.getDomain())}isZoomable(){return J(this,oi,Ho).call(this)&&!!this.getScaleProps().zoom}zoom(t,n,r){if(!J(this,oi,Ho).call(this))return!1;const i=this.getScale(),a=i.domain();let o=[...a],s=i.invert(n);switch(this.getScaleProps().reverse&&(r=-r),"align"in i&&(s+=i.align()),i.type){case"linear":case"index":case"locus":o=uI(o,r||0),o=mp(o,s,t);break;case"log":o=fI(o,r||0),o=ov(o,s,t);break;case"pow":case"sqrt":{const c=i;o=hI(o,r||0,c.exponent()),o=bp(o,s,t,c.exponent());break}default:throw new Error("Zooming is not implemented for: "+i.type)}return P(this,ai)&&(o=pI(o,P(this,ai)[0],P(this,ai)[1])),[0,1].some(c=>o[c]!=a[c])?(i.domain(o),J(this,Rr,ya).call(this),!0):!1}async zoomTo(t,n=!1){var s;if(kc(n)&&(n=n?700:0),!J(this,oi,Ho).call(this))throw new Error("Not a zoomable scale!");const r=this.fromComplexInterval(t),i=(s=this.members[0])==null?void 0:s.view.context.animator,a=this.getScale(),o=a.domain();if(n>0&&o.length==2){const c=o[1]-o[0],l=o[0]+c/2,u=r[1]-r[0],f=r[0]+u/2;await i.transition({duration:n,easingFunction:DN,onUpdate:h=>{const d=PN(c,u,h),p=(c-d)/(c-u),g=p*f+(1-p)*l;a.domain([g-d/2,g+d/2]),J(this,Rr,ya).call(this)}}),a.domain(r),J(this,Rr,ya).call(this)}else a.domain(r),i==null||i.requestRender(),J(this,Rr,ya).call(this)}resetZoom(){if(!J(this,oi,Ho).call(this))throw new Error("Not a zoomable scale!");const t=this.getDomain(),n=J(this,fc,dp).call(this);return[0,1].some(r=>n[r]!=t[r])?(P(this,Ot).domain(n),J(this,Rr,ya).call(this),!0):!1}getZoomLevel(){return this.isZoomable()?Of(P(this,ai))/Of(this.getScale().domain()):1}getGenome(){var n;if(this.type!=="locus")return;const t=(n=this.members[0].view.context.genomeStore)==null?void 0:n.getGenome();if(!t)throw new Error("No genome has been defined!");return t}invertToComplex(t){const n=this.getScale();if("invert"in n){const r=n.invert(t);return this.toComplex(r)}else throw new Error("The scale does not support inverting!")}toComplex(t){const n=this.getGenome();return n?n.toChromosomal(t):t}fromComplex(t){return Kh(t)?this.getGenome().toContinuous(t.chrom,t.pos):t}fromComplexInterval(t){return this.type==="locus"&&CN(t)?this.getGenome().toContinuousInterval(t):t}}ai=new WeakMap,uc=new WeakMap,Ot=new WeakMap,Rr=new WeakSet,ya=function(){for(const t of P(this,uc).values())t({type:"domain",scaleResolution:this})},V0=new WeakSet,NT=function(){return ds(this,"mergedScaleProps",()=>{const t=this.members.map(n=>Yg(n.view,n.channel).scale).filter(n=>n!==void 0);return Xh(t,"scale",["domain"])})},fc=new WeakSet,dp=function(){return this.getConfiguredDomain()??(this.type==fE?this.getGenome().getExtent():this.getDataDomain())},oi=new WeakSet,Ho=function(){const t=this.getScale().type;return _t(t)},cf=new WeakSet,Z2=function(){const t=this.getScaleProps(),n=t.zoom;if(zN(n)&&Qt(n.extent))return this.fromComplexInterval(n.extent);if(n)return t.type=="locus"?this.getGenome().getExtent():P(this,Ot).domain()},j0=new WeakSet,zT=function(t){const n=this.channel,r={};return this.isExplicitDomain()&&(r.zero=!1),wl(n)?r.nice=!this.isExplicitDomain():Ha(n)?r.scheme=t==Gm?"tableau10":t==Hm?"blues":"viridis":Ch(n)?r.range=n=="shape"?["circle","square","triangle-up","cross","diamond"]:[]:n=="size"?r.range=[0,400]:n=="angle"&&(r.range=[0,360]),r},U2=new WeakSet,eee=function(){return this.members.map(t=>t.view.getPathString()).join(", ")},lf=new WeakSet,Q2=function(t){const n=this.members.filter(r=>!r.view.getLayoutAncestors().some(i=>!i.options.contributesToScaleDomain)).map(t).filter(r=>!!r);if(n.length)return n.reduce((r,i)=>r.extendAll(i))};function LN(e,t){if(t==MN||t==fE){if(c3(e))return t;throw new Error(`${e} does not support ${t} data type. Only positional channels do.`)}const n={x:["band","band","linear"],y:["band","band","linear"],size:[void 0,"point","linear"],opacity:[void 0,"point","linear"],fillOpacity:[void 0,"point","linear"],strokeOpacity:[void 0,"point","linear"],color:["ordinal","ordinal","linear"],fill:["ordinal","ordinal","linear"],stroke:["ordinal","ordinal","linear"],strokeWidth:[void 0,void 0,"linear"],shape:["ordinal","ordinal",void 0],dx:[void 0,void 0,"null"],dy:[void 0,void 0,"null"],angle:[void 0,void 0,"linear"]},i=["sample"].includes(e)?"null":n[e]?n[e][[Gm,Hm,uE].indexOf(t)]:t==uE?"linear":"ordinal";if(i===void 0)throw new Error(`Channel "${e}" is not compatible with "${t}" data type. Use of a proper scale may be needed.`);return i}function NN(e,t){wl(t)&&e.type!=="ordinal"&&(e.range=[0,1]),t=="opacity"&&_t(e.type)&&(e.clamp=!0)}function zN(e){return Xt(e)}function Vm(e){const t=new Set;function n(r){for(const i of Object.values(r.resolutions.scale))t.add(i)}for(const r of Lt(e)){r.visit(n);for(const i of r.getDataAncestors()){if(!i.options.contributesToScaleDomain)break;n(i)}}t.forEach(r=>r.reconfigure())}function jm(...e){for(const t of e)if(t!==void 0)return t}class UN{constructor(t){this.channel=t,this.members=[]}get scaleResolution(){var t;return(t=xn(this.members))==null?void 0:t.view.getScaleResolution(this.channel)}pushUnitView(t,n){const r=t.getScaleResolution(this.channel);if(!r)throw new Error("Cannot find a scale resolution!");if(this.scaleResolution&&r!==this.scaleResolution)throw new Error("Shared axes must have a shared scale!");this.members.push({view:t,channel:n})}getAxisProps(){return ds(this,"axisProps",()=>{const t=this.members.map(n=>{const r=n.view.mark.encoding[n.channel];return"axis"in r&&r.axis});return t.length>0&&t.some(n=>n===null)?null:Xh(t.filter(n=>n!==void 0),"axis",["title"])})}getTitle(){const t=a=>{var s;const o=Yg(a.view,a.channel);if(!Gn(o))return{member:a,explicitTitle:jm("axis"in o?(s=o.axis)==null?void 0:s.title:void 0,o.title),implicitTitle:jm(Ur(o)?o.field:void 0,Zg(o)?o.expr:void 0)}},n=this.members.map(t),r=n.filter(a=>{var o;if(xl(a.member.channel)&&!a.explicitTitle){const s=$a(a.member.channel);return((o=n.find(c=>c.member.view==a.member.view&&c.member.channel==s))==null?void 0:o.explicitTitle)===void 0}return!0}),i=new Set(r.map(a=>jm(a.explicitTitle,a.implicitTitle)).filter(Me));return i.size?[...i].join(", "):null}}const $N={point:AL,rect:gL,rule:CL,link:BL,text:zL};class mt extends qn{constructor(t,n,r,i,a,o){super(t,n,r,i,a,o),this.spec=t;const s=$N[this.getMarkType()];if(s)this.mark=new s(this);else throw new Error(`No such mark: ${this.getMarkType()}`);this.resolve(),this.needsAxes={x:!0,y:!0}}render(t,n,r={}){super.render(t,n,r),this.isConfiguredVisible()&&(t.pushView(this,n),t.renderMark(this.mark,r),t.popView(this))}getMarkType(){return typeof this.spec.mark=="object"?this.spec.mark.type:this.spec.mark}resolve(t){t||(this.resolve("scale"),this.resolve("axis"));const n=this.mark.encoding;for(const[r,i]of Object.entries(n)){if(!rn(i))continue;const a=$a(i.resolutionChannel??r);if(!Ri(a)||t=="axis"&&!wl(a))continue;let o=this;for(;(o.getConfiguredOrDefaultResolution(a,t)=="forced"||o.dataParent instanceof qn&&["shared","excluded","forced"].includes(o.dataParent.getConfiguredOrDefaultResolution(a,t)))&&o.getConfiguredOrDefaultResolution(a,t)!="excluded";)o=o.dataParent;t=="axis"&&wl(r)&&c3(a)?(o.resolutions[t][a]||(o.resolutions[t][a]=new UN(a)),o.resolutions[t][a].pushUnitView(this,r)):t=="scale"&&Ri(r)&&(o.resolutions[t][a]||(o.resolutions[t][a]=new ON(a)),o.resolutions[t][a].pushUnitView(this,r))}}getAccessor(t){return this._cache("accessor/"+t,()=>{const n=this.mark.encoding;if(n&&n[t])return this.context.accessorFactory.createAccessor(n[t])})}getFacetAccessor(t){const n=this.getAccessor("sample");return n||super.getFacetAccessor(this)}getCollector(){return this.context.dataFlow.findCollectorByKey(this)}_validateDomainQuery(t){if(xl(t))throw new Error(`getDomain(${t}), must only be called for primary channels!`);const n=this.mark.encoding[t];if(!rn(n))throw new Error("The channel has no scale, cannot get domain!");return n}getConfiguredDomain(t){const n=this._validateDomainQuery(t),r=n&&n.scale&&n.scale.domain;if(r){const i=this.getScaleResolution(n.resolutionChannel??t);return lE(n.type??"nominal",i.fromComplexInterval(r))}}extractDataDomain(t){const r=this._validateDomainQuery(t).type??"nominal",i=s=>{let c;const l=this.mark.encoding[s];if(l){const u=this.context.accessorFactory.createAccessor(l);if(u)if(c=lE(r),u.constant)c.extend(u({}));else{const f=this.getCollector();f!=null&&f.completed&&f.visitData(h=>c.extend(u(h)))}}return c};let a=i(t);const o=Qg[t];if(o){const s=i(o);s&&a.extendAll(s)}return a}getZoomLevel(){const t=n=>{var r;return((r=this.getScaleResolution(n))==null?void 0:r.getZoomLevel())??1};return ns.map(t).reduce((n,r)=>n*r,1)}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0),t.target=this,!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,n){return t=="x"?"shared":"independent"}}function*qm(e,t=[]){for(const[n,r]of e.entries())if(r instanceof Map)for(const i of qm(r,[...t,n]))yield i;else yield[[...t,n],r]}class Ol extends at{get behavior(){return Mm}constructor(t){super(),this.params=t??{type:"collect"},this.observers=[],this.facetBatches=void 0,this._init()}_init(){this._data=[],this.facetBatches=new gi([],JSON.stringify),this.facetBatches.set(void 0,this._data)}reset(){super.reset(),this._init()}handle(t){this._data.push(t)}beginBatch(t){wL(t)&&(this._data=[],this.facetBatches.set(Lt(t.facetId),this._data))}complete(){var i,a;const t=(i=this.params)==null?void 0:i.sort,n=t?sv(t.field,t.order):void 0,r=o=>{n&&o.sort(n)};if((a=this.params.groupby)!=null&&a.length){if(this.facetBatches.size>1)throw new Error("TODO: Support faceted data!");const o=this.params.groupby.map(c=>Oe(c)),s=Rc(this._data,...o);this.facetBatches.clear();for(const[c,l]of qm(s))this.facetBatches.set(c,l)}for(const o of this.facetBatches.values())r(o);if(this.children.length)for(const[o,s]of this.facetBatches.entries()){if(o){const c={type:"facet",facetId:o};for(const l of this.children)l.beginBatch(c)}for(const c of s)this._propagate(c)}super.complete();for(const o of this.observers)o(this)}getData(){switch(this._checkStatus(),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{const t=this.facetBatches;return{[Symbol.iterator]:function*(){for(const r of t.values())for(let i=0;i<r.length;i++)yield r[i]}}}}}visitData(t){this._checkStatus();for(const n of this.facetBatches.values())for(let r=0;r<n.length;r++)t(n[r])}getItemCount(){let t=0;for(const n of this.facetBatches.values())t+=n.length;return t}_checkStatus(){if(!this.completed)throw new Error("Data propagation is not completed! No data are available.")}}class Ll{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(t,n){let r=this.length++;for(;r>0;){const i=r-1>>1,a=this.values[i];if(n>=a)break;this.ids[r]=this.ids[i],this.values[r]=a,r=i}this.ids[r]=t,this.values[r]=n}pop(){if(this.length===0)return;const t=this.ids[0];if(this.length--,this.length>0){const n=this.ids[0]=this.ids[this.length],r=this.values[0]=this.values[this.length],i=this.length>>1;let a=0;for(;a<i;){let o=(a<<1)+1;const s=o+1;let c=this.ids[o],l=this.values[o];const u=this.values[s];if(s<this.length&&u<l&&(o=s,c=this.ids[s],l=u),l>=r)break;this.ids[a]=c,this.values[a]=l,a=o}this.ids[a]=n,this.values[a]=r}return t}peek(){if(this.length!==0)return this.ids[0]}peekValue(){if(this.length!==0)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}class HN extends at{get behavior(){return gr}constructor(t){super(),this.params=t,this.startAccessor=Oe(t.start),this.endAccessor=Oe(t.end),this.chromAccessor=t.chrom?Oe(t.chrom):n=>{},this.weightAccessor=t.weight?Oe(t.weight):n=>1,this.as={coverage:t.as||"coverage",start:t.asStart||t.start,end:t.asEnd||t.end,chrom:t.asChrom||t.chrom},this.createSegment=new Function("start","end","coverage","chrom","return {"+Object.entries(this.as).filter(([n,r])=>r).map(([n,r])=>`${JSON.stringify(r)}: ${n}`).join(", ")+"};"),this.ends=new Ll}reset(){super.reset(),this.initialize()}initialize(){const t=this.as.coverage,n=this.as.end,r=this.as.chrom,i=this.startAccessor,a=this.endAccessor,o=this.chromAccessor,s=this.weightAccessor;let c,l,u,f=0,h;const d=this.ends;d.clear();const p=(b,v,x)=>{if(b==v)return;let A=!1;c&&(c[t]===x?(c[n]=v,A=!0):c[t]!=0&&this._propagate(c)),A||(c=this.createSegment(b,v,x,u))},g=()=>{let b;for(;(b=d.peekValue())!==void 0;)p(h,b,f),h=b,f-=d.pop();h=void 0,c&&(this._propagate(c),c=void 0)};this.handle=b=>{const v=i(b);let x;for(;(x=d.peekValue())!==void 0&&x<v;)p(h,x,f),h=x,f-=d.pop();if(r){let w=o(b);w!==l&&(g(),u=w,l=u)}h!==void 0&&p(h,v,f),h=v;const A=s(b);f+=A,d.push(A,a(b))},this.complete=()=>{g(),super.complete()}}}function GN(e,t,n=0,r=e.length){const i=new Ll,a=r-n;let o;for(o=0;o<t&&o<a;o++)i.push(o,e[n+o]);for(;o<a;o++){const l=e[n+o];l>=i.peekValue()&&(i.push(o,l),i.pop())}const s=[];let c;for(;(c=i.pop())!==void 0;)s.push(n+c);return s.reverse()}class VN{constructor(t,n=-1/0,r=1/0){this.maxSize=t,this.lowerLimit=n,this.upperLimit=r;const i=this.maxSize*2+1;this.lowerLimits=new Float64Array(i),this.upperLimits=new Float64Array(i),this.lowerChildren=new Int32Array(i),this.upperChildren=new Int32Array(i),this.reset()}reset(){this.lowerLimits.fill(0),this.upperLimits.fill(0),this.lowerChildren.fill(0),this.upperChildren.fill(0),this.n=1,this.lowerLimits[0]=this.lowerLimit,this.upperLimits[0]=this.upperLimit}_findSlot(t,n,r=0){if(t>=this.lowerLimits[r]&&n<=this.upperLimits[r]){const i=this.lowerChildren[r];if(i){const a=this._findSlot(t,n,i);return a>=0?a:this._findSlot(t,n,this.upperChildren[r])}else return r}else return-1}reserve(t,n){if(n-t<=0)throw new Error("Cannot reserve an empty or negative-size slot!");if(this.n+1>this.lowerLimits.length)return!1;const r=this._findSlot(t,n);if(r<0)return!1;const i=this.n++,a=this.n++;return this.lowerLimits[i]=this.lowerLimits[r],this.upperLimits[i]=t,this.lowerLimits[a]=n,this.upperLimits[a]=this.upperLimits[r],this.lowerChildren[r]=i,this.upperChildren[r]=a,!0}}class jN extends at{get behavior(){return Mm}constructor(t,n){if(super(),this.params=t,this._data=[],this.channel=t.channel??"x",!["x","y"].includes(this.channel))throw new Error("Invalid channel: "+this.channel);this.posAccessor=Oe(this.params.pos),this.posBisector=zf(this.posAccessor),this.scoreAccessor=Oe(this.params.score),this.widthAccessor=Oe(this.params.width),this.laneAccessor=this.params.lane?Oe(this.params.lane):i=>0,this.padding=this.params.padding??0,this.reservationMaps=new Map,this.resolution=n.getScaleResolution(this.channel);const r=()=>this._filterAndPropagate();this.schedule=()=>n.context.animator.requestTransition(r),this.resolution.addEventListener("domain",i=>this.schedule()),n._addBroadcastHandler("layoutComputed",()=>this.schedule())}complete(){const t=this.posAccessor;this._data.sort((n,r)=>t(n)-t(r)),this._scores=this._data.map(this.scoreAccessor);for(const n of new Set(this._data.map(this.laneAccessor)))this.reservationMaps.set(n,new VN(200));this.schedule(),super.complete()}_filterAndPropagate(){var o;super.reset();const t=this.resolution.getScale(),n=(o=this.resolution.members[0].view.coords)==null?void 0:o[this.channel=="x"?"width":"height"];if(!n)return;for(const s of this.reservationMaps.values())s.reset();const r=t.domain(),i=70,a=GN(this._scores,i,this.posBisector.left(this._data,r[0]),this.posBisector.right(this._data,r[1]));for(const s of a){const c=this._data[s],l=t(this.posAccessor(c))*n,u=this.widthAccessor(c)/2+this.padding;this.reservationMaps.get(this.laneAccessor(c)).reserve(l-u,l+u)&&this._propagate(c)}super.complete()}reset(){super.reset(),this._data=[],this.groups=new Map}handle(t){this._data.push(t)}}class qN extends at{constructor(t){super(),this.params=t,this.predicate=void 0}initialize(){this.predicate=sh(this.params.expr,this.getGlobalObject())}handle(t){this.predicate(t)&&this._propagate(t)}}class WN extends at{get behavior(){return gr}constructor(t){super();const n=t.index;if(t.fields){const r=Lt(t.fields).map(a=>Oe(a)),i=Lt(t.as||t.fields);if(r.length!==i.length)throw new Error(`Lengths of "fields" (${r.length}), and "as" (${i.length}) do not match!`);this.handle=a=>{const o=r.map((c,l)=>c(a)??[]),s=o[0].length;for(let c=0;c<s;c++){const l=Object.assign({},a);for(let u=0;u<r.length;u++)l[i[u]]=c<o[u].length?o[u][c]:null;n&&(l[n]=c),this._propagate(l)}}}else this.handle=r=>{for(let i=0;i<r.length;i++){const a=Object.assign({},r[i]);n&&(a[n]=i),this._propagate(a)}}}}const YN="0".charCodeAt(0);function*ZN(e,t=","){const n=t.charCodeAt(0);let r=0;for(let i=0;i<e.length;i++){const a=e.charCodeAt(i);a==n?(yield r,r=0):r=r*10+a-YN}yield r}class QN extends at{get behavior(){return gr}constructor(t){super();const n=Oe(t.exons??"exons"),r=Oe(t.start??"start"),[i,a]=t.as||["exonStart","exonEnd"];this.handle=o=>{let s=r(o),c=s,l=!0;const u=n(o);for(const f of ZN(u)){if(l)c=s+f;else{s=c+f;const h=Object.assign({},o);h[i]=c,h[a]=s,this._propagate(h)}l=!l}}}}class XN extends at{get behavior(){return gr}constructor(t){super();const n=Lt(t.field).map(a=>Oe(a)),r=Lt(t.separator),i=Lt(t.as||t.field);if(n.length!==r.length||n.length!==i.length)throw new Error(`Lengths of "separator" (${r.length}), "fields" (${n.length}), and "as" (${i.length}) do not match!`);this.handle=a=>{if(n.some(c=>!c(a)))return;const o=n.map((c,l)=>c(a).split(r[l]));KN(o,a);const s=o[0].length;for(let c=0;c<s;c++){const l=Object.assign({},a);for(let u=0;u<n.length;u++)l[i[u]]=o[u][c];this._propagate(l)}}}}function KN(e,t){const n=e.map(r=>r.length);if(!n.every(r=>r==n[0]))throw new Error("Mismatching number of elements in the fields to be split: "+JSON.stringify(t))}class JN extends at{get behavior(){return Li}constructor(t){super(),this.params=t,this.as=t.as,this.fn=void 0}initialize(){this.fn=sh(this.params.expr,this.getGlobalObject())}handle(t){t[this.as]=this.fn(t),this._propagate(t)}}class hE extends at{get behavior(){return Li}constructor(t,n){super();const r=t.channel??"x";if(!["x","y"].includes(r))throw new Error("Invalid channel: "+r);const i=n.getScaleResolution(r).getGenome();if(!i)throw new Error("LinearizeGenomicCoordinate transform requires a locus scale!");const a=Oe(t.chrom),o=Lt(t.pos).map(p=>Oe(p)),s=Lt(t.as);if(o.length!=s.length)throw new Error('The number of "pos" and "as" elements must be equal!');const c=Lt(t.offset);let l;if(c.length==0)l=new Array(o.length).fill(0);else if(c.length==1)l=new Array(o.length).fill(c[0]);else if(c.length==o.length)l=c;else throw new Error(`Invalid "offset" parameter: ${JSON.stringify(t.offset)}!`);const u=new Function("datum","chromOffset","posAccessors",s.map((p,g)=>`datum[${JSON.stringify(p)}] = chromOffset + +posAccessors[${g}](datum) - ${l[g]};`).join(`
|
1634
|
+
`));let f,h=0;const d=p=>{if(p!==f){if(h=i.cumulativeChromPositions.get(p),h===void 0)throw new Error("Unknown chromosome/contig: "+p);f=p}return h};this.handle=p=>{u(p,d(a(p)),o),this._propagate(p)}}}const dE={pages:["Lato-Regular.png"],chars:[{id:87,width:53,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:43.491,chnl:15,x:0,y:0,page:0},{id:124,width:17,height:50,xoffset:0,yoffset:-32.193000000000005,xadvance:10.521,chnl:15,x:0,y:42,page:0},{id:40,width:20,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:94,page:0},{id:41,width:19,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:145,page:0},{id:36,width:32,height:49,xoffset:0,yoffset:-34.419000000000004,xadvance:24.360000000000003,chnl:15,x:0,y:196,page:0},{id:125,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:247,page:0},{id:91,width:22,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:297,page:0},{id:93,width:19,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:347,page:0},{id:123,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:397,page:0},{id:106,width:19,height:48,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:0,y:447,page:0},{id:81,width:43,height:47,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:21,y:447,page:0},{id:77,width:45,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:38.997,chnl:15,x:66,y:447,page:0},{id:64,width:43,height:44,xoffset:0,yoffset:-28.539,xadvance:35.133,chnl:15,x:23,y:397,page:0},{id:92,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:68,y:397,page:0},{id:47,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:98,y:397,page:0},{id:109,width:42,height:32,xoffset:0,yoffset:-21.609,xadvance:34.545,chnl:15,x:113,y:447,page:0},{id:119,width:42,height:31,xoffset:0,yoffset:-21.315,xadvance:32.991,chnl:15,x:157,y:447,page:0},{id:42,width:25,height:42,xoffset:0,yoffset:-31.626,xadvance:17.85,chnl:15,x:128,y:397,page:0},{id:37,width:42,height:41,xoffset:0,yoffset:-30.387,xadvance:33.663000000000004,chnl:15,x:155,y:397,page:0},{id:79,width:42,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:199,y:397,page:0},{id:102,width:24,height:41,xoffset:0,yoffset:-30.534000000000002,xadvance:14.721,chnl:15,x:243,y:397,page:0},{id:100,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:269,y:397,page:0},{id:98,width:32,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:302,y:397,page:0},{id:56,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:336,y:397,page:0},{id:38,width:40,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:29.904000000000003,chnl:15,x:370,y:397,page:0},{id:108,width:17,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:9.912,chnl:15,x:412,y:397,page:0},{id:107,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:21.336000000000002,chnl:15,x:431,y:397,page:0},{id:48,width:33,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:464,y:397,page:0},{id:71,width:38,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:30.681,chnl:15,x:21,y:347,page:0},{id:83,width:31,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:22.785,chnl:15,x:61,y:347,page:0},{id:63,width:27,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:18.795,chnl:15,x:94,y:347,page:0},{id:105,width:18,height:41,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:123,y:347,page:0},{id:51,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:143,y:347,page:0},{id:104,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.436,chnl:15,x:177,y:347,page:0},{id:67,width:37,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:28.056,chnl:15,x:210,y:347,page:0},{id:88,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.258000000000003,chnl:15,x:249,y:347,page:0},{id:68,width:40,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:31.941000000000003,chnl:15,x:288,y:347,page:0},{id:70,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:23.751,chnl:15,x:330,y:347,page:0},{id:34,width:23,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:15.561000000000002,chnl:15,x:364,y:347,page:0},{id:72,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:389,y:347,page:0},{id:73,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.760000000000002,chnl:15,x:429,y:347,page:0},{id:74,width:24,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:17.745,chnl:15,x:449,y:347,page:0},{id:75,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.825000000000003,chnl:15,x:24,y:297,page:0},{id:76,width:31,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:21.567,chnl:15,x:475,y:347,page:0},{id:66,width:35,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.153000000000002,chnl:15,x:64,y:297,page:0},{id:78,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:101,y:297,page:0},{id:33,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.298,chnl:15,x:141,y:297,page:0},{id:80,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.221,chnl:15,x:161,y:297,page:0},{id:65,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:197,y:297,page:0},{id:82,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.313000000000002,chnl:15,x:237,y:297,page:0},{id:35,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:275,y:297,page:0},{id:84,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.801000000000002,chnl:15,x:310,y:297,page:0},{id:85,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:30.891000000000002,chnl:15,x:346,y:297,page:0},{id:86,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:385,y:297,page:0},{id:39,width:16,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:8.568000000000001,chnl:15,x:425,y:297,page:0},{id:69,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.255000000000003,chnl:15,x:443,y:297,page:0},{id:89,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.208000000000002,chnl:15,x:23,y:247,page:0},{id:90,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.284000000000002,chnl:15,x:477,y:297,page:0},{id:49,width:31,height:40,xoffset:0,yoffset:-30.156000000000002,xadvance:24.360000000000003,chnl:15,x:61,y:247,page:0},{id:50,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:94,y:247,page:0},{id:57,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:128,y:247,page:0},{id:94,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:162,y:247,page:0},{id:96,width:21,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:16.8,chnl:15,x:196,y:247,page:0},{id:55,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:219,y:247,page:0},{id:54,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:254,y:247,page:0},{id:53,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:289,y:247,page:0},{id:52,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:323,y:247,page:0},{id:103,width:31,height:39,xoffset:0,yoffset:-21.630000000000003,xadvance:21.84,chnl:15,x:358,y:247,page:0},{id:112,width:32,height:39,xoffset:0,yoffset:-21.651,xadvance:23.541,chnl:15,x:391,y:247,page:0},{id:113,width:31,height:39,xoffset:0,yoffset:-21.651,xadvance:23.520000000000003,chnl:15,x:425,y:247,page:0},{id:116,width:25,height:39,xoffset:0,yoffset:-28.182000000000002,xadvance:15.057,chnl:15,x:458,y:247,page:0},{id:121,width:31,height:38,xoffset:0,yoffset:-21.273,xadvance:21.651,chnl:15,x:34,y:196,page:0},{id:59,width:18,height:36,xoffset:0,yoffset:-20.706,xadvance:10.983,chnl:15,x:485,y:247,page:0},{id:43,width:32,height:34,xoffset:0,yoffset:-24.486,xadvance:24.360000000000003,chnl:15,x:67,y:196,page:0},{id:60,width:30,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:101,y:196,page:0},{id:62,width:31,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:133,y:196,page:0},{id:117,width:30,height:32,xoffset:0,yoffset:-21.273,xadvance:23.415000000000003,chnl:15,x:166,y:196,page:0},{id:99,width:29,height:32,xoffset:0,yoffset:-21.609,xadvance:20.055,chnl:15,x:198,y:196,page:0},{id:110,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:23.436,chnl:15,x:229,y:196,page:0},{id:111,width:32,height:32,xoffset:0,yoffset:-21.609,xadvance:23.814,chnl:15,x:262,y:196,page:0},{id:126,width:32,height:26,xoffset:0,yoffset:-16.128,xadvance:24.360000000000003,chnl:15,x:201,y:447,page:0},{id:101,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:22.176000000000002,chnl:15,x:296,y:196,page:0},{id:114,width:25,height:32,xoffset:0,yoffset:-21.651,xadvance:15.288,chnl:15,x:329,y:196,page:0},{id:115,width:27,height:32,xoffset:0,yoffset:-21.609,xadvance:18.186,chnl:15,x:356,y:196,page:0},{id:97,width:28,height:32,xoffset:0,yoffset:-21.651,xadvance:20.874000000000002,chnl:15,x:385,y:196,page:0},{id:118,width:31,height:31,xoffset:0,yoffset:-21.273,xadvance:21.672,chnl:15,x:415,y:196,page:0},{id:61,width:31,height:29,xoffset:0,yoffset:-19.089000000000002,xadvance:24.360000000000003,chnl:15,x:448,y:196,page:0},{id:120,width:30,height:31,xoffset:0,yoffset:-21.273,xadvance:20.916,chnl:15,x:21,y:145,page:0},{id:58,width:18,height:31,xoffset:0,yoffset:-20.706,xadvance:10.5,chnl:15,x:53,y:145,page:0},{id:122,width:28,height:31,xoffset:0,yoffset:-21.273,xadvance:18.984,chnl:15,x:73,y:145,page:0},{id:95,width:28,height:16,xoffset:0,yoffset:0,xadvance:19.278000000000002,chnl:15,x:235,y:447,page:0},{id:45,width:23,height:24,xoffset:0,yoffset:-14.175,xadvance:15.603000000000002,chnl:15,x:481,y:196,page:0},{id:44,width:17,height:21,xoffset:0,yoffset:-4.956,xadvance:9.534,chnl:15,x:103,y:145,page:0},{id:46,width:18,height:15,xoffset:0,yoffset:-4.956,xadvance:9.912,chnl:15,x:0,y:497,page:0},{id:32,width:0,height:0,xoffset:0,yoffset:0,xadvance:10.752,chnl:15,x:20,y:497,page:0}],info:{face:"Lato Regular",size:42,bold:0,italic:0,charset:[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],unicode:1,stretchH:100,smooth:1,aa:1,padding:[0,0,0,0],spacing:[2,2]},common:{lineHeight:50.400000000000006,base:41.454,scaleW:512,scaleH:512,pages:1,packed:0,alphaChnl:0,redChnl:0,greenChnl:0,blueChnl:0},kernings:[]};class ez extends at{get behavior(){return Li}constructor(t){super();const n=Bm(dE),r=Oe(t.field),i=t.as,a=t.fontSize;this.handle=o=>{const s=r(o);s!==void 0?o[i]=n.measureWidth(s,a):o[i]=0,this._propagate(o)}}}const tz=65536;class nz extends at{get behavior(){return Li}constructor(t){super(),this.params=t}reset(){super.reset(),this.initialize()}initialize(){const t=this.params,n=t.as||"lane",r=ft(t.spacing)?t.spacing:1,i=Oe(t.start),a=Oe(t.end);if(!t.preference!=!t.preferredOrder)throw new Error('Must specify both "preference" and "preferredOrder"');if(t.preference){const o=new Float64Array(tz),s=Oe(t.preference),c=t.preferredOrder;let l=1/0;this.handle=u=>{const f=i(u);f<l&&o.fill(-1/0),l=f;const h=c.indexOf(s(u));let d=-1;if(h>=0&&o[h]<f)d=h;else{const p=i(u);for(d=0;d<o.length&&!(o[d]<p);d++);if(d>=o.length)throw new Error("Out of lanes!")}o[d]=a(u)+r,u[n]=d,this._propagate(u)}}else{const o=new Ll,s=new Ll;let c=-1/0,l=0;this.handle=u=>{const f=i(u);for(;o.length&&(o.peekValue()<=f||f<c);){const d=o.pop();s.push(d,d)}c=f;let h=s.pop();h===void 0&&(h=l++),u[n]=h,this._propagate(u),o.push(h,a(u)+r)}}}}class rz extends at{get behavior(){return gr}constructor(t){if(super(),t.as&&t.as.length!=t.fields.length)throw new Error('"fields" and "as" have unequal lengths!');const n=t.fields.map(i=>Oe(i)),r=t.as?t.as:n.map(Vo);this.handle=i=>{const a={};for(let o=0;o<n.length;o++)a[r[o]]=n[o](i);this._propagate(a)}}}class iz extends at{get behavior(){return Li}constructor(t){super();const n=new RegExp(t.regex),r=typeof t.as=="string"?[t.as]:t.as,i=Oe(t.field);this.handle=a=>{const o=i(a);if(Me(o)){const s=o.match(n);if(s){if(s.length-1!=r.length)throw new Error('The number of RegEx groups and the length of "as" do not match!');for(let c=0;c<r.length;c++)a[r[c]]=s[c+1]}else if(t.skipInvalidInput)for(let c=0;c<r.length;c++)a[r[c]]=void 0;else throw new Error(`"${o}" does not match the given regex: ${n.toString()}`)}else if(!t.skipInvalidInput)throw new Error(`Trying to match a non-string field. Encountered type: ${typeof o}, field content: "${o}".`);this._propagate(a)}}}class az extends at{get behavior(){return gr}constructor(t){super();const n=Lt(t.columnRegex).map(h=>new RegExp(h)),r=Lt(t.asValue);if(n.length!=r.length)throw new Error('Lengths of "columnRegex" and "as" are not equal!');const i=t.skipRegex?new RegExp(t.skipRegex):void 0,a=t.asKey||"sample";let o,s,c;const l=h=>{var b;const d=Object.keys(h);for(const v of n)if(!d.some(x=>v.test(x)))throw new Error(`No columns matching the regex ${v.toString()} found in the data!`);const p=new Map;for(const[v,x]of n.entries())for(const A of d){const w=(b=x.exec(A))==null?void 0:b[1];if(w!==void 0){let _=p.get(w);_||(_=[],p.set(w,_)),_[v]=A}}o=[...p.entries()],s=d.filter(v=>!n.some(x=>x.test(v))&&!(i&&i.test(v)));const g=[...s.map(v=>JSON.stringify(v)+": datum["+JSON.stringify(v)+"]"),JSON.stringify(a)+": sampleId",...r.map(v=>JSON.stringify(v)+": null")];c=new Function("datum","sampleId",`return {
|
1635
1635
|
`+g.join(`,
|
1636
1636
|
`)+`
|
1637
|
-
};`)},u=h=>{o||l(h);for(const[d,p]of o){const g=c(h,d);for(let b=0;b<p.length;b++)g[r[b]]=h[p[b]];this._propagate(g)}},f=h=>{l(h),u(h),this.handle=u};this.handle=f,this.beginBatch=h=>{HA(h)&&(this.handle=f),super.beginBatch(h)}}}class oz extends at{get behavior(){return Oi}constructor(t){super(),this.params=t,this.buffer=[]}reset(){this.buffer=[]}handle(t){this.buffer.push(t)}complete(){const t=this.params,n=t.as||["y0","y1"],r=t.sort?sv(t.sort.field,t.sort.order):void 0,i=t.field?Oe(t.field):()=>1,a=t.groupby.map(u=>Oe(u)),o=WI(this.buffer,u=>a.map(f=>f(u)).join()).map(u=>u[1]);let s=u=>!0;if(t.baseField){const u=Oe(t.baseField);s=f=>u(f)!==null}let c,l;switch(t.offset){case"normalize":c=(u,f)=>u/f,l=(u,f)=>Hf(u,f);break;case"center":c=(u,f)=>u-f/2,l=(u,f)=>Hf(u,f);break;case"information":{const u=Math.log2(t.cardinality??4);c=(f,h)=>f/h,l=(f,h)=>{const p=Hf(f,x=>+!s(x)),g=Hf(f,h),b=g-p;let v=0;for(let x=0;x<f.length;x++){const A=f[x];if(s(A)){const w=h(A)/b;v-=w*Math.log2(w)}}return b/(u-(v+0))*(b/g)}}break;default:c=(u,f)=>u,l=(u,f)=>1}for(const u of o){r&&u.sort(r);const f=l(u,i);let h=0;for(const d of u){const p=h+i(d);s(d)&&(d[n[0]]=c(h,f),d[n[1]]=c(p,f),this._propagate(d),h=p)}}super.complete()}}class sz extends at{get behavior(){return mr}constructor(t){super();const n=Oe(t.field??"sequence"),[r,i]=t.as??["pos","sequence"];this.handle=a=>{const o=Object.assign({},a,{[i]:"",[r]:0}),s=n(a);for(let c=0;c<s.length;c++){const l=Object.assign({},o);l[r]=c,l[i]=s.charAt(c),this._propagate(l)}}}}class cz extends at{get behavior(){return mr}constructor(t){super(),this.params=t,this.buffer=[]}reset(){this.buffer=[]}handle(t){this.buffer.push(t)}complete(){const n=this.params.groupby,r=n.map(a=>Oe(a)),i=Rc(this.buffer,...r);for(const[a,o]of qm(i)){const s={count:o.length};for(let c=0;c<n.length;c++)s[n[c]]=a[c];this._propagate(s)}super.complete()}}const lz="_uniqueId",pE=1e4,gE=[null];class mE extends at{get behavior(){return Oi}constructor(t){super(),this.params=t,this.as=t.as??lz,this._blocks=[],this._usedBlocks=0,this._id=-1}initialize(){}reset(){super.reset(),this._usedBlocks=0,this._id=-1}handle(t){t[this.as]=this._nextId(),this._propagate(t)}_nextId(){return++this._id%pE==0&&(this._id=this._getBlock()*pE),this._id}_getBlock(){return this._usedBlocks<this._blocks.length?this._blocks[this._usedBlocks++]:this._reserveBlock()}_reserveBlock(){const t=gE.length;return gE[t]=this,this._blocks.push(t),this._usedBlocks++,t}}const bE={aggregate:cz,collect:Ol,coverage:HN,filterScoredLabels:jN,filter:qN,flatten:WN,flattenCompressedExons:QN,flattenDelimited:XN,flattenSequence:sz,formula:JN,identifier:mE,linearizeGenomicCoordinate:hE,measureText:ez,pileup:nz,project:rz,regexExtract:iz,regexFold:az,sample:GA,stack:oz};function uz(e,t){const n=bE[e.type];if(n)return new n(e,t);throw new Error("Unknown transform: "+e.type)}function yE(e){if(!xE(e)&&!wE(e))return;const t={...e.format};if(t.type??(t.type=wE(e)&&fz(e.url)),t.parse??(t.parse="auto"),!t.type)throw new Error("Format for the data source was not defined and it could not be inferred: "+JSON.stringify(e));return t}function fz(e){var t;if(Array.isArray(e)&&(e=e[0]),e)return(t=e.match(/\.(csv|tsv|json)/))==null?void 0:t[1]}const vE=e=>typeof e!="object"?hz:dz,hz=e=>({data:e}),dz=e=>e;function wE(e){return"url"in e}class ms extends at{get identifier(){}handle(t){throw new Error("Source does not handle incoming data!")}async load(){}}function xE(e){return"values"in e}class pz extends ms{constructor(t,n){var r;if(super(),this.params=t,typeof t.values=="string"&&!((r=t==null?void 0:t.format)!=null&&r.type))throw new Error("Data format type (csv, dsv, ...) must be specified if a string is provided!")}loadSynchronously(){const t=this.params.values;let n=[],r=i=>i;if(Array.isArray(t))t.length>0&&(n=t,r=vE(t[0]));else if(typeof t=="object")n=[t];else if(typeof t=="string")n=lw(t,yE(this.params));else throw new Error('"values" in data configuration is not an array, object, or a string!');this.reset(),this.beginBatch({type:"file"});for(const i of n)this._propagate(r(i));this.complete()}async load(){this.loadSynchronously()}}function gz(e){return"url"in e}class mz extends ms{constructor(t,n){super(),this.params=t,this.baseUrl=n==null?void 0:n.getBaseUrl()}get identifier(){return JSON.stringify({params:this.params,baseUrl:this.baseUrl})}async load(){const t=this.params.url,n=Array.isArray(t)?t:[t],r=async a=>Zc({baseURL:this.baseUrl}).load(a).catch(o=>{throw new Error(`Cannot fetch: ${this.baseUrl}${a}: ${o.message}`)}),i=(a,o)=>{try{const s=lw(a,yE(this.params));this.beginBatch({type:"file",url:o});for(const c of s)this._propagate(c)}catch(s){throw new Error(`Cannot parse: ${o}: ${s.message}`)}};this.reset(),await Promise.all(n.map(a=>r(a).then(i))),this.complete()}}function bz(e){return"sequence"in e}class yz extends ms{constructor(t,n){if(super(),this.sequence=t.sequence,!("start"in this.sequence))throw new Error("'start' is missing from sequence parameters!");if(!("stop"in this.sequence))throw new Error("'stop' is missing from sequence parameters!")}loadSynchronously(){const t=this.sequence.as||"data",n=this.sequence.step||1,r=this.sequence.stop;this.reset(),this.beginBatch({type:"file"});for(let i=this.sequence.start;i<r;i+=n)this._propagate({[t]:i});this.complete()}async load(){this.loadSynchronously()}}class Wm extends ms{constructor(n,r){super();ar(this,"initializedPromise",Promise.resolve());if(this.view=n,r){if(r!=="x"&&r!=="y")throw new Error(`Invalid channel specified for the dynamic data source: ${r}. Must be either "x" or "y"`)}else throw new Error('No channel has been specified for the dynamic data source. Must be either "x" or "y".');if(this.channel=r,this.scaleResolution=this.view.getScaleResolution(r),!this.scaleResolution){const a=[`The dynamic data source cannot find a resolved scale for channel "${r}".`];throw this.view instanceof mt||a.push('Make sure the view has a "shared" scale resolution as it is not a unit view.'),new Error(a.join(" "))}const i=()=>{this.view.isVisible()&&this.onDomainChanged(this.scaleResolution.getDomain(),this.scaleResolution.getComplexDomain())};this.scaleResolution.addEventListener("domain",i),this.view.context.addBroadcastListener("layoutComputed",i)}getAxisLength(){const n=this.scaleResolution.members.map(r=>{var i;return(i=r.view.coords)==null?void 0:i[this.channel==="x"?"width":"height"]}).filter(r=>r>0);return n.length?n.reduce((r,i)=>Math.min(r,i),1e4):0}get genome(){return this.scaleResolution.getGenome()}async onDomainChanged(n,r){}setLoadingStatus(n){this.view.context.setDataLoadingStatus(this.view,n)}requestRender(){this.view.context.animator.requestRender()}async load(){this.reset(),this.complete()}publishData(n){this.reset(),this.beginBatch({type:"file"});for(const r of n)for(const i of r)this._propagate(i);this.complete(),Vm(this.view),this.requestRender()}}class vz extends Wm{constructor(n,r){const i={axis:{},...n};super(r,i.channel);ar(this,"ticks",[]);this.params=n}async onDomainChanged(){const n=this.scaleResolution.getScale(),r=this.params.axis,i=this.getAxisLength(),a=l=>25+60*lg(100,700,l),o=ft(r.tickCount)?r.tickCount:Math.round(i/a(i)),s=KA(n,o,r.tickMinStep),c=r.values?JA(n,r.values,s):JL(n,s);if(!eh(c,this.ticks)){this.ticks=c;const l=tN(n,o,r.format);this.publishData([c.map(u=>({value:u,label:l(u)}))])}}}class wz extends Wm{constructor(t,n){super(n,t.channel)}async load(){this.publishData([this.genome.chromosomes])}}function Xa(e,t){return!t||/^(data:|([A-Za-z]+:)?\/\/)/.test(e)||e.startsWith("/")?e:(t.endsWith("/")||(t+="/"),t+e)}function bs(e,t,n=!0){let r,i=o=>{};return function(...s){return new Promise((c,l)=>{const u=()=>{clearTimeout(r),i=f=>{},c(e(...s))};n&&i("debounced"),clearTimeout(r),i=l,r=window.setTimeout(u,t)})}}class Nl extends Wm{constructor(){super(...arguments);Z(this,hc,new AbortController);Z(this,uf,[0,0]);ar(this,"params")}setupDebouncing(n){n.debounce>0&&(n.debounceMode=="domain"?this.onDomainChanged=bs(this.onDomainChanged.bind(this),n.debounce,!1):n.debounceMode=="window"&&(this.loadInterval=bs(this.loadInterval.bind(this),n.debounce,!1)))}async onDomainChanged(n){var a;const r=((a=this.params)==null?void 0:a.windowSize)??-1;if(n[1]-n[0]>r)return;const i=this.quantizeInterval(n,r);this.checkAndUpdateLastInterval(i)&&(await this.initializedPromise,this.loadInterval(i))}async loadInterval(n){}async discretizeAndLoad(n,r){P(this,hc).abort(),this.setLoadingStatus(!0),le(this,hc,new AbortController);const i=P(this,hc).signal,a=this.genome.continuousToDiscreteChromosomeIntervals(n);try{const o=await Promise.all(a.map(async s=>r(s,i)));if(!i.aborted)return this.setLoadingStatus(!1),o}catch(o){if(!i.aborted)throw this.setLoadingStatus(!1),o}}quantizeInterval(n,r){return[Math.max(Math.floor(n[0]/r-1)*r,0),Math.min(Math.ceil(n[1]/r+1)*r,this.genome.totalSize)]}checkAndUpdateLastInterval(n){return eh(P(this,uf),n)?!1:(le(this,uf,n),!0)}}hc=new WeakMap,uf=new WeakMap;class xz extends Nl{constructor(t,n){const r={channel:"x",windowSize:7e3,debounce:200,debounceMode:"window",...t};if(super(n,r.channel),this.params=r,!this.params.url)throw new Error("No URL provided for IndexedFastaSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(i=>{Promise.all([Promise.resolve().then(()=>l6),Promise.resolve().then(()=>RY),Promise.resolve().then(()=>hu)]).then(([{Buffer:a},{IndexedFasta:o},{RemoteFile:s}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=a));const c=l=>new s(Xa(l,this.view.getBaseUrl()));this.fasta=new o({fasta:c(this.params.url),fai:c(this.params.indexUrl??this.params.url+".fai")}),i()})})}async loadInterval(t){const n=await this.discretizeAndLoad(t,async(r,i)=>this.fasta.getSequence(r.chrom,r.startPos,r.endPos,{signal:i}).then(a=>({chrom:r.chrom,start:r.startPos,sequence:a})));n&&this.publishData([n])}}class Az extends Nl{constructor(n,r){const i={pixelsPerBin:2,channel:"x",debounce:200,debounceMode:"window",...n};super(r,i.channel);Z(this,dc,[]);Z(this,pc,void 0);if(this.params=i,!this.params.url)throw new Error("No URL provided for BigWigSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(a=>{Promise.all([Promise.resolve().then(()=>sk),Promise.resolve().then(()=>hu)]).then(([{BigWig:o},{RemoteFile:s}])=>{le(this,pc,new o({filehandle:new s(Xa(this.params.url,this.view.getBaseUrl()))})),P(this,pc).getHeader().then(c=>{le(this,dc,c.zoomLevels.map(l=>l.reductionLevel).reverse()),P(this,dc).push(1),a()})})})}async onDomainChanged(n){await this.initializedPromise;const r=this.getAxisLength()||700,i=Ez(n,r,P(this,dc)),a=Math.max(i*r,5e3),o=this.quantizeInterval(n,a);this.checkAndUpdateLastInterval(o)&&this.loadInterval(o,i)}async loadInterval(n,r){const i=.5/r/this.params.pixelsPerBin,a=await this.discretizeAndLoad(n,(o,s)=>P(this,pc).getFeatures(o.chrom,o.startPos,o.endPos,{scale:i,signal:s}).then(c=>c.map(l=>({chrom:o.chrom,start:l.start,end:l.end,score:l.score}))));a&&this.publishData(a)}}dc=new WeakMap,pc=new WeakMap;function Ez(e,t,n){const r=(e[1]-e[0])/t;return n.find(i=>i<r)??n.at(-1)}class Sz extends Nl{constructor(n,r){const i={channel:"x",windowSize:1e6,debounce:200,debounceMode:"window",...n};super(r,i.channel);ar(this,"parser");ar(this,"bbi");if(this.params=i,!this.params.url)throw new Error("No URL provided for BigBedSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(a=>{Promise.all([Promise.resolve().then(()=>_K),Promise.resolve().then(()=>sk),Promise.resolve().then(()=>hu)]).then(([o,{BigBed:s},{RemoteFile:c}])=>{const l=o.default;this.bbi=new s({filehandle:new c(Xa(this.params.url,this.view.getBaseUrl()))}),this.bbi.getHeader().then(async u=>{this.parser=new l({autoSql:u.autoSql}),a()})})})}async loadInterval(n){const r=await this.discretizeAndLoad(n,async(i,a)=>this.bbi.getFeatures(i.chrom,i.startPos,i.endPos,{signal:a}).then(o=>o.map(s=>this.parser.parseLine(`${i.chrom} ${s.start} ${s.end} ${s.rest}`,{uniqueId:s.uniqueId}))));r&&this.publishData(r)}}class _z extends Nl{constructor(n,r){const i={channel:"x",windowSize:2e4,debounce:200,debounceMode:"domain",...n};super(r,i.channel);Z(this,Mo,void 0);ar(this,"chrPrefixFixer",n=>n);if(this.params=i,!this.params.url)throw new Error("No URL provided for BamSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(a=>{Promise.all([Promise.resolve().then(()=>jK),Promise.resolve().then(()=>hu)]).then(([{BamFile:o},{RemoteFile:s}])=>{const c=l=>new s(Xa(l,this.view.getBaseUrl()));le(this,Mo,new o({bamFilehandle:c(this.params.url),baiFilehandle:c(this.params.indexUrl??this.params.url+".bai")})),P(this,Mo).getHeader().then(l=>{var h,d;const u=this.genome.hasChrPrefix(),f=(d=(h=P(this,Mo).indexToChr)==null?void 0:h[0])==null?void 0:d.refName.startsWith("chr");u&&!f?this.chrPrefixFixer=p=>p.replace("chr",""):!u&&f&&(this.chrPrefixFixer=p=>"chr"+p),a()})})})}async loadInterval(n){const r=await this.discretizeAndLoad(n,async(i,a)=>P(this,Mo).getRecordsForRange(this.chrPrefixFixer(i.chrom),i.startPos,i.endPos,{signal:a}).then(o=>o.map(s=>({chrom:i.chrom,start:s.get("start"),end:s.get("end"),name:s.get("name"),MD:s.get("MD"),cigar:s.get("cigar"),mapq:s.get("mq"),strand:s.get("strand")===1?"+":"-"}))));r&&this.publishData(r)}}Mo=new WeakMap;class Cz extends Nl{constructor(n,r){const i={channel:"x",windowSize:3e6,debounce:200,debounceMode:"domain",...n};super(r,i.channel);Z(this,ff,void 0);if(this.params=i,!this.params.url)throw new Error("No URL provided for TabixSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(a=>{Promise.all([Promise.resolve().then(()=>l6),Promise.resolve().then(()=>tJ),Promise.resolve().then(()=>hu)]).then(([{Buffer:o},{TabixIndexedFile:s},{RemoteFile:c}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=o));const l=u=>new c(Xa(u,this.view.getBaseUrl()));le(this,ff,new s({filehandle:l(this.params.url),tbiFilehandle:l(this.params.indexUrl??this.params.url+".tbi")})),a()})})}async loadInterval(n){const r=await this.discretizeAndLoad(n,async(i,a)=>{const o=[];return await P(this,ff).getLines(i.chrom,i.startPos,i.endPos,{lineCallback:s=>{o.push(s)},signal:a}),this._parseFeatures(o)});r&&this.publishData(r)}_parseFeatures(n){return[]}}ff=new WeakMap;class kz extends Cz{constructor(n,r){super(n,r);Z(this,hf,void 0);Promise.resolve().then(()=>zJ).then(i=>{le(this,hf,i.default)})}_parseFeatures(n){var i;return(i=P(this,hf))==null?void 0:i.parseStringSync(n.join(`
|
1637
|
+
};`)},u=h=>{o||l(h);for(const[d,p]of o){const g=c(h,d);for(let b=0;b<p.length;b++)g[r[b]]=h[p[b]];this._propagate(g)}},f=h=>{l(h),u(h),this.handle=u};this.handle=f,this.beginBatch=h=>{HA(h)&&(this.handle=f),super.beginBatch(h)}}}class oz extends at{get behavior(){return Li}constructor(t){super(),this.params=t,this.buffer=[]}reset(){this.buffer=[]}handle(t){this.buffer.push(t)}complete(){const t=this.params,n=t.as||["y0","y1"],r=t.sort?sv(t.sort.field,t.sort.order):void 0,i=t.field?Oe(t.field):()=>1,a=t.groupby.map(u=>Oe(u)),o=WI(this.buffer,u=>a.map(f=>f(u)).join()).map(u=>u[1]);let s=u=>!0;if(t.baseField){const u=Oe(t.baseField);s=f=>u(f)!==null}let c,l;switch(t.offset){case"normalize":c=(u,f)=>u/f,l=(u,f)=>Hf(u,f);break;case"center":c=(u,f)=>u-f/2,l=(u,f)=>Hf(u,f);break;case"information":{const u=Math.log2(t.cardinality??4);c=(f,h)=>f/h,l=(f,h)=>{const p=Hf(f,x=>+!s(x)),g=Hf(f,h),b=g-p;let v=0;for(let x=0;x<f.length;x++){const A=f[x];if(s(A)){const w=h(A)/b;v-=w*Math.log2(w)}}return b/(u-(v+0))*(b/g)}}break;default:c=(u,f)=>u,l=(u,f)=>1}for(const u of o){r&&u.sort(r);const f=l(u,i);let h=0;for(const d of u){const p=h+i(d);s(d)&&(d[n[0]]=c(h,f),d[n[1]]=c(p,f),this._propagate(d),h=p)}}super.complete()}}class sz extends at{get behavior(){return gr}constructor(t){super();const n=Oe(t.field??"sequence"),[r,i]=t.as??["pos","sequence"];this.handle=a=>{const o=Object.assign({},a,{[i]:"",[r]:0}),s=n(a);for(let c=0;c<s.length;c++){const l=Object.assign({},o);l[r]=c,l[i]=s.charAt(c),this._propagate(l)}}}}class cz extends at{get behavior(){return gr}constructor(t){super(),this.params=t,this.buffer=[]}reset(){this.buffer=[]}handle(t){this.buffer.push(t)}complete(){const n=this.params.groupby,r=n.map(a=>Oe(a)),i=Rc(this.buffer,...r);for(const[a,o]of qm(i)){const s={count:o.length};for(let c=0;c<n.length;c++)s[n[c]]=a[c];this._propagate(s)}super.complete()}}const lz="_uniqueId",pE=1e4,gE=[null];class mE extends at{get behavior(){return Li}constructor(t){super(),this.params=t,this.as=t.as??lz,this._blocks=[],this._usedBlocks=0,this._id=-1}initialize(){}reset(){super.reset(),this._usedBlocks=0,this._id=-1}handle(t){t[this.as]=this._nextId(),this._propagate(t)}_nextId(){return++this._id%pE==0&&(this._id=this._getBlock()*pE),this._id}_getBlock(){return this._usedBlocks<this._blocks.length?this._blocks[this._usedBlocks++]:this._reserveBlock()}_reserveBlock(){const t=gE.length;return gE[t]=this,this._blocks.push(t),this._usedBlocks++,t}}const bE={aggregate:cz,collect:Ol,coverage:HN,filterScoredLabels:jN,filter:qN,flatten:WN,flattenCompressedExons:QN,flattenDelimited:XN,flattenSequence:sz,formula:JN,identifier:mE,linearizeGenomicCoordinate:hE,measureText:ez,pileup:nz,project:rz,regexExtract:iz,regexFold:az,sample:GA,stack:oz};function uz(e,t){const n=bE[e.type];if(n)return new n(e,t);throw new Error("Unknown transform: "+e.type)}function yE(e){if(!xE(e)&&!wE(e))return;const t={...e.format};if(t.type??(t.type=wE(e)&&fz(e.url)),t.parse??(t.parse="auto"),!t.type)throw new Error("Format for the data source was not defined and it could not be inferred: "+JSON.stringify(e));return t}function fz(e){var t;if(Array.isArray(e)&&(e=e[0]),e)return(t=e.match(/\.(csv|tsv|json)/))==null?void 0:t[1]}const vE=e=>typeof e!="object"?hz:dz,hz=e=>({data:e}),dz=e=>e;function wE(e){return"url"in e}class ms extends at{get identifier(){}handle(t){throw new Error("Source does not handle incoming data!")}async load(){}}function xE(e){return"values"in e}class pz extends ms{constructor(t,n){var r;if(super(),this.params=t,typeof t.values=="string"&&!((r=t==null?void 0:t.format)!=null&&r.type))throw new Error("Data format type (csv, dsv, ...) must be specified if a string is provided!")}loadSynchronously(){const t=this.params.values;let n=[],r=i=>i;if(Array.isArray(t))t.length>0&&(n=t,r=vE(t[0]));else if(typeof t=="object")n=[t];else if(typeof t=="string")n=lw(t,yE(this.params));else throw new Error('"values" in data configuration is not an array, object, or a string!');this.reset(),this.beginBatch({type:"file"});for(const i of n)this._propagate(r(i));this.complete()}async load(){this.loadSynchronously()}}function gz(e){return"url"in e}class mz extends ms{constructor(t,n){super(),this.params=t,this.baseUrl=n==null?void 0:n.getBaseUrl()}get identifier(){return JSON.stringify({params:this.params,baseUrl:this.baseUrl})}async load(){const t=this.params.url,n=Array.isArray(t)?t:[t],r=async a=>Zc({baseURL:this.baseUrl}).load(a).catch(o=>{throw new Error(`Cannot fetch: ${this.baseUrl}${a}: ${o.message}`)}),i=(a,o)=>{try{const s=lw(a,yE(this.params));this.beginBatch({type:"file",url:o});for(const c of s)this._propagate(c)}catch(s){throw new Error(`Cannot parse: ${o}: ${s.message}`)}};this.reset(),await Promise.all(n.map(a=>r(a).then(i))),this.complete()}}function bz(e){return"sequence"in e}class yz extends ms{constructor(t,n){if(super(),this.sequence=t.sequence,!("start"in this.sequence))throw new Error("'start' is missing from sequence parameters!");if(!("stop"in this.sequence))throw new Error("'stop' is missing from sequence parameters!")}loadSynchronously(){const t=this.sequence.as||"data",n=this.sequence.step||1,r=this.sequence.stop;this.reset(),this.beginBatch({type:"file"});for(let i=this.sequence.start;i<r;i+=n)this._propagate({[t]:i});this.complete()}async load(){this.loadSynchronously()}}class Wm extends ms{constructor(n,r){super();ar(this,"initializedPromise",Promise.resolve());if(this.view=n,r){if(r!=="x"&&r!=="y")throw new Error(`Invalid channel specified for the dynamic data source: ${r}. Must be either "x" or "y"`)}else throw new Error('No channel has been specified for the dynamic data source. Must be either "x" or "y".');if(this.channel=r,this.scaleResolution=this.view.getScaleResolution(r),!this.scaleResolution){const a=[`The dynamic data source cannot find a resolved scale for channel "${r}".`];throw this.view instanceof mt||a.push('Make sure the view has a "shared" scale resolution as it is not a unit view.'),new Error(a.join(" "))}const i=()=>{this.view.isVisible()&&this.onDomainChanged(this.scaleResolution.getDomain(),this.scaleResolution.getComplexDomain())};this.scaleResolution.addEventListener("domain",i),this.view.context.addBroadcastListener("layoutComputed",i)}getAxisLength(){const n=this.scaleResolution.members.map(r=>{var i;return(i=r.view.coords)==null?void 0:i[this.channel==="x"?"width":"height"]}).filter(r=>r>0);return n.length?n.reduce((r,i)=>Math.min(r,i),1e4):0}get genome(){return this.scaleResolution.getGenome()}async onDomainChanged(n,r){}setLoadingStatus(n){this.view.context.setDataLoadingStatus(this.view,n)}requestRender(){this.view.context.animator.requestRender()}async load(){this.reset(),this.complete()}publishData(n){this.reset(),this.beginBatch({type:"file"});for(const r of n)for(const i of r)this._propagate(i);this.complete(),Vm(this.view),this.requestRender()}}class vz extends Wm{constructor(n,r){const i={axis:{},...n};super(r,i.channel);ar(this,"ticks",[]);this.params=n}async onDomainChanged(){const n=this.scaleResolution.getScale(),r=this.params.axis,i=this.getAxisLength(),a=l=>25+60*lg(100,700,l),o=ft(r.tickCount)?r.tickCount:Math.round(i/a(i)),s=KA(n,o,r.tickMinStep),c=r.values?JA(n,r.values,s):JL(n,s);if(!eh(c,this.ticks)){this.ticks=c;const l=tN(n,o,r.format);this.publishData([c.map(u=>({value:u,label:l(u)}))])}}}class wz extends Wm{constructor(t,n){super(n,t.channel)}async load(){this.publishData([this.genome.chromosomes])}}function Xa(e,t){return!t||/^(data:|([A-Za-z]+:)?\/\/)/.test(e)||e.startsWith("/")?e:(t.endsWith("/")||(t+="/"),t+e)}function bs(e,t,n=!0){let r,i=o=>{};return function(...s){return new Promise((c,l)=>{const u=()=>{clearTimeout(r),i=f=>{},c(e(...s))};n&&i("debounced"),clearTimeout(r),i=l,r=window.setTimeout(u,t)})}}class Nl extends Wm{constructor(){super(...arguments);Z(this,hc,new AbortController);Z(this,uf,[0,0]);ar(this,"params")}setupDebouncing(n){n.debounce>0&&(n.debounceMode=="domain"?this.onDomainChanged=bs(this.onDomainChanged.bind(this),n.debounce,!1):n.debounceMode=="window"&&(this.loadInterval=bs(this.loadInterval.bind(this),n.debounce,!1)))}async onDomainChanged(n){var a;const r=((a=this.params)==null?void 0:a.windowSize)??-1;if(n[1]-n[0]>r)return;const i=this.quantizeInterval(n,r);this.checkAndUpdateLastInterval(i)&&(await this.initializedPromise,this.loadInterval(i))}async loadInterval(n){}async discretizeAndLoad(n,r){P(this,hc).abort(),this.setLoadingStatus(!0),le(this,hc,new AbortController);const i=P(this,hc).signal,a=this.genome.continuousToDiscreteChromosomeIntervals(n);try{const o=await Promise.all(a.map(async s=>r(s,i)));if(!i.aborted)return this.setLoadingStatus(!1),o}catch(o){if(!i.aborted)throw this.setLoadingStatus(!1),o}}quantizeInterval(n,r){return[Math.max(Math.floor(n[0]/r-1)*r,0),Math.min(Math.ceil(n[1]/r+1)*r,this.genome.totalSize)]}checkAndUpdateLastInterval(n){return eh(P(this,uf),n)?!1:(le(this,uf,n),!0)}}hc=new WeakMap,uf=new WeakMap;class xz extends Nl{constructor(t,n){const r={channel:"x",windowSize:7e3,debounce:200,debounceMode:"window",...t};if(super(n,r.channel),this.params=r,!this.params.url)throw new Error("No URL provided for IndexedFastaSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(i=>{Promise.all([Promise.resolve().then(()=>l6),Promise.resolve().then(()=>RY),Promise.resolve().then(()=>hu)]).then(([{Buffer:a},{IndexedFasta:o},{RemoteFile:s}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=a));const c=l=>new s(Xa(l,this.view.getBaseUrl()));this.fasta=new o({fasta:c(this.params.url),fai:c(this.params.indexUrl??this.params.url+".fai")}),i()})})}async loadInterval(t){const n=await this.discretizeAndLoad(t,async(r,i)=>this.fasta.getSequence(r.chrom,r.startPos,r.endPos,{signal:i}).then(a=>({chrom:r.chrom,start:r.startPos,sequence:a})));n&&this.publishData([n])}}class Az extends Nl{constructor(n,r){const i={pixelsPerBin:2,channel:"x",debounce:200,debounceMode:"window",...n};super(r,i.channel);Z(this,dc,[]);Z(this,pc,void 0);if(this.params=i,!this.params.url)throw new Error("No URL provided for BigWigSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(a=>{Promise.all([Promise.resolve().then(()=>sk),Promise.resolve().then(()=>hu)]).then(([{BigWig:o},{RemoteFile:s}])=>{le(this,pc,new o({filehandle:new s(Xa(this.params.url,this.view.getBaseUrl()))})),P(this,pc).getHeader().then(c=>{le(this,dc,c.zoomLevels.map(l=>l.reductionLevel).reverse()),P(this,dc).push(1),a()})})})}async onDomainChanged(n){await this.initializedPromise;const r=this.getAxisLength()||700,i=Ez(n,r,P(this,dc)),a=Math.max(i*r,5e3),o=this.quantizeInterval(n,a);this.checkAndUpdateLastInterval(o)&&this.loadInterval(o,i)}async loadInterval(n,r){const i=.5/r/this.params.pixelsPerBin,a=await this.discretizeAndLoad(n,(o,s)=>P(this,pc).getFeatures(o.chrom,o.startPos,o.endPos,{scale:i,signal:s}).then(c=>c.map(l=>({chrom:o.chrom,start:l.start,end:l.end,score:l.score}))));a&&this.publishData(a)}}dc=new WeakMap,pc=new WeakMap;function Ez(e,t,n){const r=(e[1]-e[0])/t;return n.find(i=>i<r)??n.at(-1)}class Sz extends Nl{constructor(n,r){const i={channel:"x",windowSize:1e6,debounce:200,debounceMode:"window",...n};super(r,i.channel);ar(this,"parser");ar(this,"bbi");if(this.params=i,!this.params.url)throw new Error("No URL provided for BigBedSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(a=>{Promise.all([Promise.resolve().then(()=>_K),Promise.resolve().then(()=>sk),Promise.resolve().then(()=>hu)]).then(([o,{BigBed:s},{RemoteFile:c}])=>{const l=o.default;this.bbi=new s({filehandle:new c(Xa(this.params.url,this.view.getBaseUrl()))}),this.bbi.getHeader().then(async u=>{this.parser=new l({autoSql:u.autoSql}),a()})})})}async loadInterval(n){const r=await this.discretizeAndLoad(n,async(i,a)=>this.bbi.getFeatures(i.chrom,i.startPos,i.endPos,{signal:a}).then(o=>o.map(s=>this.parser.parseLine(`${i.chrom} ${s.start} ${s.end} ${s.rest}`,{uniqueId:s.uniqueId}))));r&&this.publishData(r)}}class _z extends Nl{constructor(n,r){const i={channel:"x",windowSize:2e4,debounce:200,debounceMode:"domain",...n};super(r,i.channel);Z(this,Mo,void 0);ar(this,"chrPrefixFixer",n=>n);if(this.params=i,!this.params.url)throw new Error("No URL provided for BamSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(a=>{Promise.all([Promise.resolve().then(()=>jK),Promise.resolve().then(()=>hu)]).then(([{BamFile:o},{RemoteFile:s}])=>{const c=l=>new s(Xa(l,this.view.getBaseUrl()));le(this,Mo,new o({bamFilehandle:c(this.params.url),baiFilehandle:c(this.params.indexUrl??this.params.url+".bai")})),P(this,Mo).getHeader().then(l=>{var h,d;const u=this.genome.hasChrPrefix(),f=(d=(h=P(this,Mo).indexToChr)==null?void 0:h[0])==null?void 0:d.refName.startsWith("chr");u&&!f?this.chrPrefixFixer=p=>p.replace("chr",""):!u&&f&&(this.chrPrefixFixer=p=>"chr"+p),a()})})})}async loadInterval(n){const r=await this.discretizeAndLoad(n,async(i,a)=>P(this,Mo).getRecordsForRange(this.chrPrefixFixer(i.chrom),i.startPos,i.endPos,{signal:a}).then(o=>o.map(s=>({chrom:i.chrom,start:s.get("start"),end:s.get("end"),name:s.get("name"),MD:s.get("MD"),cigar:s.get("cigar"),mapq:s.get("mq"),strand:s.get("strand")===1?"+":"-"}))));r&&this.publishData(r)}}Mo=new WeakMap;class Cz extends Nl{constructor(n,r){const i={channel:"x",windowSize:3e6,debounce:200,debounceMode:"domain",...n};super(r,i.channel);Z(this,ff,void 0);if(this.params=i,!this.params.url)throw new Error("No URL provided for TabixSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(a=>{Promise.all([Promise.resolve().then(()=>l6),Promise.resolve().then(()=>tJ),Promise.resolve().then(()=>hu)]).then(([{Buffer:o},{TabixIndexedFile:s},{RemoteFile:c}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=o));const l=u=>new c(Xa(u,this.view.getBaseUrl()));le(this,ff,new s({filehandle:l(this.params.url),tbiFilehandle:l(this.params.indexUrl??this.params.url+".tbi")})),a()})})}async loadInterval(n){const r=await this.discretizeAndLoad(n,async(i,a)=>{const o=[];return await P(this,ff).getLines(i.chrom,i.startPos,i.endPos,{lineCallback:s=>{o.push(s)},signal:a}),this._parseFeatures(o)});r&&this.publishData(r)}_parseFeatures(n){return[]}}ff=new WeakMap;class kz extends Cz{constructor(n,r){super(n,r);Z(this,hf,void 0);Promise.resolve().then(()=>zJ).then(i=>{le(this,hf,i.default)})}_parseFeatures(n){var i;return(i=P(this,hf))==null?void 0:i.parseStringSync(n.join(`
|
1638
1638
|
`),{parseSequences:!1})}}hf=new WeakMap;function AE(e,t){if(xE(e))return new pz(e,t);if(gz(e))return new mz(e,t);if(bz(e))return new yz(e,t);if(Tz(e))return Oz(e.lazy,t);throw new Error("Cannot figure out the data source type: "+JSON.stringify(e))}function Tz(e){return"lazy"in e}function Iz(e){return(e==null?void 0:e.type)=="axisTicks"}function Rz(e){return(e==null?void 0:e.type)=="axisGenome"}function Dz(e){return(e==null?void 0:e.type)=="indexedFasta"}function Bz(e){return(e==null?void 0:e.type)=="bigwig"}function Fz(e){return(e==null?void 0:e.type)=="bigbed"}function Pz(e){return(e==null?void 0:e.type)=="bam"}function Mz(e){return(e==null?void 0:e.type)=="gff3"}function Oz(e,t){if(Iz(e))return new vz(e,t);if(Rz(e))return new wz(e,t);if(Dz(e))return new xz(e,t);if(Bz(e))return new Az(e,t);if(Fz(e))return new Sz(e,t);if(Pz(e))return new _z(e,t);if(Mz(e))return new kz(e,t);throw new Error("Cannot figure out the data source type: "+JSON.stringify(e))}function Lz(e){const t=Object.keys(e).filter(r=>typeof r=="string"),n=new Function("source","return { "+t.map(r=>JSON.stringify(r)).map(r=>`${r}: source[${r}]`).join(`,
|
1639
|
-
`)+" };");return n.properties=t,n}class Jh extends at{get behavior(){return
|
1639
|
+
`)+" };");return n.properties=t,n}class Jh extends at{get behavior(){return gr}constructor(){super();const t=n=>{const r=Lz(n);this.handle=i=>this._propagate(r(i)),this.handle(n)};this.handle=t,this.beginBatch=n=>{HA(n)&&(this.handle=t),super.beginBatch(n)}}}function Nz(e){return"name"in e}class EE extends ms{constructor(n,r,i){super();Z(this,df,void 0);this.provider=i,this.params=n}get identifier(){return this.params.name}updateDynamicData(n){le(this,df,n),this.loadSynchronously()}loadSynchronously(){const n=P(this,df)??this.provider(this.params.name)??[];let r=i=>i;if(Array.isArray(n))n.length>0&&(r=vE(n[0]));else throw new Error(`Named data "${this.params.name}" is not an array!`);this.reset(),this.beginBatch({type:"file"});for(const i of n)this._propagate(r(i));this.complete()}async load(){this.loadSynchronously()}}df=new WeakMap;class SE{constructor(){this._dataSourcesByHost=new Map,this._collectorsByHost=new Map,this._observers=new Map}get dataSources(){return[...new Set(this._dataSourcesByHost.values()).values()]}get collectors(){return[...this._collectorsByHost.values()]}addObserver(t,n){let r=this._observers.get(n);r||(r=[],this._observers.set(n,r)),r.push(t)}_relayObserverCallback(t,n){const r=this._observers.get(n);if(r)for(const i of r)i(t)}addDataSource(t,n){this._dataSourcesByHost.set(n,t)}findDataSourceByKey(t){return this._dataSourcesByHost.get(t)}findNamedDataSource(t){let n,r=[];for(const[i,a]of this._dataSourcesByHost.entries())if(a instanceof EE&&t==a.identifier){if(n&&n!==a)throw new Error(`Found multiple instances of named data: ${t}. Data flow optimization is broken (it's a bug).`);n=a,r.push(i)}if(n)return{dataSource:n,hosts:r}}addCollector(t,n){this._collectorsByHost.set(n,t),t.observers.push(r=>this._relayObserverCallback(r,n))}findCollectorByKey(t){return this._collectorsByHost.get(t)}initialize(){for(const t of this.dataSources)t.visit(n=>n.initialize())}}function _E(e,t){const n=new Map,r=[];for(const i of e)n.set(i,{ref:i,children:[]});for(const i of n.values()){const a=n.get(t(i.ref));a?a.children.push(i):r.push(i)}return r}function CE(e,t,n){var i,a;const r=(i=t.preOrder)==null?void 0:i.call(t,e);if(r)return r;for(const o of n(e)){const s=CE(o,t,n);if(s==="stop")return s}return(a=t.postOrder)==null?void 0:a.call(t,e)}function kE(e,t){return CE(e,t,n=>n.children)}function TE(e,t){const n=[];let r;const i=t??new SE,a=[];function o(f,h=()=>{}){if(!r)throw h()||new Error("Cannot append data flow node, no parent exist!");return r.addChild(f),r=f,f}function s(f,h){return o(f,()=>new Error(`Cannot append a transform because no (inherited) data are available! ${h?JSON.stringify(h):""}`))}function c(f,h){for(const d of f){let p;try{p=uz(d,h)}catch(g){throw console.warn(g),new Error(`Cannot initialize "${d.type}" transform: ${g}`)}p.behavior&Li&&s(new Jh),s(p)}}const l=f=>{if(n.push(r),f.spec.data){const h=Nz(f.spec.data)?new EE(f.spec.data,f,f.context.getNamedDataFromProvider):AE(f.spec.data,f);r=h,i.addDataSource(h,f)}if(f.spec.transform&&c(f.spec.transform,f),f instanceof mt){if(!r)throw new Error(`A unit view (${f.getPathString()}) has no (inherited) data source`);const h=zz(f);if(h){a.push(h.rewrite);for(const p of h.transforms)s(p)}f.mark.isPickingParticipant()&&(s(new Jh),s(new mE({type:"identifier"})));const d=new Ol({type:"collect",groupby:f.getFacetFields(),sort:Uz(f,h==null?void 0:h.rewrittenEncoding)});o(d),i.addCollector(d,f)}},u=_E(e.getDescendants(),f=>f.dataParent);for(const f of u)kE(f,{preOrder:h=>l(h.ref),postOrder:()=>{r=n.pop()}});return a.forEach(f=>f()),i}function zz(e){var a;const t=[],n={},r=[];for(const[o,s]of Object.entries(e.getEncoding())){const c=o;wl(c)&&s3(s)&&r.push({channel:c,chromPosDef:s})}const i=Rc(r,o=>$a(o.channel),o=>o.chromPosDef.chrom);for(const[o,s]of i.entries())for(const[c,l]of s.entries()){const u=[],f=[],h=[];for(const{channel:d,chromPosDef:p}of l){const g=x=>x.replace(/[^A-Za-z0-9_]/g,""),b=["_linearized_",g(p.chrom),"_",g(p.pos)].join(""),v={...((a=e.spec.encoding)==null?void 0:a[d])??e.getEncoding()[d]??{},field:b};delete v.chrom,delete v.pos,!v.type&&p.type&&(v.type=p.type),n[d]=v,u.push(p.pos),h.push(p.offset??0),f.push(b)}t.push(new Jh),t.push(new hE({type:"linearizeGenomicCoordinate",channel:o,chrom:c,pos:u,offset:h,as:f},e))}return t.length?{transforms:t,rewrittenEncoding:n,rewrite:()=>{e.spec.encoding={...e.spec.encoding,...n},PA(e.mark,"encoding")}}:void 0}function Uz(e,t){var r;const n={...e.getEncoding(),...t}.x;if(rn(n)&&(r=e.getScaleResolution("x"))!=null&&r.isZoomable()){if(Ur(n))return{field:n.field};if(!vl(n))throw new Error("A zoomable x channel must be mapped to a field.")}}function $z(e,...t){let n=e;for(const a of t)n.addChild(a),n=a;let r;n instanceof Ol?r=n:(r=new Ol,n.addChild(r));let i;return e instanceof ms?i=async()=>(await e.load(),r.getData()):i=async()=>{throw new Error("The root node is not derived from DataSource!")},{dataSource:e,collector:r,loadAndCollect:i}}function IE(e,t=void 0){if(e.parent!==t)return!1;for(const n of e.children)if(!IE(n,e))return!1;return!0}function Ym(e,t=!1){if(e.behavior&Mm&&(t=!0),e instanceof Jh)if(t)t=!1;else{const n=e.children[0];e.excise(),n&&Ym(n,t);return}e.behavior&gr&&(t=!1);for(let n=0,r=e.children.length;n<r;n++)Ym(e.children[n],t||r>1)}function Hz(e){const t=[...e._dataSourcesByHost.entries()],n=new Map;for(const r of t){const i=r[1];i.identifier&&!n.has(i.identifier)&&n.set(i.identifier,i)}e._dataSourcesByHost.clear();for(let[r,i]of t){const a=n.get(i.identifier);a&&(a.adoptChildrenOf(i),i=a),e.addDataSource(i,r)}}function Gz(e){if(Ym(e),!IE(e))throw new Error("Encountered a bug! There's a problem in the data flow structure.")}function Vz(e){for(const t of e.dataSources)Gz(t);Hz(e)}function RE(e){const t=new Set;e.visit(n=>{for(const r of Object.values(n.resolutions.scale)){const i=r.name;if(i&&t.has(i))throw new Error(`The same scale name "${i}" occurs in multiple scale resolutions!`);t.add(i)}})}function jz(e){for(const t of ns){const n=e.getScaleResolution(t);n&&!n.name&&n.isZoomable()&&(n.name=`${t}_at_root`)}}function qz(e){const t=[];return e.visit(n=>{if(n instanceof mt){const r=n.getEncoding();for(const[i,a]of Object.entries(r))Ur(a)&&"type"in a&&t.push({view:n,channel:i,field:a.field,type:a.type});return YA}}),t}async function Wz(e,t,n){var o;if(!e.import.url)throw new Error("Cannot import, not an import spec: "+JSON.stringify(e));const r=Zc({baseURL:t}),i=e.import.url,a=JSON.parse(await r.load(i).catch(s=>{throw new Error(`Could not load imported view spec: ${i}
|
1640
1640
|
Reason: ${s.message}`)}));if(n.isViewSpec(a))return a.baseUrl=(o=i.match(/^[^?#]*\//))==null?void 0:o[0],a;throw new Error(`The imported spec "${i}" is not a view spec: ${JSON.stringify(e)}`)}function DE(e){const t=[];return e.visit(n=>{t.push(n)}),new Set([...YI(t,n=>n.length,n=>n.name)].filter(([n,r])=>r==1&&n!==void 0).map(([n,r])=>n))}const Yz=e=>!/^(layer|concat)\d+$/.test(e);function Zz(e){const t=e.getSize().addPadding(e.getOverhang()),n=r=>r.grow>0?void 0:r.px;return{width:n(t.width),height:n(t.height)}}function Vr(e){return()=>e}const rr=class rr{static create(t,n,r,i){return new rr(Vr(t),Vr(n),Vr(r),Vr(i))}_offset(t,n){const r=this["_"+t];if(n===0)return r;switch(typeof n){case"number":return()=>r()+n;case"function":return()=>r()+n();default:throw new Error("Not a number of function")}}_passThrough(t){return this._offset(t,0)}constructor(t,n,r,i){this._x=t,this._y=n,this._width=r,this._height=i}get x(){return this._x()}get y(){return this._y()}get width(){return this._width()}get height(){return this._height()}get x2(){return this._x()+this._width()}get y2(){return this._y()+this._height()}equals(t){return t?this===t||this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height:!1}modify(t){if(!Object.keys(t).length)return this;const n=r=>{const i=t[r];return typeof i=="number"?Vr(i):typeof i=="function"?i:this._passThrough(r)};return new rr(n("x"),n("y"),n("width"),n("height"))}translate(t,n){return t===0&&n===0?this:new rr(this._offset("x",t),this._offset("y",n),this._passThrough("width"),this._passThrough("height"))}translateBy(t){return this.translate(t.x,t.y)}expand(t,n=1){return t.left==0&&t.top==0&&t.right==0&&t.bottom==0?this:new rr(t.left?this._offset("x",-t.left*n):this._passThrough("x"),t.top?this._offset("y",-t.top*n):this._passThrough("y"),t.width?this._offset("width",t.width*n):this._passThrough("width"),t.height?this._offset("height",t.height*n):this._passThrough("height"))}shrink(t){return this.expand(t,-1)}intersect(t){return this===t||t==null?this:new rr(()=>Math.max(this.x,t.x),()=>Math.max(this.y,t.y),()=>Math.min(this.x2,t.x2)-Math.max(this.x,t.x),()=>Math.min(this.y2,t.y2)-Math.max(this.y,t.y))}union(t){return this===t||t==null?this:new rr(()=>Math.min(this.x,t.x),()=>Math.min(this.y,t.y),()=>Math.max(this.x2,t.x2)-Math.min(this.x,t.x),()=>Math.max(this.y2,t.y2)-Math.min(this.y,t.y))}isDefined(){return this.width>=0&&this.height>=0}flatten(){return new rr(Vr(this.x),Vr(this.y),Vr(this.width),Vr(this.height))}containsPoint(t,n){return t>=this.x&&t<this.x2&&n>=this.y&&n<this.y2}normalizePoint(t,n){return{x:(t-this.x)/this.width,y:(n-this.y)/this.height}}toString(){return`Rectangle: x: ${this.x}, y: ${this.y}, width: ${this.width}, height: ${this.height}`}toRoundedString(){return`Rectangle: x: ${Math.round(this.x)}, y: ${Math.round(this.y)}, width: ${Math.round(this.width)}, height: ${Math.round(this.height)}`}};ar(rr,"ZERO",rr.create(0,0,0,0));let Wn=rr;class BE{constructor(t){this.globalOptions=t}pushView(t,n){}popView(t){}renderMark(t,n){}}class FE extends BE{constructor(t,n){super(t),this.webGLHelper=n,this.buffer=[],this.coords=void 0,this.views=new Set}pushView(t,n){this.views.add(t),this.coords=n}renderMark(t,n){if(this.globalOptions.picking&&!t.isPickingParticipant())return;const r=t.render(n);r&&this.buffer.push({mark:t,callback:r,coords:this.coords,clipRect:n.clipRect})}render(){if(this.batch||this._buildBatch(),this.batch.length==0)return;const t=this.webGLHelper.gl,n=this.globalOptions.picking;t.bindFramebuffer(t.FRAMEBUFFER,n?this.webGLHelper._pickingBufferInfo.framebuffer:null),this.webGLHelper.clearAll();for(const r of this.views)r.onBeforeRender();for(const r of this.batch)r();n&&t.bindFramebuffer(t.FRAMEBUFFER,null)}_buildBatch(){this.batch=[];let t=!0,n=!0;const r=o=>()=>{t&&o()},i=o=>()=>{t&&n&&o()},a=Rc(this.buffer.reverse(),o=>o.mark);for(const[o,s]of[...a.entries()].reverse()){if(!o.isReady())continue;this.batch.push(()=>{t=o.unitView.getEffectiveOpacity()>0}),this.batch.push(...o.prepareRender(this.globalOptions).map(l=>r(l)));let c;for(const l of s){const u=l.coords;u.equals(c)||this.batch.push(r(()=>{n=o.setViewport(u,l.clipRect)})),this.batch.push(i(l.callback)),c=l.coords}}}}class Qz extends BE{constructor(...t){super({}),this.contexts=t}pushView(t,n){for(const r of this.contexts)r.pushView(t,n)}popView(t){for(const n of this.contexts)n.popView(t)}renderMark(t,n){for(const r of this.contexts)r.renderMark(t,n)}}class Xz{constructor(t,n){this.point=t,this.uiEvent=n,this.stopped=!1,this.target=void 0}stopPropagation(){this.stopped=!0}get type(){return this.uiEvent.type}}class Kz{constructor(t,n){this.x=t,this.y=n}equals(t){return t?t===this||t.x===this.x&&t.y===this.y:!1}}const Jz=e=>new Promise(t=>setTimeout(t,e));function ed(e){const t=e.requestAnimationFrame||window.requestAnimationFrame,n=e.signal,r=()=>new Promise((i,a)=>{if(n!=null&&n.aborted)return a("aborted");const o=performance.now(),s=o+(e.duration||1e3),c=typeof e.from=="number"?e.from:0,l=typeof e.to=="number"?e.to:1,u=e.easingFunction||(g=>g),f=g=>(g-o)/(s-o),h=g=>g*(l-c)+c,d=g=>Math.max(0,Math.min(1,g)),p=g=>{n!=null&&n.aborted?a("aborted"):(e.onUpdate(h(u(d(f(g))))),g<s?t(p):(e.onUpdate(h(u(1))),i()))};t(p)});return e.delay?n!=null&&n.aborted?Promise.reject("aborted"):Jz(e.delay).then(r):r()}class eU{constructor(t){this._renderCallback=t,this._renderRequested=!1,this._warn=!1,this.transitions=[]}requestTransition(t){this.cancelTransition(t),this.transitions.push(t),this.requestRender()}cancelTransition(t){const n=this.transitions.indexOf(t);n>=0&&this.transitions.splice(n,1)}requestRender(){this._renderRequested?this._warn&&console.warn("Render already requested!"):(this._renderRequested=!0,window.requestAnimationFrame(t=>{this._renderRequested=!1;const n=this.transitions;this.transitions=[];let r;for(;r=n.shift();)r(t);this._renderCallback(t)}))}transition(t){return ed({requestAnimationFrame:n=>this.requestTransition(n),...t})}}class tU{constructor(t){this.genomes=new Map,this.baseUrl=t}async initialize(t){const n=new SN(t);return this.genomes.set(n.name,n),Promise.all([...this.genomes.values()].map(r=>r.load(this.baseUrl)))}getGenome(t){if(!this.genomes.size)throw new Error("No genomes have been configured!");if(t){const n=this.genomes.get(t);if(!n)throw new Error(`No genome with the name ${t} has been configured!`);return n}else{if(this.genomes.size>1)throw new Error("Cannot pick a default genome! More than one have been configured!");return this.genomes.values().next().value}}}const nU="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAIAAAB7GkOtAAEFzklEQVR4AezcRXjr2BnG8b8SQ+gJOiA5d1NmZuZVuU133Zf3++6XxW27Ku7LzIzDrMgByxQGaxwfWVFGMly088z7e76Zi5bu6nvP+Y4sKwgC2n4KP4QfgEcvAVdZGHfuM++Fj8HHwUZERO6aMTocsMGhl4C7bbrzr7C5N0REFAC30nct7qwhdH8REQXAfKf7FrjTLPpJ7EPuMhERycB36XD+hX0/DuzSlsnw3OfyilcwAA/vn/yzQQMoUHg9r59hhn7Oz/njH9ncJAiAXNj9P2qTxdhARETufgDYNs4fsH/Cv2jL53nzm1lcZH2dngKCP/Gnn/LTEiXg+Tw/Q+btvJ1+/vlPfvYz/v1vEwA26w4fs8lm4R4GgIiIAmB5GdvGnmbuh9Rq8MIXcuMGpVJ6AFhEXNwneOI//OfnSz8fL49/jI+9lJcecjjJJD15Ho8+yo9/TKUCb7J5vY1tcw+JiOgMILYJcDpNuFQKq5+neMrFbRXLnI+fu7im6KlSCS9fqXDBccLb31siIgqARBOu1SiV8DzKZbpr0nRxWxnQqs8tv51lol/2Xf63qlS6euOpKYZIREQ7ANOHTYdu1SDL/wMOlguFlxW+Hf8dujMX9ryrNx4KEREFgGXd9BQoWu97S0vLbU36T4EOD6NwGf78R0REAZBoxWaJ3qqDA9Kcx3p9YXW1sLLSCoBM5jIV+i7/gwCWl8Nbzs0xLCIiCgDbDiub7b8JMF3exT3kMOM4a3bLmuNczoX22ScpPluK33KIREQUALmc2QS0KjGqT3BxzWKf2VmKhl0sEhD0ngKZS5ZKOgAQERmVAEg05KhVBwFXnXJ62eWLRYoGrRofv8yGHsv/gwOYmwtvtryMiIgMLQCSxwCHh92mQNGg/4gjEwCTxRZMRdOhPfbSl/86/hURGbUAmJ4eaAoULf/N/OeibDsKgPhf0AOgIiLXIQASbTn+la3ICSfRSS+xru84YY2NpU+BqtXwYr4PU1PaAYiIjFoAxNpy9NKGajV5/HvMcTwApqYuf2X+govboJG+/I82GiIiMiIBsLAQdualpStfCIg/AJqc/9DWewqUfABUy38RkREKgPjpbKJtc8xxdAIc7/dXAyBlCnR8HIuSbFYHACIioxgA6e+EODqKr+tPOU0GQHwKtMmm2SvUqcdzpNmM3SCXQ0RERicAVlbCFj07C81m/CjYrP1T5z/pUyArnALFJ0k6/hURGdEASL4XyNQRR2b5n5z/9JsCRdfQA6AiIqMdAClTIM+Ljn/POEsGQHIK5BF+ZGurZpb/+/uxS09PIyIiIxgApiYnYX/fjIDcrc7x79xc6vyn27NArY/qBXAiItcjAMbGnrkJOLzo4rH3/6yvR8v/vlMgz3tKb4AQEbkWAZBo1Ftb3vb25s6mi3vOeXyRn2S+5GuqRMk9cLd2Wp9u7O5CoRBedH4eEREZzQCIdgCZDJTLZd/f8Xe2m9u95z/JKdB2dXunsuP7uzr+FRG5HgGQz8fadbPpV6t+zW9VvLv3DQDLotwol+vlet2/HvMfEREFQLxdW1Cp16v1amWx0jMArOitotHf8hu+v+c3Gj5zc+HllpcREZFRDoD4AzvVWq1Sq1zOf9bW6CkKgPLr/Uqj0njkA/HLiYjIsGQYwMxMuAlYW+Oz//8/X/4/L3lJcvlvQdBrChR896vf1QHAdSIi2gEkm/Yg85/kFOjC5KQOAERERkEGPjT4McC6w/rfYQ6KS93nPx9K3QS8ulVPgdMJE8tCRESGGgAbDGBhAcdhw4YlWIUiqcv/b8Gn2UgNgI0iWGB3MkBERIYdAJ9iMO8Je3e7iu1Klbjg9HS7+5syV3AsRERk2AGQZzB52/TudhVhjVSpF8ybT0X5kUNERIZrjMGtJpb/gyuaCiPk+hARUQAYzq0GwMzVEZCIiAybFQQBIiLyrN4BiIiIAqAK34T3wxp8CX7N0+zZAQYCQRzF4bfMAQroCKETRMfYvWRHqFt0kI4wkaaQDQQ7+33mDPPz9wBwAQAgAAAIAAALU3KeWwEu+dglp7yNATqEADT35Np+/zGNAHQOEIDWgFsyBQAbAAACAIAAACAAAAgAAAIAgAAAIAAACAAAAgCAAAAgAAAIAAACAIAAACAAAAgAAAIAgAAAIAAAAgCAAAAgAAAIAAACAIAAACAAAAgAAH8iAAAIAAACAIAAACAAAAgAAAIAgAAAULLPD9v0CYCSKXOO6RYAJaPff40ASg75tnm+5QLACAyAAAAgAAAMtdasBAAuAADKkJcHO3eZ3Uh2wFH8GtRkZmb2kXrCWUNWHGbmxAwyW2RmtpXSyOrwfJ9X93f+ghW8K6xZSP3LRvgvf4bvw/fgl7wq8iUlSaqlYgn2P62SgWYqcjBXWSAkyQBUXMCv/ysDST73d5j7/P6csEiSAajYgcy/LzWX7Z3rZQ5WkCSFGICKJ/jrp/cBh4f7f/9xam4q9ffUe94jSQo2ABWH8BPIzM9n5uYyf9/KHGe+zbd76UWSFG4AKtLp1YWF/dLOjjiqp94AxIAkA/D8zNISi4vXCwtn1L/hTTTCJ0n+EWx1lZWVaIn9wgwz0aaYInCSZACKRdbXWVtjdXWSySmmppnuppvASZIB2NxkY4N0mkJhnPFok0wSPkkyAFtbpW1ujjASbYyxDjoInCQZgNNTdnfZ2WFvb4ihYYajIUkKPwCZTGn7+3XU9dM/wMAgg4RPkgxAPk8uRzbbQ08vvX30VVNN4CTJANzfc3BAoRCtm+7yCJ8kGYCjo9dBO+0ddHTSSfgkyQCcnXF6yslJE01ttEXzGnDxIMkAXFxwfh6tmeZoLbQgKRZkAK6uymugIVojjUiKBRmA29vSbm4+8KGOumhIkmIRgLu70u7v3/O+PCRJ4Qfg8fF1kCDhJaAlKTYBeH7m5aV0D7XU1lATDUlS+AEoFl9XQhVV0ZAkhR+AqqrSqquBIsUXXqIhSQo/ALW1pdXUAE88lYckKRYBSCR484aqqgceykOSFH4AIu/elXfL7Q030ZAkxSIAHz6UVld3xdU119E9kqRYBKC+noaGaJdcXnARDUlSLALQ1FRac/MZZ6ecnnCCJCkWAWhpobU12jXXxxxHO+ccSVL4AWhvL62jg0TigIPykCSFH4Dqarq6SuvuLlDIkcuSRZIUfgAiPT309tLXlyWbIRPNH4NKUjwC0NdHfz8DA0+Jqj32dtndYQdJUvgB+PCBwUGGhhgZ2WFnm+1oSJLCD0BkZITR0Wh58ptspknbgHiQZAD6+hgfZ2KC4eE06XXW11hDkhR+ACITE0xOMj29xdYqqyuspEkjSbEXgwAMDzMzU9rU1DLLUQCiEiBJCkItX2x2lu3tod3d5P5d63XrW94iKQ5kAJp6elKpVDKTSWbbkr9Nfo2vETxJMgDJ8j5+TGXzyVxyND/KFpKkkAPQD0lIlQPw7l3qs+8k8glylHaHJCnAANR/OvcrTzqAkQQfeQ3AHwiNJBmAmX8596NN8C8+g1xlewRCkgxAz3+98H/Hv6v7lwbk4ZEvNUlSVbFYRJLkH8FiQpL0D/buAqqtNd/7+DcUSQrBQ4TgGg6NNEyZqZ13pvJed3dZet3d71123WXZdR13OX7OSIVOE6BKC6USCMGC9oS2+z6bTUIoFkrP9Ib+P+u3Uk+C/X/7efZOycHEanzwy/Aq643CS/Cn8MPQBQWk6YU/htNg2jTrmDZJDnwV/Cn087TNwz/B14Ips9TBL8I5duwe/AUcA9Nq/o8TQshVQL3gTMaDIQF9azPKWl6IwdhywuxOIJlOstZ0MkIIkT0FkN4BLihhcO3ov8Im/DAGseVEeFK1cDBZAFksnowQQmRVAYxAL7iYck71Hy9Ln/4zbK7C6IBkHrBzFggkUyoFIIQQz+KVwL30O/v7nH19rnf1NTf3wTCbej9JHoi9SSzKGPRgcOI8ylEUE2g8JhxmYABNS9v8cQd4TwvLvp2thMPh4eHhRCJRWVnZ0dFRVVW11bMzzMOn2Lk6OISy7dOKRLhy5cHUVDw/P15XN+PzIYQQWVQAceJfevClvl41/Qf6XAV91dUPLRYyKQDF72fsc3pi00ZpBAlasfrwsYYJuHWLM2d4/XUePgRaqQpwOkAgkMmkPXPmzJtvvnn58uXFxcWampqxsbETJ05UVFRsUwBP0gF1y2H7Ahgf54031DObHh2dtlimOztZWqKri2whhJACGGDgLd46c+dMX99CzO2mtpaurkwLoLiYQIBYjLHPqhooX7TkkefE6cBhx06ahQVCIT3nzjE4VaaP/oMHCQQwm9nO1NSUGv2qA954443p6Wmv15ubm+t2uw8fPszjPsJ68+Rt3QGvwImlJZRaqCNDg4P09vLaa/H+/nh5eXxxEaeTjg727ycrCCGkAAoosGBZYCHW309dHfX1NDRQUUGGmpqW1wFjxGKTX/ximLADhxPnKU6RJhRayeAgvC9AYDk1NWRgZmZmYmLi7t27k5OTwMDAgN/vV02AYbvD9dIt1hYaXISX4FTsP15+qVqrLqGkkEIysbDAzAyjo3FNi09MxCMRxseZnpYCyBpCSAG00OLBM8jgzbmbsStXaGykuZnDh8lcIKAKwMilG5ecOI1FwAEOsOzmzdUCwOslEFhJZgoKCvbv319SUsIytftfVFRksVi2LoBtpr+G7hb0xLjwMhcufFlr76LLi7eRRjJhtVJeTk3N9NTUtM2maoDsIoSQAjBjbqf9Bjeucz129TwtLQwM0N6uT7cMmc3GRpCesbHwzMoiQKWSytnZ1el/v8xJILn5kzGHw9HS0hIMBvPy8hYWFurq6jo7OxsaGmC9byJNof7rdTRWxOP0vKRGv4pjMu8UXUGCKhYsmS59vF4WF+NtbfEy0/TgJIWF2XT4L4SQAlBaaW2hpZnmy4nLUzduoDI4mGkBGGprjY0gldgbb4QJG4uAE5xITf/he7nGWV89Nhs7cejQoZycnKampkQiYbPZVAHU19fzBDRW9fSo0W+6cKHg5t2TnDSmfzXVZKi0lBdfnKiqmpy8MW39UOLf7Nhs+m9mESGEFEAeeU00NdLYQMPUzesMDenx+cjLI2Ppi4C+K31GATivO0OhDqMAjAN/PR4PO1RaWnry5MmpqamlpSX18/z8/N1O/y9/WY1+lhPkPcb076STHamqGqgaHGLobnCUr+uipobsIoSQAlDqqVepo+7i3EVteJjbt7lzh8bGHczVffvw+03GyYBYLDwediaczj5VAI5QiCV3g7H5o6nbJBM7U1ZWxhPTSDGpektOf4/WHiRohB0aNA320nul8sr1/++hrY2mJrKOEEL+N9ASSmqoceOuppq7d/Xcu8d2ND1pnE413zW//77fHyUajoTDw+Fr13rvThfNqd9fDlbrun/+DvskaBhMKtPTqenvmMw3Rn8XXfvZzxZMjydqip7hTE9uT+jg3H2fj85OSkrIOkIIKQBFjX4VFy599I+M6HnwgHW0tKxnXORzMRD4XZ8v3BgOR8PRaPg3Dx4MGZs/DQ1b3OHTVwg/lD7Adcnpr2/9p6a/C9dOn9YII5fyLvUcuT7Y3U1XF14vQgiRjVtAyuoLuJaWiEaNnRycTnZoqCkQahxTsQyM1X506LW8Xw4H/r8jUG4PlDfzDJhYs/W/UgA9PUEOd9Gl8gIvkKKRIVepy9ftm+vOzTl8+ILqgOwlhJACsGK1YVMpoSQ+Po7KxMROC2B+nlCoIhQKhEK/0fhXFY7PePI/E1G/sh+02/PsDhxFFD2b0a8MDaWmvwdPV/K6TwwaO+CiqrvqePfxfd1VOd3dORbLebKWEEIKQKmgQqWc8vjkJFNTKlvOVY11QiEjnqGhoZPek46I93ok4vyhL4S0kB27ylGOZnp/O2dic9PTqenvnDJ3pV/1r5Hyd/DtUMmWmqFbj6PbceyQIweMnCVrCSGkAMooK6VUhfh14nFmZnY0bwcGCIW4eFG/7aCj09tZH/E6IhFGRsKmsAOHscXUQgtfecnpbx6MBJNX/bs0F2neC9/BdrzQnUwnVXAMcpL5EtlJCCEFUEyxFasK8/PMzel59IicHDKgyiIUWknR2xV+/P58f8DrNc4nJyKR0P2VRYADhxUrOxePx43XAeTm5rITxta/8cqvIEf06a8F07f+Tej+H9v1XXdaGjFUru2AL5CFhBBSAIUUGkFZWFhJURHbW53+d+5wAr9f8/vxO+rr8XqJRFTunDsXYqUDjnGMnZidne3p6RkcHEwkElVVVZ2dnW1tbWRoaCg1/TvoCGorV/6wI4Vrp7+DdOXrOuARWUUIIQVgwaJixozy9ttGMimAq1dXC+AABwIE/Ph9+ACjAIyE765uBLXSSsbOnj376quv9vb2Liws1NfXT05OWiyW2tpatjU9TU+PMf2dk2Zj9KuYMe/s9WhzbK0UvlZPdhJCSAHkkptPvooJk7a0hJHtTE6ubv1XPLD78RvBUFi40gEjI0sjnwk9XN0IKqaYDESj0YGBgQsXLrz00kuapjU1NVmt1paWlkwKwBj9Kub/iATPnlw+99vq5DYqm47+JqgkpRshxN4nBaDsY5+KaoKlhw9RefQo882fkYjpNH7j8N+GjZSWFqMA1O3dixfDhI0OOM5xMnD//v25ubmpqSk1/YGRkZGZmRm1FGBbly+nLvwPvv9IF21BbndsNfqVpuUgBfDcEUIKwIRJBUXTkrdbuXRptQACyWP/tPOrST6fUQAqoWjIWAGoZLIRVFRUVFZW5nK5SkpK4vF4c3OzzWZTP89k7cCtW/T1AV3vvxNEBRNbaIQmHvPHPBeEEFIAj3ikoqGRk4PJpOdxx0mKxVZ2fhZDHIdmmo0CYL3S0pWNoGj0wcJCiFl78oRwCSVsqaKioqOjY3x8vLi4eHFx0e12BwKB1tZWtnhmBk3T35q2Jdq4yO2L8EdwfOsCeG4JIaQAHvDACPv2Gdniu26FQkyHOKQSXbmKNEiwjDI21NHB+DgWCw8f3oMw2BmzE3qRF9nO4cOHLRZLe3t7IpGorKz0eDxqEZDRN4Ts1COE2IaQAkiQMIKSn29kszEbDeMN6aEPgxnzNofzx4/j8RjnFUJgB4eeaBt2thNYpmmayWTCsG0BvKBHCLE9IQWwwMIiiyooZvNKHmdHGcUeAiM7kjxyf2h0QDKlZGSL6a/YN/+1EEKIHDY3x5zKPPPk5LB/vx6LhfUewcXk9J/giUUgvJwQz5QQQsgKYIYZI1itKpu+BCyUzGV2Z3UR4IB2nhEhhJACmGRyiikVSkspKdGzoYPL+VUypPGsvG85f48QQmxNtoDGGZ9gYpJJystXIoTY84QUwDjjY4ypLLCAzaanogIhxJ4npABGGBllVIWiIhwOqqqorEQIsecJKYC73L3HvQgRqqtxOnG5EELseUIKYJTR29y+w50YMWpqVPQaEELseUIKYIihW9xSwWajvp66OimAvU8IIQUQJ36Tm4MMqhqgqYmGBr0DhBB7npACuMa161wfYOB+qZnmZhW9BoQQe5uQAhhn/CpXjQ6gvZ22NlpbsVgQQuxtQgpgmGFVAFe4Mu+w0tGBx6PXgBBCiD0nd92vc61Y22lf6rRffeEFvQPMZoQQe56QAvDhS5BwdDjc3v6aAwf6PZ4RhBB7nZACMLyr7F01vhq3113j9dZAH/TDIkKIvU5IAeDD4XU4fI4aOzXghhroh+sIIfYwIQXQBl7wgZd2cCcLwGiCfhhDCLH3CCmAYvAlk4NSBO82pn/aUqAPEggh9hIhBeBLHv67SFe9nJq0JugnuwkhhDBpmoYQQgh5IVgaIYQQUgCmjXIY/gzukrke+C3wg2mzZPK4Rk7BX8Ntnoj6Z38C74Zq+Bn4ArtzAX4FmsCUWerhF+EcG/hx+Ev4LAyzVlR/ezme8WPkwnfDh8lEDP4W3gsm6ITfhStsYhT+Kvk0fPAHG1wcZnraqYDvYnMP4b/gW1P/4ImfzPNg03eWKS1e+H24yjv1kX0P/N7az/8p+Hf4Xih9Sg+RbgD+GI7tfuyY4TvhP2CerX0GfhSsO3zOJ+EfYIrtDcMfwaHN7+o74P1PswA0NpCHkcw1QSN69rE7juQd1bIXzKx+NXwCPZ9Ev30ZvV7FQT3iK8eMkXeEGw5Ap367qgw6wKPfPn31yVif1h0V7uHLQDOXb4TNGIe6Q2s/zKkOGGAXjLtoIOvNw1W4podDxtpEzw0Y0G/1tOnB9RxP/6CejGmIXb6zLO9kAaSmv4U1OvRZwS39llGepjxoSKaXXUjdC89hAWjrVkp5WxWACQrAt9HoblLZTQFYocHoALLY4iLXrnHNz7VkB/wuKUMqRg3oMWog2gZ27DxP6iG4ixWACfGEKwCLyjs5/Vt4XAF0ZFYAuzh230UBOJN34XwuCyC9A85zfphhLV8jj2/Me6wCvj31hefTk/L+1BWljZ+lcQZ3an+juJiuLioq2FyceA89k0ymHf43UNCVesiNvX/TMwBnSeOCI2zo28egiqcskdBHv8rVWq6BUQCzrHdjNUYNfLKNNpVKKslIxu+XGLzOWp3gSXtHvD91CuCt9S8cpzX1gcjU6CiRCBMTzM+ztERODmYzJSU4HNTVkZcHFCdHfxDKSDmzflf7/OrEN9VR58CBMjvL8DDRqPqJ/hC5uRQVYbfrnzlWK7szPj5+7969iYmJ2dnZJXXnUFBQYLVabTab2+0uUW/IU6Ge/L17q++lffvYv5/yclwu3G629b/sfQdYFGnW9SmBJgoNKJIzggKCIKLojDppZ76dmY3On3POOeecc845rRu+71t3djbNrI6ZIAgiUTI0OTTdQHdD/ef1LmUrdFMdGNedPs996oEOVV1vOOfe+4Zqxs6yaoNAFTnPwfIg1FWGh9WFNjZgscQdOhRXWhrH9wLCzAzGxiC/1uN5+muzspCXByBV2F/Z7qgAhrzMgDotG8ziIpxOSGtJTMShQ8jPR0aGmaaeDhR+jMJ5FBija/x6Y6P6hb4xh7lWtK5gxUtDqoEKo7X7JpmPADuCxBtP2/tlX5cYAe5hb1ze8WeIKSAdE9rEXdz9FJ9SAC5b2FrghW8Y7J8niwp2I53iYhT/KorvbgsAa5Ed/rXX4Bud6PwxfjyIQRwQAfglnmWvW8P3LuOLAD7wqwHZu39f3cm/Um+FE5ub29Tfg94F9OYr6l+Cf/Q+jQOc/bjaj/4KVFAGUpEaugD40IBKoMq7LOQru2nACW+Vv2yS1B4+RH8/ezV5VLGzIQCpqYraSkpw7BjNSP6U7PXjh7e57gAOnMGZ9/T3LO0PtUePMDiIqSksL4sA0NVQ5y8rQ02N2uY2KJD0u7q6BgYGRkdHZ2dnKQAbGxuaplEAyPtHjhwpKCg4evRoVVVVIkkqaHiX0uwsVldFAIT4yKfqLqqqeDuB1vPgtgbwZPX1eP99WDqacf8+r6Uuur7OO4nLzIyraow98XVZELo3WInt7WzVSnEpA/y1IgD8tXTs+GtZp5WVVfn5wv5+/BcjCOBRB9SvYn8ZGnrOXRAtJwnwtLwNEsieRVBYiMIOFN7eFoCKCvXzTp+Gb3Sg44f44RjGkMDvR6PwS+osgG8BCF0DXofArwAYrd4E+4dXAACn7lzRVvpi+o7HtHsVu+4ddEcbS8p8CQCtC12/ioUF4L33VIcnF7Bl7wYq8BCGBjDwK/gVd3EBit5X36dnYRLkL82HBvhgfx3hh/C+lwA0YR4msQU8gsQBN1kONEMGkpEctAD40IBKmt+vGBpwQllA4I03N6OjA2RnupxknJWVGDegwZ1ggZDF0aPkkRNzc/VnztTFxNTtqE5fveEeUKqXFtmLlu9cO9zaigcP0NeH8XFtYUEXAbBaVXhByiCV8BXKQGAgHfU3Nzd3dHT09PQMDQ1NT08vLy9vbm7qum6xWKxWa1ZWVnFx8fHjxycnJxsbG7MNgg6xlPhrLRZsbdGHIPGRhlSXobadOcOYMMB6Fg2g36Xn5GDp/t2M69e1O3fQ2cmyYmYyPi4hvvhy/Hg8pgAbVA3n7CGJuHED9+6hq0u1TZstcWXD4rFsRm3akzQ9I4NlTrYtHh+vbmiorq2thj8UAMdEAFZXH7ISqSvd3eq0/G2GEFIARMt57xQGvnjhAjVgbwGgkdR/BUvuRH5eyVVtrSrY3TCPeeY52NG+i++i8Liw/y574/8AvnAA30/GajDs77seTWvA5f0aBHbB5dJdriSXxcJGv3vK1WD/UuwCegZ0CEQGlABQ3mmPH/sSAHk8PT/khlu+pqJ4c/itUKXn0APPB18Mn/svXgzN0ICZeAQON9ClZEAFATSRAWoAlSDxpZiXwBu/fh23bqGlhe5tNrKLUJGBjAQkQIfT4Zx2TA+PDk0ODuZOT9fZ7XVud/3581HP989x+ADfyF7NdnzqcNz8acadO8XD9/PyFtOaVE93uehgeAYH56Za58hQ6v/4eOoNkyABsf/169dv3brV0tLCIIDkTk//0KFD8fHxFACn0zkzM/P48eNHjx6NjY0tLCwwMrhw4QIlIWD2v3ZNlRLpj8THSOWVV+jukHoU+y8vq5iABcjj0pJytC0Wn91hGH6YIzOTxdC30dys8VrXr6csbCYiFUhdX1+P646Lm4qDDZiCshPAKewOXVdaRQH49FP+4DJPUSkaWaexiKUuUh0nlice93cuDg1Vzc5WOzerPalRpwpA+A8C5ueHbt0aunvX2dZGIU+YWGS3z0R9EpKiEOXcck4tTfUs9ayTGFggBAMCaqE/UDVYTmIMeByK/fl1HhlL+aYdagAA45vmmVYLH3/gLeyKVL7zmY0BkKolCnOvrrqI/+qy/OiqxZKIjjS6JGxNBsFmP91NzifI4aIBdBrWhf15rK7e9dmTpH4xJhNZB/wa/cRABwN1UxrgFchcQOjgfXnzPs06tUbKPoqjWcgKzHmXaPrEifXY2I6+voHR74kA8EiTsYF4xOPnFnTfSFu3b5NrWJn1qD+Jk/zNLAf2agCrWJ3EJO+ly9Z16JPoeldaPXIOw4Lz4MEkHLcdzptLjuvX34y/efw9nS2FTkVsLBMbpH02NvIqo4IJUpX40eYFgEl/+v5k/2vXrg0ODp4+ffrkyZNlZWWZmZkJKo9MN3SVXj8jg9bW1rt3766trR04cIBZoLfeeovZoQCGRuhK81dSA1ZW8MYbOHkSpaXMdLNrUADYAdmo+LPVZ27eVPfGvBm5nO8GiA2Fzo3u9uzm5qqFU3nIk4pgwE1/Im4xToWDU9t2yreoM3Rgzd69ywo9h3NVqMpBDpuiB54FLIxilK20d7C32lFa7a4u2CzAJtAIP8iYxfEbg0M3W4ZvfdzS3Hzcc7QK58pQlotcdhkKAJsKeZlXue68bmfskpLCaIC0sNd4gKpwMQZXW6R+mg8B2MSmvE0NYGnL13Y//+V9Zn8fSew0efmzEAC2ue5u+j8Shbnsdhex6YqJuxLznSSyEkufvMwoj7Ge5sX+KfAFCrZoAI2+oAOGBtDf2cH+IsVsTCg+JxFAqHPeNB/vhHHuCBvPs9SfMm4n7wtT8w/x3GEeLLJz59jbmSHh2Ry9vW2UgbEBkQGaIQMWWBB+6CGWC6uZ3Y7My1omU1zAhbM4ewIn8pEfhzgA61gnWXSjm/08ai2q7kYd7wUC0xpAAXDcufPXs2+91aAzwcPiIDdaLCQ7XlY1VZdLJVSWWWCDg6qOFhdVkZoAXf729nb6/mT/hoYGuvZnz56trq7mkG8cfXPA4XCMjIzk5+dTD9g/Hjx4IGPCOTk5dXV1MAlqFJMe5FP2tbfeUpmNs2dVrt9qNWYQqM5IyqMYfPQRi1Qy7EGks1yufper19Xd/frEa6dwqhSlVlh16MtY1qDxXxC92wLwF3yFXeMsWTbIdKSzWl/BK01oYg0CkDpl/+1BTzWq82x5VderFPuLNfleaXgTx24eG7o5NHJvJAUJbCQ1qOGgEDmY414UAP5CthM2G2rVp85PeXWVEBsd3UsAWIqGBpBvxiUI2DX5TMIR4yVQeALynV3xBV+v/SdlAePfmdGYVHntsxCAvj42R0ZhJDJJR7pWVtxs4B6PJf7Kr0lOth06pFEhqaJsB7W1NQ0NNVFRNdib20jjYmQGcfF3FQBJ/tCY9fOd/zEXBPhgMx1hxfi4wftiySOLivFxwVsAVN4jUOTn0ygALG0aq2alt7e5t7d/QrE/zVsG2E/CxvyhY2aGIsWMNr1FzmStRe1pnKYGHMZhbIP9mcXCO6RXAKByvRI3QASkARv/em3sUuWFV/7q2bOv0HXeBsc1lX+ytqa6PPmTHMsEOhszO78ZAWBuh/kfevednZ3M/NTW1jK/f/HixVSv79LZZ+o/OTmZKRQODnOImJpRWFjINFFlZaWpIGBignXKUuJPZKjH3qSmqZw/D29Qzfi6283fxG7Bz1PJ2DEDFwCK4sDG6OBf6c95A+dexatkWJ+rFG/AJ5aW6CCyJA+hjMEcG56wv1GnPC21ZA5zVJf4uXhc3xYAD3Bux4rQSbK/soM3D9a01Gxgg84+2wMFIBOZRlOkDHCof1abZYNnSn+F5Sa1aQJeAqC8NNGAnQJguP9qwpjxHdP4CG9fAb4B2AMhqNcVrf+eD7BjdkcyfLyw3wIgSVuG7a2t5Gm2cSZh3IWF7vj4xNH45ssrhy8vHaqf4lsSHxyZnz+xulpz7twJEwEp1drgcw6nSRBAGSfHeY/DCPurmiiuheR/LJYwerR6GKeOsxU+O9KbNDSr6BjnvKk/xHy9lJoIAI/Ug6Xe3juUgcmnMmAMEePnBOPK21I1CfDX84fRJfRmf2/K4FsQrD9LPa9hT5wBzh7G+WqcOLlLZdNXZkCgOrsw18qKMhNgTp/ePfP7zPUXFRXJJB/F/jvAgIAywDlC/Fh3dzcHivlFfr20tNTMZVQpsRdI0plKz/Hq3cCmRJ3gxdgxlWzYbIYbax4D9q/8OLHh3W+/W/9KPWk6mC6g6zIuzSNzJh541rCGHYhBDLUBgkVANMADdbzk3Ugg7K8q/T7YgDlKRA1gO9nphdC/ydKzOB86TUtbWR6G1KbHo4b6/aKgQJL5KhyclzEAGQr2+iJpR9x/hqQorBb29znR6Ns+JADOYOnk0lMJ+OoLXAdAF6O5mXlGagB5mblIOlFkZ1damivhkeVfnHvNsgLLwoQ+MaANPHr8aGbmxyfsjhpX/Ak9K+18JeLNUhmNzCApIB55iZ2BGAeOTbj/Wz5e8IFNIA9be330gNef/srK4H2h/gHbUdWDG71zPirHGi6QUGjbMkCb7+u7SRmYUuzvPVOIn8MLx/S0TPzXoDF1SzefdQkzEA0wLQBnoeyED8GnM8d0vTgnWF+nDwyXy1wAM2Oz2Tjxn2l9RgBkefK7b4op4Ac49ksB4KgAv8iv7xSAsV1bEUuJhH74MD0t5OQg3Qk4oe24lWQoArNalU+2sMBEFhnQWwDysDeYpqdzzZZJ9g8y26dpqjSTkmgTqxN96LuN29QAnpZxwAFf/WVFNOBZARjdpn4eOyBI1pPhG3SkeAtxehw0sCrFyOMmgwBW4HyLHYYGlJTsdP99DP+anKLzPcCJgHERghcuAHQxjKQtLl1CUxPDUlKw6/CUK7HD8u9+v8Uy8K5ljiXVp/cVaoXdq90112tObJ2oRCUkZo/fuyaMoeDp7SwQryJTPN1wG8O/Qv08+gjYfUwQ/D5g3z0LJMiGfGdM2W56/ZrXOjAfO5LNAz0Y68WHvXikNODUXzloTS/MPHymOK/46CHF+7SDOLgfGRfyvmHrfX3D5eVkqbn5+T+8cLV/QGTAXY7S8he7aNrtJj2RpGhpirfS6dNJ3t+8BpjEnwZ0v3x14IAy8V7FTPx899LSEmf18JiWlkbHPz09nZM+fYe2GfwAPymLBhYXF/nFvRur0wkpJYeD7K/IPe0B8ACaj2xmLC1WuaX8PL9LPfPCn8DeSEbeYeTnoIBMGvyIT2amLEpYu3//Jm4y6c9Z8+RLOu80iv3uSuCA0gCPd3oTyn7dnmkSFXKsremkes2jHdg8oG1pJmrT51CwW1JAXgKwhS1j/g/FXD7qb5nqd+EbVxMD04BLPzcrgdkW6YzTm2R6p7paLZfgeNSZM8yIufAtl+aKOeWKiclJseS8hxMckOEUguM4XugurLlRA4E5DTCmA01P60YQIAJgDP/aYUdx047hX3Na/JE/DTjD7/hlf4FvAXACo4Yld43GPx79+jffsXJuYEZGQVHB0fLC5PJCHDqI/cRGwdG+jbLejb4B9+NJi23u4MJU0p+MH4hPQGY8QEuAsswXuOkFGYo8BXDkg3RjREL7oQFSxWEE53c6ngAAB3iZ60+iz+sbMvmHnyQ4NYhf5BmwA38Sz6Bxfd0oJeXXJ32CPwDcAzQfYekPobC8rMKFzU1aoAIA5AnvhjTqL+vRGLt4PDOdnd/H9xkHMMIzBIB/k0F3yXyuKw0wB413abNRTRUtra6ynLSNDd0jSaQtBAjvrD4ZblQiAAZSQjtC/TwuYxmFtXtn/y/DF74ugvJSbgUh0ej4OEWV96+82Lo6lhwbGtnfBZfFsmWxaDExugaNLn+BXsAxGTp3ye5k3IBpDRBWl7lAWPGaD0rvxhj+lTleyhgU+8PH2A2Wj2AxOqCRXfuHUNzvxOX/9vF/+29YAmCFNy7ADBKAk0ApUFaF0hiU0hX/X9/u+ST9WlpWlsa+QQXt62PpMRskEXrYN5Xg6Xt7edR6e8v7+spHR+3Rs9Vvud6qiFJjABVIKQdywjkcrAUTAdBcLkkHW2ChIVCsA3gxGuB5AtnvIWYb8AvjY6R+fpHgpPgopjF94y4ZXAycHnvg8oOCywUoK4BP/Aco8ENEfHxQA2M/Af6wtI7gNcBqpXfIMlK0mpvL/jo4OjroHGRyRtx/SfeRIupQ93zez7P3Nk7kA5rsBDE7qwTAbldCycXXbverm5uXgiJYbwGAsSDAEADRAJkzFLQAfA0GXkYBYDFTdhmQxsWxIEheEgSR+tmbeVSdWJn0NdCno0HgftZfexO+QZ5/OhLQ3m43pgPZKqzy1wQmUHxe8j9BTJeN3fmqDoxKtNBx9YMx4N2rwLmQRn8P1uNUCRT7M+FO+93zvT3zPb29VzfZvkj9chQZYDHukfzRTJKqUL/3MX4+t0KR/rsyx5RHdr+ft/mgenDkXB3CpK/wIbjH52maUWKm8lOeDzybqN7EMbNlLVQVzKStvDDUNvsmQ5bMTNX2SaNk68nJtampgcnJgZWBFKTQ/WcvZhyvQWN2yOTGfeT6tjaVHGbvGR3lKemUpi5a0u3JybwceanroOVK1P1vRCEIUKoksX/kCKaNuUC1tQvaorj/PBruv1SKT/wSduJtAC+1AIgzQmH3Tq6JAIgGbAuAj7birQFvmh0KZmV7toOA4YpUkWKkpJie/Xl5J/tf9pli71ACQO7/b/HUgNCJzQprIxpLvWSgzN3b09XT23cVO2UgLS0Eh3QX6o+Zy6reJn05eve0F6wBMTE0aStsOeJABLyXYwOAF6MB4stL0l9CAddeQ8fubTAdxC/y6+L+7+EKiQEbX9tgMn0NJUCtmbLWQ9psWzdf23nAmK8pfa+/ruZwk6qZNpiaImGr0ezBweXu7ubF5iUsUdzSkEaPhBN49mT/hQW1Eu7uXTqFaixyNKFCdf+abHqiMvStx8U9ZI1EDyGqH98JKQiYvrtkzAcdLloU9n9m3fAvNKL9d1rGWqo2pqdZo0zFiADQkrwFwLcGmEFqqqEBpLMpsr/z8eOh8bShXBn+PSbuv/o9e+CNPf7XvfcB6gAxKR+KB86FrgEEk2BNaHpGBly9PZ09A5QByQXJUZSAdx4IOPzV0/M8+2uzGce2SZ/2WU37uQ2chUnExzN3zk4ry33pCa5gJaAyxWllLwoJCir1L6u9Vp8AvsFsj5H657IAGQ8wtdKbUTQTKZpm1+wr+gpz0Lum3nSEF5qc1YzCXISq+AH4QFYWjRkhcgU1gGLABkrS4DTC/ul+WSUwjvECFGAvtLbiyf4UuNdu4UoITkFkl6HfTqWhAOgsKGYmLBNQAuBz6Nj8UPD6kxTQFmfsPhEAmvE2L/e5FAA2xJQUcVQp43TOqb2sWlcO1EZAmuuJOtD0sHgjJSWGAKi03+jw8MiofTh3eD3a81Qcwg1t356ykoEMmrcM9Gz09Hb2DvVffRoKUN0uXlQdxjQ+/lgFxQb1b86kG/6+8QeCAt1TmkS6koqmnw6faAfuBBYBWK1UOx4XlxbnMT+DGQccptZDWKCov0HZi0J0dDRn/qQ9wcITcFsI7vTALYB8zRnlB/gxADIdKNWM0rP009QkKQ7qzs3MzWgzNt3GiY0MCkLh/fDGSxcAC5R1+89l5eQoq6lBZ6di6sVFepCzmGUcQPk3s2iEzfvBA7UpBk7XUgCUVVczy/RsOUxgFbgWtK4/JfmeXuX+c+3eiH1h5OCIkt7CeiP7/7kUAJY1q7CgQA3Okm+Yd9N1hgKuo0ddhS7XATUGwBFgskZYIHsA06jxrP+Jyclx2xrnkxnsr9QorNB8tHwJAsICujw0QwZ47Fnv6X3QOyoy4HZTGkwLAGlF1cMPfqAqZGPaupP6Q1n6y04qbjrBLsoOwL66a/ksoFuxv7IMmAcFUVrU0hJ9wFGMcmyvGtV+NhyUgWJhf3WswwsEN3nmvH5u6kBa59R+LuziCq/jPjaUZiJhfHx8ii4wwK9wsyBODDV5Gdno3z0zwyIa0ob60FetV/tpxMwUyYRaHAdeAy5BHa2h9glfDt1FIBbKLEC7GeGvq5N1tpS3LQLKTGy7BBYeUzKQxXsVFZyDLhGk/ty8gJvALQQLLwHo0cEVG1NTk9Pz4wfHKcPyBgnw8yoADLJIUlVVsNnUPn/NzbINoaukxFVgdV1xWX75lsUyAk8OHaRwTHAXnteoAWvj67bZ2anZ9cm5SRS/bW74N7Dra+aD4JCRi1zaMzKw1tO7NDjBvhDIiKKu06gaB/Omn6d+cmXIWQ7lo7PZM/Cbtk9zyI7JN47dZSLTKB+P7ulARzOa7+HmCG4DM0Cm+UE3WYJJ+RrEYA96mAfgMk4KJJ4FL92GNuaIuDqprqZO2J/HEN3a0GSdLJTH5V3c55k7fXIvoN7eXi4EI61zuu9O9n/48CH3jeCyYfr+/Bi/yK+b3OpDlsaQkPqd/d3opiOdoqXsOpI/hakudNlgY0m+mv8qJEvWCFj3MUFUAli2LdZ4okZ3N5xOVjE1fud2EzS2WjJ/EpISkGBmv0KXS31pfV1FpkpFYmOF/Z8Bs3B3pnBLD0UAZG9JGmWXHhY38JiZnZsunUZhuZH9/7wKAMEIjlrMqmU1tLfLriPuoiJ3Xp4rlxHAty2DOfhODiueDVc5dyFBBEDnMa9L+3Nzc7Y5B2pz8CX1KusnLOyvmWvqEgSEF+ylNC8Z6JWnQNoCYWmgPNeb+sO6/WdmJouZNUmK9pCgKVqyOY8VVgAMCEa0EVLSfdy3nX/72IXZ0b88ij8RgAvNcEe5ckND8w8ftqOdp+Wo4AmcYLGQGljqvARVpxOdLWiZxvRq8WpKQ0rJ6RLF/vF4sSDRc/sHuvzMEty/f5/PA2BWhwO83OSHi36Z5dd1fWVlhe/yLXlgAHfa5H5Bx44d446hatqoGaSk0OuSodS5u3db0cqSoctchSpqQApSGOTR5WcuRbbYfIiHAxg4n34+qTGp7nSdEoCcfU8Q5QEWL7vd2uphanJ+XlXuiRP8/cp3NNj//n15losExMyLcpAMMDUczqhUtr9WLDQ+Tp4x+ijPqTNDRK+Uu9TcHADCEASsPJgTrFo28KUiefXzLQCshHPnFPvLbqsDA2yXGwMDroGB2fh4S/Z3LP0q00fvSJEb57xXVobC1AcOiAYsFhf/1z/Z/N2i+9/iNujhcf8dgRD69rrCiwg/JJ9FAVCG3jJAZGB2rx4BlAMVPH5xm/pJDQgrWNKsQ5LPxAQeLj20wEJGpo8pa5jpkk9isj+6X2/sPNf0tYGmRJxFYGDzGB+Xx0V1jnRq0Oywc7SNvMDBANIcx4eZ9GPSg/KwlrVG9reetvJ4KONQOPgrVHDjT2Z1uLKX2f+2tjZN07jZPff8YXaIY7wUAA788gMMDvguX6+vrz916lRNTQ13DYJ58MOTk+J4dXd2slgWsch0mWweTsmkR72ABabR+CJ1eiZlJq4xThVUY0pJeQk+ExwxckHT07GdndQAB+lYJoAyGmC+i9Th8VAV6DWSpulTVKKSzgSd6jSkmZkVInthMOdJ2lGjtPHxJBmlCS4XE9G8Fh/3VtHefqb81x7+V55Hv/t66AKQ3bH6V+cVjJcYDn++BUBckjfeYI2SHmQ9hnt83DU1FT81ZXn82DI4yIqhAMhe0HwXDQ3sKFAIeih4oLh4kE/cG4q1hmf497/62TzP9xsp+Oky/hX2BdtBAI8rpYAhA7sh2qB+2mko6qcniH0AuxwduNlZtW63pYV+/n2yM1NAZGcdugMOe870iROL9fX66cbvTjUlxiXFrZ9AYMMAbB5OJ9WVF3jw6AGTGAwp6BUyjiHT8RI22MhrK8dycLKp5cwJ6+mKlJJDb6hSePHg0764CzTZn9TPlcDc6ZNbAzG9w2Fe7wfCcGyAue5XXnmF7N/U1MSvqAmg5iEPKWT6Q9P4N3cfnXBMSCmxIigALriWsUwxZu1sHS1F9aWWU3XWM8dT6kqsQPpnVhoyINzZZekaT+hce/BobXjiQ5AQGEJyKNtiUQKwtESXkfNHKu353LyTm0VTBswl3FSnP3ZM+SJMpvFsbJcMUakrsq2IZWKiZrn/1KlHjY3fXDybihDAUxqE/6c4K/wq8OabL4P7XwD8Kdo+C4BMEJE5WFR4sv/EhKttyn1lyvKVSVaDzPSiMfdJ547dm548fb0gZxkkOg6UDB4oHogqHkTsUWF/hDzQ/Dt9LdarUvZCoEFT8zXhKQNKlaFsl/IqN9ifxxglAGnYT9TXK+aJiaEYUO7Z6RbX1xddioiQq7ZuVfFBbS08pxKSEpNOBzExk16CrtOPk0G22ZGR2dkhOLrU0KDFQodLXTj/ouwu0F5fb62uTgGswBl4owg+UASz7xQFGSQVkf3p73OXf+7zzEmD8gQYeSYwnwpAkaioqOBQATM/3DKaD43hJxEoGFW/+qo8sIxur314+IHNxgwc1PY3miq95GRVUDnV8vDkoZqaloYGKSiKZZTZZV55CA0JPbjQeSG+Mz6tO40JQ675Gm0enWu+tmr1eGJiojc3E+1ahjujEOfZ1OtQdxZnj+CIyS3m6IswCiLbMxrgqMriL/d5Dh1iJi3F48k6tFJSsnq8kbQUH9eQlpqfmufvXl41HwSkPwQytv9nxunzgWiTjgl7P8314yXXnank5C9ZvvqBZaxBqQIlurOT0RpDe8kXMeG7+7YH2h6jwmrzsuKBgZKB1X4X3i8OPf/zwy/6WB9MVNP8fxl/AJh5a1+LPrpS2F8dvVEmpO91PJyGzwLM+dGBY/tnOMdQWzzRhATWpzysV6cnMIhCOnRsDQgC9OusVsVx5eX0J3gNiQmU7CQlkfL4lrh/bEUtgPAaj8f2WnpfSjO1QlB0NUiQ9zm0y0Hd8vJyzgWSh8LLujB5KDxHhvlMGNkv2kj9B6MBZD4eWdysCbpWKyvgVQgKAJWSBcUUCeuJH8jOvr9dULTGPZbGC4qUhYJVoBPRndFNnU1MT9FTY+jGAXympxxLjk1scriCQ77M+JOdGe9Wo9ok+xubNlME2SL4B1Niy8tuj2eKxclbJ7vwRTZF5hoGkrM4WUDGFYJ+NK4kON4uUpqIbCmbInxuEK0YptfsHBiXy+pypVomK2O+HBMz9j6GRiTrx5lC7M/yfCLZ9ybQBShuuAcxOHB4YPB3DqJcUb8yOjshwCd75yszgwzsO2KBE8+Q1zvPUn8mPluQe+VR24zgxemkM0pVYMcTlKDksHZ4DWvBz72gMdk9NYXFRaacRADoZPAyjPR5NEimZVsAeMzyzWplynZHK1Dv9ZUKZSGBa7vOnDnD4V+6/0wZM/VvCIDxCDBGA6EvP2PGTMZk6Awr74pX0TQJlaQ+vOdGS0FJWVX4Z7/Q2Z/oVIYuYAqyXpZZKRtsi1h0wikCwMweM/4yGTq4hDC/ydY4PQ27HR6POAmKWuidUwEJBhZxWpwd9lAEgKguVAZaNo+0g58nATgHbAGaqRmbbrfGdmjhJKBEi6XCgop3lJ/C5u5wsD8zccD2yhoLYnxOsT8GeKQTgeJGw/3/nCABBt7dZv8cvCAwjcc+RvMVsiUjmRbqrCPaXpgAjDjgPQjq8Syi5CXfMN63qL/CA3I9gwDsNyiKdKdo/rFDLKVk0YgdiFKvhogxEQBlBmT7z3CvwaafoMwP9opETYUdRwoBbwFIwOdPADaBxwD8rzon+1MDYOFWQJrFoltAMF23vEzqp+/PdB1jVXor6kMBxr9kfzFFPOL+0wH4POJd7/AkgofeAuAbEYx7ieW72Ddsebn/63hB0MPOgt4CEA68rQz/6aUSAB6HfY7cCvuLbe8EaoG+PYPEaqVTZOwip4b1AgETiOL+M4pE8asiAPic4ueT/XW8OIhvG8Ge6PoMBKBrWwAG8AsFQwA+Z25nNMq9BIDHMZ8U4HKJBuzY1d1rx1CRhiDcf0kBqeRm8TPDvxFE4FIaEMGLF0vM70z+vFBfREPYkA78dnwOEQ3imJcAfApMQBblk+0LtIID+gFjD3ojAlAaoFsgWFxUmR+7HSkpNIYCu+ygXeUndB2X5M8okpGYJe6/OkMoiGBzP915/ecpWIgCfq2yvWEBfgPtcxtSGUUVLNL3qQD1F1WIEURDUOUVB1xX64Bu47YTTo7B1KP+MA4DpH6dg8CUgURYRANAzM4az+xRxM3JCbvOff7Av/s/P4AmGX9Ugz6lpXi5UK8Mf3ef11/+QWURRBBBBOEWAOKECACmNqfaP22/PnPdBhttXpvnloQVqHC5LNQAJoIsUCPAPKrZgi0taqegnh7qg5q6VVDA0WDz07FmMDOIzAFcHjQmoGRnIzFx//Psf0JZBBFEEEFEAAQ4CX1L79js6Njq6LjZ0TPTs4CFaUyPYrQPfTmunCfrAOos/RbLA4s2+zGGhtDZqfbtfvAAdXVqDXBFxe7T+yp8uf8ZyiLBXAQRRBDBC18J3FGvdWyld6Cgx1KDVk/nQCcHAx5rj7lT5xH3kWRXssv16yxXHlrW2jA/rzI/8nSS6mo0NlID1KxQ01gCBoEBdYwggggiiOCFCoAN6KA1NDx4suxaVt0t9PXdmrzVoXUcKjh08DcddLkSYq64Y9buqKWiNpvK+F+4gNpaJQBnzwb0mEOD/TfwWSOCCCKIIAJN13Vs4wfb1g1gdJTpHZXcHxigp69PTzcvLn7D6fxva2uXLZYP4uIuyLY/+flqpSIjALr/TP68dIgggggiiEQAD8T9F/YnyOwczi0r05non5jAzIyLezI5HJb1b1ssX46JjZVdCRkiyK6EkYmbLyUiiCCCiADMKOoXDfCCpumyFQmzPXNzrrFl1xWn5TtXLd9MtMR+RXYljHj9LzciiCCCiAB0bNv8rsssrFaa+zF+thPcBYsFCUAlXlpEEEEEEURwAEDnNvt3+Vxkp9FcLo0LwX62ExwseJkRQQQRRBBB9JyR/d+d/eugcBKAy6UsweW1E9xLiwgiiCCCCKKN5M/sLuz/d409HLa2FPvX0DZRjvJMZELDS68BEUQQQQQRAeh8nv0Hn9vAgezf4FZGkP0TkADgZdeACCKIIIKIAOz0/UvwLOJcKHEBNC+8vBoQQQQRRBDBgQ5g2szWqm5gVwEgNLyUiCCCCCKICADMOPEuwK0MiGhABBFEEMEvzFYQn09EEEEEEUTWAUQQQQQRRBARALQAfwYoAjRT5oUfAX8cOBbo12DuC9nA7wC+CTiggFd3ntIkaoC/CfTBBLR9ts/gGsHDiWBxD/gHwLvAwTD91uvAHwKOBHX/2cAfAW7ue+2+ppoVbiMofAj8diB5r2sUAX8aaMY+oVj1fbSGu1v4Pksc8JuAXzX7iNP/C3zN92lfCOSXHAX+AtARdGF9AFx50ZvBhY4qYAwYV4ZVhBtV25ZorE+bB7r3ZzpSBMPAgirkoHDaa8rANXX8hUc90CCGwOEBVoBlwI4XiG7sByLQTYrVyy8AWUC1Yn8lA3cQVhxTp1ZWAcBbAGjTCAQTiMAMepQAoARIQVA4C7i8NOAXGmWK93GKx+C607IyrOAFYgpoRQT7pwGE9osuAEYQYMQB4UGS4f4/53MtKAHAjwCPySBgALiLCPbEgJcANAadWRQNkFDgNn5RccTL909DUFgRQwgIKQZeV+yPFoQf+xib6y+Bf/9ShALRz6efWoAheScaiYlqx/+CAqT5bdvGKeKB6n6Mt3sLQApS6lB3CIdgDhsbuHsX09PYRjWtCNWnkOn9fPnK7Qhg4VlW14BvYDd0deHOIyM0qQGOwg8uwxw2NzE6CpsNS0tYW+O/UmyqwLKykJOD8ICnHhtThbK8rApI1+H1yDajdsxUkRn0XEXvmirbEmWXTNXd5R3XiKMGrMB1Da51uMTDhAYtDWlsD1ZYzf/U68A0QkQ2cM5E7ZrA48fo78fKirR3of5TKC/ECVPFshPL7VjuxzJMopBX9NlcDYr5Bkyj5QZaprwjgGKgPpRuMYKRKUwtYnENa5vYjEZ0EpLYinKRexiHYQLNuw8CtG17FwfykS+nwvo6hoZUD2SNuFyIikJSEjIyFGulpiJ0sLqnprC4qC5ExMXxtKpjFxYC6EGPHXYIYFG8so2GvTRgZgbNzXA6jbINgYbAJtk/MDCwurqanJx89OjRoqKiYAXA0AAyGSkmMxMlJaiuxsmTptilrExR1dj3MTaChyDykMdG8A7egTm0tuKTT/BQfZfItaLqHVRVoWpnqRhZINoAnuKDnQXHkr5zB8rcSMIJqaiQBeDRI/T0qObHFrKwoOpSBIAtkMzMRsKSq6xEXh6Ch8eDzk709WF4mJcRnVECYLEgOdl4IpsqoZSUsAgA70jZPREA3kHWeZwPRgAI/sKzZ6kBytw2PABRhCK2hzfxpumfGroGZLFRmKtdE3Tw8cdoa8PcHIT9UdWA108I+wcnAGSulU+xYjPF/jRTzfUDk/fKjsYe13pTCUCW1A+Kg+4WpP4udA1gYAIT85h3wsm6jkFMkpaU8aOMAhQUohyoAp6l5je8//RTYoOiAVGIakDDe3gvpmeQjp3S48lJxdEiAGx1ZK3SUtUpyFpBY2REdT2enITG7s1+R8THIz1dqcvx49212T849ANKHRRinmtjDXvFAb29bEo8t8+C/YYdOGiyz/Z88sknHR0dCwsLhw4dqquru3TpUgn7bpACACT3osIVPTObskAHs6KCaqUczzNnTHVZqsX4OJR9nx7rJVzKQhYVuxKV2AsTE6pFdnTgww95QYpG9SuoJvvHIQ47kPSsBizu+ntcLqF+GiMLNpQTqrOGCDkrew6bnzwxE/PzcDiUAIhuigtSXq7u6PRpVSTBgCxz7x7a29HdjcFBnktdRgQgNlYxPqOM4mIcO0Zt4GUoBiEKAOWG7M+m2fMp5mzRJXiXGkBjDSK4KINKqDTAJTLAs7+BN47gCJ3BYzgW0E+9BswEyf6XERZQfVnldCZ+/GMqQS1qSf1kolM4FVLwxahO2fcAZ1DsH/zFSZuK/Wk3sD4l7E8LEg/x8DZu38d9+g9Ugtn42fjk+KioKJfLpS/qWVeyilGcicfAGPAbYOCLAEwJgKEBRXoR3cql2y2HWRfsHXTESNbkaFIGBcBqpc+lWMtmU07ZuXMIAqR+9vD793ly+l4kQPY7ht009m1xc+cWGh6ff3xVv4qjMTvb2N/fKxe0uqoa1Ecfwf72Lp/Af5ZTmhWAlpaWH//4x6Ojo8XFxZubm5mZmeYFwBuq9PjFy5dZmJ7x8fn29vn2H40x/GHsozozdXVPMGtE7SUp0m7eZLOg8lMAeGQkuKc/QiOrsirJ+2JlKIMPFHhpwE927VrC+yIA9BHCAdLvjRv49FOeWLUQNrNsZJch6yAOMjhd96zPL86PLo729q4NDZHDWXhslvQYAmf/69dZgGhpwYMHMQ4Hw7oj9fWJiYmapq2trc3Ozo4MDq5SG0ZHeWuqyC5eDDHrRPYXy/lb9X/wO1n/82qPbwEwjexs0QCxrsddZH8xlhhM48gRmvn0cBvwCa1ztRsWi5LlkCFkSSP7k8tI/WKxiEXQYK2trNBIVdXVZIKvK/ORH2Oqj6KfkBC2tKLcDdtX4p8r/X3fzP7o+lgI08aGb+HWNVy7i7vzqfNVVVVnC85arVYRgLm5ucetjz8c/DAJo8A//rcH0n4v86S0HdL57+Rsfi+VgQzHDYfjxrXDt28rsmBTYj2QmlmYlAH2OqoCO4XdDk1TV6mtRUAg6bN7s5PT/aLjxfOfOqXYj+7/1hZPq/r8T35iX1+3H7DPvjbrQLbZwZa4pxpAf1Fsl+b7TgDsz7TP4uLi1NQU2R9g23w8OTnJUGB9fT2OpB2oAJDh2cKoTtROeoIsPYdjoZ8xL51NvkczA/L2+LjYzIiKCikAtDM44599WJsUAEZdzBFXo1oEAH7hHQS0wws2m0H9tIzkf13/3pXvf/f7YeEBnlg0IHYj+RLqK1BBlyQFKQxOGfbOYGYQg+1oZ2KO3Yzkw6iUfgObEMyPLdC7uXWLGsAOSuqvvXSprKwsOzv74MGDFACn02mz2Zj1Y9z3iD9IREZyTwwOggLPIe4/j2eys7Kys28fvvsbZ3+mAaw+BA0mTN1uEQCb61rX+M80oAlNMAEWHeWTR9PsPwDc68TdT/7y9/DaaxRFJR0hoq3NEACmsw32598IBcL+y8tRfz3qOFIqkQLabgOGQmUM9uh9hgXkfbHpq2lvXqmvdwx8hODBPt6GNkYAi6mLzD+cPn2azTU9PT0mJoZMxLb68OHD5NvJzFSc/g2nexNrf5KUVEdXhpoWeNWstq067jhWb7SoJvveeygqUmkZEYDpadWCeVdMI7DjS8cj9/BC5h0vo4fThSX119erWD4zk8xIAWBl8XXPo0f227ft8QWORAfM43+olQ+E06k7HBppluczoBvjOG/DNNjdY+Pj4w8+gd1uT01N5TBAQkICXw8mAhCPzQjfGaRQAvs/GqOiMmLkzSsnZE9YLEYQQHu49VAEgEGAL1+SekPqFyOE+qkBZkaNZEaQ2CgUGLV5Z34KCuYbG6/Mn3HhzwK/D6FgdpbRIR1/xc9k/4u4SFWrQQ1dwnSkUwAo6kyA8j6oB1vYGhwfpDsi4wHmBYBKSC9GOig70quvvsoeVVlZWVBQkJKScuDAAdb0+Pg4O1VaWhqdrC5+nvUiQwLMe4bm/sfMZeXm5ubk51qLinrCIgAyOORyiQx0XruWM9MpGmDmtIzmyX1Op8l5IesP8eD7aL2He3P/LkcNkPDSVKAQwOZksL8FFoP9WekIDZL/oQakfMD6SzmDlHzfk0bogDK3oWmhzzNh+zJuCK866uscR+ucDxAsRjFKj6cXvY/x+NVq1VZfe+01ZqLZMrdlboW5aYYCVILey73lieXDiV+oSyzVk5O1wKvG0exw3Ot20LF64w3U1Sl2Zsu3WKgHinDYOfm3w8HkrGIT5kj5BxOkJsGQWno4T8XQ4ZVXVBKppoY9i6eVmyEnOnJyVuPjV7/1U/wDIGBJFt9faUDoc5ooscz21NTUuN3u+fn5jIwM/s1X6CaGOg2UHZSyR3GllmwsLFANePOmBABguRtxwFpHh5EI8iUABvszm12IQiP/AxNIezYOcDCCM9j/wYOKCr2xcfrUGfeVM27UIkRQDvv6VCNht72Ak2R/0QAN2vaPSWM0wCiV7D+HOYbGvb2bpLCREeVJmFJll4tBEONQ/niKeX19fVNTEzWg1Cv8YiIo8wmio6MdDsf09PQsy45ETReRoxzseAGCzojh/lehpLC4sKCkgNQ52Nvbs6w0QAyhoLJSgoCN6OgutzsXP9MA5s2wB0h8ZqcEPkDfIzxiUxrRRnDpEgWAFipHG2S5uNiAc8L+tSE3JmETseSK5BRdaUB5SBMHJ4FsMyNtxg1VrtfVNdfVr6+fZKwKDUFhHvOMeun30BXNz8/nLBQ2Wrop2AabMVlpaGgoLy/v0ZcfTelTs5idxwX6TEFMkl//I7aN1x0uVi7ZubERBuihUwyokyxSMg95n92V4i2OPH/PniDL8Vu9vYqJSHzsSlSOV19VaW2vm1E+1sGDKky3j2PxMQLC+8CvigDQVBXroe6qyZs75fF4cnJy6BfSQSwvLz9p2guM3ktelFFrN9h1xYMzDRkNliCgd6GX7C9WjnI8i5kZSf2rI51o8f1pvLhZ/9IQgLa2T7cdf1I1y+HMGTaSraUzm5vlm9AQyBDwBVmjuX10M17jDZHKORmEGWneCEeUG9FosL8B+obsD2QiEtyIa4SBKUOH+XmJrkx0UF5jaIh0U1pXd+zYsdraWrL/bgqdy7fGWLy9vbO8ZX6Lv29yknwZtPtvWcrgfZUnlJeWF1CH2B967oZJAAhpl/n5g5ubXUAunJQBxk/hmhC+hjX6oX1aH4/IUe6/RABhSf2TTdgmDfcfut8NcXWz6iLGAf1kJNN8n8UMSaRiLzCQMlL/cbbCerolm/V1ntuax1OEGAQFFrsTThJaUlISuZ5ZCLL/jpHBwxwSYJoCgENzOHXnOtaDXCtVb8WpEkX9tJ0gx7CzMLBgA2BXokdpsymKoTO7J4SvqBns6nRh2XjotZD9d6L0MFY0LELZiMlSWnduM79z1el4AgC3Ibi9c1XVQXjjLHyAzv7Zs2c57sLMMKuA3mHYFoJR5MToVNJMqaj3oJUxGHDtmvdo8HOzeoT6afRDa7Z9/6IAJyTUbW7O37mj7O7d7jt3DkyMnWkS9lfH7+QjcHz9WQFYmZtbnplZmZ5ejltbyUQmyZ3Bii8HlgpBBycVqSMYsdtVtbPvmQKFgnLBhgvQxyfLc2QfPsC36FVlcYSG4Lfm5ujFBCoADO0M9/8kysmatOiKIrI/bbS/v2fhZxrA0Y4waAAN6ARyty09TGuByPu9Wi+PC1jA0XC4/+3thgCw3f6M/fWGeMT7/jnBRAApqEjRUhgEhLYIKg64CrwL3xDqp032JL+J+jrmUPTcVIQEdgExfRvYAe+31Ie1A5quBVmE9cpwyu+8AyaFSNwycW5xkU3clABQJ6gWdKEI9qncXH/JwzpgEfgz/lJAbYBDGZzyBz50YMapOTmG8QTOPwZc8cH+NJgTAIEMA4R5JfD6uhpZoanAKi5OGRBcEDD5+LExGuw9c25wUNhf5VXImHSyxBAYVi1Rd+qK784P3pmPvTPvmqu6JOyv8+gRCddCFQBieXm5bmmlBMvUQ7J/tu+I2wILLRrRMr1SdNRsOsZu59XoRrFGGdPRdYIPMOjmB/gx/rHGb/G7DkfQ7n/i6hFhfxWlxUepgFqCgFtPgwAJy0LHgpcGXAyZ+sWvJPWLkQJCd/8ZURnsn6pbhfp5pLSHbSKORADr6ylQ7M8jQoUVIKv8E1+TG0n9ck9NivrrGAGUwGOu1H2664lI5IQu/vgZ+8zS0hLn/OycgsLsP6emsPvI4lB+PlFLDFI1/wXUYF68nzKwsjhVQEWwU0i/MOkKUS3oQiUl0X9Vo3b+KfUN+MeVZ9hf/r7mwLDj1zucX1BBgLC/2kbzA//sT/xjhIIgBEDKjabrSl9YoDwGpNhUehkNljjgoetpECCju0wpGVM/CSP1T8cZAWAOuEPLyrpTX39nYcHBtkflFvefVTmF4JBJ8ybmhNWVL68ur6yusNfSi2Gex8/vdMHlhtsDjwyKSzLN5BQgKgaNAkCokTS/iNoGXC75YqDTTQ33v2Gb/SlvACgAEgRM9fcbo8FKm8MEEYAcdURpaOwPDX3oE1vCEo7Whur+2+0G+0fNLzXoaso/zc+kZA2BRQUy/EvjRNJkPZm0mIAEeltSg5o0moADjFTA6iu9YWSzKlwnSP00RgDAPVNF7vvFDC1D1vp0bXQNDw9zWjojV6ahmY7Ydqxn7t+/z0lxnKqYgxwOkvHzvN/gd4nIhj8Y3qq3D2smO+ZwKL5jB+RwAhMp8vtN1rcPATDYf1PTyIf8bfpXy64D35jGlQMY/+q3L2+evnwaNM1LAD4zRJsITxWBiaKyUAJukQUFRhxgb2szggAuEAOM1D/fBMklKPdfNp8Tu1tZyWUQnDVI/WamQX9KnhpCRlL2Ki0b5pyJRSySiVh+AAuP0um7Oe1gdI660Diws7GxwSn/HN+P8aEejKnpR/AzhLqANLKg3P+UdTWqQSNxGlPMngYBs4+MIEDxVDigP5sIiguW+gk6Kjvdf1roqX/ee4N+RrH/akP9ag7cY6wgEgTdTA2mUA7YgGU/+Z/+lJR7KclL8bB/i2GBRreI9WixGGvK2Yk0s7piVRqAV4Hrz007MVL/MdO5Qv00UXottF13jugqcKTfZtNsnJfMMQB2Qg5NceaPTAPlLPXu7u579+6N94+z43MNIGeUB7dTkKlvsfuIBRJ9GzOVjcFPWijsTww+O2GTxKTzV0mK7AYUvv1t/J8o4Ks+Bv1ftABIhKoITEwB84Hue2VMCWUQMPN0Sqh1odiY/GOBxXD/tQDKoc+gfmOrEA7d0/YFq2Im2pLiibEpTE1jmqKZlRXIOgB+QeKt2VlGzQyoGT4z0e8jSzHC3kUPa1Pclvj4gNYB2GxP3f+m7ey/kILACALmGATYfhYEkDgQJox5aUBDoOyvwYDB/mywOHoyVPZ/8MAQgOOu4w0PGxpGGhpmRmDvIk1oFADWUXq6oubi4j3rlZ3btm1TPO4cAf5WSspCUsriNxl2aPRDDQFgG2Aim92FiazKSmOlt18xSBUN8JX6H+2NfxOK+uv1ekbh4dpzjSP5c5hb19ctvZbrvddn/sYM5yhTCThLjU4MFy0ODg4udi/KlDle3XcgFSYN0HVlhKbJ0dQKT29oGi28e7vpHP2qqVEXuolt/DpcBiAaAPy8CYAk0LwF4N8icPCLxv4QH38so8G0tEdFDx9qZH+m3eq3ff9A5pt3bFM/j492lvYLFAC61GTNIQw54DhRwnwUO69p15zMwm7PMavBQbpRnDzHmJpDwTsn9nLWV2dnJ6cAcfkfiNRUyX4G4f4f8mQa2f/nnSkJApQAtBtBAFsDwgIfAmDS8RewkTLzIwJAsQ0x+0/dRUeHmgne1pY1kHHqw1OnurMahr6XNDWlka9dLtnvSaiZF2KzJaOaEQDF/t62suKUCOCbhSkL30xZXNRWVrTNLRLPFrZkXqNqBkVFqKjgyKRsKrIXDcZva0Ai4DDkzEj9N6rMjzJWdLjYX2Y/n184H9Mck9aZlt+XP544/iDzgeN/OjajNmNcMcn2ZOZ8mtB0HMd56bM4G4YOqvtdX00RpREWi2RgzUTeYt5p2DDu76kbWfHnGnEU5PIvJAiIlov6z4khN4ktnm7p6yHMATfWhXFWCedHliyUHOo/2ttbzrHfDGQEMvFfYFA/bRj+oYWJ/e3qiC34B12hTnR2o5t8RDY+dowsYXYNtczuVMxC1/LRI/pNpHiG0vSkOM2Lc+mwDSZb+dadO3eYXeXfIEgWDDT4GXOgHBvu/6vb7L9zUpORBVpmImjiZ0FAIxrDqKqiAc9CN1+bQv3UACoBjtaJAJhy+nytkurspAZYZmfrfvjFuvbEUw++Vz84yJH2Y9HRTMdxJJMuLYMARc1s2NPTqp9wTroPnNqOm23P2fIyberI8szQzJX5wz9G8ZeRRLqiALjgojJMOaco7etU95ER2eyMRKbEgNg7C0RzAKrPGdmsMvdxet9iXsXpn17N7UnmdGbdaH7rxq1/3tKSmvrb33t7xl497/zTzs18tRkch3wZbTD1z4qp0Cv2fTtocpYxG0Jyr2ZmRjJ09h45oDGt6h+fAq+E/HvDt132FvDNbdPNXT1aPrBrYxARdbmUiqrSoYUAIwigsa/2P+5fHuReBuW8hPj+ZH81D9osfrrN/tPh3i9cD8X9Z9dlqM0tsR7gAZXg4knmo6hsAaxFZ2mTc+n+s6C4M+rdu3c5wMsJSBQDLvPjIu+trS36/hMTE319fWT/27dvy9Q3zv6kePjYBbfKl/s/3KPe88r+74CmkXQoACoISJ0pwc80QO2CECb0PCMAekBazhyKCIDh/ivfn8egIKooY1Mu4Hu/53vDlZU/LSv7Wm0tZ1sxo+1yubj1CpdhM/Dqp1RMTKhIeWuLxKEGiX0jXRkqgTVh/9VVm7YydX7FVvrlFVv2EduRNFvaQdvB2LFYCgBHLTmAxK7Cm2JbeszCp1dL9pf13juq2EcWaJw0aKT+tZkj5H1x/2P1WHM94D8BH5hUTY2XuXHjfNTtxsarr702E1235Dzg3NK3mIxPRCJbi+kdpUzMAuqFvwBGFt0sLMhkdImMzfQ7cXNVHtVul+wcQwGfyyq7gJZQqF/bVQN04B0EA2re8tracmLickKCHkwKaIcSyORe3j7bN41lEYoqM2EqgwHa2NiU3jw8Nrw+yvyGTQ0f2auqkqoqURmII/+JYn+s7P1DtCDYP3gB4HYo3ISgGc0d6GDGj72N7lZNTeBiabOp9ufx2FtafvSjH5FxuA8EN1fhdE8KgKz+/TcTEx81NFh/rfWjP/zhFlmPtFxUZHInX8YMJLq0XlweAJGJTHH/dy8DyUGvrzvd7h6gBCOUAdkmOoyJoODCOIP96fXhaH2o7j91l2zb1yeL7M+dO8dllsePH2fhc9cNvsKMNhfcMy/HDZr4CuWZWzYxV8PEHTXYzGZ88UARLWkFX1mx2ZZttt+wYsvJtGWm29IpABabBf8PHnjmMc8UIjOl9Ip06ENjQwxKlMCXqDVQewkAzeqd+h/qi3lTpv3odSRi35kM79p/2+SeZJoEGiy3jo64JpJtQmpqYY5LaeK+oBVIA1KBDB8L6RkwUZjZgyiZ9AlkTYAJUCpk9idvhyrCM/A8u2+yO25HK5Rlhsz+OzTg+8B/DnR/SnqB/f3LDsdycvLysWOs6hDHAHRATXOQOQh0eTAzQ85gaVIeg/a3ZV3YL4+PX8kZv/9nx91jY5vnS6ovv2M2+aM/FwG49oP9QxEAbohIAaDdxd3jx9U8VKZtT50KfGsGTeOXqbiyCetWf//DJzv/kP25x5Ou68709Jmioh++9VZHnaOjoWOLQyqs9fJyn4nvHX7ceg/e6AFoCmCQngO/5MWtRgsL6QcoARDDVNh8OmA6qAwe3WRj9iczYOL7KwsODocsBIUaUyHNNnIHDu7DwRmNjL3gBeoxX6EecPLVA6bYmTJiFfDqAezGukzLzFzJzPwKEIcVr4GCs4j+o9FHcETWEpL9F7HI5KmHMsdaJrvV1flNalslAqBeGKn/U4r6VeaHHc1fNltHENA9HtKuGr52Oll+bW0aNzkg5SYm8mey8fNIY1vmK4xhyMb8W/N1MrMCYLXjgmNnbocixNwp1Yj+E3sE64WRsVktYpGzFVHIx9TuZ2wG9JIoukbi3qh+pfr37qNlFDbgIAKEFuZcECv4pz9Fc/MScfgwE5SKpUlAIQ4CFxbqLMDaWjhuakNs4snJmJpSgRJeB9KCebhGUpIxI6j/j/yIWfLT75yWjR+EfczDBPsHQ/2hCAA3oLiJmzTKQP7R9aYm7oJMGieBB3VFlvalS3RJ2HzloTNs0Gsu11pUlP5kBPIn+fltR6faT9ycKJrBF77AgqWT7tvzrYA3BlDRA/QCwwEkpoRY3YChAeGi/6A123D/HXAY7j+7a7AqNK3KeXKSOldYWMhtNrivGTWAurtzEw4qMeMwTsFias7R3886Ug3bIZRk/lGQHRAkK8NRwA3YgD8KAWfL2GDjEDxDgcG1Qf429SPn5pQr5hMJQOroqLW1NaG11UlyKHKXGckf+EDu801SA74Ac5ANb/Un06K03glmzru7NbbcHQJAAqAAkGPJLWyt/BKCQec0rO2IT2Y18SxKdBUpgcVCT4A8SAmiJJMEZfyNMVMAw28UjOJieQIHT6LESuZBMDJgu1pZUcLA12Wz3vz30POPgT8SrsZtaMBvD3TFYlcXd6hettuXjxxZYrHyrkMXADIXm8z6+nJS0t3h4anpD/+OanYxbyOUpysxm9w7hoxxxIxnux9VIb0KBaSufaFsLXynMgRg0if7f4pPb+AGBeBI2Qo3EKRRA/LzQ5Ao9hgKCJsv29zMDBuf7nbjyRzE1vT0lpwbrYWtbVobowyqNNNMbLhmb7dHDMHBEABaPl4YFrBgCAB9tzDM/ZdVoOQRgBke7sPKHVgN9t+5uQ13PeP0ds7Q5TQtGPs9mRWAZWU7EQPkefvkyEUuE3TMoQ9iEEtLsnzMrwDAbif7pz4x59b/S6//RFF/Curuwfht2i6t8RPRJXzy3BD2QQguwSfYShdPnhzc2PjWo0e/t7W1RYtf+3SNzCkCwD8sFhKyKht5oiKDJWrZ+fNBbdT9r4/gWjZ9XlUU9PQZnPHUHo8qHHmMF/NyLCIOy7Nf0DFiWZkEU3n8ZbJ3I/md5+GvZ6vgmBCFS9Mo8HQRZD9ItUlc3xmAFlbXJtDQiCrIeyczkP2BZe5Us7jIv2X0ItStIJIrx6wJtw/ldjomRvS/P++JSeI3QkY1MA6MVeER/6IlvshHNush64dif1K/WHrpIps1jQJA6g49OiHTMJw2appuyGD0SAt+rCJ7rZWulOyuw7Zu3m2GuP/jwU9L6HnxAgAj+bOGNRw9Far7T6ytydQ3LsAmv3OHpXwKuG9wvSs/xpEAmTQd4D4cZp8Er3ZNQKJafGesa3W54BcjrakdLVbOx+nrm3jrSn0q6lqUyb1ou9b0e8BHV2AHrsCAseXO3gLQ5aloT/H0FqaOaGVfP3TIUXbEWep0lbrc75KZlK1jnVHaHOa6YYuN5SCXKiry9i/9EgJGE+DKwKceXL0KVhAjD7pK5DvqAVWFLYJqc+ECA3DlGzHvFeiiJXkIMMuZ0dMPf8iUIJNCssqSzYMyz8sp9q9pQl8jkBoK+4cONnh5NvhabS23KlvOyWGSAGIhRgCsMI5nXiu6dqfoTt9Zy+q7775OuolByMgEqoDf/kPgTwHlCDOuARfMaoAOA8NAIYKAsL+4/9biBfH9KQD0JIKmft1XTVss85jnqF4r6GS1LCa6hPppZtcZu0N1/wWDz8QBLwAsh/C6/yKxYvT6OduKOxlQCfyu2EuMfwKZM+dz5vhvAW4D/XgGunr4l8mt1jRoNACm1jS1I5VTMVtTLa1WAG1X6toUkdcCmg9iOiSPKcEVYf+3gTlhf5o3/jV2x/376uFI9+5VPXz4/mD1+V95553V48VrpWuuIpdH97g1twsuCgAf5DJzbab/p/3N15pbWpbYYEknDG7J4YGhBvAAUReZQmK6n346+VqVv8ySYlKIfY8KU1/PGDzguYskd8oGJZYqQsdrcFDFdszvaZo8I50np0goXZlvBLIBDSjbd+ov2GuS/dzcUmLikt2+lNmOx2rjgTAsBHuMx91aN+mmLWca77/PYUB126q5hyUIUHgT0BF+/AHgX+2tAToM/IMgHxzLwV7D908pWiDvi5GITNxZwOKwiU1x/FkpQxhC7Tlx/5n8Cdj9tyEkvGgBMNifzIKjDcL+yusJAWQQMf0JONsKfqFvQ/LgPt2uC4AFiAG6fdCC7o80GN9wVihN6InEpMwXRoBWWFutFICszay38Bbm2gDa3wP/3rX93QauPMQV9B/HZbR/wNECYxagppnYQFOjAHDs6/r1WNu5d9n6L7EDcM8D6OR9SiLdf5euBGAFK5OuyXZXO5zgxDby6sKC8tqDQT2QVCN0rLz+lRVKrzyPm96ALJ1TXhFfCQI8gwy/FRQwFyQP4pZHsjHdRNVSJ6+qwZWkz8jxLwWa4A8shzfftJWVzTl/ZeH3L+LLauJTaAKggZjF7BSmhjGMjBwORaoRFR7Dg3jsMzKAGX8aoMPA6eDZXxx/HpMLDfbniJGZtFIw0ifUL+sMFN8Z7r9JrIXH/ReMemlABT5TsGUaAsA+GR73HzC2AHOOj3OAl09b5XZM0b5JhHMuuCCDHwMgq414Bp8CINYeMEvwZhewsIQlQNbk+/bvVoBWZYmtidVz1bIqxZz30f3X0B1zGUAtUAbpMaS80lJey/8vJv3SP2aS3Barxnb1qioZftSgxSKW5t3OqxqrNmY2+AA77hW6ubnOtI0e9EZA5UD+F+WJ7bDbKQBUX1mhTZpSpRQKmNZ77TXVoiYmVHixvi77uDHdxJOrSyyHzu/mUAE0KfOP5bSo3rS+x7GPx75YSv0zH1VF+2mLlG6J3YxR/HDO8/A9GrX/4wHmr2bK9z9YIJkfnceKihBcAc2fS8hkN6lfDFYreV/cf/aygN3/OYQBL04AjOw/2yd7qXn33+w0cIBrfbkFE6d7cjoQfIB7W/IB3NyISYZqyA67L9Eq2Wb/GHXEPZgHb5AemOwrBYuFvh4v5GtimbA/WoB+sGWwUOiAm2F/JQAw3KCTsjerTgVITt6zKTscpF9FkohTo73+W6PL5eJCCq6mprKyCVNcKJrBQ+b50PYJubnK9gfGVkMSJDHCo1hKaKtDr5AuVbXN/uf81QOzlkwMPMCD7lM9y8e/QA+UTTFAAdB2fS9ajOoqA82hRzqhf18PyFHYc0xYAxqCZH9x/xPy5kn94vvT9Qn4xjRTL85gxmB/O+w4eUnc/wAaqD2c7r9gSjQAnylYFPvi/gMyB5xFSmbhLnuc38lJPhwK3vX52pz5w3e5xbHah4NeIX2unByfjmeelwDQbgFbaEYz74V7JBzH8SQk+aD01i50UeoYBKD0uOwqtXsK6L6ifmWtT7fpN9+LxoEiq/F6ivlZFLJLAKkY8wuw2bhzeHpGhmW3VAFXs7e3t7PcuMNVXJyHt8KSllxFcEHAi4YWinLJnChpzyMY4VCiFdZpTLO6xfmurq1+yv6F/q7JhsSvt5S1tDNFLxOfTCPaz10kIIHGZrQgWwLZ7T8BLuNlh47QwIFxw/ePz517Qv1uWlElnL6bRxzifD/81tT2EmJ0BtWYj+H+AwG7/0sIG16EABjsz05isL+5bK8JMiMtlZTQhxpub+fOxlx6zdVefJ6t90IwPniP+0C0trY2NzerVWCAqfnmR4CLT0OBttttH69//AiPClBAH78c5YUo9N5izwYb32WNy6pyJCfTv+AP83mV1m3bCrgHaL6I1YQGsGBkU9TBwSW0t38rMTF9eTmdq9YPH+YgOXcx4VAKd4Q29s9guVEGTp0iTakyS0oKjX71l4z6jQwTyy0rSy0160Qn652JPpKtLGzMRGbWqay8pjxrk1Wxfy78YxnLk2WTM03ZW41qrz82lfDsBkqvhFPQaFhZpHwrA37vz4sG3AziHePtWdrz9Zhj6Ow5v+wvjj8tLuf2+fM3z59fSDlvb61yt/ptHixMEnYxihE4DPZnW2HDMeZ9BrDhwWL43X/BnDrlZwe6SEb+h8kQ8xt/mgUZlp1yfBxzc9zmgQMATPEz1ZOdnc3N4DgpiEt/mfPhHm1MZHODezqzaGhgdZDP9l5wlCrjARixjLRZ2qgBP1r5UQlKKADUszzkMRqgo6BDd8BBARjEIGucTW7V4sLpV9VVTpygz+xPAOYDY3/NBLHqfjmvoEAJ0+SkPG244w85HF8bHk7PyUlLT+dMKkMAuIMeU2qPFbpOn3adOcNi894i5SWSAQ0hg1EcGwsdOaYP+/tXPsJHD/GQKaBVrDqtk1VVJztP5+Y25b5y7hVkYk8crz2+2Lh4oNF5oKnpflFR2LaDpi6JYXlYtkYytrXS8cLxDfiCB/i2D4fmDwM//cbsLl/OFV3zLwDMshm+f0zW3z937ttZ56bvnpu3V9tdcPlvGFnI4hyRIASgG92GAAAg74v7TyIIxv1fRdjR8yLcfw88hvuvBqjCBRlcWVjA2trGnTsff/wxaYtZiyNHjtCfFQHgQxooCXRmlxgZNzbKfHOzu68kYfWCq80y3GaZa0v0LN63tgy1kOiLUMR8cypSRQCccNIlHMUogwCVz62/yKvwWv5mtbcAAwGwv2aeWPfiWFL5+joTQapJcn/HT+4MaFo6n2PKCbJUUAoA8/7M/2xtzeTnb3LiP7WSpcUbslh8FZLA9HsHATv2Hwd3/oKkYKebUfyWljhuRTGgs7Hlco2wNHLSmE1ki+6src091piHQ7mAX0KPAhqR25j7SuMrBxpdBwoLDwCt4RKAZCSLUdyNh5dyKPiFhl8GrsAPPMB3nmnJ/xQCzB6+csUv+xP/zPe8WAbjZP85zL079duHzjfcPT8zVzPn0BzYC1/BV9awRtpSYyqmMYlJg/35dfH9xd8MlKTF9gPL+Iwwhann5/7L5j/hBfM5Gxtq1gej366u7icjAdwKlP4sh0XJZcxmbLEH0/WtqFDzzZnOaGpSymEObRZL24ULbfHxA/wKswA9PYt8WMr4gzZPG9OtFlhk6uc61tWQclEdfw/ZglchZfpb5tZqlv21cPvXdBI5ZYY6xfzZ8LCKBrhf3urqPEtxa4s/mZwhz7aRZBFviJGMv1u57PNKvt/77cB/xn7it++8dk4I6RCWA9mfZcI4wFjGwBaRnc23PJWVnTExuQAtzydLH1TsL5bdmP1KBg5ADM1hEQAmf5i4oD19fJ3dLgKww79+DwHibYSIGvhFvQeYhYGPgIPqojU4DLOohcAYaudIvVrNCFUxV8EG58Z/VjsvohbBw/d36QYK9beicwpHYMlTvC/uf6AQ938dLwF8N6Xtp77oW/giGyZpUVEw+03YwUKWSd8MqIeGwE07l5a4167iM4uFwiBzDSWMN78Kj3gItIkxaOD55Wlfwppzc5x56nC5ZMYhyYAiZzwObO90iW7q3fd9FfBJZbvjfSj86h4TaClP1OKxMZaWiqAYHRkCEBuryuzQIeodRWLvmT8fYDdYfb3h1cnfxv7go53XzpWXQkBBAU22/RUBoEyyzkUah4EuQDTg5O5DSo1eloRM4BUYGoC7oQsAUxYJSIhHfCxiN1ifTidtD802hy8geJi5Yr2ykPFByOcO/ipG6v9hK7K65UN0GEg69ARTU4MRANpLgcs+g6FejPahhiZLosiMKv28T+DJc3MVpclGTBL+6jq7KeleNn/+/+y9B1wU2bru/S8FGhAkJ4liAAOimJ0czz5p9rlnNt64z3dzzjnnnHPO+Y4n3JmTdpysM86YYVRMgAhKjgJNqu9Zs37UbYWWohsanKlnv7umraaraq1a63ned721akkezNY3uj32h2kQF1qfWacwNNDfL9a060GqdPa1mboGOYQihhV57uG/QeNy2d/C/vjbS69lJwMV4nEBUJ0lJcXhHW5cHXKP9YqyVu5yiouNRV8rr9xsKSASWx9l/w1YFD6qAZ/EKQDek6BSAvskaPQlAU7GXpcrLQANshXJ5TTGz/6xl+MKt86x5TyN57DARowxPjbRAjM8HTgZrQR5LZxsAdcbRhW1rCrS0uxCpTb29QTAvtJsudMOZiLY/wERsDKgniW32S4I7PnMHu+vBPuH4aS/DhM/7GhGfAgwFLFe6ks+n2HMh28as4hbAOy7UVxcOyUgeqMP4RshVgSZPr+IHdt5FBsW7Fr5s1jchXNst3N6pp62RK1/+G8f96CFUAvcYC1gc2HxwWP/L1gAT91XHK6PfhdivSJA83wEINvBKmAD0THIYD/9QwxNMGEnoHvu51OPGtYtRuAcWPbvIYDBDaw9rbgdIQABAiwHTdBsbHWQxALYVOc441e5ep3r7bTz5VIPFBWZD6uMAN58fst3ATqgBWM3n9pI3lL/eRgjgXDX/3H9YyP8OmPrBFnw22U+6mp9w3FxH0u1neb0AAOTTHbQcZ7zH2z8yH3hBb1tjh//cerq/JRv/SNAgAABAiRFe/B8mmmzFl3pOHtesfNc7LPnXxUECBAgQCAAz7MQd5hpS04hcw9btrB9O/X1Zhai4/DVQYAAAQIEAnCSBagwtnGjyfraBRB27OCrhgABAgQIBKBxMfYX7OoKoRBfTQQIECBAIACFPIpCAgQIECDA1wAbCBAgQIAAgQAECBAgQICvDxzXdQkQIECAAEEEECBAgAABvt4CMAz/Hn4EnEetBv48XMEvRuE/wjfAgTT4/+CXiAbHh5XDt+E/wG3fJ145i/N00dEB/xCOgQOvwL+GfnxhAv4L/AQ4UA9/HW7gIeYaSjTG4H/AX/XfrtZhGR1/9jr8G+/ufg5/CrYtp8W0w9+HIz7OtB/+BtyIcnGvwb+DIXyiCf4i1IIDu+EvQTP+8Dn8SagCBw7A34q+atl78Idhawxd0fFnb2CIo48n4R78IzgOIfhN8A4eVoluDsPfhTaWQBj+O7wRB3mFDHPyzlMdARTA8XnbRoCvyote2ozRru3TW0bXn7OVDTnGDBiEIWMGAaqssTqomD96PgGeSgHYDMfhmDF2E+Crwv7MU7+1u1/hV6R57L8BmIUhGJQlpMTrH1vnKTonwfKy/hEIQMo89R+HBlYHAX6RNcA96/5726eujP6Z1rJ/NkIE+7sE8DTA2kojK6oABEg6FTUJ8D2ioAb2LVjUKspxRuE7RCANfgJY8HOHR9HWRksLIyMYeCM/Bcd58dHfwSkfZ10MGzaQnExaGllZ5OVRUkJ6OkvAx+mSkqiuXnQBVwfcKAfogE95BC9DnlfKaCeeWCSlUg87gWi/9V9FDk4yyWmkbWZzHnkllGSQ4b96/KL9NG1dHvvLXq83d8Q//De/hdjAhhRSVMYssmwZ9TluDXCIgJrwxYv09GDZnwM5bKeRU4O3GLzIkJ1yrxazf7+vSm2Hz+K/LA+vQfaSvalpwXpCu2AvPvH5AlU/ANu9k0aetWqYqu9RBZdh1lsv8ciRGN5H0ELLda5PMRUhLNvZeGCpst6DT/BACN7w05tsQ4sDh6FqkTrxEIZ3iBcLSkSjJwC+NWAn1PjrgQvrJg0a/SyKePcuH3zA2bP09WF9f6qP8eIxji34XYxd3xMAkb5de7W01HTD2tonLGXn63QpKRw/rharQ/k9wAINeBnw1exgHH4ZD/ug3tdvF1bRz0QVAJFjAQWllG5lay21IsoVE4CxMaP07W/TBrNou7eNmnb27cM//Dc/fmZxAUgn3StjNdUqo/7pK+/rLk2258/z/e9z6xaQzSs55OS8BUgABhk6z+AdTCt87rnHVoZ1o1aqpwHx4zX/vSlSA3YZs4hBAw4Yg0XJTj2xqoiqt6nq4DYG7NmjvmQ0YDnoo+8MZz7iozHGcKzv/2NUVfkrq6cBKXDSR2+KXwMOweFodbKiGhCyR/clAJ4G7Nv3a+EkvOkJwPJ7/gh8NxVO+omau7v55BM+/ZT33+f69f3sF/Uf57gslVS/J/bOSlQ4jiHrTZsM4xcWUlHBjh20t3P4sFECixhOV1amHq2mrMPaHu3/AHfhLLy8zBN7GrBPtrzfelWUGjUCEDlmk11IYQUV29neSmsDDbvZvTICIPa3Nv05kNdOZrv5l38B8N/8SI0aAWxiU2QZdUEHOagPvjRAcKNqQDhMVxfXrvH22477LcP+8/7FqaEhpAGDP4TaExw6xPR0xI+XKlwbfE58eHW59XgFWmJhf4vPoB32w4Enn1Usbewyt3+I8c6Skti1SwH1soIA3cE73DnHuSaaqNpK1Td1UFW+77J2wAVojI0ClolDMr9nmYxjDNPTM/9rAv816yebeM9r0yLKlV+71MFTnGFRvzWx/y52ifetWacsBrySmsrJZ2jEPi7pYdadnQxPDoWHHgw8uHNn6NIldu826jMxYYLyykpiw717nDuHFYBXX0Unf8xptPW4rvAKqfDMwuWgw4SHGe6h5zM+u8hFucaddGrPNNP11BM/pLeytraa/1jz5s9t/5u//MtWDu7eVTNb2QLCYmWcYWaSySGGHvDgNrcvcUlNTp+N5whWA+IIBQzFW3Nz5tlfbQvm5rD7JQN4X0U9zAFfu1w4D6fgraGL2a1Q/zTO8tF9txqQn09f37htHsZqavAH3VO1KutZeJJiLFE4Ia062AiyN+Lo6yf87Y0CF8bg+/A9bbvP3L6t0Daf/M1s9i0AkXqxG08DcnJWUABcIjE5aXx/a5cuacBBYz7W5J0RKxoRSuHEY9H5LLMTTKgb3uNeCy0XJi9cuDA1NkZSkumMW7YYRz42NDdbATD27LOsf0RWUaQAWHK8z/1b3LrCFflTAwyI/eU1q3CVVBIPJJW2b/f2FhTUFBQU3N28+cW2EdvlV1AA/jUWi5RRbWCccbUBCdtNbkoALnBBCufiKiwooCCLrFg1wAXHY3lL8dq6WGFwBwcd7Z8LpZGbq/1kZrpPvj8R+DVP6knD8JayDvxN4M2nUQO2brUmAcC2EMmAfwGw1C8NGGVUdZt4AWgEquEgXjOI8TAL8PKyOPUiXOjn4ve5ffsG+Qrc5bTtZKdfAXB5FDvjLE/UMzjMw/P9z57dwhbP96+gIm52W0QDbOfvp1/N5TKX00l/l3dv3JC8qbUo7jRNLga8/o3Xf9j4w3O/d9YKgJSgrs5HRi4B8F1FkQIgxu+g4ypX88jToKqI8nM+zyW3lNI4BcBz7hzXKTpbVFhYWFBY2N46Yrt8vU0Fr1TpomiA2sBDHqoNiC+aadYde5/3FQrIUVILlNN0hCNAzBoglrcaQMGX7D8/CmFVQVvttOYyj/8D34KNUUvwU0uw/yngz3o/ego1wGPsy5eZ6uqy7cTE5kVF+ECk+++JSeJ7k38N8CkALy3Lnb42woXvIUfgwoUyeJ2GAxyQBqhV+xIAd+nzOCv7wJx1/K2Jayz1y/ffwQ7iQx7eyXIXErBYTFF/JpkiArGbQgG1Hfmm9+/HKADT4UOHwsNn7509t9cKgNmWlz/KE2ukAf6ryEMZZfvYV0JJMsnSy1/hV8SPqqVaaiUM5ZQTE2z61/ZtNcqSYv2vJHXLltlbt+xu2b59Kx1jLlZGuflim73stVGm6FpN8AY3lOdQAQ9z2MGJWQPk6Q8NGQ1gZ2QCAMv+ngB4wsBvW8j+wnbmUblECc8v9qPtC3loPSMjA08D5JB5iSI/AtBHn3X/de9ISkq8+y+ULvgUU92XEoEQlPpv5b294n3L/s70dMM8+6sj+5oH4OIH7gr2Sl2r5/5vmkr2Rn7qqEvAE9tppO1hj/wEebVgAk/roMWGsBGAQzXhGrksSgZYGx31X4PrEWo9ysaL9LexDVDv6qKrm258I3r6d7qCirLSstLSUsrKSE/3Rn0TOQEqREhcL9JXARULyhtQ6cQmAwzEms5ichLL8qNjjijeNUNAXgRgtQHL/makQqiALNkKZdQcnlo8ytueRxAOsxQWH/3fvBmf2LhRJuWwps+x139iuru74MCua9nfEfvfv6/OZdlfWxZDUvyPPMfbWK9e9Xz/pJHx4/PP/BziECsEJ/qTGp4bmEuuHfANh03XnZrCdWNYBVk/PFQ5PXxoemjIHWpxur1kwEsvrU4NrmoVRUACqWigmGJFAJYZRWLxp39TSVUbrUyqrKyooLJS1n/tWuyp4Dg6nDSghJJ88tUSFOuMMSYZ0Ic88lgOJp1JPV8AjAxaT38sN6fioWX/jZMIc3hDQGO5uQ9NEJCN85A9sBljbAKDTbGzz9ON0lJL3cbp7+4eV2vwkwqeYca6/7IY079paY/bSvamyH3Oajk4ov4vfX+amuTKeOyvRuZLANwETzK/fdvz/RW5HOc5z/1PJMElkyzplwGOYz5pK4sBc3Pls7OHDs2qgw/9kB+eOzfpJQMaGha5FvvJWfcaYAUyk0zAMuMEE/GnfyupEevLUrWxZgSAOFPBLrFAPV4ykEKKTQ/I5phjOfiYj1Wwaaaxw0nGdPez3zIs3wlv2f3Thv1FL5u+3D9LutlPlrVXPeb/Lcssp7PUHXXBecpSwRKAiCBAAuDD/R9hxKbyjJWXJ14ABMfPQPpncAT4uyvVxJ27d637bww89n/CQHpSwgclXDx0dhret+5/hxlvFe9b919cvBpnjdZdRhn1GC03V2Rto8aYsfcQEgBjp+dOawjISwZUV/vIq6xLDUgiydNI0aK1ONO/gHH/qdSW4mJsEFBU1N7ebb/fv183InEuyRRT8iJlgFUCeQb4xk1uypE5zemwE8aFIasBSi/knMppIrsJwYFb2P3P52h/D7mnsNgse9MW2BMA/3B83NGnNBU80dWl1rBkKthz/2NP/4ZChvTT08nI0DYeAXCffJMqoRFjBn8y/qM7wPi4N/Qv7qmhxhv9JzqS1oz9+/ocO+FLduuWEhTeYz+KXBL8Mqw73Omks4ceMBxdVhZ9VqY/Fi3hkNEAd2jYGW4eaPZmBsgkMLBOZcAlKqSOYcIywDKjLJ70ryyffOv22+yLPloNmO3utn/if1KYywqgjz4xs/EfQffKRjxEwwJu0W/VhC5zuRWoNt//BFyaYWCAb/3bgT/xb+eH0l7jt8HPwrXkpG+9ff3n3qbVHi3riFqJLIa75fhQ9acrCEhL8zRAMWHE86BRBKCffhsB3OWueDz29O+WLeYRwLw864usLPvHDh9hn8f+otM88jz2DxEiOpLWhv3FApb6pQHNzRIrb+Qnh5xEsv8009e4pkcbr3JVo9tqMHV11NaybVuctZKqHMYQQ8MMa3vnzj1PAF55RY607ZRrLwP+K+o+93vpteP+YqnNbM4gIy73f2rKsr/3mK/+ZU3tuL192v6VBCAxuM51NQDRh+5XCSU24SEB8P+gtpRjBGeERluZb4vluxj6Oer/wJVs9g1CNgafaj+zg/xsLrk5vParUAMO2Pno8bC/fw14jacAkQLgJY28WcHRHv9/5JebNrFcyHOTb/PwISUlsvXM/g4RuH7dsr/Zgsf+1rVaQgAShe97/2V01Dl/3rD/+fOVbqU38qMqX/E8V/OiHx1D/WOMPeCB3P8rXJEcFe0a0N0/etQ9cMCEgHFC9CENsAIgu3hxbD4ZoFOsmEvrOAv/sfLsP8poCy2ttHbQAeg2FVJYQAExYN6338AGkb01LDZt8oKA/lu34kwF+8ccc3ICNNv5Epf0AdjN7u1sl7MO+BeAYbKHaRyen4Y52MzQVWYmTmQ3vpnDkez5Yg7SK/ZXk9jGNu3UV1jHXC1jxw784LMovcG3Bnwf/h3rHcXFlsaNU97V9dALAti5k0cxy+yKzf4V+4sF4sCZhR+dqOR7xP9s398ki3K8vj6P/QmHRf2W/f1M109K4POIpxDeATtcdedO+tmzO365ft+Vfcdrjh8PHdcdW41o/xQWn8se8/2VzJRXe3fz3f4t/31nVW5t7WYNOh854qMb+utttdQOu8NDjhEAzTCKTAbU1BA/NmywtuAfK+37K6l0jnPNNPfQk056NdVibfnI8aV/t1r3P3J6uqjfaoDCWPV0/6ngW/jHLSwcptwpue0qoHx/OQFnOdtJp2RbnaeOuhpqeAIOEYkRGDZ6z4xl+Q6GPsZkgMnOOWRSvXDIphks+8szMF+hr+oheRmDM3/cB/v70IDfAUNPTSpYAoDnOkgAorn/upuP6MYawCOc95Zk/0b/L4EIPfFgHvt3dpZT7uV+8YEkN5E18w7eM9L1k5OlP/ZrS//vjoqKmrIDDcXP1pC1SmddhP1d3Jn8mfGS8f6S/l9X8sef3/Kz5eV527eW7K2sLDHNayMrBDsQZDv8xdGLX2qANaeoyCU+JCVZW/CPZaJ1wUdvprQEUo6/xsc0SiYfGdjP/j3sETmKuONJ/1rfX/EfEXDLyx2rATk5bW2D/lPBp/CJJpnXk6Y+nRrdPdqzuUfccZ3rYcLP8Zx9GGG5TyEPz5v7yFQvJ8fOASPHyxOoMWibRZbdn0zyMp4TrPTB/r41IPupSgWPRU8FP+7+W9FYI7yF8C6/B2NdLIpkaCQa/tGyBj489lcdpZHmsX8uSyQbEz4E1DAJDVjMzl7u77/8K/8nP/9sbe2OsbEcBV4vv2zpa4WxyW4Woo/M0czNPZu/0/7vfzG7qrSgYItchm3bTAqooYHSUlYCG9loNcBaa0dr5KviQqH4Dr4R1VtKCo6Dq//oH7IYm6zwhSxyYGSCiX7673HvBjfEj4DI8ShHrYMcT/pX9Gfcf7dCWx6F++UQkGRg9tKg/1TwW/jBFVlkZ5o+Pj32v8b6d/dn7c7amrRVYzIa/FHnOcIR23/8o3yIP/Kz/JHfjoVlf20rsM/5W7LFsr8sx9sfU1jmxBedPi1Qo/Y0oLkZr/1ECoCaqHX/Tfo3Pd1Qv/3BGqF/G40XshuzeQOcKLe3cqXmdnR0eLlfwGP/nez02aqSEvuOjO1wwAoAnZ189lnf6aMff+yKtTT8K3vmmWXViYsPnPTeZrcAM+GZ8e7x/u7+v0qHCO5W0ecmulSdDg+7L7xgnyCOv5/luXmHnP+XEG5qGvQSwipv/D1EJiGZtJ9ky8epBezvCYB9UyZQTrnIUe6/BEAOsnyNuNK/bq2NAJyFzdsGBtKAS5fsL/wIwCWWQGolJ89OnD0Lf5yWGnBdw8O9va//yut5bXn57flbDm+pKq6qoWYve2N5wGnMGM/A6ci5vk69a1g+MgKwQUAO3v5lt2oHi6+FBkQKgNeEIlPB9tHPx0f/U1PX9NVaDbDN/7BejHd5YsJjfzUrkb6X+/VB/WsjAPMaMDPjNjc7GzYwOcl5R93SCoD0+8CBlT/twlWM7J2ZYcamAZQHrqAio/vMpe6PGBiQPjm6moICrxm5xAW5lp4A/IAfnDvn2lGgrCx3717igS7Q2qT3afm4YTdR3pWv9lRCiXrVDnbI8dc/de3xpH8JUzlVaWcATC2kpU05Ng8crqgI3b1rf7QCqeCTwNG/T+VP2JPNzXH/PmfPnv+VN3e35RU+yKuZKX711YrMzHT84QqP4mELY2EeggOjdq4vMxPJ2VcMy98l++6jQ0AapND+MDlXsPfRmR/ZdnxNX/naaEDkjK6OjsdTwbPMLv78D6ypAMSrAQ4+4LH/zZsKWD32Fwv4jyWT1uolSeJ7KZi18atXpQFif5l2686uIKoiP0aBgkeRmvSgn/6OL74wQ85lZSYXLHpeof5ykIPeE0GfT34emRAuww+qowlAWhq5xtKQ6d+xcSO/BpKJgIPjLZZSRFE55ZIxWfyzf8veKhP7h6j8VfLsqRbQUqXVgP929+5fnvf5tGMluuURqARcabxu9Oxs//f/ykcfdYbDZGSQm4sCP584tXCAa+z/MmZpHoYwGeA/n625XpeQWUyBYX+1BLH/fXJOWSnFyczkxRc5ciSBb3pwYpv678ZxQie+VLAEAFF/ZCrYc/9VpY+8QWINsSfi0+rNvWhpWfS5zzLKolH/H4WTcGxtBGAhiebnu8eOORKAyUlZ7507VgNsHCD6FRLm64iPppnuoquFlg46uHXL+JxdXVYA4j+zbQKRCeEbD254yYDsg2T4Y+mFMKqZxsk0MJZGcnLs3MhPQXJkd/WWSyykMN75GV6/hcpTlR0YW8Bp3j+noZKcCrFyW9uYj1SwD9Qt+CSxHBigX6KfeuFCODfXlQDI6upiFoBBxn6A8Br8WhhE7P8uOfB7oQUL/gUMAl+Q8wV/BX4DBpw4sfR5nQT0yuiTwLW179tRT5HhD/aP9St7HGvxpIKHOzuxDaKnh8LChe6/hGK9zadfeQ3o7/fYX+SpgVnL/voQbbJYWZS0c9JaVo1o/tgxFcDGAe3t9z/7zAqA2ebkkLCXwdmHUoopzicf742gw8OsKDazOXJ22PXrPVlZTna2GQ560T9LLxCAxnTwLCb8yIKPK4yxMS9yT0/fdGnTJf7XJfgr0d94lo19q/0tZq/iIxUcSyNwa2sddSTZwMDMmTN6eWJeHlYDSkvdJd3mFh7F7Cxzc+wtc/dyEX72ND87Q1L5/W9x9k3K6ikDOrWfn/+56Q19yXkv0vYtyl6lzIEi7HsHEsH7MYQCqaTKD1AsaF8DJaEbYQR/GGXUvlYPML4KabIYHnaI1ACvQQwUJln3X1syM22YYMd/vuIa4LH/vXty+R957tNdXvtJWuOq2bHDCoC2WgT46tVBbyBIr88MhRLn6CSRFCJk3wpn3uY4NcXMjGxln0yqoMJqwHwyYMpmg7M2cIAno4HFsCstgv3T1uuAcET6t6L6Nx6vhE/haPS26UI3vA2VD7j6q+/4TAXHUM6GBgmAtZ6WlvPnDfvn5cmcZY+lVVYqp+/W1wODsssMNf3FHX90RzY/nkO6Pe0XMPiAgZ8lZ7I9548fzsZSFZnGbHyzHpFFlswmflRTffT10CO/Xp1lSfbXX+rv1doB+/yz3KA4nwf1mlPb/qS2lAWj/zYIXp8asPh8vr8JjbADn7h0ybK/PkibPfbXwyYxeA9JrCGsKtbVWQHQVhqg12d6CeHnn1+5E/mIVSeZnGJqllk7IdB7rH4FR4GEfezzgoAzs2e+TAYkZR3fmJ2UtDW2FMcfN2Zwfr0mBT0fnl8RTx4xT4BGd4pcDIqgUvYOxcX/6cGDWFLBPsrppqU5ERpw/XqfBMDash/Q2rbNLSmx76wffNc+BfS7c04eMY978k0MGGhm8Jr215U0lZhHgHgVcrHsb7brFKqPQgqLKMokU5zeQYc49za3a6ld8hVb+stOOu0b13UEbWOIACBybUe1o4e2Rd29m9K+fcHzP+sE7tJh1xGE/dC4vFzawuc+3QM11MQWOyatC208ciQyDohMCB88iB/E/3YO+zI40QAgSjb+WEYGq4PIV0Rc7XfOnevLygplp6RkQw5x4OC6fDCks9NL/xYW/tiXT3jyoyU+AuOKa9hJYQ8etPtIBcc+DulpwPe/f+GC6w0E7dq1vAZmW62dAqZt0nRado55BCgDbx0Ya527c3fnuHYSQA6W/Y2tX5RSWkGF+LWJJlH/da7rswj9CZmhbrqbaW6h5Ra3AP29jqDjxD8rWM1APNjd2Xm/M6Nze6e6UuRa8uub/Z0oO2U+IHr02H9gYAc7Gtyoz306+ELSmj8PZhlAyQArALLJTz+NfDBU/XDl4RAJ9f7LXL7JTRtO2teBUli4OnKHeCIyIXz7dkpWVkp2YSgbXoENy3lMo6+v78aNG8PDw+np6dXV1eXl5YnXAN/uv/eiB389R39q7dKltrawj1RwrKiv94KAyfOCHQgy26KiZfd0bwpYNiU5To6IHgMePsR+NTm+IXISgAs/aYMA1i+2YmbJ7WSn2Pw+9y9xSRJpl1ErppgFuMc9zRs/xzl1KzvrTb/VEXSc+CcE6L7Q1dVz/37Pg5zume715/4vl/1907XH/jduqF15T/6kkRb9NOsuAojCbSkpkQnhgcuXI+OAePy+URjDYizy7PaRhjHG1KBF/Re5eJ7zIhn7ICrV1fasK6kBEd5uCSURCeGSCxceZr/8zWzIgiO+b+GDBw/ef//9ixcv9vb2bt68ua6u7vnnn9+xY8eKNFJ3pdO/yckepUfJjrkLEtxmSrBRjNmbNyUiPlLBMY7MRSYDutrarAbIXnuNpKTlOXmieBsE5Ni5vk42Lp4wDAxg2V/asMG1Wm/Zn3TWL/LJ381u3QF1ljOcUU8R+08zrfoSs8uvzyIriSTtUZO2a2tLJM5yVhGDfX3IXvbWUmszyfFrABdm+nt7+76Eide96GA9oA/6wW580bKDkIdFHlFw44aX+6WPhv4Gy/7lpEP/cqg/L/Jj0jqaFJKVFRkHdLS0RMYBMcd2p7DotR9x8OBNBBNFXeWqmixiqcOHjZ+5Zw8FBauaEtrFLu8VER/wwbvvvv0uy8O1a9c+++yzd99999atWyUlJWNjWmEwd9u2bRs2bFh5jY4//bvNuv9ORobvJyTm14nk5k17GCsAK39DRCIRGtDcPOoNBB096l80I8d52GmJfj4CGBhw7H7r+8u8Kv6f8APWO5S76qZbbVUOmrwlyYA+y9NXx7HvzZYAqEPZl+tp9P8LvrjBDeAoRxUoiK10hJWaFZx0mf/TLxhQtRu7V81+HcDSTBec8s/+rzseLf9uFsPAgMf+Ysj6U/WG/ck6wFmM4eAT+z0BsCdLSkQO0L9nXFQUGQe0tNy17C97+eUY1+c5FYX9rQCMM25fdzPGGMXFZjTgyBHT6UUHq4/Ip0IVLLNMyP25d+/elStXXNeVBlRWVnZ3dw8NDUkGVly44hr/keG5/8tZ4q6sDPubvDx1dT+p4NjLtm2bupk1JaIiB4J27PAf0WPdfxsBWHtMGEofewuQg/CqyzpHGmmi8jBh+1nekl1Co4IKxQcZZFgBGGVUHpVuuT5vZrN9sdIJTmi7gQ3xu4ieBnzrSv/rL/ZP1U3zzXU2/nPKY39/zCz29xBNAK5f59Ilw/4dHaUvlx44ldfAhQNcWOaATz3sBxYKwNprQKTKe3GAthcu9NpRIJmmSsaAX9Vx/uuv8l+jv1J582YKSigtNRQgx//AASMAycmrUtRHXd1kkiMTwuo2y3x1eXIoFNLgj3IAjuOkpaWlpKQkRRuzSHwoEDFnJyfHSwAss615QUB/f+ypYH+IDALGmpqsBngy4Ace+yfNpFpPX8z42Fd7yLZfPXXvZiii6HmeTyVVF7+FLXLwdTc0fCrjUaiAGpGxL1ZqoEHKoZ+s7Auib9/u/N4/7fRe/WZUdX0g/G74Xf47Mj846PhayUPtpqvLyAB0vtv5n5EtF2VQv4o5gJ8kOlLs175RW2sjAEDbs7Dpoo0D5J2v6InF/qmpZGSYAaaSEtOMamp09kSVE/t4nI0DJplcboxcUVGxe/duufxdXV3y+pUD2Lp1q/TA/0X7v+I34J3lNgPrsae2aa9q2mZV/BOe46WCdV/27pVCt80fcmREqh3/bbGlihDljRutBugEOulduNBD7nmbDPDVFCzFpwzyDTZKtXRzI5ebzcrScZxULwLwU8UxNKm9slXUgFd5tZBCla6W2g46euiRB6PuOstsEklppKlo+oMKKrazXeOc9dRrPx7iK2J5OZbwf7IAeqGKhLv//nuTDzgyx+85XmXFkRSnF+L9phFiePW1wX+Dby8YBJYbPjtLWRnh8DSchXTY1GLiAPnoHuI6sRUA9Uv7Fhi7KHl0xHu66OPd6ifqP3nkSQPwC1tJB8bHx/Py8gYHBzdt2lRTU3No8cWMGuO7Yu9GGXzbZ/XY9G+drN26OKpd0bhPOJFhv7Iy0unJyVlohzZsJmBFb4uHwkITgKpJSAPgIuRC3gPJwMInkhsXFYDiQRqH2MCGUkojlmRS2VUCRkdzwLD/Rjb6rOJGloM9skSMBanRyv3vpLOX3hFG1HTnmFOhFB9kkSXlU/GrqdZn/Hcq35mA56tANgdbZVmJFQD/vckvFmpAY0LYX0iKfczX8fGqmhT7RUwQl8kdm54GhsDEAZAuC7M1tEInlgD4GOpZuXKGIcRiqKNuD3ummV5ms3GeffZZ8f7o6GhqaqrWM/B70bHfGVsGH9WT3M63LF1PeS6wz7bmLIwId+60LaFt3vaxas1v2zaZndIlnIdcKwNhqkJLnHPPoDEGsW9SIgJlZdafycE+/u+7ik8m3vf3AfkrMvuKw1FGIwUgk8xlTvdd3k3aUSWbFwD7IUFY+d6EI/NxjldZJSTFmPdzoqxZ5muvb1gPHYMuLw7AWGHsJ44Jq386+YyhmI5T8CWWe9Gh1a6ekCXqdl/xo++W0D9/0LtQ4eu2xBSVRejVEFyA3Hnb/ORaHYQhGCQaQiHL/jK/COEboTV7UUT8rcY/QhmQAAFIWG9yfNBpKHEC4KNfOqwJbs4LgLYvQQYB1i06wQpAzwq/Cd0bBYIKEoTbNgLAbF8iOgbnbeYJxbLsn008CLBVNi8Am3mK4bC2SCIKBqLs0MQW+aqrNiV4CVyeFwBtXybAukWbJWr/SST/3cGLLEYS1/cjBoJgH1GwlPsPDmRjLId4EGALVMGs2T71cGRreHLXZSGGhzl16l+fOsUPfkBjIydf4qcxcNjClhd44ZExPpenDgECBAgQIIno+N1YL7sX3vLcs+d4roqqOup4mhEgQIAAAZKe50mYeXaO++/yTzD2PLBzhhkXl6ccAQIECBAg6STR8QZfVQQIECBAgKTGryX7BwgQIECApEIWQxZfbQQIECBAgA18fRAgQIAAAQIBCBAgQIAAjuu6fF0RIECAAEEEECBAgAABAgE4DX8YtoDzqL0J/wfmeBxOAi0Z3lit06bAT8N/hB6w6IP/Dr8R8lboFPHDWV2Liln43/AmOFAMfxA+Wt8FibR9ROAm/At4A0IxVIfjw47An4cPeTJGMU3tG6vTSiC+s0cv62H4u9DG0rgH/wiOQwh+E7yDQQf8Q8zOVPi2dsZ0wcv7rcV34LdBJjjwCvxr6E/EiRfiV+G3RlzIv4GBZV9HGvx/8EtfxwhgH9SxSqiZt0KwyIc675xPJwKUwAEisAP2z9vKo3L+0AeIDS5rCZcAwasg1isKoc7YaiAUIQCRqIPOebtFvAjgJJZkUqBBtnBZ7G6M9UAbK4e0eeqXZQbsHyAQgJV3/2Wr6v7nL4iPIjVggqcJwVtvGxYVgE3zGtCj7QreVEv9+2EbMeBt1hJv8/VEgKRTiyQBuoiCN2EDHhpZPsYYe8CDAQZGGBlnfJrpOebsWijppGeRlU9+CSUppBCJXfPsv4dlYHCQe/fo62N0lKkpu4w6GRnk5FBczPz6Wamwc94WojxCA84yj+lp7t7lwQOGhpicZG6OlBQ2b6aoiIoKc4plYmJi4sqVK52dnYAW9tLqvlrikZhhr03FHx9nZoaNG0lPJztbpfa3eN6CRjELP8+jKIbniIbGlWZ/3cTubgYGzK1Uhc/O4jimzlVLKldBAaWlppgR2A4HrAAsLFU17P+Ennt0wydYqAXuY18VVfjDZ5/R3h55tv2k7OdHDpD6SB2cijqo+x0fqulsZGMaaZlk5pJbRJG2+ISPs8f2cvbDRNZRY5Sz3INPHo2x34AO+HTBzhiqy/vlApxqXDQDMMqjeBnyHm2qp3ycdeF5G72f+k8CjBGBVyA38nD+L4U0+AmWi8ZoAuBDA96MbyXPDjpuc1vb+9zvo2+YYQnAFFMurhWATWzKJruAgi1sUT/czvY8e5cyoQ5rfiGaaGri5k3TR0UcIyN4ApCZSV6eYX+7BPy2bZ77nxc99uict3tgjnzjBq2t3L8vShJ5GwGwa36XlFBdze7d1NezHHz00UenT5++desW6Iq2aY3fV199NVlXu1zcvs21a9y5Q1cX/f08fIgnALbU9vK2b/fJG1E0oPhJd/+tFaV+1YkKZSXNarkq3BMAK+fS3fJyVZy5oampQM489R+ATYuWav9+0zC6v0d3H3cQcsiROyL/I4Ol9fv6dT75hNOnwWAz7Of1AzKd3UdvXtCnfxPRYJdZ38xm9YUSSsopr6ZaXQN/8H92nzgEh4GlBMDTgAULJnoaELK/XX512V9GgXl3PUtowMsLCuBPebzz+hIAHxrwChYxiGCa/eNVEgAoaKEA4T/DKfjlK1d+mtghum+i6RrXbnGrjbYuunrpHWLoIQ8jBUAdT52wkEK18q1sraFmL3v3s3/Dvg1Y9i/BF+T1nz3LpUtcvWqoUDQtPz0cRhBNSwDkMJaViQTFLOn792sl9Zq0tBqiIt3TgIGBznPnXHtkEZNOZEnWdc2Rc3ONH7pzp9k/PMxzz+H4IUDp1E25/9KATz/91HXdI0eOpKWlVVZW7hZTLwuffsr581jl6+igt5exMSsAxlNWqcWSujx9NTjI4cPL5A1PA4qiLoDqrqjjL8a/fNnomYrT1kZnpxEAVWykAOhuqtqlu5WV7NhhpKKuTh88378yWqnS0owG9PTQ/V16vqeKOsIRudgi2ROcWDKwVBOQffyxaVy8YKjfHK2iwndVWozAdwkBTxIALzKWY1RJ5Q527GJXHXX6J9Hh/+z+cUi2vLN0wAVoXLDzIjTGdsGGhWMos8e7Ly/nV95ZLfv7/6kPDXgZYrwUUuHkquUA5EyJd/LzXRi31/IpXGmEv0BMuMGNc5xTf2mmWZ/vcMfFBeOPlmSaLrxhg7rz3OTkxMjIxI3hXv2NWrx8HIULnXT2VvYeqTuSU5fDPvxAPVLutOman3/OlSviffXqPLbJjXJwJsOTg+HBzj6J0TV5cfIra/r6tKR6zTPP5GRlER07oPP+/c4zZzrPnr1y/ryOnE+fOCevxjCJAoCRkXBn5/1b5+4byRkYMLSrL0SyPjA0NNTT09Pa2qqBIEBxwIMHDxQEsCycOcOHHxoNuHhR5ZKOKsYRcYhBwrPhgZGBeyP3RsSPMgnD5KRRhYYGVhDuijr+ukG6gypLc7PulDTVjtLkkptOUTLJc+5cOBweDY8O9KnJ3CAnx7j/7e1qAPUDAw1Hj1oBeBKqqmwcIJMzf5nLYn9r8j+IDsv+0ibD/rt26SDGDhwgJjxDCA4RBdNMjzE2wMBFLsrkG+1kp7yoBzw4xKE97CE+nCAEB7EIECSBjV+cnu7Kc7T4xBu1Owk1LBMi/dOcPsvZ85y/whUwbmh1tXGU9UHemyJmx5EAIOobHjbU1NlJa+v4lcEr7bT3JPUM7Rsarxs/UXeiKKWIJaEDXbggEpQGyBEupliO0ja2iQ0lKg7OBBN99N3l7k1uXuu4ltE9WDOSWTO1s2YOnoEcoqOjLuVM5+SZzq4znZfPydeUSm7dKrlUbRkBEF23tYkXxMMDYXGxPG59J4koLGQJqBJSNeKfm5vbpkMYaczLyMgIhUL4x9WrGpMWi6ngqcPhgzwjJ7GCCtGlBGCSSZW6lVZxXHNHs6nrpCSys20iZB2yv+6dkXDdx3PnTNFAZREpl1KaR56GCo0AMBcmPMyw+Fs39NbgrTH9fWdnaV9fw+how9TUgRMnjMg9GZ4A9PSEb96M1IBUUqPVtGV/bXWrLPXLvHP5xz/Bw1Y4zAK4uBKAUUb76e+kU87Tda530KHP2iNh0LcSH2LCP8JDNYEGBALgwfVIYdx3YiiK7y/2/5APz3BGPktKiukme/YYiamoMMSYlRUpAIZD1RM7OuQCq5uJBIaH976XVPcwvy5cVD0Nx6F86aHZ5mZ1Tf1YZKGlKw9zuJZafbYDu+OMq7urIykE0M7BqcGaj2pqZmuyZrOYhWcgn8XQCmfy8s7U1Z3u7Lw8OmoKsm+fGU2RkonqJQCSLvmsKtH0tLhrxFxJTY08cT8CUFFRUVtbK69fvA/oswZ/quSf+sTDh7bUosvk4fHneUmDGOIFKV8BBeJKyZ4cRnGHTSE29zWb2Ki8HOlY/AKwssM+IHdeKmrDOLWGTDIbaJCru4Md8n9VIt1KFcrFlbANMthFl1pXCy3yNm533G4YmW0IZzTMFubPbOQZSOFJSEmxGiAB0LZtpM3TgKMcZQH6+w31W/Z3XSz16wj6RdzjsVWLaoBETgLQQ494X15LFVUXuKBbqZ1TTDk4IUIS+xjP/lXTAJc4EQiAG/fK7d64v0Z+5Ptb9hczyiE7dIj6ehGcfGc5zosOhhg/uqXFKERZmXFS6+o+27dvCqZB2xNQzRPQ3m6GOES+IAY8znFpwGOrV4pKdrNbHUnxgcRAnWfnmZ3MgbVnoJBHcRPOYOx0Xd0XAwPY/PHBg6Sl4UF0KqqfnDQCJvUa6Ow0nCLC8IGsrKzjx4+npKTs0ngCKnjZgQMH8vPz8QkNOok0pT8PHhw4ceToTx194adeOL7juKjBo2SpnUjNxdV90e0Yk8aqru7dIxwmFFqp7uYQN/r7JWNK4UgDVJWie4mZRufrqded0l3bwAYehTRAA1vVVG9hyxd80TDccODDAxJ1ZmAWTkA60WDv3HwyoFtjaIpTvSCgggoegaV+mWoauQB28EdteoW4qoToGGBAXovKmE32x3wsJ0Y9S2GKzQ8rxo377KU83XBjcFMDJPlh/xg0oIkm9RSN/IhuRJTPPMPzz3P8uOHN6M83GsZXh6quFglqa/0z8eOleQHQVlYT9ckf9eGuLnXmMsrk/4rrDfsvgKhfpr40wog6uboQn8LsvD0LxczjmqV+zLbFcXjxRaamzIUthIjUDm3l5DBw9yHj4yau8QcFAaWlpcoEgI5QkJSUxGJ4CUZgeH4bBgOJzd27koHMUGZNeU1ded3h8sOW/SNvl8pbQ41IRJVzffa6odrBQYaHJVzrhf3t4I9Y9sIF6ZN8f7G/JFxbjXdvZCOLIYccfVtOeRFFknZJXcPDBj7ACoDZPrPExCxPAGQPW1psEKAWoq1CDebxxRd4o/9qQd7gT2I8VUVvz/CMtrqzs8w+5OE97ikakEbqOl/hlZU8e/xMunGjMTVja/oM9nOkrZbX7y6zUQYC4LKSuMtdEY1Ccjvu39DA0aNGA559Fj/YvNn88d69aiGeWnyxtACMjRkNEKNBFlnqKk92i0QWROJzmLPm5dibItj/duSwQTRs2IDjGLP/MeYT32PjWxtL/n0Jws9AI/wkC/GtRwVgRDY+PtzTM9LdPez25VVu31KxpaqialPq4hqrChFdGsETJiclZbJ1NM9LEYniGBGtRqhA5KoRPIVxZjRmKYj9v8E3pOi2dIThw3kB0PbHiQpLTPX1XjLg9uBtbyBI0uLNQ7DsLzO32Rv8yc9P5DiFwiCx/yijffR9l++qi0nOlR3ZwQ65MutolCQt7TGzyS5jkTvjQ/wDFgGS/LcJ//Wq+FTjlS202Ai7rs70lMOHn3D/fgFOYWwmYmBk4VCMjQN+Z9QMsDVwcKyxLJy3QYAnAB/Os387/jAwYARISmRELCMjSrDzWdRdWRD2zn6ECBzxBOAxDRgZGdb/a4eGS5iby922I3dLZV40bvZcL+ujichk8fa7/n6nt9dIr33eVKUuLIyBFu1Ylsn/tLTguqIz+xCwpWCfMOzvYQY+8CcAQmkpXjLgvfciB4JKKY188kffc9BQv7HduxM/Sq1qkVLZWTW3uHWDG9qqx/kRADdmVX8WTsJ/jUsA7AerAVYMVpf9Aw3wUVtJ7krXvtwTRQBttLXSap8qqqkxud9QKP6O0AZTRENyMtZgmOF++u9z33Pz/eISzDGPD+AMdPqfgyXuam/HDBAfKKe4WDzo8znfIfg+kXgeWCgAhRjzMA4jjA2/NjYyMibhkQBUVOSWluZg8TcfP9VDHk4wMckkQmam0af09Lie07961RFr68PICNPTRlykfKLNbdsk+8uTgYcPuXvXVF9rK6ARvJ3slMNr5Sp2nIZZ/MAKgLWRq1cjNeCLpg2W/U1kUl6+cPAnwaihRnlgOf6ifvUydTfpgW7uJjatrtf/i1CML4RCYnm1LjkE2noRgD6o1cnszkTkewMNcBP7LqAHPBDzdtHl4ooNKiqU8hUhxNwgre/RuHTTE6PpfNnZdtaxeogdw62nPoss/OMK4EUA3X6lqQ37CH5zM/aZdCN9VVX+J3oMwg+isL/w91gE6bLiseLiMZAJOZBrtsLNxSdj6+700WcnT8lVV3XFMjRsa+nCdxw7KdpOfJuask+XGopUNrunxwzklZUtQ07u36ezk9lZOfLyZ6uoqqaa+PEpvuA4kU8EtfS3lDglJW5JSU9J8+X9Nv0rXrPUb3NTa/WQShllqp9SSlVRI4yor+m2SrgWVpfL2mHLFtMM8vKorKSoyIu07E51De1cXfYPNMBdi5fByfUWxfTQY2eViWfUEhKB9HQ53WIfaY58ybOcVR5qjDGxntzJcsptLO8f/tlfjuH580YAPvmE9r5NPHfUPvFq6XUB2omCQRghxPIwNm9CrrHFIMdfLu0lLt3ghhxG9j7Pjh3qhDFyxFn45LxmHqRdvFg6c116l7LF8H9/P61X2l2RpSTh4UPpgVhSwuz3+Z++PpGvzVXYHGyCu4ZN7To2IfzDHyoTYC6jqaTpUvGlS8W9vXDMUL8r9lftRYGTkMH3IopUS/nkSwDU3dTpBhjwBGBdZHUOHTLhuJqBjaMsDh60O0UK2rmK7B9ogLtGbwNVixxmeIghQNQgXzM/P1FOiR1vamsTjwxPDv+AH8gzUpgsX1JOkwRAW9kKMsvEBGfPcu6c8f21vTFSzIsHOXaMo0YDSATGYHReAP4F/PNODFzuubgzzIj6Bxm8x70WWi5w4Vz6Ofaf4MgRt77eDGHHgHNwGj76YN/tM2/U91RWmvubkkI4bGjz+nVTIf3yltXP8/JMfasq/GBkhKEhmX2wJ5dcsdsadIr6evdLAQh3d6c2N1/pvVJyu6TlWklzc8mt6uptPgZ/7Cmc1WR/W0VZZMnsgKc63SijLMAo/jHqh/0zl9wROSQrDVg48UI748JF778B/Df0xAnAOOMPeSgDM9aXkWFdwISguhp10cFBpqfFx9MDZgL9da7beNnTgEoqNX66ne0ppBAHdBJNVzp92lCeIoC+gl28etD4OGrix4+TIERGAO4/ARdrEy7vzDI7yaRoVYNyrQWtP1c2VbLtxQ0KTXSFUqnYnsM7Lev8S8Mff+MbfV++d8fEeaEQdg6Ejfa+8x3mmpt1OxTvi1J9pfvGx42p4YAGiTPIkK1Jp7ADQZe7u/9qT89fLLxa8hdLejpKfmdGxuUDB4oPHNikb30kTtxVdnnSSZelkWZ7nGRexgK8hU/0wltLsv+PL8L3v41E4xTCp8Z8IGD/d+CNhArAFFOyaaZtKsja45iN9q/o2Bj53+gQr83MGMYpKKClBb1gp79fzq8sk0wJgMRAAqBguZZa+6IIYsXlyxoFwWrAVN1Bkb6I1ZgYNtHsPwfuc+A+YuFZfkECIPew5yd7/njJz/y85hpUVW2tqdm1b19qrCm4wT/J9RdKX3zx548de66hwYZ3jqe/jiPytPnwCSMI9++bf1dWsiTUaqyBhFmWSiprAbWc9v37L3V3X+rpyfje9y53Xu5r+mH6c0eL9+8p3r/3RFXVepicmkyyNUBxnrVY31PWC6c86o/O/hZrLgBv8QkyHwjY/9vQmNAIYI45F1fmPRdv7ckN8x0I80S8CMVY/DqeCHWKl14yA09lZXY4yNBQZyddXaNDQ4oGZEUUyf1vpbWbbgXOMb9NRQfW4T7/nKmtNXaqm5Gf0lISgctQHyEA7lEWgZM8s7G+OTROxif5P//fPy7cUlheXr4j27wy7TCHJYcsH8dzOFGrV51qVocq+/FhD2X7y80DUEZysXPNhoZ8CYDrMjdntmBbjYPDWiAc5vKdvZfvdF++3eP+i9Pf+M7xX5P8nd+4/3LxgWKZ96q49QM3usp8lyUQCocb//t3//t/58l4lnWDvfdgLzGgJRvOf53YPxUaEz0EZLuubMGj+UuEpu/AJFHwEhZ+BMAbyZU7KvffvvBAAiBXVBpgXzXXPWae9eukc5hhXV0aaTXUsHzI6ZLDOjaGEZvaWk6coKSEBGEL/Bv4hfk+7pzF/Qc8ihBzjeYKHz5kYKCv85/33bx59WJL1m52q/gT7sSLvBhDOuS4tSSx/yJZtpwcOwXCG9XxOx1arcZOTZAM6KZYYw3gTfjaf/v2qzv37Szt2l3a1TX5z85f/lOXi5OL7SRhtZm1XQXT8/ptNOBN71g2fiQEL74Nb4DD04BGYNeyNeAGtADnvzbs70BobXIAdtRH8fskk+Ewk5PGRAqP4BcWf8h4ZgV9j8xM9u0z9uCBqN+anHa7ZIr6dxtt6j/ppBdQUEGF/y4dmdCyNmWfdxb5JQ4FsAVKIAuGMXD+GO5dIlevEJdiJaq3l7t3uXqVz/OHT5/+ZIyxjc7GLLI8AfDPUn8b/jSkRp9Ua83qv67AmP/aDIUkGGHCajUyVhjOkkVtb7eve3O0VTOu3Vdb1VVV1rXP7epyytrM5ADXCMAxjvk/z2poQOS4v5quupuMGHDStqWXIuO4dS8Ay9SAG8YEtdwg67vqApBBhjV14NFRZCMjFBYuETeo9/+4HWZ0oRVOyTqVyH076hgo0/hDcbGxhgbDgurfN25QXi550OD9Pe5d5aodDlpsyliKTwFAAiBTH0woSqwGWAGwqFj4KWKhhJISQ83DwzQ1N+WRJ9nbyU4V3xc3RiCLlYd9YEBb0ZpajWyEEd25RK5PPDnpuf8mbDrqmvm++/btK+2alPegGjQPhjpqTMaqqFrD1fCHGLIP/9j5zzL1uDj4NB9eejqelqyO/OQPN75uz/w4aykA2WTbx/j66BscpL/fEO/27U96JreGmh/jx6aZjihJJ5wCGqOsWPcMfAhzy0zu2eUIjKvuugwN0dRk50b10rt45/AhAN80ApBiBCDRsOyv7XU/PCP2V4air4+bN2luxi7PqbDICoDFWg5rZGXJdGt0iQMM9NOvmyJ9In5ULSOrb+3OHSqprKfeWG09nRM2ghxvarKTA+w0hRChtaq0HnpUP6olQFqu7iYjBmz2LitzfT8xH389OgH7J0IA8sm3E3lucMOb3Tk9TXJyVA2opVZdfdadBYt7kWnik4u54idgBj5m+VBPOXIEXdm1axIAuVFyNhVQxyYAP5oCsnSsAKxRBJAO4376R34+RUXk5RmPsXfE0IccSSzWXAN0WZLnwkIJlCRZdKv4bJLJeJ8FKoJj+IFdz8eamN2yv2wTm9i3zyaQtL3Tf8dqgATgCEdYC6h+rHgPMgjoSuy8MOLG060B65/9Xdda5IsjEzrykwAB2MKWUkrLKVdMOjY+Zl/ucusWu3YtuHsRg44bXJs69tscn4FZjH0SG9fYZGVy8ty0GaWOkm/8Jk/EcyH4fwKwJv2gZGpqS2trSXv77YkJtmzh8OEl+od0yr6Ja2RkMkxYtvID6rFBXnVJCaWl0tXwVLiNNvtKwTrqiBmb4Rgc9TWhz77tRzY+zlHM4I9dVMfGjlYDjL3/vicA2lZQkXjVbKFFAZx915Z9rFndbTObE8CnT6cGOKwTqMPJ7LPOKdZWlv2dtReAJJKqqLIzreROacDh+nW2bjVdW5Tr3T2fIjYFISBKBGDt8zik2N6FZJKJASkQkq2RAPTJaS35vLWktVUacHt0VP6qhtDt9F4n2sCn5M6ag2ONdQKJUkUFlZWmrbS03OLWda5XU11GWQ45xIBkOGaNJeGt8+UN/lhjHlYArD28ccNbM0Cm9pNIsrVrn13jmiJsQKGzVMp7MjXQgPXL/mNjcrtQR52edhzvnXgJ8P0TKwCCqL+GGjkp8uO6u4euXDEdJTtbD8pbxfN7967DNTywCRqwINsGAfMacBED+xIICgt58mwd+8oB3YyZmSyyMsmUEQP2G+NvkGi0GqONLa1b5lq3XGjd8lFbaHY2LNd+505qa+3Ei532Eh+ba9Xba5eBQfGZWmA66awfVFfbl3koYOyb7WuiSSQr9n+e5/0MBPXTr5S+4kh57iqapX6OLi0Ara3e254XDP54cJxIDbg9dttLBhzmcMLIVn3KrrCts0vHxf672V1LrZRyxfnUBeep1wCH9YPOTrq76euzg7G5uYYSHWcF2d9ZLwKgTruHPTa/+h7vXbhAVpao3ziehw6p5N7lRi3NHbgG1+GPY0EFNBjzQN58HDBrjCti/+9/nxs32LaNhgYOHoy6TndLi6RC3diOn9qXasU0D2Cmvb19YmIiMzOzsrKSBOCKx/5mm9KaUt5aXjlWeYkqOYYqukom7RN7zePSYwua377N3btyQaiiWKW2mcP1gpISM1Bo5+5dvHiRi9lki/pd3EMcyiPvyWsQfc7nIkf54+OMP3/o+dCxkB/2n5gQ70cZ/Fm4ZoCnAWfORGaDFaastgY85KG8fumUyvgJn6hzqd0e5KCEai97iRMLeuS6hP9rdlhvUNtS51SAqe4HW7ao6chTTQj7J14ABLXLHnrkaavhfjb32enTYn9VgjxQ9XGRlGRgkcHkcNgubsiNeQGwOAAN8xaJIm8sSGhuviov7ld/1fRf+2rJ3bt1pse7+xdfmBc4NDXpfsgLVuxcSeVyOzDoDP1nzpy5fv366OhoXl7e3r17n3322VAoxKribY/9zVbQ9cv7U8glAVDJxFE5OSQlLfI2CsVhZ8+K5kzyW9CvVHDfk4ETFWvX1YleTSsZHlY7OM1pF1eE3kef/Nwqqh6TAX1rV/mX73+BC9IABXPJe5KTjiW9cOyFDcc2kOZz2pfigCiDP7DoQNBoW1tkMmC587AG/e3zFoWXwikj0kyziqk4wFstWRqwYjdxQY90wXn6RoQc1haTk6YBp6YaP99xTNz94IGhnXPnaG5Wy0lONrFuZSXl5cSCe95//XW9soiPCRMAReJqnRNMzDCzkY2fT37+3nszAwPcu4eyAhUVFBWZCCg9XWwlbRD1O6Oj9PS4nZ3GBTSZgx7uQi40RNgOHkepHQtqbp5tapprarqufizq15lU6XJ3y8p0G8zNcF3pj9l565a6u7hQ/6znmV3s2sGOGEZC5KF++OGHn376aV9fn96vMDQ0lJGRcfTo0UQIwAAexD52tE0E0dTf9OmnJuwZGzM+dEmJqV7XNf/s7JTeoVBMfzA4iHxGhWj6YTnlsJ5Gj9UmFCSqKagXue5Ua+v7vD/AwD3u3eCGdFrEJ4oX284xN8WUyLGXXpVd317hijIHodra5OP3ko51JR+9/2xu6ZKDP9b3jzL4swChUKQG3Jy66QmAiJjlIBf+DZF4AKcWvuNhmmm7AGQnndI55UX0T4m3TneMY9IAXe2qOteu+zRqwNphZoYf/AAF4xrgz8lRbxS1iZGMV2tpB7UwOcEarZUTHPvb8G7K/LD/tkdY/48kTADsQNCzPCslSCMtm+wmmi5fvqcuJ/UrLTXhT1YWaWlWACST6vWqKOf+fdrb70gnHM6bVd0p89z/aNVV0c+J5s2zzVs2NO9OY+zS6CX3gw90FJ1JsZa5DVYA5P7buWDygUdG1IU0enuAAzFE0PL6Ozo6rl279vHHH4OilrsKAvbs2bPqAnCehVAtiY366Zfc3mq9pVJK5kT3BQWmeq3wdXerBcr/MBUgV1rc0UDDPvatL/ffYts202dcl5QUNm8WN4vZW2lVrLOFLXnkKW7zBGCMMRVc5CgJnNK+/YfChw+fOXYs6fjx5NLSJDj2xKDcc/9VaQsGf6Jg61ZPA+TTRWaDl+uJ/y54BYv70V7cKQFQGSWB97kfJiz9s2M+dsFkbRPAqq7Lc0RFgHrohh6YA3Uw09N+4RfkfKn1SgAMtQ0MyCPTfhviHjnCgQPs3UuMOLUc9pexRgJg5wS8zMtZZBVSKGezhZY7I3cuXepQl7Prd4mhVEWua99YoIoyYrCJut1UbuMnRFViN7X4/RTzBDRR3VS9oWlD2qBRGnVIOUp32u7Q1mZOIKcyFDLnmJw0J5ieLqJoNwfFgHbB8RieNJ/9EtPT0xigNICGoLRnbm5uw4YNJBYiBXHBJJPS2s1svvbg2g8eTFy5Iv/CEz4bFBlJPsEucZxKLQ3QTWF9QmN3ipMzMkz0VlYmNRttbb0yqzJdCRGSe+4JwEMezjJLUpIR+9pa9Sr1rbEjR85UVCRDEiQT1TP3nvtsa/Mx+BNlIGikq8sOBFlTsMty8EOEsP1vNKSQoh4kr1/6V0WVAlaFrRJvfSZR+Aj+GYsjwE9Dj9UAWTjcHQ4PhsMY1xD7bivvOeeaGuNiyEuUZWURGyY/mfyE/4rsyQjBNpZE0mqHW/LXXuAF23ZrqGmjrZPOHnoGRwdHBcLqwA6OunQW6eVslounjiS1kMdnV4VdgqduQ7OxquYqT2nUSXQiOU0DEwMPJx5OM6ZTiOizqNHB1dt1JepCCgJiSv9KU7KLioqqq6vl9ff29ioDXFVVpT3+2L8i6mGNxQKVV+wvZlTp9Pkud/t6+oZ7xvqYBlTwYjbXU1RBhb6V/yjxe+LgT3L0L/x+k0x82LHDrltJVZX6jYIs7t+XiIVHR8MmPpgzXSs1m4wy+2dUVuondvkBeRZDcMYKgNl6pP6TkevP2+c+Cy6ZvdIV6aId/PH7mikJgER1drYFimktxoQCC11yHTw6Usz34SUeqk4jTbquhmqnHUgJ1Hp9phx+cqmT+8Ib8A4JgI8Ljv0YL63Sia0AeBowOSnr3TI59IIJMaen5REaLzQnh9JSBbcmOdfQIDGI4VLsdawwkuKcz+OfoZSotEPV4uVeeocYGmMsHCEAtqHLS5WHXkqpBEMfeDLC0GSMZnDRb1/kRSmHfc9BN92DDI4zPs20TqFOruNbhVCYv5vd8WUr6zTuLyWwSeD6+vq9foO6kyyGHPtFrFCJxBGqNI0U2xEhece24HIhLYOUUWYXQlBVxHCFaXDS308y4OSKzA1+8UW2bxdbm9xRdzeDg4yN2QEiEzmGQnak1SSUysrUvSJXH+2FM48LQKO3/ryoP+MSb16GSWzKSq6G/8UhpEm6GAUo1r+7DMVQQrNNCfibTZ7sfcl/X/zvbL+QfmeSmUuuuoMcKZaDRh8n94X/xh+AB98mBiT2gv/bon/34mqe2Hb7KasBU1M9h6b6qqZGRowAzMzgOEYAsrIM6VdWmoazlJfY6P864kdSTNM6HZYPB0caIJtgoo++YYbFUJ4AJJNsG7pIvIACfKJ53u7ioZJK2QgjVmZ0Ok8AdHzrSRE35PKnp6fX1taOj49v3rx5+/btehg05kaevRJ3N4ssBZeKbB7wwD5/ZV8XLAFQwfPIEzc5OLFdYVr0K3wbvhnxZcbKtlQxu2xykp4ehoYMeU9NiXaNAKSkGAHIzqagYNE38d2fjwN+z6MqlXSZH78MsjYsrEyyLBw7Znw51wWG4DKUQLEx18FZQktJ8SmREgA7rBQbTvo/uQ8UhyGEHyTggv0f4KWEnDgFymT7ptg3NTFhBGBiQgJg6D4UUlCKX3rgpP/riB9Jyx/XcYgP8vTlg8uIE90RArAA9hWJrCYKvwTLxhEfu+Kq3rhXLPkmj2Kjdvn7SYo+rd48YdkycRfO4CGEcJvQJZBdJk5ETuS/7gkA7MdDNMIMLVJ/LiuOkP+9sWNdXXAoyq6E1dSULC1Nhn/4KkICBMCHBjisHzTPj/+MEA0BAtwhAg/h8rxNsrKwA0GexZ5WC/AUY8oaTwmSWICwE37oPmQR5LF+cGPe979KgAB+cWne2llxDDyqAQQa8HXE9NMtABo+/piP+53+9d4Qm+YtQAD/eMYYf5UY4LJyyITfaiwGrMPTu+v8gr9hjP+QmLO+Zox/t77umH8BaKX1Ez65xCUceMg83k3szfeBN419dfC6Mf49FuuutjfCr5P5y4X9Rtk6LUckAgQIkMTzRMK+HP8aM/eBH8WC55/nq4YAAQIECATgJAuww9hXHAECBAgQCEBjwP5fTwQIECAQgEIeRSFfAwQIECBAgA18fRAgQIAAAQIBCBAgQIAAjuu6fE0QIECAAAGCCCBAgAABAmxwwL+9CP8Cenkczhrb47gOfwdOrNyRnZWwZ+DvQktMa8CdhN8G3yGR8FHyDfC6KRUXWZ9wlml74C/DVVYUw/Dv4UfAgZ3w5+AyfjAL/xveBAeK4Q/CR8SJhHVFZ40sOn4Rvg2pkAW/A74Hq3oTnAUWRAAJQ5UxKiGN9YJ0qJq3SHTzNOPgvB1gfcJleUgyxsaoHTpAAB9wWEsEApAKlZZt15Mm2UsK8Qh+BT6DMZ5CVEcIwFcFSdae6p4dIECQA6iytv6CEhYIgOxX4QtixzRcIrHIiWD/bNYz3PgFIAgFnnYE7n/sawLfvUtnJwMDTE7OL3D8IhRg0UjsePCAnh4GBzFrA4fNwe06fxkZ5ORQWEhx8XIHyz0UQyXfqWS0BO4nJVFezqFDJB7nztHRsWVmxggAWUW8jodGhFR4B9qhzWzZEykS34fXTj1arkz4BkLjp3AMA27BF3AV9rM0bt682dnZqcUstaJ9SkqKlrQsLS3Vcmb4QB99t7k9zTR47J/O1gYi8CyxYGBg4MGDB9pqfc3JyUmtsO84ji5Pa65lZWXl5+eXlJSkpqYSK9xovfLhQ9ra6O5mZITpaTW/jZmZSYWFSWVl5OX56OXuo60vGoYXDDnvhPqIhhDlALPw8zyKYniOaGhkRTDOeAcdPfQMMxwmPMdcCikZZOSRV0ppAQWsHFTrugNigqEhwwGCt4JuZSWx4tSiKYBJIpFFRGdsXKk74BA/1P7b29vVI9RP1R1c11Vf0LKDBQUF5eXl+pAoAdA9uXCBq1dpb6evj/FxXBdeiLfNSUhu3aK1lXv3zJ2XtEgAtNMKgPq5BCA31y70SlUVO3aoUcRw36vMj9+u4vz9lBTsgr0J1oDPPuOHP6S5uWp6upJDlXxzYdX9GFTCF/Ar0D6vAbshv8Xs5bVGODlftEz7G97CfEflfUos9dvtn+EJkNT2nD9//urVq2pbotqpqSm1Kq1mrBXtd+/effDgQTWvJ7UFht7n/c/5fJLJL6k/jYOv0mAJ//+n7jzAokizd38KUERUGhHMNJKlQR1QEAzj5GfdnHdvjk+8Oeecc8453/vf8E8zOzlgwKwgTZLUKCCSJEuy7s86Q03ZQFNd3Yzs2e9hR+jqrq4633ve857zfeU9AHR2dnZ0dPT09PT39w8NDY2Pj4cFAEIUj10jSvEMTgIVwUDiZc3N0tCAK0pfn4yN8aRJ3C9px46kvWVJB78vB0SHpLndv19vlYsYUGAFAIkUAFZGoD0R5hteEbuxEWSDNLRKa7d0szO8PlHVFFOfKgr081Q2nupaKqW7JA43orVVgkHp6IBhwgPBAA0Awk0G/QsLecI/JDA+AQCDac3a6O+8kvxjo9wBvLK5paWFedHX18c8nZmZefr0aXJyMkxoz549zNbCwkIeSM7UWOcAACeqrZXLl3l+NpPkwMCsb8onZobEaC0t3HPuPFOf3EL6+3cNDe3YOr5ly5OEhKeLiwmzsymTMztGMjIWuPPQdp70zXOUAwE5fNhDAGD4+QI7fmNmcZF/8T4aS74EI17i2nx46i9+kTPxdT0ZWWZfEcm2RpCxFAO6nzwJBIOBxgDPSV76VtvkV37guDnBYDC7qVoDAEKeVEkkA1tra2svX758584dkgC8B0KNb4G2oCo5weTk5Llz5yLA6025eUNufCQf9R0akYo3pOK0VKyg/f9TcWnQ7oGGhgYCEufT3d2Nuw8ODo6NjXFWdgBITU1NT0/fvXs3xCc3N7eoqCgQCBw7diyJlC7GJACvvnRJrl+H3+CHwE/ynJFIAEivStx/LOlAEtAvB4Wf8jvFfSoABBhrxIACRjSwZSPQbuLLum6uDd+/Ile40UEJkur1Su+IjCxsXkhgZj55mkb+Krt52mixFPdJX6VUEgkkBuPaX73KfQASuAMyPMzDuzeJyNbN83A/5j2TdXBQamokNzcuAcCOATu4kvG8A/ZNMGIl/nV1dbC0u3fvMinu37/PtJ2amiIDYLYyEfbt28csgK6RHFRVVREP1jMAcGe4P599tvVKQ7VUl0gJMZ/nU/NgcbiAeDDSbe45b3v3LmFud+e9nJyh/YWSeYpH5gPLPD1ZiHVPnkxNTEwND/c/fNjY82lGV1M+MEqugC9IZaVEowOAnn7xP0Pe8f3N5Jk6CCRfjunHhUL+iYN6GjyVfsXHwZ+CzC8NAP1TYkBjYyj4i1AwFDACRaap4o96GYGs6a4RDL7Z9DA7mOEfLCwkXQgwJIKRyN26cuXKZ599hj+dPXsWHkEM4HH2ZAP8CdgFcEkt33zzzRXVzFtyC1x4NnwdEH+gn0GiHgP1a71+/frt27fxdf6bDEBEoDl4OXx/06ZNeMLs7CyKUIdlTICCggL+48GDB8QJvH8nOaLnGMDH4YoXLsjFi5BP+GyOnPCJL3ExMXEocfPQ5qT6JGa7HAgLAK5SAXP9deD1QH+YPk+CuiAXrspVHgeSsDMBZlCxt2Lbtm0EAIgCYNTV1fWb3b8ZkhCBAWkINPD89GkwgPjLHQBjeoeShVl59IBY4sbU48edXV2dHzSTmIEZhoEigB7s8rEp62/e0D9N1jKc8eKFCxeYp0xJIJ6s9/DhwxB/rj/TFsIEeyM/YAogDZHBv/zyy0yWdQkAoC1zlLvEPDkhp8/JuSqpOiAHuOV7ZA/AKlEa8Z1kAkkETdxXX1+a11/8dYI8FJ9bC5IQAMi/QTcepQ+9hbGSG6ASDbe1DTd+GLqPUkSKCKc+fVpwB9cG7Opo7r6tcPwlBwBGjlRYiUgkRVOhxq9jcBB6/04wSABgsvEWX8B7p7wThLOSRDU2JWcX+/1fyc4ObNnCn/Miyiz4TX19PV711ltv4Tfw6O3btwOvfBDY+v777+NbBw4cYM5DMZY/Iwjo1yHgvg5e5tGQxBrxdRz9xo0bnICQAGVnHzp0CIKDJAXiEABgPYAOihDKFVQI6CdUEK6YBiqMnj59Gs3KcxqK+IMrgv5n5MxJOQmrhd8kSVKCJODhsF0ZEGHcjK725wwDxi8P+mOAPvreJblEGMANKisrcRJVnAEg0jKcp62tDWyCpRItgIIdsoOcYKtErUUgLdfXC5efGDDwJE1ePy0vvYRHKaVg8nODkIGCFy5ACgkKe/fKq6+uhvgcwvDpzw3aZZAqsLzIBh9iRmgMIBMlHQf9mRdQIv7JVCVF5vrDmbj++D+MLSUlBcZGohz/AIA0z9wAvHYtphdK4TE59oq8wvQQbwZ2K9uqq8t/dK3i7ALSXkmJoO2DzWhZy66ksbAA6Yf6kyrIvn0Pr1//qAEywG/xCHzBtQLAZFbw3fvwTj9wCiITWHCo9TbYi/Vx+wYSNQIxVWQtK1Y5qDuYbQaDBxuDp0c0BgSMHsM4b9QZ7e/A/Y2mpoL0YMlbhVkB/0wguzVQcTTy5YAywN1IKiHRpaWlJ0+eREsRy+AXo6Oj+ld+ArUEgDBZwEb/0fJDXwQAr8YHoUTh5ZcuXQLQOYGXXnqJrBbQAW7AdCKTHQDAenCHl5ElEACQjEhiSFwWFxeZFa+++irRIuokAHzp7sa3GIgYfBn4DYKGd1E7ciqw4aFfy/vN0oz6j8pHvb2mpgaWQFmIm4IKJyJccHyD688/4Z7IFOmSTkE4T/IAB4m68IMbCKGf6ru8dlzOnJFTp4Qqnc+n4iAlYOY4pcG7d+5kZwveWlYmVrjfYcO9/kfYPzci+m+x0L9GIhgaLPwMPnSVhEi4HmdOnTrFvNCiF65Ojs4sYAowX5gChAFuBEkwKtBx6prxDwBjY4RpaDu3mYnBnfaO/tTWrlyB/hMAApNXa15ByAFAuKPc4tUuoMmflLpnZxsZGQSJOaP2Yn1dIpkCoCVVVeLaVH5h9NsqEAHgy9J/NPzw0/V6sc4TJxr9/qA1JOjvv3U21P+X+jMzz2292PXhxe2Tt1871oM6GggEA4HsgC/bxzeMjF1oJvBoGER1dTUg6+z5ISTAMpjzgDKvIc1fLv3r6MhZjBn9cahh9XI+DofGfcGaEydOHDlypLiYfMaPry8rRY2TwRCWeDFsFIoEV6IGoA1C4FS08o85NGTQewYPQOSXg0BYmVlmo39cY0A4QBgb9Qm89Pzgr+3SToWfG0GVBVc57MiVuS8U4bngpAKU64nibeNtyMI90uMhAEAvoXfMD2ailnrJ7MU2KgAnT9IbwivkGSlJ7+/3DQ6mZ2auiPvOX255YehvrI6vNToiZ6QtpMLgO0AP9KNwotMyNezpwJVnnhIMIP7IQcxTAobdGUGjRLwDwPw8wM1IkjQaABji1ZCfSfaQ+ooeX0VLIthT1Tl0yKUjg1AmJC8hwZidfTr2/vXuWz40I5ICxKNoVaA73XdmFJePHVvXUrA2FzJSux849R8XtqDF4Kyst/mWfj+jhdH36wPTTxaebBrxf/X/+n/f+UBJIJAbQJET7E9bWcM5Wc2YsXgMKSSUAXKNr4SBLL7F7/krr6EUDL+2Gwxuy+3PA0DavS+kf8R3r4aLozXBH6n6cibKNMEayCY6g6xkgD54hDxFLky2CxUlBSYGaHHYdQ+rFmh/oHfHnJw00BlF0P13mjtJEx3z+KvWy2j1SIlXDFghw91I6I8NyzBNn/3Sj6qgsKLoH2Zcc03UYAyt460DMkDqMC7jaEHisMj5DzIv1x56yZD9VrPf8rmMFoT3M2u/970Jn28qMX16ekX0T97o60sU+k8xInVDoHASU1F4uLDa5oAEt5wMcVPgQ7we8sQkIi0mlYcelZeXxzkAgLg69BHBDPFmPT2ofcSAPW03Kt+Q6moivbb3msvlU9jHpExqmzkhJ1VSt2zeIt+Vvf9LTpwwR0eNhw8n79+9u0hOiEyB07guBX9Ow5/kNGsZYJ1LwfoRDP+sJh9a/nV3O65/Xd75OgvDHlx9cM8M3ssO3ssP9gz2VL5X/WQurfGdb83l7kkOFSQHJDlgZGa+LH/3vNVJVCarGIi5YBn+lGSZPG/oLfp7fRmvF81hjG6b/ps296du49VQoihFwHRQEkQEr8XLiQFucli4D3kxp0eIgv4wW4glIBGVA9cBAAPWfwUhEX5jzs8niLHJ3MSt2SSbvMOy2xgQIRK8eEPTp/ef2bctdZuyBFnFiAGEZFXeOIQDmbZ2AHATBvAvBjdBnY9B9V+WG4rQkyfcqbn09GfDp4i/WTaGmW5Wfp1aGjWRThxtDUBHgBUR/DkvL48kjIYIWckQS9vb20mImUQcwoE0UMQ/AECQGSgv3F0dnptaKflB/I4cmabMw0wPR39DpmRKe86gIRMyYQcAeo12Ze06mHUwtzY39+yWQMDs6jLa2tpbkA8RcJGQ4A5RqkDNodtfRi/QUpjJkeN8NEPcW0Aehx4He56VgIMI/v7g5pJgxZF/Har+Sdr75w//mZ82/u7Gnh4qAyjjhwKWpaSUyuoGs060zI4E8rwp6GMaBpR3QOts9B95yR8m/nirc0Jz8F1oC/o+Hkw1AqbjXsEEmHB0rQnDevgJY+INmQZMm5WE1edOtW8liDZ6DX1huO38IgHYL25tclIXNGk/Ow1rRnq6SbKa4plFRng1H4OQtbR+jc4INHKG12Bl6PB2rOvzNpyYz+dR5yFFJSeT5Qbiv/66ICFbA1DY+EZKhGwialVK/yWtRnZoRi0rc1YkNeRZ6BGzj0wXqYcMLMIs4AW8jESNNJqjOJY6meeW0KQVUzU+h9ybn1PSDy8Alz0S4bY2uokKEjoQrUFsfoah/1252yRNbdKGmDgog+AOVxCXIgBAK3Zn7vZn+r+dlVcsufn5eUxz0LQlFCJoUjchAHgpBWsAoEjL1FwH0+I5Y/+jTW7Lv04BaKsESx8Ge64GQ7Wjhcj87SUl5u7Ar3T+67kn21/5+mxGdnd20PDXhogBmaHp0tCuQCDHKJZVDT0HeQfKhrYDfSaFBH9REp0iO79HJlIhiNc7pf92//wX6G8dZXrCLz4CqoLLgt0iAs1hPcvhKMMwfk/OSwghfpAEKAMiEhAA1uzpvqQxQAyRK87X3BfGMvT/vtj2R9xpfvCc9nayHF0yrySK1cRGdrZZXCxHJX7GB+jqKcoYhAENAExYIIDMOBBAWI92VTSdPCTcrPWdmp7iTiEGyiqGSM1f8RYR4fUcCFWMKoLhe2A7Gg+1PZI5YibTmTJAhG1OGHPisP9o3aAdsqGM7imq6MqVBabE8oUaefmUtraq/bEVr6eW6JiGdMGhagLlSv9XM2QiXkMDKLOJAzmcy+g9AKyYqnHWDOThcWkFlBkeAwB5Db0WRVR64NzPIcYT40md1AExXLUWaenKGRwCkSnwJm27PD//s8eP/8Hwx29l7a7IOpSZmQdi7N2by9/5mtuu9U3SJwD9wTyXgjk33m49uz/5xKjKvx2gv47iYoJcoKenem8T05l2qZu5It9AmuaEzfNaGkj0Nx2a/kUg0JOT0yPCCKzOVdFPcBd8C6YAZYCJ27KJUmllEJg2VtIReNOwAsCOVlv6Z76a4t34CJgO3Q40+CMjoN5Q8oXLSJQG1nMghxMAlP7wtiQxsKdIAcAZA2yrlvsEgLA0Pl0rBe4DAKCv61so5XHbATVIrYZe4XLm5xvd3Y+HMqSa38QuOrQRnN8TNDQ+DNykv479E/juTBw6Z2iXgX/QIkHMwVwrUOzxkCVZ+2Rf/XQ9EjMXlsjKdV7WzzFHFOdWgjs7ZSfMhqSDMBAlIzD37OFkCY0ydGsIfBC+C58FQ1zJ5nTYJ/yWhf7GxtJ/gDI6aGullhUSRPsTFvTT2UScwyIEAPrcaMNjxa/KazT20Am9phzKy3ixdlVwLO8QHwnIJgf4kw74OI2ABACEGjhCVPs94Iv46O4pPIl5yy13UF1jQVedsPLw1q5bQ8hDh6sFsrRzJ/nhr8/OPhqt3TbcmPlgIDNzICMDVCQG5LJMlb/7UkcnuV58Z9QMXN9DKVg1ekgHczTu5V/rzVO7e9F/XJZ/BwB9xyBfOI+y87inpCQUCISoxdw0ZGmWQfZNf5rfH/DnBJpJEOzFw4zfvzpx1m4BBBN68PEw6AZ8n5+I8vwGMIVZK7bSdWrT/6dL3N8kYMRmeKoyHREhGhFsIDISvZH5cqwuFmM7I6U/vDnhTcLs8nMyBRUtqkHJ8sp01R+ePjXNZjfm5Yq5r3XIw78j8nfkxnFR+2rU7b50OOuaYpbNzDxNFrxs7y4EIJY1dkxOttUOwHGnquWpyMsxathBglgzPXUU1ZhfTE/YIAGAi0sCQlSAb+m8QGFhyrlFMkPohmJJFw3frPlQJ+EKQ9WdERpvofsQ6ZkMDNAB33Ill50holeyuEKkgGZhIeBvjHHmUDFQDxWLc47QZrNR9+Jj/cRluUwAYBwIjCn019S4EuQ038JEhDSdWUlThkS0HZbxSr0p2rsRtxrAbatb4m9zMzQGbN48MTdBAEAFii4AsJQMnv6MWi5yfy30N+1bSLsx0E8MuLi/de7Uq0Jn6JEjoAzXbHTT/ODszwZHBjPOTWZ9V1cATgisVBo5KZqSGeAsi8IYXIyoS8GzVilYB+x6nVb/zrkt/15zQL8pUinCOQUOHAicZ60WqP5z3RsIW/q/QMrj4PG/eZwY4GcnH+vA+ogBAOhHbIHpM2/pv6S/nrYz+j0QhSB0zGpmO3I8QScjJ+MD+UDp//Cxg6Loz8+Ybcwy+I6IUGOEvyjTidZAJaU/vAnozxvqO2sAiGCH5TDlpcfm4+mr09P/r29afuXvyPdJm8/8QW358QIrYC8NbnV1wp4poD/4xYImGtdIVBGACABM0JHe3k9bvv/00g8Sk4Ra81nPG/C2WyGNTwIxAwGcC8YIWyISkA3TV09UgEqjCIH+/InYQBBySWih8/R0UocbM8bqOuvo0+U6E1khBPZCMDIt3IYuXtaC0fqJZ9A+ywI6idqYtegBTJSnrG2qre2Q63+YWQ3UoGXBAiNXWTdWDDCETjnQX8fe4jGFfoZLejNjGTNR8MElk4jG7dCXsYSTA9XiXATOx9+IMBbiTs0Bt89GtIu/ECvhJhl7yVnA8eeajuulHoi5uv36XNUbdIbSG2TSmqmBQ9oeJT8aTBvMOhFW1lrAQ7SCpC2q+LonFYgAcGtdA4CWf13qP+9YCP5QRHFef+I8sp3/DMlfsfXoEoazVpxZSg+Q+HWs9RAryqeQBeQXujA//vhj6APeQyTAddDiWXLC6jBew01R9L+XPSsVZwX0p0hLDhKz8UEIx0pVtCahFMaDcSCH8yYEAN4TczMBAmaAln94zIx0Tsv/mxZoPy20nc9igPclzfS4ccmW0P/cORrYkTLIuZg7NLuQ4dO6MHbw4K/UvfMrn17/K7GUgq8wpkiphe06mCzwZ+YGkwG9iVQb+s8nfvwxpJrfA6OEfUiVuDYAnWofp0LzRfNo83sn3qPEgiptbwXB1UYwHPrNoZo9NUeMI2wNcEJOeG4QTz3SWtrfMjTUPjrKGu82vghuRngHDVZr8FuQBZPzM0THJlnRNn2Z+k+jNIL7Sv/T84cV+okBLlsUVVWbtUzIDi2LXADA7Fdi3BfeAVMVNJ57AcEj+BwGWAt1YkTntiQ1DKSGQq0miG2UfFl2SPm3sqzsW+Xl36qqylb01wBA7mAM0pVcmknYYIQRQIZ9AtFlnloKZuwduNOvZQAtBa9b+ZfTdxMAitB8lqA/37l7SNOPVY9ettlPkwRKmHr2c2YYkUMNBJmOe0ATCcXeDRRXQ09E+YH704nfk97zufizvRnp31yS/kVEsZvqMbxDU9RoDbmGT+Sn033FkzkPZ+bwnpibWUsWyAD0nTUFwTE89fwDvNBubXPjjeH+oD8xAGi2PxPuAxCr93MR5YP3xbP99gE51SosfKOTmozZmT/Rmwvl5yJQf/jgAzovCAP4YVQBAInsZXl5W8e2PR17Cu4X9Pyenv/15/8X9xqf0QCA0Py1P/u1Uz87lbsvt+RQyUtFL2WmeGk6IswgANxJuhM8Hmwba6v678H5U8Utl4Kic1tjABH0eaNVhGIhHaTK/b+9agD4rfJlGZVLcF8DQErOgEI/g5nv3uwePF1tZ7fhRTZ9GeZ8h3gHAM7JNBls+oFzMKLq/GBqkpySOjI1UlKIJnqYjBqjqMyd0jmSPnKm8Iyf/S6cDQCGAP3EgNHtg0A/VMaJNni4DoEv6IjS7HW5ui0EgwAQ9+5PO9UQF/amzf2X34ySZf9lW8FzCXGprP1hSOfnz59n6S8lPvt5AMgpugUQXVg2/V9ckv5RM1CEKRpT90NqJADQI0ShWHeQ3uT6+j+1jMPtHFZNPJkeq41MvKe+ebQrdgxHt763ttaeHu42VXRIDjcgn7orgOtAf4dVFslkg4yKjKCFiUcL7JYT5SylAR+Xb4dF2gH/APpJBZBeKUxDbqBSTCH35asENv5qaPC3tnaGQjQGfLJ3LzIdd5yrTaAl8frWz+5l75nwHxjLy5+QrinySoq3UT0UhRopoMl+c9r9kXUs6/T583I42fzjZut3Gp0xwNi/33webd+Rd9CiwaHvWKmCvIgAYJ8Sq6YvG58rP3LggUI/MSDaYpm5ZCpvqrkRQtXC3iF+AaC/H3/Cgchh90g5TQI+0yfRGPGDkchIFIZt4Dv7jLOdLNklvRzsAQajc65IBP15TVbWDK4bRv/RD1T8FxRD6rcMzJMKVN9dP60BgPDDu8VunJyu/g31sbWk+/4fuH9JPDYx2eYOOossExHdTscmZTb6Dx3dr7o/FeDLFy8i+KL8EjPQ2XEy+CCBRKMIC9Zd7s4fhviLSyaeTI8F9O135otEpa0YEeb319xvZy1gLLNE6+xAIUx81Y+tgPtQW9PI7cmO8yb8TAP9V6v1IzyT63FmpAKor2iwLgMA6Yzu/Y4LkNH4ExJICr9dVUVxyM4AyBrfffCACvCdW7eIdiYQQeg7exbty/1yM7plaP2g+Hct8dri6dO9lZUdZE6BObPYFBH2e3LGAJuczZgzU8YU3Si/Lr/+HVQJa7zA5h/muco+/Jzd2312SfeHA0RrSmWcbMYNlOvLMOc7eA4AvxK2K6DcE2p26JqJLS3lc0dLTehNPmpGtNU6hpmQwEk6+Rl3kUXgAP3BnQeBj7DandJ/hqJ/mPfyB7x6dMJqIdYKWJSmpWAGa3Sb7X7QkpJ4qv9zOfoRLuXRGnkx5gRNG/3bDs6w0T/oz5q9Omv7aPZdYNcR7U7jEPptWINOCAEOQOHXXnst1V34TF6y2SUDU7w924gDbdmUSgbvSSrjHf01CYjatMIl+CQnoWWuSGibBnzH4/n7Ebq9mRQ+n6bMzF8EWEiJyy1Muf80F7H3OxXt4vx8tqOhIERxiGAP8dcisG4H/awsfOUKz5YwqOcTwiFhfHfKOS4uIvVSbZghDMjJU7oHXB5y1s5RU6z/GWYbGYwjBmgtFcRgAB18mnaC4Lxfvn0kanMDoL/xDP1HM26cq0lT9C8t9fJkSHQbXYqvYo6aG+FITd9BLU4BQDuB6qequ7r2/OPiouwiSj0vyUsSpalEs7Bpk9ZriQHK/9hGHCLAYN4iKIc916b3am9/VT8L6o4sLRVxCuwMaMeEMh2vCx/s9vzm7puq2BAA4rn9Qxj93/DWYDR8Lv1vC9rSf6fV88f+tHQNsQfD0aNH6drUAEDnKFGBvTxVDmInH3FhduEX4NbWN4rS3nYz51i79Y33xFwGIcxYc9uG3xT5b66anLXIRRiSXds4DyGYRZZID0lM9ofWgFjNidFb9fx0uLoCtKk2NenzP3b5fOzNp7tRhu2xQTxgiwJ4gPZ0QQv41kxDMgB90J4R8euT9wclqN0fQqoE8a+qAuLxjDzZKXqsdXQb7+yIAXwEgAApZN8hPpxGcJDhhdj/UwATOgimWSuzWPCdc0feq64u51JRxPS234dWfeExWhDGlNlENl6jLwb3ORxjbnoOAIOyzHa2TX83UJj1s8yc/J1l/T7f6e3RVvt1JwmGtmsi3cAS7I5sfurOBM7yHbWBdl9799/s7vvzfZVb9A2cG+bpcyQTpSQXDHcW2j2Wgh8trQomsNCmGoMhuWoysX9ws7P8u/HtvnHf7vpfWJL+mevt778P0NP0TXsoWAAiAAd4GwuvSNq4a2+//bZuxEYxwE1Z2GcZ7ZsQSbIHAgn/weESpeH6HGgvftF+UE7AO/ovjwG/A9FhzeYNLXKJTmISHIbnz459eyElkzqUIqoG69J7cV0q2nwrvaHQ/xVvDYkg2zfRDkQqwKPc5ltbaeekMcnNk1aZaez4gpRPXEIp50BKJrb6SoMW9N8OA/eIRgZmmFYM6N3d22/2PzQe5u6xE60XYD+VBX5oP9JY0tgf2pFc5hs45puoyOCa53jb72Prktmdctia/RS8EmMuaJVeD/ccAL6//OEk35bxhl9rvrD7g86yTvg6SS5JTrTNegxokb3zH/+yF53zNyYwnkRzuq4+vT90/3rf9YbdDQNpA3/23LmG+U+ZY0wwEgncGHxCeKTd4t7WUpQ2ipPiUJ+9l4KXdJtYA4C+ibP8u+FNd2Gy0X/wyF5t+uQn/A6JnyUC+CJ7NoAINs0HcFFg6CNiTzdWonP7CAlu8NdejcyiM9aa6v4nWoeIdkc5jqUorRVp3hP/WbMUYUSLrylrirCi2qZz50SJ0WKPAZwTA7MZtDsxCyWLPEA7BWgK4KbLKkYMQAUiHeSycwe13sD0JsJLRCMDIIen1wBMEMR9GlUZDkNntpMA7N7t2/oVeBRG15n+UFZoNGGY5J+ZytEvxJLkB99RCJb5toW2f3az9v7Y2AEQSpU3T4nJdst0Bo1bxuxzs6SGV+pWvjssiyUA/CAM/fk3Wny6pD8eeGyMf8A5QrdNdJJodp3mcuAszPuhXl0TZvAeglBpZmQZzxad3+m6A4gAKExpJvPDRw/v9t29+qevHk87Xu579IFFqalLkWVC9ZqbrYeJtefKuQrKtmF6W6ylYOgPKRxkJMbyb7ej/LthzVhhr//WA1NSUaP0HwpJjxAUm/BMvg/C7nt+wlG6100jgHKIvMtl6EAG7wO4oPsRV4guNJXTYqQVaffGUQQeDtczIQvhbb2jv9d6gAK+Bi8YCqGAEe0OPHHeg1hXxjAwe8mMC9MMHTfWhzCDJpEZJS+wZTftyoAjRgYHJF8aeOCByAGybR9vsSJcEgM0AOjPe5A+w2gxjHvG044z7F/CXkcm8xZAekH2/STIsfV1PjM/mzamD7bf4IubwDfn9NprK5YmjIi3Trd/wEREM2PmnUQ0XsDLMBFhhuq6yFgCgJM98Q/9uYtGHWA6Y2brMJMN/Obz+Kri1kjVaEiAUfTfSOnrmyHLpGeMOcOic1aQs4Cwd6yXh3sQyoAYitrDI8NdfV1Vf7mqMquyfN+tu3dyttdCMBGCUFpBV6kfKR07e5w2OPJNz1vSh5eC5/zNdj9oIBDr3p/zzvLvi4f4yMY6jM8DQOpde8Mfsmvn6kQt0oQ9dcveM05XYPFKl837MEfd7VY3n9A93UBw90/14hCUBzYB1QDA4bwh2xV4vQzeYwAAqyNcD4pg9SJH1w39nVgs0bXJaS7DMJKStKXEbQ+iHquHRzTUKGQTRqTsxBSsgP+J2GHAMG7+E8NoNtJ7ftj5la88IvMnOYk1fHu3VxQxq2WUSEYNiKjWduOGQTzT3TNZCBKlMZU0MyaLBdl1yyzYfQRSr/tfkUZrxsaxsLH4PxRe90ln4NzKLCJHs+Ucib40SNr4Pn93dwsLU1DwaZKGObGCfMgYwuOa+5oB/fYt7alm6r7ZfW/JWywxr86vzi2bnx0b+6R5562PR5INYzotbRLFn2ZquD89A3iBw8zYVCBKwbEHAI0BlH9/WfSfB/LApv/z9oY/kHFH274uLUmwbMWeTu3FxMSdIStrIREWjwezoT/uC3mhwOCmh4GN5NiHgNoj8UNrkmQPvKdmAPEzV26OJgrGErk4cZ5RoBXhSCh0n4RLYrV+MqmISo6KrZp/qy7hLjjzfRizU8+M6jricoT1qLp3rAZ+LX6s2ZVJaQIkIWLaCQeXa7VrRQz4PAB0mfJfpel33mgy9h858kdLSy+WlJzZv39XnKK9d3KAOsIzRLnlOvqvX9cAwPDQUaKZMeksxS19NgAThNqbrGTspmVLr0QODtQnacc/AAD5OogCWlyKaopggCEkjXl/71ZLayuh22C3NzyNbafQfNKN9CIpGpXRxSeLcBWqpvyeDUkO5B6Q0wvMLbR+hC6YAhcXBUG3ujVJLOJhbGSoYL3vUX1fLKVgkhTrcMq/GlQ2fvkX8mKj/6Oy3WI1ffLT+YgYDM4+bxnNBmGL19W0/9L9cjA4DuUE/BvfpbmIdlJoDu9ALwBVx8hOTMbAU8D0WWBEAqRPniLJEwV0Q+n1sciNLaArGEsuypycpSGU/1t14dWEhf43iFq8WQxdQLzJG6s/BUub5DgNjOSbM3GHC6pfc3vAZXilPkGaOC0rGeRUNwSFrsIF+P5uIg3hhZ3FfOKj+DeBZsh5hkLUc+CIK8aAQv7XLmadKRflo2Kzt69j/1uXZo8aw2XGsJxhWVKM0B97DKCCUWlWThjPAsBHEx9NEgNAfx0Q32hMHwBAOoskzqJLElz6L4gHK84I2A95MNqp7qmuGziuwzOB24XFQRQJAQvtLWNIlEZ+Ak8Dx/s6O4PBJi4LOwzW1Jgiggp00Dz4wHhADkUqgH/ohrT2w4BIHUh1IBsEAIKBGdmbvSYBCtl9SxoOAcBz9ydv9ctC/230b9k/IRVvKP136sVoMkAz3TUwEa0HhEmQ6P4AAeKj1qDEtYHaYAdvSB8nGQC9pKQRMEpwBzrPTNBNKJ0t/+QKnAZTgl2Mrl27xgQgZtCLwt4VNKeiIMkLMtU4YSZArjbSkOQCu+FxA8J75Zpc75KbY9IWw0KwW1RgIZ+rPFywrY0gSZMctwdEEa2WutTW+A68GBwJhQAg1v3BK5EmwKDlGzqRhIFTxGNuDQjEPOVwN+uy9speHmLKBEF7RMujeZQryIH8DGOTBBnaUgtpBgVV6669XzXzgwu5/+8/XTP+lGH4cA7jjJxh97oXvh9cQAKaAQBin/R9Is4YwHBtTDQSWfyfi4+Ta2bMtGJ7LmcMgCdx8TUJRgjlNQRplmRybLwDwN8WWrX4VgzKHdrPo84UtUHQQiG4yZ33B3btGuay8Jik8nJutJASHjJXbY2mriKMNTL0vZaqesz6+SPPCwLqQ45VwdF8Te6+ij+p3f1+qdz47f+6fdXnAWBrvS39MwmdLAxJEWGR1BK6TbKJX0I0gFqFAAgILB4ajgijj7AQ10a/M23mIL5mFfg6O9NRzoJUKu6QJRB+yCrIEYEYSkTEBv4KLQL6ORmAiYnBgySJAfo0sRdl+lxqfIilSybgSys9lwi2FAhoumzofhH8+erVgrq6vKPp8kdF/qLnuD0uvi6ehiEJSc4GSkV/lnHRyM85aMc+0Ox+SxqwGFlVGzofdnVx07lNKDxAEveXkg8hWTeDwxNAH/YKBaf4phA1QTbks1wYnA9er3uOjnC50tO5SswgzpZACr8E4QwIH+GUi9bWBtel889vmmdPs9I2+c+IlBdf1eqBxgB0GHkh5hCuWCOlOyUzbrTcsNGfgnCUMHlY55Q+7Z0pwDWHe5EW6AJMTbwIvXAgbhAcCI2orKyMlJpEPH4BwPhiva4O6toAsQ7xYNxaxKzBwenHj69e/TQ5ecZq5TaIAVGeNmcD0hpEItyVE7WhX3/GWgq2+0HxaQ+rfxec5d+Na8w9m/7P2crPsmQfRZ6cVFvClWvoQwVwRBy0wTJcEIAgCY2Wg9MOxMIC/BvHJYGot4yUlk/kT7g7EK8BACUavwd3ECXQPTVZZuNScJ+2VGKAvEgjIwX6AEBoN5HM2hgafRMIA7yYLIbBf5PFsoDl4O3bVYf+4EzVr0iVeLbUf7d36wc7t9bW8rZ8JOm1gqagqPBP+DIxABWorIyBEs3Jud+OALenDZQ5xhsSlbnyJGpkXSRkCkb8hjhNAOaX7A6yyOytrsZ5CEUuV+SQ4h+RIyzpAjHZRGGcrj5yI65PMIj6JLwhzVTUBhDTSKc6OhKbm8tmisrN8sqWypOSeNRqb73SecUZA9CUXmwMSDQTK40vigGtziTgxIloWibTcWwyYwgWrTFkxvoEPZIw8gPmHf8kFSbxYrJwL5QAIZwyQ2PtbQ1H/7AAYH8fzwat5p1mZgYWFmprL8/OTo2PE+YNzpzchaUeLjaWNjo7mVZMJWBIvvY1gMLGfYaqwDGWgm8ol/cWAKD/G1//IZmz0X+gNJPZq2M1SoL/Ab64IyQd5yMtoPALK0GQoRKFC+KyAU+Vc1RL0B9qCd8nfsDuec+gZfg6/UV2ALD3edZFZ+S8iEh8LmkEUUpesAGzkGboDcBFf+oD+fBDwItzJWPGswE4HD2vs6OqqqOm5jevVKVuzdk67bl1rXzLlpFDWz6+I2+/ja8BmsQb8JrJBe4zN/gp3A4aUYjrTLqoLDeXA4FgggqxpK21lTIA4ZYbRCeYbgbHrad4g/pHaGGa8CnEgKhgjg0FEJbpCIJ7sSS4E47PxOZyUUhAC+LTuWIjI0n9/bnzh4rkdTSWo3K0oriiQBZ1fQM/67rqnDEAZvpiYwBB6IuCsDnR54wB0bQ449t4Oy0VUCsVgki1ycDQggjA/IlJx8UnJED88X8mIJtxScyWtGIhhSitA0mEEWPnLY7C3YVoDGzZ8uGNm0NDffgqfUFweYpAJAmkg3yIrf2aJvECx4YNwEt0mS0KJ06e+MYbZd3dxxwBID0+peDB+j5V863ClNvyr3XI/qHkjVX+Pb6G9N8sqSCFov9q6i28D4qBUIMaoNDM/Mc7QW1SgTfffBP2gRSDO4onI6vgTYjkEH94jVaGSS/QfBAfKAzg9KQCYBAMCJWJD0WGQnSC8uS547ZrTb6t+pIYDK0MAMRXyZPxYUoAQ2MXL5JAoc/gzZmbZgoKZo9YRZa8k6l3A6mpRup8pBrApgh/SClJSZlISZk7LXBn+D5ArKAJ8hB/EKTYiRo+zgkx3ZhUURrH6pNk8H/QaJ5Hh6L5MFFnZ5mQlIj4UihFZHDMW16gnyVRhmEgmywZ9YZ6AAuDe6eRg0ZmpEMfA47WnCEH91p0ijUBPMOHdIYXS7HYAYAzvPx02pBLdgwAa11dyfj/jbkzRxQ4aBzUGABgfjT20awzBnC5XBtzCvQnLQb3cXUSX2YE3AsyBGFirjElEYUgZ+g/xADmZjwCgLEyW6T8SxFYtmy3K8DeDe85exb3IpBM79p1ubEx9DZ9QRPop4R/ZpHPp08EIkbQg0ifCZOK+AMbYAUCzAZV0Oicyp8rKio0SkOho8eOHU1JORz/UrAOJkA03Z8brvz7fVluQQla6J96U76pHTnAUmSYwOFeffVVNBkAF3TW7aABZeCY30BDQGSJwfB1Crm8lf1cYkQGNB/kZupdBADyAD6O+UDyQQZA3kAS4H7Xwx9EFFT07zEbJA+n1dYP+4HAnPwYhIYaJ27BM/0RQYdytrO25k1508Mppyz9YUfVjq1JlcwWtDD4BxSJqQIEM610Tx4+DMWVYOD9ywBYxFe+CeIM/Au5yQ4AiP6EB3xGnzbjNfZXSRUFYfZ+YP70Sz+Nq1QcNQBANvVRw6wW4gWsQ3LmpNp1ynfkfC6JGAxp0BhA5HB587/n0WlSIjsMtQ3QH8mEMzHvm3J9XnZc12JAVCtMaWxDdoMVkYEB/VB+uL8GACYCUw9K5L3w674LiCUbOrQBlNsf++aTgmhLroeH+f29bQW9XV07Pr6/ZyvawmJaGt4VFgDwPQIAOXTWwD5aFLLxSwhIN32EZWWhlPRiiY8p+tOBGuoOTSmmM4WWlYLTlnXDaQDY1j2z8QMAa/puytab8o2bIrP2Rh0u9tLA4eDp6Dykn/YDYfR5AArEsRsEv9wybS4izDgDAHIQfq+V4XjEQbWt+sd4mT4Ckp9kj3gs3TG4Mf5MkQCQpMaJY2dJyaQxSc4V7Smn2L81hMa5PRXlzCCQWnQ3ZuYoM4uLo08B4yRivC8qXrNTG6k3X4ZJyGzUAAALJPbwQbwmNqOHksHmbloSmLW8kgDAJjHwfTJpNCLBzHBdkgvNWWk2cFHE0CEDZ8QgeKx587/n0WlS3DgMBWF+UucwOe8gV5JhEgbIzKLrLrMMjk/7A2k304HMWyVTpp69f+L6BgD28GeA/eAxg0xT4mFkjjAlBEeyZdBzvLd3fGCgDaIxOA7k85Bvg++akLCgK1MAqcJ0OZWp/RZgLLwjdOBAt0hIJF4BgHUsLEeAlfjmfXPdczD6FUvB31+5+zN988I3WdXMO2yg8u/zvPwJ4o/sA/oZD8WL7bdM1tkyLZP4WZmHv3g1XJWF7gzEGBgzIAxa4sI2hrHS5ZysCQTfDJ+G/GrF9iMGsxLxRwMAHBOAjqPB+ZinjPU0UiKGRGWkIAw1RwxgnCGtW/1KYl8XzP0diHwTVsbMk3JSbLtOAFga5RKtxbTDT+wBgEQGBYsCy0Pdy406V7wMtoL4EAgg65BmwvAJ6bgyAYA1R8R26BPezOzhlTAOnET7lPXG94O91hiAn0p8jOXHzM9SKV0ILQjhpbtv7QBA8hqqku4qYiTpqq5f35h2c2k0/X/2zjOuqXTb/98tVQIiIFEIwtBU0BksyH/G+Yin934O8++99zf/3st9dc+r++b23u89vdw+fYQpeKyoY4NANIAh5BAgkFD2/V122CcaxBDAwjzfWbMNO/t5kuDH9XvWWjvPYtMxyBXLHgX6Z6LA+YONnaYBRY/rfVjpWZR7NSCrnM1jEwA1Y1eeTq7t2vDL9Pdz+TKlpdTVablBeTnrR/5dsbFMsUUkokhTAkC6AJSWpi9tBsEJAnazYeityAiBf8kCsJdUPkEKQ+D/BH4I84RzJUUAth4Gw+K9GvAJniTG79UA79MjADXUNNHUSmuQ4JWzZykqkptWlC4BoLGRj32MjUITao0vy5jBZQ04DPlsNP5ledn7kGtkTzgjKd5/FsOjx2bzMSzA6SdTAIQ/RQM+yxOIZWOzEnL9r/LqaU6f5ez1kusTjfXJL+996Ut0dbl7ntiPY0OOF+GL8CVo3vA9ofI09bKVsAJR+B58d+m48Ij8wzeWrAS64FMYDAbDZkYAoprqk5wspLCKqtbJ1tD5UIzY4qkEtv0kyKoTBDSz0cylLPCfXTVEWOCR0YXsUWEwGIwAiDrqlJ1ppDFAIEx4hhkbmyeAO8uJoBBUPuKY+7kl+59sZQwGgxEA4cFzhCPOd7hXEQCbrYXBYDAYAXAppljGVsFgMBgM2/jgYDAYDAYjAAaDwWDIxSZDDAaDwWAiAIPBYDAYAbAet63CJPwqfCq7eTIZ8+mlF5jkoSzA78NXV3659b6P1cf/BfwrqMrw6lvw09Cx2kUrzlMN/xpezuqtr8o34SXIgb8J3yYD3oP/CM9k/OqF8HfhBxgMRgAMW26PgOqkZUb5sqViZf0q62cxy9+WwWAwAmDwyTJ3zWVQDhWQv5kyk6m+2EkzGAybKgAG60l8YYt1sxOqwQeVWQQBmeFdfomdbCyLj14ADAbzRTD1Zb148eKdO3cANahUJ271ZmIjGGd8lFEdo0RnmZ1n3sLKI6+IolJKnW2oCylkjXzjgUWAP035qLkNNLTRth6nfP48AwPMz+PCp6AEhy4E75DOAvQuT23VUbeHPcCtW9y+rYYLJBLk51Nejnpt1dbauCwu6iKGh3UR8bjT/cNp/7T6FqrfIYXqS1TfxAchnDbWxzi2gx0P+IDlt26VLy6Ww0hNjfrLprTATmGe+Xd59y53wfH+OjbDIZb4chYi+IekYzNv851FXHLgK7h0YTAYNl4A3nrrre7u7ps3bwLqP6nOZB//+Mdz5H3WQT/9t7g1xNAww2HCEoAZZlwB8OCRY5IA+PCpvWIzzbvYtS4BSNOAfPJPcUrT6iXICgliby+vv87cXIr3536P9I3VdoZlG9vUOehD4c+fPZt/+bIlOQmHkwLg9dLczLFjdHQgGBriwgWuXSMQIBJhdjbZ/2/PHhobefZZXcoD+MP7e0i9S/UrnE92wZQWnuQkaYRC+oDlr71WPj9fAXobUhm9pZWbDL/GazqC4/0/plcBMheAG9y4w50o0UUWt7O94hsVPnyS/7TWpLOL/GAbWORadAFGAAyGTRSAGzduaPkvDXjnnXcAtaLX8l9tYNWNnqzQOvEiF69w5QY3/PjvcCdEaIIJVwDcdqC72V1Djdbp+9l/kIOHOSxtWJ8AiCj8mdP1RQJTT33WAnD1KleucOYM16+73n9155uuAe812831wfpXuyd6e73nzqGpRketeFx9n/H5aGsjFiMvjyMlNzl9GglOXx9SiVDIEYBkA/KWFp2RbmiJ/vBfSEXFkgYUU/GdnPDkl/myNHieeckA9xIMSuTKL18uv3ixvLZWg3RmZQHQDAECL/NyZBdUf1mXpnYK+j1WQ33A3+O9S1waZDBCRAKg+M/7DW8NNbXUSp9kHjzAEEMhQhFGPFws4mvSCQwGw6YKgNb7agKutvRKBAGKA0ZGRtSwm6y4zvVees9x7hKXrnFtkEEgPz+/vLzc6/Hm5ubatp1IJKLR6K3xWwoRCilsokkPbnM7RKiDjvRQIOt3Is8iAdBRL8Ea6e+XAMgc778at1d9sjpUHeuOvfnmdE9PZcHZpiN4CyiYZXYkPvJ+//tvTkTz8uSxQzV573rfeiuvu/tA/rWaQ5SUOM3TFvz+SP+liDJHytORn09ZGQcOkMZCWmNfmdz0QvjSCCOOyeGuJABF0oB/8A/Kf/u3S4LBSZ2Jx5E4pSLx1nBpwBhjVD+nadHkmREn3k33m7x5hjP6G9EMkqJiip0OdHXU6W/HSZFZWH78ffT106+VwS52lVPOClxK/yErnk19ZDB8QAWgsLDQ4/HIQfv9fpAzqtCPOsnaUYqgm+53eEca0EcfsHfv3vr6ejUZ17TFxcV5eXkSAHW+lwCEQqFAIHDr1q2+SJ90YpRRLRUVJShZ4cXL+vha19e++cffvDp91REAHXPIIWNsW2v/pABA0ec+99kf/vAbZMV07/TwO9Pd3Z89dO5TinLkmLWwjRHTR9bjN8JvXL5MY+OVlvkLpb29JxquHTlCfT07dyIBCIXQG3j7bc6di6BIxOtFy+X9+7EsVkc+2nHTly45vlt2nwCEw/L+0gCKi8tFzRsVwf80qet0Rm8gFXcGhDOtjpnRR99ZzvbQc5rTcvTHOa6PP820ZnuFVyqo0N+O4gBH9RU7at0wyugn+aTO6w0/NNqZgR+SBccxAmAwAiBqa2sPHDigVb8cNKDMT2tr6zNyNGvkJjd76NFaTxrgx68m90eOHDl48KCKCpKBysrKkpISVwAUdoyOjkpyrl+/funSpQsXLmig3OICC7nkfoSPlFDCOoi1xn7Nf/wf9vYqEyXvL3uWZ9eU/HFsaIhfbG/9RryFbIm9F/uL3m+d/JkPPX/y+SMcabQaHQ8oscwnP0Kk1z8eCPQHJ6+3e/s6OzlxgoMHJcNIALTu372b+XkpgR4Po5BpcFCPpKusTmWlowGKGIYjw04EkLb8dyIAypcJBv06ky4ActaO6VLH+2fY1HOe+X76FQhe4EIrrZL2AxzQ8n+SSQV8fvwyXaDgoIwyIEJEz77Ii/pF6Xp9gExSbjPwg7V6f1kK/w+D4YMqAKWlpS+88IKyNHL9zppdjlvugLUQIfIjfqQbRd7mbT/+3bt3nzhxor29va2tTeoiOUkvKU9OTmr5f+XKlT179kgtVIU+s3hG63TnBqEP8SHWwUzrzMxAixJbrWM/CQLkXDIaO5P0/goCRsrLv9HSEh9chwD8vP2Rlzrk1DrprKEGG+GxPB10yCm/z/vnphtGRv79v7/m/+IXbS3/pQFu++S6OubmCATQO5HbR054dJSxMUcAMgkCZNHIZUcAxhhLTa/J9TsRQFtbuagor7gcTKqCJCc3FzeH43h/zUB1S3LazAgR0ij5eun6czynX4KsggqFegqAZH78AQJ6IzojtSiiSLO30NJOu4yVaVvpVFYYDEYAnCBAWRpVAgAt1ZWpZ40ocj/PeQX7/fRLUeT9Ozs7dTx27Fi663dQQHD48GHpTVlZmeRnYWGhp6fHWQx68frwNdOcvQC0SABaZwcGxt56yw0C5HPXtPzX7yPxYktcAnC9hexpL6J9Lx33JDRssFCmW95Qn/fllwfb2/0+Hw0N3EdNDQoCFBAgJiaIRqWcZIBbBuDyZdeDuwIQiSR9vdSuqqpyz56qam91QXxHMBh1ztfW3r/8lxN3RYUVOcx9TDE1yeQEE/vw6uM306yCPyCBr6MuSlQaIAEYOT+ix5q/kEIvXl0jtXjw7QBd3MtfQ5YtBoMRAP6cnD/MqfrlKsTfgy74PJmjFZwcZh99ivQBBRC6lUjeX0cehmoDJ0+enJ+fn5qaCofD165dk5YoKSwv0ESThUVWJFoTcwPMDbTaAwOe21fcIKCSSlZDJfHk2l9Hu6qqv6VlzmqZm2sle9rhODSRRhFFcnkFFMBveDxSREpL0ys0FBWxfTuS0YXZWRIJZJkg3XDy9Tt2jESTdeBDHEpZ/sv0vGNJ1+4IwPDw/QKgsXpzzoSaOTPPjHw6zHcxDwVQqM9LCjvYobycbOL8hHRikcUCCqSIueSyGl8jhQ5kmWIwGAF4jzSSp0ohDi8h0v9Zdax6y/8Nblzn+iKLyvYcOnRImZ/jx4+TGao9KFBQ/BFQLry//87cHU2lisIAA5IBsiMHu9W2B1oYGIjd/nMFAY4AnOJUhsv/iQk41mK3tJBose08sue/gM1KSN62sc0RuW3bkpaOZaHzOmLbSXPJrBQ8Gr3qFHKnmfbgcQsAsoMHlwRA4NPV7wbfd867aJQzluo6t/yboQDkuOdW3QqutKu0dF8pBoNh8wXgG6TxY/gLUukEMhSAGLEhhpxqHtDY2Lhv3z6VEyzLgsw9VbVKBSoINzQ0KAiQ69eEmjZ7ARBN0NoqAZBduZHMAskUXnA/NljAyEjKzT8qg8v7yy7sZ71YYPPIcTM2+jyOH5c10ihtc8q/09P3RAD605ouDganHA3QKTf/EyOW9P6yB9G8yglrybZhMBieNAEQEXj5wd5ffJ2VcZaH8hjzzCv7r3KCvkSWxU1EultUA1USkAAECGhCTZsgkU9+9i63pYGBv9IAWxow7wQBjgCsjFv7jceXxEPef58EALCeSg1wb9ksLh6ZGnEFwC3/6knHRDVuFui6KwDu8p+SkuTzVVVkw2oRgCvBBoNhswVgkAcQgSgFrJEw4RAhZ5cYr9er+3+0nGftaJRuB9IMBQUF8Xhcc44xpsmrqCJrapATl/fXDgz9ly5dJXlH0AEOkIbfnxSA99+HAwdsZ/lPipI9zRowcn3IWcsvshgMbnMiAGmcKwD607Gzw0kBSK0Au9kkssRZ/uvIBmtAx5J9HYPB8Bh2A51gQhYhAuzcuVO39Di3kGaBBmq4JnH2D9C0UaKsE2chr2NxsSoBMjn5OHHScGu/5OdrSNKeclzHPcusEwGoIOxEAFNTK0cAcxNFjgDcvTvuLP8jRFwhITsc7y8zGAxbSQBixKaZlgEej0cVXd3fSVYUL6FJAE2omWWsk4oKeX/H5Mvk/R0Z4F6uXUsu/wcGwPX+VVVbRABkRUXJL/QGhx3/nur9nU3rnBNLWSCWbPkLwB5PWgFgo1NADjYGg+FpEoAECceA/CWUwyErNNCZ4b5ps8RKCwIqK90gQBEGyyQSKbXfkpK05b/F08u2ba4GOAn90eDovTeA4uJcp3P3C4CrIpZFFpgisMGwVQXAxl5kUUc0+xJWtm4idbjmdKddL0VF9rIGyO9LABxLr/3K2zlqYevisjK2BO43wvTZwzPh8HB4eHgmGl1BAJzlvyw2XjgysjAyMjb247EQodQCwPojABMEGAxbRwCUOsghR0dgYYlFue6sSB2uOd1pNwAnAtCxttbNAjm7m0WjSQGQKUTY5Oy/9RjLABQWRu5GQqPahenH6d7f+Z27peDR0XHVAMKh8EJhXnoBIPsisMFg2EoCUECBY0B8Ce31RlbMLqEZUqfdqEyIqwFx4k4WSMfU2m8kkpL9LyraOg0pc3PdHM7E6MTdu9HR0eiD9nRwS8FjY5Oh0MREaMINIJAiw/qLwCYIMBi2jgB48BRT7Gzeqe0ctMVbNBolKzR2aglAc2pm2Yb52cbGpAbs23eNa04Q0B/qd5f/Tt8V55rUKbZMECCbvDs5Oqo9nydXjACEGwEEQy1jY1OTY5OkasX6U0AGw1bCCEAppTvZmdzONxIJh8NjY2Osnbm5OQ0cHx/XJEA55ZpTk7NB2KnV4Lw8JwjQl86WvL8Vi+Eu/22FC1sLdxXf/5XAr/961OdzBGCFmm4eeclS8LTvN8d+6lrXwIYKwDbABAGPC4Mhl42mkkov3t3s1rJaW/yrr4Cay8uba+t/1sLt27eDwaCGqwywne2aUzPvYtfGLoTdzSGGLly4Gb3ZP9B/69bta9eW4wNZUxNrpD6LJ+szncNlL6txglXJz0/m8Y9Xw88VFPycz2frp3TcUrCOVX9cxTM4AzWDiQDux2AwAlBFlfxFDTUePNOx6cHBQXWXVF/JtbYUVm8A9YcZGhoC9rLXcUPWRrsMVwBk/iG/f9Cv/+cXt+l81rXfLh5EkyyDMV/gYdRoRJbvIUX8amU+GLQspcGsmpqVV9o11Oxn/1f5KqIafKxj+X8A/heyLLB50jEYjADkkltHXT31jTRe5KJcv/Iq2tOtpqYm82+EqTH91atXtRmc/DHQQIPTKXDj918oK8MNAgLnA0u4yR/27s0iX/8SK9KMbEV+pDFr8P57ZVm8h3QBeKkaZDmwsHt36ge078sCfZyPH+UouY73l5VjMBiMAKyIXH8zzVo29tOvHM7Fixe1I5B2dFBPmEwSQcr8nDlz5vz58319fYAzlY4+fGwoNlggR+8IQPwf+odG/+Du9u/T+VlHALJbdx4jnRydzmDAoezmT6eah7FdebWkO4fAQ+/sqkb/kbRCVsZgMBgBqKCildYhhoIEu+k+e/astgXV13qVzT969OiuVfvHKmKQ91cvsN7eXpUBSilto+0QhzThJqUF5ApdDQjMz1NXl/T+Xi9bGjehA4FML3dGGAyGLUHuJm28qx5+o4yGCU8yeXHh4unTp+X9dUOn2ryoPYD2edY2n5Zlpd7yPzw8rGqBMj9a+7/33ntqDZ9Pfgcdxzh2mMM+fNibtgtnayuDg0Qit51b/g8dQg/Sh201XI+ewb6kVopeGAxbCBMBbLwGFFDQTvsUUwkSFtaF2QuvvfaabglVUVctYlQPUBygkoAyQrZty/tPTExIG1QxVvZfmR9d5ol6ni95/gQnpAGaig3E1YDUT67+5BUVTE+Tn09TEzt2APZW9v7CA39HZuquH3AMJgVkw5twio1jD3te5EVHDHaw4wIXVAxQhkedXqqqqrTVs3b6dAQgHo9Ho9FQKKScj1P1rf2vtUd6jrSfan+h8AVpAGlsfBwgj9/RsVnf1cqBv4FsdQ4t2f/lYXxpyX4Hg8GwUZgaQBz+KfwSG8de9n6YD5dQsotdPnzXuDYQG7i8hHZ50z7PrgDEYjHE59gTLhmdOlDfc7gtr+1E3tHOzo7c3Bw2Exsss/z9YGMwGAFIINtodrP7E3xC0UAddfvZP8hgkGCIUHQxOjM5M8+8s3uEpKKsu8z7htc3F/e98cb/7TmvL+fm5TXl5tLZufqq3AY+z4PJf/DTX4Dv8zC+kD6+BpnBYNhqGAHIhXk2lDzyVMhtoqmf/iGGRhgJE44SnWVWAmBh6QKP7Sm1SysTldUJv29u7n+88UZPT1NeHhIAHV944SHZmK4HvzZd2QQB9oPn9jmnDAbDVsEIwOKyAMyzOZRSeoQjsjHGxhmfZPInAmDnFVFUapVWnKgomXuHuTkSidhpq6dH3j9p7e1r/95Tvp7IJhFkP3juGudng8GwhTAC4Hj/OEvYNkksi41G9QDZyrn2fDhxQgLg2MS770oDnCBA1tbGgyjI9GwWFKT/YDAYthJGAOJLlgAWF5meJhZjdhaKCikspKCAR4bHo4yPqwFjZ8+6cYCU4ODBTa8G23zAMBgMJgK4eTMxNZUAxse5cYNgkEQCnvFSXs7OnZvodNMpK5MG6OUdG+nrkwa49YB9+9gwzJ0/BoPBCMDwcOLllxOBQAKYnOTmTS5cgPx8mpupq8Pn4xHj9bq5IHn9QDicmguqryczSuAfIdtAGuG/IDMYDFsEIwCz44noaOLPv5GYgOlpgkGorKSzjWPHlHbZLAGwH9a0RBpgWehBNNoPebK+pAbU1LAeDAaDwZDLKzBEYiiRCCTiTZU3pjsRh4upqmL/fo4epaODR4vFMs88Q1kZgQCxGLZ9DXIdGbhDZy579mAwGAyGrMnloxAhPhSPBw4n7lYjV2tZFBWhCKC+Xsv/x5xuLy1FtsxlRwAgF05BBevBYDAYTAqojETZc4m25xLRKDMzSAC2b6ekhCeS88sCoOMp/rKdO+BQIIgCOP5mupRGYQpQxSEFEZAAhPvcg44OKAClQGkXxoJb2BubAw539txp+v889OYL/GVqpCMVAAB3APltOh0J8wcKqeLtMwBhXgQAUD0A8v+UfMvrbwUAAAjAezk/VtzlL/EBAKooCnk8AAAtAIBoEAAAAAEAABAAAAABAAA8yVeyLNvtdpfLRSnV7/dns1mj0ZC4AQAByPPcObderw+HQ61WG4/H3vvVaiVxAwACsN/vt9utc26z2dTr9cVi0W63n0sCIGIgAN77JEmOx2NeOp1OYQ2HAiBu4BK42WwaY6y1tzV8CGs4FABxA98AhsPhZDK5Xq+9Xk9rPZ1OwzoajQRA3EAArLXL5dIYcz6flVKDwWA+n7daLQHwCMBjcOE8TVOtdbfbFQAAr4ECAPgnMACAAAAA7s0HoDFhsamH/bcAAAAASUVORK5CYII=",rU={thin:100,light:300,regular:400,normal:400,medium:500,bold:700,black:900};class iU{constructor(t){this._webGLHelper=t,this.fontRepository="https://raw.githubusercontent.com/etiennepinchon/aframe-fonts/master/fonts/",this._fonts=new gi([],JSON.stringify),this._metadataPromises=new Map,this._fontPromises=new Map,this._promises=[],this._defaultFontEntry={metrics:Bm(dE),texture:t?this._createTextureNow(nU):void 0}}async waitUntilReady(){await Promise.all(this._promises)}getFont(t,n="normal",r="regular"){if(Me(r)&&(r=rU[r.toLowerCase()],!r))throw new Error("Unknown font weight: "+r);const i={family:t,style:n,weight:r};let a=this._fonts.get(i);return a||(a={metrics:void 0,texture:void 0},this._fonts.set(i,a),this._promises.push(this._loadFontEntry(a,i))),a}async _loadFontEntry(t,n){try{const r=await this._loadMetadata(n.family),i=oU(r,n),a=this.fontRepository+PE(n.family)+"/"+i.replace(/\.\w+/,""),o=this._createTexture(a+".png"),s=this._loadFont(a+".json");t.texture=await o,t.metrics=await s}catch(r){console.log("Cannot load font. Using default.",r),t.metrics=this._defaultFontEntry.metrics,t.texture=this._defaultFontEntry.texture}}_loadFont(t){let n=this._fontPromises.get(t);return n||(n=fetch(t).then(r=>{if(!r.ok)throw new Error("Could not load font: "+r.status);return r}).then(r=>r.json()).then(r=>Bm(r)),this._fontPromises.set(t,n)),n}_loadMetadata(t){const n=PE(t);let r=this._metadataPromises.get(n);return r||(r=fetch(this.fontRepository+n+"/METADATA.pb").then(i=>{if(!i.ok)throw new Error("Could not load font metadata: "+i.status);return i}).then(i=>i.text()).then(i=>aU(i)).catch(i=>{console.warn(i)}),this._metadataPromises.set(n,r)),r}getDefaultFont(){return this._defaultFontEntry}_createTexture(t){const n=this._webGLHelper.gl;return new Promise((r,i)=>{kl(n,{src:t,min:n.LINEAR},(a,o,s)=>{a?i(a):r(o)})})}_createTextureNow(t){const n=this._webGLHelper.gl;let r;const i=new Promise((a,o)=>{r=kl(n,{src:t,min:n.LINEAR},(s,c,l)=>{s?o(s):a(c)})});return this._promises.push(i),r}}function PE(e){return e.toLowerCase().replaceAll(/[^\w]/g,"")}function aU(e){const t=e.split(`
|
1641
1641
|
`),n=[];let r;for(const i of t)if(i.startsWith("fonts {")&&(r={name:void 0,style:void 0,weight:void 0,filename:void 0,post_script_name:void 0,full_name:void 0,copyright:void 0}),i.startsWith("}")&&(n.push(r),r=void 0),r){let a=i.match(/^\s*([A-Za-z_]+):[ ]?"(.*)"$/);if(a){const o=a[1];r[o]=a[2]}if(a=i.match(/^\s*([A-Za-z_]+):[ ]?(\d+)$/),a){const o=a[1];r[o]=+a[2]}}return n}function oU(e,t){let n,r=Number.POSITIVE_INFINITY;for(const i of e)if(t.family.localeCompare(i.name,void 0,{sensitivity:"accent"})==0&&t.style==i.style){const a=Math.abs(t.weight-i.weight);a<r&&(r=a,n=i)}return n==null?void 0:n.filename}function sU(e,t){const n=[];let r;for(const i of e.split(`
|
1642
1642
|
`))if(i.startsWith(">"))r={identifier:i.match(/>(\S+)/)[1],sequence:""},n.push(r);else if(r)r.sequence+=i.trim();else throw new Error("Invalid fasta file!");return n}class cU{constructor(t,n){this.animator=t,this.disabled=!!n,this.damping=.015,this.acceleration=.3,this.accelerationThreshold=100,this.lowerLimit=.5,this.loop=!1,this.momentum=0,this.timestamp=0,this.callback=null,this._transitionCallback=this.animate.bind(this),this.clear()}clear(){this.momentum=0,this.timestamp=null,this.loop=null,this.callback=null}cancel(){this.loop&&(this.animator.cancelTransition(this._transitionCallback),this.clear())}setMomentum(t,n){if(this.disabled){n(t);return}t*this.momentum<0?this.momentum=0:Math.abs(t)>this.accelerationThreshold?this.momentum=lv([this.momentum,t],this.acceleration):this.momentum=t,this.callback=n,this.loop||this.animate()}animate(t){this.callback(this.momentum);const n=t-this.timestamp||0;this.timestamp=t;const r=Math.abs(this.momentum);this.momentum=Math.sign(this.momentum)*Math.max(0,r-((r*this.damping)**1.5+.04)*n),Math.abs(this.momentum)>this.lowerLimit?(this.loop=!0,this.animator.requestTransition(this._transitionCallback)):this.clear()}}function lU(e){const t={},n=["string","number","boolean"],r=["wheelDelta","wheelDeltaX","wheelDeltaY"];for(const i in e){const a=i;!r.includes(i)&&n.includes(typeof e[a])&&(t[a]=e[a])}return t}const ME=new Map;async function uU(e,t,n){const r=e.symbol;let i=ME.get(r)??await dU(e.symbol);return i?(ME.set(r,i),$`
|
@@ -1664,7 +1664,7 @@ Reason: ${s.message}`)}));if(n.isViewSpec(a))return a.baseUrl=(o=i.match(/^[^?#]
|
|
1664
1664
|
<div class="title">
|
1665
1665
|
<strong>${o}</strong>
|
1666
1666
|
</div>
|
1667
|
-
`:"";return $`${s}${a}`}class Ka extends qn{constructor(n,r,i,a,o,s){super(n,r,i,a,o,s);Z(this,si,[]);this.spec=n,this.needsAxes={x:!0,y:!0}}async initializeChildren(){le(this,si,await Promise.all(this.spec.layer.map((n,r)=>this.context.createOrImportView(n,this,this,"grid"+r,i=>{if(!rd(i)&&!nd(i))throw new Za("LayerView accepts only unit or layer specs as children!",this)}))))}get children(){return P(this,si).slice()}*[Symbol.iterator](){for(const n of P(this,si))yield n}render(n,r,i={}){if(super.render(n,r,i),!!this.isConfiguredVisible()){n.pushView(this,r);for(const a of P(this,si))a.render(n,r,i);n.popView(this)}}propagateInteractionEvent(n){this.handleInteractionEvent(void 0,n,!0);for(let r=P(this,si).length-1;r>=0;r--)if(P(this,si)[r].propagateInteractionEvent(n),n.stopped)return;this.handleInteractionEvent(void 0,n,!1)}}si=new WeakMap;class OE{constructor(t,n){this.n=t,this.maxCols=n??1/0}get nRows(){return this.maxCols==1/0?1:Math.ceil(this.n/this.maxCols)}get nCols(){return Math.min(this.n,this.maxCols)}get rowIndices(){const t=[],n=this.nCols,r=this.nRows;for(let i=0;i<r;i++){const a=[];t.push(a);for(let o=0;o<n;o++){const s=i*n+o;s<this.n&&a.push(s)}}return t}get colIndices(){const t=[],n=this.nCols,r=this.nRows;for(let i=0;i<n;i++){const a=[];t.push(a);for(let o=0;o<r;o++){const s=o*n+i;s<this.n&&a.push(s)}}return t}getCellIndex(t,n){let r=0;if(this.maxCols==1/0)r=n==0?t:void 0;else{if(t>=this.maxCols)return;r=n*this.nCols+t}return r<this.n?r:void 0}getCellCoords(t){if(!(t<0||t>=this.n))return[t%this.nCols,Math.floor(t/this.nCols)]}}const bU="chromosome_ticks_and_labels",yU={x:"width",y:"height"};function Qm(e){return e=="x"?"y":"x"}const td={x:["bottom","top"],y:["left","right"]},Xm=Object.fromEntries(Object.entries(td).map(([e,t])=>t.map(n=>[n,e])).flat(1));function Li(e){return Xm[e]}class Km extends Ka{constructor(t,n,r,i,a,o){const s=n=="locus",c={...s?wU:LE,...vU(n,t),...t};super(s?xU(c,n):NE(c,n),r,i,a,`axis_${t.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...o}),this.axisProps=c}getSize(){const t={px:this.getPerpendicularSize()},n={grow:1};return Xm[this.axisProps.orient]=="x"?new Gr(n,t):new Gr(t,n)}getPerpendicularSize(){return Jm(this.axisProps)}isPickingSupported(){return!1}}function Jm(e){const t=Li(e.orient);let n=e.ticks&&e.tickSize||0;return e.labels&&(n+=e.labelPadding,t=="x"?n+=e.labelFontSize:n+=30),e.title&&(n+=e.titlePadding+e.titleFontSize),n=Math.min(e.maxExtent||1/0,Math.max(e.minExtent||0,n)),n}const LE={values:null,minExtent:20,maxExtent:1/0,offset:0,domain:!0,domainWidth:1,domainColor:"gray",domainDash:null,domainDashOffset:0,domainCap:"square",ticks:!0,tickSize:5,tickWidth:1,tickColor:"gray",tickDash:null,tickDashOffset:0,tickCap:"square",tickCount:null,tickMinStep:null,labels:!0,labelAlign:"center",labelBaseline:"middle",labelPadding:4,labelFontSize:10,labelLimit:180,labelColor:"black",format:null,titleColor:"black",titleFont:"sans-serif",titleFontSize:10,titlePadding:3};function vU(e,t){const n=t.orient,r=e=="nominal"||e=="ordinal";let i="center",a="middle",o=t.labelAngle??((n=="top"||n=="bottom")&&r?-90:0);switch(n){case"left":i="right";break;case"right":i="left";break;case"top":case"bottom":Math.abs(o)>30?(i=o>0==(n=="bottom")?"left":"right",a="middle"):a=n=="top"?"alphabetic":"top";break}return{labelAlign:i,labelAngle:o,labelBaseline:a}}function NE(e,t){const n={...e,extent:Jm(e)},r=Li(n.orient),i=Qm(r),a=n.orient=="bottom"||n.orient=="right"?1:-1,o=n.orient=="bottom"||n.orient=="left"?1:0,s=()=>({name:"domain",data:{values:[0]},mark:{type:"rule",clip:!1,strokeDash:n.domainDash,strokeCap:n.domainCap,color:n.domainColor,[i]:o,size:n.domainWidth}}),c=()=>({name:"labels",mark:{type:"text",clip:!1,align:n.labelAlign,angle:n.labelAngle,baseline:n.labelBaseline,[i+"Offset"]:(n.tickSize+n.labelPadding)*a,[i]:o,size:n.labelFontSize,color:n.labelColor,minBufferSize:1500},encoding:{[r]:{field:"value",type:t},text:{field:"label"}}}),l=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:n.tickDash,strokeCap:n.tickCap,color:n.tickColor,size:n.tickWidth,minBufferSize:300},encoding:{[i]:{value:o},[i+"2"]:{value:o-n.tickSize/n.extent*(o?1:-1)}}}),u=()=>({name:"title",data:{values:[0]},mark:{type:"text",clip:!1,align:"center",baseline:n.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(n.orient)],text:n.title,color:n.titleColor,[r]:.5,[i]:1-o}}),f=()=>{const d={name:"ticks_and_labels",encoding:{[r]:{field:"value",type:t}},layer:[]};return n.ticks&&d.layer.push(l()),n.labels&&d.layer.push(c()),d},h={resolve:{scale:{[r]:"forced"}},[yU[Qm(r)]]:n.extent,data:{lazy:{type:"axisTicks",channel:r,axis:e}},layer:[]};return n.domain&&h.layer.push(s()),(n.ticks||n.labels)&&h.layer.push(f()),n.title&&h.layer.push(u()),h}const wU={...LE,chromTicks:!0,chromTickSize:18,chromTickWidth:1,chromTickColor:"#989898",chromTickDash:[4,2],chromTickDashOffset:1,chromLabels:!0,chromLabelFontSize:13,chromLabelFontWeight:"normal",chromLabelFontStyle:"normal",chromLabelColor:"black",chromLabelAlign:"left",chromLabelPadding:7};function xU(e,t){const n={...e,extent:Jm(e)},r=Li(n.orient),i=Qm(r),a=n.orient=="bottom"||n.orient=="left"?1:0,o=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:e.chromTickDash,strokeDashOffset:e.chromTickDashOffset,[i]:a,[i+"2"]:a-n.chromTickSize/n.extent*(a?1:-1),color:e.chromTickColor,size:n.chromTickWidth}}),s=()=>{let u;switch(n.orient){case"top":u={y:0,angle:0,paddingX:4,dy:-n.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":u={y:1,angle:0,paddingX:4,dy:n.chromLabelPadding+n.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":u={x:1,angle:-90,paddingY:4,dy:-n.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":u={x:0,angle:90,align:"right",paddingY:4,dy:-n.chromLabelPadding};break;default:u={}}return{name:"chromosome_labels",mark:{type:"text",size:n.chromLabelFontSize,font:n.chromLabelFont,fontWeight:n.chromLabelFontWeight,fontStyle:n.chromLabelFontStyle,color:n.chromLabelColor,align:e.chromLabelAlign,baseline:"alphabetic",clip:!1,...u},encoding:{[r+"2"]:{field:"continuousEnd",type:t},text:{field:"name"}}}};let c;switch(n.orient){case"bottom":case"top":c={};break;case"left":c={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":c={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:c={}}const l=NE({...e,...c},t);if(e.chromTicks||e.chromLabels){const u={name:bU,data:{lazy:{type:"axisGenome",channel:Li(n.orient)}},encoding:{[r]:{field:"continuousStart",type:t,band:0}},layer:[]};if(e.chromTicks&&u.layer.push(o()),e.chromLabels){u.layer.push(s());let f;l.layer.filter(h=>h.name=="ticks_and_labels").forEach(h=>h.layer.filter(d=>d.name=="labels").forEach(d=>{f=d.mark})),f&&(n.orient=="top"||n.orient=="bottom"?(f.viewportEdgeFadeWidthLeft=30,f.viewportEdgeFadeDistanceLeft=40):(f.viewportEdgeFadeWidthBottom=30,f.viewportEdgeFadeDistanceBottom=40))}l.layer.push(u)}return l}class AU extends Ka{constructor(t,n,r,i,a,o){const c={...n=="locus"?EU:zE,...t};super(kU(c,n),r,i,a,`axisGrid_${t.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...o}),this.axisProps=c}getOrient(){return this.axisProps.orient}isPickingSupported(){return!1}}const zE={values:null,grid:!1,gridCap:"butt",gridColor:"lightgray",gridDash:null,gridOpacity:1,gridWidth:1,tickCount:null,tickMinStep:null},EU={...zE,chromGrid:!1,chromGridCap:"butt",chromGridColor:"gray",chromGridDash:[1,5],chromGridOpacity:1,chromGridWidth:1};function SU(e,t){const n=e,r=Li(n.orient);return{name:"grid_lines",data:{lazy:{type:"axisTicks",channel:r,axis:e}},mark:{type:"rule",strokeDash:n.gridDash,strokeCap:n.gridCap,color:n.gridColor,size:n.gridWidth,opacity:n.gridOpacity,minBufferSize:300},encoding:{[r]:{field:"value",type:t}}}}function _U(e,t){const n=e,r=Li(n.orient);return{name:"chromosome_lines",data:{lazy:{type:"axisGenome",channel:r}},mark:{type:"rule",strokeDash:n.chromGridDash,strokeCap:n.chromGridCap,color:n.chromGridColor,size:n.chromGridWidth,opacity:n.chromGridOpacity},encoding:{[r]:{field:"continuousStart",type:t,band:0}}}}function CU(e,t){const n=e,r=Li(n.orient);return{name:"chromosome_fill",data:{lazy:{type:"axisGenome",channel:r}},mark:{type:"rect"},encoding:{[r]:{field:"continuousStart",type:t,band:0},[r+"2"]:{field:"continuousEnd",band:0},fill:{field:"odd",type:"nominal",scale:{domain:[!1,!0],range:[n.chromGridFillEven??"white",n.chromGridFillOdd??"white"]}},opacity:{field:"odd",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[n.chromGridFillEven?1:0,n.chromGridFillOdd?1:0]}}}}}function kU(e,t){const n={...e},r=[];return n.chromGrid&&(n.chromGridFillOdd||n.chromGridFillEven)&&r.push(CU(n,t)),n.chromGrid&&n.chromGridOpacity>0&&r.push(_U(n,t)),n.grid&&n.gridOpacity>0&&r.push(SU(n,t)),{name:"grid_layers",configurableVisibility:!1,resolve:{scale:{[Li(e.orient)]:"forced",fill:"independent",opacity:"independent"}},layer:r}}const UE={anchor:"middle",frame:"group",offset:10,orient:"top",align:void 0,angle:0,baseline:"alphabetic",dx:0,dy:0,color:void 0,font:void 0,fontSize:12,fontStyle:"normal",fontWeight:"normal"},TU={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},IU={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},RU={start:0,middle:.5,end:1},DU={start:"left",middle:"center",end:"right"};function BU(e){if(!e)return;const t=Me(e)?{text:e}:e;if(!t.text||t.orient=="none")return;const n={"track-title":TU,overlay:IU}[t.style]??{},r={...UE,...n,...t};let i={},a={x:0,y:0};const o=RU[r.anchor??"middle"];switch(r.orient){case"top":a={x:o,y:1},i={baseline:"alphabetic",angle:0};break;case"right":a={x:1,y:1-o},i={baseline:"alphabetic",angle:90};break;case"bottom":a={x:o,y:0},i={baseline:"top",angle:0};break;case"left":a={x:0,y:o},i={baseline:"alphabetic",angle:-90};break}const s={...UE,...i,...n,...t},c={xOffset:0,yOffset:0};switch(r.orient){case"top":c.yOffset=-s.offset;break;case"right":c.xOffset=s.offset;break;case"bottom":c.yOffset=s.offset;break;case"left":c.xOffset=-s.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...a,...c,text:s.text,align:s.align??DU[s.anchor],angle:s.angle,baseline:s.baseline,dx:s.dx,dy:s.dy,color:s.color,font:s.font,size:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight}}}function $E(e,t,n,r){if(e.type=="wheel"){e.uiEvent.preventDefault();const i=e.uiEvent,a=i.deltaMode?120:1;let{x:o,y:s}=e.point;if(r){const c=r.mark.encoders;c.x&&!c.x2&&!c.x.constantValue&&(o=+c.x(r.datum)*t.width+t.x),c.y&&!c.y2&&!c.y.constantValue&&(s=(1-+c.y(r.datum))*t.height+t.y)}Math.abs(i.deltaX)<Math.abs(i.deltaY)?n({x:o,y:s,xDelta:0,yDelta:0,zDelta:i.deltaY*a/300}):n({x:o,y:s,xDelta:-i.deltaX*a,yDelta:0,zDelta:0})}else if(e.type=="mousedown"&&e.uiEvent.button===0){const i=e.uiEvent;i.preventDefault();let a=i;const o=c=>{n({x:a.clientX,y:a.clientY,xDelta:c.clientX-a.clientX,yDelta:c.clientY-a.clientY,zDelta:0}),a=c},s=c=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",s)};document.addEventListener("mouseup",s,!1),document.addEventListener("mousemove",o,!1)}}class FU extends qn{constructor(n,r,i,a,o,s,c){super(n,r,i,a,o,c);Z(this,ci);Z(this,q0);Z(this,Lo);Z(this,pf);Z(this,gf);Z(this,mf);Z(this,W0);Z(this,yc);Z(this,Y0);Z(this,gc,1/0);Z(this,mc,10);Z(this,vn,[]);Z(this,Oo,{});Z(this,bc,0);this.spec=n,le(this,mc,n.spacing??10),le(this,gc,s),le(this,vn,[]),this.wrappingFacet=!1}appendChild(n){n.layoutParent??(n.layoutParent=this),P(this,vn).push(new t1(n,this,P(this,bc))),OT(this,bc)._++}setChildren(n){le(this,vn,[]);for(const r of n)this.appendChild(r)}replaceChild(n,r){const i=P(this,vn).findIndex(a=>a.view==n);if(i>=0)P(this,vn)[i]=new t1(r,this,P(this,bc));else throw new Error("Not my child view!")}get children(){return P(this,vn).map(n=>n.view)}get childCount(){return P(this,vn).length}async createAxes(){const n=[];for(const r of ns){const i=this.resolutions.axis[r];if(i){const a=i.getAxisProps();if(a){const o={title:i.getTitle(),orient:td[r][0],...a},s=new Km(o,i.scaleResolution.type,this.context,this,this);n.push(s.initializeChildren()),P(this,Oo)[r]=s}}}return Promise.all([...n,...P(this,vn).map(r=>r.createAxes())])}*[Symbol.iterator](){for(const n of P(this,vn))yield*n.getChildren();for(const n of Object.values(P(this,Oo)))yield n}getOverhang(){return J(this,W0,$T).call(this).union(J(this,yc,pp).call(this))}getSize(){return this._cache("size",()=>new Gr(J(this,gf,K2).call(this,"column"),J(this,gf,K2).call(this,"row")).addPadding(J(this,yc,pp).call(this)))}render(n,r,i={}){if(super.render(n,r,i),!this.isConfiguredVisible())return;this.layoutParent||(r=r.shrink(this.getPadding())),r=r.shrink(J(this,yc,pp).call(this)),n.pushView(this,r);const a={devicePixelRatio:this.context.devicePixelRatio},o=Fl(J(this,pf,X2).call(this,"column"),r.width,a),s=Fl(J(this,pf,X2).call(this,"row"),r.height,a),c=new OE(P(this,ci,Go).length,P(this,gc)??1/0),l=u=>Math.round(u*devicePixelRatio)/devicePixelRatio;for(const[u,f]of P(this,ci,Go).entries()){const{view:h,axes:d,gridLines:p,background:g,backgroundStroke:b,title:v}=f,[x,A]=c.getCellCoords(u),w=o[J(this,mf,J2).call(this,"column",x)],_=s[J(this,mf,J2).call(this,"row",A)],C=h.getViewportSize(),I=h.getSize(),D=h.getOverhang(),B=w.location-D.left,G=_.location-D.top,z=(Ve,L)=>(Ve[L].grow?(L=="width"?w:_).size:Ve[L].px)+D[L],ae=z(C,"width"),se=z(C,"height"),ve=z(I,"width"),Pe=z(I,"height"),st=f.scrollbars.horizontal,Ne=f.scrollbars.vertical,lt=st?()=>l(st.viewportOffset):()=>0,tt=Ne?()=>l(Ne.viewportOffset):()=>0,ut=new Wn(()=>r.x+B,()=>r.y+G,()=>ae,()=>se),Te=h.isScrollable(),Ie=Te?new Wn(()=>r.x+B-lt(),()=>r.y+G-tt(),()=>ve,()=>Pe):ut;f.coords=ut;const Rt=i.clipRect?ut.intersect(i.clipRect):ut;g==null||g.render(n,Rt,{...i,clipRect:void 0});for(const Ve of Object.values(p))Ve.render(n,ut,i);const ln=MU(h)||Te;ln&&h.render(n,Ie,{...i,clipRect:Rt}),b==null||b.render(n,Rt,{...i,clipRect:void 0});for(const[Ve,L]of Object.entries(d)){const O=Ve=="left"||Ve=="right"?"vertical":"horizontal",W=f.scrollbars[O],j=W?ut.modify(O=="vertical"?{y:()=>Ie.y,height:Pe}:{x:()=>Ie.x,width:ve}):ut,Q=e1(j,Ve,L);let T=i.clipRect;W&&(T=Q.intersect(T).intersect(W?ut.modify(O=="vertical"?{x:-1e5,width:2e5}:{y:-1e5,height:2e5}):void 0)),L.render(n,Q,{...i,clipRect:T})}for(const Ve of Object.values(P(this,Oo))){const O=Ve.axisProps.orient;(O=="left"&&x==0||O=="right"&&x==c.nCols-1||O=="top"&&A==0||O=="bottom"&&A==c.nRows-1)&&Ve.render(n,e1(ut.shrink(f.view.getOverhang()),O,Ve),i)}ln||h.render(n,Ie,i);for(const Ve of Object.values(f.scrollbars))Ve.updateScrollbar(ut,Ie),Ve.render(n,r,i);v==null||v.render(n,ut,i)}n.popView(this)}propagateInteractionEvent(n){if(this.handleInteractionEvent(void 0,n,!0),n.stopped)return;const r=P(this,ci,Go).find(a=>a.coords.containsPoint(n.point.x,n.point.y));for(const a of Object.values((r==null?void 0:r.scrollbars)??{}))if(a.coords.containsPoint(n.point.x,n.point.y)&&(a.propagateInteractionEvent(n),n.stopped))return;const i=r==null?void 0:r.view;i&&(i.propagateInteractionEvent(n),(i instanceof mt||i instanceof Ka)&&$E(n,r.coords,a=>J(this,Y0,HT).call(this,r.coords,r.view,a),this.context.getCurrentHover())),!n.stopped&&this.handleInteractionEvent(void 0,n,!1)}getDefaultResolution(n,r){return"independent"}}gc=new WeakMap,mc=new WeakMap,vn=new WeakMap,Oo=new WeakMap,bc=new WeakMap,ci=new WeakSet,Go=function(){return P(this,vn).filter(n=>n.view.isConfiguredVisible())},q0=new WeakSet,UT=function(){return new OE(P(this,ci,Go).length,P(this,gc)??1/0)},Lo=new WeakSet,Tf=function(n){const r=n=="column"?"width":"height",i=(a,o)=>a.map(s=>{const l=P(this,ci,Go)[s].getOverhangAndPadding();return n=="column"?o?l.right:l.left:o?l.bottom:l.top}).reduce((s,c)=>Math.max(s,c),0);return this._cache(`size/directionSizes/${n}`,()=>P(this,q0,UT)[n=="column"?"colIndices":"rowIndices"].map(a=>({axisBefore:i(a,0),axisAfter:i(a,1),view:UL(a.map(o=>P(this,ci,Go)[o].view.getViewportSize()[r]))})))},pf=new WeakSet,X2=function(n){const r=J(this,Lo,Tf).call(this,n),i=[];i.push(Pl);for(const[a,o]of r.entries())a>0&&i.push({px:P(this,mc),grow:0}),(a==0||this.wrappingFacet)&&i.push(Pl),i.push({px:o.axisBefore,grow:0}),i.push(o.view),i.push({px:o.axisAfter,grow:0}),(a==r.length-1||this.wrappingFacet)&&i.push(Pl);return i},gf=new WeakSet,K2=function(n){let r=0,i=0;const a=n=="row"?this.spec.height:this.spec.width;if(a||a===0)return qA(a);const o=J(this,Lo,Tf).call(this,n);for(const[s,c]of o.entries())s>0&&(i+=P(this,mc)),(s==0||this.wrappingFacet)&&(i+=0),i+=c.axisBefore,i+=c.view.px??0,r+=c.view.grow??0,i+=c.axisAfter,(s==o.length-1||this.wrappingFacet)&&(i+=0);return{px:i,grow:r}},mf=new WeakSet,J2=function(n,r){return n=="row"&&this.wrappingFacet?1+6*r+2:2+4*r+1},W0=new WeakSet,$T=function(){const n=J(this,Lo,Tf).call(this,"column"),r=J(this,Lo,Tf).call(this,"row");return!n.length||!r.length?Ct.zero():new Ct(r.at(0).axisBefore,n.at(-1).axisAfter,r.at(-1).axisAfter,n.at(0).axisBefore)},yc=new WeakSet,pp=function(){const n=r=>{const i=Xm[r],a=P(this,Oo)[i];return(a==null?void 0:a.axisProps.orient)!==r?0:Math.max(a.getPerpendicularSize()+a.axisProps.offset,0)};return new Ct(n("top"),n("right"),n("bottom"),n("left"))},Y0=new WeakSet,HT=function(n,r,i){for(const[a,o]of Object.entries(PU(r))){if(o.size<=0)continue;const s=n.normalizePoint(i.x,i.y),c=n.normalizePoint(i.x+i.xDelta,i.y+i.yDelta),l={x:c.x-s.x,y:c.y-s.y};for(const u of o)u.zoom(2**i.zDelta,a=="y"?1-s[a]:s[a],a=="x"?l.x:-l.y)}this.context.animator.requestRender()};function HE(e){if(!(!e||!e.fill||e.fillOpacity===0))return{configurableVisibility:!1,data:{values:[{}]},mark:{color:e.fill,opacity:e.fillOpacity??1,type:"rect",clip:!1,tooltip:null,minHeight:1,minOpacity:0}}}function GE(e){if(!(!e||!e.stroke||e.strokeWidth===0||e.strokeOpacity===0))return{configurableVisibility:!1,resolve:{scale:{x:"excluded",y:"excluded"},axis:{x:"excluded",y:"excluded"}},data:{values:[{x:0,y:0,x2:1,y2:0},{x:1,y:0,x2:1,y2:1},{x:1,y:1,x2:0,y2:1},{x:0,y:1,x2:0,y2:0}]},mark:{size:e.strokeWidth??1,color:e.stroke??"lightgray",strokeCap:"square",strokeOpacity:e.strokeOpacity??1,type:"rule",clip:!1,tooltip:null},encoding:{x:{field:"x",type:"quantitative",scale:null},y:{field:"y",type:"quantitative",scale:null},x2:{field:"x2"},y2:{field:"y2"}}}}function PU(e){const t={x:new Set,y:new Set};return e.visit(n=>{for(const[r,i]of Object.entries(t)){const a=n.getScaleResolution(r);a&&a.isZoomable()&&i.add(a)}}),t}function MU(e){let t=!0;return e.visit(n=>{n instanceof mt&&t&&(t=n.mark.properties.clip===!0)}),t}function e1(e,t,n){const r=n.axisProps,i=n.getPerpendicularSize();if(t=="bottom")return e.translate(0,e.height+r.offset).modify({height:i});if(t=="top")return e.translate(0,-i-r.offset).modify({height:i});if(t=="left")return e.translate(-i-r.offset,0).modify({width:i});if(t=="right")return e.translate(e.width+r.offset,0).modify({width:i})}class t1{constructor(t,n,r){if(this.layoutParent=n,this.view=t,this.serial=r,this.background=void 0,this.backgroundStroke=void 0,this.axes={},this.gridLines={},this.scrollbars={},this.title=void 0,this.coords=Wn.ZERO,t.needsAxes.x||t.needsAxes.y){const i=t.spec,a="view"in i?i==null?void 0:i.view:void 0,o=HE(a);o&&(this.background=new mt(o,n.context,n,t,"background"+r,{blockEncodingInheritance:!0}));const s=GE(a);s&&(this.backgroundStroke=new mt(s,n.context,n,t,"backgroundStroke"+r,{blockEncodingInheritance:!0}));const c=BU(t.spec.title);if(c){const l=new mt(c,n.context,n,t,"title"+r,{blockEncodingInheritance:!0});this.title=l}}t.spec.viewportWidth!=null&&(this.scrollbars.horizontal=new VE(this,"horizontal")),t.spec.viewportHeight!=null&&(this.scrollbars.vertical=new VE(this,"vertical"))}*getChildren(){this.background&&(yield this.background),this.backgroundStroke&&(yield this.backgroundStroke),this.title&&(yield this.title),yield*Object.values(this.axes),yield*Object.values(this.gridLines),yield this.view,yield*Object.values(this.scrollbars)}async createAxes(){const{view:t,axes:n,gridLines:r}=this,i=(s,c)=>{const l=s.getAxisProps();if(l===null)return;const u=l?{...l}:{};if(!u.orient){for(const f of td[c])if(!n[f]){u.orient=f;break}if(!u.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if(u.title??(u.title=s.getTitle()),!td[c].includes(u.orient))throw new Error(`Invalid axis orientation "${u.orient}" on channel "${c}"!`);return u},a=async(s,c,l)=>{const u=i(s,c);if(u){if(n[u.orient])throw new Error(`An axis with the orient "${u.orient}" already exists!`);const f=new Km(u,s.scaleResolution.type,this.layoutParent.context,this.layoutParent,l);n[u.orient]=f,await f.initializeChildren()}},o=async(s,c,l)=>{const u=i(s,c);if(u&&(u.grid||u.chromGrid)){const f=new AU(u,s.scaleResolution.type,this.layoutParent.context,this.layoutParent,l);r[u.orient]=f,await f.initializeChildren()}};for(const s of["x","y"])if(t.needsAxes[s]){const c=t.resolutions.axis[s];if(!c)continue;await a(c,s,t)}for(const s of["x","y"])if(t.needsAxes[s]){const c=t.getAxisResolution(s);if(!c)continue;await o(c,s,t)}if(t instanceof Ka){for(const s of t)for(const[c,l]of Object.entries(s.resolutions.axis)){const u=l.getAxisProps();u&&u.orient&&await a(l,c,s)}for(const s of t)for(const[c,l]of Object.entries(s.resolutions.axis)){const u=l.getAxisProps();u&&!u.orient&&await a(l,c,s)}}[...Object.values(n),...Object.values(r)].forEach(s=>s.visit(c=>{c instanceof mt&&c.resolve("scale")}))}getOverhang(){const t=n=>{const r=this.axes[n];return r?Math.max(r.getPerpendicularSize()+r.axisProps.offset,0):0};return new Ct(t("top"),t("right"),t("bottom"),t("left")).add(this.view.getOverhang())}getOverhangAndPadding(){return this.getOverhang().add(this.view.getPadding())}}class VE extends mt{constructor(t,n){const r={scrollbarSize:8,scrollbarPadding:2};super({data:{values:[{}]},mark:{type:"rect",fill:"#b0b0b0",fillOpacity:.6,stroke:"white",strokeWidth:1,strokeOpacity:1,cornerRadius:5,clip:!1},configurableVisibility:!1},t.layoutParent.context,t.layoutParent,t.view,"scrollbar-"+n,{blockEncodingInheritance:!0}),this.config=r,this.scrollDirection=n,this.viewportOffset=0,this.maxScrollOffset=0,this.scrollbarCoords=Wn.ZERO,this.addInteractionEventListener("mousedown",(i,a)=>{if(a.stopPropagation(),this.maxScrollOffset<=0)return;const o=h=>n=="vertical"?h.clientY:h.clientX,s=a.uiEvent;s.preventDefault();const c=this.getScrollOffset(),l=o(s),u=h=>{const d=Ai(o(h)-l+c,0,this.maxScrollOffset);this.viewportOffset=d/this.maxScrollOffset*this.maxViewportOffset,this.context.animator.requestRender()},f=()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f,!1),document.addEventListener("mousemove",u,!1)})}getScrollOffset(){return this.viewportOffset/this.maxViewportOffset*this.maxScrollOffset}render(t,n,r){super.render(t,this.scrollbarCoords,r)}updateScrollbar(t,n){const r=this.config.scrollbarPadding,i=this.config.scrollbarSize,a=this.scrollDirection=="horizontal"?"width":"height",o=Math.min(1,t[a]/n[a]),s=t[a]-2*r,c=o*s;this.maxScrollOffset=s-c,this.maxViewportOffset=n[a]-t[a],this.viewportOffset=Ai(this.viewportOffset,0,this.maxViewportOffset),this.scrollbarCoords=this.scrollDirection=="vertical"?new Wn(()=>t.x+t.width-i-r,()=>t.y+r+this.getScrollOffset(),()=>i,()=>c):new Wn(()=>t.x+r+this.getScrollOffset(),()=>t.y+t.height-i-r,()=>c,()=>i)}}class ys extends FU{constructor(t,n,r,i,a){super(t,n,r,i,a,n1(t)?t.columns:id(t)?1:1/0),this.spec=t}async initializeChildren(){const t=this.spec,n=n1(t)?t.concat:id(t)?t.vconcat:t.hconcat;this.setChildren(await Promise.all(n.map((r,i)=>this.context.createOrImportView(r,this,this,"grid"+i)))),await this.createAxes()}getDefaultResolution(t,n){return n=="axis"?"independent":id(this.spec)&&t==="x"||qE(this.spec)&&t==="y"?"shared":"independent"}}const jE="viewRoot";class OU{constructor(t={}){Z(this,vc,new Map);this.options={allowImport:!0,wrapRoot:!0,...t};const n=r=>(i,a,o,s,c)=>new r(i,a,o,s,i.name??c);this.addViewType(rd,n(Ka)),this.addViewType(nd,n(mt)),this.addViewType(id,n(ys)),this.addViewType(qE,n(ys)),this.addViewType(n1,n(ys)),this.addViewType(WE,()=>{throw new Error("SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!")})}addViewType(t,n){P(this,vc).set(t,n)}createView(t,n,r,i,a){for(const[o,s]of P(this,vc))if(o(t))return s(t,n,r,i,a);throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(t)]))}isViewSpec(t){const n=[...P(this,vc).keys()].filter(r=>r(t));if(n.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return n.length==1}async createOrImportView(t,n,r,i,a,o){let s;if(NU(t))if(this.options.allowImport)s=await Wz(t,i.getBaseUrl(),n),o&&o(s);else throw new Za("Importing views is not allowed!",r);else s=t;!i&&this.options.wrapRoot&&(nd(s)||rd(s))&&a===jE&&(s={name:"implicitRoot",vconcat:[s]});const c=this.createView(s,n,r,i,a);return c instanceof qn&&await c.initializeChildren(),c}}vc=new WeakMap;function nd(e){return"mark"in e&&(Me(e.mark)||Xt(e.mark))}function rd(e){return"layer"in e&&Xt(e.layer)}function LU(e){return e&&(nd(e)||rd(e))&&"aggregateSamples"in e}function NU(e){return"import"in e}function id(e){return"vconcat"in e&&Qt(e.vconcat)}function qE(e){return"hconcat"in e&&Qt(e.hconcat)}function n1(e){return"concat"in e&&Qt(e.concat)}function WE(e){return"samples"in e&&Xt(e.samples)&&"spec"in e&&Xt(e.spec)}class zU{constructor(){Z(this,wc,void 0);Z(this,No,void 0);Z(this,bf,void 0);Z(this,zo,void 0);le(this,wc,new Map),le(this,No,new Set),le(this,zo,new Map),le(this,bf,new Proxy(P(this,wc),{get(t,n){return Me(n)?t.get(n):void 0}}))}allocateSetter(t){if(P(this,No).has(t))throw new Error("Setter already allocated for parameter: "+t);return P(this,No).add(t),n=>{P(this,wc).set(t,n);const r=P(this,zo).get(t);if(r)for(const i of r)i()}}createExpression(t){const n=sh(t,P(this,bf));for(const r of n.globals)if(!P(this,No).has(r))throw new Error(`Unknown variable "${r}" in expression: ${t}`);return n.addListener=r=>{for(const i of n.globals){const a=P(this,zo).get(i)??new Set;P(this,zo).set(i,a),a.add(r)}},n}}wc=new WeakMap,No=new WeakMap,bf=new WeakMap,zo=new WeakMap,cw("fasta",sU);class YE{constructor(t,n,r={}){this.container=t,this._destructionCallbacks=[];const i=document.createElement("style");i.innerHTML=aD,t.appendChild(i),this.spec=n,this.accessorFactory=new WB,this.viewFactory=new OU,this.namedDataProviders=[],this.animator=new eU(()=>this.renderAll()),this.genomeStore=void 0,this.viewVisibilityPredicate=a=>a.isVisibleInSpec(),this._renderingContext=void 0,this._pickingContext=void 0,this._dirtyPickingBuffer=!1,this._currentHover=void 0,this._wheelInertia=new cU(this.animator),this._keyboardListeners=new Map,this._eventListeners=new Map,this._extraBroadcastListeners=new Map,this.tooltipHandlers={default:mU,refseqgene:uU,...r.tooltipHandlers??{}},this.viewRoot=void 0,this._paramBroker=new zU,this._loadingViews=new Map}registerNamedDataProvider(t){this.namedDataProviders.unshift(t)}getNamedDataFromProvider(t){for(const n of this.namedDataProviders){const r=n(t);if(r)return r}}updateNamedData(t,n){const r=this.viewRoot.context.dataFlow.findNamedDataSource(t);if(!r)throw new Error("No such named data source: "+t);r.dataSource.updateDynamicData(n),Vm(r.hosts),this.animator.requestRender()}broadcast(t,n){var i;const r={type:t,payload:n};this.viewRoot.visit(a=>a.handleBroadcast(r)),(i=this._extraBroadcastListeners.get(t))==null||i.forEach(a=>a(r))}_updateLoadingIndicators(){const t=[],n=()=>[...this._loadingViews.values()].some(r=>r);for(const[r,i]of this._loadingViews){const a=r.coords;if(a){const o={left:`${a.x}px`,top:`${a.y}px`,width:`${a.width}px`,height:`${a.height}px`};t.push($`<div style=${Jf(o)}>
|
1667
|
+
`:"";return $`${s}${a}`}class Ka extends qn{constructor(n,r,i,a,o,s){super(n,r,i,a,o,s);Z(this,si,[]);this.spec=n,this.needsAxes={x:!0,y:!0}}async initializeChildren(){le(this,si,await Promise.all(this.spec.layer.map((n,r)=>this.context.createOrImportView(n,this,this,"grid"+r,i=>{if(!rd(i)&&!nd(i))throw new Za("LayerView accepts only unit or layer specs as children!",this)}))))}get children(){return P(this,si).slice()}*[Symbol.iterator](){for(const n of P(this,si))yield n}render(n,r,i={}){if(super.render(n,r,i),!!this.isConfiguredVisible()){n.pushView(this,r);for(const a of P(this,si))a.render(n,r,i);n.popView(this)}}propagateInteractionEvent(n){this.handleInteractionEvent(void 0,n,!0);for(let r=P(this,si).length-1;r>=0;r--)if(P(this,si)[r].propagateInteractionEvent(n),n.stopped)return;this.handleInteractionEvent(void 0,n,!1)}}si=new WeakMap;class OE{constructor(t,n){this.n=t,this.maxCols=n??1/0}get nRows(){return this.maxCols==1/0?1:Math.ceil(this.n/this.maxCols)}get nCols(){return Math.min(this.n,this.maxCols)}get rowIndices(){const t=[],n=this.nCols,r=this.nRows;for(let i=0;i<r;i++){const a=[];t.push(a);for(let o=0;o<n;o++){const s=i*n+o;s<this.n&&a.push(s)}}return t}get colIndices(){const t=[],n=this.nCols,r=this.nRows;for(let i=0;i<n;i++){const a=[];t.push(a);for(let o=0;o<r;o++){const s=o*n+i;s<this.n&&a.push(s)}}return t}getCellIndex(t,n){let r=0;if(this.maxCols==1/0)r=n==0?t:void 0;else{if(t>=this.maxCols)return;r=n*this.nCols+t}return r<this.n?r:void 0}getCellCoords(t){if(!(t<0||t>=this.n))return[t%this.nCols,Math.floor(t/this.nCols)]}}const bU="chromosome_ticks_and_labels",yU={x:"width",y:"height"};function Qm(e){return e=="x"?"y":"x"}const td={x:["bottom","top"],y:["left","right"]},Xm=Object.fromEntries(Object.entries(td).map(([e,t])=>t.map(n=>[n,e])).flat(1));function Ni(e){return Xm[e]}class Km extends Ka{constructor(t,n,r,i,a,o){const s=n=="locus",c={...s?wU:LE,...vU(n,t),...t};super(s?xU(c,n):NE(c,n),r,i,a,`axis_${t.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...o}),this.axisProps=c}getSize(){const t={px:this.getPerpendicularSize()},n={grow:1};return Xm[this.axisProps.orient]=="x"?new Gr(n,t):new Gr(t,n)}getPerpendicularSize(){return Jm(this.axisProps)}isPickingSupported(){return!1}}function Jm(e){const t=Ni(e.orient);let n=e.ticks&&e.tickSize||0;return e.labels&&(n+=e.labelPadding,t=="x"?n+=e.labelFontSize:n+=30),e.title&&(n+=e.titlePadding+e.titleFontSize),n=Math.min(e.maxExtent||1/0,Math.max(e.minExtent||0,n)),n}const LE={values:null,minExtent:20,maxExtent:1/0,offset:0,domain:!0,domainWidth:1,domainColor:"gray",domainDash:null,domainDashOffset:0,domainCap:"square",ticks:!0,tickSize:5,tickWidth:1,tickColor:"gray",tickDash:null,tickDashOffset:0,tickCap:"square",tickCount:null,tickMinStep:null,labels:!0,labelAlign:"center",labelBaseline:"middle",labelPadding:4,labelFontSize:10,labelLimit:180,labelColor:"black",format:null,titleColor:"black",titleFont:"sans-serif",titleFontSize:10,titlePadding:3};function vU(e,t){const n=t.orient,r=e=="nominal"||e=="ordinal";let i="center",a="middle",o=t.labelAngle??((n=="top"||n=="bottom")&&r?-90:0);switch(n){case"left":i="right";break;case"right":i="left";break;case"top":case"bottom":Math.abs(o)>30?(i=o>0==(n=="bottom")?"left":"right",a="middle"):a=n=="top"?"alphabetic":"top";break}return{labelAlign:i,labelAngle:o,labelBaseline:a}}function NE(e,t){const n={...e,extent:Jm(e)},r=Ni(n.orient),i=Qm(r),a=n.orient=="bottom"||n.orient=="right"?1:-1,o=n.orient=="bottom"||n.orient=="left"?1:0,s=()=>({name:"domain",data:{values:[0]},mark:{type:"rule",clip:!1,strokeDash:n.domainDash,strokeCap:n.domainCap,color:n.domainColor,[i]:o,size:n.domainWidth}}),c=()=>({name:"labels",mark:{type:"text",clip:!1,align:n.labelAlign,angle:n.labelAngle,baseline:n.labelBaseline,[i+"Offset"]:(n.tickSize+n.labelPadding)*a,[i]:o,size:n.labelFontSize,color:n.labelColor,minBufferSize:1500},encoding:{[r]:{field:"value",type:t},text:{field:"label"}}}),l=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:n.tickDash,strokeCap:n.tickCap,color:n.tickColor,size:n.tickWidth,minBufferSize:300},encoding:{[i]:{value:o},[i+"2"]:{value:o-n.tickSize/n.extent*(o?1:-1)}}}),u=()=>({name:"title",data:{values:[0]},mark:{type:"text",clip:!1,align:"center",baseline:n.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(n.orient)],text:n.title,color:n.titleColor,[r]:.5,[i]:1-o}}),f=()=>{const d={name:"ticks_and_labels",encoding:{[r]:{field:"value",type:t}},layer:[]};return n.ticks&&d.layer.push(l()),n.labels&&d.layer.push(c()),d},h={resolve:{scale:{[r]:"forced"}},[yU[Qm(r)]]:n.extent,data:{lazy:{type:"axisTicks",channel:r,axis:e}},layer:[]};return n.domain&&h.layer.push(s()),(n.ticks||n.labels)&&h.layer.push(f()),n.title&&h.layer.push(u()),h}const wU={...LE,chromTicks:!0,chromTickSize:18,chromTickWidth:1,chromTickColor:"#989898",chromTickDash:[4,2],chromTickDashOffset:1,chromLabels:!0,chromLabelFontSize:13,chromLabelFontWeight:"normal",chromLabelFontStyle:"normal",chromLabelColor:"black",chromLabelAlign:"left",chromLabelPadding:7};function xU(e,t){const n={...e,extent:Jm(e)},r=Ni(n.orient),i=Qm(r),a=n.orient=="bottom"||n.orient=="left"?1:0,o=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:e.chromTickDash,strokeDashOffset:e.chromTickDashOffset,[i]:a,[i+"2"]:a-n.chromTickSize/n.extent*(a?1:-1),color:e.chromTickColor,size:n.chromTickWidth}}),s=()=>{let u;switch(n.orient){case"top":u={y:0,angle:0,paddingX:4,dy:-n.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":u={y:1,angle:0,paddingX:4,dy:n.chromLabelPadding+n.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":u={x:1,angle:-90,paddingY:4,dy:-n.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":u={x:0,angle:90,align:"right",paddingY:4,dy:-n.chromLabelPadding};break;default:u={}}return{name:"chromosome_labels",mark:{type:"text",size:n.chromLabelFontSize,font:n.chromLabelFont,fontWeight:n.chromLabelFontWeight,fontStyle:n.chromLabelFontStyle,color:n.chromLabelColor,align:e.chromLabelAlign,baseline:"alphabetic",clip:!1,...u},encoding:{[r+"2"]:{field:"continuousEnd",type:t},text:{field:"name"}}}};let c;switch(n.orient){case"bottom":case"top":c={};break;case"left":c={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":c={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:c={}}const l=NE({...e,...c},t);if(e.chromTicks||e.chromLabels){const u={name:bU,data:{lazy:{type:"axisGenome",channel:Ni(n.orient)}},encoding:{[r]:{field:"continuousStart",type:t,band:0}},layer:[]};if(e.chromTicks&&u.layer.push(o()),e.chromLabels){u.layer.push(s());let f;l.layer.filter(h=>h.name=="ticks_and_labels").forEach(h=>h.layer.filter(d=>d.name=="labels").forEach(d=>{f=d.mark})),f&&(n.orient=="top"||n.orient=="bottom"?(f.viewportEdgeFadeWidthLeft=30,f.viewportEdgeFadeDistanceLeft=40):(f.viewportEdgeFadeWidthBottom=30,f.viewportEdgeFadeDistanceBottom=40))}l.layer.push(u)}return l}class AU extends Ka{constructor(t,n,r,i,a,o){const c={...n=="locus"?EU:zE,...t};super(kU(c,n),r,i,a,`axisGrid_${t.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...o}),this.axisProps=c}getOrient(){return this.axisProps.orient}isPickingSupported(){return!1}}const zE={values:null,grid:!1,gridCap:"butt",gridColor:"lightgray",gridDash:null,gridOpacity:1,gridWidth:1,tickCount:null,tickMinStep:null},EU={...zE,chromGrid:!1,chromGridCap:"butt",chromGridColor:"gray",chromGridDash:[1,5],chromGridOpacity:1,chromGridWidth:1};function SU(e,t){const n=e,r=Ni(n.orient);return{name:"grid_lines",data:{lazy:{type:"axisTicks",channel:r,axis:e}},mark:{type:"rule",strokeDash:n.gridDash,strokeCap:n.gridCap,color:n.gridColor,size:n.gridWidth,opacity:n.gridOpacity,minBufferSize:300},encoding:{[r]:{field:"value",type:t}}}}function _U(e,t){const n=e,r=Ni(n.orient);return{name:"chromosome_lines",data:{lazy:{type:"axisGenome",channel:r}},mark:{type:"rule",strokeDash:n.chromGridDash,strokeCap:n.chromGridCap,color:n.chromGridColor,size:n.chromGridWidth,opacity:n.chromGridOpacity},encoding:{[r]:{field:"continuousStart",type:t,band:0}}}}function CU(e,t){const n=e,r=Ni(n.orient);return{name:"chromosome_fill",data:{lazy:{type:"axisGenome",channel:r}},mark:{type:"rect"},encoding:{[r]:{field:"continuousStart",type:t,band:0},[r+"2"]:{field:"continuousEnd",band:0},fill:{field:"odd",type:"nominal",scale:{domain:[!1,!0],range:[n.chromGridFillEven??"white",n.chromGridFillOdd??"white"]}},opacity:{field:"odd",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[n.chromGridFillEven?1:0,n.chromGridFillOdd?1:0]}}}}}function kU(e,t){const n={...e},r=[];return n.chromGrid&&(n.chromGridFillOdd||n.chromGridFillEven)&&r.push(CU(n,t)),n.chromGrid&&n.chromGridOpacity>0&&r.push(_U(n,t)),n.grid&&n.gridOpacity>0&&r.push(SU(n,t)),{name:"grid_layers",configurableVisibility:!1,resolve:{scale:{[Ni(e.orient)]:"forced",fill:"independent",opacity:"independent"}},layer:r}}const UE={anchor:"middle",frame:"group",offset:10,orient:"top",align:void 0,angle:0,baseline:"alphabetic",dx:0,dy:0,color:void 0,font:void 0,fontSize:12,fontStyle:"normal",fontWeight:"normal"},TU={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},IU={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},RU={start:0,middle:.5,end:1},DU={start:"left",middle:"center",end:"right"};function BU(e){if(!e)return;const t=Me(e)?{text:e}:e;if(!t.text||t.orient=="none")return;const n={"track-title":TU,overlay:IU}[t.style]??{},r={...UE,...n,...t};let i={},a={x:0,y:0};const o=RU[r.anchor??"middle"];switch(r.orient){case"top":a={x:o,y:1},i={baseline:"alphabetic",angle:0};break;case"right":a={x:1,y:1-o},i={baseline:"alphabetic",angle:90};break;case"bottom":a={x:o,y:0},i={baseline:"top",angle:0};break;case"left":a={x:0,y:o},i={baseline:"alphabetic",angle:-90};break}const s={...UE,...i,...n,...t},c={xOffset:0,yOffset:0};switch(r.orient){case"top":c.yOffset=-s.offset;break;case"right":c.xOffset=s.offset;break;case"bottom":c.yOffset=s.offset;break;case"left":c.xOffset=-s.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...a,...c,text:s.text,align:s.align??DU[s.anchor],angle:s.angle,baseline:s.baseline,dx:s.dx,dy:s.dy,color:s.color,font:s.font,size:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight}}}function $E(e,t,n,r){if(e.type=="wheel"){e.uiEvent.preventDefault();const i=e.uiEvent,a=i.deltaMode?120:1;let{x:o,y:s}=e.point;if(r){const c=r.mark.encoders;c.x&&!c.x2&&!c.x.constantValue&&(o=+c.x(r.datum)*t.width+t.x),c.y&&!c.y2&&!c.y.constantValue&&(s=(1-+c.y(r.datum))*t.height+t.y)}Math.abs(i.deltaX)<Math.abs(i.deltaY)?n({x:o,y:s,xDelta:0,yDelta:0,zDelta:i.deltaY*a/300}):n({x:o,y:s,xDelta:-i.deltaX*a,yDelta:0,zDelta:0})}else if(e.type=="mousedown"&&e.uiEvent.button===0){const i=e.uiEvent;i.preventDefault();let a=i;const o=c=>{n({x:a.clientX,y:a.clientY,xDelta:c.clientX-a.clientX,yDelta:c.clientY-a.clientY,zDelta:0}),a=c},s=c=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",s)};document.addEventListener("mouseup",s,!1),document.addEventListener("mousemove",o,!1)}}class FU extends qn{constructor(n,r,i,a,o,s,c){super(n,r,i,a,o,c);Z(this,ci);Z(this,q0);Z(this,Lo);Z(this,pf);Z(this,gf);Z(this,mf);Z(this,W0);Z(this,yc);Z(this,Y0);Z(this,gc,1/0);Z(this,mc,10);Z(this,vn,[]);Z(this,Oo,{});Z(this,bc,0);this.spec=n,le(this,mc,n.spacing??10),le(this,gc,s),le(this,vn,[]),this.wrappingFacet=!1}appendChild(n){n.layoutParent??(n.layoutParent=this),P(this,vn).push(new t1(n,this,P(this,bc))),OT(this,bc)._++}setChildren(n){le(this,vn,[]);for(const r of n)this.appendChild(r)}replaceChild(n,r){const i=P(this,vn).findIndex(a=>a.view==n);if(i>=0)P(this,vn)[i]=new t1(r,this,P(this,bc));else throw new Error("Not my child view!")}get children(){return P(this,vn).map(n=>n.view)}get childCount(){return P(this,vn).length}async createAxes(){const n=[];for(const r of ns){const i=this.resolutions.axis[r];if(i){const a=i.getAxisProps();if(a){const o={title:i.getTitle(),orient:td[r][0],...a},s=new Km(o,i.scaleResolution.type,this.context,this,this);n.push(s.initializeChildren()),P(this,Oo)[r]=s}}}return Promise.all([...n,...P(this,vn).map(r=>r.createAxes())])}*[Symbol.iterator](){for(const n of P(this,vn))yield*n.getChildren();for(const n of Object.values(P(this,Oo)))yield n}getOverhang(){return J(this,W0,$T).call(this).union(J(this,yc,pp).call(this))}getSize(){return this._cache("size",()=>new Gr(J(this,gf,K2).call(this,"column"),J(this,gf,K2).call(this,"row")).addPadding(J(this,yc,pp).call(this)))}render(n,r,i={}){if(super.render(n,r,i),!this.isConfiguredVisible())return;this.layoutParent||(r=r.shrink(this.getPadding())),r=r.shrink(J(this,yc,pp).call(this)),n.pushView(this,r);const a={devicePixelRatio:this.context.devicePixelRatio},o=Fl(J(this,pf,X2).call(this,"column"),r.width,a),s=Fl(J(this,pf,X2).call(this,"row"),r.height,a),c=new OE(P(this,ci,Go).length,P(this,gc)??1/0),l=u=>Math.round(u*devicePixelRatio)/devicePixelRatio;for(const[u,f]of P(this,ci,Go).entries()){const{view:h,axes:d,gridLines:p,background:g,backgroundStroke:b,title:v}=f,[x,A]=c.getCellCoords(u),w=o[J(this,mf,J2).call(this,"column",x)],_=s[J(this,mf,J2).call(this,"row",A)],C=h.getViewportSize(),I=h.getSize(),D=h.getOverhang(),B=w.location-D.left,G=_.location-D.top,z=(Ve,L)=>(Ve[L].grow?(L=="width"?w:_).size:Ve[L].px)+D[L],ae=z(C,"width"),se=z(C,"height"),ve=z(I,"width"),Pe=z(I,"height"),st=f.scrollbars.horizontal,Ne=f.scrollbars.vertical,lt=st?()=>l(st.viewportOffset):()=>0,tt=Ne?()=>l(Ne.viewportOffset):()=>0,ut=new Wn(()=>r.x+B,()=>r.y+G,()=>ae,()=>se),Te=h.isScrollable(),Ie=Te?new Wn(()=>r.x+B-lt(),()=>r.y+G-tt(),()=>ve,()=>Pe):ut;f.coords=ut;const Rt=i.clipRect?ut.intersect(i.clipRect):ut;g==null||g.render(n,Rt,{...i,clipRect:void 0});for(const Ve of Object.values(p))Ve.render(n,ut,i);const ln=MU(h)||Te;ln&&h.render(n,Ie,{...i,clipRect:Rt}),b==null||b.render(n,Rt,{...i,clipRect:void 0});for(const[Ve,L]of Object.entries(d)){const O=Ve=="left"||Ve=="right"?"vertical":"horizontal",W=f.scrollbars[O],j=W?ut.modify(O=="vertical"?{y:()=>Ie.y,height:Pe}:{x:()=>Ie.x,width:ve}):ut,Q=e1(j,Ve,L);let T=i.clipRect;W&&(T=Q.intersect(T).intersect(W?ut.modify(O=="vertical"?{x:-1e5,width:2e5}:{y:-1e5,height:2e5}):void 0)),L.render(n,Q,{...i,clipRect:T})}for(const Ve of Object.values(P(this,Oo))){const O=Ve.axisProps.orient;(O=="left"&&x==0||O=="right"&&x==c.nCols-1||O=="top"&&A==0||O=="bottom"&&A==c.nRows-1)&&Ve.render(n,e1(ut.shrink(f.view.getOverhang()),O,Ve),i)}ln||h.render(n,Ie,i);for(const Ve of Object.values(f.scrollbars))Ve.updateScrollbar(ut,Ie),Ve.render(n,r,i);v==null||v.render(n,ut,i)}n.popView(this)}propagateInteractionEvent(n){if(this.handleInteractionEvent(void 0,n,!0),n.stopped)return;const r=P(this,ci,Go).find(a=>a.coords.containsPoint(n.point.x,n.point.y));for(const a of Object.values((r==null?void 0:r.scrollbars)??{}))if(a.coords.containsPoint(n.point.x,n.point.y)&&(a.propagateInteractionEvent(n),n.stopped))return;const i=r==null?void 0:r.view;i&&(i.propagateInteractionEvent(n),(i instanceof mt||i instanceof Ka)&&$E(n,r.coords,a=>J(this,Y0,HT).call(this,r.coords,r.view,a),this.context.getCurrentHover())),!n.stopped&&this.handleInteractionEvent(void 0,n,!1)}getDefaultResolution(n,r){return"independent"}}gc=new WeakMap,mc=new WeakMap,vn=new WeakMap,Oo=new WeakMap,bc=new WeakMap,ci=new WeakSet,Go=function(){return P(this,vn).filter(n=>n.view.isConfiguredVisible())},q0=new WeakSet,UT=function(){return new OE(P(this,ci,Go).length,P(this,gc)??1/0)},Lo=new WeakSet,Tf=function(n){const r=n=="column"?"width":"height",i=(a,o)=>a.map(s=>{const l=P(this,ci,Go)[s].getOverhangAndPadding();return n=="column"?o?l.right:l.left:o?l.bottom:l.top}).reduce((s,c)=>Math.max(s,c),0);return this._cache(`size/directionSizes/${n}`,()=>P(this,q0,UT)[n=="column"?"colIndices":"rowIndices"].map(a=>({axisBefore:i(a,0),axisAfter:i(a,1),view:UL(a.map(o=>P(this,ci,Go)[o].view.getViewportSize()[r]))})))},pf=new WeakSet,X2=function(n){const r=J(this,Lo,Tf).call(this,n),i=[];i.push(Pl);for(const[a,o]of r.entries())a>0&&i.push({px:P(this,mc),grow:0}),(a==0||this.wrappingFacet)&&i.push(Pl),i.push({px:o.axisBefore,grow:0}),i.push(o.view),i.push({px:o.axisAfter,grow:0}),(a==r.length-1||this.wrappingFacet)&&i.push(Pl);return i},gf=new WeakSet,K2=function(n){let r=0,i=0;const a=n=="row"?this.spec.height:this.spec.width;if(a||a===0)return qA(a);const o=J(this,Lo,Tf).call(this,n);for(const[s,c]of o.entries())s>0&&(i+=P(this,mc)),(s==0||this.wrappingFacet)&&(i+=0),i+=c.axisBefore,i+=c.view.px??0,r+=c.view.grow??0,i+=c.axisAfter,(s==o.length-1||this.wrappingFacet)&&(i+=0);return{px:i,grow:r}},mf=new WeakSet,J2=function(n,r){return n=="row"&&this.wrappingFacet?1+6*r+2:2+4*r+1},W0=new WeakSet,$T=function(){const n=J(this,Lo,Tf).call(this,"column"),r=J(this,Lo,Tf).call(this,"row");return!n.length||!r.length?Ct.zero():new Ct(r.at(0).axisBefore,n.at(-1).axisAfter,r.at(-1).axisAfter,n.at(0).axisBefore)},yc=new WeakSet,pp=function(){const n=r=>{const i=Xm[r],a=P(this,Oo)[i];return(a==null?void 0:a.axisProps.orient)!==r?0:Math.max(a.getPerpendicularSize()+a.axisProps.offset,0)};return new Ct(n("top"),n("right"),n("bottom"),n("left"))},Y0=new WeakSet,HT=function(n,r,i){for(const[a,o]of Object.entries(PU(r))){if(o.size<=0)continue;const s=n.normalizePoint(i.x,i.y),c=n.normalizePoint(i.x+i.xDelta,i.y+i.yDelta),l={x:c.x-s.x,y:c.y-s.y};for(const u of o)u.zoom(2**i.zDelta,a=="y"?1-s[a]:s[a],a=="x"?l.x:-l.y)}this.context.animator.requestRender()};function HE(e){if(!(!e||!e.fill||e.fillOpacity===0))return{configurableVisibility:!1,data:{values:[{}]},mark:{color:e.fill,opacity:e.fillOpacity??1,type:"rect",clip:!1,tooltip:null,minHeight:1,minOpacity:0}}}function GE(e){if(!(!e||!e.stroke||e.strokeWidth===0||e.strokeOpacity===0))return{configurableVisibility:!1,resolve:{scale:{x:"excluded",y:"excluded"},axis:{x:"excluded",y:"excluded"}},data:{values:[{x:0,y:0,x2:1,y2:0},{x:1,y:0,x2:1,y2:1},{x:1,y:1,x2:0,y2:1},{x:0,y:1,x2:0,y2:0}]},mark:{size:e.strokeWidth??1,color:e.stroke??"lightgray",strokeCap:"square",strokeOpacity:e.strokeOpacity??1,type:"rule",clip:!1,tooltip:null},encoding:{x:{field:"x",type:"quantitative",scale:null},y:{field:"y",type:"quantitative",scale:null},x2:{field:"x2"},y2:{field:"y2"}}}}function PU(e){const t={x:new Set,y:new Set};return e.visit(n=>{for(const[r,i]of Object.entries(t)){const a=n.getScaleResolution(r);a&&a.isZoomable()&&i.add(a)}}),t}function MU(e){let t=!0;return e.visit(n=>{n instanceof mt&&t&&(t=n.mark.properties.clip===!0)}),t}function e1(e,t,n){const r=n.axisProps,i=n.getPerpendicularSize();if(t=="bottom")return e.translate(0,e.height+r.offset).modify({height:i});if(t=="top")return e.translate(0,-i-r.offset).modify({height:i});if(t=="left")return e.translate(-i-r.offset,0).modify({width:i});if(t=="right")return e.translate(e.width+r.offset,0).modify({width:i})}class t1{constructor(t,n,r){if(this.layoutParent=n,this.view=t,this.serial=r,this.background=void 0,this.backgroundStroke=void 0,this.axes={},this.gridLines={},this.scrollbars={},this.title=void 0,this.coords=Wn.ZERO,t.needsAxes.x||t.needsAxes.y){const i=t.spec,a="view"in i?i==null?void 0:i.view:void 0,o=HE(a);o&&(this.background=new mt(o,n.context,n,t,"background"+r,{blockEncodingInheritance:!0}));const s=GE(a);s&&(this.backgroundStroke=new mt(s,n.context,n,t,"backgroundStroke"+r,{blockEncodingInheritance:!0}));const c=BU(t.spec.title);if(c){const l=new mt(c,n.context,n,t,"title"+r,{blockEncodingInheritance:!0});this.title=l}}t.spec.viewportWidth!=null&&(this.scrollbars.horizontal=new VE(this,"horizontal")),t.spec.viewportHeight!=null&&(this.scrollbars.vertical=new VE(this,"vertical"))}*getChildren(){this.background&&(yield this.background),this.backgroundStroke&&(yield this.backgroundStroke),this.title&&(yield this.title),yield*Object.values(this.axes),yield*Object.values(this.gridLines),yield this.view,yield*Object.values(this.scrollbars)}async createAxes(){const{view:t,axes:n,gridLines:r}=this,i=(s,c)=>{const l=s.getAxisProps();if(l===null)return;const u=l?{...l}:{};if(!u.orient){for(const f of td[c])if(!n[f]){u.orient=f;break}if(!u.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if(u.title??(u.title=s.getTitle()),!td[c].includes(u.orient))throw new Error(`Invalid axis orientation "${u.orient}" on channel "${c}"!`);return u},a=async(s,c,l)=>{const u=i(s,c);if(u){if(n[u.orient])throw new Error(`An axis with the orient "${u.orient}" already exists!`);const f=new Km(u,s.scaleResolution.type,this.layoutParent.context,this.layoutParent,l);n[u.orient]=f,await f.initializeChildren()}},o=async(s,c,l)=>{const u=i(s,c);if(u&&(u.grid||u.chromGrid)){const f=new AU(u,s.scaleResolution.type,this.layoutParent.context,this.layoutParent,l);r[u.orient]=f,await f.initializeChildren()}};for(const s of["x","y"])if(t.needsAxes[s]){const c=t.resolutions.axis[s];if(!c)continue;await a(c,s,t)}for(const s of["x","y"])if(t.needsAxes[s]){const c=t.getAxisResolution(s);if(!c)continue;await o(c,s,t)}if(t instanceof Ka){for(const s of t)for(const[c,l]of Object.entries(s.resolutions.axis)){const u=l.getAxisProps();u&&u.orient&&await a(l,c,s)}for(const s of t)for(const[c,l]of Object.entries(s.resolutions.axis)){const u=l.getAxisProps();u&&!u.orient&&await a(l,c,s)}}[...Object.values(n),...Object.values(r)].forEach(s=>s.visit(c=>{c instanceof mt&&c.resolve("scale")}))}getOverhang(){const t=n=>{const r=this.axes[n];return r?Math.max(r.getPerpendicularSize()+r.axisProps.offset,0):0};return new Ct(t("top"),t("right"),t("bottom"),t("left")).add(this.view.getOverhang())}getOverhangAndPadding(){return this.getOverhang().add(this.view.getPadding())}}class VE extends mt{constructor(t,n){const r={scrollbarSize:8,scrollbarPadding:2};super({data:{values:[{}]},mark:{type:"rect",fill:"#b0b0b0",fillOpacity:.6,stroke:"white",strokeWidth:1,strokeOpacity:1,cornerRadius:5,clip:!1},configurableVisibility:!1},t.layoutParent.context,t.layoutParent,t.view,"scrollbar-"+n,{blockEncodingInheritance:!0}),this.config=r,this.scrollDirection=n,this.viewportOffset=0,this.maxScrollOffset=0,this.scrollbarCoords=Wn.ZERO,this.addInteractionEventListener("mousedown",(i,a)=>{if(a.stopPropagation(),this.maxScrollOffset<=0)return;const o=h=>n=="vertical"?h.clientY:h.clientX,s=a.uiEvent;s.preventDefault();const c=this.getScrollOffset(),l=o(s),u=h=>{const d=Ai(o(h)-l+c,0,this.maxScrollOffset);this.viewportOffset=d/this.maxScrollOffset*this.maxViewportOffset,this.context.animator.requestRender()},f=()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f,!1),document.addEventListener("mousemove",u,!1)})}getScrollOffset(){return this.viewportOffset/this.maxViewportOffset*this.maxScrollOffset}render(t,n,r){super.render(t,this.scrollbarCoords,r)}updateScrollbar(t,n){const r=this.config.scrollbarPadding,i=this.config.scrollbarSize,a=this.scrollDirection=="horizontal"?"width":"height",o=Math.min(1,t[a]/n[a]),s=t[a]-2*r,c=o*s;this.maxScrollOffset=s-c,this.maxViewportOffset=n[a]-t[a],this.viewportOffset=Ai(this.viewportOffset,0,this.maxViewportOffset),this.scrollbarCoords=this.scrollDirection=="vertical"?new Wn(()=>t.x+t.width-i-r,()=>t.y+r+this.getScrollOffset(),()=>i,()=>c):new Wn(()=>t.x+r+this.getScrollOffset(),()=>t.y+t.height-i-r,()=>c,()=>i)}}class ys extends FU{constructor(t,n,r,i,a){super(t,n,r,i,a,n1(t)?t.columns:id(t)?1:1/0),this.spec=t}async initializeChildren(){const t=this.spec,n=n1(t)?t.concat:id(t)?t.vconcat:t.hconcat;this.setChildren(await Promise.all(n.map((r,i)=>this.context.createOrImportView(r,this,this,"grid"+i)))),await this.createAxes()}getDefaultResolution(t,n){return n=="axis"?"independent":id(this.spec)&&t==="x"||qE(this.spec)&&t==="y"?"shared":"independent"}}const jE="viewRoot";class OU{constructor(t={}){Z(this,vc,new Map);this.options={allowImport:!0,wrapRoot:!0,...t};const n=r=>(i,a,o,s,c)=>new r(i,a,o,s,i.name??c);this.addViewType(rd,n(Ka)),this.addViewType(nd,n(mt)),this.addViewType(id,n(ys)),this.addViewType(qE,n(ys)),this.addViewType(n1,n(ys)),this.addViewType(WE,()=>{throw new Error("SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!")})}addViewType(t,n){P(this,vc).set(t,n)}createView(t,n,r,i,a){for(const[o,s]of P(this,vc))if(o(t))return s(t,n,r,i,a);throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(t)]))}isViewSpec(t){const n=[...P(this,vc).keys()].filter(r=>r(t));if(n.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return n.length==1}async createOrImportView(t,n,r,i,a,o){let s;if(NU(t))if(this.options.allowImport)s=await Wz(t,i.getBaseUrl(),n),o&&o(s);else throw new Za("Importing views is not allowed!",r);else s=t;!i&&this.options.wrapRoot&&(nd(s)||rd(s))&&a===jE&&(s={name:"implicitRoot",vconcat:[s]});const c=this.createView(s,n,r,i,a);return c instanceof qn&&await c.initializeChildren(),c}}vc=new WeakMap;function nd(e){return"mark"in e&&(Me(e.mark)||Xt(e.mark))}function rd(e){return"layer"in e&&Xt(e.layer)}function LU(e){return e&&(nd(e)||rd(e))&&"aggregateSamples"in e}function NU(e){return"import"in e}function id(e){return"vconcat"in e&&Qt(e.vconcat)}function qE(e){return"hconcat"in e&&Qt(e.hconcat)}function n1(e){return"concat"in e&&Qt(e.concat)}function WE(e){return"samples"in e&&Xt(e.samples)&&"spec"in e&&Xt(e.spec)}class zU{constructor(){Z(this,wc,void 0);Z(this,No,void 0);Z(this,bf,void 0);Z(this,zo,void 0);le(this,wc,new Map),le(this,No,new Set),le(this,zo,new Map),le(this,bf,new Proxy(P(this,wc),{get(t,n){return Me(n)?t.get(n):void 0}}))}allocateSetter(t){if(P(this,No).has(t))throw new Error("Setter already allocated for parameter: "+t);return P(this,No).add(t),n=>{P(this,wc).set(t,n);const r=P(this,zo).get(t);if(r)for(const i of r)i()}}createExpression(t){const n=sh(t,P(this,bf));for(const r of n.globals)if(!P(this,No).has(r))throw new Error(`Unknown variable "${r}" in expression: ${t}`);return n.addListener=r=>{for(const i of n.globals){const a=P(this,zo).get(i)??new Set;P(this,zo).set(i,a),a.add(r)}},n}}wc=new WeakMap,No=new WeakMap,bf=new WeakMap,zo=new WeakMap,cw("fasta",sU);class YE{constructor(t,n,r={}){this.container=t,this._destructionCallbacks=[];const i=document.createElement("style");i.innerHTML=aD,t.appendChild(i),this.spec=n,this.accessorFactory=new WB,this.viewFactory=new OU,this.namedDataProviders=[],this.animator=new eU(()=>this.renderAll()),this.genomeStore=void 0,this.viewVisibilityPredicate=a=>a.isVisibleInSpec(),this._renderingContext=void 0,this._pickingContext=void 0,this._dirtyPickingBuffer=!1,this._currentHover=void 0,this._wheelInertia=new cU(this.animator),this._keyboardListeners=new Map,this._eventListeners=new Map,this._extraBroadcastListeners=new Map,this.tooltipHandlers={default:mU,refseqgene:uU,...r.tooltipHandlers??{}},this.viewRoot=void 0,this._paramBroker=new zU,this._loadingViews=new Map}registerNamedDataProvider(t){this.namedDataProviders.unshift(t)}getNamedDataFromProvider(t){for(const n of this.namedDataProviders){const r=n(t);if(r)return r}}updateNamedData(t,n){const r=this.viewRoot.context.dataFlow.findNamedDataSource(t);if(!r)throw new Error("No such named data source: "+t);r.dataSource.updateDynamicData(n),Vm(r.hosts),this.animator.requestRender()}broadcast(t,n){var i;const r={type:t,payload:n};this.viewRoot.visit(a=>a.handleBroadcast(r)),(i=this._extraBroadcastListeners.get(t))==null||i.forEach(a=>a(r))}_updateLoadingIndicators(){const t=[],n=()=>[...this._loadingViews.values()].some(r=>r);for(const[r,i]of this._loadingViews){const a=r.coords;if(a){const o={left:`${a.x}px`,top:`${a.y}px`,width:`${a.width}px`,height:`${a.height}px`};t.push($`<div style=${Jf(o)}>
|
1668
1668
|
<div class=${i?"loading":""}>
|
1669
1669
|
<img src="${iD}" alt="" />
|
1670
1670
|
<span>Loading...</span>
|
@@ -1677,17 +1677,17 @@ Reason: ${s.message}`)}));if(n.isViewSpec(a))return a.baseUrl=(o=i.match(/^[^?#]
|
|
1677
1677
|
* @license
|
1678
1678
|
* Copyright 2017 Google LLC
|
1679
1679
|
* SPDX-License-Identifier: BSD-3-Clause
|
1680
|
-
*/const{is:jU,defineProperty:qU,getOwnPropertyDescriptor:WU,getOwnPropertyNames:YU,getOwnPropertySymbols:ZU,getPrototypeOf:QU}=Object,
|
1680
|
+
*/const{is:jU,defineProperty:qU,getOwnPropertyDescriptor:WU,getOwnPropertyNames:YU,getOwnPropertySymbols:ZU,getPrototypeOf:QU}=Object,zi=globalThis,KE=zi.trustedTypes,XU=KE?KE.emptyScript:"",i1=zi.reactiveElementPolyfillSupport,zl=(e,t)=>e,a1={toAttribute(e,t){switch(t){case Boolean:e=e?XU:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},JE=(e,t)=>!jU(e,t),e4={attribute:!0,type:String,converter:a1,reflect:!1,hasChanged:JE};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),zi.litPropertyMetadata??(zi.litPropertyMetadata=new WeakMap);let vs=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=e4){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(t,n),!n.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(t,r,n);i!==void 0&&qU(this.prototype,t,i)}}static getPropertyDescriptor(t,n,r){const{get:i,set:a}=WU(this.prototype,t)??{get(){return this[n]},set(o){this[n]=o}};return{get(){return i==null?void 0:i.call(this)},set(o){const s=i==null?void 0:i.call(this);a.call(this,o),this.requestUpdate(t,s,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??e4}static _$Ei(){if(this.hasOwnProperty(zl("elementProperties")))return;const t=QU(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(zl("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(zl("properties"))){const n=this.properties,r=[...YU(n),...ZU(n)];for(const i of r)this.createProperty(i,n[i])}const t=this[Symbol.metadata];if(t!==null){const n=litPropertyMetadata.get(t);if(n!==void 0)for(const[r,i]of n)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const i=this._$Eu(n,r);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const n=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const i of r)n.unshift(XE(i))}else t!==void 0&&n.push(XE(t));return n}static _$Eu(t,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$ES(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(n=>n(this))}addController(t){var n;(this._$E_??(this._$E_=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)==null||n.call(t))}removeController(t){var n;(n=this._$E_)==null||n.delete(t)}_$ES(){const t=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return VU(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$E_)==null||t.forEach(n=>{var r;return(r=n.hostConnected)==null?void 0:r.call(n)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$E_)==null||t.forEach(n=>{var r;return(r=n.hostDisconnected)==null?void 0:r.call(n)})}attributeChangedCallback(t,n,r){this._$AK(t,r)}_$EO(t,n){var a;const r=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,r);if(i!==void 0&&r.reflect===!0){const o=(((a=r.converter)==null?void 0:a.toAttribute)!==void 0?r.converter:a1).toAttribute(n,r.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,n){var a;const r=this.constructor,i=r._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const o=r.getPropertyOptions(i),s=typeof o.converter=="function"?{fromAttribute:o.converter}:((a=o.converter)==null?void 0:a.fromAttribute)!==void 0?o.converter:a1;this._$Em=i,this[i]=s.fromAttribute(n,o.type),this._$Em=null}}requestUpdate(t,n,r,i=!1,a){if(t!==void 0){if(r??(r=this.constructor.getPropertyOptions(t)),!(r.hasChanged??JE)(i?a:this[t],n))return;this.C(t,n,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,n,r){this._$AL.has(t)||this._$AL.set(t,n),r.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(n){Promise.reject(n)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,o]of this._$Ep)this[a]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[a,o]of i)o.wrapped!==!0||this._$AL.has(a)||this[a]===void 0||this.C(a,this[a],o)}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(r=this._$E_)==null||r.forEach(i=>{var a;return(a=i.hostUpdate)==null?void 0:a.call(i)}),this.update(n)):this._$ET()}catch(i){throw t=!1,this._$ET(),i}t&&this._$AE(n)}willUpdate(t){}_$AE(t){var n;(n=this._$E_)==null||n.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(n=>this._$EO(n,this[n]))),this._$ET()}updated(t){}firstUpdated(t){}};vs.elementStyles=[],vs.shadowRootOptions={mode:"open"},vs[zl("elementProperties")]=new Map,vs[zl("finalized")]=new Map,i1==null||i1({ReactiveElement:vs}),(zi.reactiveElementVersions??(zi.reactiveElementVersions=[])).push("2.0.2");/**
|
1681
1681
|
* @license
|
1682
1682
|
* Copyright 2017 Google LLC
|
1683
1683
|
* SPDX-License-Identifier: BSD-3-Clause
|
1684
|
-
*/let
|
1684
|
+
*/let mr=class extends vs{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;const t=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=t.firstChild),t}update(t){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Vt(n,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Dt}};mr._$litElement$=!0,mr.finalized=!0,(xT=globalThis.litElementHydrateSupport)==null||xT.call(globalThis,{LitElement:mr});const o1=globalThis.litElementPolyfillSupport;o1==null||o1({LitElement:mr}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.2");/**
|
1685
1685
|
* @license
|
1686
1686
|
* Copyright 2018 Google LLC
|
1687
1687
|
* SPDX-License-Identifier: BSD-3-Clause
|
1688
|
-
*/const s1=Ra(class extends Zo{constructor(e){var t;if(super(e),e.type!==sr.ATTRIBUTE||e.name!=="class"||((t=e.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var r,i;if(this.it===void 0){this.it=new Set,e.strings!==void 0&&(this.st=new Set(e.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in t)t[a]&&!((r=this.st)!=null&&r.has(a))&&this.it.add(a);return this.render(t)}const n=e.element.classList;for(const a of this.it)a in t||(n.remove(a),this.it.delete(a));for(const a in t){const o=!!t[a];o===this.it.has(a)||(i=this.st)!=null&&i.has(a)||(o?(n.add(a),this.it.add(a)):(n.remove(a),this.it.delete(a)))}return Dt}});var KU={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]},od=KU,JU={prefix:"fas",iconName:"forward-step",icon:[320,512,["step-forward"],"f051","M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4l192 160L256 241V96c0-17.7 14.3-32 32-32s32 14.3 32 32V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V271l-11.5 9.6-192 160z"]},e$=JU,t$={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},n$=t$,t4={prefix:"fas",iconName:"bookmark",icon:[384,512,[128278,61591],"f02e","M0 48V487.7C0 501.1 10.9 512 24.3 512c5 0 9.9-1.5 14-4.4L192 400 345.7 507.6c4.1 2.9 9 4.4 14 4.4c13.4 0 24.3-10.9 24.3-24.3V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48z"]},r$={prefix:"fas",iconName:"maximize",icon:[512,512,["expand-arrows-alt"],"f31e","M200 32H56C42.7 32 32 42.7 32 56V200c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l40-40 79 79-79 79L73 295c-6.9-6.9-17.2-8.9-26.2-5.2S32 302.3 32 312V456c0 13.3 10.7 24 24 24H200c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-40-40 79-79 79 79-40 40c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H456c13.3 0 24-10.7 24-24V312c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2l-40 40-79-79 79-79 40 40c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2V56c0-13.3-10.7-24-24-24H312c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l40 40-79 79-79-79 40-40c6.9-6.9 8.9-17.2 5.2-26.2S209.7 32 200 32z"]},i$=r$,a$={prefix:"fas",iconName:"arrow-down-wide-short",icon:[576,512,["sort-amount-asc","sort-amount-down"],"f160","M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320z"]},o$=a$,Ja={prefix:"fas",iconName:"filter",icon:[512,512,[],"f0b0","M3.9 54.9C10.5 40.9 24.5 32 40 32H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9V448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6V320.9L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"]},Ul={prefix:"fas",iconName:"object-group",icon:[576,512,[],"f247","M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32H456.6C467.6 12.9 488.3 0 512 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4V392.6c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H119.4c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V119.4zM456.6 96H119.4c-5.6 9.7-13.7 17.8-23.4 23.4V392.6c9.7 5.6 17.8 13.7 23.4 23.4H456.6c5.6-9.7 13.7-17.8 23.4-23.4V119.4c-9.7-5.6-17.8-13.7-23.4-23.4zM128 160c0-17.7 14.3-32 32-32H288c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32V160zM256 320h32c35.3 0 64-28.7 64-64V224h64c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H288c-17.7 0-32-14.3-32-32V320z"]},n4={prefix:"fas",iconName:"circle",icon:[512,512,[128308,128309,128992,128993,128994,128995,128996,9679,9898,9899,11044,61708,61915],"f111","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"]},s$={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},c$=s$,l$={prefix:"fas",iconName:"pen",icon:[512,512,[128394],"f304","M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"]},u$={prefix:"fas",iconName:"arrow-rotate-right",icon:[512,512,[8635,"arrow-right-rotate","arrow-rotate-forward","redo"],"f01e","M386.3 160H336c-17.7 0-32 14.3-32 32s14.3 32 32 32H464c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"]},f$=u$,r4={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"]},h$={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},i4=h$,d$={prefix:"fas",iconName:"arrow-rotate-left",icon:[512,512,[8634,"arrow-left-rotate","arrow-rotate-back","arrow-rotate-backward","undo"],"f0e2","M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"]},p$=d$,g$={prefix:"fas",iconName:"backward-step",icon:[320,512,["step-backward"],"f048","M267.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160L64 241V96c0-17.7-14.3-32-32-32S0 78.3 0 96V416c0 17.7 14.3 32 32 32s32-14.3 32-32V271l11.5 9.6 192 160z"]},m$=g$,b$={prefix:"fas",iconName:"sliders",icon:[512,512,["sliders-h"],"f1de","M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z"]},y$=b$,v$={prefix:"fas",iconName:"ellipsis-vertical",icon:[128,512,["ellipsis-v"],"f142","M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"]},w$=v$,x$={prefix:"fas",iconName:"ellipsis",icon:[448,512,["ellipsis-h"],"f141","M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"]},A$=x$,a4={prefix:"fas",iconName:"medal",icon:[512,512,[127941],"f5a2","M4.1 38.2C1.4 34.2 0 29.4 0 24.6C0 11 11 0 24.6 0H133.9c11.2 0 21.7 5.9 27.4 15.5l68.5 114.1c-48.2 6.1-91.3 28.6-123.4 61.9L4.1 38.2zm503.7 0L405.6 191.5c-32.1-33.3-75.2-55.8-123.4-61.9L350.7 15.5C356.5 5.9 366.9 0 378.1 0H487.4C501 0 512 11 512 24.6c0 4.8-1.4 9.6-4.1 13.6zM80 336a176 176 0 1 1 352 0A176 176 0 1 1 80 336zm184.4-94.9c-3.4-7-13.3-7-16.8 0l-22.4 45.4c-1.4 2.8-4 4.7-7 5.1L168 298.9c-7.7 1.1-10.7 10.5-5.2 16l36.3 35.4c2.2 2.2 3.2 5.2 2.7 8.3l-8.6 49.9c-1.3 7.6 6.7 13.5 13.6 9.9l44.8-23.6c2.7-1.4 6-1.4 8.7 0l44.8 23.6c6.9 3.6 14.9-2.2 13.6-9.9l-8.6-49.9c-.5-3 .5-6.1 2.7-8.3l36.3-35.4c5.6-5.4 2.5-14.8-5.2-16l-50.1-7.3c-3-.4-5.7-2.4-7-5.1l-22.4-45.4z"]},E$={prefix:"fas",iconName:"chevron-down",icon:[512,512,[],"f078","M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},S$={prefix:"fas",iconName:"arrow-up",icon:[384,512,[8593],"f062","M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"]},_$={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},C$={prefix:"fas",iconName:"up-down",icon:[256,512,[8597,11021,"arrows-alt-v"],"f338","M145.6 7.7C141 2.8 134.7 0 128 0s-13 2.8-17.6 7.7l-104 112c-6.5 7-8.2 17.2-4.4 25.9S14.5 160 24 160H80V352H24c-9.5 0-18.2 5.7-22 14.4s-2.1 18.9 4.4 25.9l104 112c4.5 4.9 10.9 7.7 17.6 7.7s13-2.8 17.6-7.7l104-112c6.5-7 8.2-17.2 4.4-25.9s-12.5-14.4-22-14.4H176V160h56c9.5 0 18.2-5.7 22-14.4s2.1-18.9-4.4-25.9l-104-112z"]},k$=C$,T$={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"]},c1={prefix:"fas",iconName:"share",icon:[512,512,["arrow-turn-right","mail-forward"],"f064","M307 34.8c-11.5 5.1-19 16.6-19 29.2v64H176C78.8 128 0 206.8 0 304C0 417.3 81.5 467.9 100.2 478.1c2.5 1.4 5.3 1.9 8.1 1.9c10.9 0 19.7-8.9 19.7-19.7c0-7.5-4.3-14.4-9.8-19.5C108.8 431.9 96 414.4 96 384c0-53 43-96 96-96h96v64c0 12.6 7.4 24.1 19 29.2s25 3 34.4-5.4l160-144c6.7-6.1 10.6-14.7 10.6-23.8s-3.8-17.7-10.6-23.8l-160-144c-9.4-8.5-22.9-10.6-34.4-5.4z"]};function o4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o4(Object(n),!0).forEach(function(r){bt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sd(e){"@babel/helpers - typeof";return sd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sd(e)}function I$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R$(e,t,n){return t&&s4(e.prototype,t),n&&s4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l1(e,t){return B$(e)||P$(e,t)||c4(e,t)||O$()}function $l(e){return D$(e)||F$(e)||c4(e)||M$()}function D$(e){if(Array.isArray(e))return u1(e)}function B$(e){if(Array.isArray(e))return e}function F$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function P$(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(c){a=!0,s=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function c4(e,t){if(e){if(typeof e=="string")return u1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u1(e,t)}}function u1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
1688
|
+
*/const s1=Da(class extends Zo{constructor(e){var t;if(super(e),e.type!==sr.ATTRIBUTE||e.name!=="class"||((t=e.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var r,i;if(this.it===void 0){this.it=new Set,e.strings!==void 0&&(this.st=new Set(e.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in t)t[a]&&!((r=this.st)!=null&&r.has(a))&&this.it.add(a);return this.render(t)}const n=e.element.classList;for(const a of this.it)a in t||(n.remove(a),this.it.delete(a));for(const a in t){const o=!!t[a];o===this.it.has(a)||(i=this.st)!=null&&i.has(a)||(o?(n.add(a),this.it.add(a)):(n.remove(a),this.it.delete(a)))}return Dt}});var KU={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]},od=KU,JU={prefix:"fas",iconName:"forward-step",icon:[320,512,["step-forward"],"f051","M52.5 440.6c-9.5 7.9-22.8 9.7-34.1 4.4S0 428.4 0 416V96C0 83.6 7.2 72.3 18.4 67s24.5-3.6 34.1 4.4l192 160L256 241V96c0-17.7 14.3-32 32-32s32 14.3 32 32V416c0 17.7-14.3 32-32 32s-32-14.3-32-32V271l-11.5 9.6-192 160z"]},e$=JU,t$={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},n$=t$,t4={prefix:"fas",iconName:"bookmark",icon:[384,512,[128278,61591],"f02e","M0 48V487.7C0 501.1 10.9 512 24.3 512c5 0 9.9-1.5 14-4.4L192 400 345.7 507.6c4.1 2.9 9 4.4 14 4.4c13.4 0 24.3-10.9 24.3-24.3V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48z"]},r$={prefix:"fas",iconName:"maximize",icon:[512,512,["expand-arrows-alt"],"f31e","M200 32H56C42.7 32 32 42.7 32 56V200c0 9.7 5.8 18.5 14.8 22.2s19.3 1.7 26.2-5.2l40-40 79 79-79 79L73 295c-6.9-6.9-17.2-8.9-26.2-5.2S32 302.3 32 312V456c0 13.3 10.7 24 24 24H200c9.7 0 18.5-5.8 22.2-14.8s1.7-19.3-5.2-26.2l-40-40 79-79 79 79-40 40c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H456c13.3 0 24-10.7 24-24V312c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2l-40 40-79-79 79-79 40 40c6.9 6.9 17.2 8.9 26.2 5.2s14.8-12.5 14.8-22.2V56c0-13.3-10.7-24-24-24H312c-9.7 0-18.5 5.8-22.2 14.8s-1.7 19.3 5.2 26.2l40 40-79 79-79-79 40-40c6.9-6.9 8.9-17.2 5.2-26.2S209.7 32 200 32z"]},i$=r$,a$={prefix:"fas",iconName:"arrow-down-wide-short",icon:[576,512,["sort-amount-asc","sort-amount-down"],"f160","M151.6 469.6C145.5 476.2 137 480 128 480s-17.5-3.8-23.6-10.4l-88-96c-11.9-13-11.1-33.3 2-45.2s33.3-11.1 45.2 2L96 365.7V64c0-17.7 14.3-32 32-32s32 14.3 32 32V365.7l32.4-35.4c11.9-13 32.2-13.9 45.2-2s13.9 32.2 2 45.2l-88 96zM320 480c-17.7 0-32-14.3-32-32s14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320zm0-128c-17.7 0-32-14.3-32-32s14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320z"]},o$=a$,Ja={prefix:"fas",iconName:"filter",icon:[512,512,[],"f0b0","M3.9 54.9C10.5 40.9 24.5 32 40 32H472c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9V448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6V320.9L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"]},Ul={prefix:"fas",iconName:"object-group",icon:[576,512,[],"f247","M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32H456.6C467.6 12.9 488.3 0 512 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4V392.6c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H119.4c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V119.4zM456.6 96H119.4c-5.6 9.7-13.7 17.8-23.4 23.4V392.6c9.7 5.6 17.8 13.7 23.4 23.4H456.6c5.6-9.7 13.7-17.8 23.4-23.4V119.4c-9.7-5.6-17.8-13.7-23.4-23.4zM128 160c0-17.7 14.3-32 32-32H288c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H160c-17.7 0-32-14.3-32-32V160zM256 320h32c35.3 0 64-28.7 64-64V224h64c17.7 0 32 14.3 32 32v96c0 17.7-14.3 32-32 32H288c-17.7 0-32-14.3-32-32V320z"]},n4={prefix:"fas",iconName:"circle",icon:[512,512,[128308,128309,128992,128993,128994,128995,128996,9679,9898,9899,11044,61708,61915],"f111","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"]},s$={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},c$=s$,l$={prefix:"fas",iconName:"pen",icon:[512,512,[128394],"f304","M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"]},u$={prefix:"fas",iconName:"arrow-rotate-right",icon:[512,512,[8635,"arrow-right-rotate","arrow-rotate-forward","redo"],"f01e","M386.3 160H336c-17.7 0-32 14.3-32 32s14.3 32 32 32H464c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0s-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3s163.8-62.5 226.3 0L386.3 160z"]},f$=u$,r4={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"]},h$={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},i4=h$,d$={prefix:"fas",iconName:"arrow-rotate-left",icon:[512,512,[8634,"arrow-left-rotate","arrow-rotate-back","arrow-rotate-backward","undo"],"f0e2","M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"]},p$=d$,g$={prefix:"fas",iconName:"backward-step",icon:[320,512,["step-backward"],"f048","M267.5 440.6c9.5 7.9 22.8 9.7 34.1 4.4s18.4-16.6 18.4-29V96c0-12.4-7.2-23.7-18.4-29s-24.5-3.6-34.1 4.4l-192 160L64 241V96c0-17.7-14.3-32-32-32S0 78.3 0 96V416c0 17.7 14.3 32 32 32s32-14.3 32-32V271l11.5 9.6 192 160z"]},m$=g$,b$={prefix:"fas",iconName:"sliders",icon:[512,512,["sliders-h"],"f1de","M0 416c0 17.7 14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384c-17.7 0-32 14.3-32 32zm128 0a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zM320 256a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm32-80c-32.8 0-61 19.7-73.3 48L32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48zM192 128a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm73.3-64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64z"]},y$=b$,v$={prefix:"fas",iconName:"ellipsis-vertical",icon:[128,512,["ellipsis-v"],"f142","M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"]},w$=v$,x$={prefix:"fas",iconName:"ellipsis",icon:[448,512,["ellipsis-h"],"f141","M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"]},A$=x$,a4={prefix:"fas",iconName:"medal",icon:[512,512,[127941],"f5a2","M4.1 38.2C1.4 34.2 0 29.4 0 24.6C0 11 11 0 24.6 0H133.9c11.2 0 21.7 5.9 27.4 15.5l68.5 114.1c-48.2 6.1-91.3 28.6-123.4 61.9L4.1 38.2zm503.7 0L405.6 191.5c-32.1-33.3-75.2-55.8-123.4-61.9L350.7 15.5C356.5 5.9 366.9 0 378.1 0H487.4C501 0 512 11 512 24.6c0 4.8-1.4 9.6-4.1 13.6zM80 336a176 176 0 1 1 352 0A176 176 0 1 1 80 336zm184.4-94.9c-3.4-7-13.3-7-16.8 0l-22.4 45.4c-1.4 2.8-4 4.7-7 5.1L168 298.9c-7.7 1.1-10.7 10.5-5.2 16l36.3 35.4c2.2 2.2 3.2 5.2 2.7 8.3l-8.6 49.9c-1.3 7.6 6.7 13.5 13.6 9.9l44.8-23.6c2.7-1.4 6-1.4 8.7 0l44.8 23.6c6.9 3.6 14.9-2.2 13.6-9.9l-8.6-49.9c-.5-3 .5-6.1 2.7-8.3l36.3-35.4c5.6-5.4 2.5-14.8-5.2-16l-50.1-7.3c-3-.4-5.7-2.4-7-5.1l-22.4-45.4z"]},E$={prefix:"fas",iconName:"chevron-down",icon:[512,512,[],"f078","M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},S$={prefix:"fas",iconName:"arrow-up",icon:[384,512,[8593],"f062","M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.2L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"]},_$={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},C$={prefix:"fas",iconName:"up-down",icon:[256,512,[8597,11021,"arrows-alt-v"],"f338","M145.6 7.7C141 2.8 134.7 0 128 0s-13 2.8-17.6 7.7l-104 112c-6.5 7-8.2 17.2-4.4 25.9S14.5 160 24 160H80V352H24c-9.5 0-18.2 5.7-22 14.4s-2.1 18.9 4.4 25.9l104 112c4.5 4.9 10.9 7.7 17.6 7.7s13-2.8 17.6-7.7l104-112c6.5-7 8.2-17.2 4.4-25.9s-12.5-14.4-22-14.4H176V160h56c9.5 0 18.2-5.7 22-14.4s2.1-18.9-4.4-25.9l-104-112z"]},k$=C$,T$={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"]},c1={prefix:"fas",iconName:"share",icon:[512,512,["arrow-turn-right","mail-forward"],"f064","M307 34.8c-11.5 5.1-19 16.6-19 29.2v64H176C78.8 128 0 206.8 0 304C0 417.3 81.5 467.9 100.2 478.1c2.5 1.4 5.3 1.9 8.1 1.9c10.9 0 19.7-8.9 19.7-19.7c0-7.5-4.3-14.4-9.8-19.5C108.8 431.9 96 414.4 96 384c0-53 43-96 96-96h96v64c0 12.6 7.4 24.1 19 29.2s25 3 34.4-5.4l160-144c6.7-6.1 10.6-14.7 10.6-23.8s-3.8-17.7-10.6-23.8l-160-144c-9.4-8.5-22.9-10.6-34.4-5.4z"]};function o4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o4(Object(n),!0).forEach(function(r){bt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sd(e){"@babel/helpers - typeof";return sd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sd(e)}function I$(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R$(e,t,n){return t&&s4(e.prototype,t),n&&s4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l1(e,t){return B$(e)||P$(e,t)||c4(e,t)||O$()}function $l(e){return D$(e)||F$(e)||c4(e)||M$()}function D$(e){if(Array.isArray(e))return u1(e)}function B$(e){if(Array.isArray(e))return e}function F$(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function P$(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(c){a=!0,s=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function c4(e,t){if(e){if(typeof e=="string")return u1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u1(e,t)}}function u1(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M$(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
1689
1689
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
1690
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l4=function(){},f1={},u4={},f4=null,h4={mark:l4,measure:l4};try{typeof window<"u"&&(f1=window),typeof document<"u"&&(u4=document),typeof MutationObserver<"u"&&(f4=MutationObserver),typeof performance<"u"&&(h4=performance)}catch{}var L$=f1.navigator||{},d4=L$.userAgent,p4=d4===void 0?"":d4,
|
1690
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l4=function(){},f1={},u4={},f4=null,h4={mark:l4,measure:l4};try{typeof window<"u"&&(f1=window),typeof document<"u"&&(u4=document),typeof MutationObserver<"u"&&(f4=MutationObserver),typeof performance<"u"&&(h4=performance)}catch{}var L$=f1.navigator||{},d4=L$.userAgent,p4=d4===void 0?"":d4,Ui=f1,We=u4,g4=f4,cd=h4;Ui.document;var jr=!!We.documentElement&&!!We.head&&typeof We.addEventListener=="function"&&typeof We.createElement=="function",m4=~p4.indexOf("MSIE")||~p4.indexOf("Trident/"),ld,ud,fd,hd,dd,qr="___FONT_AWESOME___",h1=16,b4="fa",y4="svg-inline--fa",eo="data-fa-i2svg",d1="data-fa-pseudo-element",N$="data-fa-pseudo-element-pending",p1="data-prefix",g1="data-icon",v4="fontawesome-i2svg",z$="async",U$=["HTML","HEAD","STYLE","SCRIPT"],w4=function(){try{return!0}catch{return!1}}(),Ye="classic",ct="sharp",m1=[Ye,ct];function Hl(e){return new Proxy(e,{get:function(n,r){return r in n?n[r]:n[Ye]}})}var Gl=Hl((ld={},bt(ld,Ye,{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands",fak:"kit","fa-kit":"kit"}),bt(ld,ct,{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light"}),ld)),Vl=Hl((ud={},bt(ud,Ye,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),bt(ud,ct,{solid:"fass",regular:"fasr",light:"fasl"}),ud)),jl=Hl((fd={},bt(fd,Ye,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),bt(fd,ct,{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light"}),fd)),$$=Hl((hd={},bt(hd,Ye,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),bt(hd,ct,{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl"}),hd)),H$=/fa(s|r|l|t|d|b|k|ss|sr|sl)?[\-\ ]/,x4="fa-layers-text",G$=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i,V$=Hl((dd={},bt(dd,Ye,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),bt(dd,ct,{900:"fass",400:"fasr",300:"fasl"}),dd)),A4=[1,2,3,4,5,6,7,8,9,10],j$=A4.concat([11,12,13,14,15,16,17,18,19,20]),q$=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],to={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},ql=new Set;Object.keys(Vl[Ye]).map(ql.add.bind(ql)),Object.keys(Vl[ct]).map(ql.add.bind(ql));var W$=[].concat(m1,$l(ql),["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",to.GROUP,to.SWAP_OPACITY,to.PRIMARY,to.SECONDARY]).concat(A4.map(function(e){return"".concat(e,"x")})).concat(j$.map(function(e){return"w-".concat(e)})),Wl=Ui.FontAwesomeConfig||{};function Y$(e){var t=We.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function Z$(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}if(We&&typeof We.querySelector=="function"){var Q$=[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]];Q$.forEach(function(e){var t=l1(e,2),n=t[0],r=t[1],i=Z$(Y$(n));i!=null&&(Wl[r]=i)})}var E4={styleDefault:"solid",familyDefault:"classic",cssPrefix:b4,replacementClass:y4,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Wl.familyPrefix&&(Wl.cssPrefix=Wl.familyPrefix);var ws=te(te({},E4),Wl);ws.autoReplaceSvg||(ws.observeMutations=!1);var re={};Object.keys(E4).forEach(function(e){Object.defineProperty(re,e,{enumerable:!0,set:function(n){ws[e]=n,Yl.forEach(function(r){return r(re)})},get:function(){return ws[e]}})}),Object.defineProperty(re,"familyPrefix",{enumerable:!0,set:function(t){ws.cssPrefix=t,Yl.forEach(function(n){return n(re)})},get:function(){return ws.cssPrefix}}),Ui.FontAwesomeConfig=re;var Yl=[];function X$(e){return Yl.push(e),function(){Yl.splice(Yl.indexOf(e),1)}}var $i=h1,br={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function K$(e){if(!(!e||!jr)){var t=We.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=We.head.childNodes,r=null,i=n.length-1;i>-1;i--){var a=n[i],o=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(r=a)}return We.head.insertBefore(t,r),e}}var J$="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Zl(){for(var e=12,t="";e-- >0;)t+=J$[Math.random()*62|0];return t}function xs(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function b1(e){return e.classList?xs(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function S4(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function eH(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(S4(e[n]),'" ')},"").trim()}function pd(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function y1(e){return e.size!==br.size||e.x!==br.x||e.y!==br.y||e.rotate!==br.rotate||e.flipX||e.flipY}function tH(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,i={transform:"translate(".concat(n/2," 256)")},a="translate(".concat(t.x*32,", ").concat(t.y*32,") "),o="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)"),c={transform:"".concat(a," ").concat(o," ").concat(s)},l={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:c,path:l}}function nH(e){var t=e.transform,n=e.width,r=n===void 0?h1:n,i=e.height,a=i===void 0?h1:i,o=e.startCentered,s=o===void 0?!1:o,c="";return s&&m4?c+="translate(".concat(t.x/$i-r/2,"em, ").concat(t.y/$i-a/2,"em) "):s?c+="translate(calc(-50% + ".concat(t.x/$i,"em), calc(-50% + ").concat(t.y/$i,"em)) "):c+="translate(".concat(t.x/$i,"em, ").concat(t.y/$i,"em) "),c+="scale(".concat(t.size/$i*(t.flipX?-1:1),", ").concat(t.size/$i*(t.flipY?-1:1),") "),c+="rotate(".concat(t.rotate,"deg) "),c}var rH=`:root, :host {
|
1691
1691
|
--fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";
|
1692
1692
|
--fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";
|
1693
1693
|
--fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";
|
@@ -2443,9 +2443,9 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2443
2443
|
.fad.fa-inverse,
|
2444
2444
|
.fa-duotone.fa-inverse {
|
2445
2445
|
color: var(--fa-inverse, #fff);
|
2446
|
-
}`;function _4(){var e=b4,t=y4,n=re.cssPrefix,r=re.replacementClass,i=rH;if(n!==e||r!==t){var a=new RegExp("\\.".concat(e,"\\-"),"g"),o=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");i=i.replace(a,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(s,".".concat(r))}return i}var C4=!1;function v1(){re.autoAddCss&&!C4&&(K$(_4()),C4=!0)}var iH={mixout:function(){return{dom:{css:_4,insertCss:v1}}},hooks:function(){return{beforeDOMElementCreation:function(){v1()},beforeI2svg:function(){v1()}}}},Wr=zi||{};Wr[qr]||(Wr[qr]={}),Wr[qr].styles||(Wr[qr].styles={}),Wr[qr].hooks||(Wr[qr].hooks={}),Wr[qr].shims||(Wr[qr].shims=[]);var Yn=Wr[qr],k4=[],aH=function e(){We.removeEventListener("DOMContentLoaded",e),gd=1,k4.map(function(t){return t()})},gd=!1;jr&&(gd=(We.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(We.readyState),gd||We.addEventListener("DOMContentLoaded",aH));function oH(e){jr&&(gd?setTimeout(e,0):k4.push(e))}function Ql(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,i=e.children,a=i===void 0?[]:i;return typeof e=="string"?S4(e):"<".concat(t," ").concat(eH(r),">").concat(a.map(Ql).join(""),"</").concat(t,">")}function T4(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var sH=function(t,n){return function(r,i,a,o){return t.call(n,r,i,a,o)}},w1=function(t,n,r,i){var a=Object.keys(t),o=a.length,s=i!==void 0?sH(n,i):n,c,l,u;for(r===void 0?(c=1,u=t[a[0]]):(c=0,u=r);c<o;c++)l=a[c],u=s(u,t[l],l,t);return u};function cH(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);(a&64512)==56320?t.push(((i&1023)<<10)+(a&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}function x1(e){var t=cH(e);return t.length===1?t[0].toString(16):null}function lH(e,t){var n=e.length,r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function I4(e){return Object.keys(e).reduce(function(t,n){var r=e[n],i=!!r.icon;return i?t[r.iconName]=r.icon:t[n]=r,t},{})}function A1(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,a=I4(t);typeof Yn.hooks.addPack=="function"&&!i?Yn.hooks.addPack(e,I4(t)):Yn.styles[e]=te(te({},Yn.styles[e]||{}),a),e==="fas"&&A1("fa",t)}var md,bd,yd,As=Yn.styles,uH=Yn.shims,fH=(md={},bt(md,Ye,Object.values(jl[Ye])),bt(md,ct,Object.values(jl[ct])),md),E1=null,R4={},D4={},B4={},F4={},P4={},hH=(bd={},bt(bd,Ye,Object.keys(Gl[Ye])),bt(bd,ct,Object.keys(Gl[ct])),bd);function dH(e){return~W$.indexOf(e)}function pH(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!dH(i)?i:null}var M4=function(){var t=function(a){return w1(As,function(o,s,c){return o[c]=w1(s,a,{}),o},{})};R4=t(function(i,a,o){if(a[3]&&(i[a[3]]=o),a[2]){var s=a[2].filter(function(c){return typeof c=="number"});s.forEach(function(c){i[c.toString(16)]=o})}return i}),D4=t(function(i,a,o){if(i[o]=o,a[2]){var s=a[2].filter(function(c){return typeof c=="string"});s.forEach(function(c){i[c]=o})}return i}),P4=t(function(i,a,o){var s=a[2];return i[o]=o,s.forEach(function(c){i[c]=o}),i});var n="far"in As||re.autoFetchSvg,r=w1(uH,function(i,a){var o=a[0],s=a[1],c=a[2];return s==="far"&&!n&&(s="fas"),typeof o=="string"&&(i.names[o]={prefix:s,iconName:c}),typeof o=="number"&&(i.unicodes[o.toString(16)]={prefix:s,iconName:c}),i},{names:{},unicodes:{}});B4=r.names,F4=r.unicodes,E1=vd(re.styleDefault,{family:re.familyDefault})};X$(function(e){E1=vd(e.styleDefault,{family:re.familyDefault})}),M4();function S1(e,t){return(R4[e]||{})[t]}function gH(e,t){return(D4[e]||{})[t]}function no(e,t){return(P4[e]||{})[t]}function O4(e){return B4[e]||{prefix:null,iconName:null}}function mH(e){var t=F4[e],n=S1("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function $i(){return E1}var _1=function(){return{prefix:null,iconName:null,rest:[]}};function vd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?Ye:n,i=Gl[r][e],a=Vl[r][e]||Vl[r][i],o=e in Yn.styles?e:null;return a||o||null}var L4=(yd={},bt(yd,Ye,Object.keys(jl[Ye])),bt(yd,ct,Object.keys(jl[ct])),yd);function wd(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,a=(t={},bt(t,Ye,"".concat(re.cssPrefix,"-").concat(Ye)),bt(t,ct,"".concat(re.cssPrefix,"-").concat(ct)),t),o=null,s=Ye;(e.includes(a[Ye])||e.some(function(l){return L4[Ye].includes(l)}))&&(s=Ye),(e.includes(a[ct])||e.some(function(l){return L4[ct].includes(l)}))&&(s=ct);var c=e.reduce(function(l,u){var f=pH(re.cssPrefix,u);if(As[u]?(u=fH[s].includes(u)?$$[s][u]:u,o=u,l.prefix=u):hH[s].indexOf(u)>-1?(o=u,l.prefix=vd(u,{family:s})):f?l.iconName=f:u!==re.replacementClass&&u!==a[Ye]&&u!==a[ct]&&l.rest.push(u),!i&&l.prefix&&l.iconName){var h=o==="fa"?O4(l.iconName):{},d=no(l.prefix,l.iconName);h.prefix&&(o=null),l.iconName=h.iconName||d||l.iconName,l.prefix=h.prefix||l.prefix,l.prefix==="far"&&!As.far&&As.fas&&!re.autoFetchSvg&&(l.prefix="fas")}return l},_1());return(e.includes("fa-brands")||e.includes("fab"))&&(c.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(c.prefix="fad"),!c.prefix&&s===ct&&(As.fass||re.autoFetchSvg)&&(c.prefix="fass",c.iconName=no(c.prefix,c.iconName)||c.iconName),(c.prefix==="fa"||o==="fa")&&(c.prefix=$i()||"fas"),c}var bH=function(){function e(){I$(this,e),this.definitions={}}return R$(e,[{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i.reduce(this._pullDefinitions,{});Object.keys(o).forEach(function(s){n.definitions[s]=te(te({},n.definitions[s]||{}),o[s]),A1(s,o[s]);var c=jl[Ye][s];c&&A1(c,o[s]),M4()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,r){var i=r.prefix&&r.iconName&&r.icon?{0:r}:r;return Object.keys(i).map(function(a){var o=i[a],s=o.prefix,c=o.iconName,l=o.icon,u=l[2];n[s]||(n[s]={}),u.length>0&&u.forEach(function(f){typeof f=="string"&&(n[s][f]=l)}),n[s][c]=l}),n}}]),e}(),N4=[],Es={},Ss={},yH=Object.keys(Ss);function vH(e,t){var n=t.mixoutsTo;return N4=e,Es={},Object.keys(Ss).forEach(function(r){yH.indexOf(r)===-1&&delete Ss[r]}),N4.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(o){typeof i[o]=="function"&&(n[o]=i[o]),sd(i[o])==="object"&&Object.keys(i[o]).forEach(function(s){n[o]||(n[o]={}),n[o][s]=i[o][s]})}),r.hooks){var a=r.hooks();Object.keys(a).forEach(function(o){Es[o]||(Es[o]=[]),Es[o].push(a[o])})}r.provides&&r.provides(Ss)}),n}function C1(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=Es[e]||[];return a.forEach(function(o){t=o.apply(null,[t].concat(r))}),t}function ro(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=Es[e]||[];i.forEach(function(a){a.apply(null,n)})}function Yr(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Ss[e]?Ss[e].apply(null,t):void 0}function k1(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||$i();if(t)return t=no(n,t)||t,T4(z4.definitions,n,t)||T4(Yn.styles,n,t)}var z4=new bH,wH=function(){re.autoReplaceSvg=!1,re.observeMutations=!1,ro("noAuto")},xH={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return jr?(ro("beforeI2svg",t),Yr("pseudoElements2svg",t),Yr("i2svg",t)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot;re.autoReplaceSvg===!1&&(re.autoReplaceSvg=!0),re.observeMutations=!0,oH(function(){EH({autoReplaceSvgRoot:n}),ro("watch",t)})}},AH={icon:function(t){if(t===null)return null;if(sd(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:no(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){var n=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],r=vd(t[0]);return{prefix:r,iconName:no(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(re.cssPrefix,"-"))>-1||t.match(H$))){var i=wd(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||$i(),iconName:no(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var a=$i();return{prefix:a,iconName:no(a,t)||t}}}},hn={noAuto:wH,config:re,dom:xH,parse:AH,library:z4,findIconDefinition:k1,toHtml:Ql},EH=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?We:n;(Object.keys(Yn.styles).length>0||re.autoFetchSvg)&&jr&&re.autoReplaceSvg&&hn.dom.i2svg({node:r})};function xd(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return Ql(r)})}}),Object.defineProperty(e,"node",{get:function(){if(jr){var r=We.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function SH(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,a=e.styles,o=e.transform;if(y1(o)&&n.found&&!r.found){var s=n.width,c=n.height,l={x:s/c/2,y:.5};i.style=pd(te(te({},a),{},{"transform-origin":"".concat(l.x+o.x/16,"em ").concat(l.y+o.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function _H(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,a=e.symbol,o=a===!0?"".concat(t,"-").concat(re.cssPrefix,"-").concat(n):a;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:te(te({},i),{},{id:o}),children:r}]}]}function T1(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,a=e.iconName,o=e.transform,s=e.symbol,c=e.title,l=e.maskId,u=e.titleId,f=e.extra,h=e.watchable,d=h===void 0?!1:h,p=r.found?r:n,g=p.width,b=p.height,v=i==="fak",x=[re.replacementClass,a?"".concat(re.cssPrefix,"-").concat(a):""].filter(function(B){return f.classes.indexOf(B)===-1}).filter(function(B){return B!==""||!!B}).concat(f.classes).join(" "),A={children:[],attributes:te(te({},f.attributes),{},{"data-prefix":i,"data-icon":a,class:x,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(g," ").concat(b)})},w=v&&!~f.classes.indexOf("fa-fw")?{width:"".concat(g/b*16*.0625,"em")}:{};d&&(A.attributes[eo]=""),c&&(A.children.push({tag:"title",attributes:{id:A.attributes["aria-labelledby"]||"title-".concat(u||Zl())},children:[c]}),delete A.attributes.title);var _=te(te({},A),{},{prefix:i,iconName:a,main:n,mask:r,maskId:l,transform:o,symbol:s,styles:te(te({},w),f.styles)}),C=r.found&&n.found?Yr("generateAbstractMask",_)||{children:[],attributes:{}}:Yr("generateAbstractIcon",_)||{children:[],attributes:{}},I=C.children,D=C.attributes;return _.children=I,_.attributes=D,s?_H(_):SH(_)}function U4(e){var t=e.content,n=e.width,r=e.height,i=e.transform,a=e.title,o=e.extra,s=e.watchable,c=s===void 0?!1:s,l=te(te(te({},o.attributes),a?{title:a}:{}),{},{class:o.classes.join(" ")});c&&(l[eo]="");var u=te({},o.styles);y1(i)&&(u.transform=nH({transform:i,startCentered:!0,width:n,height:r}),u["-webkit-transform"]=u.transform);var f=pd(u);f.length>0&&(l.style=f);var h=[];return h.push({tag:"span",attributes:l,children:[t]}),a&&h.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),h}function CH(e){var t=e.content,n=e.title,r=e.extra,i=te(te(te({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),a=pd(r.styles);a.length>0&&(i.style=a);var o=[];return o.push({tag:"span",attributes:i,children:[t]}),n&&o.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),o}var I1=Yn.styles;function R1(e){var t=e[0],n=e[1],r=e.slice(4),i=l1(r,1),a=i[0],o=null;return Array.isArray(a)?o={tag:"g",attributes:{class:"".concat(re.cssPrefix,"-").concat(to.GROUP)},children:[{tag:"path",attributes:{class:"".concat(re.cssPrefix,"-").concat(to.SECONDARY),fill:"currentColor",d:a[0]}},{tag:"path",attributes:{class:"".concat(re.cssPrefix,"-").concat(to.PRIMARY),fill:"currentColor",d:a[1]}}]}:o={tag:"path",attributes:{fill:"currentColor",d:a}},{found:!0,width:t,height:n,icon:o}}var kH={found:!1,width:512,height:512};function TH(e,t){!w4&&!re.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function D1(e,t){var n=t;return t==="fa"&&re.styleDefault!==null&&(t=$i()),new Promise(function(r,i){if(Yr("missingIconAbstract"),n==="fa"){var a=O4(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&I1[t]&&I1[t][e]){var o=I1[t][e];return r(R1(o))}TH(e,t),r(te(te({},kH),{},{icon:re.showMissingIcons&&e?Yr("missingIconAbstract")||{}:{}}))})}var $4=function(){},B1=re.measurePerformance&&cd&&cd.mark&&cd.measure?cd:{mark:$4,measure:$4},Xl='FA "6.4.2"',IH=function(t){return B1.mark("".concat(Xl," ").concat(t," begins")),function(){return H4(t)}},H4=function(t){B1.mark("".concat(Xl," ").concat(t," ends")),B1.measure("".concat(Xl," ").concat(t),"".concat(Xl," ").concat(t," begins"),"".concat(Xl," ").concat(t," ends"))},F1={begin:IH,end:H4},Ad=function(){};function G4(e){var t=e.getAttribute?e.getAttribute(eo):null;return typeof t=="string"}function RH(e){var t=e.getAttribute?e.getAttribute(p1):null,n=e.getAttribute?e.getAttribute(g1):null;return t&&n}function DH(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(re.replacementClass)}function BH(){if(re.autoReplaceSvg===!0)return Ed.replace;var e=Ed[re.autoReplaceSvg];return e||Ed.replace}function FH(e){return We.createElementNS("http://www.w3.org/2000/svg",e)}function PH(e){return We.createElement(e)}function V4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?FH:PH:n;if(typeof e=="string")return We.createTextNode(e);var i=r(e.tag);Object.keys(e.attributes||[]).forEach(function(o){i.setAttribute(o,e.attributes[o])});var a=e.children||[];return a.forEach(function(o){i.appendChild(V4(o,{ceFn:r}))}),i}function MH(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var Ed={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(V4(i),n)}),n.getAttribute(eo)===null&&re.keepOriginalSource){var r=We.createComment(MH(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~b1(n).indexOf(re.replacementClass))return Ed.replace(t);var i=new RegExp("".concat(re.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var a=r[0].attributes.class.split(" ").reduce(function(s,c){return c===re.replacementClass||c.match(i)?s.toSvg.push(c):s.toNode.push(c),s},{toNode:[],toSvg:[]});r[0].attributes.class=a.toSvg.join(" "),a.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",a.toNode.join(" "))}var o=r.map(function(s){return Ql(s)}).join(`
|
2447
|
-
`);n.setAttribute(eo,""),n.innerHTML=o}};function j4(e){e()}function q4(e,t){var n=typeof t=="function"?t:Ad;if(e.length===0)n();else{var r=j4;re.mutateApproach===z$&&(r=
|
2448
|
-
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function XH(e){return Promise.all([J4(e,"::before"),J4(e,"::after")])}function KH(e){return e.parentNode!==document.head&&!~U$.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(d1)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function eS(e){if(jr)return new Promise(function(t,n){var r=xs(e.querySelectorAll("*")).filter(KH).map(XH),i=F1.begin("searchPseudoElements");W4(),Promise.all(r).then(function(){i(),M1(),t()}).catch(function(){i(),M1(),n()})})}var JH={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=eS,n}}},provides:function(t){t.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?We:r;re.searchPseudoElements&&eS(i)}}},tS=!1,eG={mixout:function(){return{dom:{unwatch:function(){W4(),tS=!0}}}},hooks:function(){return{bootstrap:function(){Y4(C1("mutationObserverCallbacks",{}))},noAuto:function(){OH()},watch:function(n){var r=n.observeMutationsRoot;tS?M1():Y4(C1("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},nS=function(t){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t.toLowerCase().split(" ").reduce(function(r,i){var a=i.toLowerCase().split("-"),o=a[0],s=a.slice(1).join("-");if(o&&s==="h")return r.flipX=!0,r;if(o&&s==="v")return r.flipY=!0,r;if(s=parseFloat(s),isNaN(s))return r;switch(o){case"grow":r.size=r.size+s;break;case"shrink":r.size=r.size-s;break;case"left":r.x=r.x-s;break;case"right":r.x=r.x+s;break;case"up":r.y=r.y-s;break;case"down":r.y=r.y+s;break;case"rotate":r.rotate=r.rotate+s;break}return r},n)},tG={mixout:function(){return{parse:{transform:function(n){return nS(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=nS(i)),n}}},provides:function(t){t.generateAbstractTransformGrouping=function(n){var r=n.main,i=n.transform,a=n.containerWidth,o=n.iconWidth,s={transform:"translate(".concat(a/2," 256)")},c="translate(".concat(i.x*32,", ").concat(i.y*32,") "),l="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),u="rotate(".concat(i.rotate," 0 0)"),f={transform:"".concat(c," ").concat(l," ").concat(u)},h={transform:"translate(".concat(o/2*-1," -256)")},d={outer:s,inner:f,path:h};return{tag:"g",attributes:te({},d.outer),children:[{tag:"g",attributes:te({},d.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:te(te({},r.icon.attributes),d.path)}]}]}}}},O1={x:0,y:0,width:"100%",height:"100%"};function rS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function nG(e){return e.tag==="g"?e.children:[e]}var rG={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),a=i?wd(i.split(" ").map(function(o){return o.trim()})):_1();return a.prefix||(a.prefix
|
2446
|
+
}`;function _4(){var e=b4,t=y4,n=re.cssPrefix,r=re.replacementClass,i=rH;if(n!==e||r!==t){var a=new RegExp("\\.".concat(e,"\\-"),"g"),o=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");i=i.replace(a,".".concat(n,"-")).replace(o,"--".concat(n,"-")).replace(s,".".concat(r))}return i}var C4=!1;function v1(){re.autoAddCss&&!C4&&(K$(_4()),C4=!0)}var iH={mixout:function(){return{dom:{css:_4,insertCss:v1}}},hooks:function(){return{beforeDOMElementCreation:function(){v1()},beforeI2svg:function(){v1()}}}},Wr=Ui||{};Wr[qr]||(Wr[qr]={}),Wr[qr].styles||(Wr[qr].styles={}),Wr[qr].hooks||(Wr[qr].hooks={}),Wr[qr].shims||(Wr[qr].shims=[]);var Yn=Wr[qr],k4=[],aH=function e(){We.removeEventListener("DOMContentLoaded",e),gd=1,k4.map(function(t){return t()})},gd=!1;jr&&(gd=(We.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(We.readyState),gd||We.addEventListener("DOMContentLoaded",aH));function oH(e){jr&&(gd?setTimeout(e,0):k4.push(e))}function Ql(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,i=e.children,a=i===void 0?[]:i;return typeof e=="string"?S4(e):"<".concat(t," ").concat(eH(r),">").concat(a.map(Ql).join(""),"</").concat(t,">")}function T4(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var sH=function(t,n){return function(r,i,a,o){return t.call(n,r,i,a,o)}},w1=function(t,n,r,i){var a=Object.keys(t),o=a.length,s=i!==void 0?sH(n,i):n,c,l,u;for(r===void 0?(c=1,u=t[a[0]]):(c=0,u=r);c<o;c++)l=a[c],u=s(u,t[l],l,t);return u};function cH(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);(a&64512)==56320?t.push(((i&1023)<<10)+(a&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}function x1(e){var t=cH(e);return t.length===1?t[0].toString(16):null}function lH(e,t){var n=e.length,r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function I4(e){return Object.keys(e).reduce(function(t,n){var r=e[n],i=!!r.icon;return i?t[r.iconName]=r.icon:t[n]=r,t},{})}function A1(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,a=I4(t);typeof Yn.hooks.addPack=="function"&&!i?Yn.hooks.addPack(e,I4(t)):Yn.styles[e]=te(te({},Yn.styles[e]||{}),a),e==="fas"&&A1("fa",t)}var md,bd,yd,As=Yn.styles,uH=Yn.shims,fH=(md={},bt(md,Ye,Object.values(jl[Ye])),bt(md,ct,Object.values(jl[ct])),md),E1=null,R4={},D4={},B4={},F4={},P4={},hH=(bd={},bt(bd,Ye,Object.keys(Gl[Ye])),bt(bd,ct,Object.keys(Gl[ct])),bd);function dH(e){return~W$.indexOf(e)}function pH(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!dH(i)?i:null}var M4=function(){var t=function(a){return w1(As,function(o,s,c){return o[c]=w1(s,a,{}),o},{})};R4=t(function(i,a,o){if(a[3]&&(i[a[3]]=o),a[2]){var s=a[2].filter(function(c){return typeof c=="number"});s.forEach(function(c){i[c.toString(16)]=o})}return i}),D4=t(function(i,a,o){if(i[o]=o,a[2]){var s=a[2].filter(function(c){return typeof c=="string"});s.forEach(function(c){i[c]=o})}return i}),P4=t(function(i,a,o){var s=a[2];return i[o]=o,s.forEach(function(c){i[c]=o}),i});var n="far"in As||re.autoFetchSvg,r=w1(uH,function(i,a){var o=a[0],s=a[1],c=a[2];return s==="far"&&!n&&(s="fas"),typeof o=="string"&&(i.names[o]={prefix:s,iconName:c}),typeof o=="number"&&(i.unicodes[o.toString(16)]={prefix:s,iconName:c}),i},{names:{},unicodes:{}});B4=r.names,F4=r.unicodes,E1=vd(re.styleDefault,{family:re.familyDefault})};X$(function(e){E1=vd(e.styleDefault,{family:re.familyDefault})}),M4();function S1(e,t){return(R4[e]||{})[t]}function gH(e,t){return(D4[e]||{})[t]}function no(e,t){return(P4[e]||{})[t]}function O4(e){return B4[e]||{prefix:null,iconName:null}}function mH(e){var t=F4[e],n=S1("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Hi(){return E1}var _1=function(){return{prefix:null,iconName:null,rest:[]}};function vd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?Ye:n,i=Gl[r][e],a=Vl[r][e]||Vl[r][i],o=e in Yn.styles?e:null;return a||o||null}var L4=(yd={},bt(yd,Ye,Object.keys(jl[Ye])),bt(yd,ct,Object.keys(jl[ct])),yd);function wd(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,a=(t={},bt(t,Ye,"".concat(re.cssPrefix,"-").concat(Ye)),bt(t,ct,"".concat(re.cssPrefix,"-").concat(ct)),t),o=null,s=Ye;(e.includes(a[Ye])||e.some(function(l){return L4[Ye].includes(l)}))&&(s=Ye),(e.includes(a[ct])||e.some(function(l){return L4[ct].includes(l)}))&&(s=ct);var c=e.reduce(function(l,u){var f=pH(re.cssPrefix,u);if(As[u]?(u=fH[s].includes(u)?$$[s][u]:u,o=u,l.prefix=u):hH[s].indexOf(u)>-1?(o=u,l.prefix=vd(u,{family:s})):f?l.iconName=f:u!==re.replacementClass&&u!==a[Ye]&&u!==a[ct]&&l.rest.push(u),!i&&l.prefix&&l.iconName){var h=o==="fa"?O4(l.iconName):{},d=no(l.prefix,l.iconName);h.prefix&&(o=null),l.iconName=h.iconName||d||l.iconName,l.prefix=h.prefix||l.prefix,l.prefix==="far"&&!As.far&&As.fas&&!re.autoFetchSvg&&(l.prefix="fas")}return l},_1());return(e.includes("fa-brands")||e.includes("fab"))&&(c.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(c.prefix="fad"),!c.prefix&&s===ct&&(As.fass||re.autoFetchSvg)&&(c.prefix="fass",c.iconName=no(c.prefix,c.iconName)||c.iconName),(c.prefix==="fa"||o==="fa")&&(c.prefix=Hi()||"fas"),c}var bH=function(){function e(){I$(this,e),this.definitions={}}return R$(e,[{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i.reduce(this._pullDefinitions,{});Object.keys(o).forEach(function(s){n.definitions[s]=te(te({},n.definitions[s]||{}),o[s]),A1(s,o[s]);var c=jl[Ye][s];c&&A1(c,o[s]),M4()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,r){var i=r.prefix&&r.iconName&&r.icon?{0:r}:r;return Object.keys(i).map(function(a){var o=i[a],s=o.prefix,c=o.iconName,l=o.icon,u=l[2];n[s]||(n[s]={}),u.length>0&&u.forEach(function(f){typeof f=="string"&&(n[s][f]=l)}),n[s][c]=l}),n}}]),e}(),N4=[],Es={},Ss={},yH=Object.keys(Ss);function vH(e,t){var n=t.mixoutsTo;return N4=e,Es={},Object.keys(Ss).forEach(function(r){yH.indexOf(r)===-1&&delete Ss[r]}),N4.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(o){typeof i[o]=="function"&&(n[o]=i[o]),sd(i[o])==="object"&&Object.keys(i[o]).forEach(function(s){n[o]||(n[o]={}),n[o][s]=i[o][s]})}),r.hooks){var a=r.hooks();Object.keys(a).forEach(function(o){Es[o]||(Es[o]=[]),Es[o].push(a[o])})}r.provides&&r.provides(Ss)}),n}function C1(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var a=Es[e]||[];return a.forEach(function(o){t=o.apply(null,[t].concat(r))}),t}function ro(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=Es[e]||[];i.forEach(function(a){a.apply(null,n)})}function Yr(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Ss[e]?Ss[e].apply(null,t):void 0}function k1(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Hi();if(t)return t=no(n,t)||t,T4(z4.definitions,n,t)||T4(Yn.styles,n,t)}var z4=new bH,wH=function(){re.autoReplaceSvg=!1,re.observeMutations=!1,ro("noAuto")},xH={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return jr?(ro("beforeI2svg",t),Yr("pseudoElements2svg",t),Yr("i2svg",t)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot;re.autoReplaceSvg===!1&&(re.autoReplaceSvg=!0),re.observeMutations=!0,oH(function(){EH({autoReplaceSvgRoot:n}),ro("watch",t)})}},AH={icon:function(t){if(t===null)return null;if(sd(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:no(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){var n=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],r=vd(t[0]);return{prefix:r,iconName:no(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(re.cssPrefix,"-"))>-1||t.match(H$))){var i=wd(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||Hi(),iconName:no(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var a=Hi();return{prefix:a,iconName:no(a,t)||t}}}},hn={noAuto:wH,config:re,dom:xH,parse:AH,library:z4,findIconDefinition:k1,toHtml:Ql},EH=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?We:n;(Object.keys(Yn.styles).length>0||re.autoFetchSvg)&&jr&&re.autoReplaceSvg&&hn.dom.i2svg({node:r})};function xd(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return Ql(r)})}}),Object.defineProperty(e,"node",{get:function(){if(jr){var r=We.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function SH(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,a=e.styles,o=e.transform;if(y1(o)&&n.found&&!r.found){var s=n.width,c=n.height,l={x:s/c/2,y:.5};i.style=pd(te(te({},a),{},{"transform-origin":"".concat(l.x+o.x/16,"em ").concat(l.y+o.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function _H(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,a=e.symbol,o=a===!0?"".concat(t,"-").concat(re.cssPrefix,"-").concat(n):a;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:te(te({},i),{},{id:o}),children:r}]}]}function T1(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,a=e.iconName,o=e.transform,s=e.symbol,c=e.title,l=e.maskId,u=e.titleId,f=e.extra,h=e.watchable,d=h===void 0?!1:h,p=r.found?r:n,g=p.width,b=p.height,v=i==="fak",x=[re.replacementClass,a?"".concat(re.cssPrefix,"-").concat(a):""].filter(function(B){return f.classes.indexOf(B)===-1}).filter(function(B){return B!==""||!!B}).concat(f.classes).join(" "),A={children:[],attributes:te(te({},f.attributes),{},{"data-prefix":i,"data-icon":a,class:x,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(g," ").concat(b)})},w=v&&!~f.classes.indexOf("fa-fw")?{width:"".concat(g/b*16*.0625,"em")}:{};d&&(A.attributes[eo]=""),c&&(A.children.push({tag:"title",attributes:{id:A.attributes["aria-labelledby"]||"title-".concat(u||Zl())},children:[c]}),delete A.attributes.title);var _=te(te({},A),{},{prefix:i,iconName:a,main:n,mask:r,maskId:l,transform:o,symbol:s,styles:te(te({},w),f.styles)}),C=r.found&&n.found?Yr("generateAbstractMask",_)||{children:[],attributes:{}}:Yr("generateAbstractIcon",_)||{children:[],attributes:{}},I=C.children,D=C.attributes;return _.children=I,_.attributes=D,s?_H(_):SH(_)}function U4(e){var t=e.content,n=e.width,r=e.height,i=e.transform,a=e.title,o=e.extra,s=e.watchable,c=s===void 0?!1:s,l=te(te(te({},o.attributes),a?{title:a}:{}),{},{class:o.classes.join(" ")});c&&(l[eo]="");var u=te({},o.styles);y1(i)&&(u.transform=nH({transform:i,startCentered:!0,width:n,height:r}),u["-webkit-transform"]=u.transform);var f=pd(u);f.length>0&&(l.style=f);var h=[];return h.push({tag:"span",attributes:l,children:[t]}),a&&h.push({tag:"span",attributes:{class:"sr-only"},children:[a]}),h}function CH(e){var t=e.content,n=e.title,r=e.extra,i=te(te(te({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),a=pd(r.styles);a.length>0&&(i.style=a);var o=[];return o.push({tag:"span",attributes:i,children:[t]}),n&&o.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),o}var I1=Yn.styles;function R1(e){var t=e[0],n=e[1],r=e.slice(4),i=l1(r,1),a=i[0],o=null;return Array.isArray(a)?o={tag:"g",attributes:{class:"".concat(re.cssPrefix,"-").concat(to.GROUP)},children:[{tag:"path",attributes:{class:"".concat(re.cssPrefix,"-").concat(to.SECONDARY),fill:"currentColor",d:a[0]}},{tag:"path",attributes:{class:"".concat(re.cssPrefix,"-").concat(to.PRIMARY),fill:"currentColor",d:a[1]}}]}:o={tag:"path",attributes:{fill:"currentColor",d:a}},{found:!0,width:t,height:n,icon:o}}var kH={found:!1,width:512,height:512};function TH(e,t){!w4&&!re.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function D1(e,t){var n=t;return t==="fa"&&re.styleDefault!==null&&(t=Hi()),new Promise(function(r,i){if(Yr("missingIconAbstract"),n==="fa"){var a=O4(e)||{};e=a.iconName||e,t=a.prefix||t}if(e&&t&&I1[t]&&I1[t][e]){var o=I1[t][e];return r(R1(o))}TH(e,t),r(te(te({},kH),{},{icon:re.showMissingIcons&&e?Yr("missingIconAbstract")||{}:{}}))})}var $4=function(){},B1=re.measurePerformance&&cd&&cd.mark&&cd.measure?cd:{mark:$4,measure:$4},Xl='FA "6.4.2"',IH=function(t){return B1.mark("".concat(Xl," ").concat(t," begins")),function(){return H4(t)}},H4=function(t){B1.mark("".concat(Xl," ").concat(t," ends")),B1.measure("".concat(Xl," ").concat(t),"".concat(Xl," ").concat(t," begins"),"".concat(Xl," ").concat(t," ends"))},F1={begin:IH,end:H4},Ad=function(){};function G4(e){var t=e.getAttribute?e.getAttribute(eo):null;return typeof t=="string"}function RH(e){var t=e.getAttribute?e.getAttribute(p1):null,n=e.getAttribute?e.getAttribute(g1):null;return t&&n}function DH(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(re.replacementClass)}function BH(){if(re.autoReplaceSvg===!0)return Ed.replace;var e=Ed[re.autoReplaceSvg];return e||Ed.replace}function FH(e){return We.createElementNS("http://www.w3.org/2000/svg",e)}function PH(e){return We.createElement(e)}function V4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?FH:PH:n;if(typeof e=="string")return We.createTextNode(e);var i=r(e.tag);Object.keys(e.attributes||[]).forEach(function(o){i.setAttribute(o,e.attributes[o])});var a=e.children||[];return a.forEach(function(o){i.appendChild(V4(o,{ceFn:r}))}),i}function MH(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var Ed={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(V4(i),n)}),n.getAttribute(eo)===null&&re.keepOriginalSource){var r=We.createComment(MH(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~b1(n).indexOf(re.replacementClass))return Ed.replace(t);var i=new RegExp("".concat(re.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var a=r[0].attributes.class.split(" ").reduce(function(s,c){return c===re.replacementClass||c.match(i)?s.toSvg.push(c):s.toNode.push(c),s},{toNode:[],toSvg:[]});r[0].attributes.class=a.toSvg.join(" "),a.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",a.toNode.join(" "))}var o=r.map(function(s){return Ql(s)}).join(`
|
2447
|
+
`);n.setAttribute(eo,""),n.innerHTML=o}};function j4(e){e()}function q4(e,t){var n=typeof t=="function"?t:Ad;if(e.length===0)n();else{var r=j4;re.mutateApproach===z$&&(r=Ui.requestAnimationFrame||j4),r(function(){var i=BH(),a=F1.begin("mutate");e.map(i),a(),n()})}}var P1=!1;function W4(){P1=!0}function M1(){P1=!1}var Sd=null;function Y4(e){if(g4&&re.observeMutations){var t=e.treeCallback,n=t===void 0?Ad:t,r=e.nodeCallback,i=r===void 0?Ad:r,a=e.pseudoElementsCallback,o=a===void 0?Ad:a,s=e.observeMutationsRoot,c=s===void 0?We:s;Sd=new g4(function(l){if(!P1){var u=Hi();xs(l).forEach(function(f){if(f.type==="childList"&&f.addedNodes.length>0&&!G4(f.addedNodes[0])&&(re.searchPseudoElements&&o(f.target),n(f.target)),f.type==="attributes"&&f.target.parentNode&&re.searchPseudoElements&&o(f.target.parentNode),f.type==="attributes"&&G4(f.target)&&~q$.indexOf(f.attributeName))if(f.attributeName==="class"&&RH(f.target)){var h=wd(b1(f.target)),d=h.prefix,p=h.iconName;f.target.setAttribute(p1,d||u),p&&f.target.setAttribute(g1,p)}else DH(f.target)&&i(f.target)})}}),jr&&Sd.observe(c,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function OH(){Sd&&Sd.disconnect()}function LH(e){var t=e.getAttribute("style"),n=[];return t&&(n=t.split(";").reduce(function(r,i){var a=i.split(":"),o=a[0],s=a.slice(1);return o&&s.length>0&&(r[o]=s.join(":").trim()),r},{})),n}function NH(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"",i=wd(b1(e));return i.prefix||(i.prefix=Hi()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=gH(i.prefix,e.innerText)||S1(i.prefix,x1(e.innerText))),!i.iconName&&re.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function zH(e){var t=xs(e.attributes).reduce(function(i,a){return i.name!=="class"&&i.name!=="style"&&(i[a.name]=a.value),i},{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return re.autoA11y&&(n?t["aria-labelledby"]="".concat(re.replacementClass,"-title-").concat(r||Zl()):(t["aria-hidden"]="true",t.focusable="false")),t}function UH(){return{iconName:null,title:null,titleId:null,prefix:null,transform:br,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function Z4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=NH(e),r=n.iconName,i=n.prefix,a=n.rest,o=zH(e),s=C1("parseNodeAttributes",{},e),c=t.styleParser?LH(e):[];return te({iconName:r,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:br,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:c,attributes:o}},s)}var $H=Yn.styles;function Q4(e){var t=re.autoReplaceSvg==="nest"?Z4(e,{styleParser:!1}):Z4(e);return~t.extra.classes.indexOf(x4)?Yr("generateLayersText",e,t):Yr("generateSvgReplacementMutation",e,t)}var Gi=new Set;m1.map(function(e){Gi.add("fa-".concat(e))}),Object.keys(Gl[Ye]).map(Gi.add.bind(Gi)),Object.keys(Gl[ct]).map(Gi.add.bind(Gi)),Gi=$l(Gi);function X4(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!jr)return Promise.resolve();var n=We.documentElement.classList,r=function(f){return n.add("".concat(v4,"-").concat(f))},i=function(f){return n.remove("".concat(v4,"-").concat(f))},a=re.autoFetchSvg?Gi:m1.map(function(u){return"fa-".concat(u)}).concat(Object.keys($H));a.includes("fa")||a.push("fa");var o=[".".concat(x4,":not([").concat(eo,"])")].concat(a.map(function(u){return".".concat(u,":not([").concat(eo,"])")})).join(", ");if(o.length===0)return Promise.resolve();var s=[];try{s=xs(e.querySelectorAll(o))}catch{}if(s.length>0)r("pending"),i("complete");else return Promise.resolve();var c=F1.begin("onTree"),l=s.reduce(function(u,f){try{var h=Q4(f);h&&u.push(h)}catch(d){w4||d.name==="MissingIcon"&&console.error(d)}return u},[]);return new Promise(function(u,f){Promise.all(l).then(function(h){q4(h,function(){r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),c(),u()})}).catch(function(h){c(),f(h)})})}function HH(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Q4(e).then(function(n){n&&q4([n],t)})}function GH(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:k1(t||{}),i=n.mask;return i&&(i=(i||{}).icon?i:k1(i||{})),e(r,te(te({},n),{},{mask:i}))}}var VH=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?br:r,a=n.symbol,o=a===void 0?!1:a,s=n.mask,c=s===void 0?null:s,l=n.maskId,u=l===void 0?null:l,f=n.title,h=f===void 0?null:f,d=n.titleId,p=d===void 0?null:d,g=n.classes,b=g===void 0?[]:g,v=n.attributes,x=v===void 0?{}:v,A=n.styles,w=A===void 0?{}:A;if(t){var _=t.prefix,C=t.iconName,I=t.icon;return xd(te({type:"icon"},t),function(){return ro("beforeDOMElementCreation",{iconDefinition:t,params:n}),re.autoA11y&&(h?x["aria-labelledby"]="".concat(re.replacementClass,"-title-").concat(p||Zl()):(x["aria-hidden"]="true",x.focusable="false")),T1({icons:{main:R1(I),mask:c?R1(c.icon):{found:!1,width:null,height:null,icon:{}}},prefix:_,iconName:C,transform:te(te({},br),i),symbol:o,title:h,maskId:u,titleId:p,extra:{attributes:x,styles:w,classes:b}})})}},jH={mixout:function(){return{icon:GH(VH)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=X4,n.nodeCallback=HH,n}}},provides:function(t){t.i2svg=function(n){var r=n.node,i=r===void 0?We:r,a=n.callback,o=a===void 0?function(){}:a;return X4(i,o)},t.generateSvgReplacementMutation=function(n,r){var i=r.iconName,a=r.title,o=r.titleId,s=r.prefix,c=r.transform,l=r.symbol,u=r.mask,f=r.maskId,h=r.extra;return new Promise(function(d,p){Promise.all([D1(i,s),u.iconName?D1(u.iconName,u.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(g){var b=l1(g,2),v=b[0],x=b[1];d([n,T1({icons:{main:v,mask:x},prefix:s,iconName:i,transform:c,symbol:l,maskId:f,title:a,titleId:o,extra:h,watchable:!0})])}).catch(p)})},t.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,a=n.main,o=n.transform,s=n.styles,c=pd(s);c.length>0&&(i.style=c);var l;return y1(o)&&(l=Yr("generateAbstractTransformGrouping",{main:a,transform:o,containerWidth:a.width,iconWidth:a.width})),r.push(l||a.icon),{children:r,attributes:i}}}},qH={mixout:function(){return{layer:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.classes,a=i===void 0?[]:i;return xd({type:"layer"},function(){ro("beforeDOMElementCreation",{assembler:n,params:r});var o=[];return n(function(s){Array.isArray(s)?s.map(function(c){o=o.concat(c.abstract)}):o=o.concat(s.abstract)}),[{tag:"span",attributes:{class:["".concat(re.cssPrefix,"-layers")].concat($l(a)).join(" ")},children:o}]})}}}},WH={mixout:function(){return{counter:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.title,a=i===void 0?null:i,o=r.classes,s=o===void 0?[]:o,c=r.attributes,l=c===void 0?{}:c,u=r.styles,f=u===void 0?{}:u;return xd({type:"counter",content:n},function(){return ro("beforeDOMElementCreation",{content:n,params:r}),CH({content:n.toString(),title:a,extra:{attributes:l,styles:f,classes:["".concat(re.cssPrefix,"-layers-counter")].concat($l(s))}})})}}}},YH={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,a=i===void 0?br:i,o=r.title,s=o===void 0?null:o,c=r.classes,l=c===void 0?[]:c,u=r.attributes,f=u===void 0?{}:u,h=r.styles,d=h===void 0?{}:h;return xd({type:"text",content:n},function(){return ro("beforeDOMElementCreation",{content:n,params:r}),U4({content:n,transform:te(te({},br),a),title:s,extra:{attributes:f,styles:d,classes:["".concat(re.cssPrefix,"-layers-text")].concat($l(l))}})})}}},provides:function(t){t.generateLayersText=function(n,r){var i=r.title,a=r.transform,o=r.extra,s=null,c=null;if(m4){var l=parseInt(getComputedStyle(n).fontSize,10),u=n.getBoundingClientRect();s=u.width/l,c=u.height/l}return re.autoA11y&&!i&&(o.attributes["aria-hidden"]="true"),Promise.resolve([n,U4({content:n.innerHTML,width:s,height:c,transform:a,title:i,extra:o,watchable:!0})])}}},ZH=new RegExp('"',"ug"),K4=[1105920,1112319];function QH(e){var t=e.replace(ZH,""),n=lH(t,0),r=n>=K4[0]&&n<=K4[1],i=t.length===2?t[0]===t[1]:!1;return{value:x1(i?t[0]:t),isSecondary:r||i}}function J4(e,t){var n="".concat(N$).concat(t.replace(":","-"));return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var a=xs(e.children),o=a.filter(function(I){return I.getAttribute(d1)===t})[0],s=Ui.getComputedStyle(e,t),c=s.getPropertyValue("font-family").match(G$),l=s.getPropertyValue("font-weight"),u=s.getPropertyValue("content");if(o&&!c)return e.removeChild(o),r();if(c&&u!=="none"&&u!==""){var f=s.getPropertyValue("content"),h=~["Sharp"].indexOf(c[2])?ct:Ye,d=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(c[2])?Vl[h][c[2].toLowerCase()]:V$[h][l],p=QH(f),g=p.value,b=p.isSecondary,v=c[0].startsWith("FontAwesome"),x=S1(d,g),A=x;if(v){var w=mH(g);w.iconName&&w.prefix&&(x=w.iconName,d=w.prefix)}if(x&&!b&&(!o||o.getAttribute(p1)!==d||o.getAttribute(g1)!==A)){e.setAttribute(n,A),o&&e.removeChild(o);var _=UH(),C=_.extra;C.attributes[d1]=t,D1(x,d).then(function(I){var D=T1(te(te({},_),{},{icons:{main:I,mask:_1()},prefix:d,iconName:A,extra:C,watchable:!0})),B=We.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(B,e.firstChild):e.appendChild(B),B.outerHTML=D.map(function(G){return Ql(G)}).join(`
|
2448
|
+
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function XH(e){return Promise.all([J4(e,"::before"),J4(e,"::after")])}function KH(e){return e.parentNode!==document.head&&!~U$.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(d1)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function eS(e){if(jr)return new Promise(function(t,n){var r=xs(e.querySelectorAll("*")).filter(KH).map(XH),i=F1.begin("searchPseudoElements");W4(),Promise.all(r).then(function(){i(),M1(),t()}).catch(function(){i(),M1(),n()})})}var JH={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=eS,n}}},provides:function(t){t.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?We:r;re.searchPseudoElements&&eS(i)}}},tS=!1,eG={mixout:function(){return{dom:{unwatch:function(){W4(),tS=!0}}}},hooks:function(){return{bootstrap:function(){Y4(C1("mutationObserverCallbacks",{}))},noAuto:function(){OH()},watch:function(n){var r=n.observeMutationsRoot;tS?M1():Y4(C1("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},nS=function(t){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t.toLowerCase().split(" ").reduce(function(r,i){var a=i.toLowerCase().split("-"),o=a[0],s=a.slice(1).join("-");if(o&&s==="h")return r.flipX=!0,r;if(o&&s==="v")return r.flipY=!0,r;if(s=parseFloat(s),isNaN(s))return r;switch(o){case"grow":r.size=r.size+s;break;case"shrink":r.size=r.size-s;break;case"left":r.x=r.x-s;break;case"right":r.x=r.x+s;break;case"up":r.y=r.y-s;break;case"down":r.y=r.y+s;break;case"rotate":r.rotate=r.rotate+s;break}return r},n)},tG={mixout:function(){return{parse:{transform:function(n){return nS(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=nS(i)),n}}},provides:function(t){t.generateAbstractTransformGrouping=function(n){var r=n.main,i=n.transform,a=n.containerWidth,o=n.iconWidth,s={transform:"translate(".concat(a/2," 256)")},c="translate(".concat(i.x*32,", ").concat(i.y*32,") "),l="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),u="rotate(".concat(i.rotate," 0 0)"),f={transform:"".concat(c," ").concat(l," ").concat(u)},h={transform:"translate(".concat(o/2*-1," -256)")},d={outer:s,inner:f,path:h};return{tag:"g",attributes:te({},d.outer),children:[{tag:"g",attributes:te({},d.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:te(te({},r.icon.attributes),d.path)}]}]}}}},O1={x:0,y:0,width:"100%",height:"100%"};function rS(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function nG(e){return e.tag==="g"?e.children:[e]}var rG={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),a=i?wd(i.split(" ").map(function(o){return o.trim()})):_1();return a.prefix||(a.prefix=Hi()),n.mask=a,n.maskId=r.getAttribute("data-fa-mask-id"),n}}},provides:function(t){t.generateAbstractMask=function(n){var r=n.children,i=n.attributes,a=n.main,o=n.mask,s=n.maskId,c=n.transform,l=a.width,u=a.icon,f=o.width,h=o.icon,d=tH({transform:c,containerWidth:f,iconWidth:l}),p={tag:"rect",attributes:te(te({},O1),{},{fill:"white"})},g=u.children?{children:u.children.map(rS)}:{},b={tag:"g",attributes:te({},d.inner),children:[rS(te({tag:u.tag,attributes:te(te({},u.attributes),d.path)},g))]},v={tag:"g",attributes:te({},d.outer),children:[b]},x="mask-".concat(s||Zl()),A="clip-".concat(s||Zl()),w={tag:"mask",attributes:te(te({},O1),{},{id:x,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[p,v]},_={tag:"defs",children:[{tag:"clipPath",attributes:{id:A},children:nG(h)},w]};return r.push(_,{tag:"rect",attributes:te({fill:"currentColor","clip-path":"url(#".concat(A,")"),mask:"url(#".concat(x,")")},O1)}),{children:r,attributes:i}}}},iG={provides:function(t){var n=!1;Ui.matchMedia&&(n=Ui.matchMedia("(prefers-reduced-motion: reduce)").matches),t.missingIconAbstract=function(){var r=[],i={fill:"currentColor"},a={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};r.push({tag:"path",attributes:te(te({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var o=te(te({},a),{},{attributeName:"opacity"}),s={tag:"circle",attributes:te(te({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||s.children.push({tag:"animate",attributes:te(te({},a),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:te(te({},o),{},{values:"1;0;1;1;0;1;"})}),r.push(s),r.push({tag:"path",attributes:te(te({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:te(te({},o),{},{values:"1;0;0;0;0;1;"})}]}),n||r.push({tag:"path",attributes:te(te({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:te(te({},o),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:r}}}},aG={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-symbol"),a=i===null?!1:i===""?!0:i;return n.symbol=a,n}}}},oG=[iH,jH,qH,WH,YH,JH,eG,tG,rG,iG,aG];vH(oG,{mixoutsTo:hn}),hn.noAuto,hn.config,hn.library,hn.dom,hn.parse,hn.findIconDefinition,hn.toHtml;var Ue=hn.icon;hn.layer,hn.text,hn.counter;/**
|
2449
2449
|
* @license
|
2450
2450
|
* Copyright 2020 Google LLC
|
2451
2451
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -2453,8 +2453,8 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2453
2453
|
* @license
|
2454
2454
|
* Copyright 2017 Google LLC
|
2455
2455
|
* SPDX-License-Identifier: BSD-3-Clause
|
2456
|
-
*/const sS=(e,t,n)=>{const r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},fG=
|
2457
|
-
<div class="content"></div>`,n);const i=()=>{n.querySelector(".backdrop").addEventListener("transitionend",()=>n.remove()),n.classList.remove("visible"),document.body.classList.remove(
|
2456
|
+
*/const sS=(e,t,n)=>{const r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},fG=Da(class extends Zo{constructor(e){if(super(e),e.type!==sr.CHILD)throw Error("repeat() can only be used in text expressions")}ht(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);const i=[],a=[];let o=0;for(const s of e)i[o]=r?r(s,o):o,a[o]=n(s,o),o++;return{values:a,keys:i}}render(e,t,n){return this.ht(e,t,n).values}update(e,[t,n,r]){const i=uG(e),{values:a,keys:o}=this.ht(t,n,r);if(!Array.isArray(i))return this.dt=o,a;const s=this.dt??(this.dt=[]),c=[];let l,u,f=0,h=i.length-1,d=0,p=a.length-1;for(;f<=h&&d<=p;)if(i[f]===null)f++;else if(i[h]===null)h--;else if(s[f]===o[d])c[d]=io(i[f],a[d]),f++,d++;else if(s[h]===o[p])c[p]=io(i[h],a[p]),h--,p--;else if(s[f]===o[p])c[p]=io(i[f],a[p]),Kl(e,c[p+1],i[f]),f++,p--;else if(s[h]===o[d])c[d]=io(i[h],a[d]),Kl(e,i[f],i[h]),h--,d++;else if(l===void 0&&(l=sS(o,d,p),u=sS(s,f,h)),l.has(s[f]))if(l.has(s[h])){const g=u.get(o[d]),b=g!==void 0?i[g]:null;if(b===null){const v=Kl(e,i[f]);io(v,a[d]),c[d]=v}else c[d]=io(b,a[d]),Kl(e,i[f],b),i[g]=null;d++}else L1(i[h]),h--;else L1(i[f]),f++;for(;d<=p;){const g=Kl(e,c[p+1]);io(g,a[d]),c[d++]=g}for(;f<=h;){const g=i[f++];g!==null&&L1(g)}return this.dt=o,oS(e,c),Dt}}),cS="close-dialog";function hG(){return new CustomEvent(cS,{bubbles:!0})}function ao(e="default",t=document.body){const n=document.createElement("div");n.classList.add("gs-modal"),e!="default"&&n.classList.add(e);const r=a=>{var o;switch(a.key){case"Escape":{const s=n.querySelector(".btn-cancel");s&&(s.click(),a.stopPropagation());break}case"Enter":{if(((o=a.target)==null?void 0:o.tagName)=="TEXTAREA")return;n.querySelector(".btn-primary").click(),a.stopPropagation();break}}};n.addEventListener("keydown",r),Vt($`<div class="backdrop"></div>
|
2457
|
+
<div class="content"></div>`,n);const i=()=>{n.querySelector(".backdrop").addEventListener("transitionend",()=>n.remove()),n.classList.remove("visible"),document.body.classList.remove(Ba)};return n.addEventListener("keydown",a=>{a.stopPropagation()}),n.addEventListener(cS,i),t.appendChild(n),window.requestAnimationFrame(()=>n.classList.add("visible")),e!="tour"&&document.body.classList.add(Ba),{content:n.querySelector(".content"),close:i}}function dn(e,t={}){const n=ao(),r=t.title;return t.okLabel??(t.okLabel="OK"),new Promise((i,a)=>{const o=()=>{n.close(),i(!0)},s=$`
|
2458
2458
|
${r?$`<div class="modal-title">${r}</div>`:ue}
|
2459
2459
|
<div class="modal-body" style="max-width: 700px">
|
2460
2460
|
${e}
|
@@ -2470,7 +2470,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2470
2470
|
`:ue}
|
2471
2471
|
<button class="btn" @click=${o}>${t.okLabel}</button>
|
2472
2472
|
</div>
|
2473
|
-
</div>`;Vt(s,n.content)})}class lS extends
|
2473
|
+
</div>`;Vt(s,n.content)})}class lS extends mr{constructor(){super();Z(this,Z0);Z(this,Q0);Z(this,vf);Z(this,X0);Z(this,xc,void 0);Z(this,li,void 0);Z(this,la,void 0);Z(this,yf,0);this.values=[],this.thresholds=[],this.operators=[],this.colors=uS,this.showThresholdNumbers=!1,le(this,xc,nR().thresholds(40)),le(this,li,P(this,xc).call(this,[])),le(this,la,yh())}connectedCallback(){super.connectedCallback()}createRenderRoot(){return this}willUpdate(n){n.has("values")&&(le(this,li,P(this,xc).call(this,this.values)),le(this,la,yh().domain(this.domain).range([0,100])))}get domain(){return[P(this,li).at(0).x0,P(this,li).at(-1).x1]}render(){const n=P(this,la),r=100/P(this,li).length,i=J(this,X0,jT).call(this).map(a=>$`<div
|
2474
2474
|
style=${Jf({width:r+.01+"%",left:a.x+"%",bottom:a.y+"%",height:a.height+"%",backgroundColor:typeof a.group=="number"?this.colors[a.group%this.colors.length]:"default"})}
|
2475
2475
|
></div>`);return $`<div class="histogram-widget">
|
2476
2476
|
<div class="histogram-plot">
|
@@ -2498,7 +2498,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2498
2498
|
<div class="histogram-extent">
|
2499
2499
|
${n.domain().map(a=>$`<div>${a}</div>`)}
|
2500
2500
|
</div>
|
2501
|
-
</div>`}}xc=new WeakMap,li=new WeakMap,
|
2501
|
+
</div>`}}xc=new WeakMap,li=new WeakMap,la=new WeakMap,yf=new WeakMap,Z0=new WeakSet,GT=function(n){if(performance.now()<P(this,yf)+200)return;const r=n.target,i=kw(r,n);J(this,vf,ev).call(this,"add",0,i[0]/r.offsetWidth)},Q0=new WeakSet,VT=function(n,r){const a=n.target.closest(".histogram-threshold"),o=a.offsetLeft,s=a.offsetParent.offsetWidth;n.preventDefault(),n.stopPropagation(),this.style.cursor="col-resize",pG(n,(c,l)=>{J(this,vf,ev).call(this,"adjust",r,(o+c)/s)},()=>{le(this,yf,performance.now()),this.style.cursor=""})},vf=new WeakSet,ev=function(n,r,i){i=Ai(i,0,1),this.dispatchEvent(new dG(n,r,+P(this,la).invert(i*100).toPrecision(3)))},X0=new WeakSet,jT=function(){const n=P(this,li),r=P(this,la),i=90/n.map(u=>u.length).reduce((u,f)=>Math.max(u,f),0),a=[],o=this.thresholds.length==1&&this.operators[0]=="eq",s=[-1/0,...this.thresholds,1/0],c=[!1,...this.operators.map(u=>["lte","gt"].includes(u)),!0],l=["gt","gte"].includes(this.operators[0])?u=>s.length-u-2:u=>u;for(let u=0;u<n.length;u++){const f=n[u],h=r(f.x0);let d=0,p=0;if(o)for(let g=0;g<=1;g++)p=mG(f,this.thresholds[0],g>0),p&&a.push({x:h,y:d*i,height:p*i,group:g}),d+=p;else if(this.thresholds.length)for(let g=0;g<s.length-1;g++){const b=l(g);p=gG(f,s[b],s[b+1],!c[b],c[b+1]),p&&a.push({x:h,y:d*i,height:p*i,group:g}),d+=p}else p=f.length,p&&a.push({x:h,y:d,height:p*i,group:null})}return a},ar(lS,"properties",{values:{attribute:!1},thresholds:{attribute:!1},operators:{attribute:!1},colors:{attribute:!1},showThresholdNumbers:{}}),customElements.define("genome-spy-histogram",lS);class dG extends Event{constructor(t,n,r){super(t),this.index=n,this.value=r}}function pG(e,t,n){const r=e.clientX,i=e.clientY,a=function(s){t(s.clientX-r,s.clientY-i)},o=function(s){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",o),n==null||n(s.clientX-r,s.clientY-i)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",o)}function gG(e,t,n,r=!0,i=!1){const a=r?c=>c>=t:c=>c>t,o=i?c=>c<=n:c=>c<n;let s=0;for(let c=0;c<e.length;c++){const l=e[c];a(l)&&o(l)&&s++}return s}function mG(e,t,n=!1){let r=0;for(let i=0;i<e.length;i++)r+=+(e[i]==t);return n?e.length-r:r}const uS=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b"];function bG(e,t){var r;const n=(r=e.scale)==null?void 0:r.type;zr(n)?vG(e,t):_t(n)||Ii(n)?wG(e,t):e.type==="identifier"?yG(e,t):dn("Not implemented (yet).")}function yG(e,t){fS(t.getSamples().map(n=>n.id),e,t)}function vG(e,t){const n=e.scale,r=i=>$`<span
|
2502
2502
|
class="color"
|
2503
2503
|
style=${Jf({backgroundColor:n(i).toString()})}
|
2504
2504
|
></span>`;fS(n.domain(),e,t,r)}function fS(e,t,n,r=i=>ue){const i=n.provenance.storeHelper.getDispatcher(),a=new Set(hS(t,n.leafSamples,n.sampleHierarchy)),o=e.filter(w=>a.has(w)).map((w,_)=>({index:_,value:w,stringValue:`${w}`,lowerCaseValue:`${w}`.toLowerCase()})),s=ao(),c=$`
|
@@ -2610,7 +2610,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2610
2610
|
</div>
|
2611
2611
|
`;function g(){Vt($`${o}
|
2612
2612
|
<div class="modal-body">${p()}</div>
|
2613
|
-
${c()}`,a.content)}g(),(b=a.content.querySelector("input[type='text']"))==null||b.focus()}const xG={lt:["<","less than"],lte:["≤","less than or equal to"],eq:["=","equal to"],gte:["≥","greater than or equal to"],gt:[">","greater than"]};function hS(e,t,n){const r=e.accessor;return t.map(i=>r(i,n))}function Ft(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var AG=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")(),dS=AG,N1=()=>Math.random().toString(36).substring(7).split("").join("."),EG={INIT:`@@redux/INIT${N1()}`,REPLACE:`@@redux/REPLACE${N1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${N1()}`},_d=EG;function z1(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function pS(e,t,n){if(typeof e!="function")throw new Error(Ft(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ft(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ft(1));return n(pS)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((b,v)=>{o.set(v,b)}))}function u(){if(c)throw new Error(Ft(3));return i}function f(b){if(typeof b!="function")throw new Error(Ft(4));if(c)throw new Error(Ft(5));let v=!0;l();const x=s++;return o.set(x,b),function(){if(v){if(c)throw new Error(Ft(6));v=!1,l(),o.delete(x),a=null}}}function h(b){if(!z1(b))throw new Error(Ft(7));if(typeof b.type>"u")throw new Error(Ft(8));if(typeof b.type!="string")throw new Error(Ft(17));if(c)throw new Error(Ft(9));try{c=!0,i=r(i,b)}finally{c=!1}return(a=o).forEach(x=>{x()}),b}function d(b){if(typeof b!="function")throw new Error(Ft(10));r=b,h({type:_d.REPLACE})}function p(){const b=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Ft(11));function x(){const w=v;w.next&&w.next(u())}return x(),{unsubscribe:b(x)}},[dS](){return this}}}return h({type:_d.INIT}),{dispatch:h,subscribe:f,getState:u,replaceReducer:d,[dS]:p}}function SG(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:_d.INIT})>"u")throw new Error(Ft(12));if(typeof n(void 0,{type:_d.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ft(13))})}function U1(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{SG(n)}catch(a){i=a}return function(o={},s){if(i)throw i;let c=!1;const l={};for(let u=0;u<r.length;u++){const f=r[u],h=n[f],d=o[f],p=h(d,s);if(typeof p>"u")throw s&&s.type,new Error(Ft(14));l[f]=p,c=c||p!==d}return c=c||r.length!==Object.keys(o).length,c?l:o}}function Cd(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function _G(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Ft(15))};const o={getState:i.getState,dispatch:(c,...l)=>a(c,...l)},s=e.map(c=>c(o));return a=Cd(...s)(i.dispatch),{...i,dispatch:a}}}function CG(e){return z1(e)&&"type"in e&&typeof e.type=="string"}var gS=Symbol.for("immer-nothing"),mS=Symbol.for("immer-draftable"),pn=Symbol.for("immer-state");function Zn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var _s=Object.getPrototypeOf;function Gi(e){return!!e&&!!e[pn]}function Zr(e){var t;return e?bS(e)||Array.isArray(e)||!!e[mS]||!!((t=e.constructor)!=null&&t[mS])||Td(e)||Id(e):!1}var kG=Object.prototype.constructor.toString();function bS(e){if(!e||typeof e!="object")return!1;const t=_s(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===kG}function Jl(e,t){kd(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function kd(e){const t=e[pn];return t?t.type_:Array.isArray(e)?1:Td(e)?2:Id(e)?3:0}function $1(e,t){return kd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function yS(e,t,n){const r=kd(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function TG(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Td(e){return e instanceof Map}function Id(e){return e instanceof Set}function oo(e){return e.copy_||e.base_}function H1(e,t){if(Td(e))return new Map(e);if(Id(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&bS(e))return _s(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[pn];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const a=r[i],o=n[a];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(_s(e),n)}function G1(e,t=!1){return Rd(e)||Gi(e)||!Zr(e)||(kd(e)>1&&(e.set=e.add=e.clear=e.delete=IG),Object.freeze(e),t&&Jl(e,(n,r)=>G1(r,!0))),e}function IG(){Zn(2)}function Rd(e){return Object.isFrozen(e)}var RG={};function so(e){const t=RG[e];return t||Zn(0,e),t}var eu;function vS(){return eu}function DG(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wS(e,t){t&&(so("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function V1(e){j1(e),e.drafts_.forEach(BG),e.drafts_=null}function j1(e){e===eu&&(eu=e.parent_)}function xS(e){return eu=DG(eu,e)}function BG(e){const t=e[pn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function AS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[pn].modified_&&(V1(t),Zn(4)),Zr(e)&&(e=Dd(t,e),t.parent_||Bd(t,e)),t.patches_&&so("Patches").generateReplacementPatches_(n[pn].base_,e,t.patches_,t.inversePatches_)):e=Dd(t,n,[]),V1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gS?e:void 0}function Dd(e,t,n){if(Rd(t))return t;const r=t[pn];if(!r)return Jl(t,(i,a)=>ES(e,r,t,i,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Bd(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let a=i,o=!1;r.type_===3&&(a=new Set(i),i.clear(),o=!0),Jl(a,(s,c)=>ES(e,r,i,s,c,n,o)),Bd(e,i,!1),n&&e.patches_&&so("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ES(e,t,n,r,i,a,o){if(Gi(i)){const s=a&&t&&t.type_!==3&&!$1(t.assigned_,r)?a.concat(r):void 0,c=Dd(e,i,s);if(yS(n,r,c),Gi(c))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Zr(i)&&!Rd(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Dd(e,i),(!t||!t.scope_.parent_)&&Bd(e,i)}}function Bd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&G1(t,n)}function FG(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:vS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=q1;n&&(i=[r],a=tu);const{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var q1={get(e,t){if(t===pn)return e;const n=oo(e);if(!$1(n,t))return PG(e,n,t);const r=n[t];return e.finalized_||!Zr(r)?r:r===W1(e.base_,t)?(Z1(e),e.copy_[t]=Q1(r,e)):r},has(e,t){return t in oo(e)},ownKeys(e){return Reflect.ownKeys(oo(e))},set(e,t,n){const r=SS(oo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=W1(oo(e),t),a=i==null?void 0:i[pn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(TG(n,i)&&(n!==void 0||$1(e.base_,t)))return!0;Z1(e),Y1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return W1(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Z1(e),Y1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=oo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Zn(11)},getPrototypeOf(e){return _s(e.base_)},setPrototypeOf(){Zn(12)}},tu={};Jl(q1,(e,t)=>{tu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),tu.deleteProperty=function(e,t){return tu.set.call(this,e,t,void 0)},tu.set=function(e,t,n){return q1.set.call(this,e[0],t,n,e[0])};function W1(e,t){const n=e[pn];return(n?oo(n):e)[t]}function PG(e,t,n){var i;const r=SS(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function SS(e,t){if(!(t in e))return;let n=_s(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=_s(n)}}function Y1(e){e.modified_||(e.modified_=!0,e.parent_&&Y1(e.parent_))}function Z1(e){e.copy_||(e.copy_=H1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var MG=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(c=a,...l){return o.produce(c,u=>n.call(this,u,...l))}}typeof n!="function"&&Zn(6),r!==void 0&&typeof r!="function"&&Zn(7);let i;if(Zr(t)){const a=xS(this),o=Q1(t,void 0);let s=!0;try{i=n(o),s=!1}finally{s?V1(a):j1(a)}return wS(a,r),AS(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===gS&&(i=void 0),this.autoFreeze_&&G1(i,!0),r){const a=[],o=[];so("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Zn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,c=>t(c,...s));let r,i;return[this.produce(t,n,(o,s)=>{r=o,i=s}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Zr(e)||Zn(8),Gi(e)&&(e=_S(e));const t=xS(this),n=Q1(e,void 0);return n[pn].isManual_=!0,j1(t),n}finishDraft(e,t){const n=e&&e[pn];(!n||!n.isManual_)&&Zn(9);const{scope_:r}=n;return wS(r,t),AS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=so("Patches").applyPatches_;return Gi(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Q1(e,t){const n=Td(e)?so("MapSet").proxyMap_(e,t):Id(e)?so("MapSet").proxySet_(e,t):FG(e,t);return(t?t.scope_:vS()).drafts_.push(n),n}function _S(e){return Gi(e)||Zn(10,e),CS(e)}function CS(e){if(!Zr(e)||Rd(e))return e;const t=e[pn];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=H1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=H1(e,!0);return Jl(n,(r,i)=>{yS(n,r,CS(i))}),t&&(t.finalized_=!1),n}var gn=new MG,kS=gn.produce;gn.produceWithPatches.bind(gn),gn.setAutoFreeze.bind(gn),gn.setUseStrictShallowCopy.bind(gn),gn.applyPatches.bind(gn),gn.createDraft.bind(gn),gn.finishDraft.bind(gn);function OG(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function LG(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var TS=e=>Array.isArray(e)?e:[e];function NG(e){const t=Array.isArray(e[0])?e[0]:e;return LG(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function zG(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var UG=class{constructor(e){this.value=e}deref(){return this.value}},$G=WeakRef??UG,HG=0,IS=1;function Fd(){return{s:HG,v:void 0,o:null,p:null}}function X1(e,t={}){let n=Fd();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let s=n;const{length:c}=arguments;for(let f=0,h=c;f<h;f++){const d=arguments[f];if(typeof d=="function"||typeof d=="object"&&d!==null){let p=s.o;p===null&&(s.o=p=new WeakMap);const g=p.get(d);g===void 0?(s=Fd(),p.set(d,s)):s=g}else{let p=s.p;p===null&&(s.p=p=new Map);const g=p.get(d);g===void 0?(s=Fd(),p.set(d,s)):s=g}}const l=s;let u;if(s.s===IS?u=s.v:(u=e.apply(null,arguments),a++),l.s=IS,r){const f=(i==null?void 0:i.deref())??i;f!=null&&r(f,u)&&(u=f,a!==0&&a--),i=typeof u=="object"&&u!==null||typeof u=="function"?new $G(u):u}return l.v=u,u}return o.clearCache=()=>{n=Fd(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function RS(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e;return(...i)=>{let a=0,o=0,s,c={},l=i.pop();typeof l=="object"&&(c=l,l=i.pop()),OG(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:h=[],argsMemoize:d=X1,argsMemoizeOptions:p=[],devModeChecks:g={}}=u,b=TS(h),v=TS(p),x=NG(i),A=f(function(){return a++,l.apply(null,arguments)},...b),w=d(function(){o++;const C=zG(x,arguments);return s=A.apply(null,C),s},...v);return Object.assign(w,{resultFunc:l,memoizedResultFunc:A,dependencies:x,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:d})}}var GG=RS(X1);function DS(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var VG=DS(),jG=DS,qG=(...e)=>{const t=RS(...e);return(...n)=>{const r=t(...n),i=(a,...o)=>r(Gi(a)?_S(a):a,...o);return Object.assign(i,r),i}};qG(X1);var WG=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cd:Cd.apply(null,arguments)};function nu(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Qn(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>CG(r)&&r.type===e,n}var BS=class If extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,If.prototype)}static get[Symbol.species](){return If}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new If(...t[0].concat(this)):new If(...t.concat(this))}};function FS(e){return Zr(e)?kS(e,()=>{}):e}function PS(e,t,n){if(e.has(t)){let i=e.get(t);return n.update&&(i=n.update(i,t,e),e.set(t,i)),i}if(!n.insert)throw new Error(Qn(10));const r=n.insert(t,e);return e.set(t,r),r}function YG(e){return typeof e=="boolean"}var ZG=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new BS;return n&&(YG(n)?o.push(VG):o.push(jG(n.extraArgument))),o},QG="RTK_autoBatch",MS=e=>t=>{setTimeout(t,e)},XG=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:MS(10),KG=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?XG:e.type==="callback"?e.queueNotification:MS(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const f=()=>i&&u(),h=r.subscribe(f);return s.add(u),()=>{h(),s.delete(u)}},dispatch(u){var f;try{return i=!((f=u==null?void 0:u.meta)!=null&&f[QG]),a=!i,a&&(o||(o=!0,c(l))),r.dispatch(u)}finally{i=!0}}})},JG=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new BS(e);return r&&i.push(KG(typeof r=="object"?r:void 0)),i},eV=!0;function tV(e){const t=ZG(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let s;if(typeof n=="function")s=n;else if(z1(n))s=U1(n);else throw new Error(Qn(1));let c;typeof r=="function"?c=r(t):c=t();let l=Cd;i&&(l=WG({trace:!eV,...typeof i=="object"&&i}));const u=_G(...c),f=JG(u);let h=typeof o=="function"?o(f):f();const d=l(...h);return pS(s,a,d)}function OS(e){const t={},n=[];let r;const i={addCase(a,o){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(Qn(28));if(s in t)throw new Error(Qn(29));return t[s]=o,i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function nV(e){return typeof e=="function"}function rV(e,t){let[n,r,i]=OS(t),a;if(nV(e))a=()=>FS(e());else{const s=FS(e);a=()=>s}function o(s=a(),c){let l=[n[c.type],...r.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[i]),l.reduce((u,f)=>{if(f)if(Gi(u)){const d=f(u,c);return d===void 0?u:d}else{if(Zr(u))return kS(u,h=>f(h,c));{const h=f(u,c);if(h===void 0){if(u===null)return u;throw new Error(Qn(9))}return h}}return u},s)}return o.getInitialState=a,o}var iV=Symbol.for("rtk-slice-createasyncthunk");function aV(e,t){return`${e}/${t}`}function oV({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[iV];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Qn(11));typeof process<"u";const s=(typeof i.reducers=="function"?i.reducers(cV()):i.reducers)||{},c=Object.keys(s),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(b,v){const x=typeof b=="string"?b:b.type;if(!x)throw new Error(Qn(12));if(x in l.sliceCaseReducersByType)throw new Error(Qn(13));return l.sliceCaseReducersByType[x]=v,u},addMatcher(b,v){return l.sliceMatchers.push({matcher:b,reducer:v}),u},exposeAction(b,v){return l.actionCreators[b]=v,u},exposeCaseReducer(b,v){return l.sliceCaseReducersByName[b]=v,u}};c.forEach(b=>{const v=s[b],x={reducerName:b,type:aV(a,b),createNotation:typeof i.reducers=="function"};uV(v)?hV(x,v,u,t):lV(x,v,u)});function f(){const[b={},v=[],x=void 0]=typeof i.extraReducers=="function"?OS(i.extraReducers):[i.extraReducers],A={...b,...l.sliceCaseReducersByType};return rV(i.initialState,w=>{for(let _ in A)w.addCase(_,A[_]);for(let _ of l.sliceMatchers)w.addMatcher(_.matcher,_.reducer);for(let _ of v)w.addMatcher(_.matcher,_.reducer);x&&w.addDefaultCase(x)})}const h=b=>b,d=new WeakMap;let p;const g={name:a,reducerPath:o,reducer(b,v){return p||(p=f()),p(b,v)},actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState(){return p||(p=f()),p.getInitialState()},getSelectors(b=h){const v=PS(d,this,{insert:()=>new WeakMap});return PS(v,b,{insert:()=>{const x={};for(const[A,w]of Object.entries(i.selectors??{}))x[A]=sV(this,w,b,this!==g);return x}})},selectSlice(b){let v=b[this.reducerPath];return typeof v>"u"&&this!==g&&(v=this.getInitialState()),v},get selectors(){return this.getSelectors(this.selectSlice)},injectInto(b,{reducerPath:v,...x}={}){const A=v??this.reducerPath;return b.inject({reducerPath:A,reducer:this.reducer},x),{...this,reducerPath:A}}};return g}}function sV(e,t,n,r){function i(a,...o){let s=n.call(e,a);return typeof s>"u"&&r&&(s=e.getInitialState()),t(s,...o)}return i.unwrapped=t,i}var LS=oV();function cV(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function lV({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!fV(r))throw new Error(Qn(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?nu(e,o):nu(e))}function uV(e){return e._reducerDefinitionType==="asyncThunk"}function fV(e){return e._reducerDefinitionType==="reducerWithPrepare"}function hV({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Qn(18));const{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,f=i(e,a,u);r.exposeAction(t,f),o&&r.addCase(f.fulfilled,o),s&&r.addCase(f.pending,s),c&&r.addCase(f.rejected,c),l&&r.addMatcher(f.settled,l),r.exposeCaseReducer(t,{fulfilled:o||Pd,pending:s||Pd,rejected:c||Pd,settled:l||Pd})}function Pd(){}var K1="listenerMiddleware";nu(`${K1}/add`),nu(`${K1}/removeAll`),nu(`${K1}/remove`);function Qn(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function dV(e,t){var n=e+"",r=t+"";return n<r?-1:n==r?0:1}var pV=[].forEach;function gV(e,t,n){if(typeof t!="function")throw new TypeError(t+" is not a function");var r,i=[],a=[],o=[];pV.call(e,function(c,l,u){if(r=t(c,l,u),r===void 0)return void o.push(c);if(n===void 0&&typeof r=="symbol")throw new TypeError("Can't convert symbol to string");i.push(l),a[l]=r}),n===void 0&&(n=dV),i.sort(function(c,l){return n(a[c],a[l])});var s=i.map(function(c){return e[c]}).concat(o);return s.length!=e.length&&(s.length=e.length),s}function mV(e,t){const n=i=>i.copy().range(mi(0,i.domain().length)).unknown(-1);let r;switch(t.type){case"quantitative":r=i=>ft(i)&&!isNaN(i)?-i:-1/0;break;case"ordinal":r=n(t.scale);break;case"nominal":r=i=>i||"";break}return i=>r(e(i))}function bV(e,t){const n=new Set,r=i=>{const a=n.has(i);return n.add(i),a};return e.filter(i=>!r(t(i)))}function yV(e,t,n){const r=new Set,i=a=>(r.size<n&&r.add(a),r.has(a));return e.filter(a=>i(t(a)))}function vV(e,t,n=!1){return gV(e,t,(r,i)=>(n&&([r,i]=[i,r]),r<i?-1:r>i?1:0))}const wV={lt:(e,t)=>e<t,lte:(e,t)=>e<=t,eq:(e,t)=>e==t,gte:(e,t)=>e>=t,gt:(e,t)=>e>t};function xV(e,t,n,r){const i=wV[n];return e.filter(a=>i(t(a),r))}function NS(e,t,n,r){const i=new Set(r),a=s=>i.has(s),o=n=="remove"?s=>!a(s):a;return e.filter(s=>o(t(s)))}function AV(e,t){const n=r=>r!=null;return e.filter(r=>n(t(r)))}/**
|
2613
|
+
${c()}`,a.content)}g(),(b=a.content.querySelector("input[type='text']"))==null||b.focus()}const xG={lt:["<","less than"],lte:["≤","less than or equal to"],eq:["=","equal to"],gte:["≥","greater than or equal to"],gt:[">","greater than"]};function hS(e,t,n){const r=e.accessor;return t.map(i=>r(i,n))}function Ft(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var AG=(()=>typeof Symbol=="function"&&Symbol.observable||"@@observable")(),dS=AG,N1=()=>Math.random().toString(36).substring(7).split("").join("."),EG={INIT:`@@redux/INIT${N1()}`,REPLACE:`@@redux/REPLACE${N1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${N1()}`},_d=EG;function z1(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function pS(e,t,n){if(typeof e!="function")throw new Error(Ft(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ft(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ft(1));return n(pS)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((b,v)=>{o.set(v,b)}))}function u(){if(c)throw new Error(Ft(3));return i}function f(b){if(typeof b!="function")throw new Error(Ft(4));if(c)throw new Error(Ft(5));let v=!0;l();const x=s++;return o.set(x,b),function(){if(v){if(c)throw new Error(Ft(6));v=!1,l(),o.delete(x),a=null}}}function h(b){if(!z1(b))throw new Error(Ft(7));if(typeof b.type>"u")throw new Error(Ft(8));if(typeof b.type!="string")throw new Error(Ft(17));if(c)throw new Error(Ft(9));try{c=!0,i=r(i,b)}finally{c=!1}return(a=o).forEach(x=>{x()}),b}function d(b){if(typeof b!="function")throw new Error(Ft(10));r=b,h({type:_d.REPLACE})}function p(){const b=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Ft(11));function x(){const w=v;w.next&&w.next(u())}return x(),{unsubscribe:b(x)}},[dS](){return this}}}return h({type:_d.INIT}),{dispatch:h,subscribe:f,getState:u,replaceReducer:d,[dS]:p}}function SG(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:_d.INIT})>"u")throw new Error(Ft(12));if(typeof n(void 0,{type:_d.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ft(13))})}function U1(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{SG(n)}catch(a){i=a}return function(o={},s){if(i)throw i;let c=!1;const l={};for(let u=0;u<r.length;u++){const f=r[u],h=n[f],d=o[f],p=h(d,s);if(typeof p>"u")throw s&&s.type,new Error(Ft(14));l[f]=p,c=c||p!==d}return c=c||r.length!==Object.keys(o).length,c?l:o}}function Cd(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function _G(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Ft(15))};const o={getState:i.getState,dispatch:(c,...l)=>a(c,...l)},s=e.map(c=>c(o));return a=Cd(...s)(i.dispatch),{...i,dispatch:a}}}function CG(e){return z1(e)&&"type"in e&&typeof e.type=="string"}var gS=Symbol.for("immer-nothing"),mS=Symbol.for("immer-draftable"),pn=Symbol.for("immer-state");function Zn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var _s=Object.getPrototypeOf;function Vi(e){return!!e&&!!e[pn]}function Zr(e){var t;return e?bS(e)||Array.isArray(e)||!!e[mS]||!!((t=e.constructor)!=null&&t[mS])||Td(e)||Id(e):!1}var kG=Object.prototype.constructor.toString();function bS(e){if(!e||typeof e!="object")return!1;const t=_s(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===kG}function Jl(e,t){kd(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function kd(e){const t=e[pn];return t?t.type_:Array.isArray(e)?1:Td(e)?2:Id(e)?3:0}function $1(e,t){return kd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function yS(e,t,n){const r=kd(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function TG(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Td(e){return e instanceof Map}function Id(e){return e instanceof Set}function oo(e){return e.copy_||e.base_}function H1(e,t){if(Td(e))return new Map(e);if(Id(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&bS(e))return _s(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[pn];let r=Reflect.ownKeys(n);for(let i=0;i<r.length;i++){const a=r[i],o=n[a];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(n[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(_s(e),n)}function G1(e,t=!1){return Rd(e)||Vi(e)||!Zr(e)||(kd(e)>1&&(e.set=e.add=e.clear=e.delete=IG),Object.freeze(e),t&&Jl(e,(n,r)=>G1(r,!0))),e}function IG(){Zn(2)}function Rd(e){return Object.isFrozen(e)}var RG={};function so(e){const t=RG[e];return t||Zn(0,e),t}var eu;function vS(){return eu}function DG(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wS(e,t){t&&(so("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function V1(e){j1(e),e.drafts_.forEach(BG),e.drafts_=null}function j1(e){e===eu&&(eu=e.parent_)}function xS(e){return eu=DG(eu,e)}function BG(e){const t=e[pn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function AS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[pn].modified_&&(V1(t),Zn(4)),Zr(e)&&(e=Dd(t,e),t.parent_||Bd(t,e)),t.patches_&&so("Patches").generateReplacementPatches_(n[pn].base_,e,t.patches_,t.inversePatches_)):e=Dd(t,n,[]),V1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gS?e:void 0}function Dd(e,t,n){if(Rd(t))return t;const r=t[pn];if(!r)return Jl(t,(i,a)=>ES(e,r,t,i,a,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Bd(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let a=i,o=!1;r.type_===3&&(a=new Set(i),i.clear(),o=!0),Jl(a,(s,c)=>ES(e,r,i,s,c,n,o)),Bd(e,i,!1),n&&e.patches_&&so("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function ES(e,t,n,r,i,a,o){if(Vi(i)){const s=a&&t&&t.type_!==3&&!$1(t.assigned_,r)?a.concat(r):void 0,c=Dd(e,i,s);if(yS(n,r,c),Vi(c))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Zr(i)&&!Rd(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Dd(e,i),(!t||!t.scope_.parent_)&&Bd(e,i)}}function Bd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&G1(t,n)}function FG(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:vS(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=q1;n&&(i=[r],a=tu);const{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,s}var q1={get(e,t){if(t===pn)return e;const n=oo(e);if(!$1(n,t))return PG(e,n,t);const r=n[t];return e.finalized_||!Zr(r)?r:r===W1(e.base_,t)?(Z1(e),e.copy_[t]=Q1(r,e)):r},has(e,t){return t in oo(e)},ownKeys(e){return Reflect.ownKeys(oo(e))},set(e,t,n){const r=SS(oo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=W1(oo(e),t),a=i==null?void 0:i[pn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(TG(n,i)&&(n!==void 0||$1(e.base_,t)))return!0;Z1(e),Y1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return W1(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Z1(e),Y1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=oo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Zn(11)},getPrototypeOf(e){return _s(e.base_)},setPrototypeOf(){Zn(12)}},tu={};Jl(q1,(e,t)=>{tu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),tu.deleteProperty=function(e,t){return tu.set.call(this,e,t,void 0)},tu.set=function(e,t,n){return q1.set.call(this,e[0],t,n,e[0])};function W1(e,t){const n=e[pn];return(n?oo(n):e)[t]}function PG(e,t,n){var i;const r=SS(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function SS(e,t){if(!(t in e))return;let n=_s(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=_s(n)}}function Y1(e){e.modified_||(e.modified_=!0,e.parent_&&Y1(e.parent_))}function Z1(e){e.copy_||(e.copy_=H1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var MG=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(c=a,...l){return o.produce(c,u=>n.call(this,u,...l))}}typeof n!="function"&&Zn(6),r!==void 0&&typeof r!="function"&&Zn(7);let i;if(Zr(t)){const a=xS(this),o=Q1(t,void 0);let s=!0;try{i=n(o),s=!1}finally{s?V1(a):j1(a)}return wS(a,r),AS(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===gS&&(i=void 0),this.autoFreeze_&&G1(i,!0),r){const a=[],o=[];so("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Zn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...s)=>this.produceWithPatches(o,c=>t(c,...s));let r,i;return[this.produce(t,n,(o,s)=>{r=o,i=s}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Zr(e)||Zn(8),Vi(e)&&(e=_S(e));const t=xS(this),n=Q1(e,void 0);return n[pn].isManual_=!0,j1(t),n}finishDraft(e,t){const n=e&&e[pn];(!n||!n.isManual_)&&Zn(9);const{scope_:r}=n;return wS(r,t),AS(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=so("Patches").applyPatches_;return Vi(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Q1(e,t){const n=Td(e)?so("MapSet").proxyMap_(e,t):Id(e)?so("MapSet").proxySet_(e,t):FG(e,t);return(t?t.scope_:vS()).drafts_.push(n),n}function _S(e){return Vi(e)||Zn(10,e),CS(e)}function CS(e){if(!Zr(e)||Rd(e))return e;const t=e[pn];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=H1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=H1(e,!0);return Jl(n,(r,i)=>{yS(n,r,CS(i))}),t&&(t.finalized_=!1),n}var gn=new MG,kS=gn.produce;gn.produceWithPatches.bind(gn),gn.setAutoFreeze.bind(gn),gn.setUseStrictShallowCopy.bind(gn),gn.applyPatches.bind(gn),gn.createDraft.bind(gn),gn.finishDraft.bind(gn);function OG(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function LG(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var TS=e=>Array.isArray(e)?e:[e];function NG(e){const t=Array.isArray(e[0])?e[0]:e;return LG(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function zG(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var UG=class{constructor(e){this.value=e}deref(){return this.value}},$G=WeakRef??UG,HG=0,IS=1;function Fd(){return{s:HG,v:void 0,o:null,p:null}}function X1(e,t={}){let n=Fd();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let s=n;const{length:c}=arguments;for(let f=0,h=c;f<h;f++){const d=arguments[f];if(typeof d=="function"||typeof d=="object"&&d!==null){let p=s.o;p===null&&(s.o=p=new WeakMap);const g=p.get(d);g===void 0?(s=Fd(),p.set(d,s)):s=g}else{let p=s.p;p===null&&(s.p=p=new Map);const g=p.get(d);g===void 0?(s=Fd(),p.set(d,s)):s=g}}const l=s;let u;if(s.s===IS?u=s.v:(u=e.apply(null,arguments),a++),l.s=IS,r){const f=(i==null?void 0:i.deref())??i;f!=null&&r(f,u)&&(u=f,a!==0&&a--),i=typeof u=="object"&&u!==null||typeof u=="function"?new $G(u):u}return l.v=u,u}return o.clearCache=()=>{n=Fd(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function RS(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e;return(...i)=>{let a=0,o=0,s,c={},l=i.pop();typeof l=="object"&&(c=l,l=i.pop()),OG(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:f,memoizeOptions:h=[],argsMemoize:d=X1,argsMemoizeOptions:p=[],devModeChecks:g={}}=u,b=TS(h),v=TS(p),x=NG(i),A=f(function(){return a++,l.apply(null,arguments)},...b),w=d(function(){o++;const C=zG(x,arguments);return s=A.apply(null,C),s},...v);return Object.assign(w,{resultFunc:l,memoizedResultFunc:A,dependencies:x,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:d})}}var GG=RS(X1);function DS(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var VG=DS(),jG=DS,qG=(...e)=>{const t=RS(...e);return(...n)=>{const r=t(...n),i=(a,...o)=>r(Vi(a)?_S(a):a,...o);return Object.assign(i,r),i}};qG(X1);var WG=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cd:Cd.apply(null,arguments)};function nu(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Qn(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>CG(r)&&r.type===e,n}var BS=class If extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,If.prototype)}static get[Symbol.species](){return If}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new If(...t[0].concat(this)):new If(...t.concat(this))}};function FS(e){return Zr(e)?kS(e,()=>{}):e}function PS(e,t,n){if(e.has(t)){let i=e.get(t);return n.update&&(i=n.update(i,t,e),e.set(t,i)),i}if(!n.insert)throw new Error(Qn(10));const r=n.insert(t,e);return e.set(t,r),r}function YG(e){return typeof e=="boolean"}var ZG=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new BS;return n&&(YG(n)?o.push(VG):o.push(jG(n.extraArgument))),o},QG="RTK_autoBatch",MS=e=>t=>{setTimeout(t,e)},XG=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:MS(10),KG=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?XG:e.type==="callback"?e.queueNotification:MS(e.timeout),l=()=>{o=!1,a&&(a=!1,s.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const f=()=>i&&u(),h=r.subscribe(f);return s.add(u),()=>{h(),s.delete(u)}},dispatch(u){var f;try{return i=!((f=u==null?void 0:u.meta)!=null&&f[QG]),a=!i,a&&(o||(o=!0,c(l))),r.dispatch(u)}finally{i=!0}}})},JG=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new BS(e);return r&&i.push(KG(typeof r=="object"?r:void 0)),i},eV=!0;function tV(e){const t=ZG(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let s;if(typeof n=="function")s=n;else if(z1(n))s=U1(n);else throw new Error(Qn(1));let c;typeof r=="function"?c=r(t):c=t();let l=Cd;i&&(l=WG({trace:!eV,...typeof i=="object"&&i}));const u=_G(...c),f=JG(u);let h=typeof o=="function"?o(f):f();const d=l(...h);return pS(s,a,d)}function OS(e){const t={},n=[];let r;const i={addCase(a,o){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(Qn(28));if(s in t)throw new Error(Qn(29));return t[s]=o,i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function nV(e){return typeof e=="function"}function rV(e,t){let[n,r,i]=OS(t),a;if(nV(e))a=()=>FS(e());else{const s=FS(e);a=()=>s}function o(s=a(),c){let l=[n[c.type],...r.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[i]),l.reduce((u,f)=>{if(f)if(Vi(u)){const d=f(u,c);return d===void 0?u:d}else{if(Zr(u))return kS(u,h=>f(h,c));{const h=f(u,c);if(h===void 0){if(u===null)return u;throw new Error(Qn(9))}return h}}return u},s)}return o.getInitialState=a,o}var iV=Symbol.for("rtk-slice-createasyncthunk");function aV(e,t){return`${e}/${t}`}function oV({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[iV];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Qn(11));typeof process<"u";const s=(typeof i.reducers=="function"?i.reducers(cV()):i.reducers)||{},c=Object.keys(s),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(b,v){const x=typeof b=="string"?b:b.type;if(!x)throw new Error(Qn(12));if(x in l.sliceCaseReducersByType)throw new Error(Qn(13));return l.sliceCaseReducersByType[x]=v,u},addMatcher(b,v){return l.sliceMatchers.push({matcher:b,reducer:v}),u},exposeAction(b,v){return l.actionCreators[b]=v,u},exposeCaseReducer(b,v){return l.sliceCaseReducersByName[b]=v,u}};c.forEach(b=>{const v=s[b],x={reducerName:b,type:aV(a,b),createNotation:typeof i.reducers=="function"};uV(v)?hV(x,v,u,t):lV(x,v,u)});function f(){const[b={},v=[],x=void 0]=typeof i.extraReducers=="function"?OS(i.extraReducers):[i.extraReducers],A={...b,...l.sliceCaseReducersByType};return rV(i.initialState,w=>{for(let _ in A)w.addCase(_,A[_]);for(let _ of l.sliceMatchers)w.addMatcher(_.matcher,_.reducer);for(let _ of v)w.addMatcher(_.matcher,_.reducer);x&&w.addDefaultCase(x)})}const h=b=>b,d=new WeakMap;let p;const g={name:a,reducerPath:o,reducer(b,v){return p||(p=f()),p(b,v)},actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState(){return p||(p=f()),p.getInitialState()},getSelectors(b=h){const v=PS(d,this,{insert:()=>new WeakMap});return PS(v,b,{insert:()=>{const x={};for(const[A,w]of Object.entries(i.selectors??{}))x[A]=sV(this,w,b,this!==g);return x}})},selectSlice(b){let v=b[this.reducerPath];return typeof v>"u"&&this!==g&&(v=this.getInitialState()),v},get selectors(){return this.getSelectors(this.selectSlice)},injectInto(b,{reducerPath:v,...x}={}){const A=v??this.reducerPath;return b.inject({reducerPath:A,reducer:this.reducer},x),{...this,reducerPath:A}}};return g}}function sV(e,t,n,r){function i(a,...o){let s=n.call(e,a);return typeof s>"u"&&r&&(s=e.getInitialState()),t(s,...o)}return i.unwrapped=t,i}var LS=oV();function cV(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function lV({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!fV(r))throw new Error(Qn(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?nu(e,o):nu(e))}function uV(e){return e._reducerDefinitionType==="asyncThunk"}function fV(e){return e._reducerDefinitionType==="reducerWithPrepare"}function hV({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Qn(18));const{payloadCreator:a,fulfilled:o,pending:s,rejected:c,settled:l,options:u}=n,f=i(e,a,u);r.exposeAction(t,f),o&&r.addCase(f.fulfilled,o),s&&r.addCase(f.pending,s),c&&r.addCase(f.rejected,c),l&&r.addMatcher(f.settled,l),r.exposeCaseReducer(t,{fulfilled:o||Pd,pending:s||Pd,rejected:c||Pd,settled:l||Pd})}function Pd(){}var K1="listenerMiddleware";nu(`${K1}/add`),nu(`${K1}/removeAll`),nu(`${K1}/remove`);function Qn(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function dV(e,t){var n=e+"",r=t+"";return n<r?-1:n==r?0:1}var pV=[].forEach;function gV(e,t,n){if(typeof t!="function")throw new TypeError(t+" is not a function");var r,i=[],a=[],o=[];pV.call(e,function(c,l,u){if(r=t(c,l,u),r===void 0)return void o.push(c);if(n===void 0&&typeof r=="symbol")throw new TypeError("Can't convert symbol to string");i.push(l),a[l]=r}),n===void 0&&(n=dV),i.sort(function(c,l){return n(a[c],a[l])});var s=i.map(function(c){return e[c]}).concat(o);return s.length!=e.length&&(s.length=e.length),s}function mV(e,t){const n=i=>i.copy().range(mi(0,i.domain().length)).unknown(-1);let r;switch(t.type){case"quantitative":r=i=>ft(i)&&!isNaN(i)?-i:-1/0;break;case"ordinal":r=n(t.scale);break;case"nominal":r=i=>i||"";break}return i=>r(e(i))}function bV(e,t){const n=new Set,r=i=>{const a=n.has(i);return n.add(i),a};return e.filter(i=>!r(t(i)))}function yV(e,t,n){const r=new Set,i=a=>(r.size<n&&r.add(a),r.has(a));return e.filter(a=>i(t(a)))}function vV(e,t,n=!1){return gV(e,t,(r,i)=>(n&&([r,i]=[i,r]),r<i?-1:r>i?1:0))}const wV={lt:(e,t)=>e<t,lte:(e,t)=>e<=t,eq:(e,t)=>e==t,gte:(e,t)=>e>=t,gt:(e,t)=>e>t};function xV(e,t,n,r){const i=wV[n];return e.filter(a=>i(t(a),r))}function NS(e,t,n,r){const i=new Set(r),a=s=>i.has(s),o=n=="remove"?s=>!a(s):a;return e.filter(s=>o(t(s)))}function AV(e,t){const n=r=>r!=null;return e.filter(r=>n(t(r)))}/**
|
2614
2614
|
* @license
|
2615
2615
|
* Copyright 2021 Google LLC
|
2616
2616
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -2761,7 +2761,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2761
2761
|
`;function l(){Vt($`${a}
|
2762
2762
|
<div class="modal-body">${c}</div>
|
2763
2763
|
${s()}`,i.content)}l(),i.content.querySelector("input").focus()}function ib(e,t,n,r){const i=r.actions,a=t.attribute,o=r.sampleHierarchy,s=r.provenance.storeHelper.getDispatcher(),c=[];e&&c.push({label:e,type:"header"});const l=(h,d,p)=>{const g=r.provenance.getActionInfo(h);return{label:g.title,icon:g.icon,callback:d?void 0:p??(()=>s(h))}},u=(...h)=>c.push(...h.map(d=>l(d)));u(i.sortBy({attribute:a}));const f=(t==null?void 0:t.type)??"identifier";return f!="quantitative"?(f!="identifier"&&(u(i.groupByNominal({attribute:a}),i.retainFirstOfEach({attribute:a})),c.push(l(i.retainFirstNCategories({attribute:a,n:void 0}),!1,()=>MV(t,r)))),u(i.filterByNominal({attribute:a,values:[n]}),i.filterByNominal({attribute:a,remove:!0,values:[n]})),f!="identifier"&&c.push(l(i.retainMatched({attribute:a}),!o.groupMetadata.length))):(u(i.groupToQuartiles({attribute:a})),c.push({icon:Ul,label:"Group by thresholds...",callback:()=>BV(t,r)}),OV(n)?u(i.filterByQuantitative({attribute:a,operator:"gte",operand:+n}),i.filterByQuantitative({attribute:a,operator:"lte",operand:+n})):u(i.removeUndefined({attribute:a}))),c.push({icon:Ja,label:"Advanced filter...",callback:()=>bG(t,r)}),c}function OV(e){return e!=null&&e!==""&&!(typeof e=="number"&&isNaN(e))}const En={UNDO:"@@redux-undo/UNDO",REDO:"@@redux-undo/REDO",JUMP_TO_FUTURE:"@@redux-undo/JUMP_TO_FUTURE",JUMP_TO_PAST:"@@redux-undo/JUMP_TO_PAST",JUMP:"@@redux-undo/JUMP",CLEAR_HISTORY:"@@redux-undo/CLEAR_HISTORY"},lo={undo(){return{type:En.UNDO}},redo(){return{type:En.REDO}},jumpToFuture(e){return{type:En.JUMP_TO_FUTURE,index:e}},jumpToPast(e){return{type:En.JUMP_TO_PAST,index:e}},jump(e){return{type:En.JUMP,index:e}},clearHistory(){return{type:En.CLEAR_HISTORY}}};function o_(e,t=[]){return Array.isArray(e)?e:typeof e=="string"?[e]:t}function LV(e){return typeof e.present<"u"&&typeof e.future<"u"&&typeof e.past<"u"&&Array.isArray(e.future)&&Array.isArray(e.past)}function uo(e,t,n,r=null){return{past:e,present:t,future:n,group:r,_latestUnfiltered:t,index:e.length,limit:e.length+n.length+1}}let Od,Sn;const ab={prevState:"#9E9E9E",action:"#03A9F4",nextState:"#4CAF50"};function NV(){Sn={header:[],prev:[],action:[],next:[],msgs:[]}}function zV(){const{header:e,prev:t,next:n,action:r,msgs:i}=Sn;console.group?(console.groupCollapsed(...e),console.log(...t),console.log(...r),console.log(...n),console.log(...i),console.groupEnd()):(console.log(...e),console.log(...t),console.log(...r),console.log(...n),console.log(...i))}function ob(e,t,n){return[`%c${e}`,`color: ${t}; font-weight: bold`,n]}function UV(e,t){NV(),Od&&(console.group?(Sn.header=["%credux-undo","font-style: italic","action",e.type],Sn.action=ob("action",ab.action,e),Sn.prev=ob("prev history",ab.prevState,t)):(Sn.header=["redux-undo action",e.type],Sn.action=["action",e],Sn.prev=["prev history",t]))}function Xn(e){Od&&(console.group?Sn.next=ob("next history",ab.nextState,e):Sn.next=["next history",e],zV())}function $t(...e){Od&&(Sn.msgs=Sn.msgs.concat([...e,`
|
2764
|
-
`]))}function $V(e){Od=e}function sb(e,t){const n=uo([],e,[]);return t&&(n._latestUnfiltered=null),n}function HV(e,t,n,r){const i=e.past.length+1;$t("inserting",t),$t("new free: ",n-i);const{past:a,_latestUnfiltered:o}=e,s=n&&n<=i,c=a.slice(s?1:0),l=o!=null?[...c,o]:c;return uo(l,t,[],r)}function s_(e,t){if(t<0||t>=e.future.length)return e;const{past:n,future:r,_latestUnfiltered:i}=e,a=[...n,i,...r.slice(0,t)],o=r[t],s=r.slice(t+1);return uo(a,o,s)}function c_(e,t){if(t<0||t>=e.past.length)return e;const{past:n,future:r,_latestUnfiltered:i}=e,a=n.slice(0,t),o=[...n.slice(t+1),i,...r],s=n[t];return uo(a,s,o)}function cb(e,t){return t>0?s_(e,t-1):t<0?c_(e,e.past.length+t):e}function GV(e,t){return t.indexOf(e)>-1?e:!e}function VV(e,t={}){$V(t.debug);const n={limit:void 0,filter:()=>!0,groupBy:()=>null,undoType:En.UNDO,redoType:En.REDO,jumpToPastType:En.JUMP_TO_PAST,jumpToFutureType:En.JUMP_TO_FUTURE,jumpType:En.JUMP,neverSkipReducer:!1,ignoreInitialState:!1,syncFilter:!1,...t,initTypes:o_(t.initTypes,["@@redux-undo/INIT"]),clearHistoryType:o_(t.clearHistoryType,[En.CLEAR_HISTORY])},r=n.neverSkipReducer?(a,o,...s)=>({...a,present:e(a.present,o,...s)}):a=>a;let i;return(a=i,o={},...s)=>{UV(o,a);let c=a;if(!i)if($t("history is uninitialized"),a===void 0){const u=e(a,{type:"@@redux-undo/CREATE_HISTORY"},...s);return c=sb(u,n.ignoreInitialState),$t("do not set initialState on probe actions"),Xn(c),c}else LV(a)?(c=i=n.ignoreInitialState?a:uo(a.past,a.present,a.future),$t("initialHistory initialized: initialState is a history",i)):(c=i=sb(a,n.ignoreInitialState),$t("initialHistory initialized: initialState is not a history",i));let l;switch(o.type){case void 0:return c;case n.undoType:return l=cb(c,-1),$t("perform undo"),Xn(l),r(l,o,...s);case n.redoType:return l=cb(c,1),$t("perform redo"),Xn(l),r(l,o,...s);case n.jumpToPastType:return l=c_(c,o.index),$t(`perform jumpToPast to ${o.index}`),Xn(l),r(l,o,...s);case n.jumpToFutureType:return l=s_(c,o.index),$t(`perform jumpToFuture to ${o.index}`),Xn(l),r(l,o,...s);case n.jumpType:return l=cb(c,o.index),$t(`perform jump to ${o.index}`),Xn(l),r(l,o,...s);case GV(o.type,n.clearHistoryType):return l=sb(c.present,n.ignoreInitialState),$t("perform clearHistory"),Xn(l),r(l,o,...s);default:if(l=e(c.present,o,...s),n.initTypes.some(f=>f===o.type))return $t("reset history due to init action"),Xn(i),i;if(c._latestUnfiltered===l)return c;if(typeof n.filter=="function"&&!n.filter(o,l,c)){const f=uo(c.past,l,c.future,c.group);return n.syncFilter||(f._latestUnfiltered=c._latestUnfiltered),$t("filter ignored action, not storing it in past"),Xn(f),f}const u=n.groupBy(o,l,c);if(u!=null&&u===c.group){const f=uo(c.past,l,c.future,c.group);return $t("groupBy grouped the action with the previous action"),Xn(f),f}return c=HV(c,l,n.limit,u),$t("inserted new state into history"),Xn(c),c}}}function Ld(e){return e.split("-")[0]}function lb(e){return e.split("-")[1]}function ub(e){return["top","bottom"].includes(Ld(e))?"x":"y"}function l_(e){return e==="y"?"height":"width"}function u_(e,t,n){let{reference:r,floating:i}=e;const a=r.x+r.width/2-i.width/2,o=r.y+r.height/2-i.height/2,s=ub(t),c=l_(s),l=r[c]/2-i[c]/2,u=s==="x";let f;switch(Ld(t)){case"top":f={x:a,y:r.y-i.height};break;case"bottom":f={x:a,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:o};break;case"left":f={x:r.x-i.width,y:o};break;default:f={x:r.x,y:r.y}}switch(lb(t)){case"start":f[s]-=l*(n&&u?-1:1);break;case"end":f[s]+=l*(n&&u?-1:1)}return f}const jV=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:u}=u_(c,r,s),f=r,h={};for(let d=0;d<a.length;d++){const{name:p,fn:g}=a[d],{x:b,y:v,data:x,reset:A}=await g({x:l,y:u,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:c,platform:o,elements:{reference:e,floating:t}});l=b??l,u=v??u,h={...h,[p]:{...h[p],...x}},A&&(typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(c=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:l,y:u}=u_(c,f,s)),d=-1)}return{x:l,y:u,placement:f,strategy:i,middlewareData:h}};function qV(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function Nd(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function WV(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=t,p=qV(d),g=s[h?f==="floating"?"reference":"floating":f],b=Nd(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))==null||n?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v=Nd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...o.floating,x:r,y:i}:o.reference,offsetParent:await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),strategy:c}):o[f]);return{top:b.top-v.top+p.top,bottom:v.bottom-b.bottom+p.bottom,left:b.left-v.left+p.left,right:v.right-b.right+p.right}}const YV={left:"right",right:"left",bottom:"top",top:"bottom"};function zd(e){return e.replace(/left|right|bottom|top/g,t=>YV[t])}function ZV(e,t,n){n===void 0&&(n=!1);const r=lb(e),i=ub(e),a=l_(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=zd(o)),{main:o,cross:zd(o)}}const QV={start:"end",end:"start"};function f_(e){return e.replace(/start|end/g,t=>QV[t])}["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const h_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",flipAlignment:d=!0,...p}=e,g=Ld(r),b=f||(g===o||!d?[zd(o)]:function(D){const B=zd(D);return[f_(D),B,f_(B)]}(o)),v=[o,...b],x=await WV(t,p),A=[];let w=((n=i.flip)==null?void 0:n.overflows)||[];if(l&&A.push(x[g]),u){const{main:D,cross:B}=ZV(r,a,await(s.isRTL==null?void 0:s.isRTL(c.floating)));A.push(x[D],x[B])}if(w=[...w,{placement:r,overflows:A}],!A.every(D=>D<=0)){var _,C;const D=((_=(C=i.flip)==null?void 0:C.index)!=null?_:0)+1,B=v[D];if(B)return{data:{index:D,overflows:w},reset:{placement:B}};let G="bottom";switch(h){case"bestFit":{var I;const z=(I=w.map(ae=>[ae,ae.overflows.filter(se=>se>0).reduce((se,ve)=>se+ve,0)]).sort((ae,se)=>ae[1]-se[1])[0])==null?void 0:I[0].placement;z&&(G=z);break}case"initialPlacement":G=o}if(r!==G)return{reset:{placement:G}}}return{}}}},XV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(a,o){const{placement:s,platform:c,elements:l}=a,u=await(c.isRTL==null?void 0:c.isRTL(l.floating)),f=Ld(s),h=lb(s),d=ub(s)==="x",p=["left","top"].includes(f)?-1:1,g=u&&d?-1:1,b=typeof o=="function"?o(a):o;let{mainAxis:v,crossAxis:x,alignmentAxis:A}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...b};return h&&typeof A=="number"&&(x=h==="end"?-1*A:A),d?{x:x*g,y:v*p}:{x:v*p,y:x*g}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function d_(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Qr(e){if(e==null)return window;if(!d_(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function ru(e){return Qr(e).getComputedStyle(e)}function Xr(e){return d_(e)?"":e?(e.nodeName||"").toLowerCase():""}function p_(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function vr(e){return e instanceof Qr(e).HTMLElement}function ks(e){return e instanceof Qr(e).Element}function fb(e){return typeof ShadowRoot>"u"?!1:e instanceof Qr(e).ShadowRoot||e instanceof ShadowRoot}function Ud(e){const{overflow:t,overflowX:n,overflowY:r}=ru(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function KV(e){return["table","td","th"].includes(Xr(e))}function g_(e){const t=/firefox/i.test(p_()),n=ru(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function m_(){return!/^((?!chrome|android).)*safari/i.test(p_())}const b_=Math.min,iu=Math.max,$d=Math.round;function fo(e,t,n){var r,i,a,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let c=1,l=1;t&&vr(e)&&(c=e.offsetWidth>0&&$d(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&$d(s.height)/e.offsetHeight||1);const u=ks(e)?Qr(e):window,f=!m_()&&n,h=(s.left+(f&&(r=(i=u.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/c,d=(s.top+(f&&(a=(o=u.visualViewport)==null?void 0:o.offsetTop)!=null?a:0))/l,p=s.width/c,g=s.height/l;return{width:p,height:g,top:d,right:h+p,bottom:d+g,left:h,x:h,y:d}}function Vi(e){return(t=e,(t instanceof Qr(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function Hd(e){return ks(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function y_(e){return fo(Vi(e)).left+Hd(e).scrollLeft}function JV(e,t,n){const r=vr(t),i=Vi(t),a=fo(e,r&&function(c){const l=fo(c);return $d(l.width)!==c.offsetWidth||$d(l.height)!==c.offsetHeight}(t),n==="fixed");let o={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Xr(t)!=="body"||Ud(i))&&(o=Hd(t)),vr(t)){const c=fo(t,!0);s.x=c.x+t.clientLeft,s.y=c.y+t.clientTop}else i&&(s.x=y_(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}function v_(e){return Xr(e)==="html"?e:e.assignedSlot||e.parentNode||(fb(e)?e.host:null)||Vi(e)}function w_(e){return vr(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function hb(e){const t=Qr(e);let n=w_(e);for(;n&&KV(n)&&getComputedStyle(n).position==="static";)n=w_(n);return n&&(Xr(n)==="html"||Xr(n)==="body"&&getComputedStyle(n).position==="static"&&!g_(n))?t:n||function(r){let i=v_(r);for(fb(i)&&(i=i.host);vr(i)&&!["html","body"].includes(Xr(i));){if(g_(i))return i;i=i.parentNode}return null}(e)||t}function x_(e){if(vr(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=fo(e);return{width:t.width,height:t.height}}function A_(e){const t=v_(e);return["html","body","#document"].includes(Xr(t))?e.ownerDocument.body:vr(t)&&Ud(t)?t:A_(t)}function E_(e,t){var n;t===void 0&&(t=[]);const r=A_(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=Qr(r),o=i?[a].concat(a.visualViewport||[],Ud(r)?r:[]):r,s=t.concat(o);return i?s:s.concat(E_(o))}function S_(e,t,n){return t==="viewport"?Nd(function(r,i){const a=Qr(r),o=Vi(r),s=a.visualViewport;let c=o.clientWidth,l=o.clientHeight,u=0,f=0;if(s){c=s.width,l=s.height;const h=m_();(h||!h&&i==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}return{width:c,height:l,x:u,y:f}}(e,n)):ks(t)?function(r,i){const a=fo(r,!1,i==="fixed"),o=a.top+r.clientTop,s=a.left+r.clientLeft;return{top:o,left:s,x:s,y:o,right:s+r.clientWidth,bottom:o+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):Nd(function(r){var i;const a=Vi(r),o=Hd(r),s=(i=r.ownerDocument)==null?void 0:i.body,c=iu(a.scrollWidth,a.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),l=iu(a.scrollHeight,a.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let u=-o.scrollLeft+y_(r);const f=-o.scrollTop;return ru(s||a).direction==="rtl"&&(u+=iu(a.clientWidth,s?s.clientWidth:0)-c),{width:c,height:l,x:u,y:f}}(Vi(e)))}function ej(e){const t=E_(e),n=["absolute","fixed"].includes(ru(e).position)&&vr(e)?hb(e):e;return ks(n)?t.filter(r=>ks(r)&&function(i,a){const o=a==null||a.getRootNode==null?void 0:a.getRootNode();if(i!=null&&i.contains(a))return!0;if(o&&fb(o)){let s=a;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Xr(r)!=="body"):[]}const tj={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ej(t):[].concat(n),r],o=a[0],s=a.reduce((c,l)=>{const u=S_(t,l,i);return c.top=iu(u.top,c.top),c.right=b_(u.right,c.right),c.bottom=b_(u.bottom,c.bottom),c.left=iu(u.left,c.left),c},S_(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=vr(n),a=Vi(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Xr(n)!=="body"||Ud(a))&&(o=Hd(n)),vr(n))){const c=fo(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return{...t,x:t.x-o.scrollLeft+s.x,y:t.y-o.scrollTop+s.y}},isElement:ks,getDimensions:x_,getOffsetParent:hb,getDocumentElement:Vi,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:JV(t,hb(n),r),floating:{...x_(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ru(e).direction==="rtl"},nj=(e,t,n)=>jV(e,t,{platform:tj,...n});let wr;const au=[],db=bs(e=>e(),150,!1),pb={type:"divider"};function ou(e){if((e==null?void 0:e.type)=="contextmenu"){e.preventDefault();return}wr&&(wr.remove(),wr=void 0,document.body.classList.remove(Da))}function __(e){var t;if(!(e<1)){for(let n=e;n<au.length;n++)(t=au[n])==null||t.remove(),au[n]=void 0;for(const n of au[e-1].querySelectorAll("li.active"))n.classList.remove("active")}}const rj=()=>$`<li class="menu-divider"></li>`,ij=e=>$` <li class="menu-header">${e.label||"-"}</li> `,aj=(e,t)=>$`
|
2764
|
+
`]))}function $V(e){Od=e}function sb(e,t){const n=uo([],e,[]);return t&&(n._latestUnfiltered=null),n}function HV(e,t,n,r){const i=e.past.length+1;$t("inserting",t),$t("new free: ",n-i);const{past:a,_latestUnfiltered:o}=e,s=n&&n<=i,c=a.slice(s?1:0),l=o!=null?[...c,o]:c;return uo(l,t,[],r)}function s_(e,t){if(t<0||t>=e.future.length)return e;const{past:n,future:r,_latestUnfiltered:i}=e,a=[...n,i,...r.slice(0,t)],o=r[t],s=r.slice(t+1);return uo(a,o,s)}function c_(e,t){if(t<0||t>=e.past.length)return e;const{past:n,future:r,_latestUnfiltered:i}=e,a=n.slice(0,t),o=[...n.slice(t+1),i,...r],s=n[t];return uo(a,s,o)}function cb(e,t){return t>0?s_(e,t-1):t<0?c_(e,e.past.length+t):e}function GV(e,t){return t.indexOf(e)>-1?e:!e}function VV(e,t={}){$V(t.debug);const n={limit:void 0,filter:()=>!0,groupBy:()=>null,undoType:En.UNDO,redoType:En.REDO,jumpToPastType:En.JUMP_TO_PAST,jumpToFutureType:En.JUMP_TO_FUTURE,jumpType:En.JUMP,neverSkipReducer:!1,ignoreInitialState:!1,syncFilter:!1,...t,initTypes:o_(t.initTypes,["@@redux-undo/INIT"]),clearHistoryType:o_(t.clearHistoryType,[En.CLEAR_HISTORY])},r=n.neverSkipReducer?(a,o,...s)=>({...a,present:e(a.present,o,...s)}):a=>a;let i;return(a=i,o={},...s)=>{UV(o,a);let c=a;if(!i)if($t("history is uninitialized"),a===void 0){const u=e(a,{type:"@@redux-undo/CREATE_HISTORY"},...s);return c=sb(u,n.ignoreInitialState),$t("do not set initialState on probe actions"),Xn(c),c}else LV(a)?(c=i=n.ignoreInitialState?a:uo(a.past,a.present,a.future),$t("initialHistory initialized: initialState is a history",i)):(c=i=sb(a,n.ignoreInitialState),$t("initialHistory initialized: initialState is not a history",i));let l;switch(o.type){case void 0:return c;case n.undoType:return l=cb(c,-1),$t("perform undo"),Xn(l),r(l,o,...s);case n.redoType:return l=cb(c,1),$t("perform redo"),Xn(l),r(l,o,...s);case n.jumpToPastType:return l=c_(c,o.index),$t(`perform jumpToPast to ${o.index}`),Xn(l),r(l,o,...s);case n.jumpToFutureType:return l=s_(c,o.index),$t(`perform jumpToFuture to ${o.index}`),Xn(l),r(l,o,...s);case n.jumpType:return l=cb(c,o.index),$t(`perform jump to ${o.index}`),Xn(l),r(l,o,...s);case GV(o.type,n.clearHistoryType):return l=sb(c.present,n.ignoreInitialState),$t("perform clearHistory"),Xn(l),r(l,o,...s);default:if(l=e(c.present,o,...s),n.initTypes.some(f=>f===o.type))return $t("reset history due to init action"),Xn(i),i;if(c._latestUnfiltered===l)return c;if(typeof n.filter=="function"&&!n.filter(o,l,c)){const f=uo(c.past,l,c.future,c.group);return n.syncFilter||(f._latestUnfiltered=c._latestUnfiltered),$t("filter ignored action, not storing it in past"),Xn(f),f}const u=n.groupBy(o,l,c);if(u!=null&&u===c.group){const f=uo(c.past,l,c.future,c.group);return $t("groupBy grouped the action with the previous action"),Xn(f),f}return c=HV(c,l,n.limit,u),$t("inserted new state into history"),Xn(c),c}}}function Ld(e){return e.split("-")[0]}function lb(e){return e.split("-")[1]}function ub(e){return["top","bottom"].includes(Ld(e))?"x":"y"}function l_(e){return e==="y"?"height":"width"}function u_(e,t,n){let{reference:r,floating:i}=e;const a=r.x+r.width/2-i.width/2,o=r.y+r.height/2-i.height/2,s=ub(t),c=l_(s),l=r[c]/2-i[c]/2,u=s==="x";let f;switch(Ld(t)){case"top":f={x:a,y:r.y-i.height};break;case"bottom":f={x:a,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:o};break;case"left":f={x:r.x-i.width,y:o};break;default:f={x:r.x,y:r.y}}switch(lb(t)){case"start":f[s]-=l*(n&&u?-1:1);break;case"end":f[s]+=l*(n&&u?-1:1)}return f}const jV=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:u}=u_(c,r,s),f=r,h={};for(let d=0;d<a.length;d++){const{name:p,fn:g}=a[d],{x:b,y:v,data:x,reset:A}=await g({x:l,y:u,initialPlacement:r,placement:f,strategy:i,middlewareData:h,rects:c,platform:o,elements:{reference:e,floating:t}});l=b??l,u=v??u,h={...h,[p]:{...h[p],...x}},A&&(typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(c=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:l,y:u}=u_(c,f,s)),d=-1)}return{x:l,y:u,placement:f,strategy:i,middlewareData:h}};function qV(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function Nd(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function WV(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=t,p=qV(d),g=s[h?f==="floating"?"reference":"floating":f],b=Nd(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))==null||n?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v=Nd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:f==="floating"?{...o.floating,x:r,y:i}:o.reference,offsetParent:await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),strategy:c}):o[f]);return{top:b.top-v.top+p.top,bottom:v.bottom-b.bottom+p.bottom,left:b.left-v.left+p.left,right:v.right-b.right+p.right}}const YV={left:"right",right:"left",bottom:"top",top:"bottom"};function zd(e){return e.replace(/left|right|bottom|top/g,t=>YV[t])}function ZV(e,t,n){n===void 0&&(n=!1);const r=lb(e),i=ub(e),a=l_(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=zd(o)),{main:o,cross:zd(o)}}const QV={start:"end",end:"start"};function f_(e){return e.replace(/start|end/g,t=>QV[t])}["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const h_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",flipAlignment:d=!0,...p}=e,g=Ld(r),b=f||(g===o||!d?[zd(o)]:function(D){const B=zd(D);return[f_(D),B,f_(B)]}(o)),v=[o,...b],x=await WV(t,p),A=[];let w=((n=i.flip)==null?void 0:n.overflows)||[];if(l&&A.push(x[g]),u){const{main:D,cross:B}=ZV(r,a,await(s.isRTL==null?void 0:s.isRTL(c.floating)));A.push(x[D],x[B])}if(w=[...w,{placement:r,overflows:A}],!A.every(D=>D<=0)){var _,C;const D=((_=(C=i.flip)==null?void 0:C.index)!=null?_:0)+1,B=v[D];if(B)return{data:{index:D,overflows:w},reset:{placement:B}};let G="bottom";switch(h){case"bestFit":{var I;const z=(I=w.map(ae=>[ae,ae.overflows.filter(se=>se>0).reduce((se,ve)=>se+ve,0)]).sort((ae,se)=>ae[1]-se[1])[0])==null?void 0:I[0].placement;z&&(G=z);break}case"initialPlacement":G=o}if(r!==G)return{reset:{placement:G}}}return{}}}},XV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(a,o){const{placement:s,platform:c,elements:l}=a,u=await(c.isRTL==null?void 0:c.isRTL(l.floating)),f=Ld(s),h=lb(s),d=ub(s)==="x",p=["left","top"].includes(f)?-1:1,g=u&&d?-1:1,b=typeof o=="function"?o(a):o;let{mainAxis:v,crossAxis:x,alignmentAxis:A}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...b};return h&&typeof A=="number"&&(x=h==="end"?-1*A:A),d?{x:x*g,y:v*p}:{x:v*p,y:x*g}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function d_(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function Qr(e){if(e==null)return window;if(!d_(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function ru(e){return Qr(e).getComputedStyle(e)}function Xr(e){return d_(e)?"":e?(e.nodeName||"").toLowerCase():""}function p_(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function yr(e){return e instanceof Qr(e).HTMLElement}function ks(e){return e instanceof Qr(e).Element}function fb(e){return typeof ShadowRoot>"u"?!1:e instanceof Qr(e).ShadowRoot||e instanceof ShadowRoot}function Ud(e){const{overflow:t,overflowX:n,overflowY:r}=ru(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function KV(e){return["table","td","th"].includes(Xr(e))}function g_(e){const t=/firefox/i.test(p_()),n=ru(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function m_(){return!/^((?!chrome|android).)*safari/i.test(p_())}const b_=Math.min,iu=Math.max,$d=Math.round;function fo(e,t,n){var r,i,a,o;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let c=1,l=1;t&&yr(e)&&(c=e.offsetWidth>0&&$d(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&$d(s.height)/e.offsetHeight||1);const u=ks(e)?Qr(e):window,f=!m_()&&n,h=(s.left+(f&&(r=(i=u.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/c,d=(s.top+(f&&(a=(o=u.visualViewport)==null?void 0:o.offsetTop)!=null?a:0))/l,p=s.width/c,g=s.height/l;return{width:p,height:g,top:d,right:h+p,bottom:d+g,left:h,x:h,y:d}}function ji(e){return(t=e,(t instanceof Qr(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function Hd(e){return ks(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function y_(e){return fo(ji(e)).left+Hd(e).scrollLeft}function JV(e,t,n){const r=yr(t),i=ji(t),a=fo(e,r&&function(c){const l=fo(c);return $d(l.width)!==c.offsetWidth||$d(l.height)!==c.offsetHeight}(t),n==="fixed");let o={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Xr(t)!=="body"||Ud(i))&&(o=Hd(t)),yr(t)){const c=fo(t,!0);s.x=c.x+t.clientLeft,s.y=c.y+t.clientTop}else i&&(s.x=y_(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}function v_(e){return Xr(e)==="html"?e:e.assignedSlot||e.parentNode||(fb(e)?e.host:null)||ji(e)}function w_(e){return yr(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function hb(e){const t=Qr(e);let n=w_(e);for(;n&&KV(n)&&getComputedStyle(n).position==="static";)n=w_(n);return n&&(Xr(n)==="html"||Xr(n)==="body"&&getComputedStyle(n).position==="static"&&!g_(n))?t:n||function(r){let i=v_(r);for(fb(i)&&(i=i.host);yr(i)&&!["html","body"].includes(Xr(i));){if(g_(i))return i;i=i.parentNode}return null}(e)||t}function x_(e){if(yr(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=fo(e);return{width:t.width,height:t.height}}function A_(e){const t=v_(e);return["html","body","#document"].includes(Xr(t))?e.ownerDocument.body:yr(t)&&Ud(t)?t:A_(t)}function E_(e,t){var n;t===void 0&&(t=[]);const r=A_(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),a=Qr(r),o=i?[a].concat(a.visualViewport||[],Ud(r)?r:[]):r,s=t.concat(o);return i?s:s.concat(E_(o))}function S_(e,t,n){return t==="viewport"?Nd(function(r,i){const a=Qr(r),o=ji(r),s=a.visualViewport;let c=o.clientWidth,l=o.clientHeight,u=0,f=0;if(s){c=s.width,l=s.height;const h=m_();(h||!h&&i==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}return{width:c,height:l,x:u,y:f}}(e,n)):ks(t)?function(r,i){const a=fo(r,!1,i==="fixed"),o=a.top+r.clientTop,s=a.left+r.clientLeft;return{top:o,left:s,x:s,y:o,right:s+r.clientWidth,bottom:o+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):Nd(function(r){var i;const a=ji(r),o=Hd(r),s=(i=r.ownerDocument)==null?void 0:i.body,c=iu(a.scrollWidth,a.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),l=iu(a.scrollHeight,a.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let u=-o.scrollLeft+y_(r);const f=-o.scrollTop;return ru(s||a).direction==="rtl"&&(u+=iu(a.clientWidth,s?s.clientWidth:0)-c),{width:c,height:l,x:u,y:f}}(ji(e)))}function ej(e){const t=E_(e),n=["absolute","fixed"].includes(ru(e).position)&&yr(e)?hb(e):e;return ks(n)?t.filter(r=>ks(r)&&function(i,a){const o=a==null||a.getRootNode==null?void 0:a.getRootNode();if(i!=null&&i.contains(a))return!0;if(o&&fb(o)){let s=a;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Xr(r)!=="body"):[]}const tj={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?ej(t):[].concat(n),r],o=a[0],s=a.reduce((c,l)=>{const u=S_(t,l,i);return c.top=iu(u.top,c.top),c.right=b_(u.right,c.right),c.bottom=b_(u.bottom,c.bottom),c.left=iu(u.left,c.left),c},S_(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=yr(n),a=ji(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Xr(n)!=="body"||Ud(a))&&(o=Hd(n)),yr(n))){const c=fo(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return{...t,x:t.x-o.scrollLeft+s.x,y:t.y-o.scrollTop+s.y}},isElement:ks,getDimensions:x_,getOffsetParent:hb,getDocumentElement:ji,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:JV(t,hb(n),r),floating:{...x_(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ru(e).direction==="rtl"},nj=(e,t,n)=>jV(e,t,{platform:tj,...n});let vr;const au=[],db=bs(e=>e(),150,!1),pb={type:"divider"};function ou(e){if((e==null?void 0:e.type)=="contextmenu"){e.preventDefault();return}vr&&(vr.remove(),vr=void 0,document.body.classList.remove(Ba))}function __(e){var t;if(!(e<1)){for(let n=e;n<au.length;n++)(t=au[n])==null||t.remove(),au[n]=void 0;for(const n of au[e-1].querySelectorAll("li.active"))n.classList.remove("active")}}const rj=()=>$`<li class="menu-divider"></li>`,ij=e=>$` <li class="menu-header">${e.label||"-"}</li> `,aj=(e,t)=>$`
|
2765
2765
|
<li>
|
2766
2766
|
<a
|
2767
2767
|
class="submenu-item"
|
@@ -2799,7 +2799,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2799
2799
|
${e.label||"-"}</span
|
2800
2800
|
>
|
2801
2801
|
</li>
|
2802
|
-
`;function C_(e,t=1){switch(e.type){case"divider":return rj();case"header":return ij(e);default:return e.submenu?aj(e,t):e.callback?oj(e):sj(e)}}function cj(e,t,n){k_(e,t,n,"right-start"),t.classList.add("active")}function k_(e,t,n,r){const i=document.createElement("ul");i.classList.add("gs-context-menu"),i.addEventListener("mouseenter",()=>{db(()=>{})}),Vt(e.map(a=>C_(a,n)),i),
|
2802
|
+
`;function C_(e,t=1){switch(e.type){case"divider":return rj();case"header":return ij(e);default:return e.submenu?aj(e,t):e.callback?oj(e):sj(e)}}function cj(e,t,n){k_(e,t,n,"right-start"),t.classList.add("active")}function k_(e,t,n,r){const i=document.createElement("ul");i.classList.add("gs-context-menu"),i.addEventListener("mouseenter",()=>{db(()=>{})}),Vt(e.map(a=>C_(a,n)),i),vr.appendChild(i),__(n),au[n]=i,nj(t,i,{placement:r??"right-start",middleware:n?[h_()]:[XV(2),h_()]}).then(({x:a,y:o})=>{const s=i.querySelector(":scope > li");s&&(o-=s.getBoundingClientRect().top),i.style.left=`${a}px`,i.style.top=`${o}px`})}function T_(e,t,n){n??(n="bottom-start"),ou();const r=performance.now(),i=document.body;vr=document.createElement("div"),vr.classList.add("gs-context-menu-backdrop"),vr.addEventListener("click",ou),vr.addEventListener("contextmenu",ou),vr.addEventListener("mouseup",()=>{performance.now()-r>500&&ou()},{once:!0}),i.appendChild(vr),document.body.classList.add(Ba),k_(e.items,t,0,n)}function gb(e,t){T_(e,lj(t),"right-start"),t.preventDefault()}function lj(e){return{getBoundingClientRect(){return{width:0,height:0,x:e.clientX,y:e.clientY,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY,toJSON:void 0}}}}const mb={NOMINAL:"nominal",ORDINAL:"ordinal",QUANTITATIVE:"quantitative"},Gd="SAMPLE_ATTRIBUTE",I_="SAMPLE_NAME",uj=/^attribute-(.*)$/;class R_ extends ys{constructor(n,r){super({title:"Sample metadata",data:{name:null},hconcat:[],spacing:n.spec.samples.attributeSpacing??1,padding:{right:10},resolve:{scale:{default:"independent"},axis:{default:"independent"}}},n.context,n,r,"sample-metadata");Z(this,K0);Z(this,J0);Z(this,ep);Z(this,tp);Z(this,Uo);Z(this,np);Z(this,et,void 0);le(this,et,n),this._attributeHighlighState={backgroundOpacity:1,currentAttribute:void 0,abortController:new AbortController},P(this,et).compositeAttributeInfoSource.addAttributeInfoSource(Gd,i=>this.children.map(J(this,Uo,Rf).bind(this)).find(a=>a&&a.name==i.specifier)),P(this,et).compositeAttributeInfoSource.addAttributeInfoSource(I_,i=>D_),this.addInteractionEventListener("contextmenu",this.handleContextMenu.bind(this)),this.addInteractionEventListener("mousemove",(i,a)=>{var l;const o=a.target,s=P(this,et).findSampleForMouseEvent(i,a),c=o&&((l=J(this,Uo,Rf).call(this,o))==null?void 0:l.name)||void 0;if(s){const u=JSON.stringify([s.id,c]);this.context.updateTooltip(u,f=>Promise.resolve(J(this,np,QT).call(this,f)))}this._handleAttributeHighlight(c)}),xn([...P(this,et).getLayoutAncestors()]).addInteractionEventListener("mousemove",(i,a)=>{if(this._attributeHighlighState.currentAttribute){if(a.target){for(const o of a.target.getLayoutAncestors())if(o==this)return}this._handleAttributeHighlight(void 0)}})}getEncoding(){return{}}render(n,r,i={}){this.isConfiguredVisible()&&super.render(n,r,{...i,clipRect:P(this,et).locationManager.clipBySummary(r)})}_handleAttributeHighlight(n){const r=this._attributeHighlighState;n!=r.currentAttribute&&(r.abortController.abort(),r.abortController=new AbortController,this.context.animator.transition({from:r.backgroundOpacity,onUpdate:i=>{r.backgroundOpacity=i},easingFunction:IN,signal:r.abortController.signal,...n?{to:.1,duration:1e3,delay:r.backgroundOpacity<1?0:500}:{to:1,duration:200,delay:150}}).catch(i=>{}),this.context.animator.requestRender()),r.currentAttribute=n}getSample(n){var r;return(r=P(this,et).sampleHierarchy.sampleData)==null?void 0:r.entities[n]}handleContextMenu(n,r){const i=r.uiEvent,a=P(this,et).findSampleForMouseEvent(n,r);if(!a){i.preventDefault();return}const o=[P(this,et).makePeekMenuItem(),pb],s=J(this,Uo,Rf).call(this,r.target);if(s){const c=a.attributes[s.name];o.push(...ib($`Attribute: <strong>${s.name}</strong>`,s,c,P(this,et)))}else o.push(...ib($`Sample: <strong>${a.displayName}</strong>`,D_,a.id,P(this,et)));gb({items:o},i)}setSamples(n){if(this.childCount)throw new Error("Children are already created!");this._createViews();const r=this.context.dataFlow;TE(this,r);const i=r.findDataSourceByKey(this);i.visit(o=>o.initialize());const a=[];this.visit(o=>{if(o instanceof mt){const s=o.mark;s.initializeEncoders(),a.push(s.initializeGraphics().then(c=>s)),r.addObserver(c=>{s.initializeData(),s.updateGraphicsData()},o)}}),Promise.allSettled(a).then(o=>{for(const s of o)"value"in s?s.value.finalizeGraphicsInitialization():"reason"in s&&console.error(s.reason)}),i.updateDynamicData(n),this.visit(o=>{o.name.startsWith("title")&&r.findDataSourceByKey(o).load()})}_createViews(){const n=[];n.push(this.context.createView(hj(P(this,et).spec.samples),this,this));for(const r of this.getAttributeNames()){const i=this.context.createView(J(this,ep,YT).call(this,r),this,this);i.opacityFunction=a=>a*J(this,K0,qT).call(this,r),n.push(i)}this.setChildren(n);for(const r of this.getDescendants())r instanceof mt&&r.name.startsWith("title")&&typeof r.spec.mark!="string"&&(r.spec.mark.clip="never");RE(this)}getAttributeNames(){return this._cache("attributeNames",()=>[...P(this,et).getSamples().flatMap(i=>Object.keys(i.attributes)).reduce((i,a)=>i.add(a),new Set)])}getAttributeInfo(n){return J(this,Uo,Rf).call(this,J(this,tp,ZT).call(this,n))}getDefaultResolution(n,r){return"independent"}handleVerboseCommand(n){const r=n;for(const i of this.getAttributeNames()){const a=this.getAttributeInfo(i);if((a.type==Hm||a.type==Gm)&&P(this,et).getSamples().find(s=>s.attributes[a.name]==r)){const s=P(this,et).actions.filterByNominal({attribute:{type:Gd,specifier:i},values:[r]}),c=P(this,et).provenance.getPresentState().lastAction,l=P(this,et).actions.filterByNominal.match(c)&&!c.payload.remove&&c.payload.attribute.type==Gd&&c.payload.attribute.specifier==i&&c.payload.values.length==1;return P(this,et).provenance.storeHelper.dispatch(l?[lo.undo(),s]:s),!0}}return!1}isPickingSupported(){return!1}}et=new WeakMap,K0=new WeakSet,qT=function(n){const r=this._attributeHighlighState;return n==r.currentAttribute?1:r.backgroundOpacity},J0=new WeakSet,WT=function(n){var r,i;return(i=(r=P(this,et).spec.samples)==null?void 0:r.attributes)==null?void 0:i[n]},ep=new WeakSet,YT=function(n){const r=J(this,J0,WT).call(this,n);let i=r?r.type:void 0;if(!i){const a=P(this,et).getSamples();switch(aw(a.map(o=>o.attributes[n]))){case"integer":case"number":i=mb.QUANTITATIVE;break;default:i=mb.NOMINAL}}return fj(n,{...r||{},type:i},P(this,et).spec.samples)},tp=new WeakSet,ZT=function(n){return this.children[this.getAttributeNames().indexOf(n)+1]},Uo=new WeakSet,Rf=function(n){const r=n==null?void 0:n.name.match(uj);if(r){const i=n.getScaleResolution("color"),a=r[1];return{name:a,attribute:{type:Gd,specifier:a},accessor:(o,s)=>s.sampleData.entities[o].attributes[a],type:i.type,scale:i.getScale(),title:$`<em class="attribute">${a}</em>`}}},np=new WeakSet,QT=function(n){const[r,i]=JSON.parse(n),a=this.getSample(r),o=(c,l)=>dj(l)?this.getAttributeInfo(c).scale(l):"transparent",s=$`
|
2803
2803
|
<table class="attributes">
|
2804
2804
|
${Object.entries(a.attributes).map(([c,l])=>$`
|
2805
2805
|
<tr class=${s1({hovered:c==i})}>
|
@@ -2817,12 +2817,12 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2817
2817
|
<strong>${a.displayName||a.id}</strong>
|
2818
2818
|
</div>
|
2819
2819
|
${s}
|
2820
|
-
`};function fj(e,t,n){const r=`attributes["${e}"]`,i={name:`attribute-${e}`,title:{text:e,orient:"bottom",align:"right",baseline:"middle",offset:5,angle:-90+(n.attributeLabelAngle??0),dy:-.5,font:n.attributeLabelFont,fontSize:n.attributeLabelFontSize??11,fontStyle:n.attributeLabelFontStyle,fontWeight:n.attributeLabelFontWeight},visible:t.visible??!0,width:t.width??n.attributeSize??10,transform:[{type:"filter",expr:`datum.${r} != null`}],mark:{type:"rect",xOffset:-.5},encoding:{facetIndex:{field:"indexNumber"},color:{field:r,type:t.type,scale:t.scale}},opacity:1};return t.barScale&&t.type==mb.QUANTITATIVE&&(i.encoding.x={field:`attributes["${e}"]`,type:t.type,scale:t.barScale,axis:null}),i}function hj(e){return{name:"metadata-sample-name",title:{text:e.labelTitleText??"Sample name",orient:"bottom",anchor:"start",offset:5,font:e.attributeLabelFont,fontSize:e.attributeLabelFontSize??11,fontStyle:e.attributeLabelFontStyle,fontWeight:e.attributeLabelFontWeight},width:e.labelLength??140,mark:{type:"text",baseline:"middle",font:e.labelFont,size:e.labelFontSize??11,fontStyle:e.labelFontStyle,fontWeight:e.labelFontWeight,align:e.labelAlign??"left",flushY:!1},encoding:{facetIndex:{field:"indexNumber"},x:{value:0},x2:{value:1},y:{value:0},y2:{value:1},text:{field:"displayName"}}}}function dj(e){return e!==""&&!(typeof e=="number"&&isNaN(e))&&e!==null}const D_=Object.freeze({name:"sample",attribute:{type:I_},accessor:e=>e,type:"identifier",scale:void 0});class pj extends Ka{constructor(n,r){super({title:{text:"Groups",orient:"none"},padding:{right:0},width:{step:22},data:{name:null},transform:[{type:"filter",expr:"datum._depth > 0"},{type:"formula",as:"_y1",expr:"datum._index * 2"},{type:"formula",as:"_y2",expr:"datum._index * 2 + 1"},{type:"formula",as:"_title",expr:"datum.title || datum.name"},{type:"formula",as:"_NA",expr:"datum._title === null"},{type:"formula",as:"_title",expr:"datum._title !== null ? datum._title: 'NA'"}],encoding:{x:{field:"_depth",type:"ordinal",scale:{align:0,padding:.2272727},axis:null},y:{field:"_y1",type:"nominal",scale:{type:"ordinal",domain:mi(500)},axis:null},y2:{field:"_y2"}},layer:[{title:"Group",mark:{type:"rect",clip:!0,color:"#e8e8e8",cornerRadiusBottomLeft:14,cornerRadiusTopLeft:14}},{mark:{type:"text",clip:!0,angle:-90,paddingY:5,tooltip:null},encoding:{text:{field:"_title"},opacity:{field:"_NA",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[1,.3]}}}}]},n.context,n,r,"sample-groups");Z(this,rp);this.sampleView=n,this._addBroadcastHandler("layoutComputed",()=>{this.updateRange()}),this.addInteractionEventListener("contextmenu",(i,a)=>{const o=a.uiEvent,s=this.context.getCurrentHover();if(!s)return;const c=s.datum._rawGroup;let l;for(const d of rb(this.sampleView.sampleHierarchy.rootGroup))if(d.at(-1)===c){l=d.slice(1);break}const u=n.actions.removeGroup({path:l.map(d=>d.name)}),f=n.provenance.getActionInfo(u),h=n.provenance.storeHelper.getDispatcher();gb({items:[{label:f.title,icon:f.icon,callback:()=>h(u)}]},o)})}updateRange(){var o,s;const n=(o=this.sampleView.locationManager.getLocations())==null?void 0:o.groups;if(!(n!=null&&n.length))return;const r=((s=this.sampleView)==null?void 0:s.childCoords.height)??0,i=this.getScaleResolution("y"),a=[];for(const c of n)a.push(1-(c.locSize.location+c.locSize.size)/r),a.push(1-c.locSize.location/r);i.getScale().range(a),this.context.glHelper.createRangeTexture(i,!0)}updateGroups(){var o;const n=((o=this.sampleView.locationManager.getLocations())==null?void 0:o.groups)??[],r=this.context.dataFlow.findDataSourceByKey(this);if(!r)return;const i=J(this,rp,XT).call(this),a=n.map(s=>({_index:s.key.index,_depth:s.key.depth,_rawGroup:s.key.group,attribute:i[s.key.depth],name:s.key.group.name,...s.key.group.name!=s.key.group.title?{title:s.key.group.title}:{},n:s.key.n}));r.updateDynamicData(a),this.getScaleResolution("x").reconfigure(),this.getScaleResolution("y").reconfigure(),n.length&&this.updateRange(),xn([...this.getLayoutAncestors()]).visit(s=>Il(s,"size"))}}rp=new WeakSet,XT=function(){const n=document.createElement("div");return[null,...this.sampleView.sampleHierarchy.groupMetadata].map(r=>{if(!r)return"unknown";const i=this.sampleView.compositeAttributeInfoSource.getAttributeInfo(r.attribute).title;return i?Me(i)?i:(Vt(i,n),n.textContent.replace(/\s+/g," ").trim()):"unknown"})};class gj{constructor(){this.attributeInfoSourcesByType={}}addAttributeInfoSource(t,n){this.attributeInfoSourcesByType[t]=n}getAttributeInfo(t){const n=this.attributeInfoSourcesByType[t.type];if(!n)throw new Error("Cannot find attribute info source for: "+JSON.stringify(t));const r=n(t);if(r)return r;throw new Error("Unknown attribute: "+JSON.stringify(t))}}function Vd(e,t,n){let r=n&&e(n);return i=>{const a=e(i);a!==r&&(t(a,r),r=a)}}class mj{constructor(t){Z(this,xf);Z(this,Ln,0);Z(this,la,0);Z(this,$o,0);Z(this,Ac,void 0);Z(this,Ec,void 0);Z(this,ui,void 0);Z(this,Sc,void 0);Z(this,It,void 0);Z(this,wf,void 0);le(this,It,t),le(this,wf,t.viewContext.paramBroker.allocateSetter("sampleHeight"))}isCloseup(){return P(this,Ln)===1}resetLocations(){le(this,ui,void 0)}reset(){le(this,Ln,0),this.resetLocations()}handleWheelEvent(t){le(this,la,Ai(P(this,la)+t.deltaY,0,P(this,$o)-P(this,It).getHeight()))}togglePeek(t,n,r){if(P(this,Ln)>0&&P(this,Ln)<1||t!==void 0&&t==!!P(this,Ln))return;const i=P(this,It).viewContext,a=P(this,It).getHeight(),o={requestAnimationFrame:s=>i.animator.requestTransition(s),onUpdate:s=>{le(this,Ln,Math.pow(s,2)),P(this,It).onLocationUpdate(),J(this,xf,tv).call(this),i.animator.requestRender()},from:P(this,Ln)};if(P(this,Ln)==0){let s;if(r)s=(l=>l.location+l.size/2)(P(this,Sc).samples.find(l=>l.key==r).locSize);else{const c=this.getSummaryAt(n);c&&(s=P(this,Sc).summaries[c.index].locSize.location-(c.location.locSize.location-n))}s?le(this,la,s-n):le(this,la,(P(this,$o)-a)/2),P(this,$o)>a?ed({...o,to:1,duration:500,easingFunction:FN}):ed({...o,from:0,to:1,duration:300,easingFunction:l=>(1-Math.pow(l*2-1,2))*.5})}else ed({...o,to:0,duration:400,easingFunction:RN})}getLocations(){if(P(this,ui))return P(this,ui);const t=P(this,It).getHeight();if(!t)return;const n=P(this,It).getSampleHierarchy(),r=nb(n),i=P(this,It).getSummaryHeight(),a=B_(r,{viewHeight:t,groupSpacing:5,summaryHeight:i}),o=B_(r,{sampleHeight:35,groupSpacing:15,summaryHeight:i}),s=()=>-P(this,la),c=()=>P(this,Ln);le(this,Sc,o),le(this,$o,o.summaries.map(f=>f.locSize.location+f.locSize.size).reduce((f,h)=>Math.max(f,h),0));const l=(f,h)=>{const d=[];for(let p=0;p<f.length;p++){const g=f[p].key;d.push({key:g,locSize:GL(f[p].locSize,VL(h[p].locSize,s),c)})}return d},u=l(a.groups,o.groups);return le(this,ui,{samples:l(a.samples,o.samples),summaries:l(a.summaries,o.summaries),groups:u}),J(this,xf,tv).call(this),P(this,ui)}getGroupBackgroundRects(t){const n=this.getLocations().groups,r=n.map(s=>s.key.depth).reduce((s,c)=>Math.max(s,c),0),i=n.filter(s=>s.key.depth==r),a=P(this,It).getSummaryHeight();t=t.flatten();const o=P(this,It).isStickySummaries()&&a>0?t.shrink(new Ct(a,0,0,0)):t;return[...i.values()].map(s=>{const c=()=>{const l=s.locSize.location;return t.y+l+a};return{coords:t.modify({y:c,height:()=>s.locSize.size-a}).intersect(o),clipRect:o}})}updateFacetTexture(){const t=P(this,It).getSampleHierarchy().sampleData;if(!P(this,Ec)){const a=t&&Object.values(t.entities);le(this,Ec,new Float32Array(Math.ceil(a.length*2/4)*4))}const n=P(this,Ec);n.fill(0);const r=t==null?void 0:t.entities;if(r){const a=this.getLocations().samples,o=P(this,It).getHeight();for(const s of a){const c=r[s.key].indexNumber;n[c*2+0]=s.locSize.location/o,n[c*2+1]=s.locSize.size/o}}const i=P(this,It).viewContext.glHelper.gl;le(this,Ac,Dl(i,{internalFormat:i.RG32F,format:i.RG,height:1},n,P(this,Ac)))}getFacetTexture(){return P(this,Ac)}getSummaryAt(t){const n=this.getLocations().summaries,r=n.findIndex(i=>WA(i.locSize,t));return r>=0?{index:r,location:n[r]}:void 0}clipBySummary(t){if(P(this,It).isStickySummaries()){const n=P(this,It).getSummaryHeight();if(n>0)return t.modify({y:()=>t.y+n,height:()=>t.height-n})}return t}}Ln=new WeakMap,la=new WeakMap,$o=new WeakMap,Ac=new WeakMap,Ec=new WeakMap,ui=new WeakMap,Sc=new WeakMap,It=new WeakMap,wf=new WeakMap,xf=new WeakSet,tv=function(){var t;P(this,wf).call(this,((t=P(this,ui).samples[0])==null?void 0:t.locSize.size)??0)};function B_(e,{viewHeight:t=0,sampleHeight:n=0,groupSpacing:r=5,summaryHeight:i=0}){if(!t&&!n)throw new Error("viewHeight or sampleHeight must be provided!");const a=h=>xn(h),o=e.map(h=>({path:h,sampleGroup:a(h),samples:a(h).samples})).filter(h=>h.samples.length),s=n?h=>({px:h.length*n+i,grow:0}):h=>({px:i,grow:h.length}),c=[];Fl(o.map(h=>s(h.samples)),t,{spacing:r}).forEach((h,d)=>{c.push({key:o[d].path,locSize:h})});const l=[];for(const[h,d]of o.entries()){const p={grow:1},g=d.samples;Fl(g.map(b=>p),Math.max(0,c[h].locSize.size-i),{offset:c[h].locSize.location+i}).forEach((b,v)=>{const{size:x,location:A}=b,w=x*.1*lg(15,22,x);b.location=A+w,b.size=x-2*w,l.push({key:g[v],locSize:b})})}function*u(){const h=[];for(const d of c){const p=d.key,g=xn(p);for(;h.length<=p.length&&h.length&&p[h.length-1]!=h[h.length-1].group;)yield h.pop();for(let b=0;b<h.length;b++){const v=h[b];v.locSize.size=d.locSize.location-v.locSize.location+d.locSize.size}for(let b=h.length;b<p.length;b++)h.push({group:p[b],locSize:{...d.locSize},depth:h.length,n:0});for(const b of h)b.n+=g.samples.length}for(;h.length;)yield h.pop()}const f=[...u()].sort((h,d)=>h.depth-d.depth).map((h,d)=>({key:{index:d,group:h.group,depth:h.depth,n:h.n,attributeLabel:void 0},locSize:h.locSize}));return{samples:l,summaries:c,groups:f}}function bj(e,t){return t.find(n=>WA(n.locSize,e))}function yj(e,t){const n=t.specifier,r=e.findDescendantByName(n.view),i=r.getScaleResolution("x");let a;if(Kh(n.locus)){const f=i.getGenome();if(f)a=f.toContinuous(n.locus.chrom,n.locus.pos);else throw new Error("Encountered a chromosomal locus but no genome is available!")}else a=n.locus;const o=f=>{var h;return(h=r.mark.findDatumAt(f,a))==null?void 0:h[n.field]},[s,c]=Object.entries(r.getEncoding()).find(([f,h])=>"field"in h&&h.field==n.field),l=Ii(s)?r.getScaleResolution(s).getScale():void 0;return{name:n.field,attribute:t,title:$` <em class="attribute">${n.field}</em>
|
2820
|
+
`};function fj(e,t,n){const r=`attributes["${e}"]`,i={name:`attribute-${e}`,title:{text:e,orient:"bottom",align:"right",baseline:"middle",offset:5,angle:-90+(n.attributeLabelAngle??0),dy:-.5,font:n.attributeLabelFont,fontSize:n.attributeLabelFontSize??11,fontStyle:n.attributeLabelFontStyle,fontWeight:n.attributeLabelFontWeight},visible:t.visible??!0,width:t.width??n.attributeSize??10,transform:[{type:"filter",expr:`datum.${r} != null`}],mark:{type:"rect",xOffset:-.5},encoding:{facetIndex:{field:"indexNumber"},color:{field:r,type:t.type,scale:t.scale}},opacity:1};return t.barScale&&t.type==mb.QUANTITATIVE&&(i.encoding.x={field:`attributes["${e}"]`,type:t.type,scale:t.barScale,axis:null}),i}function hj(e){return{name:"metadata-sample-name",title:{text:e.labelTitleText??"Sample name",orient:"bottom",anchor:"start",offset:5,font:e.attributeLabelFont,fontSize:e.attributeLabelFontSize??11,fontStyle:e.attributeLabelFontStyle,fontWeight:e.attributeLabelFontWeight},width:e.labelLength??140,mark:{type:"text",baseline:"middle",font:e.labelFont,size:e.labelFontSize??11,fontStyle:e.labelFontStyle,fontWeight:e.labelFontWeight,align:e.labelAlign??"left",flushY:!1},encoding:{facetIndex:{field:"indexNumber"},x:{value:0},x2:{value:1},y:{value:0},y2:{value:1},text:{field:"displayName"}}}}function dj(e){return e!==""&&!(typeof e=="number"&&isNaN(e))&&e!==null}const D_=Object.freeze({name:"sample",attribute:{type:I_},accessor:e=>e,type:"identifier",scale:void 0});class pj extends Ka{constructor(n,r){super({title:{text:"Groups",orient:"none"},padding:{right:0},width:{step:22},data:{name:null},transform:[{type:"filter",expr:"datum._depth > 0"},{type:"formula",as:"_y1",expr:"datum._index * 2"},{type:"formula",as:"_y2",expr:"datum._index * 2 + 1"},{type:"formula",as:"_title",expr:"datum.title || datum.name"},{type:"formula",as:"_NA",expr:"datum._title === null"},{type:"formula",as:"_title",expr:"datum._title !== null ? datum._title: 'NA'"}],encoding:{x:{field:"_depth",type:"ordinal",scale:{align:0,padding:.2272727},axis:null},y:{field:"_y1",type:"nominal",scale:{type:"ordinal",domain:mi(500)},axis:null},y2:{field:"_y2"}},layer:[{title:"Group",mark:{type:"rect",clip:!0,color:"#e8e8e8",cornerRadiusBottomLeft:14,cornerRadiusTopLeft:14}},{mark:{type:"text",clip:!0,angle:-90,paddingY:5,tooltip:null},encoding:{text:{field:"_title"},opacity:{field:"_NA",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[1,.3]}}}}]},n.context,n,r,"sample-groups");Z(this,rp);this.sampleView=n,this._addBroadcastHandler("layoutComputed",()=>{this.updateRange()}),this.addInteractionEventListener("contextmenu",(i,a)=>{const o=a.uiEvent,s=this.context.getCurrentHover();if(!s)return;const c=s.datum._rawGroup;let l;for(const d of rb(this.sampleView.sampleHierarchy.rootGroup))if(d.at(-1)===c){l=d.slice(1);break}const u=n.actions.removeGroup({path:l.map(d=>d.name)}),f=n.provenance.getActionInfo(u),h=n.provenance.storeHelper.getDispatcher();gb({items:[{label:f.title,icon:f.icon,callback:()=>h(u)}]},o)})}updateRange(){var o,s;const n=(o=this.sampleView.locationManager.getLocations())==null?void 0:o.groups;if(!(n!=null&&n.length))return;const r=((s=this.sampleView)==null?void 0:s.childCoords.height)??0,i=this.getScaleResolution("y"),a=[];for(const c of n)a.push(1-(c.locSize.location+c.locSize.size)/r),a.push(1-c.locSize.location/r);i.getScale().range(a),this.context.glHelper.createRangeTexture(i,!0)}updateGroups(){var o;const n=((o=this.sampleView.locationManager.getLocations())==null?void 0:o.groups)??[],r=this.context.dataFlow.findDataSourceByKey(this);if(!r)return;const i=J(this,rp,XT).call(this),a=n.map(s=>({_index:s.key.index,_depth:s.key.depth,_rawGroup:s.key.group,attribute:i[s.key.depth],name:s.key.group.name,...s.key.group.name!=s.key.group.title?{title:s.key.group.title}:{},n:s.key.n}));r.updateDynamicData(a),this.getScaleResolution("x").reconfigure(),this.getScaleResolution("y").reconfigure(),n.length&&this.updateRange(),xn([...this.getLayoutAncestors()]).visit(s=>Il(s,"size"))}}rp=new WeakSet,XT=function(){const n=document.createElement("div");return[null,...this.sampleView.sampleHierarchy.groupMetadata].map(r=>{if(!r)return"unknown";const i=this.sampleView.compositeAttributeInfoSource.getAttributeInfo(r.attribute).title;return i?Me(i)?i:(Vt(i,n),n.textContent.replace(/\s+/g," ").trim()):"unknown"})};class gj{constructor(){this.attributeInfoSourcesByType={}}addAttributeInfoSource(t,n){this.attributeInfoSourcesByType[t]=n}getAttributeInfo(t){const n=this.attributeInfoSourcesByType[t.type];if(!n)throw new Error("Cannot find attribute info source for: "+JSON.stringify(t));const r=n(t);if(r)return r;throw new Error("Unknown attribute: "+JSON.stringify(t))}}function Vd(e,t,n){let r=n&&e(n);return i=>{const a=e(i);a!==r&&(t(a,r),r=a)}}class mj{constructor(t){Z(this,xf);Z(this,Ln,0);Z(this,ua,0);Z(this,$o,0);Z(this,Ac,void 0);Z(this,Ec,void 0);Z(this,ui,void 0);Z(this,Sc,void 0);Z(this,It,void 0);Z(this,wf,void 0);le(this,It,t),le(this,wf,t.viewContext.paramBroker.allocateSetter("sampleHeight"))}isCloseup(){return P(this,Ln)===1}resetLocations(){le(this,ui,void 0)}reset(){le(this,Ln,0),this.resetLocations()}handleWheelEvent(t){le(this,ua,Ai(P(this,ua)+t.deltaY,0,P(this,$o)-P(this,It).getHeight()))}togglePeek(t,n,r){if(P(this,Ln)>0&&P(this,Ln)<1||t!==void 0&&t==!!P(this,Ln))return;const i=P(this,It).viewContext,a=P(this,It).getHeight(),o={requestAnimationFrame:s=>i.animator.requestTransition(s),onUpdate:s=>{le(this,Ln,Math.pow(s,2)),P(this,It).onLocationUpdate(),J(this,xf,tv).call(this),i.animator.requestRender()},from:P(this,Ln)};if(P(this,Ln)==0){let s;if(r)s=(l=>l.location+l.size/2)(P(this,Sc).samples.find(l=>l.key==r).locSize);else{const c=this.getSummaryAt(n);c&&(s=P(this,Sc).summaries[c.index].locSize.location-(c.location.locSize.location-n))}s?le(this,ua,s-n):le(this,ua,(P(this,$o)-a)/2),P(this,$o)>a?ed({...o,to:1,duration:500,easingFunction:FN}):ed({...o,from:0,to:1,duration:300,easingFunction:l=>(1-Math.pow(l*2-1,2))*.5})}else ed({...o,to:0,duration:400,easingFunction:RN})}getLocations(){if(P(this,ui))return P(this,ui);const t=P(this,It).getHeight();if(!t)return;const n=P(this,It).getSampleHierarchy(),r=nb(n),i=P(this,It).getSummaryHeight(),a=B_(r,{viewHeight:t,groupSpacing:5,summaryHeight:i}),o=B_(r,{sampleHeight:35,groupSpacing:15,summaryHeight:i}),s=()=>-P(this,ua),c=()=>P(this,Ln);le(this,Sc,o),le(this,$o,o.summaries.map(f=>f.locSize.location+f.locSize.size).reduce((f,h)=>Math.max(f,h),0));const l=(f,h)=>{const d=[];for(let p=0;p<f.length;p++){const g=f[p].key;d.push({key:g,locSize:GL(f[p].locSize,VL(h[p].locSize,s),c)})}return d},u=l(a.groups,o.groups);return le(this,ui,{samples:l(a.samples,o.samples),summaries:l(a.summaries,o.summaries),groups:u}),J(this,xf,tv).call(this),P(this,ui)}getGroupBackgroundRects(t){const n=this.getLocations().groups,r=n.map(s=>s.key.depth).reduce((s,c)=>Math.max(s,c),0),i=n.filter(s=>s.key.depth==r),a=P(this,It).getSummaryHeight();t=t.flatten();const o=P(this,It).isStickySummaries()&&a>0?t.shrink(new Ct(a,0,0,0)):t;return[...i.values()].map(s=>{const c=()=>{const l=s.locSize.location;return t.y+l+a};return{coords:t.modify({y:c,height:()=>s.locSize.size-a}).intersect(o),clipRect:o}})}updateFacetTexture(){const t=P(this,It).getSampleHierarchy().sampleData;if(!P(this,Ec)){const a=t&&Object.values(t.entities);le(this,Ec,new Float32Array(Math.ceil(a.length*2/4)*4))}const n=P(this,Ec);n.fill(0);const r=t==null?void 0:t.entities;if(r){const a=this.getLocations().samples,o=P(this,It).getHeight();for(const s of a){const c=r[s.key].indexNumber;n[c*2+0]=s.locSize.location/o,n[c*2+1]=s.locSize.size/o}}const i=P(this,It).viewContext.glHelper.gl;le(this,Ac,Dl(i,{internalFormat:i.RG32F,format:i.RG,height:1},n,P(this,Ac)))}getFacetTexture(){return P(this,Ac)}getSummaryAt(t){const n=this.getLocations().summaries,r=n.findIndex(i=>WA(i.locSize,t));return r>=0?{index:r,location:n[r]}:void 0}clipBySummary(t){if(P(this,It).isStickySummaries()){const n=P(this,It).getSummaryHeight();if(n>0)return t.modify({y:()=>t.y+n,height:()=>t.height-n})}return t}}Ln=new WeakMap,ua=new WeakMap,$o=new WeakMap,Ac=new WeakMap,Ec=new WeakMap,ui=new WeakMap,Sc=new WeakMap,It=new WeakMap,wf=new WeakMap,xf=new WeakSet,tv=function(){var t;P(this,wf).call(this,((t=P(this,ui).samples[0])==null?void 0:t.locSize.size)??0)};function B_(e,{viewHeight:t=0,sampleHeight:n=0,groupSpacing:r=5,summaryHeight:i=0}){if(!t&&!n)throw new Error("viewHeight or sampleHeight must be provided!");const a=h=>xn(h),o=e.map(h=>({path:h,sampleGroup:a(h),samples:a(h).samples})).filter(h=>h.samples.length),s=n?h=>({px:h.length*n+i,grow:0}):h=>({px:i,grow:h.length}),c=[];Fl(o.map(h=>s(h.samples)),t,{spacing:r}).forEach((h,d)=>{c.push({key:o[d].path,locSize:h})});const l=[];for(const[h,d]of o.entries()){const p={grow:1},g=d.samples;Fl(g.map(b=>p),Math.max(0,c[h].locSize.size-i),{offset:c[h].locSize.location+i}).forEach((b,v)=>{const{size:x,location:A}=b,w=x*.1*lg(15,22,x);b.location=A+w,b.size=x-2*w,l.push({key:g[v],locSize:b})})}function*u(){const h=[];for(const d of c){const p=d.key,g=xn(p);for(;h.length<=p.length&&h.length&&p[h.length-1]!=h[h.length-1].group;)yield h.pop();for(let b=0;b<h.length;b++){const v=h[b];v.locSize.size=d.locSize.location-v.locSize.location+d.locSize.size}for(let b=h.length;b<p.length;b++)h.push({group:p[b],locSize:{...d.locSize},depth:h.length,n:0});for(const b of h)b.n+=g.samples.length}for(;h.length;)yield h.pop()}const f=[...u()].sort((h,d)=>h.depth-d.depth).map((h,d)=>({key:{index:d,group:h.group,depth:h.depth,n:h.n,attributeLabel:void 0},locSize:h.locSize}));return{samples:l,summaries:c,groups:f}}function bj(e,t){return t.find(n=>WA(n.locSize,e))}function yj(e,t){const n=t.specifier,r=e.findDescendantByName(n.view),i=r.getScaleResolution("x");let a;if(Kh(n.locus)){const f=i.getGenome();if(f)a=f.toContinuous(n.locus.chrom,n.locus.pos);else throw new Error("Encountered a chromosomal locus but no genome is available!")}else a=n.locus;const o=f=>{var h;return(h=r.mark.findDatumAt(f,a))==null?void 0:h[n.field]},[s,c]=Object.entries(r.getEncoding()).find(([f,h])=>"field"in h&&h.field==n.field),l=Ri(s)?r.getScaleResolution(s).getScale():void 0;return{name:n.field,attribute:t,title:$` <em class="attribute">${n.field}</em>
|
2821
2821
|
<span class="viewTitle">(${r.getTitleText()??r.name})</span>
|
2822
2822
|
${Kh(n.locus)?$`at
|
2823
2823
|
<span class="locus"
|
2824
2824
|
>${aE(n.locus)}</span
|
2825
|
-
>`:$`<span class="scalar">of ${a}</span>`}`,accessor:o,type:"type"in c?c.type:void 0,scale:l}}const F_="VALUE_AT_LOCUS";class bb extends qn{constructor(n,r,i,a,o,s){super(n,r,i,a,o);Z(this,ip);Z(this,ap);Z(this,op);Z(this,Ef);Z(this,sp);Z(this,cp);Z(this,lp);Z(this,ot,void 0);Z(this,Ht,void 0);Z(this,Af,-1);Z(this,_c,!1);this.provenance=s,this.spec=n,le(this,_c,n.stickySummaries??!0),this.compositeAttributeInfoSource=new gj,this.childCoords=Wn.ZERO,this.sidebarCoords=Wn.ZERO,this.locationManager=new mj({getSampleHierarchy:()=>this.sampleHierarchy,getHeight:()=>this.childCoords.height,getSummaryHeight:()=>P(this,ot).summaryViews.getSize().height.px,onLocationUpdate:()=>{this.groupPanel.updateGroups()},viewContext:this.context,isStickySummaries:()=>P(this,_c)}),this.provenance.storeHelper.subscribe(Vd(f=>tb(f).rootGroup,f=>{var h;this.locationManager.reset(),(h=this.groupPanel)==null||h.updateGroups(),this.context.requestLayoutReflow(),this.context.animator.requestRender()})),this.provenance.storeHelper.subscribe(Vd(f=>tb(f).sampleData,f=>{const h=f&&Object.values(f.entities);h&&(this.metadataView.setSamples(h),this.groupPanel.updateGroups())})),this.compositeAttributeInfoSource.addAttributeInfoSource(F_,f=>yj(this,f)),this._addBroadcastHandler("dataLoaded",()=>J(this,ap,JT).call(this)),this._addBroadcastHandler("layout",()=>{this.locationManager.resetLocations()}),this.addInteractionEventListener("mousemove",(f,h)=>{le(this,Af,h.point.y-this.childCoords.y)}),this.addInteractionEventListener("wheel",(f,h)=>{const d=h.uiEvent;this.locationManager.isCloseup()&&!d.ctrlKey&&(this.locationManager.handleWheelEvent(d),this.groupPanel.updateRange(),this.context.animator.requestRender(),h.uiEvent={type:d.type,deltaX:d.deltaX,preventDefault:d.preventDefault.bind(d)})},!0),r.addKeyboardListener("keydown",f=>{f.code=="KeyE"&&!f.repeat&&J(this,Ef,nv).call(this)}),r.addKeyboardListener("keyup",f=>{f.code=="KeyE"&&this.locationManager.togglePeek(!1)});const c=f=>this.compositeAttributeInfoSource.getAttributeInfo(f),l=_V(c);this.provenance.addReducer(l.name,l.reducer),this.provenance.addActionInfoSource(f=>kV(f,c)),this.actions=l.actions;const u=GG(f=>{var h;return(h=f.sampleData)==null?void 0:h.entities},f=>f&&Object.values(f));this.getSamples=()=>u(this.sampleHierarchy),this.spec.samples.data&&J(this,ip,KT).call(this)}async initializeChildren(){le(this,ot,new xj(this.context.createView(this.spec.spec,this,this,"sample-facets"),this,0,this.spec.view)),le(this,Ht,new ys({title:"Sidebar",resolve:{scale:{default:"independent"},axis:{default:"independent"}},encoding:{y:null,facetIndex:null},hconcat:[],spacing:0},this.context,this,this,"sample-sidebar")),this.groupPanel=new pj(this,P(this,Ht)),this.metadataView=new R_(this,P(this,Ht)),P(this,Ht).setChildren([this.groupPanel,this.metadataView]),P(this,ot).view instanceof qn&&await P(this,ot).view.initializeChildren(),P(this,ot).summaryViews instanceof qn&&await P(this,ot).summaryViews.initializeChildren(),await P(this,ot).createAxes(),await J(this,lp,rI).call(this),await P(this,ot).summaryViews.createAxes(),await this.groupPanel.initializeChildren(),await this.metadataView.initializeChildren(),P(this,ot).view.addInteractionEventListener("contextmenu",J(this,sp,tI).bind(this))}getOverhang(){let n=P(this,Ht).isConfiguredVisible()?P(this,Ht).getSize().width.px+P(this,Ht).getPadding().horizontalTotal:0;return new Ct(0,0,0,n).add(P(this,ot).getOverhang())}getSize(){return this._cache("size/size2",()=>{const n=super.getSize(),r=a=>a.getSize().addPadding(a.getOverhang()).addPadding(a.getPadding()),i=$L([P(this,Ht),P(this,ot).view].map(a=>r(a).width));return new Gr(i,n.height)})}*[Symbol.iterator](){yield P(this,Ht),yield*P(this,ot).getChildren()}get sampleHierarchy(){return this.provenance.getPresentState()[Cs]}get leafSamples(){return nb(this.sampleHierarchy).map(r=>r.at(-1)).map(r=>r.samples).flat()}getSampleAt(n){const r=bj(n,this.locationManager.getLocations().samples);if(r)return this.sampleHierarchy.sampleData.entities[r.key]}render(n,r,i={}){if(super.render(n,r,i),!this.isConfiguredVisible())return;this.layoutParent||(r=r.shrink(this.getPadding())),r=r.shrink(P(this,ot).getOverhang()),n.pushView(this,r);const a=Fl([P(this,Ht).isConfiguredVisible()?P(this,Ht).getSize().width:{px:0},{grow:1}],r.width),o=s=>r.modify({x:s.location+r.x,width:s.size});this.sidebarCoords=o(a[0]),this.childCoords=o(a[1]),P(this,Ht).render(n,this.sidebarCoords,i),J(this,op,eI).call(this,n,this.childCoords,i),n.popView(this)}onBeforeRender(){this.locationManager.updateFacetTexture()}getSampleFacetTexture(){return this.locationManager.getFacetTexture()}makePeekMenuItem(){return{...this.locationManager.isCloseup()?{label:"Close closeup",callback:()=>this.locationManager.togglePeek(!1),icon:_$}:{label:"Open closeup",callback:()=>J(this,Ef,nv).call(this),icon:k$},shortcut:"E"}}findSampleForMouseEvent(n,r){return this.getSampleAt(r.point.y-this.childCoords.y)}propagateInteractionEvent(n){this.handleInteractionEvent(void 0,n,!0),!n.stopped&&(this.childCoords.containsPoint(n.point.x,n.point.y)&&(P(this,ot).view.propagateInteractionEvent(n),$E(n,this.childCoords,r=>J(this,cp,nI).call(this,this.childCoords,P(this,ot).view,r),this.context.getCurrentHover())),this.sidebarCoords.containsPoint(n.point.x,n.point.y)&&P(this,Ht).propagateInteractionEvent(n),!n.stopped&&this.handleInteractionEvent(void 0,n,!1))}getDefaultResolution(n,r){if(r=="axis")return"independent";switch(n){case"x":case"sample":return"shared";default:return"independent"}}}ot=new WeakMap,Ht=new WeakMap,Af=new WeakMap,_c=new WeakMap,ip=new WeakSet,KT=function(){if(!this.spec.samples.data)throw new Error("SampleView has no explicit sample metadata specified! Cannot load anything.");const{dataSource:n,collector:r}=$z(AE(this.spec.samples.data,this),new vj);r.observers.push(a=>{const o=a.getData();this.provenance.storeHelper.dispatch(this.actions.setSamples({samples:o}))});const i="samples "+this.getPathString();this.context.dataFlow.addDataSource(n,i)},ap=new WeakSet,JT=function(){if(this.getSamples())return;const n=this.getScaleResolution("sample");if(n){const r=[...n.getDataDomain()].map((i,a)=>({id:i,displayName:i,indexNumber:a,attributes:[]}));this.provenance.storeHelper.dispatch(this.actions.setSamples({samples:r}))}else throw new Error("No explicit sample data nor sample channels found!")},op=new WeakSet,eI=function(n,r,i={}){var g,b,v,x;const a=P(this,ot),o=a.groupBackground||Object.values(a.axes).length?this.locationManager.getGroupBackgroundRects(this.childCoords):[];for(const{coords:A,clipRect:w}of o){(g=a.groupBackground)==null||g.render(n,A,i);for(const _ of Object.values(a.gridLines))_.render(n,A,{...i,clipRect:w})}const s=1/r.height,c=()=>s,l=this.locationManager.clipBySummary(r),u=this.locationManager.getLocations(),f=u.samples.map(A=>({...i,sampleFacetRenderingOptions:{locSize:jL(A.locSize,c)},facetId:[A.key],clipRect:l}));for(const A of f)(b=a.background)==null||b.render(n,r,A),a.view.render(n,r,A),(v=a.backgroundStroke)==null||v.render(n,r,A);for(const{coords:A}of o)(x=a.groupBackgroundStroke)==null||x.render(n,A,i);for(const[A,w]of Object.entries(a.axes))w.render(n,e1(r,A,w));const h=a.summaryViews,d=h.getOverhang().getHorizontal();i={...i,clipRect:r.expand(d)};const p=h.getSize().height.px;for(const[A,w]of u.summaries.entries()){const _=()=>{const I=w.locSize.location;let D=r.y+I;return P(this,_c)?D+Ai(-I,0,w.locSize.size-p):D},C=r.modify({y:_,height:p}).expand(d);h.render(n,C,{...i,facetId:[A]})}},Ef=new WeakSet,nv=function(){var i;const n=P(this,Af),r=(i=this.getSampleAt(n))==null?void 0:i.id;this.locationManager.togglePeek(void 0,n,r)},sp=new WeakSet,tI=function(n,r){var g,b;const i=r.uiEvent,a=this.childCoords.normalizePoint(r.point.x,r.point.y).x,o=this.findSampleForMouseEvent(n,r),s=P(this,ot).view,c=s.getScaleResolution("x"),l=c.invertToComplex(a),u=DE(this.getLayoutAncestors().at(-1)),f=(g=s.getAxisResolution("x"))==null?void 0:g.getTitle(),h=qz(s).filter(v=>!["sample","x","x2"].includes(v.channel)).filter(v=>["rect","rule"].includes(v.view.getMarkType())).filter(v=>u.has(v.view.name));let d=[this.makePeekMenuItem(),pb,{label:c.type==="locus"?`Locus: ${aE(l)}`:`${f?f+": ":""}${l}`,type:"header"},pb],p="";for(const[v,x]of h.entries()){const A={view:x.view.name,field:x.field,locus:l},w=this.compositeAttributeInfoSource.getAttributeInfo({type:F_,specifier:A}),_=x.view.getTitleText()??x.view.spec.name;_!=p&&(v>0&&d.push({type:"divider"}),d.push({label:_,type:"header"}),p=_);const C=c.getScale(),I="invert"in C&&o?(b=x.view.mark.findDatumAt(o.id,C.invert(a)))==null?void 0:b[x.field]:void 0;d.push({label:x.field,submenu:ib(null,w,I,this)})}gb({items:d},i)},cp=new WeakSet,nI=function(n,r,i){const a=P(this,ot).view.getScaleResolution("x");if(!a||!a.isZoomable())return;const o=n.normalizePoint(i.x,i.y),s=n.normalizePoint(i.x+i.xDelta,i.y+i.yDelta);a.zoom(2**i.zDelta,o.x,s.x-o.x),this.context.animator.requestRender()},lp=new WeakSet,rI=async function(){const n=[];for(const r of P(this,ot).view.getDescendants()){const i=r.spec;if(LU(i))for(const a of i.aggregateSamples){const o=a.transform??[];o.length&&o.at(-1).type!="collect"&&o.push({type:"collect"}),o.push({type:"mergeFacets"}),a.transform=o,a.encoding={...a.encoding??{},sample:null};const s=this.context.createView(a,this,r,"summaryView");s instanceof qn&&await s.initializeChildren(),s.getFacetFields=c=>{},n.push(s)}}P(this,ot).summaryViews.setChildren(n)};class vj extends at{constructor(){super(),this.reset()}reset(){this._index=0}handle(t){this._propagate({id:t.sample,displayName:t.displayName||t.sample,indexNumber:this._index++,attributes:wj(t)})}}function wj(e){const t=Object.assign({},e);return delete t.sample,delete t.displayName,t}class xj extends t1{constructor(t,n,r,i){super(t,n,r),this.groupBackground=void 0,this.groupBackgroundStroke=void 0;const a=HE(i);a&&(this.groupBackground=new mt(a,n.context,n,t,"sample-group-background-"+r,{blockEncodingInheritance:!0}));const o=GE(i);o&&(this.groupBackgroundStroke=new mt(o,n.context,n,t,"sample-group-background-stroke-"+r,{blockEncodingInheritance:!0})),this.summaryViews=new ys({configurableVisibility:!1,resolve:{axis:{x:"independent"}},spacing:0,vconcat:[]},n.context,n,n,"sampleSummaries")}*getChildren(){this.groupBackground&&(yield this.groupBackground),this.groupBackgroundStroke&&(yield this.groupBackgroundStroke),yield this.summaryViews,yield*super.getChildren()}}const Aj=(e,t)=>t.some(n=>e instanceof n);let P_,M_;function Ej(){return P_||(P_=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Sj(){return M_||(M_=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const O_=new WeakMap,yb=new WeakMap,L_=new WeakMap,vb=new WeakMap,wb=new WeakMap;function _j(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{n(ji(e.result)),i()},o=()=>{r(e.error),i()};e.addEventListener("success",a),e.addEventListener("error",o)});return t.then(n=>{n instanceof IDBCursor&&O_.set(n,e)}).catch(()=>{}),wb.set(t,e),t}function Cj(e){if(yb.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{n(),i()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});yb.set(e,t)}let xb={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return yb.get(e);if(t==="objectStoreNames")return e.objectStoreNames||L_.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return ji(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function kj(e){xb=e(xb)}function Tj(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Ab(this),t,...n);return L_.set(r,t.sort?t.sort():[t]),ji(r)}:Sj().includes(e)?function(...t){return e.apply(Ab(this),t),ji(O_.get(this))}:function(...t){return ji(e.apply(Ab(this),t))}}function Ij(e){return typeof e=="function"?Tj(e):(e instanceof IDBTransaction&&Cj(e),Aj(e,Ej())?new Proxy(e,xb):e)}function ji(e){if(e instanceof IDBRequest)return _j(e);if(vb.has(e))return vb.get(e);const t=Ij(e);return t!==e&&(vb.set(e,t),wb.set(t,e)),t}const Ab=e=>wb.get(e);function Rj(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){const o=indexedDB.open(e,t),s=ji(o);return r&&o.addEventListener("upgradeneeded",c=>{r(ji(o.result),c.oldVersion,c.newVersion,ji(o.transaction),c)}),n&&o.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),s.then(c=>{a&&c.addEventListener("close",()=>a()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),s}const Dj=["get","getKey","getAll","getAllKeys","count"],Bj=["put","add","delete","clear"],Eb=new Map;function N_(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Eb.get(t))return Eb.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=Bj.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Dj.includes(n)))return;const a=async function(o,...s){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(s.shift())),(await Promise.all([l[n](...s),i&&c.done]))[0]};return Eb.set(t,a),a}kj(e=>({...e,get:(t,n,r)=>N_(t,n)||e.get(t,n,r),has:(t,n)=>!!N_(t,n)||e.has(t,n)}));class z_{isReadonly(){return!0}async put(t,n){this._checkReadonly()}async delete(t){this._checkReadonly()}async getNames(){return[]}async get(t){}_checkReadonly(){if(this.isReadonly())throw new Error("This bookmark")}}const su="bookmarks";class Fj extends z_{constructor(t){super(),this.specId=t,this._db=void 0}async _getDB(){if(!this._db){const t=`GenomeSpy: ${this.specId}`;this._db=Rj(t,1,{upgrade(n,r,i,a){n.createObjectStore(su,{keyPath:"name"})},blocked(){},blocking(){},terminated(){}})}return this._db}isReadonly(){return!1}async put(t,n){const i=(await this._getDB()).transaction(su,"readwrite");try{n?(await i.store.delete(n),await i.store.put(t)):await i.store.put(t),await i.done}catch(a){throw i.abort(),a}}async delete(t){(await this._getDB()).delete(su,t)}async getNames(){return(await this._getDB()).getAllKeys(su)}async get(t){return(await this._getDB()).get(su,t)}}/**
|
2825
|
+
>`:$`<span class="scalar">of ${a}</span>`}`,accessor:o,type:"type"in c?c.type:void 0,scale:l}}const F_="VALUE_AT_LOCUS";class bb extends qn{constructor(n,r,i,a,o,s){super(n,r,i,a,o);Z(this,ip);Z(this,ap);Z(this,op);Z(this,Ef);Z(this,sp);Z(this,cp);Z(this,lp);Z(this,ot,void 0);Z(this,Ht,void 0);Z(this,Af,-1);Z(this,_c,!1);this.provenance=s,this.spec=n,le(this,_c,n.stickySummaries??!0),this.compositeAttributeInfoSource=new gj,this.childCoords=Wn.ZERO,this.sidebarCoords=Wn.ZERO,this.locationManager=new mj({getSampleHierarchy:()=>this.sampleHierarchy,getHeight:()=>this.childCoords.height,getSummaryHeight:()=>P(this,ot).summaryViews.getSize().height.px,onLocationUpdate:()=>{this.groupPanel.updateGroups()},viewContext:this.context,isStickySummaries:()=>P(this,_c)}),this.provenance.storeHelper.subscribe(Vd(f=>tb(f).rootGroup,f=>{var h;this.locationManager.reset(),(h=this.groupPanel)==null||h.updateGroups(),this.context.requestLayoutReflow(),this.context.animator.requestRender()})),this.provenance.storeHelper.subscribe(Vd(f=>tb(f).sampleData,f=>{const h=f&&Object.values(f.entities);h&&(this.metadataView.setSamples(h),this.groupPanel.updateGroups())})),this.compositeAttributeInfoSource.addAttributeInfoSource(F_,f=>yj(this,f)),this._addBroadcastHandler("dataLoaded",()=>J(this,ap,JT).call(this)),this._addBroadcastHandler("layout",()=>{this.locationManager.resetLocations()}),this.addInteractionEventListener("mousemove",(f,h)=>{le(this,Af,h.point.y-this.childCoords.y)}),this.addInteractionEventListener("wheel",(f,h)=>{const d=h.uiEvent;this.locationManager.isCloseup()&&!d.ctrlKey&&(this.locationManager.handleWheelEvent(d),this.groupPanel.updateRange(),this.context.animator.requestRender(),h.uiEvent={type:d.type,deltaX:d.deltaX,preventDefault:d.preventDefault.bind(d)})},!0),r.addKeyboardListener("keydown",f=>{f.code=="KeyE"&&!f.repeat&&J(this,Ef,nv).call(this)}),r.addKeyboardListener("keyup",f=>{f.code=="KeyE"&&this.locationManager.togglePeek(!1)});const c=f=>this.compositeAttributeInfoSource.getAttributeInfo(f),l=_V(c);this.provenance.addReducer(l.name,l.reducer),this.provenance.addActionInfoSource(f=>kV(f,c)),this.actions=l.actions;const u=GG(f=>{var h;return(h=f.sampleData)==null?void 0:h.entities},f=>f&&Object.values(f));this.getSamples=()=>u(this.sampleHierarchy),this.spec.samples.data&&J(this,ip,KT).call(this)}async initializeChildren(){le(this,ot,new xj(this.context.createView(this.spec.spec,this,this,"sample-facets"),this,0,this.spec.view)),le(this,Ht,new ys({title:"Sidebar",resolve:{scale:{default:"independent"},axis:{default:"independent"}},encoding:{y:null,facetIndex:null},hconcat:[],spacing:0},this.context,this,this,"sample-sidebar")),this.groupPanel=new pj(this,P(this,Ht)),this.metadataView=new R_(this,P(this,Ht)),P(this,Ht).setChildren([this.groupPanel,this.metadataView]),P(this,ot).view instanceof qn&&await P(this,ot).view.initializeChildren(),P(this,ot).summaryViews instanceof qn&&await P(this,ot).summaryViews.initializeChildren(),await P(this,ot).createAxes(),await J(this,lp,rI).call(this),await P(this,ot).summaryViews.createAxes(),await this.groupPanel.initializeChildren(),await this.metadataView.initializeChildren(),P(this,ot).view.addInteractionEventListener("contextmenu",J(this,sp,tI).bind(this))}getOverhang(){let n=P(this,Ht).isConfiguredVisible()?P(this,Ht).getSize().width.px+P(this,Ht).getPadding().horizontalTotal:0;return new Ct(0,0,0,n).add(P(this,ot).getOverhang())}getSize(){return this._cache("size/size2",()=>{const n=super.getSize(),r=a=>a.getSize().addPadding(a.getOverhang()).addPadding(a.getPadding()),i=$L([P(this,Ht),P(this,ot).view].map(a=>r(a).width));return new Gr(i,n.height)})}*[Symbol.iterator](){yield P(this,Ht),yield*P(this,ot).getChildren()}get sampleHierarchy(){return this.provenance.getPresentState()[Cs]}get leafSamples(){return nb(this.sampleHierarchy).map(r=>r.at(-1)).map(r=>r.samples).flat()}getSampleAt(n){const r=bj(n,this.locationManager.getLocations().samples);if(r)return this.sampleHierarchy.sampleData.entities[r.key]}render(n,r,i={}){if(super.render(n,r,i),!this.isConfiguredVisible())return;this.layoutParent||(r=r.shrink(this.getPadding())),r=r.shrink(P(this,ot).getOverhang()),n.pushView(this,r);const a=Fl([P(this,Ht).isConfiguredVisible()?P(this,Ht).getSize().width:{px:0},{grow:1}],r.width),o=s=>r.modify({x:s.location+r.x,width:s.size});this.sidebarCoords=o(a[0]),this.childCoords=o(a[1]),P(this,Ht).render(n,this.sidebarCoords,i),J(this,op,eI).call(this,n,this.childCoords,i),n.popView(this)}onBeforeRender(){this.locationManager.updateFacetTexture()}getSampleFacetTexture(){return this.locationManager.getFacetTexture()}makePeekMenuItem(){return{...this.locationManager.isCloseup()?{label:"Close closeup",callback:()=>this.locationManager.togglePeek(!1),icon:_$}:{label:"Open closeup",callback:()=>J(this,Ef,nv).call(this),icon:k$},shortcut:"E"}}findSampleForMouseEvent(n,r){return this.getSampleAt(r.point.y-this.childCoords.y)}propagateInteractionEvent(n){this.handleInteractionEvent(void 0,n,!0),!n.stopped&&(this.childCoords.containsPoint(n.point.x,n.point.y)&&(P(this,ot).view.propagateInteractionEvent(n),$E(n,this.childCoords,r=>J(this,cp,nI).call(this,this.childCoords,P(this,ot).view,r),this.context.getCurrentHover())),this.sidebarCoords.containsPoint(n.point.x,n.point.y)&&P(this,Ht).propagateInteractionEvent(n),!n.stopped&&this.handleInteractionEvent(void 0,n,!1))}getDefaultResolution(n,r){if(r=="axis")return"independent";switch(n){case"x":case"sample":return"shared";default:return"independent"}}}ot=new WeakMap,Ht=new WeakMap,Af=new WeakMap,_c=new WeakMap,ip=new WeakSet,KT=function(){if(!this.spec.samples.data)throw new Error("SampleView has no explicit sample metadata specified! Cannot load anything.");const{dataSource:n,collector:r}=$z(AE(this.spec.samples.data,this),new vj);r.observers.push(a=>{const o=a.getData();this.provenance.storeHelper.dispatch(this.actions.setSamples({samples:o}))});const i="samples "+this.getPathString();this.context.dataFlow.addDataSource(n,i)},ap=new WeakSet,JT=function(){if(this.getSamples())return;const n=this.getScaleResolution("sample");if(n){const r=[...n.getDataDomain()].map((i,a)=>({id:i,displayName:i,indexNumber:a,attributes:[]}));this.provenance.storeHelper.dispatch(this.actions.setSamples({samples:r}))}else throw new Error("No explicit sample data nor sample channels found!")},op=new WeakSet,eI=function(n,r,i={}){var g,b,v,x;const a=P(this,ot),o=a.groupBackground||Object.values(a.axes).length?this.locationManager.getGroupBackgroundRects(this.childCoords):[];for(const{coords:A,clipRect:w}of o){(g=a.groupBackground)==null||g.render(n,A,i);for(const _ of Object.values(a.gridLines))_.render(n,A,{...i,clipRect:w})}const s=1/r.height,c=()=>s,l=this.locationManager.clipBySummary(r),u=this.locationManager.getLocations(),f=u.samples.map(A=>({...i,sampleFacetRenderingOptions:{locSize:jL(A.locSize,c)},facetId:[A.key],clipRect:l}));for(const A of f)(b=a.background)==null||b.render(n,r,A),a.view.render(n,r,A),(v=a.backgroundStroke)==null||v.render(n,r,A);for(const{coords:A}of o)(x=a.groupBackgroundStroke)==null||x.render(n,A,i);for(const[A,w]of Object.entries(a.axes))w.render(n,e1(r,A,w));const h=a.summaryViews,d=h.getOverhang().getHorizontal();i={...i,clipRect:r.expand(d)};const p=h.getSize().height.px;for(const[A,w]of u.summaries.entries()){const _=()=>{const I=w.locSize.location;let D=r.y+I;return P(this,_c)?D+Ai(-I,0,w.locSize.size-p):D},C=r.modify({y:_,height:p}).expand(d);h.render(n,C,{...i,facetId:[A]})}},Ef=new WeakSet,nv=function(){var i;const n=P(this,Af),r=(i=this.getSampleAt(n))==null?void 0:i.id;this.locationManager.togglePeek(void 0,n,r)},sp=new WeakSet,tI=function(n,r){var g,b;const i=r.uiEvent,a=this.childCoords.normalizePoint(r.point.x,r.point.y).x,o=this.findSampleForMouseEvent(n,r),s=P(this,ot).view,c=s.getScaleResolution("x"),l=c.invertToComplex(a),u=DE(this.getLayoutAncestors().at(-1)),f=(g=s.getAxisResolution("x"))==null?void 0:g.getTitle(),h=qz(s).filter(v=>!["sample","x","x2"].includes(v.channel)).filter(v=>["rect","rule"].includes(v.view.getMarkType())).filter(v=>u.has(v.view.name));let d=[this.makePeekMenuItem(),pb,{label:c.type==="locus"?`Locus: ${aE(l)}`:`${f?f+": ":""}${l}`,type:"header"},pb],p="";for(const[v,x]of h.entries()){const A={view:x.view.name,field:x.field,locus:l},w=this.compositeAttributeInfoSource.getAttributeInfo({type:F_,specifier:A}),_=x.view.getTitleText()??x.view.spec.name;_!=p&&(v>0&&d.push({type:"divider"}),d.push({label:_,type:"header"}),p=_);const C=c.getScale(),I="invert"in C&&o?(b=x.view.mark.findDatumAt(o.id,C.invert(a)))==null?void 0:b[x.field]:void 0;d.push({label:x.field,submenu:ib(null,w,I,this)})}gb({items:d},i)},cp=new WeakSet,nI=function(n,r,i){const a=P(this,ot).view.getScaleResolution("x");if(!a||!a.isZoomable())return;const o=n.normalizePoint(i.x,i.y),s=n.normalizePoint(i.x+i.xDelta,i.y+i.yDelta);a.zoom(2**i.zDelta,o.x,s.x-o.x),this.context.animator.requestRender()},lp=new WeakSet,rI=async function(){const n=[];for(const r of P(this,ot).view.getDescendants()){const i=r.spec;if(LU(i))for(const a of i.aggregateSamples){const o=a.transform??[];o.length&&o.at(-1).type!="collect"&&o.push({type:"collect"}),o.push({type:"mergeFacets"}),a.transform=o,a.encoding={...a.encoding??{},sample:null};const s=this.context.createView(a,this,r,"summaryView");s instanceof qn&&await s.initializeChildren(),s.getFacetFields=c=>{},n.push(s)}}P(this,ot).summaryViews.setChildren(n)};class vj extends at{constructor(){super(),this.reset()}reset(){this._index=0}handle(t){this._propagate({id:t.sample,displayName:t.displayName||t.sample,indexNumber:this._index++,attributes:wj(t)})}}function wj(e){const t=Object.assign({},e);return delete t.sample,delete t.displayName,t}class xj extends t1{constructor(t,n,r,i){super(t,n,r),this.groupBackground=void 0,this.groupBackgroundStroke=void 0;const a=HE(i);a&&(this.groupBackground=new mt(a,n.context,n,t,"sample-group-background-"+r,{blockEncodingInheritance:!0}));const o=GE(i);o&&(this.groupBackgroundStroke=new mt(o,n.context,n,t,"sample-group-background-stroke-"+r,{blockEncodingInheritance:!0})),this.summaryViews=new ys({configurableVisibility:!1,resolve:{axis:{x:"independent"}},spacing:0,vconcat:[]},n.context,n,n,"sampleSummaries")}*getChildren(){this.groupBackground&&(yield this.groupBackground),this.groupBackgroundStroke&&(yield this.groupBackgroundStroke),yield this.summaryViews,yield*super.getChildren()}}const Aj=(e,t)=>t.some(n=>e instanceof n);let P_,M_;function Ej(){return P_||(P_=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Sj(){return M_||(M_=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const O_=new WeakMap,yb=new WeakMap,L_=new WeakMap,vb=new WeakMap,wb=new WeakMap;function _j(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",a),e.removeEventListener("error",o)},a=()=>{n(qi(e.result)),i()},o=()=>{r(e.error),i()};e.addEventListener("success",a),e.addEventListener("error",o)});return t.then(n=>{n instanceof IDBCursor&&O_.set(n,e)}).catch(()=>{}),wb.set(t,e),t}function Cj(e){if(yb.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",o),e.removeEventListener("abort",o)},a=()=>{n(),i()},o=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",a),e.addEventListener("error",o),e.addEventListener("abort",o)});yb.set(e,t)}let xb={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return yb.get(e);if(t==="objectStoreNames")return e.objectStoreNames||L_.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return qi(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function kj(e){xb=e(xb)}function Tj(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Ab(this),t,...n);return L_.set(r,t.sort?t.sort():[t]),qi(r)}:Sj().includes(e)?function(...t){return e.apply(Ab(this),t),qi(O_.get(this))}:function(...t){return qi(e.apply(Ab(this),t))}}function Ij(e){return typeof e=="function"?Tj(e):(e instanceof IDBTransaction&&Cj(e),Aj(e,Ej())?new Proxy(e,xb):e)}function qi(e){if(e instanceof IDBRequest)return _j(e);if(vb.has(e))return vb.get(e);const t=Ij(e);return t!==e&&(vb.set(e,t),wb.set(t,e)),t}const Ab=e=>wb.get(e);function Rj(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){const o=indexedDB.open(e,t),s=qi(o);return r&&o.addEventListener("upgradeneeded",c=>{r(qi(o.result),c.oldVersion,c.newVersion,qi(o.transaction),c)}),n&&o.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),s.then(c=>{a&&c.addEventListener("close",()=>a()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),s}const Dj=["get","getKey","getAll","getAllKeys","count"],Bj=["put","add","delete","clear"],Eb=new Map;function N_(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Eb.get(t))return Eb.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=Bj.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Dj.includes(n)))return;const a=async function(o,...s){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return r&&(l=l.index(s.shift())),(await Promise.all([l[n](...s),i&&c.done]))[0]};return Eb.set(t,a),a}kj(e=>({...e,get:(t,n,r)=>N_(t,n)||e.get(t,n,r),has:(t,n)=>!!N_(t,n)||e.has(t,n)}));class z_{isReadonly(){return!0}async put(t,n){this._checkReadonly()}async delete(t){this._checkReadonly()}async getNames(){return[]}async get(t){}_checkReadonly(){if(this.isReadonly())throw new Error("This bookmark")}}const su="bookmarks";class Fj extends z_{constructor(t){super(),this.specId=t,this._db=void 0}async _getDB(){if(!this._db){const t=`GenomeSpy: ${this.specId}`;this._db=Rj(t,1,{upgrade(n,r,i,a){n.createObjectStore(su,{keyPath:"name"})},blocked(){},blocking(){},terminated(){}})}return this._db}isReadonly(){return!1}async put(t,n){const i=(await this._getDB()).transaction(su,"readwrite");try{n?(await i.store.delete(n),await i.store.put(t)):await i.store.put(t),await i.done}catch(a){throw i.abort(),a}}async delete(t){(await this._getDB()).delete(su,t)}async getNames(){return(await this._getDB()).getAllKeys(su)}async get(t){return(await this._getDB()).get(su,t)}}/**
|
2826
2826
|
* @license
|
2827
2827
|
* Copyright 2017 Google LLC
|
2828
2828
|
* SPDX-License-Identifier: BSD-3-Clause
|
@@ -2830,11 +2830,11 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2830
2830
|
* @license
|
2831
2831
|
* Copyright 2020 Google LLC
|
2832
2832
|
* SPDX-License-Identifier: BSD-3-Clause
|
2833
|
-
*/const H_=()=>new Lj;let Lj=class{};const Sb=new WeakMap,G_=
|
2833
|
+
*/const H_=()=>new Lj;let Lj=class{};const Sb=new WeakMap,G_=Da(class extends $_{render(e){return ue}update(e,[t]){var r;const n=t!==this.G;return n&&this.G!==void 0&&this.ot(void 0),(n||this.rt!==this.lt)&&(this.G=t,this.ct=(r=e.options)==null?void 0:r.host,this.ot(this.lt=e.element)),ue}ot(e){if(typeof this.G=="function"){const t=this.ct??globalThis;let n=Sb.get(t);n===void 0&&(n=new WeakMap,Sb.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ct,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ct,e)}else this.G.value=e}get rt(){var e,t;return typeof this.G=="function"?(e=Sb.get(this.ct??globalThis))==null?void 0:e.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});/**
|
2834
2834
|
* @license
|
2835
2835
|
* Copyright 2018 Google LLC
|
2836
2836
|
* SPDX-License-Identifier: BSD-3-Clause
|
2837
|
-
*/const Nj={},zj=
|
2837
|
+
*/const Nj={},zj=Da(class extends Zo{constructor(){super(...arguments),this.nt=Nj}render(e,t){return t()}update(e,[t,n]){if(Array.isArray(t)){if(Array.isArray(this.nt)&&this.nt.length===t.length&&t.every((r,i)=>r===this.nt[i]))return Dt}else if(this.nt===t)return Dt;return this.nt=Array.isArray(t)?Array.from(t):t,this.render(t,n)}});class Uj extends mr{constructor(){super(),this.inputRef=H_(),this.app=void 0,this.getDefaultValue=()=>"",this._keyListener=this._onKeyDown.bind(this),this._documentClickListener=t=>{var n;t.target!==this._inputField&&((n=this._inputField)==null||n.blur())},this._focused=!1}get genomeSpy(){return this.app.genomeSpy}get _inputField(){return this.inputRef.value}static get properties(){return{app:{type:Object}}}connectedCallback(){super.connectedCallback(),this._initializeGenome(),document.addEventListener("keydown",this._keyListener),document.addEventListener("click",this._documentClickListener)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._keyListener),document.removeEventListener("click",this._documentClickListener)}createRenderRoot(){return this}_onKeyDown(t){switch(t.code){case"KeyF":t.metaKey||t.altKey||t.ctrlKey||(t.preventDefault(),this.inputRef.value.focus());break}}_initializeGenome(){const t=V_(this.genomeSpy.viewRoot);t&&(this._genomeResolution=t,this._genome=this.genomeSpy.genomeStore.getGenome(),this.getDefaultValue=()=>this._genome.formatInterval(t.getDomain()),t.addEventListener("domain",bs(()=>this.requestUpdate(),60,!1)))}async searchViews(t){var r;const n=new Intl.Collator("en",{usage:"search",sensitivity:"base"});for(const i of this.genomeSpy.getSearchableViews()){const a=i.getAccessor("search"),o=i.getAccessor("x"),s=i.getAccessor("x2"),c=i.getScaleResolution("x");if(!(!o||!s||!(c!=null&&c.isZoomable()))){for(const l of((r=i.getCollector())==null?void 0:r.getData())??[])if(n.compare(a(l),t)===0){const u=mp([o(l),s(l)],null,1.2);return await c.zoomTo(u),!0}}}return!1}async search(t){await(async()=>{if(this._genomeResolution&&this._genome){const r=this._genome.parseInterval(t);if(r){this._genomeResolution.zoomTo(r);return}if(await this.searchViews(t))return;this.genomeSpy.viewRoot.visit(i=>{i instanceof R_&&i.handleVerboseCommand(t)})}})(),this._inputField.value=this.getDefaultValue(),this.requestUpdate()}_onSearchHelpClicked(t){const n=t.target;n.tagName=="LI"&&this._doExampleSearch(n.innerText)}_onSearchFocused(t){const n=t.target;switch(t.type){case"focus":this._focused=!0,n.select();break;case"blur":this._focused=!1;break}}_onSearchKeyDown(t){const n=t.target;t.code=="Enter"?(t.preventDefault(),this.search(n.value).then(()=>{n.focus(),n.select()}).catch(r=>{console.log(r),alert(r)})):t.code=="Escape"?n.blur():t.stopPropagation()}_doExampleSearch(t){$j(t,this._inputField).then(()=>{this._inputField.blur(),this.search(t)})}_getSearchHelp(){var r,i;const t=[];t.push($`
|
2838
2838
|
<p>Focus to a specific range. Examples:</p>
|
2839
2839
|
<ul>
|
2840
2840
|
<!-- TODO: Display only when using a genomic coordinate system-->
|
@@ -2871,11 +2871,11 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2871
2871
|
/>
|
2872
2872
|
${zj([123],()=>this._getSearchHelp())}
|
2873
2873
|
</div>
|
2874
|
-
`}}customElements.define("genome-spy-search-field",Uj);function $j(e,t){return new Promise(n=>{let r=0;const i=700/e.length+30;function a(){t.value=e.substring(0,r),r>=e.length?setTimeout(n,500):(r++,setTimeout(a,Math.random()*i*2))}a()})}function V_(e){let t;return e.visit(n=>{for(const r of["x","y"]){const i=n.resolutions.scale[r];if(i&&i.type=="locus"&&i.isZoomable())return t=i,Qa}}),t}const j_="data:image/svg+xml,%3csvg%20viewBox='0%200%2032%2032'%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20clip-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-miterlimit='1.5'%3e%3cpath%20d='M4.7%2021.2s.4%202.3%201.3%203.6C7%2026%209.8%2028%209.8%2028s3.4-2.6%206.4-8.5c0%200%201%20.1%201.9-.4.9-.6.8-.4%201-1.2%200%200%202.9.5%206.6%200%202.1-.3%204.3-1%206.2-2.5%200%200-1.1-1.7-2.5-5.1-.5-1.3-2-1.8-4.6-4.6l-8.2%208.6-11.9%206.9z'%20fill-opacity='.1'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='%237fbbdd'/%3e%3cpath%20d='M12.4%2015.5c-.7-.5-2.4-.8-4.4-.4-2%20.4-4%201.3-4.8%201.8-.5.3-1.2%201-1.2%201.4%200%20.7.3%201.8.8%202.4.3.3.7.5%201.4.6.8%200%202.5-1.4%203.5-2%201-.6%201.6-.8%202.7-1.2l-2.9%202.4c-1.3%201.2-2.2%201.5-2.4%202.3%200%20.5%200%201.4.5%201.8.4.5.6.8%201.6.8.6%200%201%200%202.6-1.5.9-.9%202.3-3%202.7-3.7.6-1.1%201-2.2.7-3-.2-1-.4-1.4-.8-1.7zM17.4%2014.2c-.3-.5-.9-1.2-.2-2.5l1.9-3c.5-.8%202-2.3%202.6-2.6.6-.4%201.5-.6%202-.2.6.4%201%201%201.3%201.5.4.6.7%201.3.2%202-.7%201-1.6.9-2.8%201.7-1.2.8-1.9%201.2-2.5%201.9l3.8-1.8c1.3-.6%202.7-1.1%203.4-.7.8.5.8.7%201%201.4.3%201-.2%201.9-.8%202.4-.5.6-1.5.9-2.6%201.2-1.4.4-4.5%201-5.8.5-1.3-.5-1.3-1.4-1.5-1.8z'%20fill='%23fff'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='%237fbbdd'/%3e%3cpath%20d='M13.8%2015.3c.9.8.6%202%201.4%201.8%201-.2%201.4-.8%201.3-1.5%200-.7%200-.8-.4-1.6-.3-.7-1-1.1-2-.5-.7.5-1.4%201.3-1.4%201.3s.2-.3%201.1.5z'%20fill='%23fff'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3c/svg%3e",q_={name:"@genome-spy/app",description:"GenomeSpy-based visualization tool for multiple patient samples",author:{name:"Kari Lavikka",email:"kari.lavikka@helsinki.fi"},contributors:[],license:"MIT",version:"0.42.
|
2874
|
+
`}}customElements.define("genome-spy-search-field",Uj);function $j(e,t){return new Promise(n=>{let r=0;const i=700/e.length+30;function a(){t.value=e.substring(0,r),r>=e.length?setTimeout(n,500):(r++,setTimeout(a,Math.random()*i*2))}a()})}function V_(e){let t;return e.visit(n=>{for(const r of["x","y"]){const i=n.resolutions.scale[r];if(i&&i.type=="locus"&&i.isZoomable())return t=i,Qa}}),t}const j_="data:image/svg+xml,%3csvg%20viewBox='0%200%2032%2032'%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20clip-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-miterlimit='1.5'%3e%3cpath%20d='M4.7%2021.2s.4%202.3%201.3%203.6C7%2026%209.8%2028%209.8%2028s3.4-2.6%206.4-8.5c0%200%201%20.1%201.9-.4.9-.6.8-.4%201-1.2%200%200%202.9.5%206.6%200%202.1-.3%204.3-1%206.2-2.5%200%200-1.1-1.7-2.5-5.1-.5-1.3-2-1.8-4.6-4.6l-8.2%208.6-11.9%206.9z'%20fill-opacity='.1'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='%237fbbdd'/%3e%3cpath%20d='M12.4%2015.5c-.7-.5-2.4-.8-4.4-.4-2%20.4-4%201.3-4.8%201.8-.5.3-1.2%201-1.2%201.4%200%20.7.3%201.8.8%202.4.3.3.7.5%201.4.6.8%200%202.5-1.4%203.5-2%201-.6%201.6-.8%202.7-1.2l-2.9%202.4c-1.3%201.2-2.2%201.5-2.4%202.3%200%20.5%200%201.4.5%201.8.4.5.6.8%201.6.8.6%200%201%200%202.6-1.5.9-.9%202.3-3%202.7-3.7.6-1.1%201-2.2.7-3-.2-1-.4-1.4-.8-1.7zM17.4%2014.2c-.3-.5-.9-1.2-.2-2.5l1.9-3c.5-.8%202-2.3%202.6-2.6.6-.4%201.5-.6%202-.2.6.4%201%201%201.3%201.5.4.6.7%201.3.2%202-.7%201-1.6.9-2.8%201.7-1.2.8-1.9%201.2-2.5%201.9l3.8-1.8c1.3-.6%202.7-1.1%203.4-.7.8.5.8.7%201%201.4.3%201-.2%201.9-.8%202.4-.5.6-1.5.9-2.6%201.2-1.4.4-4.5%201-5.8.5-1.3-.5-1.3-1.4-1.5-1.8z'%20fill='%23fff'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='%237fbbdd'/%3e%3cpath%20d='M13.8%2015.3c.9.8.6%202%201.4%201.8%201-.2%201.4-.8%201.3-1.5%200-.7%200-.8-.4-1.6-.3-.7-1-1.1-2-.5-.7.5-1.4%201.3-1.4%201.3s.2-.3%201.1.5z'%20fill='%23fff'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3c/svg%3e",q_={name:"@genome-spy/app",description:"GenomeSpy-based visualization tool for multiple patient samples",author:{name:"Kari Lavikka",email:"kari.lavikka@helsinki.fi"},contributors:[],license:"MIT",version:"0.42.2",main:"dist/index.js",type:"module",files:["dist/"],repository:{type:"git",url:"github:genome-spy/genome-spy",directory:"packages/app"},scripts:{dev:"node dev-server.mjs",build:"vite build","test:tsc":"tsc -p tsconfig.json --noEmit",prepublishOnly:"npm run build"},dependencies:{"@floating-ui/dom":"^0.5.0","@fortawesome/fontawesome-free":"^6.4.2","@fortawesome/fontawesome-svg-core":"^6.4.2","@fortawesome/free-solid-svg-icons":"^6.4.2","@genome-spy/core":"^0.42.2","@reduxjs/toolkit":"^1.8.4",idb:"^7.1.1",lit:"^3.1.0","lz-string":"^1.4.4",mapsort:"^1.0.5","redux-batched-actions":"^0.5.0","redux-undo":"^1.0.1",snarkdown:"^2.0.0"},gitHead:"dfeb11779563fcc77e9e82f6f536c6512136b550"};/**
|
2875
2875
|
* @license
|
2876
2876
|
* Copyright 2020 Google LLC
|
2877
2877
|
* SPDX-License-Identifier: BSD-3-Clause
|
2878
|
-
*/const Hj=
|
2878
|
+
*/const Hj=Da(class extends Zo{constructor(e){if(super(e),e.type!==sr.PROPERTY&&e.type!==sr.ATTRIBUTE&&e.type!==sr.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!iS(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===Dt||t===ue)return t;const n=e.element,r=e.name;if(e.type===sr.PROPERTY){if(t===n[r])return Dt}else if(e.type===sr.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(r))return Dt}else if(e.type===sr.ATTRIBUTE&&n.getAttribute(r)===t+"")return Dt;return oS(e),t}});function W_(e,t){return new CustomEvent("query-dependency",{detail:{name:e,setter:t},bubbles:!0})}function Gj(e){if(!(e!=null&&e.length))throw new Error("Can't nest an empty array!");const t=Y_(null);for(const n of e){if(!(n!=null&&n.length))throw new Error("Cannot nest, element has no path!");let r=t;for(const i of n){let a=r.children.find(o=>o.item===i);a||(a=Y_(i),r.children.push(a)),r=a}}return t.children[0]}const Y_=e=>({item:e,children:[]}),_b=new Set;function Cb(e){const n=e.currentTarget.parentNode,r=!n.classList.contains("show");for(const i of _b)i.classList.remove("show"),document.body.classList.remove(Ba);return _b.clear(),e.stopPropagation(),r?(_b.add(n),n.classList.add("show"),document.body.classList.add(Ba),window.addEventListener("click",i=>{n.classList.contains("show")&&(n.classList.remove("show"),document.body.classList.remove(Ba),i.preventDefault())},{once:!0})):window.dispatchEvent(new MouseEvent("click")),r}const kb={visibilities:{}},Ts=LS({name:"viewSettings",initialState:kb,reducers:{setVisibility:(e,t)=>{e.visibilities[t.payload.name]=t.payload.visibility},restoreDefaultVisibility:(e,t)=>{delete e.visibilities[t.payload]},restoreDefaultVisibilities:(e,t)=>kb,setViewSettings:(e,t)=>({...kb,...t.payload?t.payload:{}})}});class Vj extends mr{constructor(){super(),this.app=void 0,this.nestedPaths=void 0,this.sateWatcher=Vd(t=>t.viewSettings,(t,n)=>this.requestUpdate()),this.style.display="none"}connectedCallback(){super.connectedCallback(),this.dispatchEvent(W_("app",t=>{this.app=t})),this.app.addInitializationListener(()=>{this.updateToggles(),this.requestUpdate(),this.style.display=this.nestedPaths.children.length?"block":"none"}),this.app.storeHelper.subscribe(this.sateWatcher)}disconnectedCallback(){this.app.storeHelper.unsubscribe(this.sateWatcher)}createRenderRoot(){return this}toolButtonClicked(t){Cb(t)}handleCheckboxClick(t,n){const r=t.target.checked;this.app.storeHelper.dispatch(r!=n.isVisibleInSpec()?Ts.actions.setVisibility({name:n.name,visibility:r}):Ts.actions.restoreDefaultVisibility(n.name)),this.requestUpdate(),t.stopPropagation()}handleResetClick(){this.app.storeHelper.dispatch(Ts.actions.restoreDefaultVisibilities())}updateToggles(){const t=this.app.genomeSpy.viewRoot;if(!t)return;const n=[];for(const i of _E(t.getDescendants(),a=>a.dataParent))kE(i,{preOrder:a=>{const o=a.ref;if(o instanceof Km)return"skip";n.push(o)}});const r=n.filter(i=>Yz(i.name)&&Z_(i)).map(i=>[...i.getDataAncestors()].reverse());this.nestedPaths=Gj(r)}renderToggles(){const t=this.getVisibilities(),n=this.app.genomeSpy.viewRoot,r=DE(n);var i=(o,s=!0)=>o.length?$`
|
2879
2879
|
<ul class=${s?null:"unchecked"}>
|
2880
2880
|
${o.map(a)}
|
2881
2881
|
</ul>
|
@@ -2918,7 +2918,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2918
2918
|
</li>
|
2919
2919
|
</ul>
|
2920
2920
|
</div>
|
2921
|
-
`}getVisibilities(){return this.app.storeHelper.state.viewSettings.visibilities}}const Z_=e=>e.spec.configurableVisibility??!(e.layoutParent&&e.layoutParent instanceof Ka);customElements.define("genome-spy-view-visibility",Vj);class jj extends
|
2921
|
+
`}getVisibilities(){return this.app.storeHelper.state.viewSettings.visibilities}}const Z_=e=>e.spec.configurableVisibility??!(e.layoutParent&&e.layoutParent instanceof Ka);customElements.define("genome-spy-view-visibility",Vj);class jj extends mr{constructor(){super(),this.provenance=void 0}connectedCallback(){super.connectedCallback(),this.provenance.storeHelper.subscribe(()=>{this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback()}createRenderRoot(){return this}render(){const t=(r,i)=>{if(!r)return ue;const a=this.provenance.getActionInfo(r);return a?$`
|
2922
2922
|
<li>
|
2923
2923
|
<a
|
2924
2924
|
@click=${()=>this.provenance.activateState(i)}
|
@@ -2973,7 +2973,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
2973
2973
|
* @license
|
2974
2974
|
* Copyright 2017 Google LLC
|
2975
2975
|
* SPDX-License-Identifier: BSD-3-Clause
|
2976
|
-
*/const Q_=e=>!cG(e)&&typeof e.then=="function",X_=1073741823,Yj=Ra(class extends $_{constructor(){super(...arguments),this._$C_t=X_,this._$Cwt=[],this._$Cq=new qj(this),this._$CK=new Wj}render(...t){return t.find(n=>!Q_(n))??Dt}update(t,n){const r=this._$Cwt;let i=r.length;this._$Cwt=n;const a=this._$Cq,o=this._$CK;this.isConnected||this.disconnected();for(let s=0;s<n.length&&!(s>this._$C_t);s++){const c=n[s];if(!Q_(c))return this._$C_t=s,c;s<i&&c===r[s]||(this._$C_t=X_,i=0,Promise.resolve(c).then(async l=>{for(;o.get();)await o.get();const u=a.deref();if(u!==void 0){const f=u._$Cwt.indexOf(c);f>-1&&f<u._$C_t&&(u._$C_t=f,u.setValue(l))}}))}return Dt}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}});var Zj={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function K_(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function lu(e){return(e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Tb(e,t){var n,r,i,a,o,s=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,c=[],l="",u=t||{},f=0;function h(p){var g=Zj[p[1]||""],b=c[c.length-1]==p;return g?g[1]?(b?c.pop():c.push(p),g[0|b]):g[0]:p}function d(){for(var p="";c.length;)p+=h(c[c.length-1]);return p}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(p,g,b){return u[g.toLowerCase()]=b,""}).replace(/^\n+|\n+$/g,"");i=s.exec(e);)r=e.substring(f,i.index),f=s.lastIndex,n=i[0],r.match(/[^\\](\\\\)*\\$/)||((o=i[3]||i[4])?n='<pre class="code '+(i[4]?"poetry":i[2].toLowerCase())+'"><code'+(i[2]?' class="language-'+i[2].toLowerCase()+'"':"")+">"+K_(lu(o).replace(/^\n+|\n+$/g,""))+"</code></pre>":(o=i[6])?(o.match(/\./)&&(i[5]=i[5].replace(/^\d+/gm,"")),a=Tb(K_(i[5].replace(/^\s*[>*+.-]/gm,""))),o==">"?o="blockquote":(o=o.match(/\./)?"ol":"ul",a=a.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),n="<"+o+">"+a+"</"+o+">"):i[8]?n='<img src="'+lu(i[8])+'" alt="'+lu(i[7])+'">':i[10]?(l=l.replace("<a>",'<a href="'+lu(i[11]||u[r.toLowerCase()])+'">'),n=d()+"</a>"):i[9]?n="<a>":i[12]||i[14]?n="<"+(o="h"+(i[14]?i[14].length:i[13]>"="?1:2))+">"+Tb(i[12]||i[15],u)+"</"+o+">":i[16]?n="<code>"+lu(i[16])+"</code>":(i[17]||i[1])&&(n=h(i[17]||"--"))),l+=r,l+=n;return(l+e.substring(f)+d()).replace(/^\n+|\n+$/g,"")}function Qj(e,t={}){const n=Tb(e),r=new DOMParser().parseFromString(`<!DOCTYPE html><html><body><div>${n}</div></body></html>`,"text/html");r.normalize(),J_(r.body);for(const a of r.querySelectorAll("a[href]"))a.setAttribute("target","blank"),a.setAttribute("rel","noopener noreferrer"),a.setAttribute("href",Xa(a.getAttribute("href"),t.baseUrl));for(const a of r.querySelectorAll("img[src]"))a.setAttribute("src",Xa(a.getAttribute("src"),t.baseUrl));const i=r.body.removeChild(r.querySelector("body > div"));return i.className="snarkdown",i}function J_(e){if(e.nodeType!==3){if(e.nodeType!==1||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e.remove();for(let t=e.attributes.length;t--;){const n=e.attributes[t].name;/^(class|id|name|href|src|alt|align|valign|(on[a-z]+))$/i.test(n)||e.attributes.removeNamedItem(n)}for(let t=e.childNodes.length;t--;)J_(e.childNodes[t])}}function Xj(e){e.stopPropagation(),e.preventDefault();const n=e.target.parentElement,r=n.parentElement,a=r.parentElement.querySelector(".panes"),o=[...r.children].findIndex(s=>s==n);for(const s of r.children)s.classList.remove("active-tab");for(const s of a.children)s.classList.remove("active-tab");r.children.item(o).classList.add("active-tab"),a.children.item(o).classList.add("active-tab")}var qd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function uu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kj(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ib={exports:{}};Ib.exports,function(e){var t=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",a={};function o(c,l){if(!a[c]){a[c]={};for(var u=0;u<c.length;u++)a[c][c.charAt(u)]=u}return a[c][l]}var s={compressToBase64:function(c){if(c==null)return"";var l=s._compress(c,6,function(u){return r.charAt(u)});switch(l.length%4){default:case 0:return l;case 1:return l+"===";case 2:return l+"==";case 3:return l+"="}},decompressFromBase64:function(c){return c==null?"":c==""?null:s._decompress(c.length,32,function(l){return o(r,c.charAt(l))})},compressToUTF16:function(c){return c==null?"":s._compress(c,15,function(l){return n(l+32)})+" "},decompressFromUTF16:function(c){return c==null?"":c==""?null:s._decompress(c.length,16384,function(l){return c.charCodeAt(l)-32})},compressToUint8Array:function(c){for(var l=s.compress(c),u=new Uint8Array(l.length*2),f=0,h=l.length;f<h;f++){var d=l.charCodeAt(f);u[f*2]=d>>>8,u[f*2+1]=d%256}return u},decompressFromUint8Array:function(c){if(c==null)return s.decompress(c);for(var l=new Array(c.length/2),u=0,f=l.length;u<f;u++)l[u]=c[u*2]*256+c[u*2+1];var h=[];return l.forEach(function(d){h.push(n(d))}),s.decompress(h.join(""))},compressToEncodedURIComponent:function(c){return c==null?"":s._compress(c,6,function(l){return i.charAt(l)})},decompressFromEncodedURIComponent:function(c){return c==null?"":c==""?null:(c=c.replace(/ /g,"+"),s._decompress(c.length,32,function(l){return o(i,c.charAt(l))}))},compress:function(c){return s._compress(c,16,function(l){return n(l)})},_compress:function(c,l,u){if(c==null)return"";var f,h,d={},p={},g="",b="",v="",x=2,A=3,w=2,_=[],C=0,I=0,D;for(D=0;D<c.length;D+=1)if(g=c.charAt(D),Object.prototype.hasOwnProperty.call(d,g)||(d[g]=A++,p[g]=!0),b=v+g,Object.prototype.hasOwnProperty.call(d,b))v=b;else{if(Object.prototype.hasOwnProperty.call(p,v)){if(v.charCodeAt(0)<256){for(f=0;f<w;f++)C=C<<1,I==l-1?(I=0,_.push(u(C)),C=0):I++;for(h=v.charCodeAt(0),f=0;f<8;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1}else{for(h=1,f=0;f<w;f++)C=C<<1|h,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=0;for(h=v.charCodeAt(0),f=0;f<16;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1}x--,x==0&&(x=Math.pow(2,w),w++),delete p[v]}else for(h=d[v],f=0;f<w;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1;x--,x==0&&(x=Math.pow(2,w),w++),d[b]=A++,v=String(g)}if(v!==""){if(Object.prototype.hasOwnProperty.call(p,v)){if(v.charCodeAt(0)<256){for(f=0;f<w;f++)C=C<<1,I==l-1?(I=0,_.push(u(C)),C=0):I++;for(h=v.charCodeAt(0),f=0;f<8;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1}else{for(h=1,f=0;f<w;f++)C=C<<1|h,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=0;for(h=v.charCodeAt(0),f=0;f<16;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1}x--,x==0&&(x=Math.pow(2,w),w++),delete p[v]}else for(h=d[v],f=0;f<w;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1;x--,x==0&&(x=Math.pow(2,w),w++)}for(h=2,f=0;f<w;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1;for(;;)if(C=C<<1,I==l-1){_.push(u(C));break}else I++;return _.join("")},decompress:function(c){return c==null?"":c==""?null:s._decompress(c.length,32768,function(l){return c.charCodeAt(l)})},_decompress:function(c,l,u){var f=[],h=4,d=4,p=3,g="",b=[],v,x,A,w,_,C,I,D={val:u(0),position:l,index:1};for(v=0;v<3;v+=1)f[v]=v;for(A=0,_=Math.pow(2,2),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;switch(A){case 0:for(A=0,_=Math.pow(2,8),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;I=n(A);break;case 1:for(A=0,_=Math.pow(2,16),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;I=n(A);break;case 2:return""}for(f[3]=I,x=I,b.push(I);;){if(D.index>c)return"";for(A=0,_=Math.pow(2,p),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;switch(I=A){case 0:for(A=0,_=Math.pow(2,8),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;f[d++]=n(A),I=d-1,h--;break;case 1:for(A=0,_=Math.pow(2,16),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;f[d++]=n(A),I=d-1,h--;break;case 2:return b.join("")}if(h==0&&(h=Math.pow(2,p),p++),f[I])g=f[I];else if(I===d)g=x+x.charAt(0);else return null;b.push(g),f[d++]=x+g.charAt(0),h--,x=g,h==0&&(h=Math.pow(2,p),p++)}}};return s}();e!=null&&(e.exports=t)}(Ib);var e6=Ib.exports;function Jj(){const e=typeof process<"u"?require("util").TextEncoder:TextEncoder;return new e}let t6;function eq(){let e,t=[];for(let n=0;n<256;n++){e=n;for(let r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}function tq(e){t6??(t6=eq());let t=-1;const n=Jj().encode(e);for(let r=0;r<n.length;r++)t=t>>>8^t6[(t^n[r])&255];return(t^-1)>>>0}function n6(e){return("00000000"+tq(e).toString(16)).slice(-8)}function r6(e){const t=e6.compressToEncodedURIComponent(JSON.stringify(e));return"#"+t+n6(t)}function nq(e){if(!e||e.length<10)throw new Error("The state string in the URL is too short.");const t=e.slice(1,-8),n=e.slice(-8);if(n6(t)!==n)throw new Error("The state string in the URL is corrupted.");return JSON.parse(e6.decompressFromEncodedURIComponent(t))}let ho;function rq(e){for(const t of e.genomeSpy.getNamedScaleResolutions().values())t.isZoomable()&&t.resetZoom();e.storeHelper.dispatch([...e.provenance.isUndoable()?[lo.jumpToPast(0)]:[],Ts.actions.restoreDefaultVisibilities()])}async function Rb(e,t){try{e.actions&&t.provenance.dispatchBookmark(e.actions),t.storeHelper.dispatch(Ts.actions.setViewSettings(e.viewSettings));const n=[];for(const[r,i]of Object.entries(e.scaleDomains??{})){const a=t.genomeSpy.getNamedScaleResolutions().get(r);a?n.push(a.zoomTo(i)):console.warn(`Cannot restore scale domain. Unknown name: ${r}`)}await Promise.all(n)}catch(n){console.error(n),dn($`<p>Cannot restore the state:</p>
|
2976
|
+
*/const Q_=e=>!cG(e)&&typeof e.then=="function",X_=1073741823,Yj=Da(class extends $_{constructor(){super(...arguments),this._$C_t=X_,this._$Cwt=[],this._$Cq=new qj(this),this._$CK=new Wj}render(...t){return t.find(n=>!Q_(n))??Dt}update(t,n){const r=this._$Cwt;let i=r.length;this._$Cwt=n;const a=this._$Cq,o=this._$CK;this.isConnected||this.disconnected();for(let s=0;s<n.length&&!(s>this._$C_t);s++){const c=n[s];if(!Q_(c))return this._$C_t=s,c;s<i&&c===r[s]||(this._$C_t=X_,i=0,Promise.resolve(c).then(async l=>{for(;o.get();)await o.get();const u=a.deref();if(u!==void 0){const f=u._$Cwt.indexOf(c);f>-1&&f<u._$C_t&&(u._$C_t=f,u.setValue(l))}}))}return Dt}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}});var Zj={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function K_(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function lu(e){return(e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Tb(e,t){var n,r,i,a,o,s=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,c=[],l="",u=t||{},f=0;function h(p){var g=Zj[p[1]||""],b=c[c.length-1]==p;return g?g[1]?(b?c.pop():c.push(p),g[0|b]):g[0]:p}function d(){for(var p="";c.length;)p+=h(c[c.length-1]);return p}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(p,g,b){return u[g.toLowerCase()]=b,""}).replace(/^\n+|\n+$/g,"");i=s.exec(e);)r=e.substring(f,i.index),f=s.lastIndex,n=i[0],r.match(/[^\\](\\\\)*\\$/)||((o=i[3]||i[4])?n='<pre class="code '+(i[4]?"poetry":i[2].toLowerCase())+'"><code'+(i[2]?' class="language-'+i[2].toLowerCase()+'"':"")+">"+K_(lu(o).replace(/^\n+|\n+$/g,""))+"</code></pre>":(o=i[6])?(o.match(/\./)&&(i[5]=i[5].replace(/^\d+/gm,"")),a=Tb(K_(i[5].replace(/^\s*[>*+.-]/gm,""))),o==">"?o="blockquote":(o=o.match(/\./)?"ol":"ul",a=a.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),n="<"+o+">"+a+"</"+o+">"):i[8]?n='<img src="'+lu(i[8])+'" alt="'+lu(i[7])+'">':i[10]?(l=l.replace("<a>",'<a href="'+lu(i[11]||u[r.toLowerCase()])+'">'),n=d()+"</a>"):i[9]?n="<a>":i[12]||i[14]?n="<"+(o="h"+(i[14]?i[14].length:i[13]>"="?1:2))+">"+Tb(i[12]||i[15],u)+"</"+o+">":i[16]?n="<code>"+lu(i[16])+"</code>":(i[17]||i[1])&&(n=h(i[17]||"--"))),l+=r,l+=n;return(l+e.substring(f)+d()).replace(/^\n+|\n+$/g,"")}function Qj(e,t={}){const n=Tb(e),r=new DOMParser().parseFromString(`<!DOCTYPE html><html><body><div>${n}</div></body></html>`,"text/html");r.normalize(),J_(r.body);for(const a of r.querySelectorAll("a[href]"))a.setAttribute("target","blank"),a.setAttribute("rel","noopener noreferrer"),a.setAttribute("href",Xa(a.getAttribute("href"),t.baseUrl));for(const a of r.querySelectorAll("img[src]"))a.setAttribute("src",Xa(a.getAttribute("src"),t.baseUrl));const i=r.body.removeChild(r.querySelector("body > div"));return i.className="snarkdown",i}function J_(e){if(e.nodeType!==3){if(e.nodeType!==1||/^(script|iframe|object|embed|svg)$/i.test(e.tagName))return e.remove();for(let t=e.attributes.length;t--;){const n=e.attributes[t].name;/^(class|id|name|href|src|alt|align|valign|(on[a-z]+))$/i.test(n)||e.attributes.removeNamedItem(n)}for(let t=e.childNodes.length;t--;)J_(e.childNodes[t])}}function Xj(e){e.stopPropagation(),e.preventDefault();const n=e.target.parentElement,r=n.parentElement,a=r.parentElement.querySelector(".panes"),o=[...r.children].findIndex(s=>s==n);for(const s of r.children)s.classList.remove("active-tab");for(const s of a.children)s.classList.remove("active-tab");r.children.item(o).classList.add("active-tab"),a.children.item(o).classList.add("active-tab")}var qd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function uu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kj(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ib={exports:{}};Ib.exports,function(e){var t=function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",a={};function o(c,l){if(!a[c]){a[c]={};for(var u=0;u<c.length;u++)a[c][c.charAt(u)]=u}return a[c][l]}var s={compressToBase64:function(c){if(c==null)return"";var l=s._compress(c,6,function(u){return r.charAt(u)});switch(l.length%4){default:case 0:return l;case 1:return l+"===";case 2:return l+"==";case 3:return l+"="}},decompressFromBase64:function(c){return c==null?"":c==""?null:s._decompress(c.length,32,function(l){return o(r,c.charAt(l))})},compressToUTF16:function(c){return c==null?"":s._compress(c,15,function(l){return n(l+32)})+" "},decompressFromUTF16:function(c){return c==null?"":c==""?null:s._decompress(c.length,16384,function(l){return c.charCodeAt(l)-32})},compressToUint8Array:function(c){for(var l=s.compress(c),u=new Uint8Array(l.length*2),f=0,h=l.length;f<h;f++){var d=l.charCodeAt(f);u[f*2]=d>>>8,u[f*2+1]=d%256}return u},decompressFromUint8Array:function(c){if(c==null)return s.decompress(c);for(var l=new Array(c.length/2),u=0,f=l.length;u<f;u++)l[u]=c[u*2]*256+c[u*2+1];var h=[];return l.forEach(function(d){h.push(n(d))}),s.decompress(h.join(""))},compressToEncodedURIComponent:function(c){return c==null?"":s._compress(c,6,function(l){return i.charAt(l)})},decompressFromEncodedURIComponent:function(c){return c==null?"":c==""?null:(c=c.replace(/ /g,"+"),s._decompress(c.length,32,function(l){return o(i,c.charAt(l))}))},compress:function(c){return s._compress(c,16,function(l){return n(l)})},_compress:function(c,l,u){if(c==null)return"";var f,h,d={},p={},g="",b="",v="",x=2,A=3,w=2,_=[],C=0,I=0,D;for(D=0;D<c.length;D+=1)if(g=c.charAt(D),Object.prototype.hasOwnProperty.call(d,g)||(d[g]=A++,p[g]=!0),b=v+g,Object.prototype.hasOwnProperty.call(d,b))v=b;else{if(Object.prototype.hasOwnProperty.call(p,v)){if(v.charCodeAt(0)<256){for(f=0;f<w;f++)C=C<<1,I==l-1?(I=0,_.push(u(C)),C=0):I++;for(h=v.charCodeAt(0),f=0;f<8;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1}else{for(h=1,f=0;f<w;f++)C=C<<1|h,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=0;for(h=v.charCodeAt(0),f=0;f<16;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1}x--,x==0&&(x=Math.pow(2,w),w++),delete p[v]}else for(h=d[v],f=0;f<w;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1;x--,x==0&&(x=Math.pow(2,w),w++),d[b]=A++,v=String(g)}if(v!==""){if(Object.prototype.hasOwnProperty.call(p,v)){if(v.charCodeAt(0)<256){for(f=0;f<w;f++)C=C<<1,I==l-1?(I=0,_.push(u(C)),C=0):I++;for(h=v.charCodeAt(0),f=0;f<8;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1}else{for(h=1,f=0;f<w;f++)C=C<<1|h,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=0;for(h=v.charCodeAt(0),f=0;f<16;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1}x--,x==0&&(x=Math.pow(2,w),w++),delete p[v]}else for(h=d[v],f=0;f<w;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1;x--,x==0&&(x=Math.pow(2,w),w++)}for(h=2,f=0;f<w;f++)C=C<<1|h&1,I==l-1?(I=0,_.push(u(C)),C=0):I++,h=h>>1;for(;;)if(C=C<<1,I==l-1){_.push(u(C));break}else I++;return _.join("")},decompress:function(c){return c==null?"":c==""?null:s._decompress(c.length,32768,function(l){return c.charCodeAt(l)})},_decompress:function(c,l,u){var f=[],h=4,d=4,p=3,g="",b=[],v,x,A,w,_,C,I,D={val:u(0),position:l,index:1};for(v=0;v<3;v+=1)f[v]=v;for(A=0,_=Math.pow(2,2),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;switch(A){case 0:for(A=0,_=Math.pow(2,8),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;I=n(A);break;case 1:for(A=0,_=Math.pow(2,16),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;I=n(A);break;case 2:return""}for(f[3]=I,x=I,b.push(I);;){if(D.index>c)return"";for(A=0,_=Math.pow(2,p),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;switch(I=A){case 0:for(A=0,_=Math.pow(2,8),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;f[d++]=n(A),I=d-1,h--;break;case 1:for(A=0,_=Math.pow(2,16),C=1;C!=_;)w=D.val&D.position,D.position>>=1,D.position==0&&(D.position=l,D.val=u(D.index++)),A|=(w>0?1:0)*C,C<<=1;f[d++]=n(A),I=d-1,h--;break;case 2:return b.join("")}if(h==0&&(h=Math.pow(2,p),p++),f[I])g=f[I];else if(I===d)g=x+x.charAt(0);else return null;b.push(g),f[d++]=x+g.charAt(0),h--,x=g,h==0&&(h=Math.pow(2,p),p++)}}};return s}();e!=null&&(e.exports=t)}(Ib);var e6=Ib.exports;function Jj(){const e=typeof process<"u"?require("util").TextEncoder:TextEncoder;return new e}let t6;function eq(){let e,t=[];for(let n=0;n<256;n++){e=n;for(let r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}function tq(e){t6??(t6=eq());let t=-1;const n=Jj().encode(e);for(let r=0;r<n.length;r++)t=t>>>8^t6[(t^n[r])&255];return(t^-1)>>>0}function n6(e){return("00000000"+tq(e).toString(16)).slice(-8)}function r6(e){const t=e6.compressToEncodedURIComponent(JSON.stringify(e));return"#"+t+n6(t)}function nq(e){if(!e||e.length<10)throw new Error("The state string in the URL is too short.");const t=e.slice(1,-8),n=e.slice(-8);if(n6(t)!==n)throw new Error("The state string in the URL is corrupted.");return JSON.parse(e6.decompressFromEncodedURIComponent(t))}let ho;function rq(e){for(const t of e.genomeSpy.getNamedScaleResolutions().values())t.isZoomable()&&t.resetZoom();e.storeHelper.dispatch([...e.provenance.isUndoable()?[lo.jumpToPast(0)]:[],Ts.actions.restoreDefaultVisibilities()])}async function Rb(e,t){try{e.actions&&t.provenance.dispatchBookmark(e.actions),t.storeHelper.dispatch(Ts.actions.setViewSettings(e.viewSettings));const n=[];for(const[r,i]of Object.entries(e.scaleDomains??{})){const a=t.genomeSpy.getNamedScaleResolutions().get(r);a?n.push(a.zoomTo(i)):console.warn(`Cannot restore scale domain. Unknown name: ${r}`)}await Promise.all(n)}catch(n){console.error(n),dn($`<p>Cannot restore the state:</p>
|
2977
2977
|
<p>${n}</p>`),t.provenance.activateState(0)}}async function fu(e,t,n={}){await Rb(e,t),(ho||e.notes||n.mode=="shared"&&(e.name||e.notes))&&await iq(e,t,n)}async function iq(e,t,n={}){ho??(ho=ao("tour",t.appContainer)),await aq(e,t,n)}async function aq(e,t,n){const r=n.database,i=r?await r.getNames():[],a=i.indexOf(e.name),o=r?` ${a+1} of ${i.length}`:"",s=`${n.mode=="shared"?"Shared bookmark":"Bookmark"}${o}: ${e.name??"Unnamed"}`,c=e.notes?Qj(e.notes,{baseUrl:t.genomeSpy.spec.baseUrl}):$`<span class="no-notes">No notes provided</span>`,l=async()=>{if(ho==null||ho.close(),ho=void 0,n.mode=="tour"){const g=n.afterTourBookmark;if(typeof g=="string"){const b=await n.database.get(g);if(!b)throw new Error(`No such bookmark: ${g}`);Rb(b,t)}else g===null||rq(t)}},u=async g=>{const b=await r.get(i[g]);fu(b,t,n),t.appContainer.querySelector("canvas").focus()},f=async()=>{if(await Db(t.localBookmarkDatabase,e,"add"))try{await t.localBookmarkDatabase.put(e)}catch(g){console.warn(g),dn(`Cannot import bookmark: ${g}`)}},h=$` <button class="btn" @click=${l}>
|
2978
2978
|
${n.mode=="tour"?"End tour":"Close"}
|
2979
2979
|
</button>
|
@@ -3102,7 +3102,7 @@ ${n}</textarea
|
|
3102
3102
|
</div>
|
3103
3103
|
`,a=t.name,o=()=>!!t.name,s=ao();return new Promise(c=>{const l=()=>{s.close(),c(!1)},u=async()=>{if(!o()){dn("Name is missing!",{title:"Error"});return}let h=!0;e&&!(n&&t.name==a)&&await e.get(t.name)&&(h=await dn($`A bookmark with the name
|
3104
3104
|
<em>${t.name}</em> already exists. It will be
|
3105
|
-
overwritten.`,{title:"Bookmark already exists",cancelButton:!0})),h&&(s.close(),c(!0))},f=()=>{s.close(),c(!0)};Vt(i(l,n=="share"?f:u),s.content),s.content.querySelector("#bookmark-title").focus()})}function a6(e){if(e!==void 0&&(e=e.trim(),e.length))return e}class oq extends
|
3105
|
+
overwritten.`,{title:"Bookmark already exists",cancelButton:!0})),h&&(s.close(),c(!0))},f=()=>{s.close(),c(!0)};Vt(i(l,n=="share"?f:u),s.content),s.content.querySelector("#bookmark-title").focus()})}function a6(e){if(e!==void 0&&(e=e.trim(),e.length))return e}class oq extends mr{constructor(){super(),this.app=void 0}connectedCallback(){super.connectedCallback(),this.dispatchEvent(W_("app",t=>{this.app=t}))}createRenderRoot(){return this}_createBookmarkWithCurrentState(){const t={name:void 0,timestamp:Date.now(),actions:this.app.provenance.getBookmarkableActionHistory(),scaleDomains:{}},n=this.app.storeHelper.state.viewSettings;Object.keys(n.visibilities).length&&(t.viewSettings=n);for(const[r,i]of this.app.genomeSpy.getNamedScaleResolutions().entries())i.isZoomable()&&(t.scaleDomains[r]=i.getComplexDomain());return t}async _shareCurrentState(){const t=this._createBookmarkWithCurrentState();await Db(void 0,t,"share")&&i6(t,!1)}async _addBookmark(t,n){const r=n?await t.get(n):void 0,i=!!r,a=this._createBookmarkWithCurrentState();if(a.name??(a.name=r==null?void 0:r.name),a.notes??(a.notes=r==null?void 0:r.notes),await Db(t,a,i?"edit":"add"))try{await t.put(a,r==null?void 0:r.name),this.requestUpdate()}catch(o){dn(`${o}`,{title:"Cannot save the bookmark!"})}}async _loadBookmark(t,n){const r=await t.get(n);r&&fu(r,this.app,{database:t})}_createContextMenu(t,n,r){r.stopPropagation();const i=r.target.closest("li"),a=()=>dn($`The bookmark <em>${n}</em> will be deleted.`,{title:"Are you sure?",cancelButton:!0}).then(async c=>{c&&(await t.delete(n),this.requestUpdate())}),o=[],s=t==this.app.globalBookmarkDatabase;s||(o.push({label:"Edit and replace...",icon:l$,callback:()=>this._addBookmark(t,n)}),o.push({label:"Delete",icon:r4,callback:a})),o.push({label:"Share...",icon:c1,callback:async()=>i6(await t.get(n),s)}),T_({items:o},i,"right-start")}async _makeBookmarkMenuItems(t,n){const i=(await t.getNames()).map(a=>({label:a,callback:()=>this._loadBookmark(t,a),ellipsisCallback:o=>this._createContextMenu(t,a,o)}));return i.length?[{type:"divider"},{label:n,type:"header"},...i].map(a=>C_(a)):ue}_getBookmarks(){const t=(n,r)=>n?Yj(this._makeBookmarkMenuItems(n,r),$`Loading...`):ue;return[t(this.app.globalBookmarkDatabase,"Bookmarks on the server"),t(this.app.localBookmarkDatabase,"Bookmarks in the web browser")]}render(){const t=this.app.localBookmarkDatabase,n=t?$` <li>
|
3106
3106
|
<a @click=${()=>this._addBookmark(t)}
|
3107
3107
|
>Add bookmark...</a
|
3108
3108
|
>
|
@@ -3130,7 +3130,7 @@ ${n}</textarea
|
|
3130
3130
|
${Ue(c1).node[0]}
|
3131
3131
|
</button>
|
3132
3132
|
</div>
|
3133
|
-
`}}customElements.define("genome-spy-bookmark-button",oq);class sq extends
|
3133
|
+
`}}customElements.define("genome-spy-bookmark-button",oq);class sq extends mr{constructor(){super(),this.app=void 0,this.appInitialized=!1}static get properties(){return{app:{type:Object},appInitialized:{type:Boolean}}}createRenderRoot(){return this}_getToolButtons(){const t=this.app.provenance,n=[];t.isEnabled()&&n.push($`
|
3134
3134
|
<genome-spy-provenance-buttons
|
3135
3135
|
.provenance=${t}
|
3136
3136
|
></genome-spy-provenance-buttons>
|
@@ -3192,18 +3192,18 @@ ${n}</textarea
|
|
3192
3192
|
></genome-spy-toolbar>
|
3193
3193
|
<div class="genome-spy-container"></div>
|
3194
3194
|
</div>`,i.appContainer),i.appContainer.querySelector(".genome-spy-app").addEventListener("query-dependency",s=>{s.detail.name=="app"&&(s.detail.setter(i),s.stopPropagation())});const a=s=>this.appContainer.getElementsByClassName(s)[0];this.genomeSpy=new YE(a("genome-spy-container"),this.config,r),this.genomeSpy.viewFactory.addViewType(WE,(s,c,l,u,f)=>new bb(s,c,l,u,f,this.provenance));const o=this.genomeSpy.viewVisibilityPredicate;this.genomeSpy.viewVisibilityPredicate=s=>{var c;return((c=this.storeHelper.state.viewSettings)==null?void 0:c.visibilities[s.name])??o(s)}}addInitializationListener(t){this._initializationListeners?this._initializationListeners.push(t):t()}toggleFullScreen(){document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():this.appContainer.requestFullscreen()}isFullPage(){return this.appContainer==document.body}async launch(){var o;const t=(o=this.config.bookmarks)!=null&&o.remote?Zc({baseURL:this.config.baseUrl}).load(this.config.bookmarks.remote.url).then(s=>Promise.resolve(JSON.parse(s))):Promise.resolve([]);if(!await this.genomeSpy.launch())return;this.appContainer.querySelector("canvas").setAttribute("tabindex","-1"),this.storeHelper.subscribe(Vd(s=>{var c;return(c=s.viewSettings)==null?void 0:c.visibilities},(s,c)=>{this.genomeSpy.viewRoot._invalidateCacheByPrefix("size","progeny");const l=this.genomeSpy.viewRoot.context;l.requestLayoutReflow(),l.animator.requestRender()},this.storeHelper.store.getState()));try{const s=await t;s.length&&(this.globalBookmarkDatabase=new bq(s))}catch(s){throw new Error(`Cannot load remote bookmarks: ${s}`)}try{await this._restoreStateFromUrlOrBookmark()}catch(s){dn(s.toString())}this.storeHelper.subscribe(()=>{this._updateStateToUrl()}),window.addEventListener("hashchange",()=>this._restoreStateFromUrl().catch(s=>dn(s.toString())),!1);const r=bs(()=>this._updateStateToUrl(),500,!1);for(const[,s]of this.genomeSpy.getNamedScaleResolutions())s.isZoomable()&&s.addEventListener("domain",r);const i=this.toolbarRef.value;i.appInitialized=!0;const a=Lt(this.genomeSpy.spec.description??[]);this.isFullPage()&&a.length>0&&(document.title="GenomeSpy - "+a);for(const s of this._initializationListeners)s();this._initializationListeners=void 0}async _restoreStateFromUrlOrBookmark(){var i;const t=(i=this.config.bookmarks)==null?void 0:i.remote,n=this.globalBookmarkDatabase;if(!await this._restoreStateFromUrl()&&t&&n){const a=t.initialBookmark??(t.tour&&(await n.getNames())[0]);if(a){const o=await n.get(a);if(!o)throw new Error(`No such bookmark: ${a}`);t.tour?await fu(o,this,{mode:"tour",database:n,afterTourBookmark:t.afterTourBookmark}):await Rb(o,this)}}}_updateStateToUrl(){const t={actions:[],scaleDomains:{}},n=this.provenance.getBookmarkableActionHistory();n!=null&&n.length&&(t.actions=n);for(const[a,o]of this.genomeSpy.getNamedScaleResolutions().entries())o.isZoomed()||(t.scaleDomains[a]=o.getComplexDomain());const r=this.storeHelper.state.viewSettings;Object.keys(r.visibilities).length&&(t.viewSettings=r);const i=t.actions.length||Object.keys(t.scaleDomains).length||t.viewSettings?r6(t):"";window.history.replaceState(void 0,document.title,window.location.pathname+window.location.search+i)}async _restoreStateFromUrl(){var r,i;const t=window.location.hash,n=(r=t.match(/^#bookmark:(.+)$/))==null?void 0:r[1];if(n){const a=(i=this.config.bookmarks)==null?void 0:i.remote,o=this.globalBookmarkDatabase;if(a&&o){const s=(await o.getNames()).find(c=>c.replaceAll(" ","-")==n);if(s){const c=await o.get(s);if(!c)throw new Error(`No such bookmark: ${s}`);return await fu(c,this,{mode:"tour",database:o}),!0}else throw new Error(`No such bookmark: ${n}`)}}if(t&&t.length>0)try{const a=nq(t);return fu(a,this,{mode:"shared"}),!0}catch(a){console.error(a),dn($`<p>Cannot restore the state:</p>
|
3195
|
-
<p>${a}</p>`)}return!1}_configureContainer(){this.isFullPage()?(this.appContainer.style.margin="0",this.appContainer.style.padding="0",this.appContainer.style.overflow="hidden",yq($U)):this.appContainer.style.position="relative"}getSampleView(){var n;if(!((n=this.genomeSpy)!=null&&n.viewRoot))return;let t;return this.genomeSpy.viewRoot.visit(r=>{if(r instanceof bb)return t=r,Qa}),t}}function yq(e){const t=document.querySelector("head"),n=document.createElement("link");n.setAttribute("rel","shortcut icon"),n.setAttribute("href",e),t.appendChild(n)}async function vq(e,t,n={}){let r;if(Me(e)){if(r=document.querySelector(e),!r)throw new Error(`No such element: ${e}`)}else if(e instanceof HTMLElement)r=e;else throw new Error(`Invalid element: ${e}`);let i;try{const a=Xt(t)?t:await s6(t);a.baseUrl??(a.baseUrl=""),a.width??(a.width="container"),a.padding??(a.padding=10);const o=new o6(r,a,n);i=o.genomeSpy,wq(i,n),await o.launch()}catch(a){r.innerText=a.toString(),console.error(a)}return{finalize(){for(i.destroy();r.firstChild;)r.firstChild.remove()},addEventListener(a,o){const s=i._eventListeners;let c=s.get(a);c||(c=new Set,s.set(a,c)),c.add(o)},removeEventListener(a,o){var c;(c=i._eventListeners.get(a))==null||c.delete(o)},getScaleResolutionByName(a){return i.getNamedScaleResolutions().get(a)},updateNamedData:i.updateNamedData.bind(i)}}function wq(e,t){t.namedDataProvider&&e.registerNamedDataProvider(t.namedDataProvider)}async function s6(e){let t;try{t=JSON.parse(await Zc().load(e))}catch(n){throw new Error(`Could not load or parse configuration: ${e}, reason: ${n.message}`)}if(!t.baseUrl){const n=e.match(/^[^?#]*\//);t.baseUrl=n&&n[0]||"./"}return t}var we={},Wd={};Wd.byteLength=Eq,Wd.toByteArray=_q,Wd.fromByteArray=Tq;for(var
|
3195
|
+
<p>${a}</p>`)}return!1}_configureContainer(){this.isFullPage()?(this.appContainer.style.margin="0",this.appContainer.style.padding="0",this.appContainer.style.overflow="hidden",yq($U)):this.appContainer.style.position="relative"}getSampleView(){var n;if(!((n=this.genomeSpy)!=null&&n.viewRoot))return;let t;return this.genomeSpy.viewRoot.visit(r=>{if(r instanceof bb)return t=r,Qa}),t}}function yq(e){const t=document.querySelector("head"),n=document.createElement("link");n.setAttribute("rel","shortcut icon"),n.setAttribute("href",e),t.appendChild(n)}async function vq(e,t,n={}){let r;if(Me(e)){if(r=document.querySelector(e),!r)throw new Error(`No such element: ${e}`)}else if(e instanceof HTMLElement)r=e;else throw new Error(`Invalid element: ${e}`);let i;try{const a=Xt(t)?t:await s6(t);a.baseUrl??(a.baseUrl=""),a.width??(a.width="container"),a.padding??(a.padding=10);const o=new o6(r,a,n);i=o.genomeSpy,wq(i,n),await o.launch()}catch(a){r.innerText=a.toString(),console.error(a)}return{finalize(){for(i.destroy();r.firstChild;)r.firstChild.remove()},addEventListener(a,o){const s=i._eventListeners;let c=s.get(a);c||(c=new Set,s.set(a,c)),c.add(o)},removeEventListener(a,o){var c;(c=i._eventListeners.get(a))==null||c.delete(o)},getScaleResolutionByName(a){return i.getNamedScaleResolutions().get(a)},updateNamedData:i.updateNamedData.bind(i)}}function wq(e,t){t.namedDataProvider&&e.registerNamedDataProvider(t.namedDataProvider)}async function s6(e){let t;try{t=JSON.parse(await Zc().load(e))}catch(n){throw new Error(`Could not load or parse configuration: ${e}, reason: ${n.message}`)}if(!t.baseUrl){const n=e.match(/^[^?#]*\//);t.baseUrl=n&&n[0]||"./"}return t}var we={},Wd={};Wd.byteLength=Eq,Wd.toByteArray=_q,Wd.fromByteArray=Tq;for(var wr=[],_n=[],xq=typeof Uint8Array<"u"?Uint8Array:Array,Bb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Is=0,Aq=Bb.length;Is<Aq;++Is)wr[Is]=Bb[Is],_n[Bb.charCodeAt(Is)]=Is;_n["-".charCodeAt(0)]=62,_n["_".charCodeAt(0)]=63;function c6(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function Eq(e){var t=c6(e),n=t[0],r=t[1];return(n+r)*3/4-r}function Sq(e,t,n){return(t+n)*3/4-n}function _q(e){var t,n=c6(e),r=n[0],i=n[1],a=new xq(Sq(e,r,i)),o=0,s=i>0?r-4:r,c;for(c=0;c<s;c+=4)t=_n[e.charCodeAt(c)]<<18|_n[e.charCodeAt(c+1)]<<12|_n[e.charCodeAt(c+2)]<<6|_n[e.charCodeAt(c+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=_n[e.charCodeAt(c)]<<2|_n[e.charCodeAt(c+1)]>>4,a[o++]=t&255),i===1&&(t=_n[e.charCodeAt(c)]<<10|_n[e.charCodeAt(c+1)]<<4|_n[e.charCodeAt(c+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function Cq(e){return wr[e>>18&63]+wr[e>>12&63]+wr[e>>6&63]+wr[e&63]}function kq(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(Cq(r));return i.join("")}function Tq(e){for(var t,n=e.length,r=n%3,i=[],a=16383,o=0,s=n-r;o<s;o+=a)i.push(kq(e,o,o+a>s?s:o+a));return r===1?(t=e[n-1],i.push(wr[t>>2]+wr[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(wr[t>>10]+wr[t>>4&63]+wr[t<<2&63]+"=")),i.join("")}var Fb={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Fb.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=a*256+e[t+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+f],f+=h,u-=8);if(a===0)a=1-l;else{if(a===c)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,r),a=a-l}return(d?-1:1)*o*Math.pow(2,a-r)},Fb.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,f=u>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?t+=h/c:t+=h*Math.pow(2,1-f),t*c>=2&&(o++,c/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(t*c-1)*Math.pow(2,i),o=o+f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+d]=s&255,d+=p,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+d]=o&255,d+=p,o/=256,l-=8);e[n+d-p]|=g*128};/*!
|
3196
3196
|
* The buffer module from node.js, for the browser.
|
3197
3197
|
*
|
3198
3198
|
* @author Feross Aboukhadijeh <https://feross.org>
|
3199
3199
|
* @license MIT
|
3200
|
-
*/(function(e){const t=Wd,n=Fb,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=x,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.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{const E=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(E,m),E.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(E){if(E>i)throw new RangeError('The value "'+E+'" is invalid for option "size"');const m=new Uint8Array(E);return Object.setPrototypeOf(m,s.prototype),m}function s(E,m,y){if(typeof E=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(E)}return c(E,m,y)}s.poolSize=8192;function c(E,m,y){if(typeof E=="string")return h(E,m);if(ArrayBuffer.isView(E))return p(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(Gt(E,ArrayBuffer)||E&&Gt(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Gt(E,SharedArrayBuffer)||E&&Gt(E.buffer,SharedArrayBuffer)))return g(E,m,y);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const R=E.valueOf&&E.valueOf();if(R!=null&&R!==E)return s.from(R,m,y);const M=b(E);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return s.from(E[Symbol.toPrimitive]("string"),m,y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}s.from=function(E,m,y){return c(E,m,y)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function u(E,m,y){return l(E),E<=0?o(E):m!==void 0?typeof y=="string"?o(E).fill(m,y):o(E).fill(m):o(E)}s.alloc=function(E,m,y){return u(E,m,y)};function f(E){return l(E),o(E<0?0:v(E)|0)}s.allocUnsafe=function(E){return f(E)},s.allocUnsafeSlow=function(E){return f(E)};function h(E,m){if((typeof m!="string"||m==="")&&(m="utf8"),!s.isEncoding(m))throw new TypeError("Unknown encoding: "+m);const y=A(E,m)|0;let R=o(y);const M=R.write(E,m);return M!==y&&(R=R.slice(0,M)),R}function d(E){const m=E.length<0?0:v(E.length)|0,y=o(m);for(let R=0;R<m;R+=1)y[R]=E[R]&255;return y}function p(E){if(Gt(E,Uint8Array)){const m=new Uint8Array(E);return g(m.buffer,m.byteOffset,m.byteLength)}return d(E)}function g(E,m,y){if(m<0||E.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<m+(y||0))throw new RangeError('"length" is outside of buffer bounds');let R;return m===void 0&&y===void 0?R=new Uint8Array(E):y===void 0?R=new Uint8Array(E,m):R=new Uint8Array(E,m,y),Object.setPrototypeOf(R,s.prototype),R}function b(E){if(s.isBuffer(E)){const m=v(E.length)|0,y=o(m);return y.length===0||E.copy(y,0,0,m),y}if(E.length!==void 0)return typeof E.length!="number"||fi(E.length)?o(0):d(E);if(E.type==="Buffer"&&Array.isArray(E.data))return d(E.data)}function v(E){if(E>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return E|0}function x(E){return+E!=E&&(E=0),s.alloc(+E)}s.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==s.prototype},s.compare=function(m,y){if(Gt(m,Uint8Array)&&(m=s.from(m,m.offset,m.byteLength)),Gt(y,Uint8Array)&&(y=s.from(y,y.offset,y.byteLength)),!s.isBuffer(m)||!s.isBuffer(y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===y)return 0;let R=m.length,M=y.length;for(let N=0,q=Math.min(R,M);N<q;++N)if(m[N]!==y[N]){R=m[N],M=y[N];break}return R<M?-1:M<R?1:0},s.isEncoding=function(m){switch(String(m).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}},s.concat=function(m,y){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return s.alloc(0);let R;if(y===void 0)for(y=0,R=0;R<m.length;++R)y+=m[R].length;const M=s.allocUnsafe(y);let N=0;for(R=0;R<m.length;++R){let q=m[R];if(Gt(q,Uint8Array))N+q.length>M.length?(s.isBuffer(q)||(q=s.from(q)),q.copy(M,N)):Uint8Array.prototype.set.call(M,q,N);else if(s.isBuffer(q))q.copy(M,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=q.length}return M};function A(E,m){if(s.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||Gt(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const y=E.length,R=arguments.length>2&&arguments[2]===!0;if(!R&&y===0)return 0;let M=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return y;case"utf8":case"utf-8":return pe(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y*2;case"hex":return y>>>1;case"base64":return fa(E).length;default:if(M)return R?-1:pe(E).length;m=(""+m).toLowerCase(),M=!0}}s.byteLength=A;function w(E,m,y){let R=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((y===void 0||y>this.length)&&(y=this.length),y<=0)||(y>>>=0,m>>>=0,y<=m))return"";for(E||(E="utf8");;)switch(E){case"hex":return tt(this,m,y);case"utf8":case"utf-8":return ve(this,m,y);case"ascii":return Ne(this,m,y);case"latin1":case"binary":return lt(this,m,y);case"base64":return se(this,m,y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,m,y);default:if(R)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),R=!0}}s.prototype._isBuffer=!0;function _(E,m,y){const R=E[m];E[m]=E[y],E[y]=R}s.prototype.swap16=function(){const m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let y=0;y<m;y+=2)_(this,y,y+1);return this},s.prototype.swap32=function(){const m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let y=0;y<m;y+=4)_(this,y,y+3),_(this,y+1,y+2);return this},s.prototype.swap64=function(){const m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let y=0;y<m;y+=8)_(this,y,y+7),_(this,y+1,y+6),_(this,y+2,y+5),_(this,y+3,y+4);return this},s.prototype.toString=function(){const m=this.length;return m===0?"":arguments.length===0?ve(this,0,m):w.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(m){if(!s.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:s.compare(this,m)===0},s.prototype.inspect=function(){let m="";const y=e.INSPECT_MAX_BYTES;return m=this.toString("hex",0,y).replace(/(.{2})/g,"$1 ").trim(),this.length>y&&(m+=" ... "),"<Buffer "+m+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(m,y,R,M,N){if(Gt(m,Uint8Array)&&(m=s.from(m,m.offset,m.byteLength)),!s.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(y===void 0&&(y=0),R===void 0&&(R=m?m.length:0),M===void 0&&(M=0),N===void 0&&(N=this.length),y<0||R>m.length||M<0||N>this.length)throw new RangeError("out of range index");if(M>=N&&y>=R)return 0;if(M>=N)return-1;if(y>=R)return 1;if(y>>>=0,R>>>=0,M>>>=0,N>>>=0,this===m)return 0;let q=N-M,ge=R-y;const Ze=Math.min(q,ge),$e=this.slice(M,N),nt=m.slice(y,R);for(let Re=0;Re<Ze;++Re)if($e[Re]!==nt[Re]){q=$e[Re],ge=nt[Re];break}return q<ge?-1:ge<q?1:0};function C(E,m,y,R,M){if(E.length===0)return-1;if(typeof y=="string"?(R=y,y=0):y>2147483647?y=2147483647:y<-2147483648&&(y=-2147483648),y=+y,fi(y)&&(y=M?0:E.length-1),y<0&&(y=E.length+y),y>=E.length){if(M)return-1;y=E.length-1}else if(y<0)if(M)y=0;else return-1;if(typeof m=="string"&&(m=s.from(m,R)),s.isBuffer(m))return m.length===0?-1:I(E,m,y,R,M);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(E,m,y):Uint8Array.prototype.lastIndexOf.call(E,m,y):I(E,[m],y,R,M);throw new TypeError("val must be string, number or Buffer")}function I(E,m,y,R,M){let N=1,q=E.length,ge=m.length;if(R!==void 0&&(R=String(R).toLowerCase(),R==="ucs2"||R==="ucs-2"||R==="utf16le"||R==="utf-16le")){if(E.length<2||m.length<2)return-1;N=2,q/=2,ge/=2,y/=2}function Ze(nt,Re){return N===1?nt[Re]:nt.readUInt16BE(Re*N)}let $e;if(M){let nt=-1;for($e=y;$e<q;$e++)if(Ze(E,$e)===Ze(m,nt===-1?0:$e-nt)){if(nt===-1&&(nt=$e),$e-nt+1===ge)return nt*N}else nt!==-1&&($e-=$e-nt),nt=-1}else for(y+ge>q&&(y=q-ge),$e=y;$e>=0;$e--){let nt=!0;for(let Re=0;Re<ge;Re++)if(Ze(E,$e+Re)!==Ze(m,Re)){nt=!1;break}if(nt)return $e}return-1}s.prototype.includes=function(m,y,R){return this.indexOf(m,y,R)!==-1},s.prototype.indexOf=function(m,y,R){return C(this,m,y,R,!0)},s.prototype.lastIndexOf=function(m,y,R){return C(this,m,y,R,!1)};function D(E,m,y,R){y=Number(y)||0;const M=E.length-y;R?(R=Number(R),R>M&&(R=M)):R=M;const N=m.length;R>N/2&&(R=N/2);let q;for(q=0;q<R;++q){const ge=parseInt(m.substr(q*2,2),16);if(fi(ge))return q;E[y+q]=ge}return q}function B(E,m,y,R){return ha(pe(m,E.length-y),E,y,R)}function G(E,m,y,R){return ha(un(m),E,y,R)}function z(E,m,y,R){return ha(fa(m),E,y,R)}function ae(E,m,y,R){return ha(ua(m,E.length-y),E,y,R)}s.prototype.write=function(m,y,R,M){if(y===void 0)M="utf8",R=this.length,y=0;else if(R===void 0&&typeof y=="string")M=y,R=this.length,y=0;else if(isFinite(y))y=y>>>0,isFinite(R)?(R=R>>>0,M===void 0&&(M="utf8")):(M=R,R=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const N=this.length-y;if((R===void 0||R>N)&&(R=N),m.length>0&&(R<0||y<0)||y>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let q=!1;for(;;)switch(M){case"hex":return D(this,m,y,R);case"utf8":case"utf-8":return B(this,m,y,R);case"ascii":case"latin1":case"binary":return G(this,m,y,R);case"base64":return z(this,m,y,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,m,y,R);default:if(q)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),q=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(E,m,y){return m===0&&y===E.length?t.fromByteArray(E):t.fromByteArray(E.slice(m,y))}function ve(E,m,y){y=Math.min(E.length,y);const R=[];let M=m;for(;M<y;){const N=E[M];let q=null,ge=N>239?4:N>223?3:N>191?2:1;if(M+ge<=y){let Ze,$e,nt,Re;switch(ge){case 1:N<128&&(q=N);break;case 2:Ze=E[M+1],(Ze&192)===128&&(Re=(N&31)<<6|Ze&63,Re>127&&(q=Re));break;case 3:Ze=E[M+1],$e=E[M+2],(Ze&192)===128&&($e&192)===128&&(Re=(N&15)<<12|(Ze&63)<<6|$e&63,Re>2047&&(Re<55296||Re>57343)&&(q=Re));break;case 4:Ze=E[M+1],$e=E[M+2],nt=E[M+3],(Ze&192)===128&&($e&192)===128&&(nt&192)===128&&(Re=(N&15)<<18|(Ze&63)<<12|($e&63)<<6|nt&63,Re>65535&&Re<1114112&&(q=Re))}}q===null?(q=65533,ge=1):q>65535&&(q-=65536,R.push(q>>>10&1023|55296),q=56320|q&1023),R.push(q),M+=ge}return st(R)}const Pe=4096;function st(E){const m=E.length;if(m<=Pe)return String.fromCharCode.apply(String,E);let y="",R=0;for(;R<m;)y+=String.fromCharCode.apply(String,E.slice(R,R+=Pe));return y}function Ne(E,m,y){let R="";y=Math.min(E.length,y);for(let M=m;M<y;++M)R+=String.fromCharCode(E[M]&127);return R}function lt(E,m,y){let R="";y=Math.min(E.length,y);for(let M=m;M<y;++M)R+=String.fromCharCode(E[M]);return R}function tt(E,m,y){const R=E.length;(!m||m<0)&&(m=0),(!y||y<0||y>R)&&(y=R);let M="";for(let N=m;N<y;++N)M+=da[E[N]];return M}function ut(E,m,y){const R=E.slice(m,y);let M="";for(let N=0;N<R.length-1;N+=2)M+=String.fromCharCode(R[N]+R[N+1]*256);return M}s.prototype.slice=function(m,y){const R=this.length;m=~~m,y=y===void 0?R:~~y,m<0?(m+=R,m<0&&(m=0)):m>R&&(m=R),y<0?(y+=R,y<0&&(y=0)):y>R&&(y=R),y<m&&(y=m);const M=this.subarray(m,y);return Object.setPrototypeOf(M,s.prototype),M};function Te(E,m,y){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+m>y)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(m,y,R){m=m>>>0,y=y>>>0,R||Te(m,y,this.length);let M=this[m],N=1,q=0;for(;++q<y&&(N*=256);)M+=this[m+q]*N;return M},s.prototype.readUintBE=s.prototype.readUIntBE=function(m,y,R){m=m>>>0,y=y>>>0,R||Te(m,y,this.length);let M=this[m+--y],N=1;for(;y>0&&(N*=256);)M+=this[m+--y]*N;return M},s.prototype.readUint8=s.prototype.readUInt8=function(m,y){return m=m>>>0,y||Te(m,1,this.length),this[m]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(m,y){return m=m>>>0,y||Te(m,2,this.length),this[m]|this[m+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(m,y){return m=m>>>0,y||Te(m,2,this.length),this[m]<<8|this[m+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},s.prototype.readBigUInt64LE=fn(function(m){m=m>>>0,V(m,"offset");const y=this[m],R=this[m+7];(y===void 0||R===void 0)&&Y(m,this.length-8);const M=y+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24,N=this[++m]+this[++m]*2**8+this[++m]*2**16+R*2**24;return BigInt(M)+(BigInt(N)<<BigInt(32))}),s.prototype.readBigUInt64BE=fn(function(m){m=m>>>0,V(m,"offset");const y=this[m],R=this[m+7];(y===void 0||R===void 0)&&Y(m,this.length-8);const M=y*2**24+this[++m]*2**16+this[++m]*2**8+this[++m],N=this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+R;return(BigInt(M)<<BigInt(32))+BigInt(N)}),s.prototype.readIntLE=function(m,y,R){m=m>>>0,y=y>>>0,R||Te(m,y,this.length);let M=this[m],N=1,q=0;for(;++q<y&&(N*=256);)M+=this[m+q]*N;return N*=128,M>=N&&(M-=Math.pow(2,8*y)),M},s.prototype.readIntBE=function(m,y,R){m=m>>>0,y=y>>>0,R||Te(m,y,this.length);let M=y,N=1,q=this[m+--M];for(;M>0&&(N*=256);)q+=this[m+--M]*N;return N*=128,q>=N&&(q-=Math.pow(2,8*y)),q},s.prototype.readInt8=function(m,y){return m=m>>>0,y||Te(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},s.prototype.readInt16LE=function(m,y){m=m>>>0,y||Te(m,2,this.length);const R=this[m]|this[m+1]<<8;return R&32768?R|4294901760:R},s.prototype.readInt16BE=function(m,y){m=m>>>0,y||Te(m,2,this.length);const R=this[m+1]|this[m]<<8;return R&32768?R|4294901760:R},s.prototype.readInt32LE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},s.prototype.readInt32BE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},s.prototype.readBigInt64LE=fn(function(m){m=m>>>0,V(m,"offset");const y=this[m],R=this[m+7];(y===void 0||R===void 0)&&Y(m,this.length-8);const M=this[m+4]+this[m+5]*2**8+this[m+6]*2**16+(R<<24);return(BigInt(M)<<BigInt(32))+BigInt(y+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24)}),s.prototype.readBigInt64BE=fn(function(m){m=m>>>0,V(m,"offset");const y=this[m],R=this[m+7];(y===void 0||R===void 0)&&Y(m,this.length-8);const M=(y<<24)+this[++m]*2**16+this[++m]*2**8+this[++m];return(BigInt(M)<<BigInt(32))+BigInt(this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+R)}),s.prototype.readFloatLE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),n.read(this,m,!0,23,4)},s.prototype.readFloatBE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),n.read(this,m,!1,23,4)},s.prototype.readDoubleLE=function(m,y){return m=m>>>0,y||Te(m,8,this.length),n.read(this,m,!0,52,8)},s.prototype.readDoubleBE=function(m,y){return m=m>>>0,y||Te(m,8,this.length),n.read(this,m,!1,52,8)};function Ie(E,m,y,R,M,N){if(!s.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>M||m<N)throw new RangeError('"value" argument is out of bounds');if(y+R>E.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(m,y,R,M){if(m=+m,y=y>>>0,R=R>>>0,!M){const ge=Math.pow(2,8*R)-1;Ie(this,m,y,R,ge,0)}let N=1,q=0;for(this[y]=m&255;++q<R&&(N*=256);)this[y+q]=m/N&255;return y+R},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(m,y,R,M){if(m=+m,y=y>>>0,R=R>>>0,!M){const ge=Math.pow(2,8*R)-1;Ie(this,m,y,R,ge,0)}let N=R-1,q=1;for(this[y+N]=m&255;--N>=0&&(q*=256);)this[y+N]=m/q&255;return y+R},s.prototype.writeUint8=s.prototype.writeUInt8=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,1,255,0),this[y]=m&255,y+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,2,65535,0),this[y]=m&255,this[y+1]=m>>>8,y+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,2,65535,0),this[y]=m>>>8,this[y+1]=m&255,y+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,4,4294967295,0),this[y+3]=m>>>24,this[y+2]=m>>>16,this[y+1]=m>>>8,this[y]=m&255,y+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,4,4294967295,0),this[y]=m>>>24,this[y+1]=m>>>16,this[y+2]=m>>>8,this[y+3]=m&255,y+4};function Rt(E,m,y,R,M){S(m,R,M,E,y,7);let N=Number(m&BigInt(4294967295));E[y++]=N,N=N>>8,E[y++]=N,N=N>>8,E[y++]=N,N=N>>8,E[y++]=N;let q=Number(m>>BigInt(32)&BigInt(4294967295));return E[y++]=q,q=q>>8,E[y++]=q,q=q>>8,E[y++]=q,q=q>>8,E[y++]=q,y}function ln(E,m,y,R,M){S(m,R,M,E,y,7);let N=Number(m&BigInt(4294967295));E[y+7]=N,N=N>>8,E[y+6]=N,N=N>>8,E[y+5]=N,N=N>>8,E[y+4]=N;let q=Number(m>>BigInt(32)&BigInt(4294967295));return E[y+3]=q,q=q>>8,E[y+2]=q,q=q>>8,E[y+1]=q,q=q>>8,E[y]=q,y+8}s.prototype.writeBigUInt64LE=fn(function(m,y=0){return Rt(this,m,y,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=fn(function(m,y=0){return ln(this,m,y,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(m,y,R,M){if(m=+m,y=y>>>0,!M){const Ze=Math.pow(2,8*R-1);Ie(this,m,y,R,Ze-1,-Ze)}let N=0,q=1,ge=0;for(this[y]=m&255;++N<R&&(q*=256);)m<0&&ge===0&&this[y+N-1]!==0&&(ge=1),this[y+N]=(m/q>>0)-ge&255;return y+R},s.prototype.writeIntBE=function(m,y,R,M){if(m=+m,y=y>>>0,!M){const Ze=Math.pow(2,8*R-1);Ie(this,m,y,R,Ze-1,-Ze)}let N=R-1,q=1,ge=0;for(this[y+N]=m&255;--N>=0&&(q*=256);)m<0&&ge===0&&this[y+N+1]!==0&&(ge=1),this[y+N]=(m/q>>0)-ge&255;return y+R},s.prototype.writeInt8=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,1,127,-128),m<0&&(m=255+m+1),this[y]=m&255,y+1},s.prototype.writeInt16LE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,2,32767,-32768),this[y]=m&255,this[y+1]=m>>>8,y+2},s.prototype.writeInt16BE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,2,32767,-32768),this[y]=m>>>8,this[y+1]=m&255,y+2},s.prototype.writeInt32LE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,4,2147483647,-2147483648),this[y]=m&255,this[y+1]=m>>>8,this[y+2]=m>>>16,this[y+3]=m>>>24,y+4},s.prototype.writeInt32BE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[y]=m>>>24,this[y+1]=m>>>16,this[y+2]=m>>>8,this[y+3]=m&255,y+4},s.prototype.writeBigInt64LE=fn(function(m,y=0){return Rt(this,m,y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=fn(function(m,y=0){return ln(this,m,y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ve(E,m,y,R,M,N){if(y+R>E.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("Index out of range")}function L(E,m,y,R,M){return m=+m,y=y>>>0,M||Ve(E,m,y,4),n.write(E,m,y,R,23,4),y+4}s.prototype.writeFloatLE=function(m,y,R){return L(this,m,y,!0,R)},s.prototype.writeFloatBE=function(m,y,R){return L(this,m,y,!1,R)};function O(E,m,y,R,M){return m=+m,y=y>>>0,M||Ve(E,m,y,8),n.write(E,m,y,R,52,8),y+8}s.prototype.writeDoubleLE=function(m,y,R){return O(this,m,y,!0,R)},s.prototype.writeDoubleBE=function(m,y,R){return O(this,m,y,!1,R)},s.prototype.copy=function(m,y,R,M){if(!s.isBuffer(m))throw new TypeError("argument should be a Buffer");if(R||(R=0),!M&&M!==0&&(M=this.length),y>=m.length&&(y=m.length),y||(y=0),M>0&&M<R&&(M=R),M===R||m.length===0||this.length===0)return 0;if(y<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),m.length-y<M-R&&(M=m.length-y+R);const N=M-R;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(y,R,M):Uint8Array.prototype.set.call(m,this.subarray(R,M),y),N},s.prototype.fill=function(m,y,R,M){if(typeof m=="string"){if(typeof y=="string"?(M=y,y=0,R=this.length):typeof R=="string"&&(M=R,R=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!s.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(m.length===1){const q=m.charCodeAt(0);(M==="utf8"&&q<128||M==="latin1")&&(m=q)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(y<0||this.length<y||this.length<R)throw new RangeError("Out of range index");if(R<=y)return this;y=y>>>0,R=R===void 0?this.length:R>>>0,m||(m=0);let N;if(typeof m=="number")for(N=y;N<R;++N)this[N]=m;else{const q=s.isBuffer(m)?m:s.from(m,M),ge=q.length;if(ge===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(N=0;N<R-y;++N)this[N+y]=q[N%ge]}return this};const W={};function j(E,m,y){W[E]=class extends y{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}j("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(E,m){return`The "${E}" argument must be of type number. Received type ${typeof m}`},TypeError),j("ERR_OUT_OF_RANGE",function(E,m,y){let R=`The value of "${E}" is out of range.`,M=y;return Number.isInteger(y)&&Math.abs(y)>2**32?M=Q(String(y)):typeof y=="bigint"&&(M=String(y),(y>BigInt(2)**BigInt(32)||y<-(BigInt(2)**BigInt(32)))&&(M=Q(M)),M+="n"),R+=` It must be ${m}. Received ${M}`,R},RangeError);function Q(E){let m="",y=E.length;const R=E[0]==="-"?1:0;for(;y>=R+4;y-=3)m=`_${E.slice(y-3,y)}${m}`;return`${E.slice(0,y)}${m}`}function T(E,m,y){V(m,"offset"),(E[m]===void 0||E[m+y]===void 0)&&Y(m,E.length-(y+1))}function S(E,m,y,R,M,N){if(E>y||E<m){const q=typeof m=="bigint"?"n":"";let ge;throw N>3?m===0||m===BigInt(0)?ge=`>= 0${q} and < 2${q} ** ${(N+1)*8}${q}`:ge=`>= -(2${q} ** ${(N+1)*8-1}${q}) and < 2 ** ${(N+1)*8-1}${q}`:ge=`>= ${m}${q} and <= ${y}${q}`,new W.ERR_OUT_OF_RANGE("value",ge,E)}T(R,M,N)}function V(E,m){if(typeof E!="number")throw new W.ERR_INVALID_ARG_TYPE(m,"number",E)}function Y(E,m,y){throw Math.floor(E)!==E?(V(E,y),new W.ERR_OUT_OF_RANGE(y||"offset","an integer",E)):m<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE(y||"offset",`>= ${y?1:0} and <= ${m}`,E)}const de=/[^+/0-9A-Za-z-_]/g;function ie(E){if(E=E.split("=")[0],E=E.trim().replace(de,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function pe(E,m){m=m||1/0;let y;const R=E.length;let M=null;const N=[];for(let q=0;q<R;++q){if(y=E.charCodeAt(q),y>55295&&y<57344){if(!M){if(y>56319){(m-=3)>-1&&N.push(239,191,189);continue}else if(q+1===R){(m-=3)>-1&&N.push(239,191,189);continue}M=y;continue}if(y<56320){(m-=3)>-1&&N.push(239,191,189),M=y;continue}y=(M-55296<<10|y-56320)+65536}else M&&(m-=3)>-1&&N.push(239,191,189);if(M=null,y<128){if((m-=1)<0)break;N.push(y)}else if(y<2048){if((m-=2)<0)break;N.push(y>>6|192,y&63|128)}else if(y<65536){if((m-=3)<0)break;N.push(y>>12|224,y>>6&63|128,y&63|128)}else if(y<1114112){if((m-=4)<0)break;N.push(y>>18|240,y>>12&63|128,y>>6&63|128,y&63|128)}else throw new Error("Invalid code point")}return N}function un(E){const m=[];for(let y=0;y<E.length;++y)m.push(E.charCodeAt(y)&255);return m}function ua(E,m){let y,R,M;const N=[];for(let q=0;q<E.length&&!((m-=2)<0);++q)y=E.charCodeAt(q),R=y>>8,M=y%256,N.push(M),N.push(R);return N}function fa(E){return t.toByteArray(ie(E))}function ha(E,m,y,R){let M;for(M=0;M<R&&!(M+y>=m.length||M>=E.length);++M)m[M+y]=E[M];return M}function Gt(E,m){return E instanceof m||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===m.name}function fi(E){return E!==E}const da=function(){const E="0123456789abcdef",m=new Array(256);for(let y=0;y<16;++y){const R=y*16;for(let M=0;M<16;++M)m[R+M]=E[y]+E[M]}return m}();function fn(E){return typeof BigInt>"u"?Br:E}function Br(){throw new Error("BigInt not supported")}})(we);const l6=_e({__proto__:null,default:uu(we)},[we]),kt={},Iq=Object.freeze(Object.defineProperty({__proto__:null,default:kt},Symbol.toStringTag,{value:"Module"})),Pb=typeof window<"u"?window:typeof self<"u"?self:{fetch:void 0};class po{async getBufferFromResponse(t){if(typeof t.buffer=="function")return t.buffer();if(typeof t.arrayBuffer=="function"){const n=await t.arrayBuffer();return we.Buffer.from(n)}else throw new TypeError("invalid HTTP response object, has no buffer method, and no arrayBuffer method")}constructor(t,n={}){this.baseOverrides={},this.url=t;const r=n.fetch||Pb.fetch&&Pb.fetch.bind(Pb);if(!r)throw new TypeError("no fetch function supplied, and none found in global environment");n.overrides&&(this.baseOverrides=n.overrides),this.fetchImplementation=r}async fetch(t,n){let r;try{r=await this.fetchImplementation(t,n)}catch(i){if(`${i}`.includes("Failed to fetch"))console.warn(`generic-filehandle: refetching ${t} to attempt to work around chrome CORS header caching bug`),r=await this.fetchImplementation(t,{...n,cache:"reload"});else throw i}return r}async read(t,n=0,r,i=0,a={}){const{headers:o={},signal:s,overrides:c={}}=a;r<1/0?o.range=`bytes=${i}-${i+r}`:r===1/0&&i!==0&&(o.range=`bytes=${i}-`);const l={...this.baseOverrides,...c,headers:{...o,...c.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:s},u=await this.fetch(this.url,l);if(!u.ok)throw new Error(`HTTP ${u.status} ${u.statusText} ${this.url}`);if(u.status===200&&i===0||u.status===206){const f=await this.getBufferFromResponse(u),h=f.copy(t,n,0,Math.min(r,f.length)),d=u.headers.get("content-range"),p=/\/(\d+)$/.exec(d||"");return p&&p[1]&&(this._stat={size:parseInt(p[1],10)}),{bytesRead:h,buffer:t}}throw u.status===200?new Error("${this.url} fetch returned status 200, expected 206"):new Error(`HTTP ${u.status} fetching ${this.url}`)}async readFile(t={}){let n,r;typeof t=="string"?(n=t,r={}):(n=t.encoding,r=t,delete r.encoding);const{headers:i={},signal:a,overrides:o={}}=r,s={headers:i,method:"GET",redirect:"follow",mode:"cors",signal:a,...this.baseOverrides,...o},c=await this.fetch(this.url,s);if(!c)throw new Error("generic-filehandle failed to fetch");if(c.status!==200)throw Object.assign(new Error(`HTTP ${c.status} fetching ${this.url}`),{status:c.status});if(n==="utf8")return c.text();if(n)throw new Error(`unsupported encoding: ${n}`);return this.getBufferFromResponse(c)}async stat(){if(!this._stat){const t=we.Buffer.allocUnsafe(10);if(await this.read(t,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}}function u6(e){const t=new FileReader;return new Promise((n,r)=>{t.onerror=()=>{t.abort(),r(new Error("problem reading blob"))},t.onabort=()=>{r(new Error("blob reading was aborted"))},t.onload=()=>{t.result&&typeof t.result!="string"?n(t.result):r(new Error("unknown error reading blob"))},t.readAsArrayBuffer(e)})}function Rq(e){const t=new FileReader;return new Promise((n,r)=>{t.onerror=()=>{t.abort(),r(new Error("problem reading blob"))},t.onabort=()=>{r(new Error("blob reading was aborted"))},t.onload=()=>{t.result&&typeof t.result=="string"?n(t.result):r(new Error("unknown error reading blob"))},t.readAsText(e)})}class Dq{constructor(t){this.blob=t,this.size=t.size}async read(t,n=0,r,i=0){if(!r)return{bytesRead:0,buffer:t};const a=i,o=a+r,s=await u6(this.blob.slice(a,o)),c=we.Buffer.from(s);return{bytesRead:c.copy(t,n),buffer:c}}async readFile(t){let n;if(typeof t=="string"?n=t:n=t&&t.encoding,n==="utf8")return Rq(this.blob);if(n)throw new Error(`unsupported encoding: ${n}`);const r=await u6(this.blob);return we.Buffer.from(r)}async stat(){return{size:this.size}}async close(){}}function f6(e,t={}){return new po(e,t)}function Bq(e,t,n,r={}){if(n!==void 0)return n;if(e!==void 0)return f6(e,r);if(t!==void 0)return new kt(t,r);throw new Error("no url, path, or filehandle provided, cannot open")}const hu=Object.freeze(Object.defineProperty({__proto__:null,BlobFile:Dq,LocalFile:kt,RemoteFile:po,fromUrl:f6,open:Bq},Symbol.toStringTag,{value:"Module"}));var Kr={};(function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function n(a,o){return Object.prototype.hasOwnProperty.call(a,o)}e.assign=function(a){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var s=o.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var c in s)n(s,c)&&(a[c]=s[c])}}return a},e.shrinkBuf=function(a,o){return a.length===o?a:a.subarray?a.subarray(0,o):(a.length=o,a)};var r={arraySet:function(a,o,s,c,l){if(o.subarray&&a.subarray){a.set(o.subarray(s,s+c),l);return}for(var u=0;u<c;u++)a[l+u]=o[s+u]},flattenChunks:function(a){var o,s,c,l,u,f;for(c=0,o=0,s=a.length;o<s;o++)c+=a[o].length;for(f=new Uint8Array(c),l=0,o=0,s=a.length;o<s;o++)u=a[o],f.set(u,l),l+=u.length;return f}},i={arraySet:function(a,o,s,c,l){for(var u=0;u<c;u++)a[l+u]=o[s+u]},flattenChunks:function(a){return[].concat.apply([],a)}};e.setTyped=function(a){a?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})(Kr);var du={},Ar={},Rs={},Fq=Kr,Pq=4,h6=0,d6=1,Mq=2;function Ds(e){for(var t=e.length;--t>=0;)e[t]=0}var Oq=0,p6=1,Lq=2,Nq=3,zq=258,Mb=29,pu=256,gu=pu+1+Mb,Bs=30,Ob=19,g6=2*gu+1,go=15,Lb=16,Uq=7,Nb=256,m6=16,b6=17,y6=18,zb=[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],Yd=[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],$q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],v6=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Hq=512,Jr=new Array((gu+2)*2);Ds(Jr);var mu=new Array(Bs*2);Ds(mu);var bu=new Array(Hq);Ds(bu);var yu=new Array(zq-Nq+1);Ds(yu);var Ub=new Array(Mb);Ds(Ub);var Zd=new Array(Bs);Ds(Zd);function $b(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var w6,x6,A6;function Hb(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function E6(e){return e<256?bu[e]:bu[256+(e>>>7)]}function vu(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function an(e,t,n){e.bi_valid>Lb-n?(e.bi_buf|=t<<e.bi_valid&65535,vu(e,e.bi_buf),e.bi_buf=t>>Lb-e.bi_valid,e.bi_valid+=n-Lb):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function Er(e,t,n){an(e,n[t*2],n[t*2+1])}function S6(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function Gq(e){e.bi_valid===16?(vu(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Vq(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,f,h,d,p,g=0;for(h=0;h<=go;h++)e.bl_count[h]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<g6;l++)u=e.heap[l],h=n[n[u*2+1]*2+1]+1,h>c&&(h=c,g++),n[u*2+1]=h,!(u>r)&&(e.bl_count[h]++,d=0,u>=s&&(d=o[u-s]),p=n[u*2],e.opt_len+=p*(h+d),a&&(e.static_len+=p*(i[u*2+1]+d)));if(g!==0){do{for(h=c-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(h=c;h!==0;h--)for(u=e.bl_count[h];u!==0;)f=e.heap[--l],!(f>r)&&(n[f*2+1]!==h&&(e.opt_len+=(h-n[f*2+1])*n[f*2],n[f*2+1]=h),u--)}}function _6(e,t,n){var r=new Array(go+1),i=0,a,o;for(a=1;a<=go;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=S6(r[s]++,s))}}function jq(){var e,t,n,r,i,a=new Array(go+1);for(n=0,r=0;r<Mb-1;r++)for(Ub[r]=n,e=0;e<1<<zb[r];e++)yu[n++]=r;for(yu[n-1]=r,i=0,r=0;r<16;r++)for(Zd[r]=i,e=0;e<1<<Yd[r];e++)bu[i++]=r;for(i>>=7;r<Bs;r++)for(Zd[r]=i<<7,e=0;e<1<<Yd[r]-7;e++)bu[256+i++]=r;for(t=0;t<=go;t++)a[t]=0;for(e=0;e<=143;)Jr[e*2+1]=8,e++,a[8]++;for(;e<=255;)Jr[e*2+1]=9,e++,a[9]++;for(;e<=279;)Jr[e*2+1]=7,e++,a[7]++;for(;e<=287;)Jr[e*2+1]=8,e++,a[8]++;for(_6(Jr,gu+1,a),e=0;e<Bs;e++)mu[e*2+1]=5,mu[e*2]=S6(e,5);w6=new $b(Jr,zb,pu+1,gu,go),x6=new $b(mu,Yd,0,Bs,go),A6=new $b(new Array(0),$q,0,Ob,Uq)}function C6(e){var t;for(t=0;t<gu;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Bs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Ob;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Nb*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function k6(e){e.bi_valid>8?vu(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function qq(e,t,n,r){k6(e),r&&(vu(e,n),vu(e,~n)),Fq.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function T6(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function Gb(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&T6(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!T6(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function I6(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?Er(e,i,t):(o=yu[i],Er(e,o+pu+1,t),s=zb[o],s!==0&&(i-=Ub[o],an(e,i,s)),r--,o=E6(r),Er(e,o,n),s=Yd[o],s!==0&&(r-=Zd[o],an(e,r,s)));while(a<e.last_lit);Er(e,Nb,t)}function Vb(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=g6,o=0;o<a;o++)n[o*2]!==0?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):n[o*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Gb(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Gb(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,Gb(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Vq(e,t),_6(n,c,e.bl_count)}function R6(e,t,n){var r,i=-1,a,o=t[0*2+1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[m6*2]++):s<=10?e.bl_tree[b6*2]++:e.bl_tree[y6*2]++,s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function D6(e,t,n){var r,i=-1,a,o=t[0*2+1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do Er(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Er(e,a,e.bl_tree),s--),Er(e,m6,e.bl_tree),an(e,s-3,2)):s<=10?(Er(e,b6,e.bl_tree),an(e,s-3,3)):(Er(e,y6,e.bl_tree),an(e,s-11,7));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function Wq(e){var t;for(R6(e,e.dyn_ltree,e.l_desc.max_code),R6(e,e.dyn_dtree,e.d_desc.max_code),Vb(e,e.bl_desc),t=Ob-1;t>=3&&e.bl_tree[v6[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Yq(e,t,n,r){var i;for(an(e,t-257,5),an(e,n-1,5),an(e,r-4,4),i=0;i<r;i++)an(e,e.bl_tree[v6[i]*2+1],3);D6(e,e.dyn_ltree,t-1),D6(e,e.dyn_dtree,n-1)}function Zq(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return h6;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return d6;for(n=32;n<pu;n++)if(e.dyn_ltree[n*2]!==0)return d6;return h6}var B6=!1;function Qq(e){B6||(jq(),B6=!0),e.l_desc=new Hb(e.dyn_ltree,w6),e.d_desc=new Hb(e.dyn_dtree,x6),e.bl_desc=new Hb(e.bl_tree,A6),e.bi_buf=0,e.bi_valid=0,C6(e)}function F6(e,t,n,r){an(e,(Oq<<1)+(r?1:0),3),qq(e,t,n,!0)}function Xq(e){an(e,p6<<1,3),Er(e,Nb,Jr),Gq(e)}function Kq(e,t,n,r){var i,a,o=0;e.level>0?(e.strm.data_type===Mq&&(e.strm.data_type=Zq(e)),Vb(e,e.l_desc),Vb(e,e.d_desc),o=Wq(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?F6(e,t,n,r):e.strategy===Pq||a===i?(an(e,(p6<<1)+(r?1:0),3),I6(e,Jr,mu)):(an(e,(Lq<<1)+(r?1:0),3),Yq(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),I6(e,e.dyn_ltree,e.dyn_dtree)),C6(e),r&&k6(e)}function Jq(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(yu[n]+pu+1)*2]++,e.dyn_dtree[E6(t)*2]++),e.last_lit===e.lit_bufsize-1}Rs._tr_init=Qq,Rs._tr_stored_block=F6,Rs._tr_flush_block=Kq,Rs._tr_tally=Jq,Rs._tr_align=Xq;function eW(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}var P6=eW;function tW(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var nW=tW();function rW(e,t,n,r){var i=nW,a=r+n;e^=-1;for(var o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}var M6=rW,jb={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"},Wt=Kr,Cn=Rs,O6=P6,qi=M6,iW=jb,mo=0,aW=1,oW=3,Wi=4,L6=5,Sr=0,N6=1,kn=-2,sW=-3,qb=-5,cW=-1,lW=1,Qd=2,uW=3,fW=4,hW=0,dW=2,Xd=8,pW=9,gW=15,mW=8,bW=29,yW=256,Wb=yW+1+bW,vW=30,wW=19,xW=2*Wb+1,AW=15,be=3,Yi=258,Kn=Yi+be+1,EW=32,Kd=42,Yb=69,Jd=73,e0=91,t0=103,bo=113,wu=666,yt=1,xu=2,yo=3,Fs=4,SW=3;function Zi(e,t){return e.msg=iW[t],t}function z6(e){return(e<<1)-(e>4?9:0)}function Qi(e){for(var t=e.length;--t>=0;)e[t]=0}function Xi(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(Wt.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function Pt(e,t){Cn._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Xi(e.strm)}function Se(e,t){e.pending_buf[e.pending++]=t}function Au(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function _W(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,Wt.arraySet(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=O6(e.adler,t,i,n):e.state.wrap===2&&(e.adler=qi(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function U6(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-Kn?e.strstart-(e.w_size-Kn):0,l=e.window,u=e.w_mask,f=e.prev,h=e.strstart+Yi,d=l[r+o-1],p=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(l[i+o]!==p||l[i+o-1]!==d||l[i]!==l[r]||l[++i]!==l[r+1])){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<h);if(a=Yi-(h-r),r=h-Yi,a>o){if(e.match_start=t,o=a,a>=s)break;d=l[r+o-1],p=l[r+o]}}while((t=f[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function vo(e){var t=e.w_size,n,r,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Kn)){Wt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=_W(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=be)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+be-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<be)););}while(e.lookahead<Kn&&e.strm.avail_in!==0)}function CW(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(vo(e),e.lookahead===0&&t===mo)return yt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Pt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Kn&&(Pt(e,!1),e.strm.avail_out===0))return yt}return e.insert=0,t===Wi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):(e.strstart>e.block_start&&(Pt(e,!1),e.strm.avail_out===0),yt)}function Zb(e,t){for(var n,r;;){if(e.lookahead<Kn){if(vo(e),e.lookahead<Kn&&t===mo)return yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=be&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+be-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Kn&&(e.match_length=U6(e,n)),e.match_length>=be)if(r=Cn._tr_tally(e,e.strstart-e.match_start,e.match_length-be),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=be){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+be-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=Cn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Pt(e,!1),e.strm.avail_out===0))return yt}return e.insert=e.strstart<be-1?e.strstart:be-1,t===Wi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):e.last_lit&&(Pt(e,!1),e.strm.avail_out===0)?yt:xu}function Ps(e,t){for(var n,r,i;;){if(e.lookahead<Kn){if(vo(e),e.lookahead<Kn&&t===mo)return yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=be&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+be-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=be-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Kn&&(e.match_length=U6(e,n),e.match_length<=5&&(e.strategy===lW||e.match_length===be&&e.strstart-e.match_start>4096)&&(e.match_length=be-1)),e.prev_length>=be&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-be,r=Cn._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-be),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+be-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=be-1,e.strstart++,r&&(Pt(e,!1),e.strm.avail_out===0))return yt}else if(e.match_available){if(r=Cn._tr_tally(e,0,e.window[e.strstart-1]),r&&Pt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return yt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Cn._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<be-1?e.strstart:be-1,t===Wi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):e.last_lit&&(Pt(e,!1),e.strm.avail_out===0)?yt:xu}function kW(e,t){for(var n,r,i,a,o=e.window;;){if(e.lookahead<=Yi){if(vo(e),e.lookahead<=Yi&&t===mo)return yt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=be&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+Yi;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=Yi-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=be?(n=Cn._tr_tally(e,1,e.match_length-be),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Cn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Pt(e,!1),e.strm.avail_out===0))return yt}return e.insert=0,t===Wi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):e.last_lit&&(Pt(e,!1),e.strm.avail_out===0)?yt:xu}function TW(e,t){for(var n;;){if(e.lookahead===0&&(vo(e),e.lookahead===0)){if(t===mo)return yt;break}if(e.match_length=0,n=Cn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Pt(e,!1),e.strm.avail_out===0))return yt}return e.insert=0,t===Wi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):e.last_lit&&(Pt(e,!1),e.strm.avail_out===0)?yt:xu}function _r(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var Ms;Ms=[new _r(0,0,0,0,CW),new _r(4,4,8,4,Zb),new _r(4,5,16,8,Zb),new _r(4,6,32,32,Zb),new _r(4,4,16,16,Ps),new _r(8,16,32,32,Ps),new _r(8,16,128,128,Ps),new _r(8,32,128,256,Ps),new _r(32,128,258,1024,Ps),new _r(32,258,258,4096,Ps)];function IW(e){e.window_size=2*e.w_size,Qi(e.head),e.max_lazy_match=Ms[e.level].max_lazy,e.good_match=Ms[e.level].good_length,e.nice_match=Ms[e.level].nice_length,e.max_chain_length=Ms[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=be-1,e.match_available=0,e.ins_h=0}function RW(){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=Xd,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 Wt.Buf16(xW*2),this.dyn_dtree=new Wt.Buf16((2*vW+1)*2),this.bl_tree=new Wt.Buf16((2*wW+1)*2),Qi(this.dyn_ltree),Qi(this.dyn_dtree),Qi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Wt.Buf16(AW+1),this.heap=new Wt.Buf16(2*Wb+1),Qi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Wt.Buf16(2*Wb+1),Qi(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 $6(e){var t;return!e||!e.state?Zi(e,kn):(e.total_in=e.total_out=0,e.data_type=dW,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Kd:bo,e.adler=t.wrap===2?0:1,t.last_flush=mo,Cn._tr_init(t),Sr)}function H6(e){var t=$6(e);return t===Sr&&IW(e.state),t}function DW(e,t){return!e||!e.state||e.state.wrap!==2?kn:(e.state.gzhead=t,Sr)}function G6(e,t,n,r,i,a){if(!e)return kn;var o=1;if(t===cW&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>pW||n!==Xd||r<8||r>15||t<0||t>9||a<0||a>fW)return Zi(e,kn);r===8&&(r=9);var s=new RW;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+be-1)/be),s.window=new Wt.Buf8(s.w_size*2),s.head=new Wt.Buf16(s.hash_size),s.prev=new Wt.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Wt.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=a,s.method=n,H6(e)}function BW(e,t){return G6(e,t,Xd,gW,mW,hW)}function FW(e,t){var n,r,i,a;if(!e||!e.state||t>L6||t<0)return e?Zi(e,kn):kn;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===wu&&t!==Wi)return Zi(e,e.avail_out===0?qb:kn);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===Kd)if(r.wrap===2)e.adler=0,Se(r,31),Se(r,139),Se(r,8),r.gzhead?(Se(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Se(r,r.gzhead.time&255),Se(r,r.gzhead.time>>8&255),Se(r,r.gzhead.time>>16&255),Se(r,r.gzhead.time>>24&255),Se(r,r.level===9?2:r.strategy>=Qd||r.level<2?4:0),Se(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Se(r,r.gzhead.extra.length&255),Se(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=qi(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Yb):(Se(r,0),Se(r,0),Se(r,0),Se(r,0),Se(r,0),Se(r,r.level===9?2:r.strategy>=Qd||r.level<2?4:0),Se(r,SW),r.status=bo);else{var o=Xd+(r.w_bits-8<<4)<<8,s=-1;r.strategy>=Qd||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,o|=s<<6,r.strstart!==0&&(o|=EW),o+=31-o%31,r.status=bo,Au(r,o),r.strstart!==0&&(Au(r,e.adler>>>16),Au(r,e.adler&65535)),e.adler=1}if(r.status===Yb)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=qi(e.adler,r.pending_buf,r.pending-i,i)),Xi(e),i=r.pending,r.pending===r.pending_buf_size));)Se(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=qi(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Jd)}else r.status=Jd;if(r.status===Jd)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=qi(e.adler,r.pending_buf,r.pending-i,i)),Xi(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,Se(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=qi(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.gzindex=0,r.status=e0)}else r.status=e0;if(r.status===e0)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=qi(e.adler,r.pending_buf,r.pending-i,i)),Xi(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,Se(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=qi(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.status=t0)}else r.status=t0;if(r.status===t0&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Xi(e),r.pending+2<=r.pending_buf_size&&(Se(r,e.adler&255),Se(r,e.adler>>8&255),e.adler=0,r.status=bo)):r.status=bo),r.pending!==0){if(Xi(e),e.avail_out===0)return r.last_flush=-1,Sr}else if(e.avail_in===0&&z6(t)<=z6(n)&&t!==Wi)return Zi(e,qb);if(r.status===wu&&e.avail_in!==0)return Zi(e,qb);if(e.avail_in!==0||r.lookahead!==0||t!==mo&&r.status!==wu){var c=r.strategy===Qd?TW(r,t):r.strategy===uW?kW(r,t):Ms[r.level].func(r,t);if((c===yo||c===Fs)&&(r.status=wu),c===yt||c===yo)return e.avail_out===0&&(r.last_flush=-1),Sr;if(c===xu&&(t===aW?Cn._tr_align(r):t!==L6&&(Cn._tr_stored_block(r,0,0,!1),t===oW&&(Qi(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Xi(e),e.avail_out===0))return r.last_flush=-1,Sr}return t!==Wi?Sr:r.wrap<=0?N6:(r.wrap===2?(Se(r,e.adler&255),Se(r,e.adler>>8&255),Se(r,e.adler>>16&255),Se(r,e.adler>>24&255),Se(r,e.total_in&255),Se(r,e.total_in>>8&255),Se(r,e.total_in>>16&255),Se(r,e.total_in>>24&255)):(Au(r,e.adler>>>16),Au(r,e.adler&65535)),Xi(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Sr:N6)}function PW(e){var t;return!e||!e.state?kn:(t=e.state.status,t!==Kd&&t!==Yb&&t!==Jd&&t!==e0&&t!==t0&&t!==bo&&t!==wu?Zi(e,kn):(e.state=null,t===bo?Zi(e,sW):Sr))}function MW(e,t){var n=t.length,r,i,a,o,s,c,l,u;if(!e||!e.state||(r=e.state,o=r.wrap,o===2||o===1&&r.status!==Kd||r.lookahead))return kn;for(o===1&&(e.adler=O6(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(o===0&&(Qi(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Wt.Buf8(r.w_size),Wt.arraySet(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),s=e.avail_in,c=e.next_in,l=e.input,e.avail_in=n,e.next_in=0,e.input=t,vo(r);r.lookahead>=be;){i=r.strstart,a=r.lookahead-(be-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+be-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++;while(--a);r.strstart=i,r.lookahead=be-1,vo(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=be-1,r.match_available=0,e.next_in=c,e.input=l,e.avail_in=s,r.wrap=o,Sr}Ar.deflateInit=BW,Ar.deflateInit2=G6,Ar.deflateReset=H6,Ar.deflateResetKeep=$6,Ar.deflateSetHeader=DW,Ar.deflate=FW,Ar.deflateEnd=PW,Ar.deflateSetDictionary=MW,Ar.deflateInfo="pako deflate (from Nodeca project)";var wo={},n0=Kr,V6=!0,j6=!0;try{String.fromCharCode.apply(null,[0])}catch{V6=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{j6=!1}for(var Eu=new n0.Buf8(256),Ki=0;Ki<256;Ki++)Eu[Ki]=Ki>=252?6:Ki>=248?5:Ki>=240?4:Ki>=224?3:Ki>=192?2:1;Eu[254]=Eu[254]=1,wo.string2buf=function(e){var t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new n0.Buf8(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};function q6(e,t){if(t<65534&&(e.subarray&&j6||!e.subarray&&V6))return String.fromCharCode.apply(null,n0.shrinkBuf(e,t));for(var n="",r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}wo.buf2binstring=function(e){return q6(e,e.length)},wo.binstring2buf=function(e){for(var t=new n0.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},wo.buf2string=function(e,t){var n,r,i,a,o=t||e.length,s=new Array(o*2);for(r=0,n=0;n<o;){if(i=e[n++],i<128){s[r++]=i;continue}if(a=Eu[i],a>4){s[r++]=65533,n+=a-1;continue}for(i&=a===2?31:a===3?15:7;a>1&&n<o;)i=i<<6|e[n++]&63,a--;if(a>1){s[r++]=65533;continue}i<65536?s[r++]=i:(i-=65536,s[r++]=55296|i>>10&1023,s[r++]=56320|i&1023)}return q6(s,r)},wo.utf8border=function(e,t){var n;for(t=t||e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Eu[e[n]]>t?n:t};function OW(){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}var W6=OW,Su=Ar,_u=Kr,Qb=wo,Xb=jb,LW=W6,Y6=Object.prototype.toString,NW=0,Kb=4,Os=0,Z6=1,Q6=2,zW=-1,UW=0,$W=8;function xo(e){if(!(this instanceof xo))return new xo(e);this.options=_u.assign({level:zW,method:$W,chunkSize:16384,windowBits:15,memLevel:8,strategy:UW,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new LW,this.strm.avail_out=0;var n=Su.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Os)throw new Error(Xb[n]);if(t.header&&Su.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(typeof t.dictionary=="string"?r=Qb.string2buf(t.dictionary):Y6.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Su.deflateSetDictionary(this.strm,r),n!==Os)throw new Error(Xb[n]);this._dict_set=!0}}xo.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?Kb:NW,typeof e=="string"?n.input=Qb.string2buf(e):Y6.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new _u.Buf8(r),n.next_out=0,n.avail_out=r),i=Su.deflate(n,a),i!==Z6&&i!==Os)return this.onEnd(i),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(a===Kb||a===Q6))&&(this.options.to==="string"?this.onData(Qb.buf2binstring(_u.shrinkBuf(n.output,n.next_out))):this.onData(_u.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==Z6);return a===Kb?(i=Su.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Os):(a===Q6&&(this.onEnd(Os),n.avail_out=0),!0)},xo.prototype.onData=function(e){this.chunks.push(e)},xo.prototype.onEnd=function(e){e===Os&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=_u.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Jb(e,t){var n=new xo(t);if(n.push(e,!0),n.err)throw n.msg||Xb[n.err];return n.result}function HW(e,t){return t=t||{},t.raw=!0,Jb(e,t)}function GW(e,t){return t=t||{},t.gzip=!0,Jb(e,t)}du.Deflate=xo,du.deflate=Jb,du.deflateRaw=HW,du.gzip=GW;var Cu={},Jn={},r0=30,VW=12,jW=function(t,n){var r,i,a,o,s,c,l,u,f,h,d,p,g,b,v,x,A,w,_,C,I,D,B,G,z;r=t.state,i=t.next_in,G=t.input,a=i+(t.avail_in-5),o=t.next_out,z=t.output,s=o-(n-t.avail_out),c=o+(t.avail_out-257),l=r.dmax,u=r.wsize,f=r.whave,h=r.wnext,d=r.window,p=r.hold,g=r.bits,b=r.lencode,v=r.distcode,x=(1<<r.lenbits)-1,A=(1<<r.distbits)-1;e:do{g<15&&(p+=G[i++]<<g,g+=8,p+=G[i++]<<g,g+=8),w=b[p&x];t:for(;;){if(_=w>>>24,p>>>=_,g-=_,_=w>>>16&255,_===0)z[o++]=w&65535;else if(_&16){C=w&65535,_&=15,_&&(g<_&&(p+=G[i++]<<g,g+=8),C+=p&(1<<_)-1,p>>>=_,g-=_),g<15&&(p+=G[i++]<<g,g+=8,p+=G[i++]<<g,g+=8),w=v[p&A];n:for(;;){if(_=w>>>24,p>>>=_,g-=_,_=w>>>16&255,_&16){if(I=w&65535,_&=15,g<_&&(p+=G[i++]<<g,g+=8,g<_&&(p+=G[i++]<<g,g+=8)),I+=p&(1<<_)-1,I>l){t.msg="invalid distance too far back",r.mode=r0;break e}if(p>>>=_,g-=_,_=o-s,I>_){if(_=I-_,_>f&&r.sane){t.msg="invalid distance too far back",r.mode=r0;break e}if(D=0,B=d,h===0){if(D+=u-_,_<C){C-=_;do z[o++]=d[D++];while(--_);D=o-I,B=z}}else if(h<_){if(D+=u+h-_,_-=h,_<C){C-=_;do z[o++]=d[D++];while(--_);if(D=0,h<C){_=h,C-=_;do z[o++]=d[D++];while(--_);D=o-I,B=z}}}else if(D+=h-_,_<C){C-=_;do z[o++]=d[D++];while(--_);D=o-I,B=z}for(;C>2;)z[o++]=B[D++],z[o++]=B[D++],z[o++]=B[D++],C-=3;C&&(z[o++]=B[D++],C>1&&(z[o++]=B[D++]))}else{D=o-I;do z[o++]=z[D++],z[o++]=z[D++],z[o++]=z[D++],C-=3;while(C>2);C&&(z[o++]=z[D++],C>1&&(z[o++]=z[D++]))}}else if(_&64){t.msg="invalid distance code",r.mode=r0;break e}else{w=v[(w&65535)+(p&(1<<_)-1)];continue n}break}}else if(_&64)if(_&32){r.mode=VW;break e}else{t.msg="invalid literal/length code",r.mode=r0;break e}else{w=b[(w&65535)+(p&(1<<_)-1)];continue t}break}}while(i<a&&o<c);C=g>>3,i-=C,g-=C<<3,p&=(1<<g)-1,t.next_in=i,t.next_out=o,t.avail_in=i<a?5+(a-i):5-(i-a),t.avail_out=o<c?257+(c-o):257-(o-c),r.hold=p,r.bits=g},X6=Kr,Ls=15,K6=852,J6=592,eC=0,ey=1,tC=2,qW=[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],WW=[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],YW=[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],ZW=[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],QW=function(t,n,r,i,a,o,s,c){var l=c.bits,u=0,f=0,h=0,d=0,p=0,g=0,b=0,v=0,x=0,A=0,w,_,C,I,D,B=null,G=0,z,ae=new X6.Buf16(Ls+1),se=new X6.Buf16(Ls+1),ve=null,Pe=0,st,Ne,lt;for(u=0;u<=Ls;u++)ae[u]=0;for(f=0;f<i;f++)ae[n[r+f]]++;for(p=l,d=Ls;d>=1&&ae[d]===0;d--);if(p>d&&(p=d),d===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,c.bits=1,0;for(h=1;h<d&&ae[h]===0;h++);for(p<h&&(p=h),v=1,u=1;u<=Ls;u++)if(v<<=1,v-=ae[u],v<0)return-1;if(v>0&&(t===eC||d!==1))return-1;for(se[1]=0,u=1;u<Ls;u++)se[u+1]=se[u]+ae[u];for(f=0;f<i;f++)n[r+f]!==0&&(s[se[n[r+f]]++]=f);if(t===eC?(B=ve=s,z=19):t===ey?(B=qW,G-=257,ve=WW,Pe-=257,z=256):(B=YW,ve=ZW,z=-1),A=0,f=0,u=h,D=o,g=p,b=0,C=-1,x=1<<p,I=x-1,t===ey&&x>K6||t===tC&&x>J6)return 1;for(;;){st=u-b,s[f]<z?(Ne=0,lt=s[f]):s[f]>z?(Ne=ve[Pe+s[f]],lt=B[G+s[f]]):(Ne=32+64,lt=0),w=1<<u-b,_=1<<g,h=_;do _-=w,a[D+(A>>b)+_]=st<<24|Ne<<16|lt|0;while(_!==0);for(w=1<<u-1;A&w;)w>>=1;if(w!==0?(A&=w-1,A+=w):A=0,f++,--ae[u]===0){if(u===d)break;u=n[r+s[f]]}if(u>p&&(A&I)!==C){for(b===0&&(b=p),D+=h,g=u-b,v=1<<g;g+b<d&&(v-=ae[g+b],!(v<=0));)g++,v<<=1;if(x+=1<<g,t===ey&&x>K6||t===tC&&x>J6)return 1;C=A&I,a[C]=p<<24|g<<16|D-o|0}}return A!==0&&(a[D+A]=u-b<<24|64<<16|0),c.bits=p,0},mn=Kr,ty=P6,Cr=M6,XW=jW,ku=QW,KW=0,nC=1,rC=2,iC=4,JW=5,i0=6,Ao=0,eY=1,tY=2,Tn=-2,aC=-3,oC=-4,nY=-5,sC=8,cC=1,lC=2,uC=3,fC=4,hC=5,dC=6,pC=7,gC=8,mC=9,bC=10,a0=11,ei=12,ny=13,yC=14,ry=15,vC=16,wC=17,xC=18,AC=19,o0=20,s0=21,EC=22,SC=23,_C=24,CC=25,kC=26,iy=27,TC=28,IC=29,Ke=30,RC=31,rY=32,iY=852,aY=592,oY=15,sY=oY;function DC(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function cY(){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 mn.Buf16(320),this.work=new mn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function BC(e){var t;return!e||!e.state?Tn:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=cC,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new mn.Buf32(iY),t.distcode=t.distdyn=new mn.Buf32(aY),t.sane=1,t.back=-1,Ao)}function FC(e){var t;return!e||!e.state?Tn:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,BC(e))}function PC(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Tn:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,FC(e))}function MC(e,t){var n,r;return e?(r=new cY,e.state=r,r.window=null,n=PC(e,t),n!==Ao&&(e.state=null),n):Tn}function lY(e){return MC(e,sY)}var OC=!0,ay,oy;function uY(e){if(OC){var t;for(ay=new mn.Buf32(512),oy=new mn.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ku(nC,e.lens,0,288,ay,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ku(rC,e.lens,0,32,oy,0,e.work,{bits:5}),OC=!1}e.lencode=ay,e.lenbits=9,e.distcode=oy,e.distbits=5}function LC(e,t,n,r){var i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new mn.Buf8(a.wsize)),r>=a.wsize?(mn.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),mn.arraySet(a.window,t,n-r,i,a.wnext),r-=i,r?(mn.arraySet(a.window,t,n-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function fY(e,t){var n,r,i,a,o,s,c,l,u,f,h,d,p,g,b=0,v,x,A,w,_,C,I,D,B=new mn.Buf8(4),G,z,ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Tn;n=e.state,n.mode===ei&&(n.mode=ny),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,f=s,h=c,D=Ao;e:for(;;)switch(n.mode){case cC:if(n.wrap===0){n.mode=ny;break}for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.check=0,B[0]=l&255,B[1]=l>>>8&255,n.check=Cr(n.check,B,2,0),l=0,u=0,n.mode=lC;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Ke;break}if((l&15)!==sC){e.msg="unknown compression method",n.mode=Ke;break}if(l>>>=4,u-=4,I=(l&15)+8,n.wbits===0)n.wbits=I;else if(I>n.wbits){e.msg="invalid window size",n.mode=Ke;break}n.dmax=1<<I,e.adler=n.check=1,n.mode=l&512?bC:ei,l=0,u=0;break;case lC:for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==sC){e.msg="unknown compression method",n.mode=Ke;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Ke;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Cr(n.check,B,2,0)),l=0,u=0,n.mode=uC;case uC:for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,B[2]=l>>>16&255,B[3]=l>>>24&255,n.check=Cr(n.check,B,4,0)),l=0,u=0,n.mode=fC;case fC:for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Cr(n.check,B,2,0)),l=0,u=0,n.mode=hC;case hC:if(n.flags&1024){for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Cr(n.check,B,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=dC;case dC:if(n.flags&1024&&(d=n.length,d>s&&(d=s),d&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),mn.arraySet(n.head.extra,r,a,d,I)),n.flags&512&&(n.check=Cr(n.check,r,d,a)),s-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=pC;case pC:if(n.flags&2048){if(s===0)break e;d=0;do I=r[a+d++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I));while(I&&d<s);if(n.flags&512&&(n.check=Cr(n.check,r,d,a)),s-=d,a+=d,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=gC;case gC:if(n.flags&4096){if(s===0)break e;d=0;do I=r[a+d++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I));while(I&&d<s);if(n.flags&512&&(n.check=Cr(n.check,r,d,a)),s-=d,a+=d,I)break e}else n.head&&(n.head.comment=null);n.mode=mC;case mC:if(n.flags&512){for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(l!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Ke;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ei;break;case bC:for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=DC(l),l=0,u=0,n.mode=a0;case a0:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,tY;e.adler=n.check=1,n.mode=ei;case ei:if(t===JW||t===i0)break e;case ny:if(n.last){l>>>=u&7,u-=u&7,n.mode=iy;break}for(;u<3;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,u-=1,l&3){case 0:n.mode=yC;break;case 1:if(uY(n),n.mode=o0,t===i0){l>>>=2,u-=2;break e}break;case 2:n.mode=wC;break;case 3:e.msg="invalid block type",n.mode=Ke}l>>>=2,u-=2;break;case yC:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Ke;break}if(n.length=l&65535,l=0,u=0,n.mode=ry,t===i0)break e;case ry:n.mode=vC;case vC:if(d=n.length,d){if(d>s&&(d=s),d>c&&(d=c),d===0)break e;mn.arraySet(i,r,a,d,o),s-=d,a+=d,c-=d,o+=d,n.length-=d;break}n.mode=ei;break;case wC:for(;u<14;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Ke;break}n.have=0,n.mode=xC;case xC:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.lens[ae[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[ae[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,G={bits:n.lenbits},D=ku(KW,n.lens,0,19,n.lencode,0,n.work,G),n.lenbits=G.bits,D){e.msg="invalid code lengths set",n.mode=Ke;break}n.have=0,n.mode=AC;case AC:for(;n.have<n.nlen+n.ndist;){for(;b=n.lencode[l&(1<<n.lenbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(A<16)l>>>=v,u-=v,n.lens[n.have++]=A;else{if(A===16){for(z=v+2;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(l>>>=v,u-=v,n.have===0){e.msg="invalid bit length repeat",n.mode=Ke;break}I=n.lens[n.have-1],d=3+(l&3),l>>>=2,u-=2}else if(A===17){for(z=v+3;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=v,u-=v,I=0,d=3+(l&7),l>>>=3,u-=3}else{for(z=v+7;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=v,u-=v,I=0,d=11+(l&127),l>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Ke;break}for(;d--;)n.lens[n.have++]=I}}if(n.mode===Ke)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Ke;break}if(n.lenbits=9,G={bits:n.lenbits},D=ku(nC,n.lens,0,n.nlen,n.lencode,0,n.work,G),n.lenbits=G.bits,D){e.msg="invalid literal/lengths set",n.mode=Ke;break}if(n.distbits=6,n.distcode=n.distdyn,G={bits:n.distbits},D=ku(rC,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,G),n.distbits=G.bits,D){e.msg="invalid distances set",n.mode=Ke;break}if(n.mode=o0,t===i0)break e;case o0:n.mode=s0;case s0:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,XW(e,h),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===ei&&(n.back=-1);break}for(n.back=0;b=n.lencode[l&(1<<n.lenbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(x&&!(x&240)){for(w=v,_=x,C=A;b=n.lencode[C+((l&(1<<w+_)-1)>>w)],v=b>>>24,x=b>>>16&255,A=b&65535,!(w+v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=v,u-=v,n.back+=v,n.length=A,x===0){n.mode=kC;break}if(x&32){n.back=-1,n.mode=ei;break}if(x&64){e.msg="invalid literal/length code",n.mode=Ke;break}n.extra=x&15,n.mode=EC;case EC:if(n.extra){for(z=n.extra;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=SC;case SC:for(;b=n.distcode[l&(1<<n.distbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(!(x&240)){for(w=v,_=x,C=A;b=n.distcode[C+((l&(1<<w+_)-1)>>w)],v=b>>>24,x=b>>>16&255,A=b&65535,!(w+v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=v,u-=v,n.back+=v,x&64){e.msg="invalid distance code",n.mode=Ke;break}n.offset=A,n.extra=x&15,n.mode=_C;case _C:if(n.extra){for(z=n.extra;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Ke;break}n.mode=CC;case CC:if(c===0)break e;if(d=h-c,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Ke;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=o-n.offset,d=n.length;d>c&&(d=c),c-=d,n.length-=d;do i[o++]=g[p++];while(--d);n.length===0&&(n.mode=s0);break;case kC:if(c===0)break e;i[o++]=n.length,c--,n.mode=s0;break;case iy:if(n.wrap){for(;u<32;){if(s===0)break e;s--,l|=r[a++]<<u,u+=8}if(h-=c,e.total_out+=h,n.total+=h,h&&(e.adler=n.check=n.flags?Cr(n.check,i,h,o-h):ty(n.check,i,h,o-h)),h=c,(n.flags?l:DC(l))!==n.check){e.msg="incorrect data check",n.mode=Ke;break}l=0,u=0}n.mode=TC;case TC:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(l!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Ke;break}l=0,u=0}n.mode=IC;case IC:D=eY;break e;case Ke:D=aC;break e;case RC:return oC;case rY:default:return Tn}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||h!==e.avail_out&&n.mode<Ke&&(n.mode<iy||t!==iC))&&LC(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,n.total+=h,n.wrap&&h&&(e.adler=n.check=n.flags?Cr(n.check,i,h,e.next_out-h):ty(n.check,i,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ei?128:0)+(n.mode===o0||n.mode===ry?256:0),(f===0&&h===0||t===iC)&&D===Ao&&(D=nY),D}function hY(e){if(!e||!e.state)return Tn;var t=e.state;return t.window&&(t.window=null),e.state=null,Ao}function dY(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?Tn:(n.head=t,t.done=!1,Ao)}function pY(e,t){var n=t.length,r,i,a;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==a0)?Tn:r.mode===a0&&(i=1,i=ty(i,t,n,0),i!==r.check)?aC:(a=LC(e,t,n,n),a?(r.mode=RC,oC):(r.havedict=1,Ao))}Jn.inflateReset=FC,Jn.inflateReset2=PC,Jn.inflateResetKeep=BC,Jn.inflateInit=lY,Jn.inflateInit2=MC,Jn.inflate=fY,Jn.inflateEnd=hY,Jn.inflateGetHeader=dY,Jn.inflateSetDictionary=pY,Jn.inflateInfo="pako inflate (from Nodeca project)";var NC={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};function gY(){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}var mY=gY,Ns=Jn,Tu=Kr,c0=wo,ht=NC,sy=jb,bY=W6,yY=mY,zC=Object.prototype.toString;function Eo(e){if(!(this instanceof Eo))return new Eo(e);this.options=Tu.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bY,this.strm.avail_out=0;var n=Ns.inflateInit2(this.strm,t.windowBits);if(n!==ht.Z_OK)throw new Error(sy[n]);if(this.header=new yY,Ns.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=c0.string2buf(t.dictionary):zC.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ns.inflateSetDictionary(this.strm,t.dictionary),n!==ht.Z_OK)))throw new Error(sy[n])}Eo.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,o,s,c,l,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?ht.Z_FINISH:ht.Z_NO_FLUSH,typeof e=="string"?n.input=c0.binstring2buf(e):zC.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new Tu.Buf8(r),n.next_out=0,n.avail_out=r),a=Ns.inflate(n,ht.Z_NO_FLUSH),a===ht.Z_NEED_DICT&&i&&(a=Ns.inflateSetDictionary(this.strm,i)),a===ht.Z_BUF_ERROR&&u===!0&&(a=ht.Z_OK,u=!1),a!==ht.Z_STREAM_END&&a!==ht.Z_OK)return this.onEnd(a),this.ended=!0,!1;n.next_out&&(n.avail_out===0||a===ht.Z_STREAM_END||n.avail_in===0&&(o===ht.Z_FINISH||o===ht.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=c0.utf8border(n.output,n.next_out),c=n.next_out-s,l=c0.buf2string(n.output,s),n.next_out=c,n.avail_out=r-c,c&&Tu.arraySet(n.output,n.output,s,c,0),this.onData(l)):this.onData(Tu.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(u=!0)}while((n.avail_in>0||n.avail_out===0)&&a!==ht.Z_STREAM_END);return a===ht.Z_STREAM_END&&(o=ht.Z_FINISH),o===ht.Z_FINISH?(a=Ns.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===ht.Z_OK):(o===ht.Z_SYNC_FLUSH&&(this.onEnd(ht.Z_OK),n.avail_out=0),!0)},Eo.prototype.onData=function(e){this.chunks.push(e)},Eo.prototype.onEnd=function(e){e===ht.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Tu.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function cy(e,t){var n=new Eo(t);if(n.push(e,!0),n.err)throw n.msg||sy[n.err];return n.result}function vY(e,t){return t=t||{},t.raw=!0,cy(e,t)}Cu.Inflate=Eo,Cu.inflate=cy,Cu.inflateRaw=vY,Cu.ungzip=cy;var wY=Kr.assign,xY=du,AY=Cu,EY=NC,UC={};wY(UC,xY,AY,EY);var l0=UC;async function Ji(e){try{let t,n=0,r=0;const i=[];let a=0,o;do{const c=e.subarray(n);if(o=new l0.Inflate,{strm:t}=o,o.push(c,l0.Z_SYNC_FLUSH),o.err)throw new Error(o.msg);n+=t.next_in,i[r]=o.result,a+=i[r].length,r+=1}while(t.avail_in);const s=new Uint8Array(a);for(let c=0,l=0;c<i.length;c++)s.set(i[c],l),l+=i[c].length;return we.Buffer.from(s)}catch(t){throw`${t}`.match(/incorrect header check/)?new Error("problem decompressing block: incorrect gzip header check"):t}}async function $C(e,t){try{let n;const{minv:r,maxv:i}=t;let a=r.blockPosition,o=r.dataPosition;const s=[],c=[],l=[];let u=0,f=0;do{const p=e.subarray(a-r.blockPosition),g=new l0.Inflate;if({strm:n}=g,g.push(p,l0.Z_SYNC_FLUSH),g.err)throw new Error(g.msg);const b=g.result;s.push(b);let v=b.length;c.push(a),l.push(o),s.length===1&&r.dataPosition&&(s[0]=s[0].subarray(r.dataPosition),v=s[0].length);const x=a;if(a+=n.next_in,o+=v,x>=i.blockPosition){s[f]=s[f].subarray(0,i.blockPosition===r.blockPosition?i.dataPosition-r.dataPosition+1:i.dataPosition+1),c.push(a),l.push(o),u+=s[f].length;break}u+=s[f].length,f++}while(n.avail_in);const h=new Uint8Array(u);for(let p=0,g=0;p<s.length;p++)h.set(s[p],g),g+=s[p].length;return{buffer:we.Buffer.from(h),cpositions:c,dpositions:l}}catch(n){throw`${n}`.match(/incorrect header check/)?new Error("problem decompressing block: incorrect gzip header check"):n}}var SY=He,In=null;try{In=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function He(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}He.prototype.__isLong__,Object.defineProperty(He.prototype,"__isLong__",{value:!0});function on(e){return(e&&e.__isLong__)===!0}He.isLong=on;var HC={},GC={};function So(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=GC[e],r)?r:(n=Ge(e,(e|0)<0?-1:0,!0),i&&(GC[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=HC[e],r)?r:(n=Ge(e,e<0?-1:0,!1),i&&(HC[e]=n),n))}He.fromInt=So;function Rn(e,t){if(isNaN(e))return t?_o:Dn;if(t){if(e<0)return _o;if(e>=jC)return QC}else{if(e<=-qC)return sn;if(e+1>=qC)return ZC}return e<0?Rn(-e,t).neg():Ge(e%zs|0,e/zs|0,t)}He.fromNumber=Rn;function Ge(e,t,n){return new He(e,t,n)}He.fromBits=Ge;var u0=Math.pow;function ly(e,t,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return Dn;if(typeof t=="number"?(n=t,t=!1):t=!!t,n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return ly(e.substring(1),t,n).neg();for(var i=Rn(u0(n,8)),a=Dn,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+s),n);if(s<8){var l=Rn(u0(n,s));a=a.mul(l).add(Rn(c))}else a=a.mul(i),a=a.add(Rn(c))}return a.unsigned=t,a}He.fromString=ly;function er(e,t){return typeof e=="number"?Rn(e,t):typeof e=="string"?ly(e,t):Ge(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}He.fromValue=er;var VC=65536,_Y=1<<24,zs=VC*VC,jC=zs*zs,qC=jC/2,WC=So(_Y),Dn=So(0);He.ZERO=Dn;var _o=So(0,!0);He.UZERO=_o;var Us=So(1);He.ONE=Us;var YC=So(1,!0);He.UONE=YC;var uy=So(-1);He.NEG_ONE=uy;var ZC=Ge(-1,2147483647,!1);He.MAX_VALUE=ZC;var QC=Ge(-1,-1,!0);He.MAX_UNSIGNED_VALUE=QC;var sn=Ge(0,-2147483648,!1);He.MIN_VALUE=sn;var X=He.prototype;X.toInt=function(){return this.unsigned?this.low>>>0:this.low},X.toNumber=function(){return this.unsigned?(this.high>>>0)*zs+(this.low>>>0):this.high*zs+(this.low>>>0)},X.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(sn)){var n=Rn(t),r=this.div(n),i=r.mul(n).sub(this);return r.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=Rn(u0(t,6),this.unsigned),o=this,s="";;){var c=o.div(a),l=o.sub(c.mul(a)).toInt()>>>0,u=l.toString(t);if(o=c,o.isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},X.getHighBits=function(){return this.high},X.getHighBitsUnsigned=function(){return this.high>>>0},X.getLowBits=function(){return this.low},X.getLowBitsUnsigned=function(){return this.low>>>0},X.getNumBitsAbs=function(){if(this.isNegative())return this.eq(sn)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,n=31;n>0&&!(t&1<<n);n--);return this.high!=0?n+33:n+1},X.isZero=function(){return this.high===0&&this.low===0},X.eqz=X.isZero,X.isNegative=function(){return!this.unsigned&&this.high<0},X.isPositive=function(){return this.unsigned||this.high>=0},X.isOdd=function(){return(this.low&1)===1},X.isEven=function(){return(this.low&1)===0},X.equals=function(t){return on(t)||(t=er(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},X.eq=X.equals,X.notEquals=function(t){return!this.eq(t)},X.neq=X.notEquals,X.ne=X.notEquals,X.lessThan=function(t){return this.comp(t)<0},X.lt=X.lessThan,X.lessThanOrEqual=function(t){return this.comp(t)<=0},X.lte=X.lessThanOrEqual,X.le=X.lessThanOrEqual,X.greaterThan=function(t){return this.comp(t)>0},X.gt=X.greaterThan,X.greaterThanOrEqual=function(t){return this.comp(t)>=0},X.gte=X.greaterThanOrEqual,X.ge=X.greaterThanOrEqual,X.compare=function(t){if(on(t)||(t=er(t)),this.eq(t))return 0;var n=this.isNegative(),r=t.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},X.comp=X.compare,X.negate=function(){return!this.unsigned&&this.eq(sn)?sn:this.not().add(Us)},X.neg=X.negate,X.add=function(t){on(t)||(t=er(t));var n=this.high>>>16,r=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,c=t.low>>>16,l=t.low&65535,u=0,f=0,h=0,d=0;return d+=a+l,h+=d>>>16,d&=65535,h+=i+c,f+=h>>>16,h&=65535,f+=r+s,u+=f>>>16,f&=65535,u+=n+o,u&=65535,Ge(h<<16|d,u<<16|f,this.unsigned)},X.subtract=function(t){return on(t)||(t=er(t)),this.add(t.neg())},X.sub=X.subtract,X.multiply=function(t){if(this.isZero())return Dn;if(on(t)||(t=er(t)),In){var n=In.mul(this.low,this.high,t.low,t.high);return Ge(n,In.get_high(),this.unsigned)}if(t.isZero())return Dn;if(this.eq(sn))return t.isOdd()?sn:Dn;if(t.eq(sn))return this.isOdd()?sn:Dn;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(WC)&&t.lt(WC))return Rn(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,c=t.high&65535,l=t.low>>>16,u=t.low&65535,f=0,h=0,d=0,p=0;return p+=o*u,d+=p>>>16,p&=65535,d+=a*u,h+=d>>>16,d&=65535,d+=o*l,h+=d>>>16,d&=65535,h+=i*u,f+=h>>>16,h&=65535,h+=a*l,f+=h>>>16,h&=65535,h+=o*c,f+=h>>>16,h&=65535,f+=r*u+i*l+a*c+o*s,f&=65535,Ge(d<<16|p,f<<16|h,this.unsigned)},X.mul=X.multiply,X.divide=function(t){if(on(t)||(t=er(t)),t.isZero())throw Error("division by zero");if(In){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var n=(this.unsigned?In.div_u:In.div_s)(this.low,this.high,t.low,t.high);return Ge(n,In.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?_o:Dn;var r,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return _o;if(t.gt(this.shru(1)))return YC;a=_o}else{if(this.eq(sn)){if(t.eq(Us)||t.eq(uy))return sn;if(t.eq(sn))return Us;var o=this.shr(1);return r=o.div(t).shl(1),r.eq(Dn)?t.isNegative()?Us:uy:(i=this.sub(t.mul(r)),a=r.add(i.div(t)),a)}else if(t.eq(sn))return this.unsigned?_o:Dn;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=Dn}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),c=s<=48?1:u0(2,s-48),l=Rn(r),u=l.mul(t);u.isNegative()||u.gt(i);)r-=c,l=Rn(r,this.unsigned),u=l.mul(t);l.isZero()&&(l=Us),a=a.add(l),i=i.sub(u)}return a},X.div=X.divide,X.modulo=function(t){if(on(t)||(t=er(t)),In){var n=(this.unsigned?In.rem_u:In.rem_s)(this.low,this.high,t.low,t.high);return Ge(n,In.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},X.mod=X.modulo,X.rem=X.modulo,X.not=function(){return Ge(~this.low,~this.high,this.unsigned)},X.and=function(t){return on(t)||(t=er(t)),Ge(this.low&t.low,this.high&t.high,this.unsigned)},X.or=function(t){return on(t)||(t=er(t)),Ge(this.low|t.low,this.high|t.high,this.unsigned)},X.xor=function(t){return on(t)||(t=er(t)),Ge(this.low^t.low,this.high^t.high,this.unsigned)},X.shiftLeft=function(t){return on(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Ge(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Ge(0,this.low<<t-32,this.unsigned)},X.shl=X.shiftLeft,X.shiftRight=function(t){return on(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Ge(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Ge(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},X.shr=X.shiftRight,X.shiftRightUnsigned=function(t){if(on(t)&&(t=t.toInt()),t&=63,t===0)return this;var n=this.high;if(t<32){var r=this.low;return Ge(r>>>t|n<<32-t,n>>>t,this.unsigned)}else return t===32?Ge(n,0,this.unsigned):Ge(n>>>t-32,0,this.unsigned)},X.shru=X.shiftRightUnsigned,X.shr_u=X.shiftRightUnsigned,X.toSigned=function(){return this.unsigned?Ge(this.low,this.high,!1):this},X.toUnsigned=function(){return this.unsigned?this:Ge(this.low,this.high,!0)},X.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},X.toBytesLE=function(){var t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},X.toBytesBE=function(){var t=this.high,n=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},He.fromBytes=function(t,n,r){return r?He.fromBytesLE(t,n):He.fromBytesBE(t,n)},He.fromBytesLE=function(t,n){return new He(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)},He.fromBytesBE=function(t,n){return new He(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)};const f0=uu(SY),h0=1;class CY{constructor({filehandle:t,path:n}){if(t)this.filehandle=t;else if(n)this.filehandle=new kt(n);else throw new TypeError("either filehandle or path must be defined")}_readLongWithOverflow(t,n=0,r=!0){const i=f0.fromBytesLE(t.slice(n,n+8),r);if(i.greaterThan(Number.MAX_SAFE_INTEGER)||i.lessThan(Number.MIN_SAFE_INTEGER))throw new TypeError("integer overflow");return i.toNumber()}_getIndex(){return this.index||(this.index=this._readIndex()),this.index}async _readIndex(){let t=we.Buffer.allocUnsafe(8);await this.filehandle.read(t,0,8,0);const n=this._readLongWithOverflow(t,0,!0);if(!n)return[[0,0]];const r=new Array(n+1);r[0]=[0,0];const i=8*2*n;if(i>Number.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");t=we.Buffer.allocUnsafe(i),await this.filehandle.read(t,0,i,8);for(let a=0;a<n;a+=1){const o=this._readLongWithOverflow(t,a*16),s=this._readLongWithOverflow(t,a*16+8);r[a+1]=[o,s]}return r}async getLastBlock(){const t=await this._getIndex();if(t.length)return t[t.length-1]}async getRelevantBlocksForRead(t,n){const r=n+t;if(t===0)return[];const i=await this._getIndex(),a=[],o=(h,d)=>{const p=h[h0],g=d?d[h0]:1/0;return p<=n&&g>n?0:p<n?-1:1};let s=0,c=i.length-1,l=Math.floor(i.length/2),u=o(i[l],i[l+1]);for(;u!==0;)u>0?c=l-1:u<0&&(s=l+1),l=Math.ceil((c-s)/2)+s,u=o(i[l],i[l+1]);a.push(i[l]);let f=l+1;for(;f<i.length&&(a.push(i[f]),!(i[f][h0]>=r));f+=1);return a[a.length-1][h0]<r&&a.push([]),a}}class XC{constructor({filehandle:t,path:n,gziFilehandle:r,gziPath:i}){if(t)this.filehandle=t;else if(n)this.filehandle=new kt(n);else throw new TypeError("either filehandle or path must be defined");if(!r&&!i&&!n)throw new TypeError("either gziFilehandle or gziPath must be defined");this.gzi=new CY({filehandle:r,path:!r&&!i&&n?i:`${n}.gzi`})}async stat(){const t=await this.filehandle.stat();return Object.assign(t,{size:await this.getUncompressedFileSize(),blocks:void 0,blksize:void 0})}async getUncompressedFileSize(){const[,t]=await this.gzi.getLastBlock(),{size:n}=await this.filehandle.stat(),r=we.Buffer.allocUnsafe(4),{bytesRead:i}=await this.filehandle.read(r,0,4,n-28-4);if(i!==4)throw new Error("read error");const a=r.readUInt32LE(0);return t+a}async _readAndUncompressBlock(t,[n],[r]){let i=r;i||(i=(await this.filehandle.stat()).size);const a=i-n;return await this.filehandle.read(t,0,a,n),await Ji(t.slice(0,a))}async read(t,n,r,i){const a=await this.gzi.getRelevantBlocksForRead(r,i),o=we.Buffer.allocUnsafe(32768*2);let s=n,c=0;for(let l=0;l<a.length-1;l+=1){const u=await this._readAndUncompressBlock(o,a[l],a[l+1]),[,f]=a[l],h=f>=i?0:i-f,d=Math.min(i+r,f+u.length)-f;h>=0&&h<u.length&&(u.copy(t,s,h,d),s+=d-h,c+=d-h)}return{bytesRead:c,buffer:t}}}function KC(e,t){return e.offset+e.lineBytes*Math.floor(t/e.lineLength)+t%e.lineLength}async function kY(e,t){const n=await e.readFile(t);if(!(n&&n.length))throw new Error("No data read from FASTA index (FAI) file");let r=0,i;const a=n.toString("utf8").split(/\r?\n/).filter(o=>/\S/.test(o)).map(o=>o.split(" ")).filter(o=>o[0]!=="").map(o=>((!i||i.name!==o[0])&&(i={name:o[0],id:r},r+=1),{id:i.id,name:o[0],length:+o[1],start:0,end:+o[1],offset:+o[2],lineLength:+o[3],lineBytes:+o[4]}));return{name:Object.fromEntries(a.map(o=>[o.name,o])),id:Object.fromEntries(a.map(o=>[o.id,o]))}}class JC{constructor({fasta:t,fai:n,path:r,faiPath:i,chunkSizeLimit:a=1e6}){if(t)this.fasta=t;else if(r)this.fasta=new kt(r);else throw new Error("Need to pass filehandle for fasta or path to localfile");if(n)this.fai=n;else if(i)this.fai=new kt(i);else if(r)this.fai=new kt(`${r}.fai`);else throw new Error("Need to pass filehandle for or path to localfile");this.chunkSizeLimit=a}async _getIndexes(t){return this.indexes||(this.indexes=kY(this.fai,t)),this.indexes}async getSequenceNames(t){return Object.keys((await this._getIndexes(t)).name)}async getSequenceSizes(t){const n={},r=await this._getIndexes(t),i=Object.values(r.id);for(let a=0;a<i.length;a+=1)n[i[a].name]=i[a].length;return n}async getSequenceSize(t,n){var r;return(r=(await this._getIndexes(n)).name[t])===null||r===void 0?void 0:r.length}async hasReferenceSequence(t,n){return!!(await this._getIndexes(n)).name[t]}async getResiduesById(t,n,r,i){const a=(await this._getIndexes(i)).id[t];if(a)return this._fetchFromIndexEntry(a,n,r,i)}async getResiduesByName(t,n,r,i){const a=(await this._getIndexes(i)).name[t];if(a)return this._fetchFromIndexEntry(a,n,r,i)}async getSequence(t,n,r,i){return this.getResiduesByName(t,n,r,i)}async _fetchFromIndexEntry(t,n=0,r,i){let a=r;if(n<0)throw new TypeError("regionStart cannot be less than 0");if((a===void 0||a>t.length)&&(a=t.length),n>=a)return"";const o=KC(t,n),s=KC(t,a)-o;if(s>this.chunkSizeLimit)throw new Error(`data size of ${s.toLocaleString()} bytes exceeded chunk size limit of ${this.chunkSizeLimit.toLocaleString()} bytes`);const c=Buffer.allocUnsafe(s);return await this.fasta.read(c,0,s,o,i),c.toString("utf8").replace(/\s+/g,"")}}class TY extends JC{constructor({fasta:t,path:n,fai:r,faiPath:i,gzi:a,gziPath:o,chunkSizeLimit:s}){super({fasta:t,path:n,fai:r,faiPath:i,chunkSizeLimit:s}),t&&a?this.fasta=new XC({filehandle:t,gziFilehandle:a}):n&&o&&(this.fasta=new XC({path:n,gziPath:o}))}}function e5(e){return e.split(">").filter(t=>/\S/.test(t)).map(t=>{const[n,...r]=t.split(`
|
3200
|
+
*/(function(e){const t=Wd,n=Fb,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=x,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.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{const E=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(E,m),E.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(E){if(E>i)throw new RangeError('The value "'+E+'" is invalid for option "size"');const m=new Uint8Array(E);return Object.setPrototypeOf(m,s.prototype),m}function s(E,m,y){if(typeof E=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(E)}return c(E,m,y)}s.poolSize=8192;function c(E,m,y){if(typeof E=="string")return h(E,m);if(ArrayBuffer.isView(E))return p(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(Gt(E,ArrayBuffer)||E&&Gt(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Gt(E,SharedArrayBuffer)||E&&Gt(E.buffer,SharedArrayBuffer)))return g(E,m,y);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const R=E.valueOf&&E.valueOf();if(R!=null&&R!==E)return s.from(R,m,y);const M=b(E);if(M)return M;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return s.from(E[Symbol.toPrimitive]("string"),m,y);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}s.from=function(E,m,y){return c(E,m,y)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function u(E,m,y){return l(E),E<=0?o(E):m!==void 0?typeof y=="string"?o(E).fill(m,y):o(E).fill(m):o(E)}s.alloc=function(E,m,y){return u(E,m,y)};function f(E){return l(E),o(E<0?0:v(E)|0)}s.allocUnsafe=function(E){return f(E)},s.allocUnsafeSlow=function(E){return f(E)};function h(E,m){if((typeof m!="string"||m==="")&&(m="utf8"),!s.isEncoding(m))throw new TypeError("Unknown encoding: "+m);const y=A(E,m)|0;let R=o(y);const M=R.write(E,m);return M!==y&&(R=R.slice(0,M)),R}function d(E){const m=E.length<0?0:v(E.length)|0,y=o(m);for(let R=0;R<m;R+=1)y[R]=E[R]&255;return y}function p(E){if(Gt(E,Uint8Array)){const m=new Uint8Array(E);return g(m.buffer,m.byteOffset,m.byteLength)}return d(E)}function g(E,m,y){if(m<0||E.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<m+(y||0))throw new RangeError('"length" is outside of buffer bounds');let R;return m===void 0&&y===void 0?R=new Uint8Array(E):y===void 0?R=new Uint8Array(E,m):R=new Uint8Array(E,m,y),Object.setPrototypeOf(R,s.prototype),R}function b(E){if(s.isBuffer(E)){const m=v(E.length)|0,y=o(m);return y.length===0||E.copy(y,0,0,m),y}if(E.length!==void 0)return typeof E.length!="number"||fi(E.length)?o(0):d(E);if(E.type==="Buffer"&&Array.isArray(E.data))return d(E.data)}function v(E){if(E>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return E|0}function x(E){return+E!=E&&(E=0),s.alloc(+E)}s.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==s.prototype},s.compare=function(m,y){if(Gt(m,Uint8Array)&&(m=s.from(m,m.offset,m.byteLength)),Gt(y,Uint8Array)&&(y=s.from(y,y.offset,y.byteLength)),!s.isBuffer(m)||!s.isBuffer(y))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===y)return 0;let R=m.length,M=y.length;for(let N=0,q=Math.min(R,M);N<q;++N)if(m[N]!==y[N]){R=m[N],M=y[N];break}return R<M?-1:M<R?1:0},s.isEncoding=function(m){switch(String(m).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}},s.concat=function(m,y){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return s.alloc(0);let R;if(y===void 0)for(y=0,R=0;R<m.length;++R)y+=m[R].length;const M=s.allocUnsafe(y);let N=0;for(R=0;R<m.length;++R){let q=m[R];if(Gt(q,Uint8Array))N+q.length>M.length?(s.isBuffer(q)||(q=s.from(q)),q.copy(M,N)):Uint8Array.prototype.set.call(M,q,N);else if(s.isBuffer(q))q.copy(M,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=q.length}return M};function A(E,m){if(s.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||Gt(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const y=E.length,R=arguments.length>2&&arguments[2]===!0;if(!R&&y===0)return 0;let M=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return y;case"utf8":case"utf-8":return pe(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y*2;case"hex":return y>>>1;case"base64":return ha(E).length;default:if(M)return R?-1:pe(E).length;m=(""+m).toLowerCase(),M=!0}}s.byteLength=A;function w(E,m,y){let R=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((y===void 0||y>this.length)&&(y=this.length),y<=0)||(y>>>=0,m>>>=0,y<=m))return"";for(E||(E="utf8");;)switch(E){case"hex":return tt(this,m,y);case"utf8":case"utf-8":return ve(this,m,y);case"ascii":return Ne(this,m,y);case"latin1":case"binary":return lt(this,m,y);case"base64":return se(this,m,y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,m,y);default:if(R)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),R=!0}}s.prototype._isBuffer=!0;function _(E,m,y){const R=E[m];E[m]=E[y],E[y]=R}s.prototype.swap16=function(){const m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let y=0;y<m;y+=2)_(this,y,y+1);return this},s.prototype.swap32=function(){const m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let y=0;y<m;y+=4)_(this,y,y+3),_(this,y+1,y+2);return this},s.prototype.swap64=function(){const m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let y=0;y<m;y+=8)_(this,y,y+7),_(this,y+1,y+6),_(this,y+2,y+5),_(this,y+3,y+4);return this},s.prototype.toString=function(){const m=this.length;return m===0?"":arguments.length===0?ve(this,0,m):w.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(m){if(!s.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:s.compare(this,m)===0},s.prototype.inspect=function(){let m="";const y=e.INSPECT_MAX_BYTES;return m=this.toString("hex",0,y).replace(/(.{2})/g,"$1 ").trim(),this.length>y&&(m+=" ... "),"<Buffer "+m+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(m,y,R,M,N){if(Gt(m,Uint8Array)&&(m=s.from(m,m.offset,m.byteLength)),!s.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(y===void 0&&(y=0),R===void 0&&(R=m?m.length:0),M===void 0&&(M=0),N===void 0&&(N=this.length),y<0||R>m.length||M<0||N>this.length)throw new RangeError("out of range index");if(M>=N&&y>=R)return 0;if(M>=N)return-1;if(y>=R)return 1;if(y>>>=0,R>>>=0,M>>>=0,N>>>=0,this===m)return 0;let q=N-M,ge=R-y;const Ze=Math.min(q,ge),$e=this.slice(M,N),nt=m.slice(y,R);for(let Re=0;Re<Ze;++Re)if($e[Re]!==nt[Re]){q=$e[Re],ge=nt[Re];break}return q<ge?-1:ge<q?1:0};function C(E,m,y,R,M){if(E.length===0)return-1;if(typeof y=="string"?(R=y,y=0):y>2147483647?y=2147483647:y<-2147483648&&(y=-2147483648),y=+y,fi(y)&&(y=M?0:E.length-1),y<0&&(y=E.length+y),y>=E.length){if(M)return-1;y=E.length-1}else if(y<0)if(M)y=0;else return-1;if(typeof m=="string"&&(m=s.from(m,R)),s.isBuffer(m))return m.length===0?-1:I(E,m,y,R,M);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?M?Uint8Array.prototype.indexOf.call(E,m,y):Uint8Array.prototype.lastIndexOf.call(E,m,y):I(E,[m],y,R,M);throw new TypeError("val must be string, number or Buffer")}function I(E,m,y,R,M){let N=1,q=E.length,ge=m.length;if(R!==void 0&&(R=String(R).toLowerCase(),R==="ucs2"||R==="ucs-2"||R==="utf16le"||R==="utf-16le")){if(E.length<2||m.length<2)return-1;N=2,q/=2,ge/=2,y/=2}function Ze(nt,Re){return N===1?nt[Re]:nt.readUInt16BE(Re*N)}let $e;if(M){let nt=-1;for($e=y;$e<q;$e++)if(Ze(E,$e)===Ze(m,nt===-1?0:$e-nt)){if(nt===-1&&(nt=$e),$e-nt+1===ge)return nt*N}else nt!==-1&&($e-=$e-nt),nt=-1}else for(y+ge>q&&(y=q-ge),$e=y;$e>=0;$e--){let nt=!0;for(let Re=0;Re<ge;Re++)if(Ze(E,$e+Re)!==Ze(m,Re)){nt=!1;break}if(nt)return $e}return-1}s.prototype.includes=function(m,y,R){return this.indexOf(m,y,R)!==-1},s.prototype.indexOf=function(m,y,R){return C(this,m,y,R,!0)},s.prototype.lastIndexOf=function(m,y,R){return C(this,m,y,R,!1)};function D(E,m,y,R){y=Number(y)||0;const M=E.length-y;R?(R=Number(R),R>M&&(R=M)):R=M;const N=m.length;R>N/2&&(R=N/2);let q;for(q=0;q<R;++q){const ge=parseInt(m.substr(q*2,2),16);if(fi(ge))return q;E[y+q]=ge}return q}function B(E,m,y,R){return da(pe(m,E.length-y),E,y,R)}function G(E,m,y,R){return da(un(m),E,y,R)}function z(E,m,y,R){return da(ha(m),E,y,R)}function ae(E,m,y,R){return da(fa(m,E.length-y),E,y,R)}s.prototype.write=function(m,y,R,M){if(y===void 0)M="utf8",R=this.length,y=0;else if(R===void 0&&typeof y=="string")M=y,R=this.length,y=0;else if(isFinite(y))y=y>>>0,isFinite(R)?(R=R>>>0,M===void 0&&(M="utf8")):(M=R,R=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const N=this.length-y;if((R===void 0||R>N)&&(R=N),m.length>0&&(R<0||y<0)||y>this.length)throw new RangeError("Attempt to write outside buffer bounds");M||(M="utf8");let q=!1;for(;;)switch(M){case"hex":return D(this,m,y,R);case"utf8":case"utf-8":return B(this,m,y,R);case"ascii":case"latin1":case"binary":return G(this,m,y,R);case"base64":return z(this,m,y,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,m,y,R);default:if(q)throw new TypeError("Unknown encoding: "+M);M=(""+M).toLowerCase(),q=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(E,m,y){return m===0&&y===E.length?t.fromByteArray(E):t.fromByteArray(E.slice(m,y))}function ve(E,m,y){y=Math.min(E.length,y);const R=[];let M=m;for(;M<y;){const N=E[M];let q=null,ge=N>239?4:N>223?3:N>191?2:1;if(M+ge<=y){let Ze,$e,nt,Re;switch(ge){case 1:N<128&&(q=N);break;case 2:Ze=E[M+1],(Ze&192)===128&&(Re=(N&31)<<6|Ze&63,Re>127&&(q=Re));break;case 3:Ze=E[M+1],$e=E[M+2],(Ze&192)===128&&($e&192)===128&&(Re=(N&15)<<12|(Ze&63)<<6|$e&63,Re>2047&&(Re<55296||Re>57343)&&(q=Re));break;case 4:Ze=E[M+1],$e=E[M+2],nt=E[M+3],(Ze&192)===128&&($e&192)===128&&(nt&192)===128&&(Re=(N&15)<<18|(Ze&63)<<12|($e&63)<<6|nt&63,Re>65535&&Re<1114112&&(q=Re))}}q===null?(q=65533,ge=1):q>65535&&(q-=65536,R.push(q>>>10&1023|55296),q=56320|q&1023),R.push(q),M+=ge}return st(R)}const Pe=4096;function st(E){const m=E.length;if(m<=Pe)return String.fromCharCode.apply(String,E);let y="",R=0;for(;R<m;)y+=String.fromCharCode.apply(String,E.slice(R,R+=Pe));return y}function Ne(E,m,y){let R="";y=Math.min(E.length,y);for(let M=m;M<y;++M)R+=String.fromCharCode(E[M]&127);return R}function lt(E,m,y){let R="";y=Math.min(E.length,y);for(let M=m;M<y;++M)R+=String.fromCharCode(E[M]);return R}function tt(E,m,y){const R=E.length;(!m||m<0)&&(m=0),(!y||y<0||y>R)&&(y=R);let M="";for(let N=m;N<y;++N)M+=pa[E[N]];return M}function ut(E,m,y){const R=E.slice(m,y);let M="";for(let N=0;N<R.length-1;N+=2)M+=String.fromCharCode(R[N]+R[N+1]*256);return M}s.prototype.slice=function(m,y){const R=this.length;m=~~m,y=y===void 0?R:~~y,m<0?(m+=R,m<0&&(m=0)):m>R&&(m=R),y<0?(y+=R,y<0&&(y=0)):y>R&&(y=R),y<m&&(y=m);const M=this.subarray(m,y);return Object.setPrototypeOf(M,s.prototype),M};function Te(E,m,y){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+m>y)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(m,y,R){m=m>>>0,y=y>>>0,R||Te(m,y,this.length);let M=this[m],N=1,q=0;for(;++q<y&&(N*=256);)M+=this[m+q]*N;return M},s.prototype.readUintBE=s.prototype.readUIntBE=function(m,y,R){m=m>>>0,y=y>>>0,R||Te(m,y,this.length);let M=this[m+--y],N=1;for(;y>0&&(N*=256);)M+=this[m+--y]*N;return M},s.prototype.readUint8=s.prototype.readUInt8=function(m,y){return m=m>>>0,y||Te(m,1,this.length),this[m]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(m,y){return m=m>>>0,y||Te(m,2,this.length),this[m]|this[m+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(m,y){return m=m>>>0,y||Te(m,2,this.length),this[m]<<8|this[m+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},s.prototype.readBigUInt64LE=fn(function(m){m=m>>>0,V(m,"offset");const y=this[m],R=this[m+7];(y===void 0||R===void 0)&&Y(m,this.length-8);const M=y+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24,N=this[++m]+this[++m]*2**8+this[++m]*2**16+R*2**24;return BigInt(M)+(BigInt(N)<<BigInt(32))}),s.prototype.readBigUInt64BE=fn(function(m){m=m>>>0,V(m,"offset");const y=this[m],R=this[m+7];(y===void 0||R===void 0)&&Y(m,this.length-8);const M=y*2**24+this[++m]*2**16+this[++m]*2**8+this[++m],N=this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+R;return(BigInt(M)<<BigInt(32))+BigInt(N)}),s.prototype.readIntLE=function(m,y,R){m=m>>>0,y=y>>>0,R||Te(m,y,this.length);let M=this[m],N=1,q=0;for(;++q<y&&(N*=256);)M+=this[m+q]*N;return N*=128,M>=N&&(M-=Math.pow(2,8*y)),M},s.prototype.readIntBE=function(m,y,R){m=m>>>0,y=y>>>0,R||Te(m,y,this.length);let M=y,N=1,q=this[m+--M];for(;M>0&&(N*=256);)q+=this[m+--M]*N;return N*=128,q>=N&&(q-=Math.pow(2,8*y)),q},s.prototype.readInt8=function(m,y){return m=m>>>0,y||Te(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},s.prototype.readInt16LE=function(m,y){m=m>>>0,y||Te(m,2,this.length);const R=this[m]|this[m+1]<<8;return R&32768?R|4294901760:R},s.prototype.readInt16BE=function(m,y){m=m>>>0,y||Te(m,2,this.length);const R=this[m+1]|this[m]<<8;return R&32768?R|4294901760:R},s.prototype.readInt32LE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},s.prototype.readInt32BE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},s.prototype.readBigInt64LE=fn(function(m){m=m>>>0,V(m,"offset");const y=this[m],R=this[m+7];(y===void 0||R===void 0)&&Y(m,this.length-8);const M=this[m+4]+this[m+5]*2**8+this[m+6]*2**16+(R<<24);return(BigInt(M)<<BigInt(32))+BigInt(y+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24)}),s.prototype.readBigInt64BE=fn(function(m){m=m>>>0,V(m,"offset");const y=this[m],R=this[m+7];(y===void 0||R===void 0)&&Y(m,this.length-8);const M=(y<<24)+this[++m]*2**16+this[++m]*2**8+this[++m];return(BigInt(M)<<BigInt(32))+BigInt(this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+R)}),s.prototype.readFloatLE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),n.read(this,m,!0,23,4)},s.prototype.readFloatBE=function(m,y){return m=m>>>0,y||Te(m,4,this.length),n.read(this,m,!1,23,4)},s.prototype.readDoubleLE=function(m,y){return m=m>>>0,y||Te(m,8,this.length),n.read(this,m,!0,52,8)},s.prototype.readDoubleBE=function(m,y){return m=m>>>0,y||Te(m,8,this.length),n.read(this,m,!1,52,8)};function Ie(E,m,y,R,M,N){if(!s.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>M||m<N)throw new RangeError('"value" argument is out of bounds');if(y+R>E.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(m,y,R,M){if(m=+m,y=y>>>0,R=R>>>0,!M){const ge=Math.pow(2,8*R)-1;Ie(this,m,y,R,ge,0)}let N=1,q=0;for(this[y]=m&255;++q<R&&(N*=256);)this[y+q]=m/N&255;return y+R},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(m,y,R,M){if(m=+m,y=y>>>0,R=R>>>0,!M){const ge=Math.pow(2,8*R)-1;Ie(this,m,y,R,ge,0)}let N=R-1,q=1;for(this[y+N]=m&255;--N>=0&&(q*=256);)this[y+N]=m/q&255;return y+R},s.prototype.writeUint8=s.prototype.writeUInt8=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,1,255,0),this[y]=m&255,y+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,2,65535,0),this[y]=m&255,this[y+1]=m>>>8,y+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,2,65535,0),this[y]=m>>>8,this[y+1]=m&255,y+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,4,4294967295,0),this[y+3]=m>>>24,this[y+2]=m>>>16,this[y+1]=m>>>8,this[y]=m&255,y+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,4,4294967295,0),this[y]=m>>>24,this[y+1]=m>>>16,this[y+2]=m>>>8,this[y+3]=m&255,y+4};function Rt(E,m,y,R,M){S(m,R,M,E,y,7);let N=Number(m&BigInt(4294967295));E[y++]=N,N=N>>8,E[y++]=N,N=N>>8,E[y++]=N,N=N>>8,E[y++]=N;let q=Number(m>>BigInt(32)&BigInt(4294967295));return E[y++]=q,q=q>>8,E[y++]=q,q=q>>8,E[y++]=q,q=q>>8,E[y++]=q,y}function ln(E,m,y,R,M){S(m,R,M,E,y,7);let N=Number(m&BigInt(4294967295));E[y+7]=N,N=N>>8,E[y+6]=N,N=N>>8,E[y+5]=N,N=N>>8,E[y+4]=N;let q=Number(m>>BigInt(32)&BigInt(4294967295));return E[y+3]=q,q=q>>8,E[y+2]=q,q=q>>8,E[y+1]=q,q=q>>8,E[y]=q,y+8}s.prototype.writeBigUInt64LE=fn(function(m,y=0){return Rt(this,m,y,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=fn(function(m,y=0){return ln(this,m,y,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(m,y,R,M){if(m=+m,y=y>>>0,!M){const Ze=Math.pow(2,8*R-1);Ie(this,m,y,R,Ze-1,-Ze)}let N=0,q=1,ge=0;for(this[y]=m&255;++N<R&&(q*=256);)m<0&&ge===0&&this[y+N-1]!==0&&(ge=1),this[y+N]=(m/q>>0)-ge&255;return y+R},s.prototype.writeIntBE=function(m,y,R,M){if(m=+m,y=y>>>0,!M){const Ze=Math.pow(2,8*R-1);Ie(this,m,y,R,Ze-1,-Ze)}let N=R-1,q=1,ge=0;for(this[y+N]=m&255;--N>=0&&(q*=256);)m<0&&ge===0&&this[y+N+1]!==0&&(ge=1),this[y+N]=(m/q>>0)-ge&255;return y+R},s.prototype.writeInt8=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,1,127,-128),m<0&&(m=255+m+1),this[y]=m&255,y+1},s.prototype.writeInt16LE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,2,32767,-32768),this[y]=m&255,this[y+1]=m>>>8,y+2},s.prototype.writeInt16BE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,2,32767,-32768),this[y]=m>>>8,this[y+1]=m&255,y+2},s.prototype.writeInt32LE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,4,2147483647,-2147483648),this[y]=m&255,this[y+1]=m>>>8,this[y+2]=m>>>16,this[y+3]=m>>>24,y+4},s.prototype.writeInt32BE=function(m,y,R){return m=+m,y=y>>>0,R||Ie(this,m,y,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[y]=m>>>24,this[y+1]=m>>>16,this[y+2]=m>>>8,this[y+3]=m&255,y+4},s.prototype.writeBigInt64LE=fn(function(m,y=0){return Rt(this,m,y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=fn(function(m,y=0){return ln(this,m,y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ve(E,m,y,R,M,N){if(y+R>E.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("Index out of range")}function L(E,m,y,R,M){return m=+m,y=y>>>0,M||Ve(E,m,y,4),n.write(E,m,y,R,23,4),y+4}s.prototype.writeFloatLE=function(m,y,R){return L(this,m,y,!0,R)},s.prototype.writeFloatBE=function(m,y,R){return L(this,m,y,!1,R)};function O(E,m,y,R,M){return m=+m,y=y>>>0,M||Ve(E,m,y,8),n.write(E,m,y,R,52,8),y+8}s.prototype.writeDoubleLE=function(m,y,R){return O(this,m,y,!0,R)},s.prototype.writeDoubleBE=function(m,y,R){return O(this,m,y,!1,R)},s.prototype.copy=function(m,y,R,M){if(!s.isBuffer(m))throw new TypeError("argument should be a Buffer");if(R||(R=0),!M&&M!==0&&(M=this.length),y>=m.length&&(y=m.length),y||(y=0),M>0&&M<R&&(M=R),M===R||m.length===0||this.length===0)return 0;if(y<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("sourceEnd out of bounds");M>this.length&&(M=this.length),m.length-y<M-R&&(M=m.length-y+R);const N=M-R;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(y,R,M):Uint8Array.prototype.set.call(m,this.subarray(R,M),y),N},s.prototype.fill=function(m,y,R,M){if(typeof m=="string"){if(typeof y=="string"?(M=y,y=0,R=this.length):typeof R=="string"&&(M=R,R=this.length),M!==void 0&&typeof M!="string")throw new TypeError("encoding must be a string");if(typeof M=="string"&&!s.isEncoding(M))throw new TypeError("Unknown encoding: "+M);if(m.length===1){const q=m.charCodeAt(0);(M==="utf8"&&q<128||M==="latin1")&&(m=q)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(y<0||this.length<y||this.length<R)throw new RangeError("Out of range index");if(R<=y)return this;y=y>>>0,R=R===void 0?this.length:R>>>0,m||(m=0);let N;if(typeof m=="number")for(N=y;N<R;++N)this[N]=m;else{const q=s.isBuffer(m)?m:s.from(m,M),ge=q.length;if(ge===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(N=0;N<R-y;++N)this[N+y]=q[N%ge]}return this};const W={};function j(E,m,y){W[E]=class extends y{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(M){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:M,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}j("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(E,m){return`The "${E}" argument must be of type number. Received type ${typeof m}`},TypeError),j("ERR_OUT_OF_RANGE",function(E,m,y){let R=`The value of "${E}" is out of range.`,M=y;return Number.isInteger(y)&&Math.abs(y)>2**32?M=Q(String(y)):typeof y=="bigint"&&(M=String(y),(y>BigInt(2)**BigInt(32)||y<-(BigInt(2)**BigInt(32)))&&(M=Q(M)),M+="n"),R+=` It must be ${m}. Received ${M}`,R},RangeError);function Q(E){let m="",y=E.length;const R=E[0]==="-"?1:0;for(;y>=R+4;y-=3)m=`_${E.slice(y-3,y)}${m}`;return`${E.slice(0,y)}${m}`}function T(E,m,y){V(m,"offset"),(E[m]===void 0||E[m+y]===void 0)&&Y(m,E.length-(y+1))}function S(E,m,y,R,M,N){if(E>y||E<m){const q=typeof m=="bigint"?"n":"";let ge;throw N>3?m===0||m===BigInt(0)?ge=`>= 0${q} and < 2${q} ** ${(N+1)*8}${q}`:ge=`>= -(2${q} ** ${(N+1)*8-1}${q}) and < 2 ** ${(N+1)*8-1}${q}`:ge=`>= ${m}${q} and <= ${y}${q}`,new W.ERR_OUT_OF_RANGE("value",ge,E)}T(R,M,N)}function V(E,m){if(typeof E!="number")throw new W.ERR_INVALID_ARG_TYPE(m,"number",E)}function Y(E,m,y){throw Math.floor(E)!==E?(V(E,y),new W.ERR_OUT_OF_RANGE(y||"offset","an integer",E)):m<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE(y||"offset",`>= ${y?1:0} and <= ${m}`,E)}const de=/[^+/0-9A-Za-z-_]/g;function ie(E){if(E=E.split("=")[0],E=E.trim().replace(de,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function pe(E,m){m=m||1/0;let y;const R=E.length;let M=null;const N=[];for(let q=0;q<R;++q){if(y=E.charCodeAt(q),y>55295&&y<57344){if(!M){if(y>56319){(m-=3)>-1&&N.push(239,191,189);continue}else if(q+1===R){(m-=3)>-1&&N.push(239,191,189);continue}M=y;continue}if(y<56320){(m-=3)>-1&&N.push(239,191,189),M=y;continue}y=(M-55296<<10|y-56320)+65536}else M&&(m-=3)>-1&&N.push(239,191,189);if(M=null,y<128){if((m-=1)<0)break;N.push(y)}else if(y<2048){if((m-=2)<0)break;N.push(y>>6|192,y&63|128)}else if(y<65536){if((m-=3)<0)break;N.push(y>>12|224,y>>6&63|128,y&63|128)}else if(y<1114112){if((m-=4)<0)break;N.push(y>>18|240,y>>12&63|128,y>>6&63|128,y&63|128)}else throw new Error("Invalid code point")}return N}function un(E){const m=[];for(let y=0;y<E.length;++y)m.push(E.charCodeAt(y)&255);return m}function fa(E,m){let y,R,M;const N=[];for(let q=0;q<E.length&&!((m-=2)<0);++q)y=E.charCodeAt(q),R=y>>8,M=y%256,N.push(M),N.push(R);return N}function ha(E){return t.toByteArray(ie(E))}function da(E,m,y,R){let M;for(M=0;M<R&&!(M+y>=m.length||M>=E.length);++M)m[M+y]=E[M];return M}function Gt(E,m){return E instanceof m||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===m.name}function fi(E){return E!==E}const pa=function(){const E="0123456789abcdef",m=new Array(256);for(let y=0;y<16;++y){const R=y*16;for(let M=0;M<16;++M)m[R+M]=E[y]+E[M]}return m}();function fn(E){return typeof BigInt>"u"?Dr:E}function Dr(){throw new Error("BigInt not supported")}})(we);const l6=_e({__proto__:null,default:uu(we)},[we]),kt={},Iq=Object.freeze(Object.defineProperty({__proto__:null,default:kt},Symbol.toStringTag,{value:"Module"})),Pb=typeof window<"u"?window:typeof self<"u"?self:{fetch:void 0};class po{async getBufferFromResponse(t){if(typeof t.buffer=="function")return t.buffer();if(typeof t.arrayBuffer=="function"){const n=await t.arrayBuffer();return we.Buffer.from(n)}else throw new TypeError("invalid HTTP response object, has no buffer method, and no arrayBuffer method")}constructor(t,n={}){this.baseOverrides={},this.url=t;const r=n.fetch||Pb.fetch&&Pb.fetch.bind(Pb);if(!r)throw new TypeError("no fetch function supplied, and none found in global environment");n.overrides&&(this.baseOverrides=n.overrides),this.fetchImplementation=r}async fetch(t,n){let r;try{r=await this.fetchImplementation(t,n)}catch(i){if(`${i}`.includes("Failed to fetch"))console.warn(`generic-filehandle: refetching ${t} to attempt to work around chrome CORS header caching bug`),r=await this.fetchImplementation(t,{...n,cache:"reload"});else throw i}return r}async read(t,n=0,r,i=0,a={}){const{headers:o={},signal:s,overrides:c={}}=a;r<1/0?o.range=`bytes=${i}-${i+r}`:r===1/0&&i!==0&&(o.range=`bytes=${i}-`);const l={...this.baseOverrides,...c,headers:{...o,...c.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:s},u=await this.fetch(this.url,l);if(!u.ok)throw new Error(`HTTP ${u.status} ${u.statusText} ${this.url}`);if(u.status===200&&i===0||u.status===206){const f=await this.getBufferFromResponse(u),h=f.copy(t,n,0,Math.min(r,f.length)),d=u.headers.get("content-range"),p=/\/(\d+)$/.exec(d||"");return p&&p[1]&&(this._stat={size:parseInt(p[1],10)}),{bytesRead:h,buffer:t}}throw u.status===200?new Error("${this.url} fetch returned status 200, expected 206"):new Error(`HTTP ${u.status} fetching ${this.url}`)}async readFile(t={}){let n,r;typeof t=="string"?(n=t,r={}):(n=t.encoding,r=t,delete r.encoding);const{headers:i={},signal:a,overrides:o={}}=r,s={headers:i,method:"GET",redirect:"follow",mode:"cors",signal:a,...this.baseOverrides,...o},c=await this.fetch(this.url,s);if(!c)throw new Error("generic-filehandle failed to fetch");if(c.status!==200)throw Object.assign(new Error(`HTTP ${c.status} fetching ${this.url}`),{status:c.status});if(n==="utf8")return c.text();if(n)throw new Error(`unsupported encoding: ${n}`);return this.getBufferFromResponse(c)}async stat(){if(!this._stat){const t=we.Buffer.allocUnsafe(10);if(await this.read(t,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}}function u6(e){const t=new FileReader;return new Promise((n,r)=>{t.onerror=()=>{t.abort(),r(new Error("problem reading blob"))},t.onabort=()=>{r(new Error("blob reading was aborted"))},t.onload=()=>{t.result&&typeof t.result!="string"?n(t.result):r(new Error("unknown error reading blob"))},t.readAsArrayBuffer(e)})}function Rq(e){const t=new FileReader;return new Promise((n,r)=>{t.onerror=()=>{t.abort(),r(new Error("problem reading blob"))},t.onabort=()=>{r(new Error("blob reading was aborted"))},t.onload=()=>{t.result&&typeof t.result=="string"?n(t.result):r(new Error("unknown error reading blob"))},t.readAsText(e)})}class Dq{constructor(t){this.blob=t,this.size=t.size}async read(t,n=0,r,i=0){if(!r)return{bytesRead:0,buffer:t};const a=i,o=a+r,s=await u6(this.blob.slice(a,o)),c=we.Buffer.from(s);return{bytesRead:c.copy(t,n),buffer:c}}async readFile(t){let n;if(typeof t=="string"?n=t:n=t&&t.encoding,n==="utf8")return Rq(this.blob);if(n)throw new Error(`unsupported encoding: ${n}`);const r=await u6(this.blob);return we.Buffer.from(r)}async stat(){return{size:this.size}}async close(){}}function f6(e,t={}){return new po(e,t)}function Bq(e,t,n,r={}){if(n!==void 0)return n;if(e!==void 0)return f6(e,r);if(t!==void 0)return new kt(t,r);throw new Error("no url, path, or filehandle provided, cannot open")}const hu=Object.freeze(Object.defineProperty({__proto__:null,BlobFile:Dq,LocalFile:kt,RemoteFile:po,fromUrl:f6,open:Bq},Symbol.toStringTag,{value:"Module"}));var Kr={};(function(e){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function n(a,o){return Object.prototype.hasOwnProperty.call(a,o)}e.assign=function(a){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var s=o.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var c in s)n(s,c)&&(a[c]=s[c])}}return a},e.shrinkBuf=function(a,o){return a.length===o?a:a.subarray?a.subarray(0,o):(a.length=o,a)};var r={arraySet:function(a,o,s,c,l){if(o.subarray&&a.subarray){a.set(o.subarray(s,s+c),l);return}for(var u=0;u<c;u++)a[l+u]=o[s+u]},flattenChunks:function(a){var o,s,c,l,u,f;for(c=0,o=0,s=a.length;o<s;o++)c+=a[o].length;for(f=new Uint8Array(c),l=0,o=0,s=a.length;o<s;o++)u=a[o],f.set(u,l),l+=u.length;return f}},i={arraySet:function(a,o,s,c,l){for(var u=0;u<c;u++)a[l+u]=o[s+u]},flattenChunks:function(a){return[].concat.apply([],a)}};e.setTyped=function(a){a?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})(Kr);var du={},xr={},Rs={},Fq=Kr,Pq=4,h6=0,d6=1,Mq=2;function Ds(e){for(var t=e.length;--t>=0;)e[t]=0}var Oq=0,p6=1,Lq=2,Nq=3,zq=258,Mb=29,pu=256,gu=pu+1+Mb,Bs=30,Ob=19,g6=2*gu+1,go=15,Lb=16,Uq=7,Nb=256,m6=16,b6=17,y6=18,zb=[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],Yd=[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],$q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],v6=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Hq=512,Jr=new Array((gu+2)*2);Ds(Jr);var mu=new Array(Bs*2);Ds(mu);var bu=new Array(Hq);Ds(bu);var yu=new Array(zq-Nq+1);Ds(yu);var Ub=new Array(Mb);Ds(Ub);var Zd=new Array(Bs);Ds(Zd);function $b(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var w6,x6,A6;function Hb(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function E6(e){return e<256?bu[e]:bu[256+(e>>>7)]}function vu(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function an(e,t,n){e.bi_valid>Lb-n?(e.bi_buf|=t<<e.bi_valid&65535,vu(e,e.bi_buf),e.bi_buf=t>>Lb-e.bi_valid,e.bi_valid+=n-Lb):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function Ar(e,t,n){an(e,n[t*2],n[t*2+1])}function S6(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function Gq(e){e.bi_valid===16?(vu(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Vq(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,f,h,d,p,g=0;for(h=0;h<=go;h++)e.bl_count[h]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<g6;l++)u=e.heap[l],h=n[n[u*2+1]*2+1]+1,h>c&&(h=c,g++),n[u*2+1]=h,!(u>r)&&(e.bl_count[h]++,d=0,u>=s&&(d=o[u-s]),p=n[u*2],e.opt_len+=p*(h+d),a&&(e.static_len+=p*(i[u*2+1]+d)));if(g!==0){do{for(h=c-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(h=c;h!==0;h--)for(u=e.bl_count[h];u!==0;)f=e.heap[--l],!(f>r)&&(n[f*2+1]!==h&&(e.opt_len+=(h-n[f*2+1])*n[f*2],n[f*2+1]=h),u--)}}function _6(e,t,n){var r=new Array(go+1),i=0,a,o;for(a=1;a<=go;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=S6(r[s]++,s))}}function jq(){var e,t,n,r,i,a=new Array(go+1);for(n=0,r=0;r<Mb-1;r++)for(Ub[r]=n,e=0;e<1<<zb[r];e++)yu[n++]=r;for(yu[n-1]=r,i=0,r=0;r<16;r++)for(Zd[r]=i,e=0;e<1<<Yd[r];e++)bu[i++]=r;for(i>>=7;r<Bs;r++)for(Zd[r]=i<<7,e=0;e<1<<Yd[r]-7;e++)bu[256+i++]=r;for(t=0;t<=go;t++)a[t]=0;for(e=0;e<=143;)Jr[e*2+1]=8,e++,a[8]++;for(;e<=255;)Jr[e*2+1]=9,e++,a[9]++;for(;e<=279;)Jr[e*2+1]=7,e++,a[7]++;for(;e<=287;)Jr[e*2+1]=8,e++,a[8]++;for(_6(Jr,gu+1,a),e=0;e<Bs;e++)mu[e*2+1]=5,mu[e*2]=S6(e,5);w6=new $b(Jr,zb,pu+1,gu,go),x6=new $b(mu,Yd,0,Bs,go),A6=new $b(new Array(0),$q,0,Ob,Uq)}function C6(e){var t;for(t=0;t<gu;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Bs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Ob;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Nb*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function k6(e){e.bi_valid>8?vu(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function qq(e,t,n,r){k6(e),r&&(vu(e,n),vu(e,~n)),Fq.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function T6(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function Gb(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&T6(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!T6(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function I6(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?Ar(e,i,t):(o=yu[i],Ar(e,o+pu+1,t),s=zb[o],s!==0&&(i-=Ub[o],an(e,i,s)),r--,o=E6(r),Ar(e,o,n),s=Yd[o],s!==0&&(r-=Zd[o],an(e,r,s)));while(a<e.last_lit);Ar(e,Nb,t)}function Vb(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=g6,o=0;o<a;o++)n[o*2]!==0?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):n[o*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Gb(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Gb(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,Gb(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Vq(e,t),_6(n,c,e.bl_count)}function R6(e,t,n){var r,i=-1,a,o=t[0*2+1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[m6*2]++):s<=10?e.bl_tree[b6*2]++:e.bl_tree[y6*2]++,s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function D6(e,t,n){var r,i=-1,a,o=t[0*2+1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do Ar(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Ar(e,a,e.bl_tree),s--),Ar(e,m6,e.bl_tree),an(e,s-3,2)):s<=10?(Ar(e,b6,e.bl_tree),an(e,s-3,3)):(Ar(e,y6,e.bl_tree),an(e,s-11,7));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function Wq(e){var t;for(R6(e,e.dyn_ltree,e.l_desc.max_code),R6(e,e.dyn_dtree,e.d_desc.max_code),Vb(e,e.bl_desc),t=Ob-1;t>=3&&e.bl_tree[v6[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Yq(e,t,n,r){var i;for(an(e,t-257,5),an(e,n-1,5),an(e,r-4,4),i=0;i<r;i++)an(e,e.bl_tree[v6[i]*2+1],3);D6(e,e.dyn_ltree,t-1),D6(e,e.dyn_dtree,n-1)}function Zq(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return h6;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return d6;for(n=32;n<pu;n++)if(e.dyn_ltree[n*2]!==0)return d6;return h6}var B6=!1;function Qq(e){B6||(jq(),B6=!0),e.l_desc=new Hb(e.dyn_ltree,w6),e.d_desc=new Hb(e.dyn_dtree,x6),e.bl_desc=new Hb(e.bl_tree,A6),e.bi_buf=0,e.bi_valid=0,C6(e)}function F6(e,t,n,r){an(e,(Oq<<1)+(r?1:0),3),qq(e,t,n,!0)}function Xq(e){an(e,p6<<1,3),Ar(e,Nb,Jr),Gq(e)}function Kq(e,t,n,r){var i,a,o=0;e.level>0?(e.strm.data_type===Mq&&(e.strm.data_type=Zq(e)),Vb(e,e.l_desc),Vb(e,e.d_desc),o=Wq(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?F6(e,t,n,r):e.strategy===Pq||a===i?(an(e,(p6<<1)+(r?1:0),3),I6(e,Jr,mu)):(an(e,(Lq<<1)+(r?1:0),3),Yq(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),I6(e,e.dyn_ltree,e.dyn_dtree)),C6(e),r&&k6(e)}function Jq(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(yu[n]+pu+1)*2]++,e.dyn_dtree[E6(t)*2]++),e.last_lit===e.lit_bufsize-1}Rs._tr_init=Qq,Rs._tr_stored_block=F6,Rs._tr_flush_block=Kq,Rs._tr_tally=Jq,Rs._tr_align=Xq;function eW(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}var P6=eW;function tW(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var nW=tW();function rW(e,t,n,r){var i=nW,a=r+n;e^=-1;for(var o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}var M6=rW,jb={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"},Wt=Kr,Cn=Rs,O6=P6,Wi=M6,iW=jb,mo=0,aW=1,oW=3,Yi=4,L6=5,Er=0,N6=1,kn=-2,sW=-3,qb=-5,cW=-1,lW=1,Qd=2,uW=3,fW=4,hW=0,dW=2,Xd=8,pW=9,gW=15,mW=8,bW=29,yW=256,Wb=yW+1+bW,vW=30,wW=19,xW=2*Wb+1,AW=15,be=3,Zi=258,Kn=Zi+be+1,EW=32,Kd=42,Yb=69,Jd=73,e0=91,t0=103,bo=113,wu=666,yt=1,xu=2,yo=3,Fs=4,SW=3;function Qi(e,t){return e.msg=iW[t],t}function z6(e){return(e<<1)-(e>4?9:0)}function Xi(e){for(var t=e.length;--t>=0;)e[t]=0}function Ki(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(Wt.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function Pt(e,t){Cn._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ki(e.strm)}function Se(e,t){e.pending_buf[e.pending++]=t}function Au(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function _W(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,Wt.arraySet(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=O6(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Wi(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function U6(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-Kn?e.strstart-(e.w_size-Kn):0,l=e.window,u=e.w_mask,f=e.prev,h=e.strstart+Zi,d=l[r+o-1],p=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(l[i+o]!==p||l[i+o-1]!==d||l[i]!==l[r]||l[++i]!==l[r+1])){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<h);if(a=Zi-(h-r),r=h-Zi,a>o){if(e.match_start=t,o=a,a>=s)break;d=l[r+o-1],p=l[r+o]}}while((t=f[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function vo(e){var t=e.w_size,n,r,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Kn)){Wt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=_W(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=be)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+be-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<be)););}while(e.lookahead<Kn&&e.strm.avail_in!==0)}function CW(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(vo(e),e.lookahead===0&&t===mo)return yt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Pt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Kn&&(Pt(e,!1),e.strm.avail_out===0))return yt}return e.insert=0,t===Yi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):(e.strstart>e.block_start&&(Pt(e,!1),e.strm.avail_out===0),yt)}function Zb(e,t){for(var n,r;;){if(e.lookahead<Kn){if(vo(e),e.lookahead<Kn&&t===mo)return yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=be&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+be-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Kn&&(e.match_length=U6(e,n)),e.match_length>=be)if(r=Cn._tr_tally(e,e.strstart-e.match_start,e.match_length-be),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=be){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+be-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=Cn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Pt(e,!1),e.strm.avail_out===0))return yt}return e.insert=e.strstart<be-1?e.strstart:be-1,t===Yi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):e.last_lit&&(Pt(e,!1),e.strm.avail_out===0)?yt:xu}function Ps(e,t){for(var n,r,i;;){if(e.lookahead<Kn){if(vo(e),e.lookahead<Kn&&t===mo)return yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=be&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+be-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=be-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Kn&&(e.match_length=U6(e,n),e.match_length<=5&&(e.strategy===lW||e.match_length===be&&e.strstart-e.match_start>4096)&&(e.match_length=be-1)),e.prev_length>=be&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-be,r=Cn._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-be),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+be-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=be-1,e.strstart++,r&&(Pt(e,!1),e.strm.avail_out===0))return yt}else if(e.match_available){if(r=Cn._tr_tally(e,0,e.window[e.strstart-1]),r&&Pt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return yt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Cn._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<be-1?e.strstart:be-1,t===Yi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):e.last_lit&&(Pt(e,!1),e.strm.avail_out===0)?yt:xu}function kW(e,t){for(var n,r,i,a,o=e.window;;){if(e.lookahead<=Zi){if(vo(e),e.lookahead<=Zi&&t===mo)return yt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=be&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+Zi;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=Zi-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=be?(n=Cn._tr_tally(e,1,e.match_length-be),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Cn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Pt(e,!1),e.strm.avail_out===0))return yt}return e.insert=0,t===Yi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):e.last_lit&&(Pt(e,!1),e.strm.avail_out===0)?yt:xu}function TW(e,t){for(var n;;){if(e.lookahead===0&&(vo(e),e.lookahead===0)){if(t===mo)return yt;break}if(e.match_length=0,n=Cn._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Pt(e,!1),e.strm.avail_out===0))return yt}return e.insert=0,t===Yi?(Pt(e,!0),e.strm.avail_out===0?yo:Fs):e.last_lit&&(Pt(e,!1),e.strm.avail_out===0)?yt:xu}function Sr(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var Ms;Ms=[new Sr(0,0,0,0,CW),new Sr(4,4,8,4,Zb),new Sr(4,5,16,8,Zb),new Sr(4,6,32,32,Zb),new Sr(4,4,16,16,Ps),new Sr(8,16,32,32,Ps),new Sr(8,16,128,128,Ps),new Sr(8,32,128,256,Ps),new Sr(32,128,258,1024,Ps),new Sr(32,258,258,4096,Ps)];function IW(e){e.window_size=2*e.w_size,Xi(e.head),e.max_lazy_match=Ms[e.level].max_lazy,e.good_match=Ms[e.level].good_length,e.nice_match=Ms[e.level].nice_length,e.max_chain_length=Ms[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=be-1,e.match_available=0,e.ins_h=0}function RW(){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=Xd,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 Wt.Buf16(xW*2),this.dyn_dtree=new Wt.Buf16((2*vW+1)*2),this.bl_tree=new Wt.Buf16((2*wW+1)*2),Xi(this.dyn_ltree),Xi(this.dyn_dtree),Xi(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Wt.Buf16(AW+1),this.heap=new Wt.Buf16(2*Wb+1),Xi(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Wt.Buf16(2*Wb+1),Xi(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 $6(e){var t;return!e||!e.state?Qi(e,kn):(e.total_in=e.total_out=0,e.data_type=dW,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Kd:bo,e.adler=t.wrap===2?0:1,t.last_flush=mo,Cn._tr_init(t),Er)}function H6(e){var t=$6(e);return t===Er&&IW(e.state),t}function DW(e,t){return!e||!e.state||e.state.wrap!==2?kn:(e.state.gzhead=t,Er)}function G6(e,t,n,r,i,a){if(!e)return kn;var o=1;if(t===cW&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>pW||n!==Xd||r<8||r>15||t<0||t>9||a<0||a>fW)return Qi(e,kn);r===8&&(r=9);var s=new RW;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+be-1)/be),s.window=new Wt.Buf8(s.w_size*2),s.head=new Wt.Buf16(s.hash_size),s.prev=new Wt.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Wt.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=a,s.method=n,H6(e)}function BW(e,t){return G6(e,t,Xd,gW,mW,hW)}function FW(e,t){var n,r,i,a;if(!e||!e.state||t>L6||t<0)return e?Qi(e,kn):kn;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===wu&&t!==Yi)return Qi(e,e.avail_out===0?qb:kn);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===Kd)if(r.wrap===2)e.adler=0,Se(r,31),Se(r,139),Se(r,8),r.gzhead?(Se(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Se(r,r.gzhead.time&255),Se(r,r.gzhead.time>>8&255),Se(r,r.gzhead.time>>16&255),Se(r,r.gzhead.time>>24&255),Se(r,r.level===9?2:r.strategy>=Qd||r.level<2?4:0),Se(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Se(r,r.gzhead.extra.length&255),Se(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Wi(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Yb):(Se(r,0),Se(r,0),Se(r,0),Se(r,0),Se(r,0),Se(r,r.level===9?2:r.strategy>=Qd||r.level<2?4:0),Se(r,SW),r.status=bo);else{var o=Xd+(r.w_bits-8<<4)<<8,s=-1;r.strategy>=Qd||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,o|=s<<6,r.strstart!==0&&(o|=EW),o+=31-o%31,r.status=bo,Au(r,o),r.strstart!==0&&(Au(r,e.adler>>>16),Au(r,e.adler&65535)),e.adler=1}if(r.status===Yb)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Wi(e.adler,r.pending_buf,r.pending-i,i)),Ki(e),i=r.pending,r.pending===r.pending_buf_size));)Se(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=Wi(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Jd)}else r.status=Jd;if(r.status===Jd)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Wi(e.adler,r.pending_buf,r.pending-i,i)),Ki(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}r.gzindex<r.gzhead.name.length?a=r.gzhead.name.charCodeAt(r.gzindex++)&255:a=0,Se(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Wi(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.gzindex=0,r.status=e0)}else r.status=e0;if(r.status===e0)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Wi(e.adler,r.pending_buf,r.pending-i,i)),Ki(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}r.gzindex<r.gzhead.comment.length?a=r.gzhead.comment.charCodeAt(r.gzindex++)&255:a=0,Se(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Wi(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.status=t0)}else r.status=t0;if(r.status===t0&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Ki(e),r.pending+2<=r.pending_buf_size&&(Se(r,e.adler&255),Se(r,e.adler>>8&255),e.adler=0,r.status=bo)):r.status=bo),r.pending!==0){if(Ki(e),e.avail_out===0)return r.last_flush=-1,Er}else if(e.avail_in===0&&z6(t)<=z6(n)&&t!==Yi)return Qi(e,qb);if(r.status===wu&&e.avail_in!==0)return Qi(e,qb);if(e.avail_in!==0||r.lookahead!==0||t!==mo&&r.status!==wu){var c=r.strategy===Qd?TW(r,t):r.strategy===uW?kW(r,t):Ms[r.level].func(r,t);if((c===yo||c===Fs)&&(r.status=wu),c===yt||c===yo)return e.avail_out===0&&(r.last_flush=-1),Er;if(c===xu&&(t===aW?Cn._tr_align(r):t!==L6&&(Cn._tr_stored_block(r,0,0,!1),t===oW&&(Xi(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Ki(e),e.avail_out===0))return r.last_flush=-1,Er}return t!==Yi?Er:r.wrap<=0?N6:(r.wrap===2?(Se(r,e.adler&255),Se(r,e.adler>>8&255),Se(r,e.adler>>16&255),Se(r,e.adler>>24&255),Se(r,e.total_in&255),Se(r,e.total_in>>8&255),Se(r,e.total_in>>16&255),Se(r,e.total_in>>24&255)):(Au(r,e.adler>>>16),Au(r,e.adler&65535)),Ki(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Er:N6)}function PW(e){var t;return!e||!e.state?kn:(t=e.state.status,t!==Kd&&t!==Yb&&t!==Jd&&t!==e0&&t!==t0&&t!==bo&&t!==wu?Qi(e,kn):(e.state=null,t===bo?Qi(e,sW):Er))}function MW(e,t){var n=t.length,r,i,a,o,s,c,l,u;if(!e||!e.state||(r=e.state,o=r.wrap,o===2||o===1&&r.status!==Kd||r.lookahead))return kn;for(o===1&&(e.adler=O6(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(o===0&&(Xi(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Wt.Buf8(r.w_size),Wt.arraySet(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),s=e.avail_in,c=e.next_in,l=e.input,e.avail_in=n,e.next_in=0,e.input=t,vo(r);r.lookahead>=be;){i=r.strstart,a=r.lookahead-(be-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+be-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++;while(--a);r.strstart=i,r.lookahead=be-1,vo(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=be-1,r.match_available=0,e.next_in=c,e.input=l,e.avail_in=s,r.wrap=o,Er}xr.deflateInit=BW,xr.deflateInit2=G6,xr.deflateReset=H6,xr.deflateResetKeep=$6,xr.deflateSetHeader=DW,xr.deflate=FW,xr.deflateEnd=PW,xr.deflateSetDictionary=MW,xr.deflateInfo="pako deflate (from Nodeca project)";var wo={},n0=Kr,V6=!0,j6=!0;try{String.fromCharCode.apply(null,[0])}catch{V6=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{j6=!1}for(var Eu=new n0.Buf8(256),Ji=0;Ji<256;Ji++)Eu[Ji]=Ji>=252?6:Ji>=248?5:Ji>=240?4:Ji>=224?3:Ji>=192?2:1;Eu[254]=Eu[254]=1,wo.string2buf=function(e){var t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new n0.Buf8(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};function q6(e,t){if(t<65534&&(e.subarray&&j6||!e.subarray&&V6))return String.fromCharCode.apply(null,n0.shrinkBuf(e,t));for(var n="",r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}wo.buf2binstring=function(e){return q6(e,e.length)},wo.binstring2buf=function(e){for(var t=new n0.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},wo.buf2string=function(e,t){var n,r,i,a,o=t||e.length,s=new Array(o*2);for(r=0,n=0;n<o;){if(i=e[n++],i<128){s[r++]=i;continue}if(a=Eu[i],a>4){s[r++]=65533,n+=a-1;continue}for(i&=a===2?31:a===3?15:7;a>1&&n<o;)i=i<<6|e[n++]&63,a--;if(a>1){s[r++]=65533;continue}i<65536?s[r++]=i:(i-=65536,s[r++]=55296|i>>10&1023,s[r++]=56320|i&1023)}return q6(s,r)},wo.utf8border=function(e,t){var n;for(t=t||e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Eu[e[n]]>t?n:t};function OW(){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}var W6=OW,Su=xr,_u=Kr,Qb=wo,Xb=jb,LW=W6,Y6=Object.prototype.toString,NW=0,Kb=4,Os=0,Z6=1,Q6=2,zW=-1,UW=0,$W=8;function xo(e){if(!(this instanceof xo))return new xo(e);this.options=_u.assign({level:zW,method:$W,chunkSize:16384,windowBits:15,memLevel:8,strategy:UW,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new LW,this.strm.avail_out=0;var n=Su.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==Os)throw new Error(Xb[n]);if(t.header&&Su.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(typeof t.dictionary=="string"?r=Qb.string2buf(t.dictionary):Y6.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Su.deflateSetDictionary(this.strm,r),n!==Os)throw new Error(Xb[n]);this._dict_set=!0}}xo.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?Kb:NW,typeof e=="string"?n.input=Qb.string2buf(e):Y6.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new _u.Buf8(r),n.next_out=0,n.avail_out=r),i=Su.deflate(n,a),i!==Z6&&i!==Os)return this.onEnd(i),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(a===Kb||a===Q6))&&(this.options.to==="string"?this.onData(Qb.buf2binstring(_u.shrinkBuf(n.output,n.next_out))):this.onData(_u.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==Z6);return a===Kb?(i=Su.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Os):(a===Q6&&(this.onEnd(Os),n.avail_out=0),!0)},xo.prototype.onData=function(e){this.chunks.push(e)},xo.prototype.onEnd=function(e){e===Os&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=_u.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Jb(e,t){var n=new xo(t);if(n.push(e,!0),n.err)throw n.msg||Xb[n.err];return n.result}function HW(e,t){return t=t||{},t.raw=!0,Jb(e,t)}function GW(e,t){return t=t||{},t.gzip=!0,Jb(e,t)}du.Deflate=xo,du.deflate=Jb,du.deflateRaw=HW,du.gzip=GW;var Cu={},Jn={},r0=30,VW=12,jW=function(t,n){var r,i,a,o,s,c,l,u,f,h,d,p,g,b,v,x,A,w,_,C,I,D,B,G,z;r=t.state,i=t.next_in,G=t.input,a=i+(t.avail_in-5),o=t.next_out,z=t.output,s=o-(n-t.avail_out),c=o+(t.avail_out-257),l=r.dmax,u=r.wsize,f=r.whave,h=r.wnext,d=r.window,p=r.hold,g=r.bits,b=r.lencode,v=r.distcode,x=(1<<r.lenbits)-1,A=(1<<r.distbits)-1;e:do{g<15&&(p+=G[i++]<<g,g+=8,p+=G[i++]<<g,g+=8),w=b[p&x];t:for(;;){if(_=w>>>24,p>>>=_,g-=_,_=w>>>16&255,_===0)z[o++]=w&65535;else if(_&16){C=w&65535,_&=15,_&&(g<_&&(p+=G[i++]<<g,g+=8),C+=p&(1<<_)-1,p>>>=_,g-=_),g<15&&(p+=G[i++]<<g,g+=8,p+=G[i++]<<g,g+=8),w=v[p&A];n:for(;;){if(_=w>>>24,p>>>=_,g-=_,_=w>>>16&255,_&16){if(I=w&65535,_&=15,g<_&&(p+=G[i++]<<g,g+=8,g<_&&(p+=G[i++]<<g,g+=8)),I+=p&(1<<_)-1,I>l){t.msg="invalid distance too far back",r.mode=r0;break e}if(p>>>=_,g-=_,_=o-s,I>_){if(_=I-_,_>f&&r.sane){t.msg="invalid distance too far back",r.mode=r0;break e}if(D=0,B=d,h===0){if(D+=u-_,_<C){C-=_;do z[o++]=d[D++];while(--_);D=o-I,B=z}}else if(h<_){if(D+=u+h-_,_-=h,_<C){C-=_;do z[o++]=d[D++];while(--_);if(D=0,h<C){_=h,C-=_;do z[o++]=d[D++];while(--_);D=o-I,B=z}}}else if(D+=h-_,_<C){C-=_;do z[o++]=d[D++];while(--_);D=o-I,B=z}for(;C>2;)z[o++]=B[D++],z[o++]=B[D++],z[o++]=B[D++],C-=3;C&&(z[o++]=B[D++],C>1&&(z[o++]=B[D++]))}else{D=o-I;do z[o++]=z[D++],z[o++]=z[D++],z[o++]=z[D++],C-=3;while(C>2);C&&(z[o++]=z[D++],C>1&&(z[o++]=z[D++]))}}else if(_&64){t.msg="invalid distance code",r.mode=r0;break e}else{w=v[(w&65535)+(p&(1<<_)-1)];continue n}break}}else if(_&64)if(_&32){r.mode=VW;break e}else{t.msg="invalid literal/length code",r.mode=r0;break e}else{w=b[(w&65535)+(p&(1<<_)-1)];continue t}break}}while(i<a&&o<c);C=g>>3,i-=C,g-=C<<3,p&=(1<<g)-1,t.next_in=i,t.next_out=o,t.avail_in=i<a?5+(a-i):5-(i-a),t.avail_out=o<c?257+(c-o):257-(o-c),r.hold=p,r.bits=g},X6=Kr,Ls=15,K6=852,J6=592,eC=0,ey=1,tC=2,qW=[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],WW=[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],YW=[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],ZW=[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],QW=function(t,n,r,i,a,o,s,c){var l=c.bits,u=0,f=0,h=0,d=0,p=0,g=0,b=0,v=0,x=0,A=0,w,_,C,I,D,B=null,G=0,z,ae=new X6.Buf16(Ls+1),se=new X6.Buf16(Ls+1),ve=null,Pe=0,st,Ne,lt;for(u=0;u<=Ls;u++)ae[u]=0;for(f=0;f<i;f++)ae[n[r+f]]++;for(p=l,d=Ls;d>=1&&ae[d]===0;d--);if(p>d&&(p=d),d===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,c.bits=1,0;for(h=1;h<d&&ae[h]===0;h++);for(p<h&&(p=h),v=1,u=1;u<=Ls;u++)if(v<<=1,v-=ae[u],v<0)return-1;if(v>0&&(t===eC||d!==1))return-1;for(se[1]=0,u=1;u<Ls;u++)se[u+1]=se[u]+ae[u];for(f=0;f<i;f++)n[r+f]!==0&&(s[se[n[r+f]]++]=f);if(t===eC?(B=ve=s,z=19):t===ey?(B=qW,G-=257,ve=WW,Pe-=257,z=256):(B=YW,ve=ZW,z=-1),A=0,f=0,u=h,D=o,g=p,b=0,C=-1,x=1<<p,I=x-1,t===ey&&x>K6||t===tC&&x>J6)return 1;for(;;){st=u-b,s[f]<z?(Ne=0,lt=s[f]):s[f]>z?(Ne=ve[Pe+s[f]],lt=B[G+s[f]]):(Ne=32+64,lt=0),w=1<<u-b,_=1<<g,h=_;do _-=w,a[D+(A>>b)+_]=st<<24|Ne<<16|lt|0;while(_!==0);for(w=1<<u-1;A&w;)w>>=1;if(w!==0?(A&=w-1,A+=w):A=0,f++,--ae[u]===0){if(u===d)break;u=n[r+s[f]]}if(u>p&&(A&I)!==C){for(b===0&&(b=p),D+=h,g=u-b,v=1<<g;g+b<d&&(v-=ae[g+b],!(v<=0));)g++,v<<=1;if(x+=1<<g,t===ey&&x>K6||t===tC&&x>J6)return 1;C=A&I,a[C]=p<<24|g<<16|D-o|0}}return A!==0&&(a[D+A]=u-b<<24|64<<16|0),c.bits=p,0},mn=Kr,ty=P6,_r=M6,XW=jW,ku=QW,KW=0,nC=1,rC=2,iC=4,JW=5,i0=6,Ao=0,eY=1,tY=2,Tn=-2,aC=-3,oC=-4,nY=-5,sC=8,cC=1,lC=2,uC=3,fC=4,hC=5,dC=6,pC=7,gC=8,mC=9,bC=10,a0=11,ei=12,ny=13,yC=14,ry=15,vC=16,wC=17,xC=18,AC=19,o0=20,s0=21,EC=22,SC=23,_C=24,CC=25,kC=26,iy=27,TC=28,IC=29,Ke=30,RC=31,rY=32,iY=852,aY=592,oY=15,sY=oY;function DC(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function cY(){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 mn.Buf16(320),this.work=new mn.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function BC(e){var t;return!e||!e.state?Tn:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=cC,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new mn.Buf32(iY),t.distcode=t.distdyn=new mn.Buf32(aY),t.sane=1,t.back=-1,Ao)}function FC(e){var t;return!e||!e.state?Tn:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,BC(e))}function PC(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Tn:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,FC(e))}function MC(e,t){var n,r;return e?(r=new cY,e.state=r,r.window=null,n=PC(e,t),n!==Ao&&(e.state=null),n):Tn}function lY(e){return MC(e,sY)}var OC=!0,ay,oy;function uY(e){if(OC){var t;for(ay=new mn.Buf32(512),oy=new mn.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ku(nC,e.lens,0,288,ay,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ku(rC,e.lens,0,32,oy,0,e.work,{bits:5}),OC=!1}e.lencode=ay,e.lenbits=9,e.distcode=oy,e.distbits=5}function LC(e,t,n,r){var i,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new mn.Buf8(a.wsize)),r>=a.wsize?(mn.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),mn.arraySet(a.window,t,n-r,i,a.wnext),r-=i,r?(mn.arraySet(a.window,t,n-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function fY(e,t){var n,r,i,a,o,s,c,l,u,f,h,d,p,g,b=0,v,x,A,w,_,C,I,D,B=new mn.Buf8(4),G,z,ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Tn;n=e.state,n.mode===ei&&(n.mode=ny),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,f=s,h=c,D=Ao;e:for(;;)switch(n.mode){case cC:if(n.wrap===0){n.mode=ny;break}for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.check=0,B[0]=l&255,B[1]=l>>>8&255,n.check=_r(n.check,B,2,0),l=0,u=0,n.mode=lC;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Ke;break}if((l&15)!==sC){e.msg="unknown compression method",n.mode=Ke;break}if(l>>>=4,u-=4,I=(l&15)+8,n.wbits===0)n.wbits=I;else if(I>n.wbits){e.msg="invalid window size",n.mode=Ke;break}n.dmax=1<<I,e.adler=n.check=1,n.mode=l&512?bC:ei,l=0,u=0;break;case lC:for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==sC){e.msg="unknown compression method",n.mode=Ke;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Ke;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,n.check=_r(n.check,B,2,0)),l=0,u=0,n.mode=uC;case uC:for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,B[2]=l>>>16&255,B[3]=l>>>24&255,n.check=_r(n.check,B,4,0)),l=0,u=0,n.mode=fC;case fC:for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,n.check=_r(n.check,B,2,0)),l=0,u=0,n.mode=hC;case hC:if(n.flags&1024){for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&(B[0]=l&255,B[1]=l>>>8&255,n.check=_r(n.check,B,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=dC;case dC:if(n.flags&1024&&(d=n.length,d>s&&(d=s),d&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),mn.arraySet(n.head.extra,r,a,d,I)),n.flags&512&&(n.check=_r(n.check,r,d,a)),s-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=pC;case pC:if(n.flags&2048){if(s===0)break e;d=0;do I=r[a+d++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I));while(I&&d<s);if(n.flags&512&&(n.check=_r(n.check,r,d,a)),s-=d,a+=d,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=gC;case gC:if(n.flags&4096){if(s===0)break e;d=0;do I=r[a+d++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I));while(I&&d<s);if(n.flags&512&&(n.check=_r(n.check,r,d,a)),s-=d,a+=d,I)break e}else n.head&&(n.head.comment=null);n.mode=mC;case mC:if(n.flags&512){for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(l!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Ke;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ei;break;case bC:for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=DC(l),l=0,u=0,n.mode=a0;case a0:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,tY;e.adler=n.check=1,n.mode=ei;case ei:if(t===JW||t===i0)break e;case ny:if(n.last){l>>>=u&7,u-=u&7,n.mode=iy;break}for(;u<3;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,u-=1,l&3){case 0:n.mode=yC;break;case 1:if(uY(n),n.mode=o0,t===i0){l>>>=2,u-=2;break e}break;case 2:n.mode=wC;break;case 3:e.msg="invalid block type",n.mode=Ke}l>>>=2,u-=2;break;case yC:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Ke;break}if(n.length=l&65535,l=0,u=0,n.mode=ry,t===i0)break e;case ry:n.mode=vC;case vC:if(d=n.length,d){if(d>s&&(d=s),d>c&&(d=c),d===0)break e;mn.arraySet(i,r,a,d,o),s-=d,a+=d,c-=d,o+=d,n.length-=d;break}n.mode=ei;break;case wC:for(;u<14;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Ke;break}n.have=0,n.mode=xC;case xC:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.lens[ae[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[ae[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,G={bits:n.lenbits},D=ku(KW,n.lens,0,19,n.lencode,0,n.work,G),n.lenbits=G.bits,D){e.msg="invalid code lengths set",n.mode=Ke;break}n.have=0,n.mode=AC;case AC:for(;n.have<n.nlen+n.ndist;){for(;b=n.lencode[l&(1<<n.lenbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(A<16)l>>>=v,u-=v,n.lens[n.have++]=A;else{if(A===16){for(z=v+2;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(l>>>=v,u-=v,n.have===0){e.msg="invalid bit length repeat",n.mode=Ke;break}I=n.lens[n.have-1],d=3+(l&3),l>>>=2,u-=2}else if(A===17){for(z=v+3;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=v,u-=v,I=0,d=3+(l&7),l>>>=3,u-=3}else{for(z=v+7;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=v,u-=v,I=0,d=11+(l&127),l>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Ke;break}for(;d--;)n.lens[n.have++]=I}}if(n.mode===Ke)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Ke;break}if(n.lenbits=9,G={bits:n.lenbits},D=ku(nC,n.lens,0,n.nlen,n.lencode,0,n.work,G),n.lenbits=G.bits,D){e.msg="invalid literal/lengths set",n.mode=Ke;break}if(n.distbits=6,n.distcode=n.distdyn,G={bits:n.distbits},D=ku(rC,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,G),n.distbits=G.bits,D){e.msg="invalid distances set",n.mode=Ke;break}if(n.mode=o0,t===i0)break e;case o0:n.mode=s0;case s0:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,XW(e,h),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===ei&&(n.back=-1);break}for(n.back=0;b=n.lencode[l&(1<<n.lenbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(x&&!(x&240)){for(w=v,_=x,C=A;b=n.lencode[C+((l&(1<<w+_)-1)>>w)],v=b>>>24,x=b>>>16&255,A=b&65535,!(w+v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=v,u-=v,n.back+=v,n.length=A,x===0){n.mode=kC;break}if(x&32){n.back=-1,n.mode=ei;break}if(x&64){e.msg="invalid literal/length code",n.mode=Ke;break}n.extra=x&15,n.mode=EC;case EC:if(n.extra){for(z=n.extra;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=SC;case SC:for(;b=n.distcode[l&(1<<n.distbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(!(x&240)){for(w=v,_=x,C=A;b=n.distcode[C+((l&(1<<w+_)-1)>>w)],v=b>>>24,x=b>>>16&255,A=b&65535,!(w+v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=v,u-=v,n.back+=v,x&64){e.msg="invalid distance code",n.mode=Ke;break}n.offset=A,n.extra=x&15,n.mode=_C;case _C:if(n.extra){for(z=n.extra;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Ke;break}n.mode=CC;case CC:if(c===0)break e;if(d=h-c,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Ke;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=o-n.offset,d=n.length;d>c&&(d=c),c-=d,n.length-=d;do i[o++]=g[p++];while(--d);n.length===0&&(n.mode=s0);break;case kC:if(c===0)break e;i[o++]=n.length,c--,n.mode=s0;break;case iy:if(n.wrap){for(;u<32;){if(s===0)break e;s--,l|=r[a++]<<u,u+=8}if(h-=c,e.total_out+=h,n.total+=h,h&&(e.adler=n.check=n.flags?_r(n.check,i,h,o-h):ty(n.check,i,h,o-h)),h=c,(n.flags?l:DC(l))!==n.check){e.msg="incorrect data check",n.mode=Ke;break}l=0,u=0}n.mode=TC;case TC:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(l!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Ke;break}l=0,u=0}n.mode=IC;case IC:D=eY;break e;case Ke:D=aC;break e;case RC:return oC;case rY:default:return Tn}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||h!==e.avail_out&&n.mode<Ke&&(n.mode<iy||t!==iC))&&LC(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,n.total+=h,n.wrap&&h&&(e.adler=n.check=n.flags?_r(n.check,i,h,e.next_out-h):ty(n.check,i,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ei?128:0)+(n.mode===o0||n.mode===ry?256:0),(f===0&&h===0||t===iC)&&D===Ao&&(D=nY),D}function hY(e){if(!e||!e.state)return Tn;var t=e.state;return t.window&&(t.window=null),e.state=null,Ao}function dY(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?Tn:(n.head=t,t.done=!1,Ao)}function pY(e,t){var n=t.length,r,i,a;return!e||!e.state||(r=e.state,r.wrap!==0&&r.mode!==a0)?Tn:r.mode===a0&&(i=1,i=ty(i,t,n,0),i!==r.check)?aC:(a=LC(e,t,n,n),a?(r.mode=RC,oC):(r.havedict=1,Ao))}Jn.inflateReset=FC,Jn.inflateReset2=PC,Jn.inflateResetKeep=BC,Jn.inflateInit=lY,Jn.inflateInit2=MC,Jn.inflate=fY,Jn.inflateEnd=hY,Jn.inflateGetHeader=dY,Jn.inflateSetDictionary=pY,Jn.inflateInfo="pako inflate (from Nodeca project)";var NC={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};function gY(){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}var mY=gY,Ns=Jn,Tu=Kr,c0=wo,ht=NC,sy=jb,bY=W6,yY=mY,zC=Object.prototype.toString;function Eo(e){if(!(this instanceof Eo))return new Eo(e);this.options=Tu.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bY,this.strm.avail_out=0;var n=Ns.inflateInit2(this.strm,t.windowBits);if(n!==ht.Z_OK)throw new Error(sy[n]);if(this.header=new yY,Ns.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=c0.string2buf(t.dictionary):zC.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Ns.inflateSetDictionary(this.strm,t.dictionary),n!==ht.Z_OK)))throw new Error(sy[n])}Eo.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,o,s,c,l,u=!1;if(this.ended)return!1;o=t===~~t?t:t===!0?ht.Z_FINISH:ht.Z_NO_FLUSH,typeof e=="string"?n.input=c0.binstring2buf(e):zC.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new Tu.Buf8(r),n.next_out=0,n.avail_out=r),a=Ns.inflate(n,ht.Z_NO_FLUSH),a===ht.Z_NEED_DICT&&i&&(a=Ns.inflateSetDictionary(this.strm,i)),a===ht.Z_BUF_ERROR&&u===!0&&(a=ht.Z_OK,u=!1),a!==ht.Z_STREAM_END&&a!==ht.Z_OK)return this.onEnd(a),this.ended=!0,!1;n.next_out&&(n.avail_out===0||a===ht.Z_STREAM_END||n.avail_in===0&&(o===ht.Z_FINISH||o===ht.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=c0.utf8border(n.output,n.next_out),c=n.next_out-s,l=c0.buf2string(n.output,s),n.next_out=c,n.avail_out=r-c,c&&Tu.arraySet(n.output,n.output,s,c,0),this.onData(l)):this.onData(Tu.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(u=!0)}while((n.avail_in>0||n.avail_out===0)&&a!==ht.Z_STREAM_END);return a===ht.Z_STREAM_END&&(o=ht.Z_FINISH),o===ht.Z_FINISH?(a=Ns.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===ht.Z_OK):(o===ht.Z_SYNC_FLUSH&&(this.onEnd(ht.Z_OK),n.avail_out=0),!0)},Eo.prototype.onData=function(e){this.chunks.push(e)},Eo.prototype.onEnd=function(e){e===ht.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Tu.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function cy(e,t){var n=new Eo(t);if(n.push(e,!0),n.err)throw n.msg||sy[n.err];return n.result}function vY(e,t){return t=t||{},t.raw=!0,cy(e,t)}Cu.Inflate=Eo,Cu.inflate=cy,Cu.inflateRaw=vY,Cu.ungzip=cy;var wY=Kr.assign,xY=du,AY=Cu,EY=NC,UC={};wY(UC,xY,AY,EY);var l0=UC;async function ea(e){try{let t,n=0,r=0;const i=[];let a=0,o;do{const c=e.subarray(n);if(o=new l0.Inflate,{strm:t}=o,o.push(c,l0.Z_SYNC_FLUSH),o.err)throw new Error(o.msg);n+=t.next_in,i[r]=o.result,a+=i[r].length,r+=1}while(t.avail_in);const s=new Uint8Array(a);for(let c=0,l=0;c<i.length;c++)s.set(i[c],l),l+=i[c].length;return we.Buffer.from(s)}catch(t){throw`${t}`.match(/incorrect header check/)?new Error("problem decompressing block: incorrect gzip header check"):t}}async function $C(e,t){try{let n;const{minv:r,maxv:i}=t;let a=r.blockPosition,o=r.dataPosition;const s=[],c=[],l=[];let u=0,f=0;do{const p=e.subarray(a-r.blockPosition),g=new l0.Inflate;if({strm:n}=g,g.push(p,l0.Z_SYNC_FLUSH),g.err)throw new Error(g.msg);const b=g.result;s.push(b);let v=b.length;c.push(a),l.push(o),s.length===1&&r.dataPosition&&(s[0]=s[0].subarray(r.dataPosition),v=s[0].length);const x=a;if(a+=n.next_in,o+=v,x>=i.blockPosition){s[f]=s[f].subarray(0,i.blockPosition===r.blockPosition?i.dataPosition-r.dataPosition+1:i.dataPosition+1),c.push(a),l.push(o),u+=s[f].length;break}u+=s[f].length,f++}while(n.avail_in);const h=new Uint8Array(u);for(let p=0,g=0;p<s.length;p++)h.set(s[p],g),g+=s[p].length;return{buffer:we.Buffer.from(h),cpositions:c,dpositions:l}}catch(n){throw`${n}`.match(/incorrect header check/)?new Error("problem decompressing block: incorrect gzip header check"):n}}var SY=He,In=null;try{In=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function He(e,t,n){this.low=e|0,this.high=t|0,this.unsigned=!!n}He.prototype.__isLong__,Object.defineProperty(He.prototype,"__isLong__",{value:!0});function on(e){return(e&&e.__isLong__)===!0}He.isLong=on;var HC={},GC={};function So(e,t){var n,r,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(r=GC[e],r)?r:(n=Ge(e,(e|0)<0?-1:0,!0),i&&(GC[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(r=HC[e],r)?r:(n=Ge(e,e<0?-1:0,!1),i&&(HC[e]=n),n))}He.fromInt=So;function Rn(e,t){if(isNaN(e))return t?_o:Dn;if(t){if(e<0)return _o;if(e>=jC)return QC}else{if(e<=-qC)return sn;if(e+1>=qC)return ZC}return e<0?Rn(-e,t).neg():Ge(e%zs|0,e/zs|0,t)}He.fromNumber=Rn;function Ge(e,t,n){return new He(e,t,n)}He.fromBits=Ge;var u0=Math.pow;function ly(e,t,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return Dn;if(typeof t=="number"?(n=t,t=!1):t=!!t,n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=e.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return ly(e.substring(1),t,n).neg();for(var i=Rn(u0(n,8)),a=Dn,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+s),n);if(s<8){var l=Rn(u0(n,s));a=a.mul(l).add(Rn(c))}else a=a.mul(i),a=a.add(Rn(c))}return a.unsigned=t,a}He.fromString=ly;function er(e,t){return typeof e=="number"?Rn(e,t):typeof e=="string"?ly(e,t):Ge(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}He.fromValue=er;var VC=65536,_Y=1<<24,zs=VC*VC,jC=zs*zs,qC=jC/2,WC=So(_Y),Dn=So(0);He.ZERO=Dn;var _o=So(0,!0);He.UZERO=_o;var Us=So(1);He.ONE=Us;var YC=So(1,!0);He.UONE=YC;var uy=So(-1);He.NEG_ONE=uy;var ZC=Ge(-1,2147483647,!1);He.MAX_VALUE=ZC;var QC=Ge(-1,-1,!0);He.MAX_UNSIGNED_VALUE=QC;var sn=Ge(0,-2147483648,!1);He.MIN_VALUE=sn;var X=He.prototype;X.toInt=function(){return this.unsigned?this.low>>>0:this.low},X.toNumber=function(){return this.unsigned?(this.high>>>0)*zs+(this.low>>>0):this.high*zs+(this.low>>>0)},X.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(sn)){var n=Rn(t),r=this.div(n),i=r.mul(n).sub(this);return r.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=Rn(u0(t,6),this.unsigned),o=this,s="";;){var c=o.div(a),l=o.sub(c.mul(a)).toInt()>>>0,u=l.toString(t);if(o=c,o.isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},X.getHighBits=function(){return this.high},X.getHighBitsUnsigned=function(){return this.high>>>0},X.getLowBits=function(){return this.low},X.getLowBitsUnsigned=function(){return this.low>>>0},X.getNumBitsAbs=function(){if(this.isNegative())return this.eq(sn)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,n=31;n>0&&!(t&1<<n);n--);return this.high!=0?n+33:n+1},X.isZero=function(){return this.high===0&&this.low===0},X.eqz=X.isZero,X.isNegative=function(){return!this.unsigned&&this.high<0},X.isPositive=function(){return this.unsigned||this.high>=0},X.isOdd=function(){return(this.low&1)===1},X.isEven=function(){return(this.low&1)===0},X.equals=function(t){return on(t)||(t=er(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},X.eq=X.equals,X.notEquals=function(t){return!this.eq(t)},X.neq=X.notEquals,X.ne=X.notEquals,X.lessThan=function(t){return this.comp(t)<0},X.lt=X.lessThan,X.lessThanOrEqual=function(t){return this.comp(t)<=0},X.lte=X.lessThanOrEqual,X.le=X.lessThanOrEqual,X.greaterThan=function(t){return this.comp(t)>0},X.gt=X.greaterThan,X.greaterThanOrEqual=function(t){return this.comp(t)>=0},X.gte=X.greaterThanOrEqual,X.ge=X.greaterThanOrEqual,X.compare=function(t){if(on(t)||(t=er(t)),this.eq(t))return 0;var n=this.isNegative(),r=t.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},X.comp=X.compare,X.negate=function(){return!this.unsigned&&this.eq(sn)?sn:this.not().add(Us)},X.neg=X.negate,X.add=function(t){on(t)||(t=er(t));var n=this.high>>>16,r=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,c=t.low>>>16,l=t.low&65535,u=0,f=0,h=0,d=0;return d+=a+l,h+=d>>>16,d&=65535,h+=i+c,f+=h>>>16,h&=65535,f+=r+s,u+=f>>>16,f&=65535,u+=n+o,u&=65535,Ge(h<<16|d,u<<16|f,this.unsigned)},X.subtract=function(t){return on(t)||(t=er(t)),this.add(t.neg())},X.sub=X.subtract,X.multiply=function(t){if(this.isZero())return Dn;if(on(t)||(t=er(t)),In){var n=In.mul(this.low,this.high,t.low,t.high);return Ge(n,In.get_high(),this.unsigned)}if(t.isZero())return Dn;if(this.eq(sn))return t.isOdd()?sn:Dn;if(t.eq(sn))return this.isOdd()?sn:Dn;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(WC)&&t.lt(WC))return Rn(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,c=t.high&65535,l=t.low>>>16,u=t.low&65535,f=0,h=0,d=0,p=0;return p+=o*u,d+=p>>>16,p&=65535,d+=a*u,h+=d>>>16,d&=65535,d+=o*l,h+=d>>>16,d&=65535,h+=i*u,f+=h>>>16,h&=65535,h+=a*l,f+=h>>>16,h&=65535,h+=o*c,f+=h>>>16,h&=65535,f+=r*u+i*l+a*c+o*s,f&=65535,Ge(d<<16|p,f<<16|h,this.unsigned)},X.mul=X.multiply,X.divide=function(t){if(on(t)||(t=er(t)),t.isZero())throw Error("division by zero");if(In){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var n=(this.unsigned?In.div_u:In.div_s)(this.low,this.high,t.low,t.high);return Ge(n,In.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?_o:Dn;var r,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return _o;if(t.gt(this.shru(1)))return YC;a=_o}else{if(this.eq(sn)){if(t.eq(Us)||t.eq(uy))return sn;if(t.eq(sn))return Us;var o=this.shr(1);return r=o.div(t).shl(1),r.eq(Dn)?t.isNegative()?Us:uy:(i=this.sub(t.mul(r)),a=r.add(i.div(t)),a)}else if(t.eq(sn))return this.unsigned?_o:Dn;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=Dn}for(i=this;i.gte(t);){r=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),c=s<=48?1:u0(2,s-48),l=Rn(r),u=l.mul(t);u.isNegative()||u.gt(i);)r-=c,l=Rn(r,this.unsigned),u=l.mul(t);l.isZero()&&(l=Us),a=a.add(l),i=i.sub(u)}return a},X.div=X.divide,X.modulo=function(t){if(on(t)||(t=er(t)),In){var n=(this.unsigned?In.rem_u:In.rem_s)(this.low,this.high,t.low,t.high);return Ge(n,In.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},X.mod=X.modulo,X.rem=X.modulo,X.not=function(){return Ge(~this.low,~this.high,this.unsigned)},X.and=function(t){return on(t)||(t=er(t)),Ge(this.low&t.low,this.high&t.high,this.unsigned)},X.or=function(t){return on(t)||(t=er(t)),Ge(this.low|t.low,this.high|t.high,this.unsigned)},X.xor=function(t){return on(t)||(t=er(t)),Ge(this.low^t.low,this.high^t.high,this.unsigned)},X.shiftLeft=function(t){return on(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Ge(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Ge(0,this.low<<t-32,this.unsigned)},X.shl=X.shiftLeft,X.shiftRight=function(t){return on(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Ge(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Ge(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},X.shr=X.shiftRight,X.shiftRightUnsigned=function(t){if(on(t)&&(t=t.toInt()),t&=63,t===0)return this;var n=this.high;if(t<32){var r=this.low;return Ge(r>>>t|n<<32-t,n>>>t,this.unsigned)}else return t===32?Ge(n,0,this.unsigned):Ge(n>>>t-32,0,this.unsigned)},X.shru=X.shiftRightUnsigned,X.shr_u=X.shiftRightUnsigned,X.toSigned=function(){return this.unsigned?Ge(this.low,this.high,!1):this},X.toUnsigned=function(){return this.unsigned?this:Ge(this.low,this.high,!0)},X.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},X.toBytesLE=function(){var t=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},X.toBytesBE=function(){var t=this.high,n=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},He.fromBytes=function(t,n,r){return r?He.fromBytesLE(t,n):He.fromBytesBE(t,n)},He.fromBytesLE=function(t,n){return new He(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,n)},He.fromBytesBE=function(t,n){return new He(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],n)};const f0=uu(SY),h0=1;class CY{constructor({filehandle:t,path:n}){if(t)this.filehandle=t;else if(n)this.filehandle=new kt(n);else throw new TypeError("either filehandle or path must be defined")}_readLongWithOverflow(t,n=0,r=!0){const i=f0.fromBytesLE(t.slice(n,n+8),r);if(i.greaterThan(Number.MAX_SAFE_INTEGER)||i.lessThan(Number.MIN_SAFE_INTEGER))throw new TypeError("integer overflow");return i.toNumber()}_getIndex(){return this.index||(this.index=this._readIndex()),this.index}async _readIndex(){let t=we.Buffer.allocUnsafe(8);await this.filehandle.read(t,0,8,0);const n=this._readLongWithOverflow(t,0,!0);if(!n)return[[0,0]];const r=new Array(n+1);r[0]=[0,0];const i=8*2*n;if(i>Number.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");t=we.Buffer.allocUnsafe(i),await this.filehandle.read(t,0,i,8);for(let a=0;a<n;a+=1){const o=this._readLongWithOverflow(t,a*16),s=this._readLongWithOverflow(t,a*16+8);r[a+1]=[o,s]}return r}async getLastBlock(){const t=await this._getIndex();if(t.length)return t[t.length-1]}async getRelevantBlocksForRead(t,n){const r=n+t;if(t===0)return[];const i=await this._getIndex(),a=[],o=(h,d)=>{const p=h[h0],g=d?d[h0]:1/0;return p<=n&&g>n?0:p<n?-1:1};let s=0,c=i.length-1,l=Math.floor(i.length/2),u=o(i[l],i[l+1]);for(;u!==0;)u>0?c=l-1:u<0&&(s=l+1),l=Math.ceil((c-s)/2)+s,u=o(i[l],i[l+1]);a.push(i[l]);let f=l+1;for(;f<i.length&&(a.push(i[f]),!(i[f][h0]>=r));f+=1);return a[a.length-1][h0]<r&&a.push([]),a}}class XC{constructor({filehandle:t,path:n,gziFilehandle:r,gziPath:i}){if(t)this.filehandle=t;else if(n)this.filehandle=new kt(n);else throw new TypeError("either filehandle or path must be defined");if(!r&&!i&&!n)throw new TypeError("either gziFilehandle or gziPath must be defined");this.gzi=new CY({filehandle:r,path:!r&&!i&&n?i:`${n}.gzi`})}async stat(){const t=await this.filehandle.stat();return Object.assign(t,{size:await this.getUncompressedFileSize(),blocks:void 0,blksize:void 0})}async getUncompressedFileSize(){const[,t]=await this.gzi.getLastBlock(),{size:n}=await this.filehandle.stat(),r=we.Buffer.allocUnsafe(4),{bytesRead:i}=await this.filehandle.read(r,0,4,n-28-4);if(i!==4)throw new Error("read error");const a=r.readUInt32LE(0);return t+a}async _readAndUncompressBlock(t,[n],[r]){let i=r;i||(i=(await this.filehandle.stat()).size);const a=i-n;return await this.filehandle.read(t,0,a,n),await ea(t.slice(0,a))}async read(t,n,r,i){const a=await this.gzi.getRelevantBlocksForRead(r,i),o=we.Buffer.allocUnsafe(32768*2);let s=n,c=0;for(let l=0;l<a.length-1;l+=1){const u=await this._readAndUncompressBlock(o,a[l],a[l+1]),[,f]=a[l],h=f>=i?0:i-f,d=Math.min(i+r,f+u.length)-f;h>=0&&h<u.length&&(u.copy(t,s,h,d),s+=d-h,c+=d-h)}return{bytesRead:c,buffer:t}}}function KC(e,t){return e.offset+e.lineBytes*Math.floor(t/e.lineLength)+t%e.lineLength}async function kY(e,t){const n=await e.readFile(t);if(!(n&&n.length))throw new Error("No data read from FASTA index (FAI) file");let r=0,i;const a=n.toString("utf8").split(/\r?\n/).filter(o=>/\S/.test(o)).map(o=>o.split(" ")).filter(o=>o[0]!=="").map(o=>((!i||i.name!==o[0])&&(i={name:o[0],id:r},r+=1),{id:i.id,name:o[0],length:+o[1],start:0,end:+o[1],offset:+o[2],lineLength:+o[3],lineBytes:+o[4]}));return{name:Object.fromEntries(a.map(o=>[o.name,o])),id:Object.fromEntries(a.map(o=>[o.id,o]))}}class JC{constructor({fasta:t,fai:n,path:r,faiPath:i,chunkSizeLimit:a=1e6}){if(t)this.fasta=t;else if(r)this.fasta=new kt(r);else throw new Error("Need to pass filehandle for fasta or path to localfile");if(n)this.fai=n;else if(i)this.fai=new kt(i);else if(r)this.fai=new kt(`${r}.fai`);else throw new Error("Need to pass filehandle for or path to localfile");this.chunkSizeLimit=a}async _getIndexes(t){return this.indexes||(this.indexes=kY(this.fai,t)),this.indexes}async getSequenceNames(t){return Object.keys((await this._getIndexes(t)).name)}async getSequenceSizes(t){const n={},r=await this._getIndexes(t),i=Object.values(r.id);for(let a=0;a<i.length;a+=1)n[i[a].name]=i[a].length;return n}async getSequenceSize(t,n){var r;return(r=(await this._getIndexes(n)).name[t])===null||r===void 0?void 0:r.length}async hasReferenceSequence(t,n){return!!(await this._getIndexes(n)).name[t]}async getResiduesById(t,n,r,i){const a=(await this._getIndexes(i)).id[t];if(a)return this._fetchFromIndexEntry(a,n,r,i)}async getResiduesByName(t,n,r,i){const a=(await this._getIndexes(i)).name[t];if(a)return this._fetchFromIndexEntry(a,n,r,i)}async getSequence(t,n,r,i){return this.getResiduesByName(t,n,r,i)}async _fetchFromIndexEntry(t,n=0,r,i){let a=r;if(n<0)throw new TypeError("regionStart cannot be less than 0");if((a===void 0||a>t.length)&&(a=t.length),n>=a)return"";const o=KC(t,n),s=KC(t,a)-o;if(s>this.chunkSizeLimit)throw new Error(`data size of ${s.toLocaleString()} bytes exceeded chunk size limit of ${this.chunkSizeLimit.toLocaleString()} bytes`);const c=Buffer.allocUnsafe(s);return await this.fasta.read(c,0,s,o,i),c.toString("utf8").replace(/\s+/g,"")}}class TY extends JC{constructor({fasta:t,path:n,fai:r,faiPath:i,gzi:a,gziPath:o,chunkSizeLimit:s}){super({fasta:t,path:n,fai:r,faiPath:i,chunkSizeLimit:s}),t&&a?this.fasta=new XC({filehandle:t,gziFilehandle:a}):n&&o&&(this.fasta=new XC({path:n,gziPath:o}))}}function e5(e){return e.split(">").filter(t=>/\S/.test(t)).map(t=>{const[n,...r]=t.split(`
|
3201
3201
|
`),[i,...a]=n.split(" "),o=r.join("").replace(/\s/g,"");return{id:i,description:a.join(" "),sequence:o}})}class IY{constructor({fasta:t,path:n}){if(t)this.fasta=t;else if(n)this.fasta=new kt(n);else throw new Error("Need to pass fasta or path");this.data=this.fasta.readFile().then(r=>{const i=r.toString("utf8");return e5(i)})}async fetch(t,n,r){const a=(await this.data).find(s=>s.id===t),o=r-n;if(!a)throw new Error(`no sequence with id ${t} exists`);return a.sequence.substr(n,o)}async getSequenceNames(){return(await this.data).map(n=>n.id)}}const RY=Object.freeze(Object.defineProperty({__proto__:null,BgzipIndexedFasta:TY,FetchableSmallFasta:IY,IndexedFasta:JC,parseSmallFasta:e5},Symbol.toStringTag,{value:"Module"})),d0=BigInt(32);function DY(e,t,n){const r=+!!n,i=+!n;return BigInt(e.getInt32(t,n)*i+e.getInt32(t+4,n)*r)<<d0|BigInt(e.getUint32(t,n)*r+e.getUint32(t+4,n)*i)}function BY(e,t,n){const r=e.getUint32(t,n),i=e.getUint32(t+4,n),a=+!!n,o=+!n;return BigInt(r*o+i*a)<<d0|BigInt(r*a+i*o)}function FY(e,t,n,r){const i=Number(n>>d0),a=Number(n&BigInt(4294967295));r?(e.setInt32(t+4,i,r),e.setUint32(t,a,r)):(e.setInt32(t,i,r),e.setUint32(t+4,a,r))}function PY(e,t,n,r){const i=Number(n>>d0),a=Number(n&BigInt(4294967295));r?(e.setUint32(t+4,i,r),e.setUint32(t,a,r)):(e.setUint32(t,i,r),e.setUint32(t+4,a,r))}"getBigInt64"in DataView||(DataView.prototype.getBigInt64=function(e,t){return DY(this,e,t)}),"getBigUint64"in DataView||(DataView.prototype.getBigUint64=function(e,t){return BY(this,e,t)}),"setBigInt64"in DataView||(DataView.prototype.setBigInt64=function(e,t,n){FY(this,e,t,n)}),"setBigUint64"in DataView||(DataView.prototype.setBigUint64=function(e,t,n){PY(this,e,t,n)});class MY{constructor(t,n){this.code="",this.scopes=[["vars"]],this.bitFields=[],this.tmpVariableCount=0,this.references=new Map,this.imports=[],this.reverseImports=new Map,this.useContextVariables=!1,this.importPath=t,this.useContextVariables=n}generateVariable(t){const n=[...this.scopes[this.scopes.length-1]];return t&&n.push(t),n.join(".")}generateOption(t){switch(typeof t){case"number":return t.toString();case"string":return this.generateVariable(t);case"function":return`${this.addImport(t)}.call(${this.generateVariable()}, vars)`}}generateError(t){this.pushCode(`throw new Error(${t});`)}generateTmpVariable(){return"$tmp"+this.tmpVariableCount++}pushCode(t){this.code+=t+`
|
3202
|
-
`}pushPath(t){t&&this.scopes[this.scopes.length-1].push(t)}popPath(t){t&&this.scopes[this.scopes.length-1].pop()}pushScope(t){this.scopes.push([t])}popScope(){this.scopes.pop()}addImport(t){if(!this.importPath)return`(${t})`;let n=this.reverseImports.get(t);return n||(n=this.imports.push(t)-1,this.reverseImports.set(t,n)),`${this.importPath}[${n}]`}addReference(t){this.references.has(t)||this.references.set(t,{resolved:!1,requested:!1})}markResolved(t){const n=this.references.get(t);n&&(n.resolved=!0)}markRequested(t){t.forEach(n=>{const r=this.references.get(n);r&&(r.requested=!0)})}getUnresolvedReferences(){return Array.from(this.references).filter(([t,n])=>!n.resolved&&!n.requested).map(([t,n])=>t)}}const tr=new Map,Co="___parser_",nr={uint8:1,uint16le:2,uint16be:2,uint32le:4,uint32be:4,int8:1,int16le:2,int16be:2,int32le:4,int32be:4,int64be:8,int64le:8,uint64be:8,uint64le:8,floatle:4,floatbe:4,doublele:8,doublebe:8},p0={uint8:"Uint8",uint16le:"Uint16",uint16be:"Uint16",uint32le:"Uint32",uint32be:"Uint32",int8:"Int8",int16le:"Int16",int16be:"Int16",int32le:"Int32",int32be:"Int32",int64be:"BigInt64",int64le:"BigInt64",uint64be:"BigUint64",uint64le:"BigUint64",floatle:"Float32",floatbe:"Float32",doublele:"Float64",doublebe:"Float64"},g0={uint8:!1,uint16le:!0,uint16be:!1,uint32le:!0,uint32be:!1,int8:!1,int16le:!0,int16be:!1,int32le:!0,int32be:!1,int64be:!1,int64le:!0,uint64be:!1,uint64le:!0,floatle:!0,floatbe:!1,doublele:!0,doublebe:!1};let Fe=class or{constructor(){this.varName="",this.type="",this.options={},this.endian="be",this.useContextVariables=!1}static start(){return new or}primitiveGenerateN(t,n){const r=p0[t],i=g0[t];n.pushCode(`${n.generateVariable(this.varName)} = dataView.get${r}(offset, ${i});`),n.pushCode(`offset += ${nr[t]};`)}primitiveN(t,n,r){return this.setNextParser(t,n,r)}useThisEndian(t){return t+this.endian.toLowerCase()}uint8(t,n={}){return this.primitiveN("uint8",t,n)}uint16(t,n={}){return this.primitiveN(this.useThisEndian("uint16"),t,n)}uint16le(t,n={}){return this.primitiveN("uint16le",t,n)}uint16be(t,n={}){return this.primitiveN("uint16be",t,n)}uint32(t,n={}){return this.primitiveN(this.useThisEndian("uint32"),t,n)}uint32le(t,n={}){return this.primitiveN("uint32le",t,n)}uint32be(t,n={}){return this.primitiveN("uint32be",t,n)}int8(t,n={}){return this.primitiveN("int8",t,n)}int16(t,n={}){return this.primitiveN(this.useThisEndian("int16"),t,n)}int16le(t,n={}){return this.primitiveN("int16le",t,n)}int16be(t,n={}){return this.primitiveN("int16be",t,n)}int32(t,n={}){return this.primitiveN(this.useThisEndian("int32"),t,n)}int32le(t,n={}){return this.primitiveN("int32le",t,n)}int32be(t,n={}){return this.primitiveN("int32be",t,n)}bigIntVersionCheck(){if(!DataView.prototype.getBigInt64)throw new Error("BigInt64 is unsupported on this runtime")}int64(t,n={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("int64"),t,n)}int64be(t,n={}){return this.bigIntVersionCheck(),this.primitiveN("int64be",t,n)}int64le(t,n={}){return this.bigIntVersionCheck(),this.primitiveN("int64le",t,n)}uint64(t,n={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("uint64"),t,n)}uint64be(t,n={}){return this.bigIntVersionCheck(),this.primitiveN("uint64be",t,n)}uint64le(t,n={}){return this.bigIntVersionCheck(),this.primitiveN("uint64le",t,n)}floatle(t,n={}){return this.primitiveN("floatle",t,n)}floatbe(t,n={}){return this.primitiveN("floatbe",t,n)}doublele(t,n={}){return this.primitiveN("doublele",t,n)}doublebe(t,n={}){return this.primitiveN("doublebe",t,n)}bitN(t,n,r){return r.length=t,this.setNextParser("bit",n,r)}bit1(t,n={}){return this.bitN(1,t,n)}bit2(t,n={}){return this.bitN(2,t,n)}bit3(t,n={}){return this.bitN(3,t,n)}bit4(t,n={}){return this.bitN(4,t,n)}bit5(t,n={}){return this.bitN(5,t,n)}bit6(t,n={}){return this.bitN(6,t,n)}bit7(t,n={}){return this.bitN(7,t,n)}bit8(t,n={}){return this.bitN(8,t,n)}bit9(t,n={}){return this.bitN(9,t,n)}bit10(t,n={}){return this.bitN(10,t,n)}bit11(t,n={}){return this.bitN(11,t,n)}bit12(t,n={}){return this.bitN(12,t,n)}bit13(t,n={}){return this.bitN(13,t,n)}bit14(t,n={}){return this.bitN(14,t,n)}bit15(t,n={}){return this.bitN(15,t,n)}bit16(t,n={}){return this.bitN(16,t,n)}bit17(t,n={}){return this.bitN(17,t,n)}bit18(t,n={}){return this.bitN(18,t,n)}bit19(t,n={}){return this.bitN(19,t,n)}bit20(t,n={}){return this.bitN(20,t,n)}bit21(t,n={}){return this.bitN(21,t,n)}bit22(t,n={}){return this.bitN(22,t,n)}bit23(t,n={}){return this.bitN(23,t,n)}bit24(t,n={}){return this.bitN(24,t,n)}bit25(t,n={}){return this.bitN(25,t,n)}bit26(t,n={}){return this.bitN(26,t,n)}bit27(t,n={}){return this.bitN(27,t,n)}bit28(t,n={}){return this.bitN(28,t,n)}bit29(t,n={}){return this.bitN(29,t,n)}bit30(t,n={}){return this.bitN(30,t,n)}bit31(t,n={}){return this.bitN(31,t,n)}bit32(t,n={}){return this.bitN(32,t,n)}namely(t){return tr.set(t,this),this.alias=t,this}skip(t,n={}){return this.seek(t,n)}seek(t,n={}){if(n.assert)throw new Error("assert option on seek is not allowed.");return this.setNextParser("seek","",{length:t})}string(t,n){if(!n.zeroTerminated&&!n.length&&!n.greedy)throw new Error("One of length, zeroTerminated, or greedy must be defined for string.");if((n.zeroTerminated||n.length)&&n.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(n.stripNull&&!(n.length||n.greedy))throw new Error("length or greedy must be defined if stripNull is enabled.");return n.encoding=n.encoding||"utf8",this.setNextParser("string",t,n)}buffer(t,n){if(!n.length&&!n.readUntil)throw new Error("length or readUntil must be defined for buffer.");return this.setNextParser("buffer",t,n)}wrapped(t,n){if(typeof n!="object"&&typeof t=="object"&&(n=t,t=""),!n||!n.wrapper||!n.type)throw new Error("Both wrapper and type must be defined for wrapped.");if(!n.length&&!n.readUntil)throw new Error("length or readUntil must be defined for wrapped.");return this.setNextParser("wrapper",t,n)}array(t,n){if(!n.readUntil&&!n.length&&!n.lengthInBytes)throw new Error("One of readUntil, length and lengthInBytes must be defined for array.");if(!n.type)throw new Error("type is required for array.");if(typeof n.type=="string"&&!tr.has(n.type)&&!(n.type in nr))throw new Error(`Array element type "${n.type}" is unkown.`);return this.setNextParser("array",t,n)}choice(t,n){if(typeof n!="object"&&typeof t=="object"&&(n=t,t=""),!n)throw new Error("tag and choices are are required for choice.");if(!n.tag)throw new Error("tag is requird for choice.");if(!n.choices)throw new Error("choices is required for choice.");for(const r in n.choices){const i=parseInt(r,10),a=n.choices[i];if(isNaN(i))throw new Error(`Choice key "${r}" is not a number.`);if(typeof a=="string"&&!tr.has(a)&&!(a in nr))throw new Error(`Choice type "${a}" is unkown.`)}return this.setNextParser("choice",t,n)}nest(t,n){if(typeof n!="object"&&typeof t=="object"&&(n=t,t=""),!n||!n.type)throw new Error("type is required for nest.");if(!(n.type instanceof or)&&!tr.has(n.type))throw new Error("type must be a known parser name or a Parser object.");if(!(n.type instanceof or)&&!t)throw new Error("type must be a Parser object if the variable name is omitted.");return this.setNextParser("nest",t,n)}pointer(t,n){if(!n.offset)throw new Error("offset is required for pointer.");if(!n.type)throw new Error("type is required for pointer.");if(typeof n.type=="string"&&!(n.type in nr)&&!tr.has(n.type))throw new Error(`Pointer type "${n.type}" is unkown.`);return this.setNextParser("pointer",t,n)}saveOffset(t,n={}){return this.setNextParser("saveOffset",t,n)}endianness(t){switch(t.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error('endianness must be one of "little" or "big"')}return this}endianess(t){return this.endianness(t)}useContextVars(t=!0){return this.useContextVariables=t,this}create(t){if(!(t instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=t,this}getContext(t){const n=new MY(t,this.useContextVariables);return n.pushCode("var dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.alias?(this.addAliasedCode(n),n.pushCode(`return ${Co+this.alias}(0).result;`)):this.addRawCode(n),n}getCode(){const t="imports";return this.getContext(t).code}addRawCode(t){t.pushCode("var offset = 0;"),t.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),t.pushCode("vars.$parent = null;"),t.pushCode("vars.$root = vars;"),this.generate(t),this.resolveReferences(t),t.pushCode("delete vars.$parent;"),t.pushCode("delete vars.$root;"),t.pushCode("return vars;")}addAliasedCode(t){return t.pushCode(`function ${Co+this.alias}(offset, context) {`),t.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),t.pushCode("var ctx = Object.assign({$parent: null, $root: vars}, context || {});"),t.pushCode("vars = Object.assign(vars, ctx);"),this.generate(t),t.markResolved(this.alias),this.resolveReferences(t),t.pushCode("Object.keys(ctx).forEach(function (item) { delete vars[item]; });"),t.pushCode("return { offset: offset, result: vars };"),t.pushCode("}"),t}resolveReferences(t){const n=t.getUnresolvedReferences();t.markRequested(n),n.forEach(r=>{var i;(i=tr.get(r))===null||i===void 0||i.addAliasedCode(t)})}compile(){const t="imports",n=this.getContext(t);this.compiled=new Function(t,"TextDecoder",`return function (buffer, constructorFn) { ${n.code} };`)(n.imports,TextDecoder)}sizeOf(){let t=NaN;if(Object.keys(nr).indexOf(this.type)>=0)t=nr[this.type];else if(this.type==="string"&&typeof this.options.length=="number")t=this.options.length;else if(this.type==="buffer"&&typeof this.options.length=="number")t=this.options.length;else if(this.type==="array"&&typeof this.options.length=="number"){let n=NaN;typeof this.options.type=="string"?n=nr[this.options.type]:this.options.type instanceof or&&(n=this.options.type.sizeOf()),t=this.options.length*n}else this.type==="seek"?t=this.options.length:this.type==="nest"?t=this.options.type.sizeOf():this.type||(t=0);return this.next&&(t+=this.next.sizeOf()),t}parse(t){return this.compiled||this.compile(),this.compiled(t,this.constructorFn)}setNextParser(t,n,r){const i=new or;return i.type=t,i.varName=n,i.options=r,i.endian=this.endian,this.head?this.head.next=i:this.next=i,this.head=i,this}generate(t){if(this.type){switch(this.type){case"uint8":case"uint16le":case"uint16be":case"uint32le":case"uint32be":case"int8":case"int16le":case"int16be":case"int32le":case"int32be":case"int64be":case"int64le":case"uint64be":case"uint64le":case"floatle":case"floatbe":case"doublele":case"doublebe":this.primitiveGenerateN(this.type,t);break;case"bit":this.generateBit(t);break;case"string":this.generateString(t);break;case"buffer":this.generateBuffer(t);break;case"seek":this.generateSeek(t);break;case"nest":this.generateNest(t);break;case"array":this.generateArray(t);break;case"choice":this.generateChoice(t);break;case"pointer":this.generatePointer(t);break;case"saveOffset":this.generateSaveOffset(t);break;case"wrapper":this.generateWrapper(t);break}this.type!=="bit"&&this.generateAssert(t)}const n=t.generateVariable(this.varName);return this.options.formatter&&this.type!=="bit"&&this.generateFormatter(t,n,this.options.formatter),this.generateNext(t)}generateAssert(t){if(!this.options.assert)return;const n=t.generateVariable(this.varName);switch(typeof this.options.assert){case"function":{const r=t.addImport(this.options.assert);t.pushCode(`if (!${r}.call(vars, ${n})) {`)}break;case"number":t.pushCode(`if (${this.options.assert} !== ${n}) {`);break;case"string":t.pushCode(`if (${JSON.stringify(this.options.assert)} !== ${n}) {`);break;default:throw new Error("assert option must be a string, number or a function.")}t.generateError(`"Assertion error: ${n} is " + ${JSON.stringify(this.options.assert.toString())}`),t.pushCode("}")}generateNext(t){return this.next&&(t=this.next.generate(t)),t}generateBit(t){const n=JSON.parse(JSON.stringify(this));if(n.options=this.options,n.generateAssert=this.generateAssert.bind(this),n.generateFormatter=this.generateFormatter.bind(this),n.varName=t.generateVariable(n.varName),t.bitFields.push(n),!this.next||this.next&&["bit","nest"].indexOf(this.next.type)<0){const r=t.generateTmpVariable();t.pushCode(`var ${r} = 0;`);const i=(u=0)=>{let f=0;for(let h=u;h<t.bitFields.length;h++){const d=t.bitFields[h].options.length;if(f+d>32)break;f+=d}return f},a=u=>(u<=8?(t.pushCode(`${r} = dataView.getUint8(offset);`),u=8):u<=16?(t.pushCode(`${r} = dataView.getUint16(offset);`),u=16):u<=24?(t.pushCode(`${r} = (dataView.getUint16(offset) << 8) | dataView.getUint8(offset + 2);`),u=24):(t.pushCode(`${r} = dataView.getUint32(offset);`),u=32),t.pushCode(`offset += ${u/8};`),u);let o=0;const s=this.endian==="be";let c=0,l=0;t.bitFields.forEach((u,f)=>{let h=u.options.length;if(h>l){if(l){const g=-1>>>32-l;t.pushCode(`${u.varName} = (${r} & 0x${g.toString(16)}) << ${h-l};`),h-=l}o=0,l=c=a(i(f)-l)}const d=s?c-o-h:o,p=-1>>>32-h;t.pushCode(`${u.varName} ${h<u.options.length?"|=":"="} ${r} >> ${d} & 0x${p.toString(16)};`),u.options.length===32&&t.pushCode(`${u.varName} >>>= 0`),u.options.assert&&u.generateAssert(t),u.options.formatter&&u.generateFormatter(t,u.varName,u.options.formatter),o+=h,l-=h}),t.bitFields=[]}}generateSeek(t){const n=t.generateOption(this.options.length);t.pushCode(`offset += ${n};`)}generateString(t){const n=t.generateVariable(this.varName),r=t.generateTmpVariable(),i=this.options.encoding,a=i.toLowerCase()==="hex",o='b => b.toString(16).padStart(2, "0")';if(this.options.length&&this.options.zeroTerminated){const s=this.options.length;t.pushCode(`var ${r} = offset;`),t.pushCode(`while(dataView.getUint8(offset++) !== 0 && offset - ${r} < ${s});`);const c=`offset - ${r} < ${s} ? offset - 1 : offset`;t.pushCode(a?`${n} = Array.from(buffer.subarray(${r}, ${c}), ${o}).join('');`:`${n} = new TextDecoder('${i}').decode(buffer.subarray(${r}, ${c}));`)}else if(this.options.length){const s=t.generateOption(this.options.length);t.pushCode(a?`${n} = Array.from(buffer.subarray(offset, offset + ${s}), ${o}).join('');`:`${n} = new TextDecoder('${i}').decode(buffer.subarray(offset, offset + ${s}));`),t.pushCode(`offset += ${s};`)}else this.options.zeroTerminated?(t.pushCode(`var ${r} = offset;`),t.pushCode("while(dataView.getUint8(offset++) !== 0);"),t.pushCode(a?`${n} = Array.from(buffer.subarray(${r}, offset - 1), ${o}).join('');`:`${n} = new TextDecoder('${i}').decode(buffer.subarray(${r}, offset - 1));`)):this.options.greedy&&(t.pushCode(`var ${r} = offset;`),t.pushCode("while(buffer.length > offset++);"),t.pushCode(a?`${n} = Array.from(buffer.subarray(${r}, offset), ${o}).join('');`:`${n} = new TextDecoder('${i}').decode(buffer.subarray(${r}, offset));`));this.options.stripNull&&t.pushCode(`${n} = ${n}.replace(/\\x00+$/g, '')`)}generateBuffer(t){const n=t.generateVariable(this.varName);if(typeof this.options.readUntil=="function"){const r=this.options.readUntil,i=t.generateTmpVariable(),a=t.generateTmpVariable();t.pushCode(`var ${i} = offset;`),t.pushCode(`var ${a} = 0;`),t.pushCode("while (offset < buffer.length) {"),t.pushCode(`${a} = dataView.getUint8(offset);`);const o=t.addImport(r);t.pushCode(`if (${o}.call(${t.generateVariable()}, ${a}, buffer.subarray(offset))) break;`),t.pushCode("offset += 1;"),t.pushCode("}"),t.pushCode(`${n} = buffer.subarray(${i}, offset);`)}else if(this.options.readUntil==="eof")t.pushCode(`${n} = buffer.subarray(offset);`);else{const r=t.generateOption(this.options.length);t.pushCode(`${n} = buffer.subarray(offset, offset + ${r});`),t.pushCode(`offset += ${r};`)}this.options.clone&&t.pushCode(`${n} = buffer.constructor.from(${n});`)}generateArray(t){const n=t.generateOption(this.options.length),r=t.generateOption(this.options.lengthInBytes),i=this.options.type,a=t.generateTmpVariable(),o=t.generateVariable(this.varName),s=t.generateTmpVariable(),c=this.options.key,l=typeof c=="string";if(l?t.pushCode(`${o} = {};`):t.pushCode(`${o} = [];`),typeof this.options.readUntil=="function"?t.pushCode("do {"):this.options.readUntil==="eof"?t.pushCode(`for (var ${a} = 0; offset < buffer.length; ${a}++) {`):r!==void 0?t.pushCode(`for (var ${a} = offset + ${r}; offset < ${a}; ) {`):t.pushCode(`for (var ${a} = ${n}; ${a} > 0; ${a}--) {`),typeof i=="string")if(tr.get(i)){const u=t.generateTmpVariable();if(t.pushCode(`var ${u} = ${Co+i}(offset, {`),t.useContextVariables){const f=t.generateVariable();t.pushCode(`$parent: ${f},`),t.pushCode(`$root: ${f}.$root,`),!this.options.readUntil&&r===void 0&&t.pushCode(`$index: ${n} - ${a},`)}t.pushCode("});"),t.pushCode(`var ${s} = ${u}.result; offset = ${u}.offset;`),i!==this.alias&&t.addReference(i)}else{const u=p0[i],f=g0[i];t.pushCode(`var ${s} = dataView.get${u}(offset, ${f});`),t.pushCode(`offset += ${nr[i]};`)}else if(i instanceof or){t.pushCode(`var ${s} = {};`);const u=t.generateVariable();t.pushScope(s),t.useContextVariables&&(t.pushCode(`${s}.$parent = ${u};`),t.pushCode(`${s}.$root = ${u}.$root;`),!this.options.readUntil&&r===void 0&&t.pushCode(`${s}.$index = ${n} - ${a};`)),i.generate(t),t.useContextVariables&&(t.pushCode(`delete ${s}.$parent;`),t.pushCode(`delete ${s}.$root;`),t.pushCode(`delete ${s}.$index;`)),t.popScope()}if(l?t.pushCode(`${o}[${s}.${c}] = ${s};`):t.pushCode(`${o}.push(${s});`),t.pushCode("}"),typeof this.options.readUntil=="function"){const u=this.options.readUntil,f=t.addImport(u);t.pushCode(`while (!${f}.call(${t.generateVariable()}, ${s}, buffer.subarray(offset)));`)}}generateChoiceCase(t,n,r){if(typeof r=="string"){const i=t.generateVariable(this.varName);if(tr.has(r)){const a=t.generateTmpVariable();t.pushCode(`var ${a} = ${Co+r}(offset, {`),t.useContextVariables&&(t.pushCode(`$parent: ${i}.$parent,`),t.pushCode(`$root: ${i}.$root,`)),t.pushCode("});"),t.pushCode(`${i} = ${a}.result; offset = ${a}.offset;`),r!==this.alias&&t.addReference(r)}else{const a=p0[r],o=g0[r];t.pushCode(`${i} = dataView.get${a}(offset, ${o});`),t.pushCode(`offset += ${nr[r]}`)}}else r instanceof or&&(t.pushPath(n),r.generate(t),t.popPath(n))}generateChoice(t){const n=t.generateOption(this.options.tag),r=t.generateVariable(this.varName);if(this.varName&&(t.pushCode(`${r} = {};`),t.useContextVariables)){const i=t.generateVariable();t.pushCode(`${r}.$parent = ${i};`),t.pushCode(`${r}.$root = ${i}.$root;`)}t.pushCode(`switch(${n}) {`);for(const i in this.options.choices){const a=parseInt(i,10),o=this.options.choices[a];t.pushCode(`case ${a}:`),this.generateChoiceCase(t,this.varName,o),t.pushCode("break;")}t.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(t,this.varName,this.options.defaultChoice):t.generateError(`"Met undefined tag value " + ${n} + " at choice"`),t.pushCode("}"),this.varName&&t.useContextVariables&&(t.pushCode(`delete ${r}.$parent;`),t.pushCode(`delete ${r}.$root;`))}generateNest(t){const n=t.generateVariable(this.varName);if(this.options.type instanceof or){if(this.varName&&(t.pushCode(`${n} = {};`),t.useContextVariables)){const r=t.generateVariable();t.pushCode(`${n}.$parent = ${r};`),t.pushCode(`${n}.$root = ${r}.$root;`)}t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName),this.varName&&t.useContextVariables&&t.useContextVariables&&(t.pushCode(`delete ${n}.$parent;`),t.pushCode(`delete ${n}.$root;`))}else if(tr.has(this.options.type)){const r=t.generateTmpVariable();if(t.pushCode(`var ${r} = ${Co+this.options.type}(offset, {`),t.useContextVariables){const i=t.generateVariable();t.pushCode(`$parent: ${i},`),t.pushCode(`$root: ${i}.$root,`)}t.pushCode("});"),t.pushCode(`${n} = ${r}.result; offset = ${r}.offset;`),this.options.type!==this.alias&&t.addReference(this.options.type)}}generateWrapper(t){const n=t.generateVariable(this.varName),r=t.generateTmpVariable();if(typeof this.options.readUntil=="function"){const c=this.options.readUntil,l=t.generateTmpVariable(),u=t.generateTmpVariable();t.pushCode(`var ${l} = offset;`),t.pushCode(`var ${u} = 0;`),t.pushCode("while (offset < buffer.length) {"),t.pushCode(`${u} = dataView.getUint8(offset);`);const f=t.addImport(c);t.pushCode(`if (${f}.call(${t.generateVariable()}, ${u}, buffer.subarray(offset))) break;`),t.pushCode("offset += 1;"),t.pushCode("}"),t.pushCode(`${r} = buffer.subarray(${l}, offset);`)}else if(this.options.readUntil==="eof")t.pushCode(`${r} = buffer.subarray(offset);`);else{const c=t.generateOption(this.options.length);t.pushCode(`${r} = buffer.subarray(offset, offset + ${c});`),t.pushCode(`offset += ${c};`)}this.options.clone&&t.pushCode(`${r} = buffer.constructor.from(${r});`);const i=t.generateTmpVariable(),a=t.generateTmpVariable(),o=t.generateTmpVariable(),s=t.addImport(this.options.wrapper);if(t.pushCode(`${r} = ${s}.call(this, ${r}).subarray(0);`),t.pushCode(`var ${i} = buffer;`),t.pushCode(`var ${a} = offset;`),t.pushCode(`var ${o} = dataView;`),t.pushCode(`buffer = ${r};`),t.pushCode("offset = 0;"),t.pushCode("dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.options.type instanceof or)this.varName&&t.pushCode(`${n} = {};`),t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName);else if(tr.has(this.options.type)){const c=t.generateTmpVariable();t.pushCode(`var ${c} = ${Co+this.options.type}(0);`),t.pushCode(`${n} = ${c}.result;`),this.options.type!==this.alias&&t.addReference(this.options.type)}t.pushCode(`buffer = ${i};`),t.pushCode(`dataView = ${o};`),t.pushCode(`offset = ${a};`)}generateFormatter(t,n,r){if(typeof r=="function"){const i=t.addImport(r);t.pushCode(`${n} = ${i}.call(${t.generateVariable()}, ${n});`)}}generatePointer(t){const n=this.options.type,r=t.generateOption(this.options.offset),i=t.generateTmpVariable(),a=t.generateVariable(this.varName);if(t.pushCode(`var ${i} = offset;`),t.pushCode(`offset = ${r};`),this.options.type instanceof or){if(t.pushCode(`${a} = {};`),t.useContextVariables){const o=t.generateVariable();t.pushCode(`${a}.$parent = ${o};`),t.pushCode(`${a}.$root = ${o}.$root;`)}t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName),t.useContextVariables&&(t.pushCode(`delete ${a}.$parent;`),t.pushCode(`delete ${a}.$root;`))}else if(tr.has(this.options.type)){const o=t.generateTmpVariable();if(t.pushCode(`var ${o} = ${Co+this.options.type}(offset, {`),t.useContextVariables){const s=t.generateVariable();t.pushCode(`$parent: ${s},`),t.pushCode(`$root: ${s}.$root,`)}t.pushCode("});"),t.pushCode(`${a} = ${o}.result; offset = ${o}.offset;`),this.options.type!==this.alias&&t.addReference(this.options.type)}else if(Object.keys(nr).indexOf(this.options.type)>=0){const o=p0[n],s=g0[n];t.pushCode(`${a} = dataView.get${o}(offset, ${s});`),t.pushCode(`offset += ${nr[n]};`)}t.pushCode(`offset = ${i};`)}generateSaveOffset(t){const n=t.generateVariable(this.varName);t.pushCode(`${n} = offset`)}};var t5={},fy={},ko={},Iu={};Object.defineProperty(Iu,"__esModule",{value:!0});function hy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dy(e,t,n){return t&&n5(e.prototype,t),n&&n5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OY(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&py(e,t)}function $s(e){return $s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$s(e)}function py(e,t){return py=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},py(e,t)}function LY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ru(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NY(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ru(e)}function zY(e){var t=LY();return function(){var r=$s(e),i;if(t){var a=$s(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return NY(this,i)}}function UY(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=$s(e),e!==null););return e}function m0(){return typeof Reflect<"u"&&Reflect.get?m0=Reflect.get.bind():m0=function(t,n,r){var i=UY(t,n);if(i){var a=Object.getOwnPropertyDescriptor(i,n);return a.get?a.get.call(arguments.length<3?t:r):a.value}},m0.apply(this,arguments)}var r5=function(){function e(){hy(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return dy(e,[{key:"addEventListener",value:function(n,r,i){n in this.listeners||(this.listeners[n]=[]),this.listeners[n].push({callback:r,options:i})}},{key:"removeEventListener",value:function(n,r){if(n in this.listeners){for(var i=this.listeners[n],a=0,o=i.length;a<o;a++)if(i[a].callback===r){i.splice(a,1);return}}}},{key:"dispatchEvent",value:function(n){if(n.type in this.listeners){for(var r=this.listeners[n.type],i=r.slice(),a=0,o=i.length;a<o;a++){var s=i[a];try{s.callback.call(this,n)}catch(c){Promise.resolve().then(function(){throw c})}s.options&&s.options.once&&this.removeEventListener(n.type,s.callback)}return!n.defaultPrevented}}}]),e}(),gy=function(e){OY(n,e);var t=zY(n);function n(){var r;return hy(this,n),r=t.call(this),r.listeners||r5.call(Ru(r)),Object.defineProperty(Ru(r),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(Ru(r),"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(Ru(r),"reason",{value:void 0,writable:!0,configurable:!0}),r}return dy(n,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(i){i.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,i)),m0($s(n.prototype),"dispatchEvent",this).call(this,i)}}]),n}(r5),i5=function(){function e(){hy(this,e),Object.defineProperty(this,"signal",{value:new gy,writable:!0,configurable:!0})}return dy(e,[{key:"abort",value:function(n){var r;try{r=new Event("abort")}catch{typeof document<"u"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}var i=n;if(i===void 0)if(typeof document>"u")i=new Error("This operation was aborted"),i.name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch{i=new Error("This operation was aborted"),i.name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(r)}},{key:"toString",value:function(){return"[object AbortController]"}}]),e}();typeof Symbol<"u"&&Symbol.toStringTag&&(i5.prototype[Symbol.toStringTag]="AbortController",gy.prototype[Symbol.toStringTag]="AbortSignal");function $Y(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function HY(e){typeof e=="function"&&(e={fetch:e});var t=e,n=t.fetch,r=t.Request,i=r===void 0?n.Request:r,a=t.AbortController,o=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=o===void 0?!1:o;if(!$Y({fetch:n,Request:i,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:n,Request:c};var c=i;(c&&!c.prototype.hasOwnProperty("signal")||s)&&(c=function(h,d){var p;d&&d.signal&&(p=d.signal,delete d.signal);var g=new i(h,d);return p&&Object.defineProperty(g,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),g},c.prototype=i.prototype);var l=n,u=function(h,d){var p=c&&c.prototype.isPrototypeOf(h)?h.signal:d?d.signal:void 0;if(p){var g;try{g=new DOMException("Aborted","AbortError")}catch{g=new Error("Aborted"),g.name="AbortError"}if(p.aborted)return Promise.reject(g);var b=new Promise(function(v,x){p.addEventListener("abort",function(){return x(g)},{once:!0})});return d&&d.signal&&delete d.signal,Promise.race([b,l(h,d)])}return l(h,d)};return{fetch:u,Request:c}}Iu.AbortController=i5,Iu.AbortSignal=gy,Iu.abortableFetch=HY,Object.defineProperty(ko,"__esModule",{value:!0}),ko.AbortSignal=ko.AbortController=void 0;const a5=Iu;var b0=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")};let GY=typeof b0().AbortController>"u"?a5.AbortController:b0().AbortController;ko.AbortController=GY;let VY=typeof b0().AbortController>"u"?a5.AbortSignal:b0().AbortSignal;ko.AbortSignal=VY;var my={};Object.defineProperty(my,"__esModule",{value:!0});const jY=ko;class qY{}class WY{constructor(){this.signals=new Set,this.abortController=new jY.AbortController}addSignal(t=new qY){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(t),t.aborted?this.handleAborted(t):typeof t.addEventListener=="function"&&t.addEventListener("abort",()=>{this.handleAborted(t)})}handleAborted(t){this.signals.delete(t),this.signals.size===0&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}my.default=WY;var by={};Object.defineProperty(by,"__esModule",{value:!0});class YY{constructor(){this.callbacks=new Set}addCallback(t=()=>{}){this.callbacks.add(t),t(this.currentMessage)}callback(t){this.currentMessage=t,this.callbacks.forEach(n=>{n(t)})}}by.default=YY;var o5=qd&&qd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fy,"__esModule",{value:!0});const ZY=ko,QY=o5(my),XY=o5(by);class y0{constructor({fill:t,cache:n}){if(typeof t!="function")throw new TypeError("must pass a fill function");if(typeof n!="object")throw new TypeError("must pass a cache object");if(typeof n.get!="function"||typeof n.set!="function"||typeof n.delete!="function")throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=n,this.fillCallback=t}static isAbortException(t){return t.name==="AbortError"||t.code==="ERR_ABORTED"||t.message==="AbortError: aborted"||t.message==="Error: aborted"}evict(t,n){this.cache.get(t)===n&&this.cache.delete(t)}fill(t,n,r,i){const a=new QY.default,o=new XY.default;o.addCallback(i);const s={aborter:a,promise:this.fillCallback(n,a.signal,c=>{o.callback(c)}),settled:!1,statusReporter:o,get aborted(){return this.aborter.signal.aborted}};s.aborter.addSignal(r),s.aborter.signal.addEventListener("abort",()=>{s.settled||this.evict(t,s)}),s.promise.then(()=>{s.settled=!0},()=>{s.settled=!0,this.evict(t,s)}).catch(c=>{throw console.error(c),c}),this.cache.set(t,s)}static checkSinglePromise(t,n){function r(){if(n&&n.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then(i=>(r(),i),i=>{throw r(),i})}has(t){return this.cache.has(t)}get(t,n,r,i){if(!r&&n instanceof ZY.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");const a=this.cache.get(t);return a?a.aborted&&!a.settled?(this.evict(t,a),this.get(t,n,r,i)):a.settled?a.promise:(a.aborter.addSignal(r),a.statusReporter.addCallback(i),y0.checkSinglePromise(a.promise,r)):(this.fill(t,n,r,i),y0.checkSinglePromise(this.cache.get(t).promise,r))}delete(t){const n=this.cache.get(t);n&&(n.settled||n.aborter.abort(),this.cache.delete(t))}clear(){const t=this.cache.keys();let n=0;for(let r=t.next();!r.done;r=t.next())this.delete(r.value),n+=1;return n}}fy.default=y0;var KY=qd&&qd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t5,"__esModule",{value:!0});const JY=KY(fy);var v0=t5.default=JY.default;class eZ{constructor(t={}){if(!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(t,n){this.cache.set(t,n),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t)){const n=this.oldCache.get(t);return this.oldCache.delete(t),this._set(t,n),n}}set(t,n){return this.cache.has(t)?this.cache.set(t,n):this._set(t,n),this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t))return this.oldCache.get(t)}delete(t){const n=this.cache.delete(t);return n&&this._size--,this.oldCache.delete(t)||n}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache)yield t;for(const t of this.oldCache){const[n]=t;this.cache.has(n)||(yield t)}}get size(){let t=0;for(const n of this.oldCache.keys())this.cache.has(n)||t++;return this._size+t}}var tZ=eZ;const w0=uu(tZ);class ea{constructor(t,n){this.ranges=arguments.length===2?[{min:t,max:n}]:0 in t?Object.assign({},t):[t]}min(){return this.ranges[0].min}max(){return this.ranges[this.ranges.length-1].max}contains(t){for(let n=0;n<this.ranges.length;n+=1){const r=this.ranges[n];if(r.min<=t&&r.max>=t)return!0}return!1}isContiguous(){return this.ranges.length>1}getRanges(){return this.ranges.map(t=>new ea(t.min,t.max))}toString(){return this.ranges.map(t=>`[${t.min}-${t.max}]`).join(",")}union(t){const n=this.getRanges().concat(t.getRanges()).sort(this.rangeOrder),r=[];let i=n[0];for(let a=1;a<n.length;a+=1){const o=n[a];o.min()>i.max()+1?(r.push(i),i=o):o.max()>i.max()&&(i=new ea(i.min(),o.max()))}return r.push(i),r.length===1?r[0]:new ea(r)}intersection(t){let n=this,r=t;const i=this.ranges(),a=r.ranges(),o=i.length,s=a.length;let c=0,l=0;const u=[];for(;c<o&&l<s;){n=i[c],r=a[l];const f=Math.max(n.min(),r.min()),h=Math.min(n.max(),r.max());h>=f&&u.push(new ea(f,h)),n.max()>r.max()?l+=1:c+=1}if(u.length===0)throw new Error("found range of length 0");return u.length===1?u[0]:new ea(u)}coverage(){let t=0;const n=this.ranges();for(const r of n)t+=r.max()-r.min()+1;return t}rangeOrder(t,n){let r=t,i=n;return arguments.length<2&&(i=r,r=this),r.min()<i.min()?-1:r.min()>i.min()?1:r.max()<i.max()?-1:i.max()>r.max()?1:0}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const nZ=4,s5=0,c5=1,rZ=2;function Hs(e){let t=e.length;for(;--t>=0;)e[t]=0}const iZ=0,l5=1,aZ=2,oZ=3,sZ=258,yy=29,Du=256,Bu=Du+1+yy,Gs=30,vy=19,u5=2*Bu+1,To=15,wy=16,cZ=7,xy=256,f5=16,h5=17,d5=18,Ay=new Uint8Array([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]),x0=new Uint8Array([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]),lZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),p5=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uZ=512,ti=new Array((Bu+2)*2);Hs(ti);const Fu=new Array(Gs*2);Hs(Fu);const Pu=new Array(uZ);Hs(Pu);const Mu=new Array(sZ-oZ+1);Hs(Mu);const Ey=new Array(yy);Hs(Ey);const A0=new Array(Gs);Hs(A0);function Sy(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let g5,m5,b5;function _y(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const y5=e=>e<256?Pu[e]:Pu[256+(e>>>7)],Ou=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},cn=(e,t,n)=>{e.bi_valid>wy-n?(e.bi_buf|=t<<e.bi_valid&65535,Ou(e,e.bi_buf),e.bi_buf=t>>wy-e.bi_valid,e.bi_valid+=n-wy):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},kr=(e,t,n)=>{cn(e,n[t*2],n[t*2+1])},v5=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},fZ=e=>{e.bi_valid===16?(Ou(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},hZ=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let l,u,f,h,d,p,g=0;for(h=0;h<=To;h++)e.bl_count[h]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<u5;l++)u=e.heap[l],h=n[n[u*2+1]*2+1]+1,h>c&&(h=c,g++),n[u*2+1]=h,!(u>r)&&(e.bl_count[h]++,d=0,u>=s&&(d=o[u-s]),p=n[u*2],e.opt_len+=p*(h+d),a&&(e.static_len+=p*(i[u*2+1]+d)));if(g!==0){do{for(h=c-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(h=c;h!==0;h--)for(u=e.bl_count[h];u!==0;)f=e.heap[--l],!(f>r)&&(n[f*2+1]!==h&&(e.opt_len+=(h-n[f*2+1])*n[f*2],n[f*2+1]=h),u--)}},w5=(e,t,n)=>{const r=new Array(To+1);let i=0,a,o;for(a=1;a<=To;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let s=e[o*2+1];s!==0&&(e[o*2]=v5(r[s]++,s))}},dZ=()=>{let e,t,n,r,i;const a=new Array(To+1);for(n=0,r=0;r<yy-1;r++)for(Ey[r]=n,e=0;e<1<<Ay[r];e++)Mu[n++]=r;for(Mu[n-1]=r,i=0,r=0;r<16;r++)for(A0[r]=i,e=0;e<1<<x0[r];e++)Pu[i++]=r;for(i>>=7;r<Gs;r++)for(A0[r]=i<<7,e=0;e<1<<x0[r]-7;e++)Pu[256+i++]=r;for(t=0;t<=To;t++)a[t]=0;for(e=0;e<=143;)ti[e*2+1]=8,e++,a[8]++;for(;e<=255;)ti[e*2+1]=9,e++,a[9]++;for(;e<=279;)ti[e*2+1]=7,e++,a[7]++;for(;e<=287;)ti[e*2+1]=8,e++,a[8]++;for(w5(ti,Bu+1,a),e=0;e<Gs;e++)Fu[e*2+1]=5,Fu[e*2]=v5(e,5);g5=new Sy(ti,Ay,Du+1,Bu,To),m5=new Sy(Fu,x0,0,Gs,To),b5=new Sy(new Array(0),lZ,0,vy,cZ)},x5=e=>{let t;for(t=0;t<Bu;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Gs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<vy;t++)e.bl_tree[t*2]=0;e.dyn_ltree[xy*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},A5=e=>{e.bi_valid>8?Ou(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},E5=(e,t,n,r)=>{const i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},Cy=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&E5(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!E5(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},S5=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?kr(e,i,t):(o=Mu[i],kr(e,o+Du+1,t),s=Ay[o],s!==0&&(i-=Ey[o],cn(e,i,s)),r--,o=y5(r),kr(e,o,n),s=x0[o],s!==0&&(r-=A0[o],cn(e,r,s)));while(a<e.sym_next);kr(e,xy,t)},ky=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems;let o,s,c=-1,l;for(e.heap_len=0,e.heap_max=u5,o=0;o<a;o++)n[o*2]!==0?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):n[o*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Cy(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Cy(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,Cy(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],hZ(e,t),w5(n,c,e.bl_count)},_5=(e,t,n)=>{let r,i=-1,a,o=t[0*2+1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[f5*2]++):s<=10?e.bl_tree[h5*2]++:e.bl_tree[d5*2]++,s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},C5=(e,t,n)=>{let r,i=-1,a,o=t[0*2+1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do kr(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&(kr(e,a,e.bl_tree),s--),kr(e,f5,e.bl_tree),cn(e,s-3,2)):s<=10?(kr(e,h5,e.bl_tree),cn(e,s-3,3)):(kr(e,d5,e.bl_tree),cn(e,s-11,7));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},pZ=e=>{let t;for(_5(e,e.dyn_ltree,e.l_desc.max_code),_5(e,e.dyn_dtree,e.d_desc.max_code),ky(e,e.bl_desc),t=vy-1;t>=3&&e.bl_tree[p5[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},gZ=(e,t,n,r)=>{let i;for(cn(e,t-257,5),cn(e,n-1,5),cn(e,r-4,4),i=0;i<r;i++)cn(e,e.bl_tree[p5[i]*2+1],3);C5(e,e.dyn_ltree,t-1),C5(e,e.dyn_dtree,n-1)},mZ=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return s5;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return c5;for(n=32;n<Du;n++)if(e.dyn_ltree[n*2]!==0)return c5;return s5};let k5=!1;const bZ=e=>{k5||(dZ(),k5=!0),e.l_desc=new _y(e.dyn_ltree,g5),e.d_desc=new _y(e.dyn_dtree,m5),e.bl_desc=new _y(e.bl_tree,b5),e.bi_buf=0,e.bi_valid=0,x5(e)},T5=(e,t,n,r)=>{cn(e,(iZ<<1)+(r?1:0),3),A5(e),Ou(e,n),Ou(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},yZ=e=>{cn(e,l5<<1,3),kr(e,xy,ti),fZ(e)},vZ=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===rZ&&(e.strm.data_type=mZ(e)),ky(e,e.l_desc),ky(e,e.d_desc),o=pZ(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?T5(e,t,n,r):e.strategy===nZ||a===i?(cn(e,(l5<<1)+(r?1:0),3),S5(e,ti,Fu)):(cn(e,(aZ<<1)+(r?1:0),3),gZ(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),S5(e,e.dyn_ltree,e.dyn_dtree)),x5(e),r&&A5(e)},wZ=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Mu[n]+Du+1)*2]++,e.dyn_dtree[y5(t)*2]++),e.sym_next===e.sym_end);var xZ=bZ,AZ=T5,EZ=vZ,SZ=wZ,_Z=yZ,CZ={_tr_init:xZ,_tr_stored_block:AZ,_tr_flush_block:EZ,_tr_tally:SZ,_tr_align:_Z},Lu=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};const kZ=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},TZ=new Uint32Array(kZ());var Tt=(e,t,n,r)=>{const i=TZ,a=r+n;e^=-1;for(let o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1},Vs={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"},Nu={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_MEM_ERROR:-4,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};const{_tr_init:IZ,_tr_stored_block:Ty,_tr_flush_block:RZ,_tr_tally:ta,_tr_align:DZ}=CZ,{Z_NO_FLUSH:na,Z_PARTIAL_FLUSH:BZ,Z_FULL_FLUSH:FZ,Z_FINISH:Bn,Z_BLOCK:I5,Z_OK:Mt,Z_STREAM_END:R5,Z_STREAM_ERROR:Tr,Z_DATA_ERROR:PZ,Z_BUF_ERROR:Iy,Z_DEFAULT_COMPRESSION:MZ,Z_FILTERED:OZ,Z_HUFFMAN_ONLY:E0,Z_RLE:LZ,Z_FIXED:NZ,Z_DEFAULT_STRATEGY:zZ,Z_UNKNOWN:UZ,Z_DEFLATED:S0}=Nu,$Z=9,HZ=15,GZ=8,VZ=29,Ry=256+1+VZ,jZ=30,qZ=19,WZ=2*Ry+1,YZ=15,ye=3,ra=258,Ir=ra+ye+1,ZZ=32,js=42,Dy=57,By=69,Fy=73,Py=91,My=103,Io=113,zu=666,Yt=1,qs=2,Ro=3,Ws=4,QZ=3,Do=(e,t)=>(e.msg=Vs[t],t),D5=e=>e*2-(e>4?9:0),ia=e=>{let t=e.length;for(;--t>=0;)e[t]=0},XZ=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let aa=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const bn=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},yn=(e,t)=>{RZ(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,bn(e.strm)},Ce=(e,t)=>{e.pending_buf[e.pending++]=t},Uu=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Oy=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Lu(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Tt(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},B5=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-Ir?e.strstart-(e.w_size-Ir):0,l=e.window,u=e.w_mask,f=e.prev,h=e.strstart+ra;let d=l[r+o-1],p=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(l[i+o]!==p||l[i+o-1]!==d||l[i]!==l[r]||l[++i]!==l[r+1])){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<h);if(a=ra-(h-r),r=h-ra,a>o){if(e.match_start=t,o=a,a>=s)break;d=l[r+o-1],p=l[r+o]}}while((t=f[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},Ys=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ir)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),XZ(e),r+=t),e.strm.avail_in===0)break;if(n=Oy(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=ye)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=aa(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=aa(e,e.ins_h,e.window[i+ye-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<ye)););}while(e.lookahead<Ir&&e.strm.avail_in!==0)},F5=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==Bn||t===na||r!==i+e.strm.avail_in)))break;o=t===Bn&&r===i+e.strm.avail_in?1:0,Ty(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,bn(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Oy(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?Ws:t!==na&&t!==Bn&&e.strm.avail_in===0&&e.strstart===e.block_start?qs:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Oy(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===Bn)&&t!==na&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=t===Bn&&e.strm.avail_in===0&&r===i?1:0,Ty(e,e.block_start,r,o),e.block_start+=r,bn(e.strm)),o?Ro:Yt)},Ly=(e,t)=>{let n,r;for(;;){if(e.lookahead<Ir){if(Ys(e),e.lookahead<Ir&&t===na)return Yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=ye&&(e.ins_h=aa(e,e.ins_h,e.window[e.strstart+ye-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Ir&&(e.match_length=B5(e,n)),e.match_length>=ye)if(r=ta(e,e.strstart-e.match_start,e.match_length-ye),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=ye){e.match_length--;do e.strstart++,e.ins_h=aa(e,e.ins_h,e.window[e.strstart+ye-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=aa(e,e.ins_h,e.window[e.strstart+1]);else r=ta(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(yn(e,!1),e.strm.avail_out===0))return Yt}return e.insert=e.strstart<ye-1?e.strstart:ye-1,t===Bn?(yn(e,!0),e.strm.avail_out===0?Ro:Ws):e.sym_next&&(yn(e,!1),e.strm.avail_out===0)?Yt:qs},Zs=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Ir){if(Ys(e),e.lookahead<Ir&&t===na)return Yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=ye&&(e.ins_h=aa(e,e.ins_h,e.window[e.strstart+ye-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=ye-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Ir&&(e.match_length=B5(e,n),e.match_length<=5&&(e.strategy===OZ||e.match_length===ye&&e.strstart-e.match_start>4096)&&(e.match_length=ye-1)),e.prev_length>=ye&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-ye,r=ta(e,e.strstart-1-e.prev_match,e.prev_length-ye),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=aa(e,e.ins_h,e.window[e.strstart+ye-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=ye-1,e.strstart++,r&&(yn(e,!1),e.strm.avail_out===0))return Yt}else if(e.match_available){if(r=ta(e,0,e.window[e.strstart-1]),r&&yn(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Yt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=ta(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<ye-1?e.strstart:ye-1,t===Bn?(yn(e,!0),e.strm.avail_out===0?Ro:Ws):e.sym_next&&(yn(e,!1),e.strm.avail_out===0)?Yt:qs},KZ=(e,t)=>{let n,r,i,a;const o=e.window;for(;;){if(e.lookahead<=ra){if(Ys(e),e.lookahead<=ra&&t===na)return Yt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=ye&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+ra;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=ra-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=ye?(n=ta(e,1,e.match_length-ye),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=ta(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(yn(e,!1),e.strm.avail_out===0))return Yt}return e.insert=0,t===Bn?(yn(e,!0),e.strm.avail_out===0?Ro:Ws):e.sym_next&&(yn(e,!1),e.strm.avail_out===0)?Yt:qs},JZ=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Ys(e),e.lookahead===0)){if(t===na)return Yt;break}if(e.match_length=0,n=ta(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(yn(e,!1),e.strm.avail_out===0))return Yt}return e.insert=0,t===Bn?(yn(e,!0),e.strm.avail_out===0?Ro:Ws):e.sym_next&&(yn(e,!1),e.strm.avail_out===0)?Yt:qs};function Rr(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const $u=[new Rr(0,0,0,0,F5),new Rr(4,4,8,4,Ly),new Rr(4,5,16,8,Ly),new Rr(4,6,32,32,Ly),new Rr(4,4,16,16,Zs),new Rr(8,16,32,32,Zs),new Rr(8,16,128,128,Zs),new Rr(8,32,128,256,Zs),new Rr(32,128,258,1024,Zs),new Rr(32,258,258,4096,Zs)],eQ=e=>{e.window_size=2*e.w_size,ia(e.head),e.max_lazy_match=$u[e.level].max_lazy,e.good_match=$u[e.level].good_length,e.nice_match=$u[e.level].nice_length,e.max_chain_length=$u[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=ye-1,e.match_available=0,e.ins_h=0};function tQ(){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=S0,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 Uint16Array(WZ*2),this.dyn_dtree=new Uint16Array((2*jZ+1)*2),this.bl_tree=new Uint16Array((2*qZ+1)*2),ia(this.dyn_ltree),ia(this.dyn_dtree),ia(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(YZ+1),this.heap=new Uint16Array(2*Ry+1),ia(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ry+1),ia(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Hu=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==js&&t.status!==Dy&&t.status!==By&&t.status!==Fy&&t.status!==Py&&t.status!==My&&t.status!==Io&&t.status!==zu?1:0},P5=e=>{if(Hu(e))return Do(e,Tr);e.total_in=e.total_out=0,e.data_type=UZ;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Dy:t.wrap?js:Io,e.adler=t.wrap===2?0:1,t.last_flush=-2,IZ(t),Mt},M5=e=>{const t=P5(e);return t===Mt&&eQ(e.state),t},nQ=(e,t)=>Hu(e)||e.state.wrap!==2?Tr:(e.state.gzhead=t,Mt),O5=(e,t,n,r,i,a)=>{if(!e)return Tr;let o=1;if(t===MZ&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>$Z||n!==S0||r<8||r>15||t<0||t>9||a<0||a>NZ||r===8&&o!==1)return Do(e,Tr);r===8&&(r=9);const s=new tQ;return e.state=s,s.strm=e,s.status=js,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+ye-1)/ye),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=a,s.method=n,M5(e)},rQ=(e,t)=>O5(e,t,S0,HZ,GZ,zZ),iQ=(e,t)=>{if(Hu(e)||t>I5||t<0)return e?Do(e,Tr):Tr;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===zu&&t!==Bn)return Do(e,e.avail_out===0?Iy:Tr);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(bn(e),e.avail_out===0)return n.last_flush=-1,Mt}else if(e.avail_in===0&&D5(t)<=D5(r)&&t!==Bn)return Do(e,Iy);if(n.status===zu&&e.avail_in!==0)return Do(e,Iy);if(n.status===js&&n.wrap===0&&(n.status=Io),n.status===js){let i=S0+(n.w_bits-8<<4)<<8,a=-1;if(n.strategy>=E0||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=ZZ),i+=31-i%31,Uu(n,i),n.strstart!==0&&(Uu(n,e.adler>>>16),Uu(n,e.adler&65535)),e.adler=1,n.status=Io,bn(e),n.pending!==0)return n.last_flush=-1,Mt}if(n.status===Dy){if(e.adler=0,Ce(n,31),Ce(n,139),Ce(n,8),n.gzhead)Ce(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ce(n,n.gzhead.time&255),Ce(n,n.gzhead.time>>8&255),Ce(n,n.gzhead.time>>16&255),Ce(n,n.gzhead.time>>24&255),Ce(n,n.level===9?2:n.strategy>=E0||n.level<2?4:0),Ce(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Ce(n,n.gzhead.extra.length&255),Ce(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Tt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=By;else if(Ce(n,0),Ce(n,0),Ce(n,0),Ce(n,0),Ce(n,0),Ce(n,n.level===9?2:n.strategy>=E0||n.level<2?4:0),Ce(n,QZ),n.status=Io,bn(e),n.pending!==0)return n.last_flush=-1,Mt}if(n.status===By){if(n.gzhead.extra){let i=n.pending,a=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+a>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,bn(e),n.pending!==0)return n.last_flush=-1,Mt;i=0,a-=s}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Fy}if(n.status===Fy){if(n.gzhead.name){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),bn(e),n.pending!==0)return n.last_flush=-1,Mt;i=0}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,Ce(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Py}if(n.status===Py){if(n.gzhead.comment){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),bn(e),n.pending!==0)return n.last_flush=-1,Mt;i=0}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,Ce(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i))}n.status=My}if(n.status===My){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(bn(e),n.pending!==0))return n.last_flush=-1,Mt;Ce(n,e.adler&255),Ce(n,e.adler>>8&255),e.adler=0}if(n.status=Io,bn(e),n.pending!==0)return n.last_flush=-1,Mt}if(e.avail_in!==0||n.lookahead!==0||t!==na&&n.status!==zu){let i=n.level===0?F5(n,t):n.strategy===E0?JZ(n,t):n.strategy===LZ?KZ(n,t):$u[n.level].func(n,t);if((i===Ro||i===Ws)&&(n.status=zu),i===Yt||i===Ro)return e.avail_out===0&&(n.last_flush=-1),Mt;if(i===qs&&(t===BZ?DZ(n):t!==I5&&(Ty(n,0,0,!1),t===FZ&&(ia(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),bn(e),e.avail_out===0))return n.last_flush=-1,Mt}return t!==Bn?Mt:n.wrap<=0?R5:(n.wrap===2?(Ce(n,e.adler&255),Ce(n,e.adler>>8&255),Ce(n,e.adler>>16&255),Ce(n,e.adler>>24&255),Ce(n,e.total_in&255),Ce(n,e.total_in>>8&255),Ce(n,e.total_in>>16&255),Ce(n,e.total_in>>24&255)):(Uu(n,e.adler>>>16),Uu(n,e.adler&65535)),bn(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Mt:R5)},aQ=e=>{if(Hu(e))return Tr;const t=e.state.status;return e.state=null,t===Io?Do(e,PZ):Mt},oQ=(e,t)=>{let n=t.length;if(Hu(e))return Tr;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==js||r.lookahead)return Tr;if(i===1&&(e.adler=Lu(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(ia(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Ys(r);r.lookahead>=ye;){let c=r.strstart,l=r.lookahead-(ye-1);do r.ins_h=aa(r,r.ins_h,r.window[c+ye-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--l);r.strstart=c,r.lookahead=ye-1,Ys(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=ye-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,Mt};var sQ=rQ,cQ=O5,lQ=M5,uQ=P5,fQ=nQ,hQ=iQ,dQ=aQ,pQ=oQ,gQ="pako deflate (from Nodeca project)",Gu={deflateInit:sQ,deflateInit2:cQ,deflateReset:lQ,deflateResetKeep:uQ,deflateSetHeader:fQ,deflate:hQ,deflateEnd:dQ,deflateSetDictionary:pQ,deflateInfo:gQ};const mQ=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var bQ=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)mQ(n,r)&&(e[r]=n[r])}}return e},yQ=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,a=e.length;r<a;r++){let o=e[r];n.set(o,i),i+=o.length}return n},_0={assign:bQ,flattenChunks:yQ};let L5=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{L5=!1}const Vu=new Uint8Array(256);for(let e=0;e<256;e++)Vu[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Vu[254]=Vu[254]=1;var vQ=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};const wQ=(e,t)=>{if(t<65534&&e.subarray&&L5)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var xQ=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const a=new Array(n*2);for(i=0,r=0;r<n;){let o=e[r++];if(o<128){a[i++]=o;continue}let s=Vu[o];if(s>4){a[i++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<n;)o=o<<6|e[r++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return wQ(a,i)},AQ=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Vu[e[n]]>t?n:t},ju={string2buf:vQ,buf2string:xQ,utf8border:AQ};function EQ(){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}var N5=EQ;const z5=Object.prototype.toString,{Z_NO_FLUSH:SQ,Z_SYNC_FLUSH:_Q,Z_FULL_FLUSH:CQ,Z_FINISH:kQ,Z_OK:C0,Z_STREAM_END:TQ,Z_DEFAULT_COMPRESSION:IQ,Z_DEFAULT_STRATEGY:RQ,Z_DEFLATED:DQ}=Nu;function Ny(e){this.options=_0.assign({level:IQ,method:DQ,chunkSize:16384,windowBits:15,memLevel:8,strategy:RQ},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new N5,this.strm.avail_out=0;let n=Gu.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==C0)throw new Error(Vs[n]);if(t.header&&Gu.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=ju.string2buf(t.dictionary):z5.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Gu.deflateSetDictionary(this.strm,r),n!==C0)throw new Error(Vs[n]);this._dict_set=!0}}Ny.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,a;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?kQ:SQ,typeof e=="string"?n.input=ju.string2buf(e):z5.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===_Q||a===CQ)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Gu.deflate(n,a),i===TQ)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Gu.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===C0;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Ny.prototype.onData=function(e){this.chunks.push(e)},Ny.prototype.onEnd=function(e){e===C0&&(this.result=_0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const k0=16209,BQ=16191;var FQ=function(t,n){let r,i,a,o,s,c,l,u,f,h,d,p,g,b,v,x,A,w,_,C,I,D,B,G;const z=t.state;r=t.next_in,B=t.input,i=r+(t.avail_in-5),a=t.next_out,G=t.output,o=a-(n-t.avail_out),s=a+(t.avail_out-257),c=z.dmax,l=z.wsize,u=z.whave,f=z.wnext,h=z.window,d=z.hold,p=z.bits,g=z.lencode,b=z.distcode,v=(1<<z.lenbits)-1,x=(1<<z.distbits)-1;e:do{p<15&&(d+=B[r++]<<p,p+=8,d+=B[r++]<<p,p+=8),A=g[d&v];t:for(;;){if(w=A>>>24,d>>>=w,p-=w,w=A>>>16&255,w===0)G[a++]=A&65535;else if(w&16){_=A&65535,w&=15,w&&(p<w&&(d+=B[r++]<<p,p+=8),_+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=B[r++]<<p,p+=8,d+=B[r++]<<p,p+=8),A=b[d&x];n:for(;;){if(w=A>>>24,d>>>=w,p-=w,w=A>>>16&255,w&16){if(C=A&65535,w&=15,p<w&&(d+=B[r++]<<p,p+=8,p<w&&(d+=B[r++]<<p,p+=8)),C+=d&(1<<w)-1,C>c){t.msg="invalid distance too far back",z.mode=k0;break e}if(d>>>=w,p-=w,w=a-o,C>w){if(w=C-w,w>u&&z.sane){t.msg="invalid distance too far back",z.mode=k0;break e}if(I=0,D=h,f===0){if(I+=l-w,w<_){_-=w;do G[a++]=h[I++];while(--w);I=a-C,D=G}}else if(f<w){if(I+=l+f-w,w-=f,w<_){_-=w;do G[a++]=h[I++];while(--w);if(I=0,f<_){w=f,_-=w;do G[a++]=h[I++];while(--w);I=a-C,D=G}}}else if(I+=f-w,w<_){_-=w;do G[a++]=h[I++];while(--w);I=a-C,D=G}for(;_>2;)G[a++]=D[I++],G[a++]=D[I++],G[a++]=D[I++],_-=3;_&&(G[a++]=D[I++],_>1&&(G[a++]=D[I++]))}else{I=a-C;do G[a++]=G[I++],G[a++]=G[I++],G[a++]=G[I++],_-=3;while(_>2);_&&(G[a++]=G[I++],_>1&&(G[a++]=G[I++]))}}else if(w&64){t.msg="invalid distance code",z.mode=k0;break e}else{A=b[(A&65535)+(d&(1<<w)-1)];continue n}break}}else if(w&64)if(w&32){z.mode=BQ;break e}else{t.msg="invalid literal/length code",z.mode=k0;break e}else{A=g[(A&65535)+(d&(1<<w)-1)];continue t}break}}while(r<i&&a<s);_=p>>3,r-=_,p-=_<<3,d&=(1<<p)-1,t.next_in=r,t.next_out=a,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=a<s?257+(s-a):257-(a-s),z.hold=d,z.bits=p};const Qs=15,U5=852,$5=592,H5=0,zy=1,G5=2,PQ=new Uint16Array([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]),MQ=new Uint8Array([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]),OQ=new Uint16Array([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]),LQ=new Uint8Array([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]);var qu=(e,t,n,r,i,a,o,s)=>{const c=s.bits;let l=0,u=0,f=0,h=0,d=0,p=0,g=0,b=0,v=0,x=0,A,w,_,C,I,D=null,B;const G=new Uint16Array(Qs+1),z=new Uint16Array(Qs+1);let ae=null,se,ve,Pe;for(l=0;l<=Qs;l++)G[l]=0;for(u=0;u<r;u++)G[t[n+u]]++;for(d=c,h=Qs;h>=1&&G[h]===0;h--);if(d>h&&(d=h),h===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f<h&&G[f]===0;f++);for(d<f&&(d=f),b=1,l=1;l<=Qs;l++)if(b<<=1,b-=G[l],b<0)return-1;if(b>0&&(e===H5||h!==1))return-1;for(z[1]=0,l=1;l<Qs;l++)z[l+1]=z[l]+G[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[z[t[n+u]]++]=u);if(e===H5?(D=ae=o,B=20):e===zy?(D=PQ,ae=MQ,B=257):(D=OQ,ae=LQ,B=0),x=0,u=0,l=f,I=a,p=d,g=0,_=-1,v=1<<d,C=v-1,e===zy&&v>U5||e===G5&&v>$5)return 1;for(;;){se=l-g,o[u]+1<B?(ve=0,Pe=o[u]):o[u]>=B?(ve=ae[o[u]-B],Pe=D[o[u]-B]):(ve=32+64,Pe=0),A=1<<l-g,w=1<<p,f=w;do w-=A,i[I+(x>>g)+w]=se<<24|ve<<16|Pe|0;while(w!==0);for(A=1<<l-1;x&A;)A>>=1;if(A!==0?(x&=A-1,x+=A):x=0,u++,--G[l]===0){if(l===h)break;l=t[n+o[u]]}if(l>d&&(x&C)!==_){for(g===0&&(g=d),I+=f,p=l-g,b=1<<p;p+g<h&&(b-=G[p+g],!(b<=0));)p++,b<<=1;if(v+=1<<p,e===zy&&v>U5||e===G5&&v>$5)return 1;_=x&C,i[_]=d<<24|p<<16|I-a|0}}return x!==0&&(i[I+x]=l-g<<24|64<<16|0),s.bits=d,0};const NQ=0,V5=1,j5=2,{Z_FINISH:q5,Z_BLOCK:zQ,Z_TREES:T0,Z_OK:Bo,Z_STREAM_END:UQ,Z_NEED_DICT:$Q,Z_STREAM_ERROR:Fn,Z_DATA_ERROR:W5,Z_MEM_ERROR:Y5,Z_BUF_ERROR:HQ,Z_DEFLATED:Z5}=Nu,I0=16180,Q5=16181,X5=16182,K5=16183,J5=16184,e8=16185,t8=16186,n8=16187,r8=16188,i8=16189,R0=16190,ni=16191,Uy=16192,a8=16193,$y=16194,o8=16195,s8=16196,c8=16197,l8=16198,D0=16199,B0=16200,u8=16201,f8=16202,h8=16203,d8=16204,p8=16205,Hy=16206,g8=16207,m8=16208,Je=16209,b8=16210,y8=16211,GQ=852,VQ=592,jQ=15,v8=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function qQ(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Fo=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<I0||t.mode>y8?1:0},w8=e=>{if(Fo(e))return Fn;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=I0,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(GQ),t.distcode=t.distdyn=new Int32Array(VQ),t.sane=1,t.back=-1,Bo},x8=e=>{if(Fo(e))return Fn;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,w8(e)},A8=(e,t)=>{let n;if(Fo(e))return Fn;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Fn:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,x8(e))},E8=(e,t)=>{if(!e)return Fn;const n=new qQ;e.state=n,n.strm=e,n.window=null,n.mode=I0;const r=A8(e,t);return r!==Bo&&(e.state=null),r},WQ=e=>E8(e,jQ);let S8=!0,Gy,Vy;const YQ=e=>{if(S8){Gy=new Int32Array(512),Vy=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(qu(V5,e.lens,0,288,Gy,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;qu(j5,e.lens,0,32,Vy,0,e.work,{bits:5}),S8=!1}e.lencode=Gy,e.lenbits=9,e.distcode=Vy,e.distbits=5},_8=(e,t,n,r)=>{let i;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},ZQ=(e,t)=>{let n,r,i,a,o,s,c,l,u,f,h,d,p,g,b=0,v,x,A,w,_,C,I,D;const B=new Uint8Array(4);let G,z;const ae=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Fo(e)||!e.output||!e.input&&e.avail_in!==0)return Fn;n=e.state,n.mode===ni&&(n.mode=Uy),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,f=s,h=c,D=Bo;e:for(;;)switch(n.mode){case I0:if(n.wrap===0){n.mode=Uy;break}for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,B[0]=l&255,B[1]=l>>>8&255,n.check=Tt(n.check,B,2,0),l=0,u=0,n.mode=Q5;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Je;break}if((l&15)!==Z5){e.msg="unknown compression method",n.mode=Je;break}if(l>>>=4,u-=4,I=(l&15)+8,n.wbits===0&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=Je;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?i8:ni,l=0,u=0;break;case Q5:for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==Z5){e.msg="unknown compression method",n.mode=Je;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Je;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Tt(n.check,B,2,0)),l=0,u=0,n.mode=X5;case X5:for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(B[0]=l&255,B[1]=l>>>8&255,B[2]=l>>>16&255,B[3]=l>>>24&255,n.check=Tt(n.check,B,4,0)),l=0,u=0,n.mode=K5;case K5:for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Tt(n.check,B,2,0)),l=0,u=0,n.mode=J5;case J5:if(n.flags&1024){for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Tt(n.check,B,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=e8;case e8:if(n.flags&1024&&(d=n.length,d>s&&(d=s),d&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+d),I)),n.flags&512&&n.wrap&4&&(n.check=Tt(n.check,r,d,a)),s-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=t8;case t8:if(n.flags&2048){if(s===0)break e;d=0;do I=r[a+d++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I));while(I&&d<s);if(n.flags&512&&n.wrap&4&&(n.check=Tt(n.check,r,d,a)),s-=d,a+=d,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=n8;case n8:if(n.flags&4096){if(s===0)break e;d=0;do I=r[a+d++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I));while(I&&d<s);if(n.flags&512&&n.wrap&4&&(n.check=Tt(n.check,r,d,a)),s-=d,a+=d,I)break e}else n.head&&(n.head.comment=null);n.mode=r8;case r8:if(n.flags&512){for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Je;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ni;break;case i8:for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=v8(l),l=0,u=0,n.mode=R0;case R0:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,$Q;e.adler=n.check=1,n.mode=ni;case ni:if(t===zQ||t===T0)break e;case Uy:if(n.last){l>>>=u&7,u-=u&7,n.mode=Hy;break}for(;u<3;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,u-=1,l&3){case 0:n.mode=a8;break;case 1:if(YQ(n),n.mode=D0,t===T0){l>>>=2,u-=2;break e}break;case 2:n.mode=s8;break;case 3:e.msg="invalid block type",n.mode=Je}l>>>=2,u-=2;break;case a8:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Je;break}if(n.length=l&65535,l=0,u=0,n.mode=$y,t===T0)break e;case $y:n.mode=o8;case o8:if(d=n.length,d){if(d>s&&(d=s),d>c&&(d=c),d===0)break e;i.set(r.subarray(a,a+d),o),s-=d,a+=d,c-=d,o+=d,n.length-=d;break}n.mode=ni;break;case s8:for(;u<14;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Je;break}n.have=0,n.mode=c8;case c8:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.lens[ae[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[ae[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,G={bits:n.lenbits},D=qu(NQ,n.lens,0,19,n.lencode,0,n.work,G),n.lenbits=G.bits,D){e.msg="invalid code lengths set",n.mode=Je;break}n.have=0,n.mode=l8;case l8:for(;n.have<n.nlen+n.ndist;){for(;b=n.lencode[l&(1<<n.lenbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(A<16)l>>>=v,u-=v,n.lens[n.have++]=A;else{if(A===16){for(z=v+2;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(l>>>=v,u-=v,n.have===0){e.msg="invalid bit length repeat",n.mode=Je;break}I=n.lens[n.have-1],d=3+(l&3),l>>>=2,u-=2}else if(A===17){for(z=v+3;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=v,u-=v,I=0,d=3+(l&7),l>>>=3,u-=3}else{for(z=v+7;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=v,u-=v,I=0,d=11+(l&127),l>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Je;break}for(;d--;)n.lens[n.have++]=I}}if(n.mode===Je)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Je;break}if(n.lenbits=9,G={bits:n.lenbits},D=qu(V5,n.lens,0,n.nlen,n.lencode,0,n.work,G),n.lenbits=G.bits,D){e.msg="invalid literal/lengths set",n.mode=Je;break}if(n.distbits=6,n.distcode=n.distdyn,G={bits:n.distbits},D=qu(j5,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,G),n.distbits=G.bits,D){e.msg="invalid distances set",n.mode=Je;break}if(n.mode=D0,t===T0)break e;case D0:n.mode=B0;case B0:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,FQ(e,h),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===ni&&(n.back=-1);break}for(n.back=0;b=n.lencode[l&(1<<n.lenbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(x&&!(x&240)){for(w=v,_=x,C=A;b=n.lencode[C+((l&(1<<w+_)-1)>>w)],v=b>>>24,x=b>>>16&255,A=b&65535,!(w+v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=v,u-=v,n.back+=v,n.length=A,x===0){n.mode=p8;break}if(x&32){n.back=-1,n.mode=ni;break}if(x&64){e.msg="invalid literal/length code",n.mode=Je;break}n.extra=x&15,n.mode=u8;case u8:if(n.extra){for(z=n.extra;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=f8;case f8:for(;b=n.distcode[l&(1<<n.distbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(!(x&240)){for(w=v,_=x,C=A;b=n.distcode[C+((l&(1<<w+_)-1)>>w)],v=b>>>24,x=b>>>16&255,A=b&65535,!(w+v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=v,u-=v,n.back+=v,x&64){e.msg="invalid distance code",n.mode=Je;break}n.offset=A,n.extra=x&15,n.mode=h8;case h8:if(n.extra){for(z=n.extra;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Je;break}n.mode=d8;case d8:if(c===0)break e;if(d=h-c,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Je;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=o-n.offset,d=n.length;d>c&&(d=c),c-=d,n.length-=d;do i[o++]=g[p++];while(--d);n.length===0&&(n.mode=B0);break;case p8:if(c===0)break e;i[o++]=n.length,c--,n.mode=B0;break;case Hy:if(n.wrap){for(;u<32;){if(s===0)break e;s--,l|=r[a++]<<u,u+=8}if(h-=c,e.total_out+=h,n.total+=h,n.wrap&4&&h&&(e.adler=n.check=n.flags?Tt(n.check,i,h,o-h):Lu(n.check,i,h,o-h)),h=c,n.wrap&4&&(n.flags?l:v8(l))!==n.check){e.msg="incorrect data check",n.mode=Je;break}l=0,u=0}n.mode=g8;case g8:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Je;break}l=0,u=0}n.mode=m8;case m8:D=UQ;break e;case Je:D=W5;break e;case b8:return Y5;case y8:default:return Fn}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||h!==e.avail_out&&n.mode<Je&&(n.mode<Hy||t!==q5))&&_8(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,n.total+=h,n.wrap&4&&h&&(e.adler=n.check=n.flags?Tt(n.check,i,h,e.next_out-h):Lu(n.check,i,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ni?128:0)+(n.mode===D0||n.mode===$y?256:0),(f===0&&h===0||t===q5)&&D===Bo&&(D=HQ),D},QQ=e=>{if(Fo(e))return Fn;let t=e.state;return t.window&&(t.window=null),e.state=null,Bo},XQ=(e,t)=>{if(Fo(e))return Fn;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Bo):Fn},KQ=(e,t)=>{const n=t.length;let r,i,a;return Fo(e)||(r=e.state,r.wrap!==0&&r.mode!==R0)?Fn:r.mode===R0&&(i=1,i=Lu(i,t,n,0),i!==r.check)?W5:(a=_8(e,t,n,n),a?(r.mode=b8,Y5):(r.havedict=1,Bo))};var JQ=x8,eX=A8,tX=w8,nX=WQ,rX=E8,iX=ZQ,aX=QQ,oX=XQ,sX=KQ,cX="pako inflate (from Nodeca project)",ri={inflateReset:JQ,inflateReset2:eX,inflateResetKeep:tX,inflateInit:nX,inflateInit2:rX,inflate:iX,inflateEnd:aX,inflateGetHeader:oX,inflateSetDictionary:sX,inflateInfo:cX};function lX(){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}var uX=lX;const C8=Object.prototype.toString,{Z_NO_FLUSH:fX,Z_FINISH:hX,Z_OK:Wu,Z_STREAM_END:jy,Z_NEED_DICT:qy,Z_STREAM_ERROR:dX,Z_DATA_ERROR:k8,Z_MEM_ERROR:pX}=Nu;function Yu(e){this.options=_0.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new N5,this.strm.avail_out=0;let n=ri.inflateInit2(this.strm,t.windowBits);if(n!==Wu)throw new Error(Vs[n]);if(this.header=new uX,ri.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=ju.string2buf(t.dictionary):C8.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=ri.inflateSetDictionary(this.strm,t.dictionary),n!==Wu)))throw new Error(Vs[n])}Yu.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?hX:fX,C8.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=ri.inflate(n,o),a===qy&&i&&(a=ri.inflateSetDictionary(n,i),a===Wu?a=ri.inflate(n,o):a===k8&&(a=qy));n.avail_in>0&&a===jy&&n.state.wrap>0&&e[n.next_in]!==0;)ri.inflateReset(n),a=ri.inflate(n,o);switch(a){case dX:case k8:case qy:case pX:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===jy))if(this.options.to==="string"){let c=ju.utf8border(n.output,n.next_out),l=n.next_out-c,u=ju.buf2string(n.output,c);n.next_out=l,n.avail_out=r-l,l&&n.output.set(n.output.subarray(c,c+l),0),this.onData(u)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Wu&&s===0)){if(a===jy)return a=ri.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},Yu.prototype.onData=function(e){this.chunks.push(e)},Yu.prototype.onEnd=function(e){e===Wu&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=_0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Wy(e,t){const n=new Yu(t);if(n.push(e),n.err)throw n.msg||Vs[n.err];return n.result}function gX(e,t){return t=t||{},t.raw=!0,Wy(e,t)}var mX=Yu,bX=Wy,yX=gX,vX=Wy,wX=Nu,xX={Inflate:mX,inflate:bX,inflateRaw:yX,ungzip:vX,constants:wX};const{Inflate:Iee,inflate:Ree,inflateRaw:AX,ungzip:Dee}=xX;var EX=AX;function SX(e){return EX(e.subarray(2))}let _X=class extends Error{constructor(t){super(t),this.code="ERR_ABORTED"}};function CX(e){e.sort((i,a)=>Number(i.offset)-Number(a.offset));const t=[];let n,r;for(const i of e)n&&r&&Number(i.offset)-r<=2e3?(n.length=BigInt(Number(n.length)+Number(i.length)-r+Number(i.offset)),n.blocks.push(i)):t.push(n={blocks:[i],length:i.length,offset:i.offset}),r=Number(n.offset)+Number(n.length);return t}function F0(e){if(e&&e.aborted)if(typeof DOMException>"u"){const t=new _X("aborted");throw t.code="ERR_ABORTED",t}else throw new DOMException("aborted","AbortError")}const kX=1,TX=2,IX=3;function Yy(e,t,n,r){return e<r&&t>=n}function RX(e){const t=e?"big":"little",n=new Fe().endianess(t).uint32("chromId").uint32("start").uint32("end").uint32("validCnt").floatle("minScore").floatle("maxScore").floatle("sumData").floatle("sumSqData").saveOffset("offset"),r=new Fe().endianess(t).uint8("isLeaf").skip(1).uint16("cnt").choice({tag:"isLeaf",choices:{1:new Fe().endianess(t).array("blocksToFetch",{length:"cnt",type:new Fe().endianess(t).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").uint64("blockSize").saveOffset("offset")}),0:new Fe().array("recurOffsets",{length:"cnt",type:new Fe().endianess(t).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").saveOffset("offset")})}}),i=new Fe().endianess(t).uint32("chromId").int32("start").int32("end").string("rest",{zeroTerminated:!0}).saveOffset("offset");return{bigWigParser:new Fe().endianess(t).skip(4).int32("blockStart").skip(4).uint32("itemStep").uint32("itemSpan").uint8("blockType").skip(1).uint16("itemCount").choice({tag:"blockType",choices:{[IX]:new Fe().array("items",{length:"itemCount",type:new Fe().floatle("score")}),[TX]:new Fe().array("items",{length:"itemCount",type:new Fe().endianess(t).int32("start").floatle("score")}),[kX]:new Fe().array("items",{length:"itemCount",type:new Fe().endianess(t).int32("start").int32("end").floatle("score")})}}),bigBedParser:i,summaryParser:n,leafParser:r}}class T8{constructor(t,n,r,i,a,o){if(this.bbi=t,this.refsByName=n,this.cirTreeOffset=r,this.isBigEndian=i,this.isCompressed=a,this.blockType=o,this.featureCache=new v0({cache:new w0({maxSize:1e3}),fill:async(c,l)=>{const u=Number(c.length),f=Number(c.offset),{buffer:h}=await this.bbi.read(we.Buffer.alloc(u),0,u,f,{signal:l});return h}}),!(r>=0))throw new Error("invalid cirTreeOffset!");const s=RX(i);this.leafParser=s.leafParser,this.bigBedParser=s.bigBedParser}async readWigData(t,n,r,i,a){try{const{refsByName:o,bbi:s,cirTreeOffset:c,isBigEndian:l}=this,u=o[t];u===void 0&&i.complete();const f={chrId:u,start:n,end:r};this.cirTreePromise||(this.cirTreePromise=s.read(we.Buffer.alloc(48),0,48,Number(c),a));const{buffer:h}=await this.cirTreePromise,d=l?h.readUInt32BE(4):h.readUInt32LE(4);let p=[],g=0;const b=(w,_,C)=>{try{const I=w.subarray(_),D=this.leafParser.parse(I);if(D.blocksToFetch&&(p=p.concat(D.blocksToFetch.filter(B=>v(B)).map(B=>({offset:B.blockOffset,length:B.blockSize})))),D.recurOffsets){const B=D.recurOffsets.filter(G=>v(G)).map(G=>Number(G.blockOffset));B.length>0&&A(B,C+1)}}catch(I){i.error(I)}},v=w=>{const{startChrom:_,startBase:C,endChrom:I,endBase:D}=w;return(_<u||_===u&&C<=r)&&(I>u||I===u&&D>=n)},x=async(w,_,C)=>{try{const I=_.max()-_.min(),D=_.min(),B=await this.featureCache.get(`${I}_${D}`,{length:I,offset:D},a==null?void 0:a.signal);for(const G of w)_.contains(G)&&(b(B,G-D,C),g-=1,g===0&&this.readFeatures(i,p,{...a,request:f}))}catch(I){i.error(I)}},A=(w,_)=>{try{g+=w.length;const C=4+Number(d)*32;let I=new ea(w[0],w[0]+C);for(let D=1;D<w.length;D+=1){const B=new ea(w[D],w[D]+C);I=I.union(B)}I.getRanges().map(D=>x(w,D,_))}catch(C){i.error(C)}};return A([Number(c)+48],1)}catch(o){i.error(o)}}parseSummaryBlock(t,n,r){const i=[];let a=n;const o=new DataView(t.buffer,t.byteOffset,t.length);for(;a<t.byteLength;){const s=o.getUint32(a,!0);a+=4;const c=o.getUint32(a,!0);a+=4;const l=o.getUint32(a,!0);a+=4;const u=o.getUint32(a,!0);a+=4;const f=o.getFloat32(a,!0);a+=4;const h=o.getFloat32(a,!0);a+=4;const d=o.getFloat32(a,!0);a+=4,a+=4,(!r||s===r.chrId&&Yy(c,l,r.start,r.end))&&i.push({start:c,end:l,maxScore:h,minScore:f,summary:!0,score:d/(u||1)})}return i}parseBigBedBlock(t,n,r,i){const a=[];let o=n;for(;o<t.byteLength;){const s=this.bigBedParser.parse(t.subarray(o));a.push({...s,uniqueId:`bb-${r+o}`}),o+=s.offset}return i?a.filter(s=>Yy(s.start,s.end,i.start,i.end)):a}parseBigWigBlock(t,n,r){const i=t.subarray(n),a=new DataView(i.buffer,i.byteOffset,i.length);let o=0;o+=4;const s=a.getInt32(o,!0);o+=8;const c=a.getUint32(o,!0);o+=4;const l=a.getUint32(o,!0);o+=4;const u=a.getUint8(o);o+=2;const f=a.getUint16(o,!0);o+=2;const h=new Array(f);switch(u){case 1:{for(let d=0;d<f;d++){const p=a.getInt32(o,!0);o+=4;const g=a.getInt32(o,!0);o+=4;const b=a.getFloat32(o,!0);o+=4,h[d]={start:p,end:g,score:b}}break}case 2:{for(let d=0;d<f;d++){const p=a.getInt32(o,!0);o+=4;const g=a.getFloat32(o,!0);o+=4,h[d]={score:g,start:p,end:p+l}}break}case 3:{for(let d=0;d<f;d++){const p=a.getFloat32(o,!0);o+=4;const g=s+d*c;h[d]={score:p,start:g,end:g+l}}break}}return r?h.filter(d=>Yy(d.start,d.end,r.start,r.end)):h}async readFeatures(t,n,r={}){try{const{blockType:i,isCompressed:a}=this,{signal:o,request:s}=r,c=CX(n);F0(o),await Promise.all(c.map(async l=>{F0(o);const{length:u,offset:f}=l,h=await this.featureCache.get(`${u}_${f}`,l,o);for(const d of l.blocks){F0(o);let p=Number(d.offset)-Number(l.offset),g=h;switch(a&&(g=SX(h.subarray(p)),p=0),F0(o),i){case"summary":{t.next(this.parseSummaryBlock(g,p,s));break}case"bigwig":{t.next(this.parseBigWigBlock(g,p,s));break}case"bigbed":{t.next(this.parseBigBedBlock(g,p,Number(d.offset)*256,s));break}default:console.warn(`Don't know what to do with ${i}`)}}})),t.complete()}catch(i){t.error(i)}}}var Zy=function(e,t){return Zy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Zy(e,t)};function Qy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Zy(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function DX(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(e,t||[])).next())})}function I8(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Zu(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xy(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Ky(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Xs(e){return this instanceof Xs?(this.v=e,this):new Xs(e)}function BX(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){r[h]&&(i[h]=function(d){return new Promise(function(p,g){a.push([h,d,p,g])>1||s(h,d)})})}function s(h,d){try{c(r[h](d))}catch(p){f(a[0][3],p)}}function c(h){h.value instanceof Xs?Promise.resolve(h.value.v).then(l,u):f(a[0][2],h)}function l(h){s("next",h)}function u(h){s("throw",h)}function f(h,d){h(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}function FX(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Zu=="function"?Zu(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(s,c){o=e[a](o),i(s,c,o.done,o.value)})}}function i(a,o,s,c){Promise.resolve(c).then(function(l){a({value:l,done:s})},o)}}typeof SuppressedError=="function"&&SuppressedError;function vt(e){return typeof e=="function"}function R8(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Jy=R8(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
|
3202
|
+
`}pushPath(t){t&&this.scopes[this.scopes.length-1].push(t)}popPath(t){t&&this.scopes[this.scopes.length-1].pop()}pushScope(t){this.scopes.push([t])}popScope(){this.scopes.pop()}addImport(t){if(!this.importPath)return`(${t})`;let n=this.reverseImports.get(t);return n||(n=this.imports.push(t)-1,this.reverseImports.set(t,n)),`${this.importPath}[${n}]`}addReference(t){this.references.has(t)||this.references.set(t,{resolved:!1,requested:!1})}markResolved(t){const n=this.references.get(t);n&&(n.resolved=!0)}markRequested(t){t.forEach(n=>{const r=this.references.get(n);r&&(r.requested=!0)})}getUnresolvedReferences(){return Array.from(this.references).filter(([t,n])=>!n.resolved&&!n.requested).map(([t,n])=>t)}}const tr=new Map,Co="___parser_",nr={uint8:1,uint16le:2,uint16be:2,uint32le:4,uint32be:4,int8:1,int16le:2,int16be:2,int32le:4,int32be:4,int64be:8,int64le:8,uint64be:8,uint64le:8,floatle:4,floatbe:4,doublele:8,doublebe:8},p0={uint8:"Uint8",uint16le:"Uint16",uint16be:"Uint16",uint32le:"Uint32",uint32be:"Uint32",int8:"Int8",int16le:"Int16",int16be:"Int16",int32le:"Int32",int32be:"Int32",int64be:"BigInt64",int64le:"BigInt64",uint64be:"BigUint64",uint64le:"BigUint64",floatle:"Float32",floatbe:"Float32",doublele:"Float64",doublebe:"Float64"},g0={uint8:!1,uint16le:!0,uint16be:!1,uint32le:!0,uint32be:!1,int8:!1,int16le:!0,int16be:!1,int32le:!0,int32be:!1,int64be:!1,int64le:!0,uint64be:!1,uint64le:!0,floatle:!0,floatbe:!1,doublele:!0,doublebe:!1};let Fe=class or{constructor(){this.varName="",this.type="",this.options={},this.endian="be",this.useContextVariables=!1}static start(){return new or}primitiveGenerateN(t,n){const r=p0[t],i=g0[t];n.pushCode(`${n.generateVariable(this.varName)} = dataView.get${r}(offset, ${i});`),n.pushCode(`offset += ${nr[t]};`)}primitiveN(t,n,r){return this.setNextParser(t,n,r)}useThisEndian(t){return t+this.endian.toLowerCase()}uint8(t,n={}){return this.primitiveN("uint8",t,n)}uint16(t,n={}){return this.primitiveN(this.useThisEndian("uint16"),t,n)}uint16le(t,n={}){return this.primitiveN("uint16le",t,n)}uint16be(t,n={}){return this.primitiveN("uint16be",t,n)}uint32(t,n={}){return this.primitiveN(this.useThisEndian("uint32"),t,n)}uint32le(t,n={}){return this.primitiveN("uint32le",t,n)}uint32be(t,n={}){return this.primitiveN("uint32be",t,n)}int8(t,n={}){return this.primitiveN("int8",t,n)}int16(t,n={}){return this.primitiveN(this.useThisEndian("int16"),t,n)}int16le(t,n={}){return this.primitiveN("int16le",t,n)}int16be(t,n={}){return this.primitiveN("int16be",t,n)}int32(t,n={}){return this.primitiveN(this.useThisEndian("int32"),t,n)}int32le(t,n={}){return this.primitiveN("int32le",t,n)}int32be(t,n={}){return this.primitiveN("int32be",t,n)}bigIntVersionCheck(){if(!DataView.prototype.getBigInt64)throw new Error("BigInt64 is unsupported on this runtime")}int64(t,n={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("int64"),t,n)}int64be(t,n={}){return this.bigIntVersionCheck(),this.primitiveN("int64be",t,n)}int64le(t,n={}){return this.bigIntVersionCheck(),this.primitiveN("int64le",t,n)}uint64(t,n={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("uint64"),t,n)}uint64be(t,n={}){return this.bigIntVersionCheck(),this.primitiveN("uint64be",t,n)}uint64le(t,n={}){return this.bigIntVersionCheck(),this.primitiveN("uint64le",t,n)}floatle(t,n={}){return this.primitiveN("floatle",t,n)}floatbe(t,n={}){return this.primitiveN("floatbe",t,n)}doublele(t,n={}){return this.primitiveN("doublele",t,n)}doublebe(t,n={}){return this.primitiveN("doublebe",t,n)}bitN(t,n,r){return r.length=t,this.setNextParser("bit",n,r)}bit1(t,n={}){return this.bitN(1,t,n)}bit2(t,n={}){return this.bitN(2,t,n)}bit3(t,n={}){return this.bitN(3,t,n)}bit4(t,n={}){return this.bitN(4,t,n)}bit5(t,n={}){return this.bitN(5,t,n)}bit6(t,n={}){return this.bitN(6,t,n)}bit7(t,n={}){return this.bitN(7,t,n)}bit8(t,n={}){return this.bitN(8,t,n)}bit9(t,n={}){return this.bitN(9,t,n)}bit10(t,n={}){return this.bitN(10,t,n)}bit11(t,n={}){return this.bitN(11,t,n)}bit12(t,n={}){return this.bitN(12,t,n)}bit13(t,n={}){return this.bitN(13,t,n)}bit14(t,n={}){return this.bitN(14,t,n)}bit15(t,n={}){return this.bitN(15,t,n)}bit16(t,n={}){return this.bitN(16,t,n)}bit17(t,n={}){return this.bitN(17,t,n)}bit18(t,n={}){return this.bitN(18,t,n)}bit19(t,n={}){return this.bitN(19,t,n)}bit20(t,n={}){return this.bitN(20,t,n)}bit21(t,n={}){return this.bitN(21,t,n)}bit22(t,n={}){return this.bitN(22,t,n)}bit23(t,n={}){return this.bitN(23,t,n)}bit24(t,n={}){return this.bitN(24,t,n)}bit25(t,n={}){return this.bitN(25,t,n)}bit26(t,n={}){return this.bitN(26,t,n)}bit27(t,n={}){return this.bitN(27,t,n)}bit28(t,n={}){return this.bitN(28,t,n)}bit29(t,n={}){return this.bitN(29,t,n)}bit30(t,n={}){return this.bitN(30,t,n)}bit31(t,n={}){return this.bitN(31,t,n)}bit32(t,n={}){return this.bitN(32,t,n)}namely(t){return tr.set(t,this),this.alias=t,this}skip(t,n={}){return this.seek(t,n)}seek(t,n={}){if(n.assert)throw new Error("assert option on seek is not allowed.");return this.setNextParser("seek","",{length:t})}string(t,n){if(!n.zeroTerminated&&!n.length&&!n.greedy)throw new Error("One of length, zeroTerminated, or greedy must be defined for string.");if((n.zeroTerminated||n.length)&&n.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(n.stripNull&&!(n.length||n.greedy))throw new Error("length or greedy must be defined if stripNull is enabled.");return n.encoding=n.encoding||"utf8",this.setNextParser("string",t,n)}buffer(t,n){if(!n.length&&!n.readUntil)throw new Error("length or readUntil must be defined for buffer.");return this.setNextParser("buffer",t,n)}wrapped(t,n){if(typeof n!="object"&&typeof t=="object"&&(n=t,t=""),!n||!n.wrapper||!n.type)throw new Error("Both wrapper and type must be defined for wrapped.");if(!n.length&&!n.readUntil)throw new Error("length or readUntil must be defined for wrapped.");return this.setNextParser("wrapper",t,n)}array(t,n){if(!n.readUntil&&!n.length&&!n.lengthInBytes)throw new Error("One of readUntil, length and lengthInBytes must be defined for array.");if(!n.type)throw new Error("type is required for array.");if(typeof n.type=="string"&&!tr.has(n.type)&&!(n.type in nr))throw new Error(`Array element type "${n.type}" is unkown.`);return this.setNextParser("array",t,n)}choice(t,n){if(typeof n!="object"&&typeof t=="object"&&(n=t,t=""),!n)throw new Error("tag and choices are are required for choice.");if(!n.tag)throw new Error("tag is requird for choice.");if(!n.choices)throw new Error("choices is required for choice.");for(const r in n.choices){const i=parseInt(r,10),a=n.choices[i];if(isNaN(i))throw new Error(`Choice key "${r}" is not a number.`);if(typeof a=="string"&&!tr.has(a)&&!(a in nr))throw new Error(`Choice type "${a}" is unkown.`)}return this.setNextParser("choice",t,n)}nest(t,n){if(typeof n!="object"&&typeof t=="object"&&(n=t,t=""),!n||!n.type)throw new Error("type is required for nest.");if(!(n.type instanceof or)&&!tr.has(n.type))throw new Error("type must be a known parser name or a Parser object.");if(!(n.type instanceof or)&&!t)throw new Error("type must be a Parser object if the variable name is omitted.");return this.setNextParser("nest",t,n)}pointer(t,n){if(!n.offset)throw new Error("offset is required for pointer.");if(!n.type)throw new Error("type is required for pointer.");if(typeof n.type=="string"&&!(n.type in nr)&&!tr.has(n.type))throw new Error(`Pointer type "${n.type}" is unkown.`);return this.setNextParser("pointer",t,n)}saveOffset(t,n={}){return this.setNextParser("saveOffset",t,n)}endianness(t){switch(t.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error('endianness must be one of "little" or "big"')}return this}endianess(t){return this.endianness(t)}useContextVars(t=!0){return this.useContextVariables=t,this}create(t){if(!(t instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=t,this}getContext(t){const n=new MY(t,this.useContextVariables);return n.pushCode("var dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.alias?(this.addAliasedCode(n),n.pushCode(`return ${Co+this.alias}(0).result;`)):this.addRawCode(n),n}getCode(){const t="imports";return this.getContext(t).code}addRawCode(t){t.pushCode("var offset = 0;"),t.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),t.pushCode("vars.$parent = null;"),t.pushCode("vars.$root = vars;"),this.generate(t),this.resolveReferences(t),t.pushCode("delete vars.$parent;"),t.pushCode("delete vars.$root;"),t.pushCode("return vars;")}addAliasedCode(t){return t.pushCode(`function ${Co+this.alias}(offset, context) {`),t.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),t.pushCode("var ctx = Object.assign({$parent: null, $root: vars}, context || {});"),t.pushCode("vars = Object.assign(vars, ctx);"),this.generate(t),t.markResolved(this.alias),this.resolveReferences(t),t.pushCode("Object.keys(ctx).forEach(function (item) { delete vars[item]; });"),t.pushCode("return { offset: offset, result: vars };"),t.pushCode("}"),t}resolveReferences(t){const n=t.getUnresolvedReferences();t.markRequested(n),n.forEach(r=>{var i;(i=tr.get(r))===null||i===void 0||i.addAliasedCode(t)})}compile(){const t="imports",n=this.getContext(t);this.compiled=new Function(t,"TextDecoder",`return function (buffer, constructorFn) { ${n.code} };`)(n.imports,TextDecoder)}sizeOf(){let t=NaN;if(Object.keys(nr).indexOf(this.type)>=0)t=nr[this.type];else if(this.type==="string"&&typeof this.options.length=="number")t=this.options.length;else if(this.type==="buffer"&&typeof this.options.length=="number")t=this.options.length;else if(this.type==="array"&&typeof this.options.length=="number"){let n=NaN;typeof this.options.type=="string"?n=nr[this.options.type]:this.options.type instanceof or&&(n=this.options.type.sizeOf()),t=this.options.length*n}else this.type==="seek"?t=this.options.length:this.type==="nest"?t=this.options.type.sizeOf():this.type||(t=0);return this.next&&(t+=this.next.sizeOf()),t}parse(t){return this.compiled||this.compile(),this.compiled(t,this.constructorFn)}setNextParser(t,n,r){const i=new or;return i.type=t,i.varName=n,i.options=r,i.endian=this.endian,this.head?this.head.next=i:this.next=i,this.head=i,this}generate(t){if(this.type){switch(this.type){case"uint8":case"uint16le":case"uint16be":case"uint32le":case"uint32be":case"int8":case"int16le":case"int16be":case"int32le":case"int32be":case"int64be":case"int64le":case"uint64be":case"uint64le":case"floatle":case"floatbe":case"doublele":case"doublebe":this.primitiveGenerateN(this.type,t);break;case"bit":this.generateBit(t);break;case"string":this.generateString(t);break;case"buffer":this.generateBuffer(t);break;case"seek":this.generateSeek(t);break;case"nest":this.generateNest(t);break;case"array":this.generateArray(t);break;case"choice":this.generateChoice(t);break;case"pointer":this.generatePointer(t);break;case"saveOffset":this.generateSaveOffset(t);break;case"wrapper":this.generateWrapper(t);break}this.type!=="bit"&&this.generateAssert(t)}const n=t.generateVariable(this.varName);return this.options.formatter&&this.type!=="bit"&&this.generateFormatter(t,n,this.options.formatter),this.generateNext(t)}generateAssert(t){if(!this.options.assert)return;const n=t.generateVariable(this.varName);switch(typeof this.options.assert){case"function":{const r=t.addImport(this.options.assert);t.pushCode(`if (!${r}.call(vars, ${n})) {`)}break;case"number":t.pushCode(`if (${this.options.assert} !== ${n}) {`);break;case"string":t.pushCode(`if (${JSON.stringify(this.options.assert)} !== ${n}) {`);break;default:throw new Error("assert option must be a string, number or a function.")}t.generateError(`"Assertion error: ${n} is " + ${JSON.stringify(this.options.assert.toString())}`),t.pushCode("}")}generateNext(t){return this.next&&(t=this.next.generate(t)),t}generateBit(t){const n=JSON.parse(JSON.stringify(this));if(n.options=this.options,n.generateAssert=this.generateAssert.bind(this),n.generateFormatter=this.generateFormatter.bind(this),n.varName=t.generateVariable(n.varName),t.bitFields.push(n),!this.next||this.next&&["bit","nest"].indexOf(this.next.type)<0){const r=t.generateTmpVariable();t.pushCode(`var ${r} = 0;`);const i=(u=0)=>{let f=0;for(let h=u;h<t.bitFields.length;h++){const d=t.bitFields[h].options.length;if(f+d>32)break;f+=d}return f},a=u=>(u<=8?(t.pushCode(`${r} = dataView.getUint8(offset);`),u=8):u<=16?(t.pushCode(`${r} = dataView.getUint16(offset);`),u=16):u<=24?(t.pushCode(`${r} = (dataView.getUint16(offset) << 8) | dataView.getUint8(offset + 2);`),u=24):(t.pushCode(`${r} = dataView.getUint32(offset);`),u=32),t.pushCode(`offset += ${u/8};`),u);let o=0;const s=this.endian==="be";let c=0,l=0;t.bitFields.forEach((u,f)=>{let h=u.options.length;if(h>l){if(l){const g=-1>>>32-l;t.pushCode(`${u.varName} = (${r} & 0x${g.toString(16)}) << ${h-l};`),h-=l}o=0,l=c=a(i(f)-l)}const d=s?c-o-h:o,p=-1>>>32-h;t.pushCode(`${u.varName} ${h<u.options.length?"|=":"="} ${r} >> ${d} & 0x${p.toString(16)};`),u.options.length===32&&t.pushCode(`${u.varName} >>>= 0`),u.options.assert&&u.generateAssert(t),u.options.formatter&&u.generateFormatter(t,u.varName,u.options.formatter),o+=h,l-=h}),t.bitFields=[]}}generateSeek(t){const n=t.generateOption(this.options.length);t.pushCode(`offset += ${n};`)}generateString(t){const n=t.generateVariable(this.varName),r=t.generateTmpVariable(),i=this.options.encoding,a=i.toLowerCase()==="hex",o='b => b.toString(16).padStart(2, "0")';if(this.options.length&&this.options.zeroTerminated){const s=this.options.length;t.pushCode(`var ${r} = offset;`),t.pushCode(`while(dataView.getUint8(offset++) !== 0 && offset - ${r} < ${s});`);const c=`offset - ${r} < ${s} ? offset - 1 : offset`;t.pushCode(a?`${n} = Array.from(buffer.subarray(${r}, ${c}), ${o}).join('');`:`${n} = new TextDecoder('${i}').decode(buffer.subarray(${r}, ${c}));`)}else if(this.options.length){const s=t.generateOption(this.options.length);t.pushCode(a?`${n} = Array.from(buffer.subarray(offset, offset + ${s}), ${o}).join('');`:`${n} = new TextDecoder('${i}').decode(buffer.subarray(offset, offset + ${s}));`),t.pushCode(`offset += ${s};`)}else this.options.zeroTerminated?(t.pushCode(`var ${r} = offset;`),t.pushCode("while(dataView.getUint8(offset++) !== 0);"),t.pushCode(a?`${n} = Array.from(buffer.subarray(${r}, offset - 1), ${o}).join('');`:`${n} = new TextDecoder('${i}').decode(buffer.subarray(${r}, offset - 1));`)):this.options.greedy&&(t.pushCode(`var ${r} = offset;`),t.pushCode("while(buffer.length > offset++);"),t.pushCode(a?`${n} = Array.from(buffer.subarray(${r}, offset), ${o}).join('');`:`${n} = new TextDecoder('${i}').decode(buffer.subarray(${r}, offset));`));this.options.stripNull&&t.pushCode(`${n} = ${n}.replace(/\\x00+$/g, '')`)}generateBuffer(t){const n=t.generateVariable(this.varName);if(typeof this.options.readUntil=="function"){const r=this.options.readUntil,i=t.generateTmpVariable(),a=t.generateTmpVariable();t.pushCode(`var ${i} = offset;`),t.pushCode(`var ${a} = 0;`),t.pushCode("while (offset < buffer.length) {"),t.pushCode(`${a} = dataView.getUint8(offset);`);const o=t.addImport(r);t.pushCode(`if (${o}.call(${t.generateVariable()}, ${a}, buffer.subarray(offset))) break;`),t.pushCode("offset += 1;"),t.pushCode("}"),t.pushCode(`${n} = buffer.subarray(${i}, offset);`)}else if(this.options.readUntil==="eof")t.pushCode(`${n} = buffer.subarray(offset);`);else{const r=t.generateOption(this.options.length);t.pushCode(`${n} = buffer.subarray(offset, offset + ${r});`),t.pushCode(`offset += ${r};`)}this.options.clone&&t.pushCode(`${n} = buffer.constructor.from(${n});`)}generateArray(t){const n=t.generateOption(this.options.length),r=t.generateOption(this.options.lengthInBytes),i=this.options.type,a=t.generateTmpVariable(),o=t.generateVariable(this.varName),s=t.generateTmpVariable(),c=this.options.key,l=typeof c=="string";if(l?t.pushCode(`${o} = {};`):t.pushCode(`${o} = [];`),typeof this.options.readUntil=="function"?t.pushCode("do {"):this.options.readUntil==="eof"?t.pushCode(`for (var ${a} = 0; offset < buffer.length; ${a}++) {`):r!==void 0?t.pushCode(`for (var ${a} = offset + ${r}; offset < ${a}; ) {`):t.pushCode(`for (var ${a} = ${n}; ${a} > 0; ${a}--) {`),typeof i=="string")if(tr.get(i)){const u=t.generateTmpVariable();if(t.pushCode(`var ${u} = ${Co+i}(offset, {`),t.useContextVariables){const f=t.generateVariable();t.pushCode(`$parent: ${f},`),t.pushCode(`$root: ${f}.$root,`),!this.options.readUntil&&r===void 0&&t.pushCode(`$index: ${n} - ${a},`)}t.pushCode("});"),t.pushCode(`var ${s} = ${u}.result; offset = ${u}.offset;`),i!==this.alias&&t.addReference(i)}else{const u=p0[i],f=g0[i];t.pushCode(`var ${s} = dataView.get${u}(offset, ${f});`),t.pushCode(`offset += ${nr[i]};`)}else if(i instanceof or){t.pushCode(`var ${s} = {};`);const u=t.generateVariable();t.pushScope(s),t.useContextVariables&&(t.pushCode(`${s}.$parent = ${u};`),t.pushCode(`${s}.$root = ${u}.$root;`),!this.options.readUntil&&r===void 0&&t.pushCode(`${s}.$index = ${n} - ${a};`)),i.generate(t),t.useContextVariables&&(t.pushCode(`delete ${s}.$parent;`),t.pushCode(`delete ${s}.$root;`),t.pushCode(`delete ${s}.$index;`)),t.popScope()}if(l?t.pushCode(`${o}[${s}.${c}] = ${s};`):t.pushCode(`${o}.push(${s});`),t.pushCode("}"),typeof this.options.readUntil=="function"){const u=this.options.readUntil,f=t.addImport(u);t.pushCode(`while (!${f}.call(${t.generateVariable()}, ${s}, buffer.subarray(offset)));`)}}generateChoiceCase(t,n,r){if(typeof r=="string"){const i=t.generateVariable(this.varName);if(tr.has(r)){const a=t.generateTmpVariable();t.pushCode(`var ${a} = ${Co+r}(offset, {`),t.useContextVariables&&(t.pushCode(`$parent: ${i}.$parent,`),t.pushCode(`$root: ${i}.$root,`)),t.pushCode("});"),t.pushCode(`${i} = ${a}.result; offset = ${a}.offset;`),r!==this.alias&&t.addReference(r)}else{const a=p0[r],o=g0[r];t.pushCode(`${i} = dataView.get${a}(offset, ${o});`),t.pushCode(`offset += ${nr[r]}`)}}else r instanceof or&&(t.pushPath(n),r.generate(t),t.popPath(n))}generateChoice(t){const n=t.generateOption(this.options.tag),r=t.generateVariable(this.varName);if(this.varName&&(t.pushCode(`${r} = {};`),t.useContextVariables)){const i=t.generateVariable();t.pushCode(`${r}.$parent = ${i};`),t.pushCode(`${r}.$root = ${i}.$root;`)}t.pushCode(`switch(${n}) {`);for(const i in this.options.choices){const a=parseInt(i,10),o=this.options.choices[a];t.pushCode(`case ${a}:`),this.generateChoiceCase(t,this.varName,o),t.pushCode("break;")}t.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(t,this.varName,this.options.defaultChoice):t.generateError(`"Met undefined tag value " + ${n} + " at choice"`),t.pushCode("}"),this.varName&&t.useContextVariables&&(t.pushCode(`delete ${r}.$parent;`),t.pushCode(`delete ${r}.$root;`))}generateNest(t){const n=t.generateVariable(this.varName);if(this.options.type instanceof or){if(this.varName&&(t.pushCode(`${n} = {};`),t.useContextVariables)){const r=t.generateVariable();t.pushCode(`${n}.$parent = ${r};`),t.pushCode(`${n}.$root = ${r}.$root;`)}t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName),this.varName&&t.useContextVariables&&t.useContextVariables&&(t.pushCode(`delete ${n}.$parent;`),t.pushCode(`delete ${n}.$root;`))}else if(tr.has(this.options.type)){const r=t.generateTmpVariable();if(t.pushCode(`var ${r} = ${Co+this.options.type}(offset, {`),t.useContextVariables){const i=t.generateVariable();t.pushCode(`$parent: ${i},`),t.pushCode(`$root: ${i}.$root,`)}t.pushCode("});"),t.pushCode(`${n} = ${r}.result; offset = ${r}.offset;`),this.options.type!==this.alias&&t.addReference(this.options.type)}}generateWrapper(t){const n=t.generateVariable(this.varName),r=t.generateTmpVariable();if(typeof this.options.readUntil=="function"){const c=this.options.readUntil,l=t.generateTmpVariable(),u=t.generateTmpVariable();t.pushCode(`var ${l} = offset;`),t.pushCode(`var ${u} = 0;`),t.pushCode("while (offset < buffer.length) {"),t.pushCode(`${u} = dataView.getUint8(offset);`);const f=t.addImport(c);t.pushCode(`if (${f}.call(${t.generateVariable()}, ${u}, buffer.subarray(offset))) break;`),t.pushCode("offset += 1;"),t.pushCode("}"),t.pushCode(`${r} = buffer.subarray(${l}, offset);`)}else if(this.options.readUntil==="eof")t.pushCode(`${r} = buffer.subarray(offset);`);else{const c=t.generateOption(this.options.length);t.pushCode(`${r} = buffer.subarray(offset, offset + ${c});`),t.pushCode(`offset += ${c};`)}this.options.clone&&t.pushCode(`${r} = buffer.constructor.from(${r});`);const i=t.generateTmpVariable(),a=t.generateTmpVariable(),o=t.generateTmpVariable(),s=t.addImport(this.options.wrapper);if(t.pushCode(`${r} = ${s}.call(this, ${r}).subarray(0);`),t.pushCode(`var ${i} = buffer;`),t.pushCode(`var ${a} = offset;`),t.pushCode(`var ${o} = dataView;`),t.pushCode(`buffer = ${r};`),t.pushCode("offset = 0;"),t.pushCode("dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.options.type instanceof or)this.varName&&t.pushCode(`${n} = {};`),t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName);else if(tr.has(this.options.type)){const c=t.generateTmpVariable();t.pushCode(`var ${c} = ${Co+this.options.type}(0);`),t.pushCode(`${n} = ${c}.result;`),this.options.type!==this.alias&&t.addReference(this.options.type)}t.pushCode(`buffer = ${i};`),t.pushCode(`dataView = ${o};`),t.pushCode(`offset = ${a};`)}generateFormatter(t,n,r){if(typeof r=="function"){const i=t.addImport(r);t.pushCode(`${n} = ${i}.call(${t.generateVariable()}, ${n});`)}}generatePointer(t){const n=this.options.type,r=t.generateOption(this.options.offset),i=t.generateTmpVariable(),a=t.generateVariable(this.varName);if(t.pushCode(`var ${i} = offset;`),t.pushCode(`offset = ${r};`),this.options.type instanceof or){if(t.pushCode(`${a} = {};`),t.useContextVariables){const o=t.generateVariable();t.pushCode(`${a}.$parent = ${o};`),t.pushCode(`${a}.$root = ${o}.$root;`)}t.pushPath(this.varName),this.options.type.generate(t),t.popPath(this.varName),t.useContextVariables&&(t.pushCode(`delete ${a}.$parent;`),t.pushCode(`delete ${a}.$root;`))}else if(tr.has(this.options.type)){const o=t.generateTmpVariable();if(t.pushCode(`var ${o} = ${Co+this.options.type}(offset, {`),t.useContextVariables){const s=t.generateVariable();t.pushCode(`$parent: ${s},`),t.pushCode(`$root: ${s}.$root,`)}t.pushCode("});"),t.pushCode(`${a} = ${o}.result; offset = ${o}.offset;`),this.options.type!==this.alias&&t.addReference(this.options.type)}else if(Object.keys(nr).indexOf(this.options.type)>=0){const o=p0[n],s=g0[n];t.pushCode(`${a} = dataView.get${o}(offset, ${s});`),t.pushCode(`offset += ${nr[n]};`)}t.pushCode(`offset = ${i};`)}generateSaveOffset(t){const n=t.generateVariable(this.varName);t.pushCode(`${n} = offset`)}};var t5={},fy={},ko={},Iu={};Object.defineProperty(Iu,"__esModule",{value:!0});function hy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dy(e,t,n){return t&&n5(e.prototype,t),n&&n5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function OY(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&py(e,t)}function $s(e){return $s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$s(e)}function py(e,t){return py=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},py(e,t)}function LY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ru(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NY(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ru(e)}function zY(e){var t=LY();return function(){var r=$s(e),i;if(t){var a=$s(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return NY(this,i)}}function UY(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&(e=$s(e),e!==null););return e}function m0(){return typeof Reflect<"u"&&Reflect.get?m0=Reflect.get.bind():m0=function(t,n,r){var i=UY(t,n);if(i){var a=Object.getOwnPropertyDescriptor(i,n);return a.get?a.get.call(arguments.length<3?t:r):a.value}},m0.apply(this,arguments)}var r5=function(){function e(){hy(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return dy(e,[{key:"addEventListener",value:function(n,r,i){n in this.listeners||(this.listeners[n]=[]),this.listeners[n].push({callback:r,options:i})}},{key:"removeEventListener",value:function(n,r){if(n in this.listeners){for(var i=this.listeners[n],a=0,o=i.length;a<o;a++)if(i[a].callback===r){i.splice(a,1);return}}}},{key:"dispatchEvent",value:function(n){if(n.type in this.listeners){for(var r=this.listeners[n.type],i=r.slice(),a=0,o=i.length;a<o;a++){var s=i[a];try{s.callback.call(this,n)}catch(c){Promise.resolve().then(function(){throw c})}s.options&&s.options.once&&this.removeEventListener(n.type,s.callback)}return!n.defaultPrevented}}}]),e}(),gy=function(e){OY(n,e);var t=zY(n);function n(){var r;return hy(this,n),r=t.call(this),r.listeners||r5.call(Ru(r)),Object.defineProperty(Ru(r),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(Ru(r),"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(Ru(r),"reason",{value:void 0,writable:!0,configurable:!0}),r}return dy(n,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(i){i.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,i)),m0($s(n.prototype),"dispatchEvent",this).call(this,i)}}]),n}(r5),i5=function(){function e(){hy(this,e),Object.defineProperty(this,"signal",{value:new gy,writable:!0,configurable:!0})}return dy(e,[{key:"abort",value:function(n){var r;try{r=new Event("abort")}catch{typeof document<"u"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}var i=n;if(i===void 0)if(typeof document>"u")i=new Error("This operation was aborted"),i.name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch{i=new Error("This operation was aborted"),i.name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(r)}},{key:"toString",value:function(){return"[object AbortController]"}}]),e}();typeof Symbol<"u"&&Symbol.toStringTag&&(i5.prototype[Symbol.toStringTag]="AbortController",gy.prototype[Symbol.toStringTag]="AbortSignal");function $Y(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof e.Request=="function"&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function HY(e){typeof e=="function"&&(e={fetch:e});var t=e,n=t.fetch,r=t.Request,i=r===void 0?n.Request:r,a=t.AbortController,o=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=o===void 0?!1:o;if(!$Y({fetch:n,Request:i,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:n,Request:c};var c=i;(c&&!c.prototype.hasOwnProperty("signal")||s)&&(c=function(h,d){var p;d&&d.signal&&(p=d.signal,delete d.signal);var g=new i(h,d);return p&&Object.defineProperty(g,"signal",{writable:!1,enumerable:!1,configurable:!0,value:p}),g},c.prototype=i.prototype);var l=n,u=function(h,d){var p=c&&c.prototype.isPrototypeOf(h)?h.signal:d?d.signal:void 0;if(p){var g;try{g=new DOMException("Aborted","AbortError")}catch{g=new Error("Aborted"),g.name="AbortError"}if(p.aborted)return Promise.reject(g);var b=new Promise(function(v,x){p.addEventListener("abort",function(){return x(g)},{once:!0})});return d&&d.signal&&delete d.signal,Promise.race([b,l(h,d)])}return l(h,d)};return{fetch:u,Request:c}}Iu.AbortController=i5,Iu.AbortSignal=gy,Iu.abortableFetch=HY,Object.defineProperty(ko,"__esModule",{value:!0}),ko.AbortSignal=ko.AbortController=void 0;const a5=Iu;var b0=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")};let GY=typeof b0().AbortController>"u"?a5.AbortController:b0().AbortController;ko.AbortController=GY;let VY=typeof b0().AbortController>"u"?a5.AbortSignal:b0().AbortSignal;ko.AbortSignal=VY;var my={};Object.defineProperty(my,"__esModule",{value:!0});const jY=ko;class qY{}class WY{constructor(){this.signals=new Set,this.abortController=new jY.AbortController}addSignal(t=new qY){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(t),t.aborted?this.handleAborted(t):typeof t.addEventListener=="function"&&t.addEventListener("abort",()=>{this.handleAborted(t)})}handleAborted(t){this.signals.delete(t),this.signals.size===0&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}my.default=WY;var by={};Object.defineProperty(by,"__esModule",{value:!0});class YY{constructor(){this.callbacks=new Set}addCallback(t=()=>{}){this.callbacks.add(t),t(this.currentMessage)}callback(t){this.currentMessage=t,this.callbacks.forEach(n=>{n(t)})}}by.default=YY;var o5=qd&&qd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fy,"__esModule",{value:!0});const ZY=ko,QY=o5(my),XY=o5(by);class y0{constructor({fill:t,cache:n}){if(typeof t!="function")throw new TypeError("must pass a fill function");if(typeof n!="object")throw new TypeError("must pass a cache object");if(typeof n.get!="function"||typeof n.set!="function"||typeof n.delete!="function")throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=n,this.fillCallback=t}static isAbortException(t){return t.name==="AbortError"||t.code==="ERR_ABORTED"||t.message==="AbortError: aborted"||t.message==="Error: aborted"}evict(t,n){this.cache.get(t)===n&&this.cache.delete(t)}fill(t,n,r,i){const a=new QY.default,o=new XY.default;o.addCallback(i);const s={aborter:a,promise:this.fillCallback(n,a.signal,c=>{o.callback(c)}),settled:!1,statusReporter:o,get aborted(){return this.aborter.signal.aborted}};s.aborter.addSignal(r),s.aborter.signal.addEventListener("abort",()=>{s.settled||this.evict(t,s)}),s.promise.then(()=>{s.settled=!0},()=>{s.settled=!0,this.evict(t,s)}).catch(c=>{throw console.error(c),c}),this.cache.set(t,s)}static checkSinglePromise(t,n){function r(){if(n&&n.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then(i=>(r(),i),i=>{throw r(),i})}has(t){return this.cache.has(t)}get(t,n,r,i){if(!r&&n instanceof ZY.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");const a=this.cache.get(t);return a?a.aborted&&!a.settled?(this.evict(t,a),this.get(t,n,r,i)):a.settled?a.promise:(a.aborter.addSignal(r),a.statusReporter.addCallback(i),y0.checkSinglePromise(a.promise,r)):(this.fill(t,n,r,i),y0.checkSinglePromise(this.cache.get(t).promise,r))}delete(t){const n=this.cache.get(t);n&&(n.settled||n.aborter.abort(),this.cache.delete(t))}clear(){const t=this.cache.keys();let n=0;for(let r=t.next();!r.done;r=t.next())this.delete(r.value),n+=1;return n}}fy.default=y0;var KY=qd&&qd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t5,"__esModule",{value:!0});const JY=KY(fy);var v0=t5.default=JY.default;class eZ{constructor(t={}){if(!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(t,n){this.cache.set(t,n),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t)){const n=this.oldCache.get(t);return this.oldCache.delete(t),this._set(t,n),n}}set(t,n){return this.cache.has(t)?this.cache.set(t,n):this._set(t,n),this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t))return this.oldCache.get(t)}delete(t){const n=this.cache.delete(t);return n&&this._size--,this.oldCache.delete(t)||n}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache)yield t;for(const t of this.oldCache){const[n]=t;this.cache.has(n)||(yield t)}}get size(){let t=0;for(const n of this.oldCache.keys())this.cache.has(n)||t++;return this._size+t}}var tZ=eZ;const w0=uu(tZ);class ta{constructor(t,n){this.ranges=arguments.length===2?[{min:t,max:n}]:0 in t?Object.assign({},t):[t]}min(){return this.ranges[0].min}max(){return this.ranges[this.ranges.length-1].max}contains(t){for(let n=0;n<this.ranges.length;n+=1){const r=this.ranges[n];if(r.min<=t&&r.max>=t)return!0}return!1}isContiguous(){return this.ranges.length>1}getRanges(){return this.ranges.map(t=>new ta(t.min,t.max))}toString(){return this.ranges.map(t=>`[${t.min}-${t.max}]`).join(",")}union(t){const n=this.getRanges().concat(t.getRanges()).sort(this.rangeOrder),r=[];let i=n[0];for(let a=1;a<n.length;a+=1){const o=n[a];o.min()>i.max()+1?(r.push(i),i=o):o.max()>i.max()&&(i=new ta(i.min(),o.max()))}return r.push(i),r.length===1?r[0]:new ta(r)}intersection(t){let n=this,r=t;const i=this.ranges(),a=r.ranges(),o=i.length,s=a.length;let c=0,l=0;const u=[];for(;c<o&&l<s;){n=i[c],r=a[l];const f=Math.max(n.min(),r.min()),h=Math.min(n.max(),r.max());h>=f&&u.push(new ta(f,h)),n.max()>r.max()?l+=1:c+=1}if(u.length===0)throw new Error("found range of length 0");return u.length===1?u[0]:new ta(u)}coverage(){let t=0;const n=this.ranges();for(const r of n)t+=r.max()-r.min()+1;return t}rangeOrder(t,n){let r=t,i=n;return arguments.length<2&&(i=r,r=this),r.min()<i.min()?-1:r.min()>i.min()?1:r.max()<i.max()?-1:i.max()>r.max()?1:0}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const nZ=4,s5=0,c5=1,rZ=2;function Hs(e){let t=e.length;for(;--t>=0;)e[t]=0}const iZ=0,l5=1,aZ=2,oZ=3,sZ=258,yy=29,Du=256,Bu=Du+1+yy,Gs=30,vy=19,u5=2*Bu+1,To=15,wy=16,cZ=7,xy=256,f5=16,h5=17,d5=18,Ay=new Uint8Array([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]),x0=new Uint8Array([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]),lZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),p5=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),uZ=512,ti=new Array((Bu+2)*2);Hs(ti);const Fu=new Array(Gs*2);Hs(Fu);const Pu=new Array(uZ);Hs(Pu);const Mu=new Array(sZ-oZ+1);Hs(Mu);const Ey=new Array(yy);Hs(Ey);const A0=new Array(Gs);Hs(A0);function Sy(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let g5,m5,b5;function _y(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const y5=e=>e<256?Pu[e]:Pu[256+(e>>>7)],Ou=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},cn=(e,t,n)=>{e.bi_valid>wy-n?(e.bi_buf|=t<<e.bi_valid&65535,Ou(e,e.bi_buf),e.bi_buf=t>>wy-e.bi_valid,e.bi_valid+=n-wy):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Cr=(e,t,n)=>{cn(e,n[t*2],n[t*2+1])},v5=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},fZ=e=>{e.bi_valid===16?(Ou(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},hZ=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let l,u,f,h,d,p,g=0;for(h=0;h<=To;h++)e.bl_count[h]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<u5;l++)u=e.heap[l],h=n[n[u*2+1]*2+1]+1,h>c&&(h=c,g++),n[u*2+1]=h,!(u>r)&&(e.bl_count[h]++,d=0,u>=s&&(d=o[u-s]),p=n[u*2],e.opt_len+=p*(h+d),a&&(e.static_len+=p*(i[u*2+1]+d)));if(g!==0){do{for(h=c-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,g-=2}while(g>0);for(h=c;h!==0;h--)for(u=e.bl_count[h];u!==0;)f=e.heap[--l],!(f>r)&&(n[f*2+1]!==h&&(e.opt_len+=(h-n[f*2+1])*n[f*2],n[f*2+1]=h),u--)}},w5=(e,t,n)=>{const r=new Array(To+1);let i=0,a,o;for(a=1;a<=To;a++)i=i+n[a-1]<<1,r[a]=i;for(o=0;o<=t;o++){let s=e[o*2+1];s!==0&&(e[o*2]=v5(r[s]++,s))}},dZ=()=>{let e,t,n,r,i;const a=new Array(To+1);for(n=0,r=0;r<yy-1;r++)for(Ey[r]=n,e=0;e<1<<Ay[r];e++)Mu[n++]=r;for(Mu[n-1]=r,i=0,r=0;r<16;r++)for(A0[r]=i,e=0;e<1<<x0[r];e++)Pu[i++]=r;for(i>>=7;r<Gs;r++)for(A0[r]=i<<7,e=0;e<1<<x0[r]-7;e++)Pu[256+i++]=r;for(t=0;t<=To;t++)a[t]=0;for(e=0;e<=143;)ti[e*2+1]=8,e++,a[8]++;for(;e<=255;)ti[e*2+1]=9,e++,a[9]++;for(;e<=279;)ti[e*2+1]=7,e++,a[7]++;for(;e<=287;)ti[e*2+1]=8,e++,a[8]++;for(w5(ti,Bu+1,a),e=0;e<Gs;e++)Fu[e*2+1]=5,Fu[e*2]=v5(e,5);g5=new Sy(ti,Ay,Du+1,Bu,To),m5=new Sy(Fu,x0,0,Gs,To),b5=new Sy(new Array(0),lZ,0,vy,cZ)},x5=e=>{let t;for(t=0;t<Bu;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Gs;t++)e.dyn_dtree[t*2]=0;for(t=0;t<vy;t++)e.bl_tree[t*2]=0;e.dyn_ltree[xy*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},A5=e=>{e.bi_valid>8?Ou(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},E5=(e,t,n,r)=>{const i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},Cy=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&E5(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!E5(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},S5=(e,t,n)=>{let r,i,a=0,o,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?Cr(e,i,t):(o=Mu[i],Cr(e,o+Du+1,t),s=Ay[o],s!==0&&(i-=Ey[o],cn(e,i,s)),r--,o=y5(r),Cr(e,o,n),s=x0[o],s!==0&&(r-=A0[o],cn(e,r,s)));while(a<e.sym_next);Cr(e,xy,t)},ky=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems;let o,s,c=-1,l;for(e.heap_len=0,e.heap_max=u5,o=0;o<a;o++)n[o*2]!==0?(e.heap[++e.heap_len]=c=o,e.depth[o]=0):n[o*2+1]=0;for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Cy(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Cy(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,Cy(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],hZ(e,t),w5(n,c,e.bl_count)},_5=(e,t,n)=>{let r,i=-1,a,o=t[0*2+1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[f5*2]++):s<=10?e.bl_tree[h5*2]++:e.bl_tree[d5*2]++,s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))},C5=(e,t,n)=>{let r,i=-1,a,o=t[0*2+1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do Cr(e,a,e.bl_tree);while(--s!==0);else a!==0?(a!==i&&(Cr(e,a,e.bl_tree),s--),Cr(e,f5,e.bl_tree),cn(e,s-3,2)):s<=10?(Cr(e,h5,e.bl_tree),cn(e,s-3,3)):(Cr(e,d5,e.bl_tree),cn(e,s-11,7));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}},pZ=e=>{let t;for(_5(e,e.dyn_ltree,e.l_desc.max_code),_5(e,e.dyn_dtree,e.d_desc.max_code),ky(e,e.bl_desc),t=vy-1;t>=3&&e.bl_tree[p5[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},gZ=(e,t,n,r)=>{let i;for(cn(e,t-257,5),cn(e,n-1,5),cn(e,r-4,4),i=0;i<r;i++)cn(e,e.bl_tree[p5[i]*2+1],3);C5(e,e.dyn_ltree,t-1),C5(e,e.dyn_dtree,n-1)},mZ=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return s5;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return c5;for(n=32;n<Du;n++)if(e.dyn_ltree[n*2]!==0)return c5;return s5};let k5=!1;const bZ=e=>{k5||(dZ(),k5=!0),e.l_desc=new _y(e.dyn_ltree,g5),e.d_desc=new _y(e.dyn_dtree,m5),e.bl_desc=new _y(e.bl_tree,b5),e.bi_buf=0,e.bi_valid=0,x5(e)},T5=(e,t,n,r)=>{cn(e,(iZ<<1)+(r?1:0),3),A5(e),Ou(e,n),Ou(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},yZ=e=>{cn(e,l5<<1,3),Cr(e,xy,ti),fZ(e)},vZ=(e,t,n,r)=>{let i,a,o=0;e.level>0?(e.strm.data_type===rZ&&(e.strm.data_type=mZ(e)),ky(e,e.l_desc),ky(e,e.d_desc),o=pZ(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?T5(e,t,n,r):e.strategy===nZ||a===i?(cn(e,(l5<<1)+(r?1:0),3),S5(e,ti,Fu)):(cn(e,(aZ<<1)+(r?1:0),3),gZ(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),S5(e,e.dyn_ltree,e.dyn_dtree)),x5(e),r&&A5(e)},wZ=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Mu[n]+Du+1)*2]++,e.dyn_dtree[y5(t)*2]++),e.sym_next===e.sym_end);var xZ=bZ,AZ=T5,EZ=vZ,SZ=wZ,_Z=yZ,CZ={_tr_init:xZ,_tr_stored_block:AZ,_tr_flush_block:EZ,_tr_tally:SZ,_tr_align:_Z},Lu=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,o=0;for(;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0};const kZ=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},TZ=new Uint32Array(kZ());var Tt=(e,t,n,r)=>{const i=TZ,a=r+n;e^=-1;for(let o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1},Vs={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"},Nu={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_MEM_ERROR:-4,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};const{_tr_init:IZ,_tr_stored_block:Ty,_tr_flush_block:RZ,_tr_tally:na,_tr_align:DZ}=CZ,{Z_NO_FLUSH:ra,Z_PARTIAL_FLUSH:BZ,Z_FULL_FLUSH:FZ,Z_FINISH:Bn,Z_BLOCK:I5,Z_OK:Mt,Z_STREAM_END:R5,Z_STREAM_ERROR:kr,Z_DATA_ERROR:PZ,Z_BUF_ERROR:Iy,Z_DEFAULT_COMPRESSION:MZ,Z_FILTERED:OZ,Z_HUFFMAN_ONLY:E0,Z_RLE:LZ,Z_FIXED:NZ,Z_DEFAULT_STRATEGY:zZ,Z_UNKNOWN:UZ,Z_DEFLATED:S0}=Nu,$Z=9,HZ=15,GZ=8,VZ=29,Ry=256+1+VZ,jZ=30,qZ=19,WZ=2*Ry+1,YZ=15,ye=3,ia=258,Tr=ia+ye+1,ZZ=32,js=42,Dy=57,By=69,Fy=73,Py=91,My=103,Io=113,zu=666,Yt=1,qs=2,Ro=3,Ws=4,QZ=3,Do=(e,t)=>(e.msg=Vs[t],t),D5=e=>e*2-(e>4?9:0),aa=e=>{let t=e.length;for(;--t>=0;)e[t]=0},XZ=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let oa=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask;const bn=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},yn=(e,t)=>{RZ(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,bn(e.strm)},Ce=(e,t)=>{e.pending_buf[e.pending++]=t},Uu=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Oy=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Lu(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Tt(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},B5=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-Tr?e.strstart-(e.w_size-Tr):0,l=e.window,u=e.w_mask,f=e.prev,h=e.strstart+ia;let d=l[r+o-1],p=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(l[i+o]!==p||l[i+o-1]!==d||l[i]!==l[r]||l[++i]!==l[r+1])){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<h);if(a=ia-(h-r),r=h-ia,a>o){if(e.match_start=t,o=a,a>=s)break;d=l[r+o-1],p=l[r+o]}}while((t=f[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead},Ys=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Tr)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),XZ(e),r+=t),e.strm.avail_in===0)break;if(n=Oy(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=ye)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=oa(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=oa(e,e.ins_h,e.window[i+ye-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<ye)););}while(e.lookahead<Tr&&e.strm.avail_in!==0)},F5=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,o=0,s=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==Bn||t===ra||r!==i+e.strm.avail_in)))break;o=t===Bn&&r===i+e.strm.avail_in?1:0,Ty(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,bn(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Oy(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(o===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?Ws:t!==ra&&t!==Bn&&e.strm.avail_in===0&&e.strstart===e.block_start?qs:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Oy(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===Bn)&&t!==ra&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,o=t===Bn&&e.strm.avail_in===0&&r===i?1:0,Ty(e,e.block_start,r,o),e.block_start+=r,bn(e.strm)),o?Ro:Yt)},Ly=(e,t)=>{let n,r;for(;;){if(e.lookahead<Tr){if(Ys(e),e.lookahead<Tr&&t===ra)return Yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=ye&&(e.ins_h=oa(e,e.ins_h,e.window[e.strstart+ye-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Tr&&(e.match_length=B5(e,n)),e.match_length>=ye)if(r=na(e,e.strstart-e.match_start,e.match_length-ye),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=ye){e.match_length--;do e.strstart++,e.ins_h=oa(e,e.ins_h,e.window[e.strstart+ye-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=oa(e,e.ins_h,e.window[e.strstart+1]);else r=na(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(yn(e,!1),e.strm.avail_out===0))return Yt}return e.insert=e.strstart<ye-1?e.strstart:ye-1,t===Bn?(yn(e,!0),e.strm.avail_out===0?Ro:Ws):e.sym_next&&(yn(e,!1),e.strm.avail_out===0)?Yt:qs},Zs=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Tr){if(Ys(e),e.lookahead<Tr&&t===ra)return Yt;if(e.lookahead===0)break}if(n=0,e.lookahead>=ye&&(e.ins_h=oa(e,e.ins_h,e.window[e.strstart+ye-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=ye-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Tr&&(e.match_length=B5(e,n),e.match_length<=5&&(e.strategy===OZ||e.match_length===ye&&e.strstart-e.match_start>4096)&&(e.match_length=ye-1)),e.prev_length>=ye&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-ye,r=na(e,e.strstart-1-e.prev_match,e.prev_length-ye),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=oa(e,e.ins_h,e.window[e.strstart+ye-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=ye-1,e.strstart++,r&&(yn(e,!1),e.strm.avail_out===0))return Yt}else if(e.match_available){if(r=na(e,0,e.window[e.strstart-1]),r&&yn(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Yt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=na(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<ye-1?e.strstart:ye-1,t===Bn?(yn(e,!0),e.strm.avail_out===0?Ro:Ws):e.sym_next&&(yn(e,!1),e.strm.avail_out===0)?Yt:qs},KZ=(e,t)=>{let n,r,i,a;const o=e.window;for(;;){if(e.lookahead<=ia){if(Ys(e),e.lookahead<=ia&&t===ra)return Yt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=ye&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+ia;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=ia-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=ye?(n=na(e,1,e.match_length-ye),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=na(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(yn(e,!1),e.strm.avail_out===0))return Yt}return e.insert=0,t===Bn?(yn(e,!0),e.strm.avail_out===0?Ro:Ws):e.sym_next&&(yn(e,!1),e.strm.avail_out===0)?Yt:qs},JZ=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Ys(e),e.lookahead===0)){if(t===ra)return Yt;break}if(e.match_length=0,n=na(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(yn(e,!1),e.strm.avail_out===0))return Yt}return e.insert=0,t===Bn?(yn(e,!0),e.strm.avail_out===0?Ro:Ws):e.sym_next&&(yn(e,!1),e.strm.avail_out===0)?Yt:qs};function Ir(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const $u=[new Ir(0,0,0,0,F5),new Ir(4,4,8,4,Ly),new Ir(4,5,16,8,Ly),new Ir(4,6,32,32,Ly),new Ir(4,4,16,16,Zs),new Ir(8,16,32,32,Zs),new Ir(8,16,128,128,Zs),new Ir(8,32,128,256,Zs),new Ir(32,128,258,1024,Zs),new Ir(32,258,258,4096,Zs)],eQ=e=>{e.window_size=2*e.w_size,aa(e.head),e.max_lazy_match=$u[e.level].max_lazy,e.good_match=$u[e.level].good_length,e.nice_match=$u[e.level].nice_length,e.max_chain_length=$u[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=ye-1,e.match_available=0,e.ins_h=0};function tQ(){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=S0,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 Uint16Array(WZ*2),this.dyn_dtree=new Uint16Array((2*jZ+1)*2),this.bl_tree=new Uint16Array((2*qZ+1)*2),aa(this.dyn_ltree),aa(this.dyn_dtree),aa(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(YZ+1),this.heap=new Uint16Array(2*Ry+1),aa(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ry+1),aa(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Hu=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==js&&t.status!==Dy&&t.status!==By&&t.status!==Fy&&t.status!==Py&&t.status!==My&&t.status!==Io&&t.status!==zu?1:0},P5=e=>{if(Hu(e))return Do(e,kr);e.total_in=e.total_out=0,e.data_type=UZ;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Dy:t.wrap?js:Io,e.adler=t.wrap===2?0:1,t.last_flush=-2,IZ(t),Mt},M5=e=>{const t=P5(e);return t===Mt&&eQ(e.state),t},nQ=(e,t)=>Hu(e)||e.state.wrap!==2?kr:(e.state.gzhead=t,Mt),O5=(e,t,n,r,i,a)=>{if(!e)return kr;let o=1;if(t===MZ&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>$Z||n!==S0||r<8||r>15||t<0||t>9||a<0||a>NZ||r===8&&o!==1)return Do(e,kr);r===8&&(r=9);const s=new tQ;return e.state=s,s.strm=e,s.status=js,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+ye-1)/ye),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=a,s.method=n,M5(e)},rQ=(e,t)=>O5(e,t,S0,HZ,GZ,zZ),iQ=(e,t)=>{if(Hu(e)||t>I5||t<0)return e?Do(e,kr):kr;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===zu&&t!==Bn)return Do(e,e.avail_out===0?Iy:kr);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(bn(e),e.avail_out===0)return n.last_flush=-1,Mt}else if(e.avail_in===0&&D5(t)<=D5(r)&&t!==Bn)return Do(e,Iy);if(n.status===zu&&e.avail_in!==0)return Do(e,Iy);if(n.status===js&&n.wrap===0&&(n.status=Io),n.status===js){let i=S0+(n.w_bits-8<<4)<<8,a=-1;if(n.strategy>=E0||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=ZZ),i+=31-i%31,Uu(n,i),n.strstart!==0&&(Uu(n,e.adler>>>16),Uu(n,e.adler&65535)),e.adler=1,n.status=Io,bn(e),n.pending!==0)return n.last_flush=-1,Mt}if(n.status===Dy){if(e.adler=0,Ce(n,31),Ce(n,139),Ce(n,8),n.gzhead)Ce(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Ce(n,n.gzhead.time&255),Ce(n,n.gzhead.time>>8&255),Ce(n,n.gzhead.time>>16&255),Ce(n,n.gzhead.time>>24&255),Ce(n,n.level===9?2:n.strategy>=E0||n.level<2?4:0),Ce(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Ce(n,n.gzhead.extra.length&255),Ce(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Tt(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=By;else if(Ce(n,0),Ce(n,0),Ce(n,0),Ce(n,0),Ce(n,0),Ce(n,n.level===9?2:n.strategy>=E0||n.level<2?4:0),Ce(n,QZ),n.status=Io,bn(e),n.pending!==0)return n.last_flush=-1,Mt}if(n.status===By){if(n.gzhead.extra){let i=n.pending,a=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+a>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,bn(e),n.pending!==0)return n.last_flush=-1,Mt;i=0,a-=s}let o=new Uint8Array(n.gzhead.extra);n.pending_buf.set(o.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Fy}if(n.status===Fy){if(n.gzhead.name){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),bn(e),n.pending!==0)return n.last_flush=-1,Mt;i=0}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,Ce(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Py}if(n.status===Py){if(n.gzhead.comment){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i)),bn(e),n.pending!==0)return n.last_flush=-1,Mt;i=0}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,Ce(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Tt(e.adler,n.pending_buf,n.pending-i,i))}n.status=My}if(n.status===My){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(bn(e),n.pending!==0))return n.last_flush=-1,Mt;Ce(n,e.adler&255),Ce(n,e.adler>>8&255),e.adler=0}if(n.status=Io,bn(e),n.pending!==0)return n.last_flush=-1,Mt}if(e.avail_in!==0||n.lookahead!==0||t!==ra&&n.status!==zu){let i=n.level===0?F5(n,t):n.strategy===E0?JZ(n,t):n.strategy===LZ?KZ(n,t):$u[n.level].func(n,t);if((i===Ro||i===Ws)&&(n.status=zu),i===Yt||i===Ro)return e.avail_out===0&&(n.last_flush=-1),Mt;if(i===qs&&(t===BZ?DZ(n):t!==I5&&(Ty(n,0,0,!1),t===FZ&&(aa(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),bn(e),e.avail_out===0))return n.last_flush=-1,Mt}return t!==Bn?Mt:n.wrap<=0?R5:(n.wrap===2?(Ce(n,e.adler&255),Ce(n,e.adler>>8&255),Ce(n,e.adler>>16&255),Ce(n,e.adler>>24&255),Ce(n,e.total_in&255),Ce(n,e.total_in>>8&255),Ce(n,e.total_in>>16&255),Ce(n,e.total_in>>24&255)):(Uu(n,e.adler>>>16),Uu(n,e.adler&65535)),bn(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Mt:R5)},aQ=e=>{if(Hu(e))return kr;const t=e.state.status;return e.state=null,t===Io?Do(e,PZ):Mt},oQ=(e,t)=>{let n=t.length;if(Hu(e))return kr;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==js||r.lookahead)return kr;if(i===1&&(e.adler=Lu(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(aa(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Ys(r);r.lookahead>=ye;){let c=r.strstart,l=r.lookahead-(ye-1);do r.ins_h=oa(r,r.ins_h,r.window[c+ye-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--l);r.strstart=c,r.lookahead=ye-1,Ys(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=ye-1,r.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,r.wrap=i,Mt};var sQ=rQ,cQ=O5,lQ=M5,uQ=P5,fQ=nQ,hQ=iQ,dQ=aQ,pQ=oQ,gQ="pako deflate (from Nodeca project)",Gu={deflateInit:sQ,deflateInit2:cQ,deflateReset:lQ,deflateResetKeep:uQ,deflateSetHeader:fQ,deflate:hQ,deflateEnd:dQ,deflateSetDictionary:pQ,deflateInfo:gQ};const mQ=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var bQ=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)mQ(n,r)&&(e[r]=n[r])}}return e},yQ=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,a=e.length;r<a;r++){let o=e[r];n.set(o,i),i+=o.length}return n},_0={assign:bQ,flattenChunks:yQ};let L5=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{L5=!1}const Vu=new Uint8Array(256);for(let e=0;e<256;e++)Vu[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Vu[254]=Vu[254]=1;var vQ=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};const wQ=(e,t)=>{if(t<65534&&e.subarray&&L5)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var xQ=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const a=new Array(n*2);for(i=0,r=0;r<n;){let o=e[r++];if(o<128){a[i++]=o;continue}let s=Vu[o];if(s>4){a[i++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<n;)o=o<<6|e[r++]&63,s--;if(s>1){a[i++]=65533;continue}o<65536?a[i++]=o:(o-=65536,a[i++]=55296|o>>10&1023,a[i++]=56320|o&1023)}return wQ(a,i)},AQ=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Vu[e[n]]>t?n:t},ju={string2buf:vQ,buf2string:xQ,utf8border:AQ};function EQ(){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}var N5=EQ;const z5=Object.prototype.toString,{Z_NO_FLUSH:SQ,Z_SYNC_FLUSH:_Q,Z_FULL_FLUSH:CQ,Z_FINISH:kQ,Z_OK:C0,Z_STREAM_END:TQ,Z_DEFAULT_COMPRESSION:IQ,Z_DEFAULT_STRATEGY:RQ,Z_DEFLATED:DQ}=Nu;function Ny(e){this.options=_0.assign({level:IQ,method:DQ,chunkSize:16384,windowBits:15,memLevel:8,strategy:RQ},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new N5,this.strm.avail_out=0;let n=Gu.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==C0)throw new Error(Vs[n]);if(t.header&&Gu.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=ju.string2buf(t.dictionary):z5.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Gu.deflateSetDictionary(this.strm,r),n!==C0)throw new Error(Vs[n]);this._dict_set=!0}}Ny.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,a;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?kQ:SQ,typeof e=="string"?n.input=ju.string2buf(e):z5.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===_Q||a===CQ)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Gu.deflate(n,a),i===TQ)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Gu.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===C0;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Ny.prototype.onData=function(e){this.chunks.push(e)},Ny.prototype.onEnd=function(e){e===C0&&(this.result=_0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const k0=16209,BQ=16191;var FQ=function(t,n){let r,i,a,o,s,c,l,u,f,h,d,p,g,b,v,x,A,w,_,C,I,D,B,G;const z=t.state;r=t.next_in,B=t.input,i=r+(t.avail_in-5),a=t.next_out,G=t.output,o=a-(n-t.avail_out),s=a+(t.avail_out-257),c=z.dmax,l=z.wsize,u=z.whave,f=z.wnext,h=z.window,d=z.hold,p=z.bits,g=z.lencode,b=z.distcode,v=(1<<z.lenbits)-1,x=(1<<z.distbits)-1;e:do{p<15&&(d+=B[r++]<<p,p+=8,d+=B[r++]<<p,p+=8),A=g[d&v];t:for(;;){if(w=A>>>24,d>>>=w,p-=w,w=A>>>16&255,w===0)G[a++]=A&65535;else if(w&16){_=A&65535,w&=15,w&&(p<w&&(d+=B[r++]<<p,p+=8),_+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=B[r++]<<p,p+=8,d+=B[r++]<<p,p+=8),A=b[d&x];n:for(;;){if(w=A>>>24,d>>>=w,p-=w,w=A>>>16&255,w&16){if(C=A&65535,w&=15,p<w&&(d+=B[r++]<<p,p+=8,p<w&&(d+=B[r++]<<p,p+=8)),C+=d&(1<<w)-1,C>c){t.msg="invalid distance too far back",z.mode=k0;break e}if(d>>>=w,p-=w,w=a-o,C>w){if(w=C-w,w>u&&z.sane){t.msg="invalid distance too far back",z.mode=k0;break e}if(I=0,D=h,f===0){if(I+=l-w,w<_){_-=w;do G[a++]=h[I++];while(--w);I=a-C,D=G}}else if(f<w){if(I+=l+f-w,w-=f,w<_){_-=w;do G[a++]=h[I++];while(--w);if(I=0,f<_){w=f,_-=w;do G[a++]=h[I++];while(--w);I=a-C,D=G}}}else if(I+=f-w,w<_){_-=w;do G[a++]=h[I++];while(--w);I=a-C,D=G}for(;_>2;)G[a++]=D[I++],G[a++]=D[I++],G[a++]=D[I++],_-=3;_&&(G[a++]=D[I++],_>1&&(G[a++]=D[I++]))}else{I=a-C;do G[a++]=G[I++],G[a++]=G[I++],G[a++]=G[I++],_-=3;while(_>2);_&&(G[a++]=G[I++],_>1&&(G[a++]=G[I++]))}}else if(w&64){t.msg="invalid distance code",z.mode=k0;break e}else{A=b[(A&65535)+(d&(1<<w)-1)];continue n}break}}else if(w&64)if(w&32){z.mode=BQ;break e}else{t.msg="invalid literal/length code",z.mode=k0;break e}else{A=g[(A&65535)+(d&(1<<w)-1)];continue t}break}}while(r<i&&a<s);_=p>>3,r-=_,p-=_<<3,d&=(1<<p)-1,t.next_in=r,t.next_out=a,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=a<s?257+(s-a):257-(a-s),z.hold=d,z.bits=p};const Qs=15,U5=852,$5=592,H5=0,zy=1,G5=2,PQ=new Uint16Array([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]),MQ=new Uint8Array([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]),OQ=new Uint16Array([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]),LQ=new Uint8Array([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]);var qu=(e,t,n,r,i,a,o,s)=>{const c=s.bits;let l=0,u=0,f=0,h=0,d=0,p=0,g=0,b=0,v=0,x=0,A,w,_,C,I,D=null,B;const G=new Uint16Array(Qs+1),z=new Uint16Array(Qs+1);let ae=null,se,ve,Pe;for(l=0;l<=Qs;l++)G[l]=0;for(u=0;u<r;u++)G[t[n+u]]++;for(d=c,h=Qs;h>=1&&G[h]===0;h--);if(d>h&&(d=h),h===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f<h&&G[f]===0;f++);for(d<f&&(d=f),b=1,l=1;l<=Qs;l++)if(b<<=1,b-=G[l],b<0)return-1;if(b>0&&(e===H5||h!==1))return-1;for(z[1]=0,l=1;l<Qs;l++)z[l+1]=z[l]+G[l];for(u=0;u<r;u++)t[n+u]!==0&&(o[z[t[n+u]]++]=u);if(e===H5?(D=ae=o,B=20):e===zy?(D=PQ,ae=MQ,B=257):(D=OQ,ae=LQ,B=0),x=0,u=0,l=f,I=a,p=d,g=0,_=-1,v=1<<d,C=v-1,e===zy&&v>U5||e===G5&&v>$5)return 1;for(;;){se=l-g,o[u]+1<B?(ve=0,Pe=o[u]):o[u]>=B?(ve=ae[o[u]-B],Pe=D[o[u]-B]):(ve=32+64,Pe=0),A=1<<l-g,w=1<<p,f=w;do w-=A,i[I+(x>>g)+w]=se<<24|ve<<16|Pe|0;while(w!==0);for(A=1<<l-1;x&A;)A>>=1;if(A!==0?(x&=A-1,x+=A):x=0,u++,--G[l]===0){if(l===h)break;l=t[n+o[u]]}if(l>d&&(x&C)!==_){for(g===0&&(g=d),I+=f,p=l-g,b=1<<p;p+g<h&&(b-=G[p+g],!(b<=0));)p++,b<<=1;if(v+=1<<p,e===zy&&v>U5||e===G5&&v>$5)return 1;_=x&C,i[_]=d<<24|p<<16|I-a|0}}return x!==0&&(i[I+x]=l-g<<24|64<<16|0),s.bits=d,0};const NQ=0,V5=1,j5=2,{Z_FINISH:q5,Z_BLOCK:zQ,Z_TREES:T0,Z_OK:Bo,Z_STREAM_END:UQ,Z_NEED_DICT:$Q,Z_STREAM_ERROR:Fn,Z_DATA_ERROR:W5,Z_MEM_ERROR:Y5,Z_BUF_ERROR:HQ,Z_DEFLATED:Z5}=Nu,I0=16180,Q5=16181,X5=16182,K5=16183,J5=16184,e8=16185,t8=16186,n8=16187,r8=16188,i8=16189,R0=16190,ni=16191,Uy=16192,a8=16193,$y=16194,o8=16195,s8=16196,c8=16197,l8=16198,D0=16199,B0=16200,u8=16201,f8=16202,h8=16203,d8=16204,p8=16205,Hy=16206,g8=16207,m8=16208,Je=16209,b8=16210,y8=16211,GQ=852,VQ=592,jQ=15,v8=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function qQ(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Fo=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<I0||t.mode>y8?1:0},w8=e=>{if(Fo(e))return Fn;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=I0,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(GQ),t.distcode=t.distdyn=new Int32Array(VQ),t.sane=1,t.back=-1,Bo},x8=e=>{if(Fo(e))return Fn;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,w8(e)},A8=(e,t)=>{let n;if(Fo(e))return Fn;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Fn:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,x8(e))},E8=(e,t)=>{if(!e)return Fn;const n=new qQ;e.state=n,n.strm=e,n.window=null,n.mode=I0;const r=A8(e,t);return r!==Bo&&(e.state=null),r},WQ=e=>E8(e,jQ);let S8=!0,Gy,Vy;const YQ=e=>{if(S8){Gy=new Int32Array(512),Vy=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(qu(V5,e.lens,0,288,Gy,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;qu(j5,e.lens,0,32,Vy,0,e.work,{bits:5}),S8=!1}e.lencode=Gy,e.lenbits=9,e.distcode=Vy,e.distbits=5},_8=(e,t,n,r)=>{let i;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},ZQ=(e,t)=>{let n,r,i,a,o,s,c,l,u,f,h,d,p,g,b=0,v,x,A,w,_,C,I,D;const B=new Uint8Array(4);let G,z;const ae=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Fo(e)||!e.output||!e.input&&e.avail_in!==0)return Fn;n=e.state,n.mode===ni&&(n.mode=Uy),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,f=s,h=c,D=Bo;e:for(;;)switch(n.mode){case I0:if(n.wrap===0){n.mode=Uy;break}for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.wrap&2&&l===35615){n.wbits===0&&(n.wbits=15),n.check=0,B[0]=l&255,B[1]=l>>>8&255,n.check=Tt(n.check,B,2,0),l=0,u=0,n.mode=Q5;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Je;break}if((l&15)!==Z5){e.msg="unknown compression method",n.mode=Je;break}if(l>>>=4,u-=4,I=(l&15)+8,n.wbits===0&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=Je;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=l&512?i8:ni,l=0,u=0;break;case Q5:for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.flags=l,(n.flags&255)!==Z5){e.msg="unknown compression method",n.mode=Je;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Je;break}n.head&&(n.head.text=l>>8&1),n.flags&512&&n.wrap&4&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Tt(n.check,B,2,0)),l=0,u=0,n.mode=X5;case X5:for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.time=l),n.flags&512&&n.wrap&4&&(B[0]=l&255,B[1]=l>>>8&255,B[2]=l>>>16&255,B[3]=l>>>24&255,n.check=Tt(n.check,B,4,0)),l=0,u=0,n.mode=K5;case K5:for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.head&&(n.head.xflags=l&255,n.head.os=l>>8),n.flags&512&&n.wrap&4&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Tt(n.check,B,2,0)),l=0,u=0,n.mode=J5;case J5:if(n.flags&1024){for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.length=l,n.head&&(n.head.extra_len=l),n.flags&512&&n.wrap&4&&(B[0]=l&255,B[1]=l>>>8&255,n.check=Tt(n.check,B,2,0)),l=0,u=0}else n.head&&(n.head.extra=null);n.mode=e8;case e8:if(n.flags&1024&&(d=n.length,d>s&&(d=s),d&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+d),I)),n.flags&512&&n.wrap&4&&(n.check=Tt(n.check,r,d,a)),s-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=t8;case t8:if(n.flags&2048){if(s===0)break e;d=0;do I=r[a+d++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I));while(I&&d<s);if(n.flags&512&&n.wrap&4&&(n.check=Tt(n.check,r,d,a)),s-=d,a+=d,I)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=n8;case n8:if(n.flags&4096){if(s===0)break e;d=0;do I=r[a+d++],n.head&&I&&n.length<65536&&(n.head.comment+=String.fromCharCode(I));while(I&&d<s);if(n.flags&512&&n.wrap&4&&(n.check=Tt(n.check,r,d,a)),s-=d,a+=d,I)break e}else n.head&&(n.head.comment=null);n.mode=r8;case r8:if(n.flags&512){for(;u<16;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Je;break}l=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ni;break;case i8:for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}e.adler=n.check=v8(l),l=0,u=0,n.mode=R0;case R0:if(n.havedict===0)return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,$Q;e.adler=n.check=1,n.mode=ni;case ni:if(t===zQ||t===T0)break e;case Uy:if(n.last){l>>>=u&7,u-=u&7,n.mode=Hy;break}for(;u<3;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}switch(n.last=l&1,l>>>=1,u-=1,l&3){case 0:n.mode=a8;break;case 1:if(YQ(n),n.mode=D0,t===T0){l>>>=2,u-=2;break e}break;case 2:n.mode=s8;break;case 3:e.msg="invalid block type",n.mode=Je}l>>>=2,u-=2;break;case a8:for(l>>>=u&7,u-=u&7;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Je;break}if(n.length=l&65535,l=0,u=0,n.mode=$y,t===T0)break e;case $y:n.mode=o8;case o8:if(d=n.length,d){if(d>s&&(d=s),d>c&&(d=c),d===0)break e;i.set(r.subarray(a,a+d),o),s-=d,a+=d,c-=d,o+=d,n.length-=d;break}n.mode=ni;break;case s8:for(;u<14;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.nlen=(l&31)+257,l>>>=5,u-=5,n.ndist=(l&31)+1,l>>>=5,u-=5,n.ncode=(l&15)+4,l>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Je;break}n.have=0,n.mode=c8;case c8:for(;n.have<n.ncode;){for(;u<3;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.lens[ae[n.have++]]=l&7,l>>>=3,u-=3}for(;n.have<19;)n.lens[ae[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,G={bits:n.lenbits},D=qu(NQ,n.lens,0,19,n.lencode,0,n.work,G),n.lenbits=G.bits,D){e.msg="invalid code lengths set",n.mode=Je;break}n.have=0,n.mode=l8;case l8:for(;n.have<n.nlen+n.ndist;){for(;b=n.lencode[l&(1<<n.lenbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(A<16)l>>>=v,u-=v,n.lens[n.have++]=A;else{if(A===16){for(z=v+2;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(l>>>=v,u-=v,n.have===0){e.msg="invalid bit length repeat",n.mode=Je;break}I=n.lens[n.have-1],d=3+(l&3),l>>>=2,u-=2}else if(A===17){for(z=v+3;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=v,u-=v,I=0,d=3+(l&7),l>>>=3,u-=3}else{for(z=v+7;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=v,u-=v,I=0,d=11+(l&127),l>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Je;break}for(;d--;)n.lens[n.have++]=I}}if(n.mode===Je)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Je;break}if(n.lenbits=9,G={bits:n.lenbits},D=qu(V5,n.lens,0,n.nlen,n.lencode,0,n.work,G),n.lenbits=G.bits,D){e.msg="invalid literal/lengths set",n.mode=Je;break}if(n.distbits=6,n.distcode=n.distdyn,G={bits:n.distbits},D=qu(j5,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,G),n.distbits=G.bits,D){e.msg="invalid distances set",n.mode=Je;break}if(n.mode=D0,t===T0)break e;case D0:n.mode=B0;case B0:if(s>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,FQ(e,h),o=e.next_out,i=e.output,c=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,l=n.hold,u=n.bits,n.mode===ni&&(n.back=-1);break}for(n.back=0;b=n.lencode[l&(1<<n.lenbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(x&&!(x&240)){for(w=v,_=x,C=A;b=n.lencode[C+((l&(1<<w+_)-1)>>w)],v=b>>>24,x=b>>>16&255,A=b&65535,!(w+v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=v,u-=v,n.back+=v,n.length=A,x===0){n.mode=p8;break}if(x&32){n.back=-1,n.mode=ni;break}if(x&64){e.msg="invalid literal/length code",n.mode=Je;break}n.extra=x&15,n.mode=u8;case u8:if(n.extra){for(z=n.extra;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.length+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=f8;case f8:for(;b=n.distcode[l&(1<<n.distbits)-1],v=b>>>24,x=b>>>16&255,A=b&65535,!(v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(!(x&240)){for(w=v,_=x,C=A;b=n.distcode[C+((l&(1<<w+_)-1)>>w)],v=b>>>24,x=b>>>16&255,A=b&65535,!(w+v<=u);){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}l>>>=w,u-=w,n.back+=w}if(l>>>=v,u-=v,n.back+=v,x&64){e.msg="invalid distance code",n.mode=Je;break}n.offset=A,n.extra=x&15,n.mode=h8;case h8:if(n.extra){for(z=n.extra;u<z;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}n.offset+=l&(1<<n.extra)-1,l>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Je;break}n.mode=d8;case d8:if(c===0)break e;if(d=h-c,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Je;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=o-n.offset,d=n.length;d>c&&(d=c),c-=d,n.length-=d;do i[o++]=g[p++];while(--d);n.length===0&&(n.mode=B0);break;case p8:if(c===0)break e;i[o++]=n.length,c--,n.mode=B0;break;case Hy:if(n.wrap){for(;u<32;){if(s===0)break e;s--,l|=r[a++]<<u,u+=8}if(h-=c,e.total_out+=h,n.total+=h,n.wrap&4&&h&&(e.adler=n.check=n.flags?Tt(n.check,i,h,o-h):Lu(n.check,i,h,o-h)),h=c,n.wrap&4&&(n.flags?l:v8(l))!==n.check){e.msg="incorrect data check",n.mode=Je;break}l=0,u=0}n.mode=g8;case g8:if(n.wrap&&n.flags){for(;u<32;){if(s===0)break e;s--,l+=r[a++]<<u,u+=8}if(n.wrap&4&&l!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Je;break}l=0,u=0}n.mode=m8;case m8:D=UQ;break e;case Je:D=W5;break e;case b8:return Y5;case y8:default:return Fn}return e.next_out=o,e.avail_out=c,e.next_in=a,e.avail_in=s,n.hold=l,n.bits=u,(n.wsize||h!==e.avail_out&&n.mode<Je&&(n.mode<Hy||t!==q5))&&_8(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,n.total+=h,n.wrap&4&&h&&(e.adler=n.check=n.flags?Tt(n.check,i,h,e.next_out-h):Lu(n.check,i,h,e.next_out-h)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ni?128:0)+(n.mode===D0||n.mode===$y?256:0),(f===0&&h===0||t===q5)&&D===Bo&&(D=HQ),D},QQ=e=>{if(Fo(e))return Fn;let t=e.state;return t.window&&(t.window=null),e.state=null,Bo},XQ=(e,t)=>{if(Fo(e))return Fn;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Bo):Fn},KQ=(e,t)=>{const n=t.length;let r,i,a;return Fo(e)||(r=e.state,r.wrap!==0&&r.mode!==R0)?Fn:r.mode===R0&&(i=1,i=Lu(i,t,n,0),i!==r.check)?W5:(a=_8(e,t,n,n),a?(r.mode=b8,Y5):(r.havedict=1,Bo))};var JQ=x8,eX=A8,tX=w8,nX=WQ,rX=E8,iX=ZQ,aX=QQ,oX=XQ,sX=KQ,cX="pako inflate (from Nodeca project)",ri={inflateReset:JQ,inflateReset2:eX,inflateResetKeep:tX,inflateInit:nX,inflateInit2:rX,inflate:iX,inflateEnd:aX,inflateGetHeader:oX,inflateSetDictionary:sX,inflateInfo:cX};function lX(){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}var uX=lX;const C8=Object.prototype.toString,{Z_NO_FLUSH:fX,Z_FINISH:hX,Z_OK:Wu,Z_STREAM_END:jy,Z_NEED_DICT:qy,Z_STREAM_ERROR:dX,Z_DATA_ERROR:k8,Z_MEM_ERROR:pX}=Nu;function Yu(e){this.options=_0.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new N5,this.strm.avail_out=0;let n=ri.inflateInit2(this.strm,t.windowBits);if(n!==Wu)throw new Error(Vs[n]);if(this.header=new uX,ri.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=ju.string2buf(t.dictionary):C8.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=ri.inflateSetDictionary(this.strm,t.dictionary),n!==Wu)))throw new Error(Vs[n])}Yu.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?hX:fX,C8.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=ri.inflate(n,o),a===qy&&i&&(a=ri.inflateSetDictionary(n,i),a===Wu?a=ri.inflate(n,o):a===k8&&(a=qy));n.avail_in>0&&a===jy&&n.state.wrap>0&&e[n.next_in]!==0;)ri.inflateReset(n),a=ri.inflate(n,o);switch(a){case dX:case k8:case qy:case pX:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||a===jy))if(this.options.to==="string"){let c=ju.utf8border(n.output,n.next_out),l=n.next_out-c,u=ju.buf2string(n.output,c);n.next_out=l,n.avail_out=r-l,l&&n.output.set(n.output.subarray(c,c+l),0),this.onData(u)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(a===Wu&&s===0)){if(a===jy)return a=ri.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},Yu.prototype.onData=function(e){this.chunks.push(e)},Yu.prototype.onEnd=function(e){e===Wu&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=_0.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Wy(e,t){const n=new Yu(t);if(n.push(e),n.err)throw n.msg||Vs[n.err];return n.result}function gX(e,t){return t=t||{},t.raw=!0,Wy(e,t)}var mX=Yu,bX=Wy,yX=gX,vX=Wy,wX=Nu,xX={Inflate:mX,inflate:bX,inflateRaw:yX,ungzip:vX,constants:wX};const{Inflate:Iee,inflate:Ree,inflateRaw:AX,ungzip:Dee}=xX;var EX=AX;function SX(e){return EX(e.subarray(2))}let _X=class extends Error{constructor(t){super(t),this.code="ERR_ABORTED"}};function CX(e){e.sort((i,a)=>Number(i.offset)-Number(a.offset));const t=[];let n,r;for(const i of e)n&&r&&Number(i.offset)-r<=2e3?(n.length=BigInt(Number(n.length)+Number(i.length)-r+Number(i.offset)),n.blocks.push(i)):t.push(n={blocks:[i],length:i.length,offset:i.offset}),r=Number(n.offset)+Number(n.length);return t}function F0(e){if(e&&e.aborted)if(typeof DOMException>"u"){const t=new _X("aborted");throw t.code="ERR_ABORTED",t}else throw new DOMException("aborted","AbortError")}const kX=1,TX=2,IX=3;function Yy(e,t,n,r){return e<r&&t>=n}function RX(e){const t=e?"big":"little",n=new Fe().endianess(t).uint32("chromId").uint32("start").uint32("end").uint32("validCnt").floatle("minScore").floatle("maxScore").floatle("sumData").floatle("sumSqData").saveOffset("offset"),r=new Fe().endianess(t).uint8("isLeaf").skip(1).uint16("cnt").choice({tag:"isLeaf",choices:{1:new Fe().endianess(t).array("blocksToFetch",{length:"cnt",type:new Fe().endianess(t).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").uint64("blockSize").saveOffset("offset")}),0:new Fe().array("recurOffsets",{length:"cnt",type:new Fe().endianess(t).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").saveOffset("offset")})}}),i=new Fe().endianess(t).uint32("chromId").int32("start").int32("end").string("rest",{zeroTerminated:!0}).saveOffset("offset");return{bigWigParser:new Fe().endianess(t).skip(4).int32("blockStart").skip(4).uint32("itemStep").uint32("itemSpan").uint8("blockType").skip(1).uint16("itemCount").choice({tag:"blockType",choices:{[IX]:new Fe().array("items",{length:"itemCount",type:new Fe().floatle("score")}),[TX]:new Fe().array("items",{length:"itemCount",type:new Fe().endianess(t).int32("start").floatle("score")}),[kX]:new Fe().array("items",{length:"itemCount",type:new Fe().endianess(t).int32("start").int32("end").floatle("score")})}}),bigBedParser:i,summaryParser:n,leafParser:r}}class T8{constructor(t,n,r,i,a,o){if(this.bbi=t,this.refsByName=n,this.cirTreeOffset=r,this.isBigEndian=i,this.isCompressed=a,this.blockType=o,this.featureCache=new v0({cache:new w0({maxSize:1e3}),fill:async(c,l)=>{const u=Number(c.length),f=Number(c.offset),{buffer:h}=await this.bbi.read(we.Buffer.alloc(u),0,u,f,{signal:l});return h}}),!(r>=0))throw new Error("invalid cirTreeOffset!");const s=RX(i);this.leafParser=s.leafParser,this.bigBedParser=s.bigBedParser}async readWigData(t,n,r,i,a){try{const{refsByName:o,bbi:s,cirTreeOffset:c,isBigEndian:l}=this,u=o[t];u===void 0&&i.complete();const f={chrId:u,start:n,end:r};this.cirTreePromise||(this.cirTreePromise=s.read(we.Buffer.alloc(48),0,48,Number(c),a));const{buffer:h}=await this.cirTreePromise,d=l?h.readUInt32BE(4):h.readUInt32LE(4);let p=[],g=0;const b=(w,_,C)=>{try{const I=w.subarray(_),D=this.leafParser.parse(I);if(D.blocksToFetch&&(p=p.concat(D.blocksToFetch.filter(B=>v(B)).map(B=>({offset:B.blockOffset,length:B.blockSize})))),D.recurOffsets){const B=D.recurOffsets.filter(G=>v(G)).map(G=>Number(G.blockOffset));B.length>0&&A(B,C+1)}}catch(I){i.error(I)}},v=w=>{const{startChrom:_,startBase:C,endChrom:I,endBase:D}=w;return(_<u||_===u&&C<=r)&&(I>u||I===u&&D>=n)},x=async(w,_,C)=>{try{const I=_.max()-_.min(),D=_.min(),B=await this.featureCache.get(`${I}_${D}`,{length:I,offset:D},a==null?void 0:a.signal);for(const G of w)_.contains(G)&&(b(B,G-D,C),g-=1,g===0&&this.readFeatures(i,p,{...a,request:f}))}catch(I){i.error(I)}},A=(w,_)=>{try{g+=w.length;const C=4+Number(d)*32;let I=new ta(w[0],w[0]+C);for(let D=1;D<w.length;D+=1){const B=new ta(w[D],w[D]+C);I=I.union(B)}I.getRanges().map(D=>x(w,D,_))}catch(C){i.error(C)}};return A([Number(c)+48],1)}catch(o){i.error(o)}}parseSummaryBlock(t,n,r){const i=[];let a=n;const o=new DataView(t.buffer,t.byteOffset,t.length);for(;a<t.byteLength;){const s=o.getUint32(a,!0);a+=4;const c=o.getUint32(a,!0);a+=4;const l=o.getUint32(a,!0);a+=4;const u=o.getUint32(a,!0);a+=4;const f=o.getFloat32(a,!0);a+=4;const h=o.getFloat32(a,!0);a+=4;const d=o.getFloat32(a,!0);a+=4,a+=4,(!r||s===r.chrId&&Yy(c,l,r.start,r.end))&&i.push({start:c,end:l,maxScore:h,minScore:f,summary:!0,score:d/(u||1)})}return i}parseBigBedBlock(t,n,r,i){const a=[];let o=n;for(;o<t.byteLength;){const s=this.bigBedParser.parse(t.subarray(o));a.push({...s,uniqueId:`bb-${r+o}`}),o+=s.offset}return i?a.filter(s=>Yy(s.start,s.end,i.start,i.end)):a}parseBigWigBlock(t,n,r){const i=t.subarray(n),a=new DataView(i.buffer,i.byteOffset,i.length);let o=0;o+=4;const s=a.getInt32(o,!0);o+=8;const c=a.getUint32(o,!0);o+=4;const l=a.getUint32(o,!0);o+=4;const u=a.getUint8(o);o+=2;const f=a.getUint16(o,!0);o+=2;const h=new Array(f);switch(u){case 1:{for(let d=0;d<f;d++){const p=a.getInt32(o,!0);o+=4;const g=a.getInt32(o,!0);o+=4;const b=a.getFloat32(o,!0);o+=4,h[d]={start:p,end:g,score:b}}break}case 2:{for(let d=0;d<f;d++){const p=a.getInt32(o,!0);o+=4;const g=a.getFloat32(o,!0);o+=4,h[d]={score:g,start:p,end:p+l}}break}case 3:{for(let d=0;d<f;d++){const p=a.getFloat32(o,!0);o+=4;const g=s+d*c;h[d]={score:p,start:g,end:g+l}}break}}return r?h.filter(d=>Yy(d.start,d.end,r.start,r.end)):h}async readFeatures(t,n,r={}){try{const{blockType:i,isCompressed:a}=this,{signal:o,request:s}=r,c=CX(n);F0(o),await Promise.all(c.map(async l=>{F0(o);const{length:u,offset:f}=l,h=await this.featureCache.get(`${u}_${f}`,l,o);for(const d of l.blocks){F0(o);let p=Number(d.offset)-Number(l.offset),g=h;switch(a&&(g=SX(h.subarray(p)),p=0),F0(o),i){case"summary":{t.next(this.parseSummaryBlock(g,p,s));break}case"bigwig":{t.next(this.parseBigWigBlock(g,p,s));break}case"bigbed":{t.next(this.parseBigBedBlock(g,p,Number(d.offset)*256,s));break}default:console.warn(`Don't know what to do with ${i}`)}}})),t.complete()}catch(i){t.error(i)}}}var Zy=function(e,t){return Zy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Zy(e,t)};function Qy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Zy(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function DX(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{l(r.next(u))}catch(f){o(f)}}function c(u){try{l(r.throw(u))}catch(f){o(f)}}function l(u){u.done?a(u.value):i(u.value).then(s,c)}l((r=r.apply(e,t||[])).next())})}function I8(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Zu(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xy(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Ky(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function Xs(e){return this instanceof Xs?(this.v=e,this):new Xs(e)}function BX(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){r[h]&&(i[h]=function(d){return new Promise(function(p,g){a.push([h,d,p,g])>1||s(h,d)})})}function s(h,d){try{c(r[h](d))}catch(p){f(a[0][3],p)}}function c(h){h.value instanceof Xs?Promise.resolve(h.value.v).then(l,u):f(a[0][2],h)}function l(h){s("next",h)}function u(h){s("throw",h)}function f(h,d){h(d),a.shift(),a.length&&s(a[0][0],a[0][1])}}function FX(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Zu=="function"?Zu(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=e[a]&&function(o){return new Promise(function(s,c){o=e[a](o),i(s,c,o.done,o.value)})}}function i(a,o,s,c){Promise.resolve(c).then(function(l){a({value:l,done:s})},o)}}typeof SuppressedError=="function"&&SuppressedError;function vt(e){return typeof e=="function"}function R8(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Jy=R8(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
|
3203
3203
|
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
3204
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function D8(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var e2=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Zu(o),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(g){t={error:g}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(vt(u))try{u()}catch(g){a=g instanceof Jy?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Zu(f),d=h.next();!d.done;d=h.next()){var p=d.value;try{F8(p)}catch(g){a=a??[],g instanceof Jy?a=Ky(Ky([],Xy(a)),Xy(g.errors)):a.push(g)}}}catch(g){r={error:g}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new Jy(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)F8(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&D8(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&D8(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();e2.EMPTY;function B8(e){return e instanceof e2||e&&"closed"in e&&vt(e.remove)&&vt(e.add)&&vt(e.unsubscribe)}function F8(e){vt(e)?e():e.unsubscribe()}var P8={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},M8={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Ky([e,t],Xy(n)))},clearTimeout:function(e){var t=M8.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function O8(e){M8.setTimeout(function(){throw e})}function L8(){}function PX(e){e()}var t2=function(e){Qy(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,B8(n)&&n.add(r)):r.destination=NX,r}return t.create=function(n,r,i){return new P0(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(e2),MX=Function.prototype.bind;function n2(e,t){return MX.call(e,t)}var OX=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){M0(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){M0(r)}else M0(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){M0(n)}},e}(),P0=function(e){Qy(t,e);function t(n,r,i){var a=e.call(this)||this,o;if(vt(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;a&&P8.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&n2(n.next,s),error:n.error&&n2(n.error,s),complete:n.complete&&n2(n.complete,s)}):o=n}return a.destination=new OX(o),a}return t}(t2);function M0(e){O8(e)}function LX(e){throw e}var NX={closed:!0,next:L8,error:LX,complete:L8},r2=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function N8(e){return e}function zX(e){return e.length===0?N8:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var Pn=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,a=$X(t)?t:new P0(t,n,r);return PX(function(){var o=i,s=o.operator,c=o.source;a.add(s?s.call(a,c):c?i._subscribe(a):i._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=z8(n),new n(function(i,a){var o=new P0({next:function(s){try{t(s)}catch(c){a(c),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[r2]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return zX(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=z8(t),new t(function(r,i){var a;n.subscribe(function(o){return a=o},function(o){return i(o)},function(){return r(a)})})},e.create=function(t){return new e(t)},e}();function z8(e){var t;return(t=e??P8.Promise)!==null&&t!==void 0?t:Promise}function UX(e){return e&&vt(e.next)&&vt(e.error)&&vt(e.complete)}function $X(e){return e&&e instanceof t2||UX(e)&&B8(e)}function HX(e){return vt(e==null?void 0:e.lift)}function Ks(e){return function(t){if(HX(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Qu(e,t,n,r,i){return new GX(e,t,n,r,i)}var GX=function(e){Qy(t,e);function t(n,r,i,a,o,s){var c=e.call(this,n)||this;return c.onFinalize=o,c.shouldUnsubscribe=s,c._next=r?function(l){try{r(l)}catch(u){n.error(u)}}:e.prototype._next,c._error=a?function(l){try{a(l)}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(t2),VX=new Pn(function(e){return e.complete()});function jX(e){return e&&vt(e.schedule)}function U8(e){return e[e.length-1]}function qX(e){return jX(U8(e))?e.pop():void 0}function WX(e,t){return typeof U8(e)=="number"?e.pop():t}var $8=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function H8(e){return vt(e==null?void 0:e.then)}function G8(e){return vt(e[r2])}function V8(e){return Symbol.asyncIterator&&vt(e==null?void 0:e[Symbol.asyncIterator])}function j8(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function YX(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var q8=YX();function W8(e){return vt(e==null?void 0:e[q8])}function Y8(e){return BX(this,arguments,function(){var n,r,i,a;return I8(this,function(o){switch(o.label){case 0:n=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Xs(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,Xs(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Xs(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Z8(e){return vt(e==null?void 0:e.getReader)}function Js(e){if(e instanceof Pn)return e;if(e!=null){if(G8(e))return ZX(e);if($8(e))return QX(e);if(H8(e))return XX(e);if(V8(e))return Q8(e);if(W8(e))return KX(e);if(Z8(e))return JX(e)}throw j8(e)}function ZX(e){return new Pn(function(t){var n=e[r2]();if(vt(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function QX(e){return new Pn(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function XX(e){return new Pn(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,O8)})}function KX(e){return new Pn(function(t){var n,r;try{for(var i=Zu(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function Q8(e){return new Pn(function(t){eK(e,t).catch(function(n){return t.error(n)})})}function JX(e){return Q8(Y8(e))}function eK(e,t){var n,r,i,a;return DX(this,void 0,void 0,function(){var o,s;return I8(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=FX(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function oa(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function X8(e,t){return t===void 0&&(t=0),Ks(function(n,r){n.subscribe(Qu(r,function(i){return oa(r,e,function(){return r.next(i)},t)},function(){return oa(r,e,function(){return r.complete()},t)},function(i){return oa(r,e,function(){return r.error(i)},t)}))})}function K8(e,t){return t===void 0&&(t=0),Ks(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function tK(e,t){return Js(e).pipe(K8(t),X8(t))}function nK(e,t){return Js(e).pipe(K8(t),X8(t))}function rK(e,t){return new Pn(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function iK(e,t){return new Pn(function(n){var r;return oa(n,t,function(){r=e[q8](),oa(n,t,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(s){n.error(s);return}o?n.complete():n.next(a)},0,!0)}),function(){return vt(r==null?void 0:r.return)&&r.return()}})}function J8(e,t){if(!e)throw new Error("Iterable cannot be null");return new Pn(function(n){oa(n,t,function(){var r=e[Symbol.asyncIterator]();oa(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function aK(e,t){return J8(Y8(e),t)}function oK(e,t){if(e!=null){if(G8(e))return tK(e,t);if($8(e))return rK(e,t);if(H8(e))return nK(e,t);if(V8(e))return J8(e,t);if(W8(e))return iK(e,t);if(Z8(e))return aK(e,t)}throw j8(e)}function sK(e,t){return t?oK(e,t):Js(e)}var cK=R8(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function ek(e,t){var n=typeof t=="object";return new Promise(function(r,i){var a=new P0({next:function(o){r(o),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new cK)}});e.subscribe(a)})}function tk(e,t){return Ks(function(n,r){var i=0;n.subscribe(Qu(r,function(a){r.next(e.call(t,a,i++))}))})}function lK(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,f=!1,h=function(){f&&!c.length&&!l&&t.complete()},d=function(g){return l<r?p(g):c.push(g)},p=function(g){a&&t.next(g),l++;var b=!1;Js(n(g,u++)).subscribe(Qu(t,function(v){i==null||i(v),a?d(v):t.next(v)},function(){b=!0},void 0,function(){if(b)try{l--;for(var v=function(){var x=c.shift();o?oa(t,o,function(){return p(x)}):p(x)};c.length&&l<r;)v();h()}catch(x){t.error(x)}}))};return e.subscribe(Qu(t,d,function(){f=!0,h()})),function(){s==null||s()}}function nk(e,t,n){return n===void 0&&(n=1/0),vt(t)?nk(function(r,i){return tk(function(a,o){return t(r,a,i,o)})(Js(e(r,i)))},n):(typeof t=="number"&&(n=t),Ks(function(r,i){return lK(r,i,e,n)}))}function uK(e){return e===void 0&&(e=1/0),nk(N8,e)}function fK(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=qX(e),r=WX(e,1/0),i=e;return i.length?i.length===1?Js(i[0]):uK(r)(sK(i,n)):VX}function hK(e,t,n,r,i){return function(a,o){var s=n,c=t,l=0;a.subscribe(Qu(o,function(u){var f=l++;c=s?e(c,u,f):(s=!0,u),r&&o.next(c)},i&&function(){s&&o.next(c),o.complete()}))}}function rk(e,t){return Ks(hK(e,t,arguments.length>=2,!1,!0))}var dK=function(e,t){return e.push(t),e};function pK(){return Ks(function(e,t){rk(dK,[])(e).subscribe(t)})}const ik=-2003829722,i2=-2021002517;function gK(e){return new TextDecoder().decode(e)}function ak(e){const t=e?"big":"little",n=new Fe().endianess(t).int32("magic").uint16("version").uint16("numZoomLevels").uint64("chromTreeOffset").uint64("unzoomedDataOffset").uint64("unzoomedIndexOffset").uint16("fieldCount").uint16("definedFieldCount").uint64("asOffset").uint64("totalSummaryOffset").uint32("uncompressBufSize").uint64("extHeaderOffset").array("zoomLevels",{length:"numZoomLevels",type:new Fe().endianess(t).uint32("reductionLevel").uint32("reserved").uint64("dataOffset").uint64("indexOffset")}),r=new Fe().endianess(t).uint64("basesCovered").doublele("scoreMin").doublele("scoreMax").doublele("scoreSum").doublele("scoreSumSquares"),i=new Fe().endianess(t).uint32("magic").uint32("blockSize").uint32("keySize").uint32("valSize").uint64("itemCount"),a=new Fe().endianess(t).uint8("isLeafNode").skip(1).uint16("cnt").saveOffset("offset");return{chromTreeParser:i,totalSummaryParser:r,headerParser:n,isLeafNode:a}}class ok{getHeader(t){return this.headerP||(this.headerP=this._getHeader(t).catch(n=>{throw this.headerP=void 0,n})),this.headerP}constructor(t){const{filehandle:n,renameRefSeqs:r=o=>o,path:i,url:a}=t;if(this.renameRefSeqs=r,n)this.bbi=n;else if(a)this.bbi=new po(a);else if(i)this.bbi=new kt(i);else throw new Error("no file given")}async _getHeader(t){const n=await this._getMainHeader(t),r=await this._readChromTree(n,t);return{...n,...r}}async _getMainHeader(t,n=2e3){const{buffer:r}=await this.bbi.read(we.Buffer.alloc(n),0,n,0,t),i=this._isBigEndian(r),a=ak(i),o=a.headerParser.parse(r),{magic:s,asOffset:c,totalSummaryOffset:l}=o;if(o.fileType=s===i2?"bigbed":"bigwig",c>n||l>n)return this._getMainHeader(t,n*2);if(c){const u=Number(o.asOffset);o.autoSql=gK(r.subarray(u,r.indexOf(0,u)))}if(o.totalSummaryOffset>n)return this._getMainHeader(t,n*2);if(o.totalSummaryOffset){const u=r.subarray(Number(o.totalSummaryOffset)),f=a.totalSummaryParser.parse(u);o.totalSummary={...f,basesCovered:Number(f.basesCovered)}}return{...o,isBigEndian:i}}_isBigEndian(t){let n=t.readInt32LE(0);if(n===ik||n===i2)return!1;if(n=t.readInt32BE(0),n===ik||n===i2)return!0;throw new Error("not a BigWig/BigBed file")}async _readChromTree(t,n){const r=t.isBigEndian,i=r?"big":"little",a=[],o={};let s=Number(t.unzoomedDataOffset);const c=Number(t.chromTreeOffset);for(;s%4!==0;)s+=1;const l=s-c,{buffer:u}=await this.bbi.read(we.Buffer.alloc(l),0,l,Number(c),n),f=ak(r),{keySize:h}=f.chromTreeParser.parse(u),d=new Fe().endianess(i).string("key",{stripNull:!0,length:h}).uint32("refId").uint32("refSize").saveOffset("offset"),p=new Fe().endianess(i).skip(h).uint64("childOffset").saveOffset("offset"),g=32,b=async v=>{let x=v;if(x>=u.length)throw new Error("reading beyond end of buffer");const A=f.isLeafNode.parse(u.subarray(x)),{isLeafNode:w,cnt:_}=A;if(x+=A.offset,w)for(let C=0;C<_;C+=1){const I=d.parse(u.subarray(x));x+=I.offset;const{key:D,refId:B,refSize:G}=I,z={name:D,id:B,length:G};o[this.renameRefSeqs(D)]=B,a[B]=z}else{const C=[];for(let I=0;I<_;I+=1){const D=p.parse(u.subarray(x)),{childOffset:B}=D;x+=D.offset,C.push(b(Number(B)-Number(c)))}await Promise.all(C)}};return await b(g),{refsByName:o,refsByNumber:a}}async getUnzoomedView(t){const{unzoomedIndexOffset:n,refsByName:r,uncompressBufSize:i,isBigEndian:a,fileType:o}=await this.getHeader(t);return new T8(this.bbi,r,n,a,i>0,o)}async getFeatureStream(t,n,r,i){await this.getHeader(i);const a=this.renameRefSeqs(t);let o;const{basesPerSpan:s,scale:c}=i||{};return s?o=await this.getView(1/s,i):c?o=await this.getView(c,i):o=await this.getView(1,i),new Pn(l=>{o.readWigData(a,n,r,l,i)})}async getFeatures(t,n,r,i){const a=await this.getFeatureStream(t,n,r,i);return(await ek(a.pipe(pK()))).flat()}}class mK extends ok{async getView(t,n){const{zoomLevels:r,refsByName:i,fileSize:a,isBigEndian:o,uncompressBufSize:s}=await this.getHeader(n),c=1/t;let l=r.length;a||(l-=1);for(let u=l;u>=0;u-=1){const f=r[u];if(f&&f.reductionLevel<=2*c){const h=Number(f.indexOffset);return new T8(this.bbi,i,h,o,s>0,"summary")}}return this.getUnzoomedView(n)}}function bK(e){return e.filter(t=>!!t)}class yK extends ok{constructor(){super(...arguments),this.readIndicesCache=new v0({cache:new w0({maxSize:1}),fill:(t,n)=>this._readIndices({...t,signal:n})})}readIndices(t={}){const{signal:n,...r}=t;return this.readIndicesCache.get(JSON.stringify(r),t,n)}async getView(t,n){return this.getUnzoomedView(n)}async _readIndices(t){const{extHeaderOffset:n,isBigEndian:r}=await this.getHeader(t),{buffer:i}=await this.bbi.read(we.Buffer.alloc(64),0,64,Number(n)),a=r?"big":"little",o=new Fe().endianess(a).uint16("size").uint16("count").uint64("offset").parse(i),{count:s,offset:c}=o;if(s===0)return[];const l=20,u=l*s,{buffer:f}=await this.bbi.read(we.Buffer.alloc(u),0,u,Number(c)),h=new Fe().endianess(a).int16("type").int16("fieldcount").uint64("offset").skip(4).int16("field"),d=[];for(let p=0;p<s;p+=1)d.push(h.parse(f.subarray(p*l)));return d}async searchExtraIndexBlocks(t,n={}){const{isBigEndian:r}=await this.getHeader(n),i=await this.readIndices(n);if(i.length===0)return[];const a=i.map(async o=>{const{offset:s,field:c}=o,{buffer:l}=await this.bbi.read(we.Buffer.alloc(32),0,32,Number(s),n),u=r?"big":"little",f=new Fe().endianess(u).int32("magic").int32("blockSize").int32("keySize").int32("valSize").uint64("itemCount"),{blockSize:h,keySize:d,valSize:p}=f.parse(l),g=new Fe().endianess(u).int8("nodeType").skip(1).int16("cnt").choice({tag:"nodeType",choices:{0:new Fe().array("leafkeys",{length:"cnt",type:new Fe().endianess(u).string("key",{length:d,stripNull:!0}).uint64("offset")}),1:new Fe().array("keys",{length:"cnt",type:new Fe().endianess(u).string("key",{length:d,stripNull:!0}).uint64("offset").uint32("length").uint32("reserved")})}}),b=async x=>{const A=Number(x),w=4+h*(d+p),{buffer:_}=await this.bbi.read(we.Buffer.alloc(w),0,w,A,n),C=g.parse(_);if(C.leafkeys){let I;for(let D=0;D<C.leafkeys.length;D+=1){const{key:B}=C.leafkeys[D];if(t.localeCompare(B)<0&&I)return b(I);I=C.leafkeys[D].offset}return b(I)}for(let I=0;I<C.keys.length;I+=1)if(C.keys[I].key===t)return{...C.keys[I],field:c}},v=32;return b(Number(s)+v)});return bK(await Promise.all(a))}async searchExtraIndex(t,n={}){const r=await this.searchExtraIndexBlocks(t,n);if(r.length===0)return[];const i=await this.getUnzoomedView(n),a=r.map(s=>new Pn(c=>{i.readFeatures(c,[s],n)}).pipe(rk((c,l)=>c.concat(l)),tk(c=>{for(const l of c)l.field=s.field;return c})));return(await ek(fK(...a))).filter(s=>{var c;return((c=s.rest)===null||c===void 0?void 0:c.split(" ")[(s.field||0)-3])===t})}}const sk=Object.freeze(Object.defineProperty({__proto__:null,BigBed:yK,BigWig:mK},Symbol.toStringTag,{value:"Module"}));function vK(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function ec(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ec)}vK(ec,Error),ec.buildMessage=function(e,t){var n={literal:function(l){return'"'+i(l.text)+'"'},class:function(l){var u="",f;for(f=0;f<l.parts.length;f++)u+=l.parts[f]instanceof Array?a(l.parts[f][0])+"-"+a(l.parts[f][1]):a(l.parts[f]);return"["+(l.inverted?"^":"")+u+"]"},any:function(l){return"any character"},end:function(l){return"end of input"},other:function(l){return l.description}};function r(l){return l.charCodeAt(0).toString(16).toUpperCase()}function i(l){return l.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function a(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function o(l){return n[l.type](l)}function s(l){var u=new Array(l.length),f,h;for(f=0;f<l.length;f++)u[f]=o(l[f]);if(u.sort(),u.length>0){for(f=1,h=1;f<u.length;f++)u[f-1]!==u[f]&&(u[h]=u[f],h++);u.length=h}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function c(l){return l?'"'+i(l)+'"':"end of input"}return"Expected "+s(e)+" but "+c(t)+" found."};function wK(e,t){t=t!==void 0?t:{};var n={},r={declaration:DT},i=DT,a="(",o=ze("(",!1),s=")",c=ze(")",!1),l=function(k,U,K,ee){return{type:k,name:U,comment:K,fields:ee}},u="simple",f=ze("simple",!1),h="object",d=ze("object",!1),p="table",g=ze("table",!1),b="auto",v=ze("auto",!1),x="primary",A=ze("primary",!1),w="index",_=ze("index",!1),C="unique",I=ze("unique",!1),D=function(k,U){return U},B=function(k,U){return k.name&&U.unshift(k),U},G="#",z=ze("#",!1),ae=";",se=ze(";",!1),ve=function(k,U,K){return{type:k,name:U,comment:K}},Pe="[",st=ze("[",!1),Ne="]",lt=ze("]",!1),tt=function(k,U,K,ee){return{type:k,size:U,name:K,comment:ee}},ut=function(k,U,K,ee){return{type:k,vals:U,name:K,comment:ee}},Te=",",Ie=ze(",",!1),Rt=function(k,U){return U.unshift(k),U},ln="int",Ve=ze("int",!1),L="uint",O=ze("uint",!1),W="short",j=ze("short",!1),Q="ushort",T=ze("ushort",!1),S="byte",V=ze("byte",!1),Y="ubyte",de=ze("ubyte",!1),ie="float",pe=ze("float",!1),un="char",ua=ze("char",!1),fa="string",ha=ze("string",!1),Gt="lstring",fi=ze("lstring",!1),da="enum",fn=ze("enum",!1),Br="double",E=ze("double",!1),m="bigint",y=ze("bigint",!1),R="set",M=ze("set",!1),N=function(k,U){return k+" "+U},q=/^[a-zA-Z_]/,ge=Cf([["a","z"],["A","Z"],"_"],!1,!1),Ze=/^[a-zA-Z0-9_]/,$e=Cf([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),nt=function(k){return kT()},Re=/^[^\n\r]/,AT=Cf([`
|
3204
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function D8(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var e2=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Zu(o),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(g){t={error:g}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(vt(u))try{u()}catch(g){a=g instanceof Jy?g.errors:[g]}var f=this._finalizers;if(f){this._finalizers=null;try{for(var h=Zu(f),d=h.next();!d.done;d=h.next()){var p=d.value;try{F8(p)}catch(g){a=a??[],g instanceof Jy?a=Ky(Ky([],Xy(a)),Xy(g.errors)):a.push(g)}}}catch(g){r={error:g}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new Jy(a)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)F8(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&D8(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&D8(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();e2.EMPTY;function B8(e){return e instanceof e2||e&&"closed"in e&&vt(e.remove)&&vt(e.add)&&vt(e.unsubscribe)}function F8(e){vt(e)?e():e.unsubscribe()}var P8={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},M8={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,Ky([e,t],Xy(n)))},clearTimeout:function(e){var t=M8.delegate;return((t==null?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function O8(e){M8.setTimeout(function(){throw e})}function L8(){}function PX(e){e()}var t2=function(e){Qy(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,B8(n)&&n.add(r)):r.destination=NX,r}return t.create=function(n,r,i){return new P0(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(e2),MX=Function.prototype.bind;function n2(e,t){return MX.call(e,t)}var OX=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){M0(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){M0(r)}else M0(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){M0(n)}},e}(),P0=function(e){Qy(t,e);function t(n,r,i){var a=e.call(this)||this,o;if(vt(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;a&&P8.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&n2(n.next,s),error:n.error&&n2(n.error,s),complete:n.complete&&n2(n.complete,s)}):o=n}return a.destination=new OX(o),a}return t}(t2);function M0(e){O8(e)}function LX(e){throw e}var NX={closed:!0,next:L8,error:LX,complete:L8},r2=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function N8(e){return e}function zX(e){return e.length===0?N8:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var Pn=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,a=$X(t)?t:new P0(t,n,r);return PX(function(){var o=i,s=o.operator,c=o.source;a.add(s?s.call(a,c):c?i._subscribe(a):i._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=z8(n),new n(function(i,a){var o=new P0({next:function(s){try{t(s)}catch(c){a(c),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[r2]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return zX(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=z8(t),new t(function(r,i){var a;n.subscribe(function(o){return a=o},function(o){return i(o)},function(){return r(a)})})},e.create=function(t){return new e(t)},e}();function z8(e){var t;return(t=e??P8.Promise)!==null&&t!==void 0?t:Promise}function UX(e){return e&&vt(e.next)&&vt(e.error)&&vt(e.complete)}function $X(e){return e&&e instanceof t2||UX(e)&&B8(e)}function HX(e){return vt(e==null?void 0:e.lift)}function Ks(e){return function(t){if(HX(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Qu(e,t,n,r,i){return new GX(e,t,n,r,i)}var GX=function(e){Qy(t,e);function t(n,r,i,a,o,s){var c=e.call(this,n)||this;return c.onFinalize=o,c.shouldUnsubscribe=s,c._next=r?function(l){try{r(l)}catch(u){n.error(u)}}:e.prototype._next,c._error=a?function(l){try{a(l)}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t}(t2),VX=new Pn(function(e){return e.complete()});function jX(e){return e&&vt(e.schedule)}function U8(e){return e[e.length-1]}function qX(e){return jX(U8(e))?e.pop():void 0}function WX(e,t){return typeof U8(e)=="number"?e.pop():t}var $8=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function H8(e){return vt(e==null?void 0:e.then)}function G8(e){return vt(e[r2])}function V8(e){return Symbol.asyncIterator&&vt(e==null?void 0:e[Symbol.asyncIterator])}function j8(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function YX(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var q8=YX();function W8(e){return vt(e==null?void 0:e[q8])}function Y8(e){return BX(this,arguments,function(){var n,r,i,a;return I8(this,function(o){switch(o.label){case 0:n=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Xs(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,Xs(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Xs(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Z8(e){return vt(e==null?void 0:e.getReader)}function Js(e){if(e instanceof Pn)return e;if(e!=null){if(G8(e))return ZX(e);if($8(e))return QX(e);if(H8(e))return XX(e);if(V8(e))return Q8(e);if(W8(e))return KX(e);if(Z8(e))return JX(e)}throw j8(e)}function ZX(e){return new Pn(function(t){var n=e[r2]();if(vt(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function QX(e){return new Pn(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function XX(e){return new Pn(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,O8)})}function KX(e){return new Pn(function(t){var n,r;try{for(var i=Zu(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function Q8(e){return new Pn(function(t){eK(e,t).catch(function(n){return t.error(n)})})}function JX(e){return Q8(Y8(e))}function eK(e,t){var n,r,i,a;return DX(this,void 0,void 0,function(){var o,s;return I8(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=FX(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function sa(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function X8(e,t){return t===void 0&&(t=0),Ks(function(n,r){n.subscribe(Qu(r,function(i){return sa(r,e,function(){return r.next(i)},t)},function(){return sa(r,e,function(){return r.complete()},t)},function(i){return sa(r,e,function(){return r.error(i)},t)}))})}function K8(e,t){return t===void 0&&(t=0),Ks(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function tK(e,t){return Js(e).pipe(K8(t),X8(t))}function nK(e,t){return Js(e).pipe(K8(t),X8(t))}function rK(e,t){return new Pn(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function iK(e,t){return new Pn(function(n){var r;return sa(n,t,function(){r=e[q8](),sa(n,t,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(s){n.error(s);return}o?n.complete():n.next(a)},0,!0)}),function(){return vt(r==null?void 0:r.return)&&r.return()}})}function J8(e,t){if(!e)throw new Error("Iterable cannot be null");return new Pn(function(n){sa(n,t,function(){var r=e[Symbol.asyncIterator]();sa(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function aK(e,t){return J8(Y8(e),t)}function oK(e,t){if(e!=null){if(G8(e))return tK(e,t);if($8(e))return rK(e,t);if(H8(e))return nK(e,t);if(V8(e))return J8(e,t);if(W8(e))return iK(e,t);if(Z8(e))return aK(e,t)}throw j8(e)}function sK(e,t){return t?oK(e,t):Js(e)}var cK=R8(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function ek(e,t){var n=typeof t=="object";return new Promise(function(r,i){var a=new P0({next:function(o){r(o),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new cK)}});e.subscribe(a)})}function tk(e,t){return Ks(function(n,r){var i=0;n.subscribe(Qu(r,function(a){r.next(e.call(t,a,i++))}))})}function lK(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,f=!1,h=function(){f&&!c.length&&!l&&t.complete()},d=function(g){return l<r?p(g):c.push(g)},p=function(g){a&&t.next(g),l++;var b=!1;Js(n(g,u++)).subscribe(Qu(t,function(v){i==null||i(v),a?d(v):t.next(v)},function(){b=!0},void 0,function(){if(b)try{l--;for(var v=function(){var x=c.shift();o?sa(t,o,function(){return p(x)}):p(x)};c.length&&l<r;)v();h()}catch(x){t.error(x)}}))};return e.subscribe(Qu(t,d,function(){f=!0,h()})),function(){s==null||s()}}function nk(e,t,n){return n===void 0&&(n=1/0),vt(t)?nk(function(r,i){return tk(function(a,o){return t(r,a,i,o)})(Js(e(r,i)))},n):(typeof t=="number"&&(n=t),Ks(function(r,i){return lK(r,i,e,n)}))}function uK(e){return e===void 0&&(e=1/0),nk(N8,e)}function fK(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=qX(e),r=WX(e,1/0),i=e;return i.length?i.length===1?Js(i[0]):uK(r)(sK(i,n)):VX}function hK(e,t,n,r,i){return function(a,o){var s=n,c=t,l=0;a.subscribe(Qu(o,function(u){var f=l++;c=s?e(c,u,f):(s=!0,u),r&&o.next(c)},i&&function(){s&&o.next(c),o.complete()}))}}function rk(e,t){return Ks(hK(e,t,arguments.length>=2,!1,!0))}var dK=function(e,t){return e.push(t),e};function pK(){return Ks(function(e,t){rk(dK,[])(e).subscribe(t)})}const ik=-2003829722,i2=-2021002517;function gK(e){return new TextDecoder().decode(e)}function ak(e){const t=e?"big":"little",n=new Fe().endianess(t).int32("magic").uint16("version").uint16("numZoomLevels").uint64("chromTreeOffset").uint64("unzoomedDataOffset").uint64("unzoomedIndexOffset").uint16("fieldCount").uint16("definedFieldCount").uint64("asOffset").uint64("totalSummaryOffset").uint32("uncompressBufSize").uint64("extHeaderOffset").array("zoomLevels",{length:"numZoomLevels",type:new Fe().endianess(t).uint32("reductionLevel").uint32("reserved").uint64("dataOffset").uint64("indexOffset")}),r=new Fe().endianess(t).uint64("basesCovered").doublele("scoreMin").doublele("scoreMax").doublele("scoreSum").doublele("scoreSumSquares"),i=new Fe().endianess(t).uint32("magic").uint32("blockSize").uint32("keySize").uint32("valSize").uint64("itemCount"),a=new Fe().endianess(t).uint8("isLeafNode").skip(1).uint16("cnt").saveOffset("offset");return{chromTreeParser:i,totalSummaryParser:r,headerParser:n,isLeafNode:a}}class ok{getHeader(t){return this.headerP||(this.headerP=this._getHeader(t).catch(n=>{throw this.headerP=void 0,n})),this.headerP}constructor(t){const{filehandle:n,renameRefSeqs:r=o=>o,path:i,url:a}=t;if(this.renameRefSeqs=r,n)this.bbi=n;else if(a)this.bbi=new po(a);else if(i)this.bbi=new kt(i);else throw new Error("no file given")}async _getHeader(t){const n=await this._getMainHeader(t),r=await this._readChromTree(n,t);return{...n,...r}}async _getMainHeader(t,n=2e3){const{buffer:r}=await this.bbi.read(we.Buffer.alloc(n),0,n,0,t),i=this._isBigEndian(r),a=ak(i),o=a.headerParser.parse(r),{magic:s,asOffset:c,totalSummaryOffset:l}=o;if(o.fileType=s===i2?"bigbed":"bigwig",c>n||l>n)return this._getMainHeader(t,n*2);if(c){const u=Number(o.asOffset);o.autoSql=gK(r.subarray(u,r.indexOf(0,u)))}if(o.totalSummaryOffset>n)return this._getMainHeader(t,n*2);if(o.totalSummaryOffset){const u=r.subarray(Number(o.totalSummaryOffset)),f=a.totalSummaryParser.parse(u);o.totalSummary={...f,basesCovered:Number(f.basesCovered)}}return{...o,isBigEndian:i}}_isBigEndian(t){let n=t.readInt32LE(0);if(n===ik||n===i2)return!1;if(n=t.readInt32BE(0),n===ik||n===i2)return!0;throw new Error("not a BigWig/BigBed file")}async _readChromTree(t,n){const r=t.isBigEndian,i=r?"big":"little",a=[],o={};let s=Number(t.unzoomedDataOffset);const c=Number(t.chromTreeOffset);for(;s%4!==0;)s+=1;const l=s-c,{buffer:u}=await this.bbi.read(we.Buffer.alloc(l),0,l,Number(c),n),f=ak(r),{keySize:h}=f.chromTreeParser.parse(u),d=new Fe().endianess(i).string("key",{stripNull:!0,length:h}).uint32("refId").uint32("refSize").saveOffset("offset"),p=new Fe().endianess(i).skip(h).uint64("childOffset").saveOffset("offset"),g=32,b=async v=>{let x=v;if(x>=u.length)throw new Error("reading beyond end of buffer");const A=f.isLeafNode.parse(u.subarray(x)),{isLeafNode:w,cnt:_}=A;if(x+=A.offset,w)for(let C=0;C<_;C+=1){const I=d.parse(u.subarray(x));x+=I.offset;const{key:D,refId:B,refSize:G}=I,z={name:D,id:B,length:G};o[this.renameRefSeqs(D)]=B,a[B]=z}else{const C=[];for(let I=0;I<_;I+=1){const D=p.parse(u.subarray(x)),{childOffset:B}=D;x+=D.offset,C.push(b(Number(B)-Number(c)))}await Promise.all(C)}};return await b(g),{refsByName:o,refsByNumber:a}}async getUnzoomedView(t){const{unzoomedIndexOffset:n,refsByName:r,uncompressBufSize:i,isBigEndian:a,fileType:o}=await this.getHeader(t);return new T8(this.bbi,r,n,a,i>0,o)}async getFeatureStream(t,n,r,i){await this.getHeader(i);const a=this.renameRefSeqs(t);let o;const{basesPerSpan:s,scale:c}=i||{};return s?o=await this.getView(1/s,i):c?o=await this.getView(c,i):o=await this.getView(1,i),new Pn(l=>{o.readWigData(a,n,r,l,i)})}async getFeatures(t,n,r,i){const a=await this.getFeatureStream(t,n,r,i);return(await ek(a.pipe(pK()))).flat()}}class mK extends ok{async getView(t,n){const{zoomLevels:r,refsByName:i,fileSize:a,isBigEndian:o,uncompressBufSize:s}=await this.getHeader(n),c=1/t;let l=r.length;a||(l-=1);for(let u=l;u>=0;u-=1){const f=r[u];if(f&&f.reductionLevel<=2*c){const h=Number(f.indexOffset);return new T8(this.bbi,i,h,o,s>0,"summary")}}return this.getUnzoomedView(n)}}function bK(e){return e.filter(t=>!!t)}class yK extends ok{constructor(){super(...arguments),this.readIndicesCache=new v0({cache:new w0({maxSize:1}),fill:(t,n)=>this._readIndices({...t,signal:n})})}readIndices(t={}){const{signal:n,...r}=t;return this.readIndicesCache.get(JSON.stringify(r),t,n)}async getView(t,n){return this.getUnzoomedView(n)}async _readIndices(t){const{extHeaderOffset:n,isBigEndian:r}=await this.getHeader(t),{buffer:i}=await this.bbi.read(we.Buffer.alloc(64),0,64,Number(n)),a=r?"big":"little",o=new Fe().endianess(a).uint16("size").uint16("count").uint64("offset").parse(i),{count:s,offset:c}=o;if(s===0)return[];const l=20,u=l*s,{buffer:f}=await this.bbi.read(we.Buffer.alloc(u),0,u,Number(c)),h=new Fe().endianess(a).int16("type").int16("fieldcount").uint64("offset").skip(4).int16("field"),d=[];for(let p=0;p<s;p+=1)d.push(h.parse(f.subarray(p*l)));return d}async searchExtraIndexBlocks(t,n={}){const{isBigEndian:r}=await this.getHeader(n),i=await this.readIndices(n);if(i.length===0)return[];const a=i.map(async o=>{const{offset:s,field:c}=o,{buffer:l}=await this.bbi.read(we.Buffer.alloc(32),0,32,Number(s),n),u=r?"big":"little",f=new Fe().endianess(u).int32("magic").int32("blockSize").int32("keySize").int32("valSize").uint64("itemCount"),{blockSize:h,keySize:d,valSize:p}=f.parse(l),g=new Fe().endianess(u).int8("nodeType").skip(1).int16("cnt").choice({tag:"nodeType",choices:{0:new Fe().array("leafkeys",{length:"cnt",type:new Fe().endianess(u).string("key",{length:d,stripNull:!0}).uint64("offset")}),1:new Fe().array("keys",{length:"cnt",type:new Fe().endianess(u).string("key",{length:d,stripNull:!0}).uint64("offset").uint32("length").uint32("reserved")})}}),b=async x=>{const A=Number(x),w=4+h*(d+p),{buffer:_}=await this.bbi.read(we.Buffer.alloc(w),0,w,A,n),C=g.parse(_);if(C.leafkeys){let I;for(let D=0;D<C.leafkeys.length;D+=1){const{key:B}=C.leafkeys[D];if(t.localeCompare(B)<0&&I)return b(I);I=C.leafkeys[D].offset}return b(I)}for(let I=0;I<C.keys.length;I+=1)if(C.keys[I].key===t)return{...C.keys[I],field:c}},v=32;return b(Number(s)+v)});return bK(await Promise.all(a))}async searchExtraIndex(t,n={}){const r=await this.searchExtraIndexBlocks(t,n);if(r.length===0)return[];const i=await this.getUnzoomedView(n),a=r.map(s=>new Pn(c=>{i.readFeatures(c,[s],n)}).pipe(rk((c,l)=>c.concat(l)),tk(c=>{for(const l of c)l.field=s.field;return c})));return(await ek(fK(...a))).filter(s=>{var c;return((c=s.rest)===null||c===void 0?void 0:c.split(" ")[(s.field||0)-3])===t})}}const sk=Object.freeze(Object.defineProperty({__proto__:null,BigBed:yK,BigWig:mK},Symbol.toStringTag,{value:"Module"}));function vK(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}function ec(e,t,n,r){this.message=e,this.expected=t,this.found=n,this.location=r,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ec)}vK(ec,Error),ec.buildMessage=function(e,t){var n={literal:function(l){return'"'+i(l.text)+'"'},class:function(l){var u="",f;for(f=0;f<l.parts.length;f++)u+=l.parts[f]instanceof Array?a(l.parts[f][0])+"-"+a(l.parts[f][1]):a(l.parts[f]);return"["+(l.inverted?"^":"")+u+"]"},any:function(l){return"any character"},end:function(l){return"end of input"},other:function(l){return l.description}};function r(l){return l.charCodeAt(0).toString(16).toUpperCase()}function i(l){return l.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function a(l){return l.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function o(l){return n[l.type](l)}function s(l){var u=new Array(l.length),f,h;for(f=0;f<l.length;f++)u[f]=o(l[f]);if(u.sort(),u.length>0){for(f=1,h=1;f<u.length;f++)u[f-1]!==u[f]&&(u[h]=u[f],h++);u.length=h}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function c(l){return l?'"'+i(l)+'"':"end of input"}return"Expected "+s(e)+" but "+c(t)+" found."};function wK(e,t){t=t!==void 0?t:{};var n={},r={declaration:DT},i=DT,a="(",o=ze("(",!1),s=")",c=ze(")",!1),l=function(k,U,K,ee){return{type:k,name:U,comment:K,fields:ee}},u="simple",f=ze("simple",!1),h="object",d=ze("object",!1),p="table",g=ze("table",!1),b="auto",v=ze("auto",!1),x="primary",A=ze("primary",!1),w="index",_=ze("index",!1),C="unique",I=ze("unique",!1),D=function(k,U){return U},B=function(k,U){return k.name&&U.unshift(k),U},G="#",z=ze("#",!1),ae=";",se=ze(";",!1),ve=function(k,U,K){return{type:k,name:U,comment:K}},Pe="[",st=ze("[",!1),Ne="]",lt=ze("]",!1),tt=function(k,U,K,ee){return{type:k,size:U,name:K,comment:ee}},ut=function(k,U,K,ee){return{type:k,vals:U,name:K,comment:ee}},Te=",",Ie=ze(",",!1),Rt=function(k,U){return U.unshift(k),U},ln="int",Ve=ze("int",!1),L="uint",O=ze("uint",!1),W="short",j=ze("short",!1),Q="ushort",T=ze("ushort",!1),S="byte",V=ze("byte",!1),Y="ubyte",de=ze("ubyte",!1),ie="float",pe=ze("float",!1),un="char",fa=ze("char",!1),ha="string",da=ze("string",!1),Gt="lstring",fi=ze("lstring",!1),pa="enum",fn=ze("enum",!1),Dr="double",E=ze("double",!1),m="bigint",y=ze("bigint",!1),R="set",M=ze("set",!1),N=function(k,U){return k+" "+U},q=/^[a-zA-Z_]/,ge=Cf([["a","z"],["A","Z"],"_"],!1,!1),Ze=/^[a-zA-Z0-9_]/,$e=Cf([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),nt=function(k){return kT()},Re=/^[^\n\r]/,AT=Cf([`
|
3205
3205
|
`,"\r"],!0,!1),UJ=function(k){return k.join("").replace(/^"/,"").replace(/"$/,"")},$J=TT("integer"),ET=/^[0-9]/,ST=Cf([["0","9"]],!1,!1),HJ=function(){return parseInt(kT(),10)},GJ=TT("whitespace"),_T=/^[ \t\n\r]/,CT=Cf([" "," ",`
|
3206
|
-
`,"\r"],!1,!1),F=0,Zt=0,up=[{line:1,column:1}],
|
3206
|
+
`,"\r"],!1,!1),F=0,Zt=0,up=[{line:1,column:1}],Br=0,$2=[],ce=0,fp;if("startRule"in t){if(!(t.startRule in r))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');i=r[t.startRule]}function kT(){return e.substring(Zt,F)}function ze(k,U){return{type:"literal",text:k,ignoreCase:U}}function Cf(k,U,K){return{type:"class",parts:k,inverted:U,ignoreCase:K}}function VJ(){return{type:"end"}}function TT(k){return{type:"other",description:k}}function IT(k){var U=up[k],K;if(U)return U;for(K=k-1;!up[K];)K--;for(U=up[K],U={line:U.line,column:U.column};K<k;)e.charCodeAt(K)===10?(U.line++,U.column=1):U.column++,K++;return up[k]=U,U}function RT(k,U){var K=IT(k),ee=IT(U);return{start:{offset:k,line:K.line,column:K.column},end:{offset:U,line:ee.line,column:ee.column}}}function fe(k){F<Br||(F>Br&&(Br=F,$2=[]),$2.push(k))}function jJ(k,U,K){return new ec(ec.buildMessage(k,U),k,U,K)}function DT(){var k,U,K,ee,oe,je,rt,Nn,ga,hi,ma,di,ba,pi;return k=F,U=xe(),U!==n?(K=BT(),K!==n?(ee=xe(),ee!==n?(oe=FT(),oe!==n?(je=xe(),je!==n?(rt=hp(),rt!==n?(Nn=xe(),Nn!==n?(e.charCodeAt(F)===40?(ga=a,F++):(ga=n,ce===0&&fe(o)),ga!==n?(hi=xe(),hi!==n?(ma=qJ(),ma!==n?(di=xe(),di!==n?(e.charCodeAt(F)===41?(ba=s,F++):(ba=n,ce===0&&fe(c)),ba!==n?(pi=xe(),pi!==n?(Zt=k,U=l(K,oe,rt,ma),k=U):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function BT(){var k;return e.substr(F,6)===u?(k=u,F+=6):(k=n,ce===0&&fe(f)),k===n&&(e.substr(F,6)===h?(k=h,F+=6):(k=n,ce===0&&fe(d)),k===n&&(e.substr(F,5)===p?(k=p,F+=5):(k=n,ce===0&&fe(g)))),k}function FT(){var k,U,K,ee;return k=ir(),k===n&&(k=F,U=ir(),U!==n?(K=PT(),K!==n?(U=[U,K],k=U):(F=k,k=n)):(F=k,k=n),k===n&&(k=F,U=ir(),U!==n?(e.substr(F,4)===b?(K=b,F+=4):(K=n,ce===0&&fe(v)),K!==n?(U=[U,K],k=U):(F=k,k=n)):(F=k,k=n),k===n&&(k=F,U=ir(),U!==n?(K=PT(),K!==n?(e.substr(F,4)===b?(ee=b,F+=4):(ee=n,ce===0&&fe(v)),ee!==n?(U=[U,K,ee],k=U):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)))),k}function PT(){var k;return e.substr(F,7)===x?(k=x,F+=7):(k=n,ce===0&&fe(A)),k===n&&(e.substr(F,5)===w?(k=w,F+=5):(k=n,ce===0&&fe(_)),k===n&&(e.substr(F,6)===C?(k=C,F+=6):(k=n,ce===0&&fe(I)))),k}function hp(){var k;return k=MT(),k===n&&(k=xe()),k}function qJ(){var k,U,K,ee,oe,je,rt;if(k=F,U=H2(),U!==n)if(K=xe(),K!==n){for(ee=[],oe=F,je=xe(),je!==n?(rt=H2(),rt!==n?(Zt=oe,je=D(U,rt),oe=je):(F=oe,oe=n)):(F=oe,oe=n);oe!==n;)ee.push(oe),oe=F,je=xe(),je!==n?(rt=H2(),rt!==n?(Zt=oe,je=D(U,rt),oe=je):(F=oe,oe=n)):(F=oe,oe=n);ee!==n?(oe=xe(),oe!==n?(Zt=k,U=B(U,ee),k=U):(F=k,k=n)):(F=k,k=n)}else F=k,k=n;else F=k,k=n;return k}function WJ(){var k;return e.charCodeAt(F)===35?(k=G,F++):(k=n,ce===0&&fe(z)),k}function YJ(){var k,U,K,ee,oe;return k=F,U=xe(),U!==n?(K=WJ(),K!==n?(ee=MT(),ee!==n?(oe=xe(),oe!==n?(U=[U,K,ee,oe],k=U):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k}function H2(){var k,U,K,ee,oe,je,rt,Nn,ga,hi,ma,di,ba,pi;return k=F,U=G2(),U!==n?(K=xe(),K!==n?(ee=ir(),ee!==n?(oe=xe(),oe!==n?(e.charCodeAt(F)===59?(je=ae,F++):(je=n,ce===0&&fe(se)),je!==n?(rt=xe(),rt!==n?(Nn=hp(),Nn!==n?(Zt=k,U=ve(U,ee,Nn),k=U):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k===n&&(k=F,U=G2(),U!==n?(K=xe(),K!==n?(e.charCodeAt(F)===91?(ee=Pe,F++):(ee=n,ce===0&&fe(st)),ee!==n?(oe=xe(),oe!==n?(je=QJ(),je!==n?(rt=xe(),rt!==n?(e.charCodeAt(F)===93?(Nn=Ne,F++):(Nn=n,ce===0&&fe(lt)),Nn!==n?(ga=xe(),ga!==n?(hi=ir(),hi!==n?(ma=xe(),ma!==n?(e.charCodeAt(F)===59?(di=ae,F++):(di=n,ce===0&&fe(se)),di!==n?(ba=xe(),ba!==n?(pi=hp(),pi!==n?(Zt=k,U=tt(U,je,hi,pi),k=U):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k===n&&(k=F,U=G2(),U!==n?(K=xe(),K!==n?(e.charCodeAt(F)===40?(ee=a,F++):(ee=n,ce===0&&fe(o)),ee!==n?(oe=xe(),oe!==n?(je=ZJ(),je!==n?(rt=xe(),rt!==n?(e.charCodeAt(F)===41?(Nn=s,F++):(Nn=n,ce===0&&fe(c)),Nn!==n?(ga=xe(),ga!==n?(hi=ir(),hi!==n?(ma=xe(),ma!==n?(e.charCodeAt(F)===59?(di=ae,F++):(di=n,ce===0&&fe(se)),di!==n?(ba=xe(),ba!==n?(pi=hp(),pi!==n?(Zt=k,U=ut(U,je,hi,pi),k=U):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n)):(F=k,k=n),k===n&&(k=YJ()))),k}function ZJ(){var k,U,K,ee,oe,je,rt;if(k=F,U=ir(),U!==n){for(K=[],ee=F,e.charCodeAt(F)===44?(oe=Te,F++):(oe=n,ce===0&&fe(Ie)),oe!==n?(je=xe(),je!==n?(rt=ir(),rt!==n?(Zt=ee,oe=D(U,rt),ee=oe):(F=ee,ee=n)):(F=ee,ee=n)):(F=ee,ee=n);ee!==n;)K.push(ee),ee=F,e.charCodeAt(F)===44?(oe=Te,F++):(oe=n,ce===0&&fe(Ie)),oe!==n?(je=xe(),je!==n?(rt=ir(),rt!==n?(Zt=ee,oe=D(U,rt),ee=oe):(F=ee,ee=n)):(F=ee,ee=n)):(F=ee,ee=n);K!==n?(Zt=k,U=Rt(U,K),k=U):(F=k,k=n)}else F=k,k=n;return k}function G2(){var k,U,K,ee;return e.substr(F,3)===ln?(k=ln,F+=3):(k=n,ce===0&&fe(Ve)),k===n&&(e.substr(F,4)===L?(k=L,F+=4):(k=n,ce===0&&fe(O)),k===n&&(e.substr(F,5)===W?(k=W,F+=5):(k=n,ce===0&&fe(j)),k===n&&(e.substr(F,6)===Q?(k=Q,F+=6):(k=n,ce===0&&fe(T)),k===n&&(e.substr(F,4)===S?(k=S,F+=4):(k=n,ce===0&&fe(V)),k===n&&(e.substr(F,5)===Y?(k=Y,F+=5):(k=n,ce===0&&fe(de)),k===n&&(e.substr(F,5)===ie?(k=ie,F+=5):(k=n,ce===0&&fe(pe)),k===n&&(e.substr(F,4)===un?(k=un,F+=4):(k=n,ce===0&&fe(fa)),k===n&&(e.substr(F,6)===ha?(k=ha,F+=6):(k=n,ce===0&&fe(da)),k===n&&(e.substr(F,7)===Gt?(k=Gt,F+=7):(k=n,ce===0&&fe(fi)),k===n&&(e.substr(F,4)===pa?(k=pa,F+=4):(k=n,ce===0&&fe(fn)),k===n&&(e.substr(F,6)===Dr?(k=Dr,F+=6):(k=n,ce===0&&fe(E)),k===n&&(e.substr(F,6)===m?(k=m,F+=6):(k=n,ce===0&&fe(y)),k===n&&(e.substr(F,3)===R?(k=R,F+=3):(k=n,ce===0&&fe(M)),k===n&&(k=F,U=BT(),U!==n?(K=xe(),K!==n?(ee=FT(),ee!==n?(Zt=k,U=N(U,ee),k=U):(F=k,k=n)):(F=k,k=n)):(F=k,k=n))))))))))))))),k}function QJ(){var k;return k=XJ(),k===n&&(k=ir()),k}function ir(){var k,U,K,ee,oe;if(k=F,U=F,q.test(e.charAt(F))?(K=e.charAt(F),F++):(K=n,ce===0&&fe(ge)),K!==n){for(ee=[],Ze.test(e.charAt(F))?(oe=e.charAt(F),F++):(oe=n,ce===0&&fe($e));oe!==n;)ee.push(oe),Ze.test(e.charAt(F))?(oe=e.charAt(F),F++):(oe=n,ce===0&&fe($e));ee!==n?(K=[K,ee],U=K):(F=U,U=n)}else F=U,U=n;return U!==n&&(Zt=k,U=nt()),k=U,k}function MT(){var k,U,K;for(k=F,U=[],Re.test(e.charAt(F))?(K=e.charAt(F),F++):(K=n,ce===0&&fe(AT));K!==n;)U.push(K),Re.test(e.charAt(F))?(K=e.charAt(F),F++):(K=n,ce===0&&fe(AT));return U!==n&&(Zt=k,U=UJ(U)),k=U,k}function XJ(){var k,U,K,ee;if(ce++,k=F,U=xe(),U!==n){if(K=[],ET.test(e.charAt(F))?(ee=e.charAt(F),F++):(ee=n,ce===0&&fe(ST)),ee!==n)for(;ee!==n;)K.push(ee),ET.test(e.charAt(F))?(ee=e.charAt(F),F++):(ee=n,ce===0&&fe(ST));else K=n;K!==n?(Zt=k,U=HJ(),k=U):(F=k,k=n)}else F=k,k=n;return ce--,k===n&&(U=n,ce===0&&fe($J)),k}function xe(){var k,U;for(ce++,k=[],_T.test(e.charAt(F))?(U=e.charAt(F),F++):(U=n,ce===0&&fe(CT));U!==n;)k.push(U),_T.test(e.charAt(F))?(U=e.charAt(F),F++):(U=n,ce===0&&fe(CT));return ce--,k===n&&(U=n,ce===0&&fe(GJ)),k}if(fp=i(),fp!==n&&F===e.length)return fp;throw fp!==n&&F<e.length&&fe(VJ()),jJ($2,Br<e.length?e.charAt(Br):null,Br<e.length?RT(Br,Br+1):RT(Br,Br))}var ck={SyntaxError:ec,parse:wK};const xK=uu(ck),a2=Object.fromEntries(Object.entries(Object.freeze(Object.defineProperty({__proto__:null,bigChain:`table bigChain
|
3207
3207
|
"bigChain pairwise alignment"
|
3208
3208
|
(
|
3209
3209
|
string chrom; "Reference sequence chromosome or scaffold"
|
@@ -3362,9 +3362,9 @@ ${n}</textarea
|
|
3362
3362
|
float score; "Floating point score."
|
3363
3363
|
char[1] leftStatus; "Gap/break annotation for preceding block"
|
3364
3364
|
char[1] rightStatus; "Gap/break annotation for following block"
|
3365
|
-
)`},Symbol.toStringTag,{value:"Module"}))).map(([e,t])=>[e,ck.parse(t.trim())]));function o2(e){const t=["uint","int","float","long"];return{...e,fields:e.fields.map(n=>({...n,isArray:n.size&&n.type!=="char",arrayIsNumeric:n.size&&t.includes(n.type),isNumeric:!n.size&&t.includes(n.type)}))}}const AK={".":0,"-":-1,"+":1};function EK(e){var t;return e.length>=12&&!Number.isNaN(parseInt(e[9],10))&&((t=e[10])===null||t===void 0?void 0:t.split(",").filter(n=>!!n).length)===parseInt(e[9],10)}class SK{constructor(t={}){if(t.autoSql)this.autoSql=o2(xK.parse(t.autoSql));else if(t.type){if(!a2[t.type])throw new Error("Type not found");this.autoSql=o2(a2[t.type])}else this.autoSql=o2(a2.defaultBedSchema),this.attemptDefaultBed=!0}parseLine(t,n={}){const{autoSql:r}=this,{uniqueId:i}=n,a=Array.isArray(t)?t:t.split(" ");let o={};if(!this.attemptDefaultBed||this.attemptDefaultBed&&EK(a))for(let s=0;s<r.fields.length;s++){const c=r.fields[s];let l=a[s];const{isNumeric:u,isArray:f,arrayIsNumeric:h,name:d}=c;if(l==null)break;if(l!=="."){if(u){const p=Number(l);l=Number.isNaN(p)?l:p}else f&&(l=l.split(","),l[l.length-1]===""&&l.pop(),h&&(l=l.map(p=>Number(p))));o[d]=l}}else{const s=["chrom","chromStart","chromEnd","name"];o=Object.fromEntries(a.map((c,l)=>[s[l]||"field"+l,c])),o.chromStart=+o.chromStart,o.chromEnd=+o.chromEnd,Number.isNaN(Number.parseFloat(o.field4))||(o.score=+o.field4,delete o.field4),(o.field5==="+"||o.field5==="-")&&(o.strand=o.field5,delete o.field5)}return i&&(o.uniqueId=i),o.strand=AK[o.strand]||0,o.chrom=decodeURIComponent(o.chrom),o}}const _K=Object.freeze(Object.defineProperty({__proto__:null,default:SK},Symbol.toStringTag,{value:"Module"}));let lk=class{constructor(t,n){this.blockPosition=t,this.dataPosition=n}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(t){return this.blockPosition-t.blockPosition||this.dataPosition-t.dataPosition}static min(...t){let n,r=0;for(;!n;r+=1)n=t[r];for(;r<t.length;r+=1)n.compareTo(t[r])>0&&(n=t[r]);return n}};function tc(e,t=0,n=!1){if(n)throw new Error("big-endian virtual file offsets not implemented");return new lk(e[t+7]*1099511627776+e[t+6]*4294967296+e[t+5]*16777216+e[t+4]*65536+e[t+3]*256+e[t+2],e[t+1]<<8|e[t])}let uk=class{constructor(t,n,r,i){this.minv=t,this.maxv=n,this.bin=r,this._fetchedSize=i}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(t){return this.minv.compareTo(t.minv)||this.maxv.compareTo(t.maxv)||this.bin-t.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}};function CK(e){return new Promise(t=>setTimeout(t,e))}function kK(e){if(e.greaterThan(Number.MAX_SAFE_INTEGER)||e.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return e.toNumber()}function TK(e){if(e&&e.aborted)if(typeof DOMException>"u"){const t=new Error("aborted");throw t.code="ERR_ABORTED",t}else throw new DOMException("aborted","AbortError")}function IK(e,t){return t.minv.blockPosition-e.maxv.blockPosition<65e3&&t.maxv.blockPosition-e.minv.blockPosition<5e6}function RK(e={}){return"aborted"in e?{signal:e}:e}function fk(e,t){const n=[];let r;if(e.length===0)return e;e.sort((i,a)=>{const o=i.minv.blockPosition-a.minv.blockPosition;return o===0?i.minv.dataPosition-a.minv.dataPosition:o});for(const i of e)(!t||i.maxv.compareTo(t)>0)&&(r===void 0?(n.push(i),r=i):IK(r,i)?i.maxv.compareTo(r.maxv)>0&&(r.maxv=i.maxv):(n.push(i),r=i));return n}function hk(e,t){return{lineCount:kK(f0.fromBytesLE(Array.prototype.slice.call(e,t,t+8),!0))}}function O0(e,t){return e?e.compareTo(t)>0?t:e:t}function DK(e,t=n=>n){let n=0,r=0;const i=[],a={};for(let o=0;o<e.length;o+=1)if(!e[o]){if(r<o){let s=e.toString("utf8",r,o);s=t(s),i[n]=s,a[s]=n}r=o+1,n+=1}return{refNameToId:a,refIdToName:i}}let dk=class{constructor({filehandle:t,renameRefSeq:n=r=>r}){this.filehandle=t,this.renameRefSeq=n}};const BK=21578050;function FK(e,t){return e-e%t}function PK(e,t){return e-e%t+t}function MK(e,t){return t-=1,[[0,0],[1+(e>>26),1+(t>>26)],[9+(e>>23),9+(t>>23)],[73+(e>>20),73+(t>>20)],[585+(e>>17),585+(t>>17)],[4681+(e>>14),4681+(t>>14)]]}class nc extends dk{async lineCount(t,n){var r,i;return((i=(r=(await this.parse(n)).indices[t])===null||r===void 0?void 0:r.stats)===null||i===void 0?void 0:i.lineCount)||0}async _parse(t){const n=await this.filehandle.readFile(t);if(n.readUInt32LE(0)!==BK)throw new Error("Not a BAI file");const r=n.readInt32LE(4),a=((1<<(5+1)*3)-1)/7;let o=8,s;const c=new Array(r);for(let l=0;l<r;l++){const u=n.readInt32LE(o);let f;o+=4;const h={};for(let g=0;g<u;g+=1){const b=n.readUInt32LE(o);if(o+=4,b===a+1)o+=4,f=hk(n,o+16),o+=32;else{if(b>a+1)throw new Error("bai index contains too many bins, please use CSI");{const v=n.readInt32LE(o);o+=4;const x=new Array(v);for(let A=0;A<v;A++){const w=tc(n,o);o+=8;const _=tc(n,o);o+=8,s=O0(s,w),x[A]=new uk(w,_,b)}h[b]=x}}}const d=n.readInt32LE(o);o+=4;const p=new Array(d);for(let g=0;g<d;g++){const b=tc(n,o);o+=8,s=O0(s,b),p[g]=b}c[l]={binIndex:h,linearIndex:p,stats:f}}return{bai:!0,firstDataLine:s,maxBlockSize:65536,indices:c,refCount:r}}async indexCov(t,n,r,i={}){const o=n!==void 0,c=(await this.parse(i)).indices[t];if(!c)return[];const{linearIndex:l=[],stats:u}=c;if(l.length===0)return[];const f=r===void 0?(l.length-1)*16384:PK(r,16384),h=n===void 0?0:FK(n,16384),d=o?new Array((f-h)/16384):new Array(l.length-1),p=l[l.length-1].blockPosition;if(f>(l.length-1)*16384)throw new Error("query outside of range of linear index");let g=l[h/16384].blockPosition;for(let b=h/16384,v=0;b<f/16384;b++,v++)d[v]={score:l[b+1].blockPosition-g,start:b*16384,end:b*16384+16384},g=l[b+1].blockPosition;return d.map(b=>({...b,score:b.score*((u==null?void 0:u.lineCount)||0)/p}))}async blocksForRange(t,n,r,i={}){n<0&&(n=0);const a=await this.parse(i);if(!a)return[];const o=a.indices[t];if(!o)return[];const s=MK(n,r),c=[];for(const[d,p]of s)for(let g=d;g<=p;g++)if(o.binIndex[g]){const b=o.binIndex[g];for(const v of b)c.push(v)}const l=o.linearIndex.length;let u;const f=Math.min(n>>14,l-1),h=Math.min(r>>14,l-1);for(let d=f;d<=h;++d){const p=o.linearIndex[d];p&&(!u||p.compareTo(u)<0)&&(u=p)}return fk(c,u)}async parse(t={}){return this.setupP||(this.setupP=this._parse(t).catch(n=>{throw this.setupP=void 0,n})),this.setupP}async hasRefSeq(t,n={}){var r;return!!(!((r=(await this.parse(n)).indices[t])===null||r===void 0)&&r.binIndex)}}var sa=we.Buffer,s2=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(s2=new Int32Array(s2));function pk(e){if(sa.isBuffer(e))return e;var t=typeof sa.alloc=="function"&&typeof sa.from=="function";if(typeof e=="number")return t?sa.alloc(e):new sa(e);if(typeof e=="string")return t?sa.from(e):new sa(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function OK(e){var t=pk(4);return t.writeInt32BE(e,0),t}function c2(e,t){e=pk(e),sa.isBuffer(t)&&(t=t.readUInt32BE(0));for(var n=~~t^-1,r=0;r<e.length;r++)n=s2[(n^e[r])&255]^n>>>8;return n^-1}function l2(){return OK(c2.apply(null,arguments))}l2.signed=function(){return c2.apply(null,arguments)},l2.unsigned=function(){return c2.apply(null,arguments)>>>0};var LK=l2;const NK=uu(LK),zK=21582659,UK=38359875;function $K(e,t){return e*2**t}function gk(e,t){return Math.floor(e/2**t)}let L0=class extends dk{constructor(){super(...arguments),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(t,n){var r,i;return((i=(r=(await this.parse(n)).indices[t])===null||r===void 0?void 0:r.stats)===null||i===void 0?void 0:i.lineCount)||0}async indexCov(){return[]}parseAuxData(t,n){const r=t.readInt32LE(n),i=r&65536?"zero-based-half-open":"1-based-closed",a={0:"generic",1:"SAM",2:"VCF"}[r&15];if(!a)throw new Error(`invalid Tabix preset format flags ${r}`);const o={ref:t.readInt32LE(n+4),start:t.readInt32LE(n+8),end:t.readInt32LE(n+12)},s=t.readInt32LE(n+16),c=s?String.fromCharCode(s):"",l=t.readInt32LE(n+20),u=t.readInt32LE(n+24);return{columnNumbers:o,coordinateType:i,metaValue:s,metaChar:c,skipLines:l,format:a,formatFlags:r,...DK(t.subarray(n+28,n+28+u),this.renameRefSeq)}}async _parse(t){const n=await this.filehandle.readFile(t),r=await Ji(n);let i;if(r.readUInt32LE(0)===zK)i=1;else if(r.readUInt32LE(0)===UK)i=2;else throw new Error("Not a CSI file");this.minShift=r.readInt32LE(4),this.depth=r.readInt32LE(8),this.maxBinNumber=((1<<(this.depth+1)*3)-1)/7;const a=r.readInt32LE(12),o=a>=30?this.parseAuxData(r,16):void 0,s=r.readInt32LE(16+a);let c=16+a+4,l;const u=new Array(s);for(let f=0;f<s;f++){const h=r.readInt32LE(c);c+=4;const d={};let p;for(let g=0;g<h;g++){const b=r.readUInt32LE(c);if(c+=4,b>this.maxBinNumber)p=hk(r,c+28),c+=28+16;else{l=O0(l,tc(r,c)),c+=8;const v=r.readInt32LE(c);c+=4;const x=new Array(v);for(let A=0;A<v;A+=1){const w=tc(r,c);c+=8;const _=tc(r,c);c+=8,l=O0(l,w),x[A]=new uk(w,_,b)}d[b]=x}}u[f]={binIndex:d,stats:p}}return{csiVersion:i,firstDataLine:l,indices:u,refCount:s,csi:!0,maxBlockSize:65536,...o}}async blocksForRange(t,n,r,i={}){n<0&&(n=0);const a=await this.parse(i),o=a==null?void 0:a.indices[t];if(!o)return[];const s=this.reg2bins(n,r);if(s.length===0)return[];const c=[];for(const[l,u]of s)for(let f=l;f<=u;f++)if(o.binIndex[f]){const h=o.binIndex[f];for(const d of h)c.push(d)}return fk(c,new lk(0,0))}reg2bins(t,n){t-=1,t<1&&(t=1),n>2**50&&(n=2**34),n-=1;let r=0,i=0,a=this.minShift+this.depth*3;const o=[];for(;r<=this.depth;a-=3,i+=$K(1,r*3),r+=1){const s=i+gk(t,a),c=i+gk(n,a);if(c-s+o.length>this.maxBinNumber)throw new Error(`query ${t}-${n} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);o.push([s,c])}return o}async parse(t={}){return this.setupP||(this.setupP=this._parse(t).catch(n=>{throw this.setupP=void 0,n})),this.setupP}async hasRefSeq(t,n={}){var r;return!!(!((r=(await this.parse(n)).indices[t])===null||r===void 0)&&r.binIndex)}};const Mn={BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048},mk="=ACMGRSVTWYHKDBN".split(""),Xu="MIDNSHP=X???????".split("");class bk{constructor(t){this.data={},this._tagList=[],this._allTagsParsed=!1;const{bytes:n,fileOffset:r}=t,{byteArray:i,start:a}=n;this.data={},this.bytes=n,this._id=r,this._refID=i.readInt32LE(a+4),this.data.start=i.readInt32LE(a+8),this.flags=(i.readInt32LE(a+16)&4294901760)>>16}get(t){return this[t]?this.data[t]?this.data[t]:(this.data[t]=this[t](),this.data[t]):this._get(t.toLowerCase())}end(){return this.get("start")+this.get("length_on_ref")}seq_id(){return this._refID}_get(t){return t in this.data?this.data[t]:(this.data[t]=this._parseTag(t),this.data[t])}_tags(){this._parseAllTags();let t=["seq"];this.isSegmentUnmapped()||t.push("start","end","strand","score","qual","MQ","CIGAR","length_on_ref","template_length"),this.isPaired()&&t.push("next_segment_position","pair_orientation"),t=t.concat(this._tagList||[]);for(const r of Object.keys(this.data))r[0]!=="_"&&r!=="next_seq_id"&&t.push(r);const n={};return t.filter(r=>{if(r in this.data&&this.data[r]===void 0||r==="CG"||r==="cg")return!1;const i=r.toLowerCase(),a=n[i];return n[i]=!0,!a})}parent(){}children(){return this.get("subfeatures")}id(){return this._id}mq(){const t=(this.get("_bin_mq_nl")&65280)>>8;return t===255?void 0:t}score(){return this.get("mq")}qual(){var t;return(t=this.qualRaw())===null||t===void 0?void 0:t.join(" ")}qualRaw(){if(this.isSegmentUnmapped())return;const{start:t,byteArray:n}=this.bytes,r=t+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4+this.get("_seq_bytes"),i=this.get("seq_length");return n.subarray(r,r+i)}strand(){return this.isReverseComplemented()?-1:1}multi_segment_next_segment_strand(){if(!this.isMateUnmapped())return this.isMateReverseComplemented()?-1:1}name(){return this.get("_read_name")}_read_name(){const t=this.get("_l_read_name"),{byteArray:n,start:r}=this.bytes;return n.toString("ascii",r+36,r+36+t-1)}_parseTag(t){if(this._allTagsParsed)return;const{byteArray:n,start:r}=this.bytes;let i=this._tagOffset||r+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4+this.get("_seq_bytes")+this.get("seq_length");const a=this.bytes.end;let o;for(;i<a&&o!==t;){const s=String.fromCharCode(n[i],n[i+1]);o=s.toLowerCase();const c=String.fromCharCode(n[i+2]);i+=3;let l;switch(c){case"A":{l=String.fromCharCode(n[i]),i+=1;break}case"i":{l=n.readInt32LE(i),i+=4;break}case"I":{l=n.readUInt32LE(i),i+=4;break}case"c":{l=n.readInt8(i),i+=1;break}case"C":{l=n.readUInt8(i),i+=1;break}case"s":{l=n.readInt16LE(i),i+=2;break}case"S":{l=n.readUInt16LE(i),i+=2;break}case"f":{l=n.readFloatLE(i),i+=4;break}case"Z":case"H":{for(l="";i<=a;){const u=n[i++];if(u===0)break;l+=String.fromCharCode(u)}break}case"B":{l="";const u=n[i++],f=String.fromCharCode(u),h=n.readInt32LE(i);if(i+=4,f==="i")if(s==="CG")for(let d=0;d<h;d++){const p=n.readInt32LE(i),g=p>>4,b=Xu[p&15];l+=g+b,i+=4}else for(let d=0;d<h;d++)l+=n.readInt32LE(i),d+1<h&&(l+=","),i+=4;if(f==="I")if(s==="CG")for(let d=0;d<h;d++){const p=n.readUInt32LE(i),g=p>>4,b=Xu[p&15];l+=g+b,i+=4}else for(let d=0;d<h;d++)l+=n.readUInt32LE(i),d+1<h&&(l+=","),i+=4;if(f==="s")for(let d=0;d<h;d++)l+=n.readInt16LE(i),d+1<h&&(l+=","),i+=2;if(f==="S")for(let d=0;d<h;d++)l+=n.readUInt16LE(i),d+1<h&&(l+=","),i+=2;if(f==="c")for(let d=0;d<h;d++)l+=n.readInt8(i),d+1<h&&(l+=","),i+=1;if(f==="C")for(let d=0;d<h;d++)l+=n.readUInt8(i),d+1<h&&(l+=","),i+=1;if(f==="f")for(let d=0;d<h;d++)l+=n.readFloatLE(i),d+1<h&&(l+=","),i+=4;break}default:console.warn(`Unknown BAM tag type '${c}', tags may be incomplete`),l=void 0,i=a}if(this._tagOffset=i,this._tagList.push(s),o===t)return l;this.data[o]=l}this._allTagsParsed=!0}_parseAllTags(){this._parseTag("")}_parseCigar(t){return t.match(/\d+\D/g).map(n=>[n.match(/\D/)[0].toUpperCase(),Number.parseInt(n,10)])}isPaired(){return!!(this.flags&Mn.BAM_FPAIRED)}isProperlyPaired(){return!!(this.flags&Mn.BAM_FPROPER_PAIR)}isSegmentUnmapped(){return!!(this.flags&Mn.BAM_FUNMAP)}isMateUnmapped(){return!!(this.flags&Mn.BAM_FMUNMAP)}isReverseComplemented(){return!!(this.flags&Mn.BAM_FREVERSE)}isMateReverseComplemented(){return!!(this.flags&Mn.BAM_FMREVERSE)}isRead1(){return!!(this.flags&Mn.BAM_FREAD1)}isRead2(){return!!(this.flags&Mn.BAM_FREAD2)}isSecondary(){return!!(this.flags&Mn.BAM_FSECONDARY)}isFailedQc(){return!!(this.flags&Mn.BAM_FQCFAIL)}isDuplicate(){return!!(this.flags&Mn.BAM_FDUP)}isSupplementary(){return!!(this.flags&Mn.BAM_FSUPPLEMENTARY)}cigar(){if(this.isSegmentUnmapped())return;const{byteArray:t,start:n}=this.bytes,r=this.get("_n_cigar_op");let i=n+36+this.get("_l_read_name");const a=this.get("seq_length");let o="",s=0,c=t.readInt32LE(i),l=c>>4,u=Xu[c&15];if(u==="S"&&l===a)return i+=4,c=t.readInt32LE(i),l=c>>4,u=Xu[c&15],u!=="N"&&console.warn("CG tag with no N tag"),this.data.length_on_ref=l,this.get("CG");for(let f=0;f<r;++f)c=t.readInt32LE(i),l=c>>4,u=Xu[c&15],o+=l+u,u!=="H"&&u!=="S"&&u!=="I"&&(s+=l),i+=4;return this.data.length_on_ref=s,o}_flags(){}length_on_ref(){return this.data.length_on_ref?this.data.length_on_ref:(this.get("cigar"),this.data.length_on_ref)}_n_cigar_op(){return this.get("_flag_nc")&65535}_l_read_name(){return this.get("_bin_mq_nl")&255}_seq_bytes(){return this.get("seq_length")+1>>1}getReadBases(){return this.seq()}seq(){const{byteArray:t,start:n}=this.bytes,r=n+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4,i=this.get("_seq_bytes"),a=this.get("seq_length");let o="",s=0;for(let c=0;c<i;++c){const l=t[r+c];o+=mk[(l&240)>>4],s++,s<a&&(o+=mk[l&15],s++)}return o}getPairOrientation(){if(!this.isSegmentUnmapped()&&!this.isMateUnmapped()&&this._refID===this._next_refid()){const t=this.isReverseComplemented()?"R":"F",n=this.isMateReverseComplemented()?"R":"F";let r=" ",i=" ";this.isRead1()?(r="1",i="2"):this.isRead2()&&(r="2",i="1");const a=[];return this.template_length()>0?(a[0]=t,a[1]=r,a[2]=n,a[3]=i):(a[2]=t,a[3]=r,a[0]=n,a[1]=i),a.join("")}return""}_bin_mq_nl(){return this.bytes.byteArray.readInt32LE(this.bytes.start+12)}_flag_nc(){return this.bytes.byteArray.readInt32LE(this.bytes.start+16)}seq_length(){return this.bytes.byteArray.readInt32LE(this.bytes.start+20)}_next_refid(){return this.bytes.byteArray.readInt32LE(this.bytes.start+24)}_next_pos(){return this.bytes.byteArray.readInt32LE(this.bytes.start+28)}template_length(){return this.bytes.byteArray.readInt32LE(this.bytes.start+32)}toJSON(){const t={};for(const n of Object.keys(this))n.charAt(0)==="_"||n==="bytes"||(t[n]=this[n]);return t}}function yk(e){const t=e.split(/\r?\n/),n=[];for(const r of t){const[i,...a]=r.split(/\t/);i&&n.push({tag:i.slice(1),data:a.map(o=>{const[s,c]=o.split(":",2);return{tag:s,value:c}})})}return n}const vk=21840194,wk=65536;async function HK(e){let t=[];for await(const n of e)t=t.concat(n);return t}class GK{read(){throw new Error("never called")}stat(){throw new Error("never called")}readFile(){throw new Error("never called")}close(){throw new Error("never called")}}class xk{constructor({bamFilehandle:t,bamPath:n,bamUrl:r,baiPath:i,baiFilehandle:a,baiUrl:o,csiPath:s,csiFilehandle:c,csiUrl:l,htsget:u,yieldThreadTime:f=100,renameRefSeqs:h=d=>d}){if(this.htsget=!1,this.featureCache=new v0({cache:new w0({maxSize:50}),fill:async(d,p)=>{const{chunk:g,opts:b}=d,{data:v,cpositions:x,dpositions:A}=await this._readChunk({chunk:g,opts:{...b,signal:p}});return this.readBamFeatures(v,x,A,g)}}),this.renameRefSeq=h,t)this.bam=t;else if(n)this.bam=new kt(n);else if(r)this.bam=new po(r);else if(u)this.htsget=!0,this.bam=new GK;else throw new Error("unable to initialize bam");if(c)this.index=new L0({filehandle:c});else if(s)this.index=new L0({filehandle:new kt(s)});else if(l)this.index=new L0({filehandle:new po(l)});else if(a)this.index=new nc({filehandle:a});else if(i)this.index=new nc({filehandle:new kt(i)});else if(o)this.index=new nc({filehandle:new po(o)});else if(n)this.index=new nc({filehandle:new kt(`${n}.bai`)});else if(r)this.index=new nc({filehandle:new po(`${r}.bai`)});else if(u)this.htsget=!0;else throw new Error("unable to infer index format");this.yieldThreadTime=f}async getHeaderPre(t){const n=RK(t);if(!this.index)return;const r=await this.index.parse(n),i=r.firstDataLine?r.firstDataLine.blockPosition+65535:void 0;let a;if(i){const u=i+wk,f=await this.bam.read(we.Buffer.alloc(u),0,u,0,n);if(!f.bytesRead)throw new Error("Error reading header");a=f.buffer.subarray(0,Math.min(f.bytesRead,i))}else a=await this.bam.readFile(n);const o=await Ji(a);if(o.readInt32LE(0)!==vk)throw new Error("Not a BAM file");const s=o.readInt32LE(4);this.header=o.toString("utf8",8,8+s);const{chrToIndex:c,indexToChr:l}=await this._readRefSeqs(s+8,65535,n);return this.chrToIndex=c,this.indexToChr=l,yk(this.header)}getHeader(t){return this.headerP||(this.headerP=this.getHeaderPre(t).catch(n=>{throw this.headerP=void 0,n})),this.headerP}async getHeaderText(t={}){return await this.getHeader(t),this.header}async _readRefSeqs(t,n,r){if(t>n)return this._readRefSeqs(t,n*2,r);const i=n+wk,{bytesRead:a,buffer:o}=await this.bam.read(we.Buffer.alloc(i),0,n,0,r);if(!a)throw new Error("Error reading refseqs from header");const s=await Ji(o.subarray(0,Math.min(a,n))),c=s.readInt32LE(t);let l=t+4;const u={},f=[];for(let h=0;h<c;h+=1){const d=s.readInt32LE(l),p=this.renameRefSeq(s.toString("utf8",l+4,l+4+d-1)),g=s.readInt32LE(l+d+4);if(u[p]=h,f.push({refName:p,length:g}),l=l+8+d,l>s.length)return console.warn(`BAM header is very big. Re-fetching ${n} bytes.`),this._readRefSeqs(t,n*2,r)}return{chrToIndex:u,indexToChr:f}}async getRecordsForRange(t,n,r,i){return HK(this.streamRecordsForRange(t,n,r,i))}async*streamRecordsForRange(t,n,r,i){var a;await this.getHeader(i);const o=(a=this.chrToIndex)===null||a===void 0?void 0:a[t];if(o===void 0||!this.index)yield[];else{const s=await this.index.blocksForRange(o,n-1,r,i);yield*this._fetchChunkFeatures(s,o,n,r,i)}}async*_fetchChunkFeatures(t,n,r,i,a={}){const{viewAsPairs:o}=a,s=[];let c=!1;for(const l of t){const u=await this.featureCache.get(l.toString(),{chunk:l,opts:a},a.signal),f=[];for(const h of u)if(h.seq_id()===n)if(h.get("start")>=i){c=!0;break}else h.get("end")>=r&&f.push(h);if(s.push(f),yield f,c)break}TK(a.signal),o&&(yield this.fetchPairs(n,s,a))}async fetchPairs(t,n,r){const{pairAcrossChr:i,maxInsertSize:a=2e5}=r,o={},s={};n.map(h=>{const d={};for(const p of h){const g=p.name(),b=p.id();d[g]||(d[g]=0),d[g]++,s[b]=1}for(const[p,g]of Object.entries(d))g===1&&(o[p]=!0)});const c=[];n.map(h=>{for(const d of h){const p=d.name(),g=d.get("start"),b=d._next_pos(),v=d._next_refid();this.index&&o[p]&&(i||v===t&&Math.abs(g-b)<a)&&c.push(this.index.blocksForRange(v,b,b+1,r))}});const l=new Map,u=await Promise.all(c);for(const h of u.flat())l.has(h.toString())||l.set(h.toString(),h);return(await Promise.all([...l.values()].map(async h=>{const{data:d,cpositions:p,dpositions:g,chunk:b}=await this._readChunk({chunk:h,opts:r}),v=[];for(const x of await this.readBamFeatures(d,p,g,b))o[x.get("name")]&&!s[x.id()]&&v.push(x);return v}))).flat()}async _readRegion(t,n,r={}){const{bytesRead:i,buffer:a}=await this.bam.read(we.Buffer.alloc(n),0,n,t,r);return a.subarray(0,Math.min(i,n))}async _readChunk({chunk:t,opts:n}){const r=await this._readRegion(t.minv.blockPosition,t.fetchedSize(),n),{buffer:i,cpositions:a,dpositions:o}=await $C(r,t);return{data:i,cpositions:a,dpositions:o,chunk:t}}async readBamFeatures(t,n,r,i){let a=0;const o=[];let s=0,c=+Date.now();for(;a+4<t.length;){const l=t.readInt32LE(a),u=a+4+l-1;if(r){for(;a+i.minv.dataPosition>=r[s++];);s--}if(u<t.length){const f=new bk({bytes:{byteArray:t,start:a,end:u},fileOffset:n.length>0?n[s]*256+(a-r[s])+i.minv.dataPosition+1:NK.signed(t.slice(a,u))});o.push(f),this.yieldThreadTime&&+Date.now()-c>this.yieldThreadTime&&(await CK(1),c=+Date.now())}a=u+1}return o}async hasRefSeq(t){var n,r;const i=(n=this.chrToIndex)===null||n===void 0?void 0:n[t];return i===void 0?!1:(r=this.index)===null||r===void 0?void 0:r.hasRefSeq(i)}async lineCount(t){var n;const r=(n=this.chrToIndex)===null||n===void 0?void 0:n[t];return r===void 0||!this.index?0:this.index.lineCount(r)}async indexCov(t,n,r){var i;if(!this.index)return[];await this.index.parse();const a=(i=this.chrToIndex)===null||i===void 0?void 0:i[t];return a===void 0?[]:this.index.indexCov(a,n,r)}async blocksForRange(t,n,r,i){var a;if(!this.index)return[];await this.index.parse();const o=(a=this.chrToIndex)===null||a===void 0?void 0:a[t];return o===void 0?[]:this.index.blocksForRange(o,n,r,i)}}async function Ak(e,t){const n=await Promise.all(e.map(async r=>{const{url:i,headers:a}=r;if(i.startsWith("data:"))return we.Buffer.from(i.split(",")[1],"base64");{const{referer:o,...s}=a,c=await fetch(i,{...t,headers:{...t==null?void 0:t.headers,...s}});if(!c.ok)throw new Error(`HTTP ${c.status} fetching ${i}: ${await c.text()}`);return we.Buffer.from(await c.arrayBuffer())}}));return we.Buffer.concat(await Promise.all(n.map(r=>Ji(r))))}class VK extends xk{constructor(t){super({htsget:!0}),this.baseUrl=t.baseUrl,this.trackId=t.trackId}async*streamRecordsForRange(t,n,r,i){var a;const s=`${`${this.baseUrl}/${this.trackId}`}?referenceName=${t}&start=${n}&end=${r}&format=BAM`,c=(a=this.chrToIndex)===null||a===void 0?void 0:a[t];if(c===void 0)yield[];else{const l=await fetch(s,{...i});if(!l.ok)throw new Error(`HTTP ${l.status} fetching ${s}: ${await l.text()}`);const u=await l.json(),f=await Ak(u.htsget.urls.slice(1),i);yield*this._fetchChunkFeatures([{buffer:f,_fetchedSize:void 0,bin:0,compareTo(){return 0},toUniqueString(){return`${t}_${n}_${r}`},fetchedSize(){return 0},minv:{dataPosition:0,blockPosition:0,compareTo:()=>0},maxv:{dataPosition:Number.MAX_SAFE_INTEGER,blockPosition:0,compareTo:()=>0},toString(){return`${t}_${n}_${r}`}}],c,n,r,i)}}async _readChunk({chunk:t}){if(!t.buffer)throw new Error("expected chunk.buffer in htsget");return{data:t.buffer,cpositions:[],dpositions:[],chunk:t}}async getHeader(t={}){const n=`${this.baseUrl}/${this.trackId}?referenceName=na&class=header`,r=await fetch(n,t);if(!r.ok)throw new Error(`HTTP ${r.status} fetching ${n}: ${await r.text()}`);const i=await r.json(),a=await Ak(i.htsget.urls,t);if(a.readInt32LE(0)!==vk)throw new Error("Not a BAM file");const o=a.readInt32LE(4),s=a.toString("utf8",8,8+o),c=yk(s),l=[],u={},f=c.filter(h=>h.tag==="SQ");for(const[h,d]of f.entries()){let p="",g=0;for(const b of d.data)b.tag==="SN"?p=b.value:b.tag==="LN"&&(g=+b.value);u[p]=h,l[h]={refName:p,length:g}}return this.chrToIndex=u,this.indexToChr=l,c}}const jK=Object.freeze(Object.defineProperty({__proto__:null,BAI:nc,BamFile:xk,BamRecord:bk,CSI:L0,HtsgetFile:VK},Symbol.toStringTag,{value:"Module"}));function Ek(e){if(e.greaterThan(Number.MAX_SAFE_INTEGER)||e.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return e.toNumber()}class qK extends Error{}function rc(e){if(e&&e.aborted){if(typeof DOMException<"u")throw new DOMException("aborted","AbortError");{const t=new qK("aborted");throw t.code="ERR_ABORTED",t}}}function WK(e,t){return t.minv.blockPosition-e.maxv.blockPosition<65e3&&t.maxv.blockPosition-e.minv.blockPosition<5e6}function Sk(e,t){const n=[];let r=null;return e.length===0?e:(e.sort(function(i,a){const o=i.minv.blockPosition-a.minv.blockPosition;return o!==0?o:i.minv.dataPosition-a.minv.dataPosition}),e.forEach(i=>{(!t||i.maxv.compareTo(t)>0)&&(r===null?(n.push(i),r=i):WK(r,i)?i.maxv.compareTo(r.maxv)>0&&(r.maxv=i.maxv):(n.push(i),r=i))}),n)}class u2{constructor(t,n){this.blockPosition=t,this.dataPosition=n}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(t){return this.blockPosition-t.blockPosition||this.dataPosition-t.dataPosition}static min(...t){let n,r=0;for(;!n;r+=1)n=t[r];for(;r<t.length;r+=1)n.compareTo(t[r])>0&&(n=t[r]);return n}}function ic(e,t=0,n=!1){if(n)throw new Error("big-endian virtual file offsets not implemented");return new u2(e[t+7]*1099511627776+e[t+6]*4294967296+e[t+5]*16777216+e[t+4]*65536+e[t+3]*256+e[t+2],e[t+1]<<8|e[t])}class N0{constructor(t,n,r,i=void 0){this.minv=t,this.maxv=n,this.bin=r,this._fetchedSize=i}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(t){return this.minv.compareTo(t.minv)||this.maxv.compareTo(t.maxv)||this.bin-t.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}class _k{constructor({filehandle:t,renameRefSeqs:n=r=>r}){this.filehandle=t,this.renameRefSeq=n}async getMetadata(t={}){const{indices:n,...r}=await this.parse(t);return r}_findFirstData(t,n){return t?t.compareTo(n)>0?n:t:n}async parse(t={}){return this.parseP||(this.parseP=this._parse(t).catch(n=>{throw this.parseP=void 0,n})),this.parseP}async hasRefSeq(t,n={}){var r;return!!(!((r=(await this.parse(n)).indices[t])===null||r===void 0)&&r.binIndex)}}const YK=21578324,Ck=14;function ZK(e,t){return e+=1,t-=1,[[0,0],[1+(e>>26),1+(t>>26)],[9+(e>>23),9+(t>>23)],[73+(e>>20),73+(t>>20)],[585+(e>>17),585+(t>>17)],[4681+(e>>14),4681+(t>>14)]]}class z0 extends _k{async lineCount(t,n={}){const r=await this.parse(n);if(!r)return-1;const i=r.refNameToId[t];if(!r.indices[i])return-1;const{stats:o}=r.indices[i];return o?o.lineCount:-1}async _parse(t={}){const n=await this.filehandle.readFile(t),r=await Ji(n);if(rc(t.signal),r.readUInt32LE(0)!==YK)throw new Error("Not a TBI file");const i=r.readInt32LE(4),a=r.readInt32LE(8),o=a&65536?"zero-based-half-open":"1-based-closed",c={0:"generic",1:"SAM",2:"VCF"}[a&15];if(!c)throw new Error(`invalid Tabix preset format flags ${a}`);const l={ref:r.readInt32LE(12),start:r.readInt32LE(16),end:r.readInt32LE(20)},u=r.readInt32LE(24),f=5,h=((1<<(f+1)*3)-1)/7,d=2**(14+f*3),p=u?String.fromCharCode(u):null,g=r.readInt32LE(28),b=r.readInt32LE(32),{refNameToId:v,refIdToName:x}=this._parseNameBytes(r.slice(36,36+b));let A=36+b,w;return{indices:new Array(i).fill(0).map(()=>{const C=r.readInt32LE(A);A+=4;const I={};let D;for(let z=0;z<C;z+=1){const ae=r.readUInt32LE(A);if(A+=4,ae>h+1)throw new Error("tabix index contains too many bins, please use a CSI index");if(ae===h+1){const se=r.readInt32LE(A);A+=4,se===2&&(D=this.parsePseudoBin(r,A)),A+=16*se}else{const se=r.readInt32LE(A);A+=4;const ve=new Array(se);for(let Pe=0;Pe<se;Pe+=1){const st=ic(r,A),Ne=ic(r,A+8);A+=16,w=this._findFirstData(w,st),ve[Pe]=new N0(st,Ne,ae)}I[ae]=ve}}const B=r.readInt32LE(A);A+=4;const G=new Array(B);for(let z=0;z<B;z+=1)G[z]=ic(r,A),A+=8,w=this._findFirstData(w,G[z]);return{binIndex:I,linearIndex:G,stats:D}}),metaChar:p,maxBinNumber:h,maxRefLength:d,skipLines:g,firstDataLine:w,columnNumbers:l,coordinateType:o,format:c,refIdToName:x,refNameToId:v,maxBlockSize:65536}}parsePseudoBin(t,n){return{lineCount:Ek(f0.fromBytesLE(t.slice(n+16,n+24),!0))}}_parseNameBytes(t){let n=0,r=0;const i=[],a={};for(let o=0;o<t.length;o+=1)if(!t[o]){if(r<o){let s=t.toString("utf8",r,o);s=this.renameRefSeq(s),i[n]=s,a[s]=n}r=o+1,n+=1}return{refNameToId:a,refIdToName:i}}async blocksForRange(t,n,r,i={}){n<0&&(n=0);const a=await this.parse(i);if(!a)return[];const o=a.refNameToId[t],s=a.indices[o];if(!s)return[];(s.linearIndex.length?s.linearIndex[n>>Ck>=s.linearIndex.length?s.linearIndex.length-1:n>>Ck]:new u2(0,0))||console.warn("querying outside of possible tabix range");const l=ZK(n,r),u=[];for(const[g,b]of l)for(let v=g;v<=b;v++)if(s.binIndex[v])for(const x of s.binIndex[v])u.push(new N0(x.minv,x.maxv,v));const f=s.linearIndex.length;let h=null;const d=Math.min(n>>14,f-1),p=Math.min(r>>14,f-1);for(let g=d;g<=p;++g){const b=s.linearIndex[g];b&&(!h||b.compareTo(h)<0)&&(h=b)}return Sk(u,h)}}const QK=21582659,XK=38359875;function KK(e,t){return e*2**t}function kk(e,t){return Math.floor(e/2**t)}class f2 extends _k{constructor(t){super(t),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(t,n={}){const r=await this.parse(n);if(!r)return-1;const i=r.refNameToId[t];if(!r.indices[i])return-1;const{stats:o}=r.indices[i];return o?o.lineCount:-1}indexCov(){throw new Error("CSI indexes do not support indexcov")}parseAuxData(t,n){const r=t.readInt32LE(n),i=r&65536?"zero-based-half-open":"1-based-closed",a={0:"generic",1:"SAM",2:"VCF"}[r&15];if(!a)throw new Error(`invalid Tabix preset format flags ${r}`);const o={ref:t.readInt32LE(n+4),start:t.readInt32LE(n+8),end:t.readInt32LE(n+12)},s=t.readInt32LE(n+16),c=s?String.fromCharCode(s):null,l=t.readInt32LE(n+20),u=t.readInt32LE(n+24),{refIdToName:f,refNameToId:h}=this._parseNameBytes(t.slice(n+28,n+28+u));return{refIdToName:f,refNameToId:h,skipLines:l,metaChar:c,columnNumbers:o,format:a,coordinateType:i}}_parseNameBytes(t){let n=0,r=0;const i=[],a={};for(let o=0;o<t.length;o+=1)if(!t[o]){if(r<o){let s=t.toString("utf8",r,o);s=this.renameRefSeq(s),i[n]=s,a[s]=n}r=o+1,n+=1}return{refNameToId:a,refIdToName:i}}async _parse(t={}){const n=await Ji(await this.filehandle.readFile(t));let r;if(n.readUInt32LE(0)===QK)r=1;else if(n.readUInt32LE(0)===XK)r=2;else throw new Error("Not a CSI file");this.minShift=n.readInt32LE(4),this.depth=n.readInt32LE(8),this.maxBinNumber=((1<<(this.depth+1)*3)-1)/7;const i=2**(this.minShift+this.depth*3),a=n.readInt32LE(12),o=a&&a>=30?this.parseAuxData(n,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},s=n.readInt32LE(16+a);let c,l=16+a+4;const u=new Array(s).fill(0).map(()=>{const f=n.readInt32LE(l);l+=4;const h={};let d;for(let p=0;p<f;p+=1){const g=n.readUInt32LE(l);if(g>this.maxBinNumber)d=this.parsePseudoBin(n,l+4),l+=4+8+4+16+16;else{const b=ic(n,l+4);c=this._findFirstData(c,b);const v=n.readInt32LE(l+12);l+=16;const x=new Array(v);for(let A=0;A<v;A+=1){const w=ic(n,l),_=ic(n,l+8);l+=16,x[A]=new N0(w,_,g)}h[g]=x}}return{binIndex:h,stats:d}});return{...o,csi:!0,refCount:s,maxBlockSize:65536,firstDataLine:c,csiVersion:r,indices:u,depth:this.depth,maxBinNumber:this.maxBinNumber,maxRefLength:i}}parsePseudoBin(t,n){return{lineCount:Ek(f0.fromBytesLE(t.slice(n+28,n+36),!0))}}async blocksForRange(t,n,r,i={}){n<0&&(n=0);const a=await this.parse(i);if(!a)return[];const o=a.refNameToId[t],s=a.indices[o];if(!s)return[];const c=this.reg2bins(n,r),l=[];for(const[u,f]of c)for(let h=u;h<=f;h++)if(s.binIndex[h])for(const d of s.binIndex[h])l.push(new N0(d.minv,d.maxv,h));return Sk(l,new u2(0,0))}reg2bins(t,n){t-=1,t<1&&(t=1),n>2**50&&(n=2**34),n-=1;let r=0,i=0,a=this.minShift+this.depth*3;const o=[];for(;r<=this.depth;a-=3,i+=KK(1,r*3),r+=1){const s=i+kk(t,a),c=i+kk(n,a);if(c-s+o.length>this.maxBinNumber)throw new Error(`query ${t}-${n} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);o.push([s,c])}return o}}const h2=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function JK(e){return new Promise(t=>setTimeout(t,e))}class eJ{constructor({path:t,filehandle:n,tbiPath:r,tbiFilehandle:i,csiPath:a,csiFilehandle:o,yieldTime:s=500,chunkSizeLimit:c=5e7,renameRefSeqs:l=f=>f,chunkCacheSize:u=5*2**20}){if(n)this.filehandle=n;else if(t)this.filehandle=new kt(t);else throw new TypeError("must provide either filehandle or path");if(i)this.index=new z0({filehandle:i,renameRefSeqs:l});else if(o)this.index=new f2({filehandle:o,renameRefSeqs:l});else if(r)this.index=new z0({filehandle:new kt(r),renameRefSeqs:l});else if(a)this.index=new f2({filehandle:new kt(a),renameRefSeqs:l});else if(t)this.index=new z0({filehandle:new kt(`${t}.tbi`),renameRefSeqs:l});else throw new TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, or csiPath");this.chunkSizeLimit=c,this.renameRefSeq=l,this.yieldTime=s,this.chunkCache=new v0({cache:new w0({maxSize:Math.floor(u/65536)}),fill:(f,h)=>this.readChunk(f,{signal:h})})}async getLines(t,n,r,i){var a;let o,s={},c;if(i===void 0)throw new TypeError("line callback must be provided");if(typeof i=="function"?c=i:(s=i,c=i.lineCallback,o=i.signal),t===void 0)throw new TypeError("must provide a reference sequence name");if(!c)throw new TypeError("line callback must be provided");const l=await this.index.getMetadata(s);rc(o);const u=n??0,f=r??l.maxRefLength;if(!(u<=f))throw new TypeError("invalid start and end coordinates. start must be less than or equal to end");if(u===f)return;const h=await this.index.blocksForRange(t,u,f,s);rc(o);for(const p of h){const g=p.fetchedSize();if(g>this.chunkSizeLimit)throw new Error(`Too much data. Chunk size ${g.toLocaleString()} bytes exceeds chunkSizeLimit of ${this.chunkSizeLimit.toLocaleString()}.`)}let d=Date.now();for(const p of h){let g;const{buffer:b,cpositions:v,dpositions:x}=await this.chunkCache.get(p.toString(),p,o);rc(o);let A=0,w=0;for(;A<b.length;){const _=b.indexOf(`
|
3366
|
-
`,A);if(_===-1)break;const C=b.slice(A,_),I=(a=h2==null?void 0:h2.decode(C))!==null&&a!==void 0?a:C.toString();if(x){for(;A+p.minv.dataPosition>=x[w++];);w--}const{startCoordinate:D,overlaps:B}=this.checkLine(l,t,u,f,I);if(g!==void 0&&D!==void 0&&g>D)throw new Error(`Lines not sorted by start coordinate (${g} > ${D}), this file is not usable with Tabix.`);if(g=D,B)c(I.trim(),v[w]*256+(A-x[w])+p.minv.dataPosition+1);else if(D!==void 0&&D>=f)return;this.yieldTime&&d-Date.now()>this.yieldTime&&(d=Date.now(),rc(o),await JK(1)),A=_+1}}}async getMetadata(t={}){return this.index.getMetadata(t)}async getHeaderBuffer(t={}){const{firstDataLine:n,metaChar:r,maxBlockSize:i}=await this.getMetadata(t);rc(t.signal);const a=((n==null?void 0:n.blockPosition)||0)+i,o=await this._readRegion(0,a,t),s=await
|
3367
|
-
`.charCodeAt(0),u=r.charCodeAt(0);for(let f=0;f<s.length&&!(f===c+1&&s[f]!==u);f+=1)s[f]===l&&(c=f);return s.slice(0,c+1)}return s}async getHeader(t={}){return(await this.getHeaderBuffer(t)).toString("utf8")}async getReferenceSequenceNames(t={}){return(await this.getMetadata(t)).refIdToName}checkLine(t,n,r,i,a){const{columnNumbers:o,metaChar:s,coordinateType:c,format:l}=t;if(s&&a.startsWith(s))return{overlaps:!1};let{ref:u,start:f,end:h}=o;u||(u=0),f||(f=0),h||(h=0),l==="VCF"&&(h=8);const d=Math.max(u,f,h);let p=1,g=0,b="",v=-1/0;for(let x=0;x<a.length+1;x+=1)if(a[x]===" "||x===a.length){if(p===u){if(this.renameRefSeq(a.slice(g,x))!==n)return{overlaps:!1}}else if(p===f){if(v=parseInt(a.slice(g,x),10),c==="1-based-closed"&&(v-=1),v>=i)return{startCoordinate:v,overlaps:!1};if((h===0||h===f)&&v+1<=r)return{startCoordinate:v,overlaps:!1}}else if(l==="VCF"&&p===4)b=a.slice(g,x);else if(p===h&&(l==="VCF"?this._getVcfEnd(v,b,a.slice(g,x)):parseInt(a.slice(g,x),10))<=r)return{overlaps:!1};if(g=x+1,p+=1,p>d)break}return{startCoordinate:v,overlaps:!0}}_getVcfEnd(t,n,r){let i=t+n.length;const a=r.includes("SVTYPE=TRA");if(r[0]!=="."&&!a){let o=";";for(let s=0;s<r.length;s+=1){if(o===";"&&r.slice(s,s+4)==="END="){let c=r.indexOf(";",s);c===-1&&(c=r.length),i=parseInt(r.slice(s+4,c),10);break}o=r[s]}}else if(a)return t+1;return i}async lineCount(t,n={}){return this.index.lineCount(t,n)}async _readRegion(t,n,r={}){const i=we.Buffer.alloc(n),{bytesRead:a,buffer:o}=await this.filehandle.read(i,0,n,t,r);return o.slice(0,a)}async readChunk(t,n={}){const r=await this._readRegion(t.minv.blockPosition,t.fetchedSize(),n);return $C(r,t)}}const tJ=Object.freeze(Object.defineProperty({__proto__:null,CSI:f2,TBI:z0,TabixIndexedFile:eJ},Symbol.toStringTag,{value:"Module"}));var d2={exports:{}},ac=typeof Reflect=="object"?Reflect:null,Tk=ac&&typeof ac.apply=="function"?ac.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},U0;ac&&typeof ac.ownKeys=="function"?U0=ac.ownKeys:Object.getOwnPropertySymbols?U0=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:U0=function(t){return Object.getOwnPropertyNames(t)};function nJ(e){console&&console.warn&&console.warn(e)}var Ik=Number.isNaN||function(t){return t!==t};function Le(){Le.init.call(this)}d2.exports=Le,d2.exports.once=oJ,Le.EventEmitter=Le,Le.prototype._events=void 0,Le.prototype._eventsCount=0,Le.prototype._maxListeners=void 0;var Rk=10;function $0(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Le,"defaultMaxListeners",{enumerable:!0,get:function(){return Rk},set:function(e){if(typeof e!="number"||e<0||Ik(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Rk=e}}),Le.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},Le.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Ik(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Dk(e){return e._maxListeners===void 0?Le.defaultMaxListeners:e._maxListeners}Le.prototype.getMaxListeners=function(){return Dk(this)},Le.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=t==="error",a=this._events;if(a!==void 0)i=i&&a.error===void 0;else if(!i)return!1;if(i){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=a[t];if(c===void 0)return!1;if(typeof c=="function")Tk(c,this,n);else for(var l=c.length,u=Ok(c,l),r=0;r<l;++r)Tk(u[r],this,n);return!0};function Bk(e,t,n,r){var i,a,o;if($0(n),a=e._events,a===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),o===void 0)o=a[t]=n,++e._eventsCount;else if(typeof o=="function"?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),i=Dk(e),i>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,nJ(s)}return e}Le.prototype.addListener=function(t,n){return Bk(this,t,n,!1)},Le.prototype.on=Le.prototype.addListener,Le.prototype.prependListener=function(t,n){return Bk(this,t,n,!0)};function rJ(){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 Fk(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=rJ.bind(r);return i.listener=n,r.wrapFn=i,i}Le.prototype.once=function(t,n){return $0(n),this.on(t,Fk(this,t,n)),this},Le.prototype.prependOnceListener=function(t,n){return $0(n),this.prependListener(t,Fk(this,t,n)),this},Le.prototype.removeListener=function(t,n){var r,i,a,o,s;if($0(n),i=this._events,i===void 0)return this;if(r=i[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(a=-1,o=r.length-1;o>=0;o--)if(r[o]===n||r[o].listener===n){s=r[o].listener,a=o;break}if(a<0)return this;a===0?r.shift():iJ(r,a),r.length===1&&(i[t]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",t,s||n)}return this},Le.prototype.off=Le.prototype.removeListener,Le.prototype.removeAllListeners=function(t){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var a=Object.keys(r),o;for(i=0;i<a.length;++i)o=a[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(i=n.length-1;i>=0;i--)this.removeListener(t,n[i]);return this};function Pk(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?aJ(i):Ok(i,i.length)}Le.prototype.listeners=function(t){return Pk(this,t,!0)},Le.prototype.rawListeners=function(t){return Pk(this,t,!1)},Le.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Mk.call(e,t)},Le.prototype.listenerCount=Mk;function Mk(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Le.prototype.eventNames=function(){return this._eventsCount>0?U0(this._events):[]};function Ok(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function iJ(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function aJ(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function oJ(e,t){return new Promise(function(n,r){function i(o){e.removeListener(t,a),r(o)}function a(){typeof e.removeListener=="function"&&e.removeListener("error",i),n([].slice.call(arguments))}Lk(e,t,a,{once:!0}),t!=="error"&&sJ(e,i,{once:!0})})}function sJ(e,t,n){typeof e.on=="function"&&Lk(e,"error",t,n)}function Lk(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var p2=d2.exports,g2={exports:{}};typeof Object.create=="function"?g2.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:g2.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var oc=g2.exports,m2,Nk;function zk(){return Nk||(Nk=1,m2=p2.EventEmitter),m2}const Uk=Kj(Iq);var b2,$k;function cJ(){if($k)return b2;$k=1;function e(p,g){var b=Object.keys(p);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(p);g&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),b.push.apply(b,v)}return b}function t(p){for(var g=1;g<arguments.length;g++){var b=arguments[g]!=null?arguments[g]:{};g%2?e(Object(b),!0).forEach(function(v){n(p,v,b[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):e(Object(b)).forEach(function(v){Object.defineProperty(p,v,Object.getOwnPropertyDescriptor(b,v))})}return p}function n(p,g,b){return g=o(g),g in p?Object.defineProperty(p,g,{value:b,enumerable:!0,configurable:!0,writable:!0}):p[g]=b,p}function r(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")}function i(p,g){for(var b=0;b<g.length;b++){var v=g[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(p,o(v.key),v)}}function a(p,g,b){return g&&i(p.prototype,g),b&&i(p,b),Object.defineProperty(p,"prototype",{writable:!1}),p}function o(p){var g=s(p,"string");return typeof g=="symbol"?g:String(g)}function s(p,g){if(typeof p!="object"||p===null)return p;var b=p[Symbol.toPrimitive];if(b!==void 0){var v=b.call(p,g||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(p)}var c=we,l=c.Buffer,u=Uk,f=u.inspect,h=f&&f.custom||"inspect";function d(p,g,b){l.prototype.copy.call(p,g,b)}return b2=function(){function p(){r(this,p),this.head=null,this.tail=null,this.length=0}return a(p,[{key:"push",value:function(b){var v={data:b,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(b){var v={data:b,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var v=this.head,x=""+v.data;v=v.next;)x+=b+v.data;return x}},{key:"concat",value:function(b){if(this.length===0)return l.alloc(0);for(var v=l.allocUnsafe(b>>>0),x=this.head,A=0;x;)d(x.data,v,A),A+=x.data.length,x=x.next;return v}},{key:"consume",value:function(b,v){var x;return b<this.head.data.length?(x=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):b===this.head.data.length?x=this.shift():x=v?this._getString(b):this._getBuffer(b),x}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var v=this.head,x=1,A=v.data;for(b-=A.length;v=v.next;){var w=v.data,_=b>w.length?w.length:b;if(_===w.length?A+=w:A+=w.slice(0,b),b-=_,b===0){_===w.length?(++x,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=w.slice(_));break}++x}return this.length-=x,A}},{key:"_getBuffer",value:function(b){var v=l.allocUnsafe(b),x=this.head,A=1;for(x.data.copy(v),b-=x.data.length;x=x.next;){var w=x.data,_=b>w.length?w.length:b;if(w.copy(v,v.length-b,0,_),b-=_,b===0){_===w.length?(++A,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=w.slice(_));break}++A}return this.length-=A,v}},{key:h,value:function(b,v){return f(this,t(t({},v),{},{depth:0,customInspect:!1}))}}]),p}(),b2}var y2,Hk;function Gk(){if(Hk)return y2;Hk=1;function e(o,s){var c=this,l=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return l||u?(s?s(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,o)):process.nextTick(i,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(f){!s&&f?c._writableState?c._writableState.errorEmitted?process.nextTick(n,c):(c._writableState.errorEmitted=!0,process.nextTick(t,c,f)):process.nextTick(t,c,f):s?(process.nextTick(n,c),s(f)):process.nextTick(n,c)}),this)}function t(o,s){i(o,s),n(o)}function n(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(o,s){o.emit("error",s)}function a(o,s){var c=o._readableState,l=o._writableState;c&&c.autoDestroy||l&&l.autoDestroy?o.destroy(s):o.emit("error",s)}return y2={destroy:e,undestroy:r,errorOrDestroy:a},y2}var v2={},Vk;function sc(){if(Vk)return v2;Vk=1;function e(s,c){s.prototype=Object.create(c.prototype),s.prototype.constructor=s,s.__proto__=c}var t={};function n(s,c,l){l||(l=Error);function u(h,d,p){return typeof c=="string"?c:c(h,d,p)}var f=function(h){e(d,h);function d(p,g,b){return h.call(this,u(p,g,b))||this}return d}(l);f.prototype.name=l.name,f.prototype.code=s,t[s]=f}function r(s,c){if(Array.isArray(s)){var l=s.length;return s=s.map(function(u){return String(u)}),l>2?"one of ".concat(c," ").concat(s.slice(0,l-1).join(", "),", or ")+s[l-1]:l===2?"one of ".concat(c," ").concat(s[0]," or ").concat(s[1]):"of ".concat(c," ").concat(s[0])}else return"of ".concat(c," ").concat(String(s))}function i(s,c,l){return s.substr(!l||l<0?0:+l,c.length)===c}function a(s,c,l){return(l===void 0||l>s.length)&&(l=s.length),s.substring(l-c.length,l)===c}function o(s,c,l){return typeof l!="number"&&(l=0),l+c.length>s.length?!1:s.indexOf(c,l)!==-1}return n("ERR_INVALID_OPT_VALUE",function(s,c){return'The value "'+c+'" is invalid for option "'+s+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(s,c,l){var u;typeof c=="string"&&i(c,"not ")?(u="must not be",c=c.replace(/^not /,"")):u="must be";var f;if(a(s," argument"))f="The ".concat(s," ").concat(u," ").concat(r(c,"type"));else{var h=o(s,".")?"property":"argument";f='The "'.concat(s,'" ').concat(h," ").concat(u," ").concat(r(c,"type"))}return f+=". Received type ".concat(typeof l),f},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),v2.codes=t,v2}var w2,jk;function qk(){if(jk)return w2;jk=1;var e=sc().codes.ERR_INVALID_OPT_VALUE;function t(r,i,a){return r.highWaterMark!=null?r.highWaterMark:i?r[a]:null}function n(r,i,a,o){var s=t(i,o,a);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var c=o?a:"highWaterMark";throw new e(c,s)}return Math.floor(s)}return r.objectMode?16:16*1024}return w2={getHighWaterMark:n},w2}var x2,Wk;function lJ(){if(Wk)return x2;Wk=1,x2=e;function e(n,r){if(t("noDeprecation"))return n;var i=!1;function a(){if(!i){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return n.apply(this,arguments)}return a}function t(n){try{if(!globalThis.localStorage)return!1}catch{return!1}var r=globalThis.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return x2}var A2,Yk;function Zk(){if(Yk)return A2;Yk=1,A2=D;function e(L){var O=this;this.next=null,this.entry=null,this.finish=function(){Ve(O,L)}}var t;D.WritableState=C;var n={deprecate:lJ()},r=zk(),i=we.Buffer,a=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(L){return i.from(L)}function s(L){return i.isBuffer(L)||L instanceof a}var c=Gk(),l=qk(),u=l.getHighWaterMark,f=sc().codes,h=f.ERR_INVALID_ARG_TYPE,d=f.ERR_METHOD_NOT_IMPLEMENTED,p=f.ERR_MULTIPLE_CALLBACK,g=f.ERR_STREAM_CANNOT_PIPE,b=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,x=f.ERR_STREAM_WRITE_AFTER_END,A=f.ERR_UNKNOWN_ENCODING,w=c.errorOrDestroy;oc(D,r);function _(){}function C(L,O,W){t=t||cc(),L=L||{},typeof W!="boolean"&&(W=O instanceof t),this.objectMode=!!L.objectMode,W&&(this.objectMode=this.objectMode||!!L.writableObjectMode),this.highWaterMark=u(this,L,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var j=L.decodeStrings===!1;this.decodeStrings=!j,this.defaultEncoding=L.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){st(O,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=L.emitClose!==!1,this.autoDestroy=!!L.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}C.prototype.getBuffer=function(){for(var O=this.bufferedRequest,W=[];O;)W.push(O),O=O.next;return W},function(){try{Object.defineProperty(C.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(D,Symbol.hasInstance,{value:function(O){return I.call(this,O)?!0:this!==D?!1:O&&O._writableState instanceof C}})):I=function(O){return O instanceof this};function D(L){t=t||cc();var O=this instanceof t;if(!O&&!I.call(D,this))return new D(L);this._writableState=new C(L,this,O),this.writable=!0,L&&(typeof L.write=="function"&&(this._write=L.write),typeof L.writev=="function"&&(this._writev=L.writev),typeof L.destroy=="function"&&(this._destroy=L.destroy),typeof L.final=="function"&&(this._final=L.final)),r.call(this)}D.prototype.pipe=function(){w(this,new g)};function B(L,O){var W=new x;w(L,W),process.nextTick(O,W)}function G(L,O,W,j){var Q;return W===null?Q=new v:typeof W!="string"&&!O.objectMode&&(Q=new h("chunk",["string","Buffer"],W)),Q?(w(L,Q),process.nextTick(j,Q),!1):!0}D.prototype.write=function(L,O,W){var j=this._writableState,Q=!1,T=!j.objectMode&&s(L);return T&&!i.isBuffer(L)&&(L=o(L)),typeof O=="function"&&(W=O,O=null),T?O="buffer":O||(O=j.defaultEncoding),typeof W!="function"&&(W=_),j.ending?B(this,W):(T||G(this,j,L,W))&&(j.pendingcb++,Q=ae(this,j,T,L,O,W)),Q},D.prototype.cork=function(){this._writableState.corked++},D.prototype.uncork=function(){var L=this._writableState;L.corked&&(L.corked--,!L.writing&&!L.corked&&!L.bufferProcessing&&L.bufferedRequest&&tt(this,L))},D.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new A(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(D.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function z(L,O,W){return!L.objectMode&&L.decodeStrings!==!1&&typeof O=="string"&&(O=i.from(O,W)),O}Object.defineProperty(D.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ae(L,O,W,j,Q,T){if(!W){var S=z(O,j,Q);j!==S&&(W=!0,Q="buffer",j=S)}var V=O.objectMode?1:j.length;O.length+=V;var Y=O.length<O.highWaterMark;if(Y||(O.needDrain=!0),O.writing||O.corked){var de=O.lastBufferedRequest;O.lastBufferedRequest={chunk:j,encoding:Q,isBuf:W,callback:T,next:null},de?de.next=O.lastBufferedRequest:O.bufferedRequest=O.lastBufferedRequest,O.bufferedRequestCount+=1}else se(L,O,!1,V,j,Q,T);return Y}function se(L,O,W,j,Q,T,S){O.writelen=j,O.writecb=S,O.writing=!0,O.sync=!0,O.destroyed?O.onwrite(new b("write")):W?L._writev(Q,O.onwrite):L._write(Q,T,O.onwrite),O.sync=!1}function ve(L,O,W,j,Q){--O.pendingcb,W?(process.nextTick(Q,j),process.nextTick(Rt,L,O),L._writableState.errorEmitted=!0,w(L,j)):(Q(j),L._writableState.errorEmitted=!0,w(L,j),Rt(L,O))}function Pe(L){L.writing=!1,L.writecb=null,L.length-=L.writelen,L.writelen=0}function st(L,O){var W=L._writableState,j=W.sync,Q=W.writecb;if(typeof Q!="function")throw new p;if(Pe(W),O)ve(L,W,j,O,Q);else{var T=ut(W)||L.destroyed;!T&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&tt(L,W),j?process.nextTick(Ne,L,W,T,Q):Ne(L,W,T,Q)}}function Ne(L,O,W,j){W||lt(L,O),O.pendingcb--,j(),Rt(L,O)}function lt(L,O){O.length===0&&O.needDrain&&(O.needDrain=!1,L.emit("drain"))}function tt(L,O){O.bufferProcessing=!0;var W=O.bufferedRequest;if(L._writev&&W&&W.next){var j=O.bufferedRequestCount,Q=new Array(j),T=O.corkedRequestsFree;T.entry=W;for(var S=0,V=!0;W;)Q[S]=W,W.isBuf||(V=!1),W=W.next,S+=1;Q.allBuffers=V,se(L,O,!0,O.length,Q,"",T.finish),O.pendingcb++,O.lastBufferedRequest=null,T.next?(O.corkedRequestsFree=T.next,T.next=null):O.corkedRequestsFree=new e(O),O.bufferedRequestCount=0}else{for(;W;){var Y=W.chunk,de=W.encoding,ie=W.callback,pe=O.objectMode?1:Y.length;if(se(L,O,!1,pe,Y,de,ie),W=W.next,O.bufferedRequestCount--,O.writing)break}W===null&&(O.lastBufferedRequest=null)}O.bufferedRequest=W,O.bufferProcessing=!1}D.prototype._write=function(L,O,W){W(new d("_write()"))},D.prototype._writev=null,D.prototype.end=function(L,O,W){var j=this._writableState;return typeof L=="function"?(W=L,L=null,O=null):typeof O=="function"&&(W=O,O=null),L!=null&&this.write(L,O),j.corked&&(j.corked=1,this.uncork()),j.ending||ln(this,j,W),this},Object.defineProperty(D.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ut(L){return L.ending&&L.length===0&&L.bufferedRequest===null&&!L.finished&&!L.writing}function Te(L,O){L._final(function(W){O.pendingcb--,W&&w(L,W),O.prefinished=!0,L.emit("prefinish"),Rt(L,O)})}function Ie(L,O){!O.prefinished&&!O.finalCalled&&(typeof L._final=="function"&&!O.destroyed?(O.pendingcb++,O.finalCalled=!0,process.nextTick(Te,L,O)):(O.prefinished=!0,L.emit("prefinish")))}function Rt(L,O){var W=ut(O);if(W&&(Ie(L,O),O.pendingcb===0&&(O.finished=!0,L.emit("finish"),O.autoDestroy))){var j=L._readableState;(!j||j.autoDestroy&&j.endEmitted)&&L.destroy()}return W}function ln(L,O,W){O.ending=!0,Rt(L,O),W&&(O.finished?process.nextTick(W):L.once("finish",W)),O.ended=!0,L.writable=!1}function Ve(L,O,W){var j=L.entry;for(L.entry=null;j;){var Q=j.callback;O.pendingcb--,Q(W),j=j.next}O.corkedRequestsFree.next=L}return Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),D.prototype.destroy=c.destroy,D.prototype._undestroy=c.undestroy,D.prototype._destroy=function(L,O){O(L)},A2}var E2,Qk;function cc(){if(Qk)return E2;Qk=1;var e=Object.keys||function(l){var u=[];for(var f in l)u.push(f);return u};E2=o;var t=nT(),n=Zk();oc(o,t);for(var r=e(n.prototype),i=0;i<r.length;i++){var a=r[i];o.prototype[a]||(o.prototype[a]=n.prototype[a])}function o(l){if(!(this instanceof o))return new o(l);t.call(this,l),n.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",s)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function s(){this._writableState.ended||process.nextTick(c,this)}function c(l){l.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),E2}var S2={},_2={exports:{}};(function(e,t){var n=we,r=n.Buffer;function i(o,s){for(var c in o)s[c]=o[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a);function a(o,s,c){return r(o,s,c)}i(r,a),a.from=function(o,s,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,s,c)},a.alloc=function(o,s,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=r(o);return s!==void 0?typeof c=="string"?l.fill(s,c):l.fill(s):l.fill(0),l},a.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},a.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(o)}})(_2,_2.exports);var uJ=_2.exports,C2=uJ.Buffer,Xk=C2.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function fJ(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function hJ(e){var t=fJ(e);if(typeof t!="string"&&(C2.isEncoding===Xk||!Xk(e)))throw new Error("Unknown encoding: "+e);return t||e}var dJ=S2.StringDecoder=Ku;function Ku(e){this.encoding=hJ(e);var t;switch(this.encoding){case"utf16le":this.text=vJ,this.end=wJ,t=4;break;case"utf8":this.fillLast=mJ,t=4;break;case"base64":this.text=xJ,this.end=AJ,t=3;break;default:this.write=EJ,this.end=SJ;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=C2.allocUnsafe(t)}Ku.prototype.write=function(e){if(e.length===0)return"";var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},Ku.prototype.end=yJ,Ku.prototype.text=bJ,Ku.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function k2(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function pJ(e,t,n){var r=t.length-1;if(r<n)return 0;var i=k2(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=k2(t[r]),i>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=k2(t[r]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function gJ(e,t,n){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"�"}}function mJ(e){var t=this.lastTotal-this.lastNeed,n=gJ(this,e);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function bJ(e,t){var n=pJ(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function yJ(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function vJ(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function wJ(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function xJ(e,t){var n=(e.length-t)%3;return n===0?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function AJ(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function EJ(e){return e.toString(this.encoding)}function SJ(e){return e&&e.length?this.write(e):""}var T2,Kk;function I2(){if(Kk)return T2;Kk=1;var e=sc().codes.ERR_STREAM_PREMATURE_CLOSE;function t(a){var o=!1;return function(){if(!o){o=!0;for(var s=arguments.length,c=new Array(s),l=0;l<s;l++)c[l]=arguments[l];a.apply(this,c)}}}function n(){}function r(a){return a.setHeader&&typeof a.abort=="function"}function i(a,o,s){if(typeof o=="function")return i(a,null,o);o||(o={}),s=t(s||n);var c=o.readable||o.readable!==!1&&a.readable,l=o.writable||o.writable!==!1&&a.writable,u=function(){a.writable||h()},f=a._writableState&&a._writableState.finished,h=function(){l=!1,f=!0,c||s.call(a)},d=a._readableState&&a._readableState.endEmitted,p=function(){c=!1,d=!0,l||s.call(a)},g=function(A){s.call(a,A)},b=function(){var A;if(c&&!d)return(!a._readableState||!a._readableState.ended)&&(A=new e),s.call(a,A);if(l&&!f)return(!a._writableState||!a._writableState.ended)&&(A=new e),s.call(a,A)},v=function(){a.req.on("finish",h)};return r(a)?(a.on("complete",h),a.on("abort",b),a.req?v():a.on("request",v)):l&&!a._writableState&&(a.on("end",u),a.on("close",u)),a.on("end",p),a.on("finish",h),o.error!==!1&&a.on("error",g),a.on("close",b),function(){a.removeListener("complete",h),a.removeListener("abort",b),a.removeListener("request",v),a.req&&a.req.removeListener("finish",h),a.removeListener("end",u),a.removeListener("close",u),a.removeListener("finish",h),a.removeListener("end",p),a.removeListener("error",g),a.removeListener("close",b)}}return T2=i,T2}var R2,Jk;function _J(){if(Jk)return R2;Jk=1;var e;function t(A,w,_){return w=n(w),w in A?Object.defineProperty(A,w,{value:_,enumerable:!0,configurable:!0,writable:!0}):A[w]=_,A}function n(A){var w=r(A,"string");return typeof w=="symbol"?w:String(w)}function r(A,w){if(typeof A!="object"||A===null)return A;var _=A[Symbol.toPrimitive];if(_!==void 0){var C=_.call(A,w||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(A)}var i=I2(),a=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),f=Symbol("stream");function h(A,w){return{value:A,done:w}}function d(A){var w=A[a];if(w!==null){var _=A[f].read();_!==null&&(A[l]=null,A[a]=null,A[o]=null,w(h(_,!1)))}}function p(A){process.nextTick(d,A)}function g(A,w){return function(_,C){A.then(function(){if(w[c]){_(h(void 0,!0));return}w[u](_,C)},C)}}var b=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var w=this,_=this[s];if(_!==null)return Promise.reject(_);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(B,G){process.nextTick(function(){w[s]?G(w[s]):B(h(void 0,!0))})});var C=this[l],I;if(C)I=new Promise(g(C,this));else{var D=this[f].read();if(D!==null)return Promise.resolve(h(D,!1));I=new Promise(this[u])}return this[l]=I,I}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var w=this;return new Promise(function(_,C){w[f].destroy(null,function(I){if(I){C(I);return}_(h(void 0,!0))})})}),e),b),x=function(w){var _,C=Object.create(v,(_={},t(_,f,{value:w,writable:!0}),t(_,a,{value:null,writable:!0}),t(_,o,{value:null,writable:!0}),t(_,s,{value:null,writable:!0}),t(_,c,{value:w._readableState.endEmitted,writable:!0}),t(_,u,{value:function(D,B){var G=C[f].read();G?(C[l]=null,C[a]=null,C[o]=null,D(h(G,!1))):(C[a]=D,C[o]=B)},writable:!0}),_));return C[l]=null,i(w,function(I){if(I&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"){var D=C[o];D!==null&&(C[l]=null,C[a]=null,C[o]=null,D(I)),C[s]=I;return}var B=C[a];B!==null&&(C[l]=null,C[a]=null,C[o]=null,B(h(void 0,!0))),C[c]=!0}),w.on("readable",p.bind(null,C)),C};return R2=x,R2}var D2,eT;function CJ(){return eT||(eT=1,D2=function(){throw new Error("Readable.from is not available in the browser")}),D2}var B2,tT;function nT(){if(tT)return B2;tT=1,B2=B;var e;B.ReadableState=D,p2.EventEmitter;var t=function(S,V){return S.listeners(V).length},n=zk(),r=we.Buffer,i=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(T){return r.from(T)}function o(T){return r.isBuffer(T)||T instanceof i}var s=Uk,c;s&&s.debuglog?c=s.debuglog("stream"):c=function(){};var l=cJ(),u=Gk(),f=qk(),h=f.getHighWaterMark,d=sc().codes,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_STREAM_PUSH_AFTER_EOF,b=d.ERR_METHOD_NOT_IMPLEMENTED,v=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,A,w;oc(B,n);var _=u.errorOrDestroy,C=["error","close","destroy","pause","resume"];function I(T,S,V){if(typeof T.prependListener=="function")return T.prependListener(S,V);!T._events||!T._events[S]?T.on(S,V):Array.isArray(T._events[S])?T._events[S].unshift(V):T._events[S]=[V,T._events[S]]}function D(T,S,V){e=e||cc(),T=T||{},typeof V!="boolean"&&(V=S instanceof e),this.objectMode=!!T.objectMode,V&&(this.objectMode=this.objectMode||!!T.readableObjectMode),this.highWaterMark=h(this,T,"readableHighWaterMark",V),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=T.emitClose!==!1,this.autoDestroy=!!T.autoDestroy,this.destroyed=!1,this.defaultEncoding=T.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,T.encoding&&(x||(x=S2.StringDecoder),this.decoder=new x(T.encoding),this.encoding=T.encoding)}function B(T){if(e=e||cc(),!(this instanceof B))return new B(T);var S=this instanceof e;this._readableState=new D(T,this,S),this.readable=!0,T&&(typeof T.read=="function"&&(this._read=T.read),typeof T.destroy=="function"&&(this._destroy=T.destroy)),n.call(this)}Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(S){this._readableState&&(this._readableState.destroyed=S)}}),B.prototype.destroy=u.destroy,B.prototype._undestroy=u.undestroy,B.prototype._destroy=function(T,S){S(T)},B.prototype.push=function(T,S){var V=this._readableState,Y;return V.objectMode?Y=!0:typeof T=="string"&&(S=S||V.defaultEncoding,S!==V.encoding&&(T=r.from(T,S),S=""),Y=!0),G(this,T,S,!1,Y)},B.prototype.unshift=function(T){return G(this,T,null,!0,!1)};function G(T,S,V,Y,de){c("readableAddChunk",S);var ie=T._readableState;if(S===null)ie.reading=!1,st(T,ie);else{var pe;if(de||(pe=ae(ie,S)),pe)_(T,pe);else if(ie.objectMode||S&&S.length>0)if(typeof S!="string"&&!ie.objectMode&&Object.getPrototypeOf(S)!==r.prototype&&(S=a(S)),Y)ie.endEmitted?_(T,new v):z(T,ie,S,!0);else if(ie.ended)_(T,new g);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!V?(S=ie.decoder.write(S),ie.objectMode||S.length!==0?z(T,ie,S,!1):tt(T,ie)):z(T,ie,S,!1)}else Y||(ie.reading=!1,tt(T,ie))}return!ie.ended&&(ie.length<ie.highWaterMark||ie.length===0)}function z(T,S,V,Y){S.flowing&&S.length===0&&!S.sync?(S.awaitDrain=0,T.emit("data",V)):(S.length+=S.objectMode?1:V.length,Y?S.buffer.unshift(V):S.buffer.push(V),S.needReadable&&Ne(T)),tt(T,S)}function ae(T,S){var V;return!o(S)&&typeof S!="string"&&S!==void 0&&!T.objectMode&&(V=new p("chunk",["string","Buffer","Uint8Array"],S)),V}B.prototype.isPaused=function(){return this._readableState.flowing===!1},B.prototype.setEncoding=function(T){x||(x=S2.StringDecoder);var S=new x(T);this._readableState.decoder=S,this._readableState.encoding=this._readableState.decoder.encoding;for(var V=this._readableState.buffer.head,Y="";V!==null;)Y+=S.write(V.data),V=V.next;return this._readableState.buffer.clear(),Y!==""&&this._readableState.buffer.push(Y),this._readableState.length=Y.length,this};var se=1073741824;function ve(T){return T>=se?T=se:(T--,T|=T>>>1,T|=T>>>2,T|=T>>>4,T|=T>>>8,T|=T>>>16,T++),T}function Pe(T,S){return T<=0||S.length===0&&S.ended?0:S.objectMode?1:T!==T?S.flowing&&S.length?S.buffer.head.data.length:S.length:(T>S.highWaterMark&&(S.highWaterMark=ve(T)),T<=S.length?T:S.ended?S.length:(S.needReadable=!0,0))}B.prototype.read=function(T){c("read",T),T=parseInt(T,10);var S=this._readableState,V=T;if(T!==0&&(S.emittedReadable=!1),T===0&&S.needReadable&&((S.highWaterMark!==0?S.length>=S.highWaterMark:S.length>0)||S.ended))return c("read: emitReadable",S.length,S.ended),S.length===0&&S.ended?W(this):Ne(this),null;if(T=Pe(T,S),T===0&&S.ended)return S.length===0&&W(this),null;var Y=S.needReadable;c("need readable",Y),(S.length===0||S.length-T<S.highWaterMark)&&(Y=!0,c("length less than watermark",Y)),S.ended||S.reading?(Y=!1,c("reading or ended",Y)):Y&&(c("do read"),S.reading=!0,S.sync=!0,S.length===0&&(S.needReadable=!0),this._read(S.highWaterMark),S.sync=!1,S.reading||(T=Pe(V,S)));var de;return T>0?de=O(T,S):de=null,de===null?(S.needReadable=S.length<=S.highWaterMark,T=0):(S.length-=T,S.awaitDrain=0),S.length===0&&(S.ended||(S.needReadable=!0),V!==T&&S.ended&&W(this)),de!==null&&this.emit("data",de),de};function st(T,S){if(c("onEofChunk"),!S.ended){if(S.decoder){var V=S.decoder.end();V&&V.length&&(S.buffer.push(V),S.length+=S.objectMode?1:V.length)}S.ended=!0,S.sync?Ne(T):(S.needReadable=!1,S.emittedReadable||(S.emittedReadable=!0,lt(T)))}}function Ne(T){var S=T._readableState;c("emitReadable",S.needReadable,S.emittedReadable),S.needReadable=!1,S.emittedReadable||(c("emitReadable",S.flowing),S.emittedReadable=!0,process.nextTick(lt,T))}function lt(T){var S=T._readableState;c("emitReadable_",S.destroyed,S.length,S.ended),!S.destroyed&&(S.length||S.ended)&&(T.emit("readable"),S.emittedReadable=!1),S.needReadable=!S.flowing&&!S.ended&&S.length<=S.highWaterMark,L(T)}function tt(T,S){S.readingMore||(S.readingMore=!0,process.nextTick(ut,T,S))}function ut(T,S){for(;!S.reading&&!S.ended&&(S.length<S.highWaterMark||S.flowing&&S.length===0);){var V=S.length;if(c("maybeReadMore read 0"),T.read(0),V===S.length)break}S.readingMore=!1}B.prototype._read=function(T){_(this,new b("_read()"))},B.prototype.pipe=function(T,S){var V=this,Y=this._readableState;switch(Y.pipesCount){case 0:Y.pipes=T;break;case 1:Y.pipes=[Y.pipes,T];break;default:Y.pipes.push(T);break}Y.pipesCount+=1,c("pipe count=%d opts=%j",Y.pipesCount,S);var de=(!S||S.end!==!1)&&T!==process.stdout&&T!==process.stderr,ie=de?un:Br;Y.endEmitted?process.nextTick(ie):V.once("end",ie),T.on("unpipe",pe);function pe(E,m){c("onunpipe"),E===V&&m&&m.hasUnpiped===!1&&(m.hasUnpiped=!0,ha())}function un(){c("onend"),T.end()}var ua=Te(V);T.on("drain",ua);var fa=!1;function ha(){c("cleanup"),T.removeListener("close",da),T.removeListener("finish",fn),T.removeListener("drain",ua),T.removeListener("error",fi),T.removeListener("unpipe",pe),V.removeListener("end",un),V.removeListener("end",Br),V.removeListener("data",Gt),fa=!0,Y.awaitDrain&&(!T._writableState||T._writableState.needDrain)&&ua()}V.on("data",Gt);function Gt(E){c("ondata");var m=T.write(E);c("dest.write",m),m===!1&&((Y.pipesCount===1&&Y.pipes===T||Y.pipesCount>1&&Q(Y.pipes,T)!==-1)&&!fa&&(c("false write response, pause",Y.awaitDrain),Y.awaitDrain++),V.pause())}function fi(E){c("onerror",E),Br(),T.removeListener("error",fi),t(T,"error")===0&&_(T,E)}I(T,"error",fi);function da(){T.removeListener("finish",fn),Br()}T.once("close",da);function fn(){c("onfinish"),T.removeListener("close",da),Br()}T.once("finish",fn);function Br(){c("unpipe"),V.unpipe(T)}return T.emit("pipe",V),Y.flowing||(c("pipe resume"),V.resume()),T};function Te(T){return function(){var V=T._readableState;c("pipeOnDrain",V.awaitDrain),V.awaitDrain&&V.awaitDrain--,V.awaitDrain===0&&t(T,"data")&&(V.flowing=!0,L(T))}}B.prototype.unpipe=function(T){var S=this._readableState,V={hasUnpiped:!1};if(S.pipesCount===0)return this;if(S.pipesCount===1)return T&&T!==S.pipes?this:(T||(T=S.pipes),S.pipes=null,S.pipesCount=0,S.flowing=!1,T&&T.emit("unpipe",this,V),this);if(!T){var Y=S.pipes,de=S.pipesCount;S.pipes=null,S.pipesCount=0,S.flowing=!1;for(var ie=0;ie<de;ie++)Y[ie].emit("unpipe",this,{hasUnpiped:!1});return this}var pe=Q(S.pipes,T);return pe===-1?this:(S.pipes.splice(pe,1),S.pipesCount-=1,S.pipesCount===1&&(S.pipes=S.pipes[0]),T.emit("unpipe",this,V),this)},B.prototype.on=function(T,S){var V=n.prototype.on.call(this,T,S),Y=this._readableState;return T==="data"?(Y.readableListening=this.listenerCount("readable")>0,Y.flowing!==!1&&this.resume()):T==="readable"&&!Y.endEmitted&&!Y.readableListening&&(Y.readableListening=Y.needReadable=!0,Y.flowing=!1,Y.emittedReadable=!1,c("on readable",Y.length,Y.reading),Y.length?Ne(this):Y.reading||process.nextTick(Rt,this)),V},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(T,S){var V=n.prototype.removeListener.call(this,T,S);return T==="readable"&&process.nextTick(Ie,this),V},B.prototype.removeAllListeners=function(T){var S=n.prototype.removeAllListeners.apply(this,arguments);return(T==="readable"||T===void 0)&&process.nextTick(Ie,this),S};function Ie(T){var S=T._readableState;S.readableListening=T.listenerCount("readable")>0,S.resumeScheduled&&!S.paused?S.flowing=!0:T.listenerCount("data")>0&&T.resume()}function Rt(T){c("readable nexttick read 0"),T.read(0)}B.prototype.resume=function(){var T=this._readableState;return T.flowing||(c("resume"),T.flowing=!T.readableListening,ln(this,T)),T.paused=!1,this};function ln(T,S){S.resumeScheduled||(S.resumeScheduled=!0,process.nextTick(Ve,T,S))}function Ve(T,S){c("resume",S.reading),S.reading||T.read(0),S.resumeScheduled=!1,T.emit("resume"),L(T),S.flowing&&!S.reading&&T.read(0)}B.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function L(T){var S=T._readableState;for(c("flow",S.flowing);S.flowing&&T.read()!==null;);}B.prototype.wrap=function(T){var S=this,V=this._readableState,Y=!1;T.on("end",function(){if(c("wrapped end"),V.decoder&&!V.ended){var pe=V.decoder.end();pe&&pe.length&&S.push(pe)}S.push(null)}),T.on("data",function(pe){if(c("wrapped data"),V.decoder&&(pe=V.decoder.write(pe)),!(V.objectMode&&pe==null)&&!(!V.objectMode&&(!pe||!pe.length))){var un=S.push(pe);un||(Y=!0,T.pause())}});for(var de in T)this[de]===void 0&&typeof T[de]=="function"&&(this[de]=function(un){return function(){return T[un].apply(T,arguments)}}(de));for(var ie=0;ie<C.length;ie++)T.on(C[ie],this.emit.bind(this,C[ie]));return this._read=function(pe){c("wrapped _read",pe),Y&&(Y=!1,T.resume())},this},typeof Symbol=="function"&&(B.prototype[Symbol.asyncIterator]=function(){return A===void 0&&(A=_J()),A(this)}),Object.defineProperty(B.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(B.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(B.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(S){this._readableState&&(this._readableState.flowing=S)}}),B._fromList=O,Object.defineProperty(B.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function O(T,S){if(S.length===0)return null;var V;return S.objectMode?V=S.buffer.shift():!T||T>=S.length?(S.decoder?V=S.buffer.join(""):S.buffer.length===1?V=S.buffer.first():V=S.buffer.concat(S.length),S.buffer.clear()):V=S.buffer.consume(T,S.decoder),V}function W(T){var S=T._readableState;c("endReadable",S.endEmitted),S.endEmitted||(S.ended=!0,process.nextTick(j,S,T))}function j(T,S){if(c("endReadableNT",T.endEmitted,T.length),!T.endEmitted&&T.length===0&&(T.endEmitted=!0,S.readable=!1,S.emit("end"),T.autoDestroy)){var V=S._writableState;(!V||V.autoDestroy&&V.finished)&&S.destroy()}}typeof Symbol=="function"&&(B.from=function(T,S){return w===void 0&&(w=CJ()),w(B,T,S)});function Q(T,S){for(var V=0,Y=T.length;V<Y;V++)if(T[V]===S)return V;return-1}return B2}var F2,rT;function iT(){if(rT)return F2;rT=1,F2=s;var e=sc().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=e.ERR_TRANSFORM_WITH_LENGTH_0,a=cc();oc(s,a);function o(u,f){var h=this._transformState;h.transforming=!1;var d=h.writecb;if(d===null)return this.emit("error",new n);h.writechunk=null,h.writecb=null,f!=null&&this.push(f),d(u);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function s(u){if(!(this instanceof s))return new s(u);a.call(this,u),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",c)}function c(){var u=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(f,h){l(u,f,h)}):l(this,null,null)}s.prototype.push=function(u,f){return this._transformState.needTransform=!1,a.prototype.push.call(this,u,f)},s.prototype._transform=function(u,f,h){h(new t("_transform()"))},s.prototype._write=function(u,f,h){var d=this._transformState;if(d.writecb=h,d.writechunk=u,d.writeencoding=f,!d.transforming){var p=this._readableState;(d.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},s.prototype._read=function(u){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},s.prototype._destroy=function(u,f){a.prototype._destroy.call(this,u,function(h){f(h)})};function l(u,f,h){if(f)return u.emit("error",f);if(h!=null&&u.push(h),u._writableState.length)throw new i;if(u._transformState.transforming)throw new r;return u.push(null)}return F2}var P2,aT;function kJ(){if(aT)return P2;aT=1,P2=t;var e=iT();oc(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,r,i){i(null,n)},P2}var M2,oT;function TJ(){if(oT)return M2;oT=1;var e;function t(h){var d=!1;return function(){d||(d=!0,h.apply(void 0,arguments))}}var n=sc().codes,r=n.ERR_MISSING_ARGS,i=n.ERR_STREAM_DESTROYED;function a(h){if(h)throw h}function o(h){return h.setHeader&&typeof h.abort=="function"}function s(h,d,p,g){g=t(g);var b=!1;h.on("close",function(){b=!0}),e===void 0&&(e=I2()),e(h,{readable:d,writable:p},function(x){if(x)return g(x);b=!0,g()});var v=!1;return function(x){if(!b&&!v){if(v=!0,o(h))return h.abort();if(typeof h.destroy=="function")return h.destroy();g(x||new i("pipe"))}}}function c(h){h()}function l(h,d){return h.pipe(d)}function u(h){return!h.length||typeof h[h.length-1]!="function"?a:h.pop()}function f(){for(var h=arguments.length,d=new Array(h),p=0;p<h;p++)d[p]=arguments[p];var g=u(d);if(Array.isArray(d[0])&&(d=d[0]),d.length<2)throw new r("streams");var b,v=d.map(function(x,A){var w=A<d.length-1,_=A>0;return s(x,w,_,function(C){b||(b=C),C&&v.forEach(c),!w&&(v.forEach(c),g(b))})});return d.reduce(l)}return M2=f,M2}var sT=On,O2=p2.EventEmitter,IJ=oc;IJ(On,O2),On.Readable=nT(),On.Writable=Zk(),On.Duplex=cc(),On.Transform=iT(),On.PassThrough=kJ(),On.finished=I2(),On.pipeline=TJ(),On.Stream=On;function On(){O2.call(this)}On.prototype.pipe=function(e,t){var n=this;function r(u){e.writable&&e.write(u)===!1&&n.pause&&n.pause()}n.on("data",r);function i(){n.readable&&n.resume&&n.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(n.on("end",o),n.on("close",s));var a=!1;function o(){a||(a=!0,e.end())}function s(){a||(a=!0,typeof e.destroy=="function"&&e.destroy())}function c(u){if(l(),O2.listenerCount(this,"error")===0)throw u}n.on("error",c),e.on("error",c);function l(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",o),n.removeListener("close",s),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e};function Ju(e){return e.replace(/%([0-9A-Fa-f]{2})/g,(t,n)=>String.fromCharCode(parseInt(n,16)))}function cT(e,t){return String(t).replace(e,n=>`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)}function ef(e){return cT(/[\n;\r\t=%&,\x00-\x1f\x7f-\xff]/g,e)}function ii(e){return cT(/[\n\r\t%\x00-\x1f\x7f-\xff]/g,e)}function lT(e){if(!(e&&e.length)||e===".")return{};const t={};return e.replace(/\r?\n$/,"").split(";").forEach(n=>{const r=n.split("=",2);if(!(r[1]&&r[1].length))return;r[0]=r[0].trim();let i=t[r[0].trim()];i||(i=[],t[r[0]]=i),i.push(...r[1].split(",").map(a=>a.trim()).map(Ju))}),t}function uT(e){const t=e.split(" ").map(r=>r==="."||r===""?null:r);return{seq_id:t[0]&&Ju(t[0]),source:t[1]&&Ju(t[1]),type:t[2]&&Ju(t[2]),start:t[3]===null?null:parseInt(t[3],10),end:t[4]===null?null:parseInt(t[4],10),score:t[5]===null?null:parseFloat(t[5]),strand:t[6],phase:t[7],attributes:t[8]===null?null:lT(t[8])}}function fT(e){const t=/^\s*##\s*(\S+)\s*(.*)/.exec(e);if(!t)return null;const[,n]=t;let[,,r]=t;const i={directive:n};if(r.length&&(r=r.replace(/\r?\n$/,""),i.value=r),n==="sequence-region"){const a=r.split(/\s+/,3);return{...i,seq_id:a[0],start:a[1]&&a[1].replace(/\D/g,""),end:a[2]&&a[2].replace(/\D/g,"")}}else if(n==="genome-build"){const[a,o]=r.split(/\s+/,2);return{...i,source:a,buildName:o}}return i}function hT(e){const t=[];return Object.entries(e).forEach(([n,r])=>{if(!r)return;let i;r.hasOwnProperty("toString")?i=ef(r.toString()):Array.isArray(r)?i=r.map(ef).join(","):i=ef(r),t.push(`${ef(n)}=${i}`)}),t.length?t.join(";"):"."}function RJ(e,t){const n=e.attributes===null||e.attributes===void 0?".":hT(e.attributes),i=`${[e.seq_id===null?".":ii(e.seq_id),e.source===null?".":ii(e.source),e.type===null?".":ii(e.type),e.start===null?".":ii(e.start),e.end===null?".":ii(e.end),e.score===null?".":ii(e.score),e.strand===null?".":ii(e.strand),e.phase===null?".":ii(e.phase),n].join(" ")}
|
3365
|
+
)`},Symbol.toStringTag,{value:"Module"}))).map(([e,t])=>[e,ck.parse(t.trim())]));function o2(e){const t=["uint","int","float","long"];return{...e,fields:e.fields.map(n=>({...n,isArray:n.size&&n.type!=="char",arrayIsNumeric:n.size&&t.includes(n.type),isNumeric:!n.size&&t.includes(n.type)}))}}const AK={".":0,"-":-1,"+":1};function EK(e){var t;return e.length>=12&&!Number.isNaN(parseInt(e[9],10))&&((t=e[10])===null||t===void 0?void 0:t.split(",").filter(n=>!!n).length)===parseInt(e[9],10)}class SK{constructor(t={}){if(t.autoSql)this.autoSql=o2(xK.parse(t.autoSql));else if(t.type){if(!a2[t.type])throw new Error("Type not found");this.autoSql=o2(a2[t.type])}else this.autoSql=o2(a2.defaultBedSchema),this.attemptDefaultBed=!0}parseLine(t,n={}){const{autoSql:r}=this,{uniqueId:i}=n,a=Array.isArray(t)?t:t.split(" ");let o={};if(!this.attemptDefaultBed||this.attemptDefaultBed&&EK(a))for(let s=0;s<r.fields.length;s++){const c=r.fields[s];let l=a[s];const{isNumeric:u,isArray:f,arrayIsNumeric:h,name:d}=c;if(l==null)break;if(l!=="."){if(u){const p=Number(l);l=Number.isNaN(p)?l:p}else f&&(l=l.split(","),l[l.length-1]===""&&l.pop(),h&&(l=l.map(p=>Number(p))));o[d]=l}}else{const s=["chrom","chromStart","chromEnd","name"];o=Object.fromEntries(a.map((c,l)=>[s[l]||"field"+l,c])),o.chromStart=+o.chromStart,o.chromEnd=+o.chromEnd,Number.isNaN(Number.parseFloat(o.field4))||(o.score=+o.field4,delete o.field4),(o.field5==="+"||o.field5==="-")&&(o.strand=o.field5,delete o.field5)}return i&&(o.uniqueId=i),o.strand=AK[o.strand]||0,o.chrom=decodeURIComponent(o.chrom),o}}const _K=Object.freeze(Object.defineProperty({__proto__:null,default:SK},Symbol.toStringTag,{value:"Module"}));let lk=class{constructor(t,n){this.blockPosition=t,this.dataPosition=n}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(t){return this.blockPosition-t.blockPosition||this.dataPosition-t.dataPosition}static min(...t){let n,r=0;for(;!n;r+=1)n=t[r];for(;r<t.length;r+=1)n.compareTo(t[r])>0&&(n=t[r]);return n}};function tc(e,t=0,n=!1){if(n)throw new Error("big-endian virtual file offsets not implemented");return new lk(e[t+7]*1099511627776+e[t+6]*4294967296+e[t+5]*16777216+e[t+4]*65536+e[t+3]*256+e[t+2],e[t+1]<<8|e[t])}let uk=class{constructor(t,n,r,i){this.minv=t,this.maxv=n,this.bin=r,this._fetchedSize=i}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(t){return this.minv.compareTo(t.minv)||this.maxv.compareTo(t.maxv)||this.bin-t.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}};function CK(e){return new Promise(t=>setTimeout(t,e))}function kK(e){if(e.greaterThan(Number.MAX_SAFE_INTEGER)||e.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return e.toNumber()}function TK(e){if(e&&e.aborted)if(typeof DOMException>"u"){const t=new Error("aborted");throw t.code="ERR_ABORTED",t}else throw new DOMException("aborted","AbortError")}function IK(e,t){return t.minv.blockPosition-e.maxv.blockPosition<65e3&&t.maxv.blockPosition-e.minv.blockPosition<5e6}function RK(e={}){return"aborted"in e?{signal:e}:e}function fk(e,t){const n=[];let r;if(e.length===0)return e;e.sort((i,a)=>{const o=i.minv.blockPosition-a.minv.blockPosition;return o===0?i.minv.dataPosition-a.minv.dataPosition:o});for(const i of e)(!t||i.maxv.compareTo(t)>0)&&(r===void 0?(n.push(i),r=i):IK(r,i)?i.maxv.compareTo(r.maxv)>0&&(r.maxv=i.maxv):(n.push(i),r=i));return n}function hk(e,t){return{lineCount:kK(f0.fromBytesLE(Array.prototype.slice.call(e,t,t+8),!0))}}function O0(e,t){return e?e.compareTo(t)>0?t:e:t}function DK(e,t=n=>n){let n=0,r=0;const i=[],a={};for(let o=0;o<e.length;o+=1)if(!e[o]){if(r<o){let s=e.toString("utf8",r,o);s=t(s),i[n]=s,a[s]=n}r=o+1,n+=1}return{refNameToId:a,refIdToName:i}}let dk=class{constructor({filehandle:t,renameRefSeq:n=r=>r}){this.filehandle=t,this.renameRefSeq=n}};const BK=21578050;function FK(e,t){return e-e%t}function PK(e,t){return e-e%t+t}function MK(e,t){return t-=1,[[0,0],[1+(e>>26),1+(t>>26)],[9+(e>>23),9+(t>>23)],[73+(e>>20),73+(t>>20)],[585+(e>>17),585+(t>>17)],[4681+(e>>14),4681+(t>>14)]]}class nc extends dk{async lineCount(t,n){var r,i;return((i=(r=(await this.parse(n)).indices[t])===null||r===void 0?void 0:r.stats)===null||i===void 0?void 0:i.lineCount)||0}async _parse(t){const n=await this.filehandle.readFile(t);if(n.readUInt32LE(0)!==BK)throw new Error("Not a BAI file");const r=n.readInt32LE(4),a=((1<<(5+1)*3)-1)/7;let o=8,s;const c=new Array(r);for(let l=0;l<r;l++){const u=n.readInt32LE(o);let f;o+=4;const h={};for(let g=0;g<u;g+=1){const b=n.readUInt32LE(o);if(o+=4,b===a+1)o+=4,f=hk(n,o+16),o+=32;else{if(b>a+1)throw new Error("bai index contains too many bins, please use CSI");{const v=n.readInt32LE(o);o+=4;const x=new Array(v);for(let A=0;A<v;A++){const w=tc(n,o);o+=8;const _=tc(n,o);o+=8,s=O0(s,w),x[A]=new uk(w,_,b)}h[b]=x}}}const d=n.readInt32LE(o);o+=4;const p=new Array(d);for(let g=0;g<d;g++){const b=tc(n,o);o+=8,s=O0(s,b),p[g]=b}c[l]={binIndex:h,linearIndex:p,stats:f}}return{bai:!0,firstDataLine:s,maxBlockSize:65536,indices:c,refCount:r}}async indexCov(t,n,r,i={}){const o=n!==void 0,c=(await this.parse(i)).indices[t];if(!c)return[];const{linearIndex:l=[],stats:u}=c;if(l.length===0)return[];const f=r===void 0?(l.length-1)*16384:PK(r,16384),h=n===void 0?0:FK(n,16384),d=o?new Array((f-h)/16384):new Array(l.length-1),p=l[l.length-1].blockPosition;if(f>(l.length-1)*16384)throw new Error("query outside of range of linear index");let g=l[h/16384].blockPosition;for(let b=h/16384,v=0;b<f/16384;b++,v++)d[v]={score:l[b+1].blockPosition-g,start:b*16384,end:b*16384+16384},g=l[b+1].blockPosition;return d.map(b=>({...b,score:b.score*((u==null?void 0:u.lineCount)||0)/p}))}async blocksForRange(t,n,r,i={}){n<0&&(n=0);const a=await this.parse(i);if(!a)return[];const o=a.indices[t];if(!o)return[];const s=MK(n,r),c=[];for(const[d,p]of s)for(let g=d;g<=p;g++)if(o.binIndex[g]){const b=o.binIndex[g];for(const v of b)c.push(v)}const l=o.linearIndex.length;let u;const f=Math.min(n>>14,l-1),h=Math.min(r>>14,l-1);for(let d=f;d<=h;++d){const p=o.linearIndex[d];p&&(!u||p.compareTo(u)<0)&&(u=p)}return fk(c,u)}async parse(t={}){return this.setupP||(this.setupP=this._parse(t).catch(n=>{throw this.setupP=void 0,n})),this.setupP}async hasRefSeq(t,n={}){var r;return!!(!((r=(await this.parse(n)).indices[t])===null||r===void 0)&&r.binIndex)}}var ca=we.Buffer,s2=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(s2=new Int32Array(s2));function pk(e){if(ca.isBuffer(e))return e;var t=typeof ca.alloc=="function"&&typeof ca.from=="function";if(typeof e=="number")return t?ca.alloc(e):new ca(e);if(typeof e=="string")return t?ca.from(e):new ca(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function OK(e){var t=pk(4);return t.writeInt32BE(e,0),t}function c2(e,t){e=pk(e),ca.isBuffer(t)&&(t=t.readUInt32BE(0));for(var n=~~t^-1,r=0;r<e.length;r++)n=s2[(n^e[r])&255]^n>>>8;return n^-1}function l2(){return OK(c2.apply(null,arguments))}l2.signed=function(){return c2.apply(null,arguments)},l2.unsigned=function(){return c2.apply(null,arguments)>>>0};var LK=l2;const NK=uu(LK),zK=21582659,UK=38359875;function $K(e,t){return e*2**t}function gk(e,t){return Math.floor(e/2**t)}let L0=class extends dk{constructor(){super(...arguments),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(t,n){var r,i;return((i=(r=(await this.parse(n)).indices[t])===null||r===void 0?void 0:r.stats)===null||i===void 0?void 0:i.lineCount)||0}async indexCov(){return[]}parseAuxData(t,n){const r=t.readInt32LE(n),i=r&65536?"zero-based-half-open":"1-based-closed",a={0:"generic",1:"SAM",2:"VCF"}[r&15];if(!a)throw new Error(`invalid Tabix preset format flags ${r}`);const o={ref:t.readInt32LE(n+4),start:t.readInt32LE(n+8),end:t.readInt32LE(n+12)},s=t.readInt32LE(n+16),c=s?String.fromCharCode(s):"",l=t.readInt32LE(n+20),u=t.readInt32LE(n+24);return{columnNumbers:o,coordinateType:i,metaValue:s,metaChar:c,skipLines:l,format:a,formatFlags:r,...DK(t.subarray(n+28,n+28+u),this.renameRefSeq)}}async _parse(t){const n=await this.filehandle.readFile(t),r=await ea(n);let i;if(r.readUInt32LE(0)===zK)i=1;else if(r.readUInt32LE(0)===UK)i=2;else throw new Error("Not a CSI file");this.minShift=r.readInt32LE(4),this.depth=r.readInt32LE(8),this.maxBinNumber=((1<<(this.depth+1)*3)-1)/7;const a=r.readInt32LE(12),o=a>=30?this.parseAuxData(r,16):void 0,s=r.readInt32LE(16+a);let c=16+a+4,l;const u=new Array(s);for(let f=0;f<s;f++){const h=r.readInt32LE(c);c+=4;const d={};let p;for(let g=0;g<h;g++){const b=r.readUInt32LE(c);if(c+=4,b>this.maxBinNumber)p=hk(r,c+28),c+=28+16;else{l=O0(l,tc(r,c)),c+=8;const v=r.readInt32LE(c);c+=4;const x=new Array(v);for(let A=0;A<v;A+=1){const w=tc(r,c);c+=8;const _=tc(r,c);c+=8,l=O0(l,w),x[A]=new uk(w,_,b)}d[b]=x}}u[f]={binIndex:d,stats:p}}return{csiVersion:i,firstDataLine:l,indices:u,refCount:s,csi:!0,maxBlockSize:65536,...o}}async blocksForRange(t,n,r,i={}){n<0&&(n=0);const a=await this.parse(i),o=a==null?void 0:a.indices[t];if(!o)return[];const s=this.reg2bins(n,r);if(s.length===0)return[];const c=[];for(const[l,u]of s)for(let f=l;f<=u;f++)if(o.binIndex[f]){const h=o.binIndex[f];for(const d of h)c.push(d)}return fk(c,new lk(0,0))}reg2bins(t,n){t-=1,t<1&&(t=1),n>2**50&&(n=2**34),n-=1;let r=0,i=0,a=this.minShift+this.depth*3;const o=[];for(;r<=this.depth;a-=3,i+=$K(1,r*3),r+=1){const s=i+gk(t,a),c=i+gk(n,a);if(c-s+o.length>this.maxBinNumber)throw new Error(`query ${t}-${n} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);o.push([s,c])}return o}async parse(t={}){return this.setupP||(this.setupP=this._parse(t).catch(n=>{throw this.setupP=void 0,n})),this.setupP}async hasRefSeq(t,n={}){var r;return!!(!((r=(await this.parse(n)).indices[t])===null||r===void 0)&&r.binIndex)}};const Mn={BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048},mk="=ACMGRSVTWYHKDBN".split(""),Xu="MIDNSHP=X???????".split("");class bk{constructor(t){this.data={},this._tagList=[],this._allTagsParsed=!1;const{bytes:n,fileOffset:r}=t,{byteArray:i,start:a}=n;this.data={},this.bytes=n,this._id=r,this._refID=i.readInt32LE(a+4),this.data.start=i.readInt32LE(a+8),this.flags=(i.readInt32LE(a+16)&4294901760)>>16}get(t){return this[t]?this.data[t]?this.data[t]:(this.data[t]=this[t](),this.data[t]):this._get(t.toLowerCase())}end(){return this.get("start")+this.get("length_on_ref")}seq_id(){return this._refID}_get(t){return t in this.data?this.data[t]:(this.data[t]=this._parseTag(t),this.data[t])}_tags(){this._parseAllTags();let t=["seq"];this.isSegmentUnmapped()||t.push("start","end","strand","score","qual","MQ","CIGAR","length_on_ref","template_length"),this.isPaired()&&t.push("next_segment_position","pair_orientation"),t=t.concat(this._tagList||[]);for(const r of Object.keys(this.data))r[0]!=="_"&&r!=="next_seq_id"&&t.push(r);const n={};return t.filter(r=>{if(r in this.data&&this.data[r]===void 0||r==="CG"||r==="cg")return!1;const i=r.toLowerCase(),a=n[i];return n[i]=!0,!a})}parent(){}children(){return this.get("subfeatures")}id(){return this._id}mq(){const t=(this.get("_bin_mq_nl")&65280)>>8;return t===255?void 0:t}score(){return this.get("mq")}qual(){var t;return(t=this.qualRaw())===null||t===void 0?void 0:t.join(" ")}qualRaw(){if(this.isSegmentUnmapped())return;const{start:t,byteArray:n}=this.bytes,r=t+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4+this.get("_seq_bytes"),i=this.get("seq_length");return n.subarray(r,r+i)}strand(){return this.isReverseComplemented()?-1:1}multi_segment_next_segment_strand(){if(!this.isMateUnmapped())return this.isMateReverseComplemented()?-1:1}name(){return this.get("_read_name")}_read_name(){const t=this.get("_l_read_name"),{byteArray:n,start:r}=this.bytes;return n.toString("ascii",r+36,r+36+t-1)}_parseTag(t){if(this._allTagsParsed)return;const{byteArray:n,start:r}=this.bytes;let i=this._tagOffset||r+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4+this.get("_seq_bytes")+this.get("seq_length");const a=this.bytes.end;let o;for(;i<a&&o!==t;){const s=String.fromCharCode(n[i],n[i+1]);o=s.toLowerCase();const c=String.fromCharCode(n[i+2]);i+=3;let l;switch(c){case"A":{l=String.fromCharCode(n[i]),i+=1;break}case"i":{l=n.readInt32LE(i),i+=4;break}case"I":{l=n.readUInt32LE(i),i+=4;break}case"c":{l=n.readInt8(i),i+=1;break}case"C":{l=n.readUInt8(i),i+=1;break}case"s":{l=n.readInt16LE(i),i+=2;break}case"S":{l=n.readUInt16LE(i),i+=2;break}case"f":{l=n.readFloatLE(i),i+=4;break}case"Z":case"H":{for(l="";i<=a;){const u=n[i++];if(u===0)break;l+=String.fromCharCode(u)}break}case"B":{l="";const u=n[i++],f=String.fromCharCode(u),h=n.readInt32LE(i);if(i+=4,f==="i")if(s==="CG")for(let d=0;d<h;d++){const p=n.readInt32LE(i),g=p>>4,b=Xu[p&15];l+=g+b,i+=4}else for(let d=0;d<h;d++)l+=n.readInt32LE(i),d+1<h&&(l+=","),i+=4;if(f==="I")if(s==="CG")for(let d=0;d<h;d++){const p=n.readUInt32LE(i),g=p>>4,b=Xu[p&15];l+=g+b,i+=4}else for(let d=0;d<h;d++)l+=n.readUInt32LE(i),d+1<h&&(l+=","),i+=4;if(f==="s")for(let d=0;d<h;d++)l+=n.readInt16LE(i),d+1<h&&(l+=","),i+=2;if(f==="S")for(let d=0;d<h;d++)l+=n.readUInt16LE(i),d+1<h&&(l+=","),i+=2;if(f==="c")for(let d=0;d<h;d++)l+=n.readInt8(i),d+1<h&&(l+=","),i+=1;if(f==="C")for(let d=0;d<h;d++)l+=n.readUInt8(i),d+1<h&&(l+=","),i+=1;if(f==="f")for(let d=0;d<h;d++)l+=n.readFloatLE(i),d+1<h&&(l+=","),i+=4;break}default:console.warn(`Unknown BAM tag type '${c}', tags may be incomplete`),l=void 0,i=a}if(this._tagOffset=i,this._tagList.push(s),o===t)return l;this.data[o]=l}this._allTagsParsed=!0}_parseAllTags(){this._parseTag("")}_parseCigar(t){return t.match(/\d+\D/g).map(n=>[n.match(/\D/)[0].toUpperCase(),Number.parseInt(n,10)])}isPaired(){return!!(this.flags&Mn.BAM_FPAIRED)}isProperlyPaired(){return!!(this.flags&Mn.BAM_FPROPER_PAIR)}isSegmentUnmapped(){return!!(this.flags&Mn.BAM_FUNMAP)}isMateUnmapped(){return!!(this.flags&Mn.BAM_FMUNMAP)}isReverseComplemented(){return!!(this.flags&Mn.BAM_FREVERSE)}isMateReverseComplemented(){return!!(this.flags&Mn.BAM_FMREVERSE)}isRead1(){return!!(this.flags&Mn.BAM_FREAD1)}isRead2(){return!!(this.flags&Mn.BAM_FREAD2)}isSecondary(){return!!(this.flags&Mn.BAM_FSECONDARY)}isFailedQc(){return!!(this.flags&Mn.BAM_FQCFAIL)}isDuplicate(){return!!(this.flags&Mn.BAM_FDUP)}isSupplementary(){return!!(this.flags&Mn.BAM_FSUPPLEMENTARY)}cigar(){if(this.isSegmentUnmapped())return;const{byteArray:t,start:n}=this.bytes,r=this.get("_n_cigar_op");let i=n+36+this.get("_l_read_name");const a=this.get("seq_length");let o="",s=0,c=t.readInt32LE(i),l=c>>4,u=Xu[c&15];if(u==="S"&&l===a)return i+=4,c=t.readInt32LE(i),l=c>>4,u=Xu[c&15],u!=="N"&&console.warn("CG tag with no N tag"),this.data.length_on_ref=l,this.get("CG");for(let f=0;f<r;++f)c=t.readInt32LE(i),l=c>>4,u=Xu[c&15],o+=l+u,u!=="H"&&u!=="S"&&u!=="I"&&(s+=l),i+=4;return this.data.length_on_ref=s,o}_flags(){}length_on_ref(){return this.data.length_on_ref?this.data.length_on_ref:(this.get("cigar"),this.data.length_on_ref)}_n_cigar_op(){return this.get("_flag_nc")&65535}_l_read_name(){return this.get("_bin_mq_nl")&255}_seq_bytes(){return this.get("seq_length")+1>>1}getReadBases(){return this.seq()}seq(){const{byteArray:t,start:n}=this.bytes,r=n+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4,i=this.get("_seq_bytes"),a=this.get("seq_length");let o="",s=0;for(let c=0;c<i;++c){const l=t[r+c];o+=mk[(l&240)>>4],s++,s<a&&(o+=mk[l&15],s++)}return o}getPairOrientation(){if(!this.isSegmentUnmapped()&&!this.isMateUnmapped()&&this._refID===this._next_refid()){const t=this.isReverseComplemented()?"R":"F",n=this.isMateReverseComplemented()?"R":"F";let r=" ",i=" ";this.isRead1()?(r="1",i="2"):this.isRead2()&&(r="2",i="1");const a=[];return this.template_length()>0?(a[0]=t,a[1]=r,a[2]=n,a[3]=i):(a[2]=t,a[3]=r,a[0]=n,a[1]=i),a.join("")}return""}_bin_mq_nl(){return this.bytes.byteArray.readInt32LE(this.bytes.start+12)}_flag_nc(){return this.bytes.byteArray.readInt32LE(this.bytes.start+16)}seq_length(){return this.bytes.byteArray.readInt32LE(this.bytes.start+20)}_next_refid(){return this.bytes.byteArray.readInt32LE(this.bytes.start+24)}_next_pos(){return this.bytes.byteArray.readInt32LE(this.bytes.start+28)}template_length(){return this.bytes.byteArray.readInt32LE(this.bytes.start+32)}toJSON(){const t={};for(const n of Object.keys(this))n.charAt(0)==="_"||n==="bytes"||(t[n]=this[n]);return t}}function yk(e){const t=e.split(/\r?\n/),n=[];for(const r of t){const[i,...a]=r.split(/\t/);i&&n.push({tag:i.slice(1),data:a.map(o=>{const[s,c]=o.split(":",2);return{tag:s,value:c}})})}return n}const vk=21840194,wk=65536;async function HK(e){let t=[];for await(const n of e)t=t.concat(n);return t}class GK{read(){throw new Error("never called")}stat(){throw new Error("never called")}readFile(){throw new Error("never called")}close(){throw new Error("never called")}}class xk{constructor({bamFilehandle:t,bamPath:n,bamUrl:r,baiPath:i,baiFilehandle:a,baiUrl:o,csiPath:s,csiFilehandle:c,csiUrl:l,htsget:u,yieldThreadTime:f=100,renameRefSeqs:h=d=>d}){if(this.htsget=!1,this.featureCache=new v0({cache:new w0({maxSize:50}),fill:async(d,p)=>{const{chunk:g,opts:b}=d,{data:v,cpositions:x,dpositions:A}=await this._readChunk({chunk:g,opts:{...b,signal:p}});return this.readBamFeatures(v,x,A,g)}}),this.renameRefSeq=h,t)this.bam=t;else if(n)this.bam=new kt(n);else if(r)this.bam=new po(r);else if(u)this.htsget=!0,this.bam=new GK;else throw new Error("unable to initialize bam");if(c)this.index=new L0({filehandle:c});else if(s)this.index=new L0({filehandle:new kt(s)});else if(l)this.index=new L0({filehandle:new po(l)});else if(a)this.index=new nc({filehandle:a});else if(i)this.index=new nc({filehandle:new kt(i)});else if(o)this.index=new nc({filehandle:new po(o)});else if(n)this.index=new nc({filehandle:new kt(`${n}.bai`)});else if(r)this.index=new nc({filehandle:new po(`${r}.bai`)});else if(u)this.htsget=!0;else throw new Error("unable to infer index format");this.yieldThreadTime=f}async getHeaderPre(t){const n=RK(t);if(!this.index)return;const r=await this.index.parse(n),i=r.firstDataLine?r.firstDataLine.blockPosition+65535:void 0;let a;if(i){const u=i+wk,f=await this.bam.read(we.Buffer.alloc(u),0,u,0,n);if(!f.bytesRead)throw new Error("Error reading header");a=f.buffer.subarray(0,Math.min(f.bytesRead,i))}else a=await this.bam.readFile(n);const o=await ea(a);if(o.readInt32LE(0)!==vk)throw new Error("Not a BAM file");const s=o.readInt32LE(4);this.header=o.toString("utf8",8,8+s);const{chrToIndex:c,indexToChr:l}=await this._readRefSeqs(s+8,65535,n);return this.chrToIndex=c,this.indexToChr=l,yk(this.header)}getHeader(t){return this.headerP||(this.headerP=this.getHeaderPre(t).catch(n=>{throw this.headerP=void 0,n})),this.headerP}async getHeaderText(t={}){return await this.getHeader(t),this.header}async _readRefSeqs(t,n,r){if(t>n)return this._readRefSeqs(t,n*2,r);const i=n+wk,{bytesRead:a,buffer:o}=await this.bam.read(we.Buffer.alloc(i),0,n,0,r);if(!a)throw new Error("Error reading refseqs from header");const s=await ea(o.subarray(0,Math.min(a,n))),c=s.readInt32LE(t);let l=t+4;const u={},f=[];for(let h=0;h<c;h+=1){const d=s.readInt32LE(l),p=this.renameRefSeq(s.toString("utf8",l+4,l+4+d-1)),g=s.readInt32LE(l+d+4);if(u[p]=h,f.push({refName:p,length:g}),l=l+8+d,l>s.length)return console.warn(`BAM header is very big. Re-fetching ${n} bytes.`),this._readRefSeqs(t,n*2,r)}return{chrToIndex:u,indexToChr:f}}async getRecordsForRange(t,n,r,i){return HK(this.streamRecordsForRange(t,n,r,i))}async*streamRecordsForRange(t,n,r,i){var a;await this.getHeader(i);const o=(a=this.chrToIndex)===null||a===void 0?void 0:a[t];if(o===void 0||!this.index)yield[];else{const s=await this.index.blocksForRange(o,n-1,r,i);yield*this._fetchChunkFeatures(s,o,n,r,i)}}async*_fetchChunkFeatures(t,n,r,i,a={}){const{viewAsPairs:o}=a,s=[];let c=!1;for(const l of t){const u=await this.featureCache.get(l.toString(),{chunk:l,opts:a},a.signal),f=[];for(const h of u)if(h.seq_id()===n)if(h.get("start")>=i){c=!0;break}else h.get("end")>=r&&f.push(h);if(s.push(f),yield f,c)break}TK(a.signal),o&&(yield this.fetchPairs(n,s,a))}async fetchPairs(t,n,r){const{pairAcrossChr:i,maxInsertSize:a=2e5}=r,o={},s={};n.map(h=>{const d={};for(const p of h){const g=p.name(),b=p.id();d[g]||(d[g]=0),d[g]++,s[b]=1}for(const[p,g]of Object.entries(d))g===1&&(o[p]=!0)});const c=[];n.map(h=>{for(const d of h){const p=d.name(),g=d.get("start"),b=d._next_pos(),v=d._next_refid();this.index&&o[p]&&(i||v===t&&Math.abs(g-b)<a)&&c.push(this.index.blocksForRange(v,b,b+1,r))}});const l=new Map,u=await Promise.all(c);for(const h of u.flat())l.has(h.toString())||l.set(h.toString(),h);return(await Promise.all([...l.values()].map(async h=>{const{data:d,cpositions:p,dpositions:g,chunk:b}=await this._readChunk({chunk:h,opts:r}),v=[];for(const x of await this.readBamFeatures(d,p,g,b))o[x.get("name")]&&!s[x.id()]&&v.push(x);return v}))).flat()}async _readRegion(t,n,r={}){const{bytesRead:i,buffer:a}=await this.bam.read(we.Buffer.alloc(n),0,n,t,r);return a.subarray(0,Math.min(i,n))}async _readChunk({chunk:t,opts:n}){const r=await this._readRegion(t.minv.blockPosition,t.fetchedSize(),n),{buffer:i,cpositions:a,dpositions:o}=await $C(r,t);return{data:i,cpositions:a,dpositions:o,chunk:t}}async readBamFeatures(t,n,r,i){let a=0;const o=[];let s=0,c=+Date.now();for(;a+4<t.length;){const l=t.readInt32LE(a),u=a+4+l-1;if(r){for(;a+i.minv.dataPosition>=r[s++];);s--}if(u<t.length){const f=new bk({bytes:{byteArray:t,start:a,end:u},fileOffset:n.length>0?n[s]*256+(a-r[s])+i.minv.dataPosition+1:NK.signed(t.slice(a,u))});o.push(f),this.yieldThreadTime&&+Date.now()-c>this.yieldThreadTime&&(await CK(1),c=+Date.now())}a=u+1}return o}async hasRefSeq(t){var n,r;const i=(n=this.chrToIndex)===null||n===void 0?void 0:n[t];return i===void 0?!1:(r=this.index)===null||r===void 0?void 0:r.hasRefSeq(i)}async lineCount(t){var n;const r=(n=this.chrToIndex)===null||n===void 0?void 0:n[t];return r===void 0||!this.index?0:this.index.lineCount(r)}async indexCov(t,n,r){var i;if(!this.index)return[];await this.index.parse();const a=(i=this.chrToIndex)===null||i===void 0?void 0:i[t];return a===void 0?[]:this.index.indexCov(a,n,r)}async blocksForRange(t,n,r,i){var a;if(!this.index)return[];await this.index.parse();const o=(a=this.chrToIndex)===null||a===void 0?void 0:a[t];return o===void 0?[]:this.index.blocksForRange(o,n,r,i)}}async function Ak(e,t){const n=await Promise.all(e.map(async r=>{const{url:i,headers:a}=r;if(i.startsWith("data:"))return we.Buffer.from(i.split(",")[1],"base64");{const{referer:o,...s}=a,c=await fetch(i,{...t,headers:{...t==null?void 0:t.headers,...s}});if(!c.ok)throw new Error(`HTTP ${c.status} fetching ${i}: ${await c.text()}`);return we.Buffer.from(await c.arrayBuffer())}}));return we.Buffer.concat(await Promise.all(n.map(r=>ea(r))))}class VK extends xk{constructor(t){super({htsget:!0}),this.baseUrl=t.baseUrl,this.trackId=t.trackId}async*streamRecordsForRange(t,n,r,i){var a;const s=`${`${this.baseUrl}/${this.trackId}`}?referenceName=${t}&start=${n}&end=${r}&format=BAM`,c=(a=this.chrToIndex)===null||a===void 0?void 0:a[t];if(c===void 0)yield[];else{const l=await fetch(s,{...i});if(!l.ok)throw new Error(`HTTP ${l.status} fetching ${s}: ${await l.text()}`);const u=await l.json(),f=await Ak(u.htsget.urls.slice(1),i);yield*this._fetchChunkFeatures([{buffer:f,_fetchedSize:void 0,bin:0,compareTo(){return 0},toUniqueString(){return`${t}_${n}_${r}`},fetchedSize(){return 0},minv:{dataPosition:0,blockPosition:0,compareTo:()=>0},maxv:{dataPosition:Number.MAX_SAFE_INTEGER,blockPosition:0,compareTo:()=>0},toString(){return`${t}_${n}_${r}`}}],c,n,r,i)}}async _readChunk({chunk:t}){if(!t.buffer)throw new Error("expected chunk.buffer in htsget");return{data:t.buffer,cpositions:[],dpositions:[],chunk:t}}async getHeader(t={}){const n=`${this.baseUrl}/${this.trackId}?referenceName=na&class=header`,r=await fetch(n,t);if(!r.ok)throw new Error(`HTTP ${r.status} fetching ${n}: ${await r.text()}`);const i=await r.json(),a=await Ak(i.htsget.urls,t);if(a.readInt32LE(0)!==vk)throw new Error("Not a BAM file");const o=a.readInt32LE(4),s=a.toString("utf8",8,8+o),c=yk(s),l=[],u={},f=c.filter(h=>h.tag==="SQ");for(const[h,d]of f.entries()){let p="",g=0;for(const b of d.data)b.tag==="SN"?p=b.value:b.tag==="LN"&&(g=+b.value);u[p]=h,l[h]={refName:p,length:g}}return this.chrToIndex=u,this.indexToChr=l,c}}const jK=Object.freeze(Object.defineProperty({__proto__:null,BAI:nc,BamFile:xk,BamRecord:bk,CSI:L0,HtsgetFile:VK},Symbol.toStringTag,{value:"Module"}));function Ek(e){if(e.greaterThan(Number.MAX_SAFE_INTEGER)||e.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return e.toNumber()}class qK extends Error{}function rc(e){if(e&&e.aborted){if(typeof DOMException<"u")throw new DOMException("aborted","AbortError");{const t=new qK("aborted");throw t.code="ERR_ABORTED",t}}}function WK(e,t){return t.minv.blockPosition-e.maxv.blockPosition<65e3&&t.maxv.blockPosition-e.minv.blockPosition<5e6}function Sk(e,t){const n=[];let r=null;return e.length===0?e:(e.sort(function(i,a){const o=i.minv.blockPosition-a.minv.blockPosition;return o!==0?o:i.minv.dataPosition-a.minv.dataPosition}),e.forEach(i=>{(!t||i.maxv.compareTo(t)>0)&&(r===null?(n.push(i),r=i):WK(r,i)?i.maxv.compareTo(r.maxv)>0&&(r.maxv=i.maxv):(n.push(i),r=i))}),n)}class u2{constructor(t,n){this.blockPosition=t,this.dataPosition=n}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(t){return this.blockPosition-t.blockPosition||this.dataPosition-t.dataPosition}static min(...t){let n,r=0;for(;!n;r+=1)n=t[r];for(;r<t.length;r+=1)n.compareTo(t[r])>0&&(n=t[r]);return n}}function ic(e,t=0,n=!1){if(n)throw new Error("big-endian virtual file offsets not implemented");return new u2(e[t+7]*1099511627776+e[t+6]*4294967296+e[t+5]*16777216+e[t+4]*65536+e[t+3]*256+e[t+2],e[t+1]<<8|e[t])}class N0{constructor(t,n,r,i=void 0){this.minv=t,this.maxv=n,this.bin=r,this._fetchedSize=i}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(t){return this.minv.compareTo(t.minv)||this.maxv.compareTo(t.maxv)||this.bin-t.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}class _k{constructor({filehandle:t,renameRefSeqs:n=r=>r}){this.filehandle=t,this.renameRefSeq=n}async getMetadata(t={}){const{indices:n,...r}=await this.parse(t);return r}_findFirstData(t,n){return t?t.compareTo(n)>0?n:t:n}async parse(t={}){return this.parseP||(this.parseP=this._parse(t).catch(n=>{throw this.parseP=void 0,n})),this.parseP}async hasRefSeq(t,n={}){var r;return!!(!((r=(await this.parse(n)).indices[t])===null||r===void 0)&&r.binIndex)}}const YK=21578324,Ck=14;function ZK(e,t){return e+=1,t-=1,[[0,0],[1+(e>>26),1+(t>>26)],[9+(e>>23),9+(t>>23)],[73+(e>>20),73+(t>>20)],[585+(e>>17),585+(t>>17)],[4681+(e>>14),4681+(t>>14)]]}class z0 extends _k{async lineCount(t,n={}){const r=await this.parse(n);if(!r)return-1;const i=r.refNameToId[t];if(!r.indices[i])return-1;const{stats:o}=r.indices[i];return o?o.lineCount:-1}async _parse(t={}){const n=await this.filehandle.readFile(t),r=await ea(n);if(rc(t.signal),r.readUInt32LE(0)!==YK)throw new Error("Not a TBI file");const i=r.readInt32LE(4),a=r.readInt32LE(8),o=a&65536?"zero-based-half-open":"1-based-closed",c={0:"generic",1:"SAM",2:"VCF"}[a&15];if(!c)throw new Error(`invalid Tabix preset format flags ${a}`);const l={ref:r.readInt32LE(12),start:r.readInt32LE(16),end:r.readInt32LE(20)},u=r.readInt32LE(24),f=5,h=((1<<(f+1)*3)-1)/7,d=2**(14+f*3),p=u?String.fromCharCode(u):null,g=r.readInt32LE(28),b=r.readInt32LE(32),{refNameToId:v,refIdToName:x}=this._parseNameBytes(r.slice(36,36+b));let A=36+b,w;return{indices:new Array(i).fill(0).map(()=>{const C=r.readInt32LE(A);A+=4;const I={};let D;for(let z=0;z<C;z+=1){const ae=r.readUInt32LE(A);if(A+=4,ae>h+1)throw new Error("tabix index contains too many bins, please use a CSI index");if(ae===h+1){const se=r.readInt32LE(A);A+=4,se===2&&(D=this.parsePseudoBin(r,A)),A+=16*se}else{const se=r.readInt32LE(A);A+=4;const ve=new Array(se);for(let Pe=0;Pe<se;Pe+=1){const st=ic(r,A),Ne=ic(r,A+8);A+=16,w=this._findFirstData(w,st),ve[Pe]=new N0(st,Ne,ae)}I[ae]=ve}}const B=r.readInt32LE(A);A+=4;const G=new Array(B);for(let z=0;z<B;z+=1)G[z]=ic(r,A),A+=8,w=this._findFirstData(w,G[z]);return{binIndex:I,linearIndex:G,stats:D}}),metaChar:p,maxBinNumber:h,maxRefLength:d,skipLines:g,firstDataLine:w,columnNumbers:l,coordinateType:o,format:c,refIdToName:x,refNameToId:v,maxBlockSize:65536}}parsePseudoBin(t,n){return{lineCount:Ek(f0.fromBytesLE(t.slice(n+16,n+24),!0))}}_parseNameBytes(t){let n=0,r=0;const i=[],a={};for(let o=0;o<t.length;o+=1)if(!t[o]){if(r<o){let s=t.toString("utf8",r,o);s=this.renameRefSeq(s),i[n]=s,a[s]=n}r=o+1,n+=1}return{refNameToId:a,refIdToName:i}}async blocksForRange(t,n,r,i={}){n<0&&(n=0);const a=await this.parse(i);if(!a)return[];const o=a.refNameToId[t],s=a.indices[o];if(!s)return[];(s.linearIndex.length?s.linearIndex[n>>Ck>=s.linearIndex.length?s.linearIndex.length-1:n>>Ck]:new u2(0,0))||console.warn("querying outside of possible tabix range");const l=ZK(n,r),u=[];for(const[g,b]of l)for(let v=g;v<=b;v++)if(s.binIndex[v])for(const x of s.binIndex[v])u.push(new N0(x.minv,x.maxv,v));const f=s.linearIndex.length;let h=null;const d=Math.min(n>>14,f-1),p=Math.min(r>>14,f-1);for(let g=d;g<=p;++g){const b=s.linearIndex[g];b&&(!h||b.compareTo(h)<0)&&(h=b)}return Sk(u,h)}}const QK=21582659,XK=38359875;function KK(e,t){return e*2**t}function kk(e,t){return Math.floor(e/2**t)}class f2 extends _k{constructor(t){super(t),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(t,n={}){const r=await this.parse(n);if(!r)return-1;const i=r.refNameToId[t];if(!r.indices[i])return-1;const{stats:o}=r.indices[i];return o?o.lineCount:-1}indexCov(){throw new Error("CSI indexes do not support indexcov")}parseAuxData(t,n){const r=t.readInt32LE(n),i=r&65536?"zero-based-half-open":"1-based-closed",a={0:"generic",1:"SAM",2:"VCF"}[r&15];if(!a)throw new Error(`invalid Tabix preset format flags ${r}`);const o={ref:t.readInt32LE(n+4),start:t.readInt32LE(n+8),end:t.readInt32LE(n+12)},s=t.readInt32LE(n+16),c=s?String.fromCharCode(s):null,l=t.readInt32LE(n+20),u=t.readInt32LE(n+24),{refIdToName:f,refNameToId:h}=this._parseNameBytes(t.slice(n+28,n+28+u));return{refIdToName:f,refNameToId:h,skipLines:l,metaChar:c,columnNumbers:o,format:a,coordinateType:i}}_parseNameBytes(t){let n=0,r=0;const i=[],a={};for(let o=0;o<t.length;o+=1)if(!t[o]){if(r<o){let s=t.toString("utf8",r,o);s=this.renameRefSeq(s),i[n]=s,a[s]=n}r=o+1,n+=1}return{refNameToId:a,refIdToName:i}}async _parse(t={}){const n=await ea(await this.filehandle.readFile(t));let r;if(n.readUInt32LE(0)===QK)r=1;else if(n.readUInt32LE(0)===XK)r=2;else throw new Error("Not a CSI file");this.minShift=n.readInt32LE(4),this.depth=n.readInt32LE(8),this.maxBinNumber=((1<<(this.depth+1)*3)-1)/7;const i=2**(this.minShift+this.depth*3),a=n.readInt32LE(12),o=a&&a>=30?this.parseAuxData(n,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},s=n.readInt32LE(16+a);let c,l=16+a+4;const u=new Array(s).fill(0).map(()=>{const f=n.readInt32LE(l);l+=4;const h={};let d;for(let p=0;p<f;p+=1){const g=n.readUInt32LE(l);if(g>this.maxBinNumber)d=this.parsePseudoBin(n,l+4),l+=4+8+4+16+16;else{const b=ic(n,l+4);c=this._findFirstData(c,b);const v=n.readInt32LE(l+12);l+=16;const x=new Array(v);for(let A=0;A<v;A+=1){const w=ic(n,l),_=ic(n,l+8);l+=16,x[A]=new N0(w,_,g)}h[g]=x}}return{binIndex:h,stats:d}});return{...o,csi:!0,refCount:s,maxBlockSize:65536,firstDataLine:c,csiVersion:r,indices:u,depth:this.depth,maxBinNumber:this.maxBinNumber,maxRefLength:i}}parsePseudoBin(t,n){return{lineCount:Ek(f0.fromBytesLE(t.slice(n+28,n+36),!0))}}async blocksForRange(t,n,r,i={}){n<0&&(n=0);const a=await this.parse(i);if(!a)return[];const o=a.refNameToId[t],s=a.indices[o];if(!s)return[];const c=this.reg2bins(n,r),l=[];for(const[u,f]of c)for(let h=u;h<=f;h++)if(s.binIndex[h])for(const d of s.binIndex[h])l.push(new N0(d.minv,d.maxv,h));return Sk(l,new u2(0,0))}reg2bins(t,n){t-=1,t<1&&(t=1),n>2**50&&(n=2**34),n-=1;let r=0,i=0,a=this.minShift+this.depth*3;const o=[];for(;r<=this.depth;a-=3,i+=KK(1,r*3),r+=1){const s=i+kk(t,a),c=i+kk(n,a);if(c-s+o.length>this.maxBinNumber)throw new Error(`query ${t}-${n} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);o.push([s,c])}return o}}const h2=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function JK(e){return new Promise(t=>setTimeout(t,e))}class eJ{constructor({path:t,filehandle:n,tbiPath:r,tbiFilehandle:i,csiPath:a,csiFilehandle:o,yieldTime:s=500,chunkSizeLimit:c=5e7,renameRefSeqs:l=f=>f,chunkCacheSize:u=5*2**20}){if(n)this.filehandle=n;else if(t)this.filehandle=new kt(t);else throw new TypeError("must provide either filehandle or path");if(i)this.index=new z0({filehandle:i,renameRefSeqs:l});else if(o)this.index=new f2({filehandle:o,renameRefSeqs:l});else if(r)this.index=new z0({filehandle:new kt(r),renameRefSeqs:l});else if(a)this.index=new f2({filehandle:new kt(a),renameRefSeqs:l});else if(t)this.index=new z0({filehandle:new kt(`${t}.tbi`),renameRefSeqs:l});else throw new TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, or csiPath");this.chunkSizeLimit=c,this.renameRefSeq=l,this.yieldTime=s,this.chunkCache=new v0({cache:new w0({maxSize:Math.floor(u/65536)}),fill:(f,h)=>this.readChunk(f,{signal:h})})}async getLines(t,n,r,i){var a;let o,s={},c;if(i===void 0)throw new TypeError("line callback must be provided");if(typeof i=="function"?c=i:(s=i,c=i.lineCallback,o=i.signal),t===void 0)throw new TypeError("must provide a reference sequence name");if(!c)throw new TypeError("line callback must be provided");const l=await this.index.getMetadata(s);rc(o);const u=n??0,f=r??l.maxRefLength;if(!(u<=f))throw new TypeError("invalid start and end coordinates. start must be less than or equal to end");if(u===f)return;const h=await this.index.blocksForRange(t,u,f,s);rc(o);for(const p of h){const g=p.fetchedSize();if(g>this.chunkSizeLimit)throw new Error(`Too much data. Chunk size ${g.toLocaleString()} bytes exceeds chunkSizeLimit of ${this.chunkSizeLimit.toLocaleString()}.`)}let d=Date.now();for(const p of h){let g;const{buffer:b,cpositions:v,dpositions:x}=await this.chunkCache.get(p.toString(),p,o);rc(o);let A=0,w=0;for(;A<b.length;){const _=b.indexOf(`
|
3366
|
+
`,A);if(_===-1)break;const C=b.slice(A,_),I=(a=h2==null?void 0:h2.decode(C))!==null&&a!==void 0?a:C.toString();if(x){for(;A+p.minv.dataPosition>=x[w++];);w--}const{startCoordinate:D,overlaps:B}=this.checkLine(l,t,u,f,I);if(g!==void 0&&D!==void 0&&g>D)throw new Error(`Lines not sorted by start coordinate (${g} > ${D}), this file is not usable with Tabix.`);if(g=D,B)c(I.trim(),v[w]*256+(A-x[w])+p.minv.dataPosition+1);else if(D!==void 0&&D>=f)return;this.yieldTime&&d-Date.now()>this.yieldTime&&(d=Date.now(),rc(o),await JK(1)),A=_+1}}}async getMetadata(t={}){return this.index.getMetadata(t)}async getHeaderBuffer(t={}){const{firstDataLine:n,metaChar:r,maxBlockSize:i}=await this.getMetadata(t);rc(t.signal);const a=((n==null?void 0:n.blockPosition)||0)+i,o=await this._readRegion(0,a,t),s=await ea(o);if(r){let c=-1;const l=`
|
3367
|
+
`.charCodeAt(0),u=r.charCodeAt(0);for(let f=0;f<s.length&&!(f===c+1&&s[f]!==u);f+=1)s[f]===l&&(c=f);return s.slice(0,c+1)}return s}async getHeader(t={}){return(await this.getHeaderBuffer(t)).toString("utf8")}async getReferenceSequenceNames(t={}){return(await this.getMetadata(t)).refIdToName}checkLine(t,n,r,i,a){const{columnNumbers:o,metaChar:s,coordinateType:c,format:l}=t;if(s&&a.startsWith(s))return{overlaps:!1};let{ref:u,start:f,end:h}=o;u||(u=0),f||(f=0),h||(h=0),l==="VCF"&&(h=8);const d=Math.max(u,f,h);let p=1,g=0,b="",v=-1/0;for(let x=0;x<a.length+1;x+=1)if(a[x]===" "||x===a.length){if(p===u){if(this.renameRefSeq(a.slice(g,x))!==n)return{overlaps:!1}}else if(p===f){if(v=parseInt(a.slice(g,x),10),c==="1-based-closed"&&(v-=1),v>=i)return{startCoordinate:v,overlaps:!1};if((h===0||h===f)&&v+1<=r)return{startCoordinate:v,overlaps:!1}}else if(l==="VCF"&&p===4)b=a.slice(g,x);else if(p===h&&(l==="VCF"?this._getVcfEnd(v,b,a.slice(g,x)):parseInt(a.slice(g,x),10))<=r)return{overlaps:!1};if(g=x+1,p+=1,p>d)break}return{startCoordinate:v,overlaps:!0}}_getVcfEnd(t,n,r){let i=t+n.length;const a=r.includes("SVTYPE=TRA");if(r[0]!=="."&&!a){let o=";";for(let s=0;s<r.length;s+=1){if(o===";"&&r.slice(s,s+4)==="END="){let c=r.indexOf(";",s);c===-1&&(c=r.length),i=parseInt(r.slice(s+4,c),10);break}o=r[s]}}else if(a)return t+1;return i}async lineCount(t,n={}){return this.index.lineCount(t,n)}async _readRegion(t,n,r={}){const i=we.Buffer.alloc(n),{bytesRead:a,buffer:o}=await this.filehandle.read(i,0,n,t,r);return o.slice(0,a)}async readChunk(t,n={}){const r=await this._readRegion(t.minv.blockPosition,t.fetchedSize(),n);return $C(r,t)}}const tJ=Object.freeze(Object.defineProperty({__proto__:null,CSI:f2,TBI:z0,TabixIndexedFile:eJ},Symbol.toStringTag,{value:"Module"}));var d2={exports:{}},ac=typeof Reflect=="object"?Reflect:null,Tk=ac&&typeof ac.apply=="function"?ac.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},U0;ac&&typeof ac.ownKeys=="function"?U0=ac.ownKeys:Object.getOwnPropertySymbols?U0=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:U0=function(t){return Object.getOwnPropertyNames(t)};function nJ(e){console&&console.warn&&console.warn(e)}var Ik=Number.isNaN||function(t){return t!==t};function Le(){Le.init.call(this)}d2.exports=Le,d2.exports.once=oJ,Le.EventEmitter=Le,Le.prototype._events=void 0,Le.prototype._eventsCount=0,Le.prototype._maxListeners=void 0;var Rk=10;function $0(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Le,"defaultMaxListeners",{enumerable:!0,get:function(){return Rk},set:function(e){if(typeof e!="number"||e<0||Ik(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Rk=e}}),Le.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},Le.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Ik(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Dk(e){return e._maxListeners===void 0?Le.defaultMaxListeners:e._maxListeners}Le.prototype.getMaxListeners=function(){return Dk(this)},Le.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=t==="error",a=this._events;if(a!==void 0)i=i&&a.error===void 0;else if(!i)return!1;if(i){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=a[t];if(c===void 0)return!1;if(typeof c=="function")Tk(c,this,n);else for(var l=c.length,u=Ok(c,l),r=0;r<l;++r)Tk(u[r],this,n);return!0};function Bk(e,t,n,r){var i,a,o;if($0(n),a=e._events,a===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),o===void 0)o=a[t]=n,++e._eventsCount;else if(typeof o=="function"?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),i=Dk(e),i>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,nJ(s)}return e}Le.prototype.addListener=function(t,n){return Bk(this,t,n,!1)},Le.prototype.on=Le.prototype.addListener,Le.prototype.prependListener=function(t,n){return Bk(this,t,n,!0)};function rJ(){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 Fk(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=rJ.bind(r);return i.listener=n,r.wrapFn=i,i}Le.prototype.once=function(t,n){return $0(n),this.on(t,Fk(this,t,n)),this},Le.prototype.prependOnceListener=function(t,n){return $0(n),this.prependListener(t,Fk(this,t,n)),this},Le.prototype.removeListener=function(t,n){var r,i,a,o,s;if($0(n),i=this._events,i===void 0)return this;if(r=i[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(a=-1,o=r.length-1;o>=0;o--)if(r[o]===n||r[o].listener===n){s=r[o].listener,a=o;break}if(a<0)return this;a===0?r.shift():iJ(r,a),r.length===1&&(i[t]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",t,s||n)}return this},Le.prototype.off=Le.prototype.removeListener,Le.prototype.removeAllListeners=function(t){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var a=Object.keys(r),o;for(i=0;i<a.length;++i)o=a[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(i=n.length-1;i>=0;i--)this.removeListener(t,n[i]);return this};function Pk(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?aJ(i):Ok(i,i.length)}Le.prototype.listeners=function(t){return Pk(this,t,!0)},Le.prototype.rawListeners=function(t){return Pk(this,t,!1)},Le.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Mk.call(e,t)},Le.prototype.listenerCount=Mk;function Mk(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Le.prototype.eventNames=function(){return this._eventsCount>0?U0(this._events):[]};function Ok(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function iJ(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function aJ(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function oJ(e,t){return new Promise(function(n,r){function i(o){e.removeListener(t,a),r(o)}function a(){typeof e.removeListener=="function"&&e.removeListener("error",i),n([].slice.call(arguments))}Lk(e,t,a,{once:!0}),t!=="error"&&sJ(e,i,{once:!0})})}function sJ(e,t,n){typeof e.on=="function"&&Lk(e,"error",t,n)}function Lk(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var p2=d2.exports,g2={exports:{}};typeof Object.create=="function"?g2.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:g2.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var oc=g2.exports,m2,Nk;function zk(){return Nk||(Nk=1,m2=p2.EventEmitter),m2}const Uk=Kj(Iq);var b2,$k;function cJ(){if($k)return b2;$k=1;function e(p,g){var b=Object.keys(p);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(p);g&&(v=v.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),b.push.apply(b,v)}return b}function t(p){for(var g=1;g<arguments.length;g++){var b=arguments[g]!=null?arguments[g]:{};g%2?e(Object(b),!0).forEach(function(v){n(p,v,b[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):e(Object(b)).forEach(function(v){Object.defineProperty(p,v,Object.getOwnPropertyDescriptor(b,v))})}return p}function n(p,g,b){return g=o(g),g in p?Object.defineProperty(p,g,{value:b,enumerable:!0,configurable:!0,writable:!0}):p[g]=b,p}function r(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")}function i(p,g){for(var b=0;b<g.length;b++){var v=g[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(p,o(v.key),v)}}function a(p,g,b){return g&&i(p.prototype,g),b&&i(p,b),Object.defineProperty(p,"prototype",{writable:!1}),p}function o(p){var g=s(p,"string");return typeof g=="symbol"?g:String(g)}function s(p,g){if(typeof p!="object"||p===null)return p;var b=p[Symbol.toPrimitive];if(b!==void 0){var v=b.call(p,g||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(p)}var c=we,l=c.Buffer,u=Uk,f=u.inspect,h=f&&f.custom||"inspect";function d(p,g,b){l.prototype.copy.call(p,g,b)}return b2=function(){function p(){r(this,p),this.head=null,this.tail=null,this.length=0}return a(p,[{key:"push",value:function(b){var v={data:b,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(b){var v={data:b,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var v=this.head,x=""+v.data;v=v.next;)x+=b+v.data;return x}},{key:"concat",value:function(b){if(this.length===0)return l.alloc(0);for(var v=l.allocUnsafe(b>>>0),x=this.head,A=0;x;)d(x.data,v,A),A+=x.data.length,x=x.next;return v}},{key:"consume",value:function(b,v){var x;return b<this.head.data.length?(x=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):b===this.head.data.length?x=this.shift():x=v?this._getString(b):this._getBuffer(b),x}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var v=this.head,x=1,A=v.data;for(b-=A.length;v=v.next;){var w=v.data,_=b>w.length?w.length:b;if(_===w.length?A+=w:A+=w.slice(0,b),b-=_,b===0){_===w.length?(++x,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=w.slice(_));break}++x}return this.length-=x,A}},{key:"_getBuffer",value:function(b){var v=l.allocUnsafe(b),x=this.head,A=1;for(x.data.copy(v),b-=x.data.length;x=x.next;){var w=x.data,_=b>w.length?w.length:b;if(w.copy(v,v.length-b,0,_),b-=_,b===0){_===w.length?(++A,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=w.slice(_));break}++A}return this.length-=A,v}},{key:h,value:function(b,v){return f(this,t(t({},v),{},{depth:0,customInspect:!1}))}}]),p}(),b2}var y2,Hk;function Gk(){if(Hk)return y2;Hk=1;function e(o,s){var c=this,l=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return l||u?(s?s(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,o)):process.nextTick(i,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(f){!s&&f?c._writableState?c._writableState.errorEmitted?process.nextTick(n,c):(c._writableState.errorEmitted=!0,process.nextTick(t,c,f)):process.nextTick(t,c,f):s?(process.nextTick(n,c),s(f)):process.nextTick(n,c)}),this)}function t(o,s){i(o,s),n(o)}function n(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function i(o,s){o.emit("error",s)}function a(o,s){var c=o._readableState,l=o._writableState;c&&c.autoDestroy||l&&l.autoDestroy?o.destroy(s):o.emit("error",s)}return y2={destroy:e,undestroy:r,errorOrDestroy:a},y2}var v2={},Vk;function sc(){if(Vk)return v2;Vk=1;function e(s,c){s.prototype=Object.create(c.prototype),s.prototype.constructor=s,s.__proto__=c}var t={};function n(s,c,l){l||(l=Error);function u(h,d,p){return typeof c=="string"?c:c(h,d,p)}var f=function(h){e(d,h);function d(p,g,b){return h.call(this,u(p,g,b))||this}return d}(l);f.prototype.name=l.name,f.prototype.code=s,t[s]=f}function r(s,c){if(Array.isArray(s)){var l=s.length;return s=s.map(function(u){return String(u)}),l>2?"one of ".concat(c," ").concat(s.slice(0,l-1).join(", "),", or ")+s[l-1]:l===2?"one of ".concat(c," ").concat(s[0]," or ").concat(s[1]):"of ".concat(c," ").concat(s[0])}else return"of ".concat(c," ").concat(String(s))}function i(s,c,l){return s.substr(!l||l<0?0:+l,c.length)===c}function a(s,c,l){return(l===void 0||l>s.length)&&(l=s.length),s.substring(l-c.length,l)===c}function o(s,c,l){return typeof l!="number"&&(l=0),l+c.length>s.length?!1:s.indexOf(c,l)!==-1}return n("ERR_INVALID_OPT_VALUE",function(s,c){return'The value "'+c+'" is invalid for option "'+s+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(s,c,l){var u;typeof c=="string"&&i(c,"not ")?(u="must not be",c=c.replace(/^not /,"")):u="must be";var f;if(a(s," argument"))f="The ".concat(s," ").concat(u," ").concat(r(c,"type"));else{var h=o(s,".")?"property":"argument";f='The "'.concat(s,'" ').concat(h," ").concat(u," ").concat(r(c,"type"))}return f+=". Received type ".concat(typeof l),f},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),v2.codes=t,v2}var w2,jk;function qk(){if(jk)return w2;jk=1;var e=sc().codes.ERR_INVALID_OPT_VALUE;function t(r,i,a){return r.highWaterMark!=null?r.highWaterMark:i?r[a]:null}function n(r,i,a,o){var s=t(i,o,a);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var c=o?a:"highWaterMark";throw new e(c,s)}return Math.floor(s)}return r.objectMode?16:16*1024}return w2={getHighWaterMark:n},w2}var x2,Wk;function lJ(){if(Wk)return x2;Wk=1,x2=e;function e(n,r){if(t("noDeprecation"))return n;var i=!1;function a(){if(!i){if(t("throwDeprecation"))throw new Error(r);t("traceDeprecation")?console.trace(r):console.warn(r),i=!0}return n.apply(this,arguments)}return a}function t(n){try{if(!globalThis.localStorage)return!1}catch{return!1}var r=globalThis.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return x2}var A2,Yk;function Zk(){if(Yk)return A2;Yk=1,A2=D;function e(L){var O=this;this.next=null,this.entry=null,this.finish=function(){Ve(O,L)}}var t;D.WritableState=C;var n={deprecate:lJ()},r=zk(),i=we.Buffer,a=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(L){return i.from(L)}function s(L){return i.isBuffer(L)||L instanceof a}var c=Gk(),l=qk(),u=l.getHighWaterMark,f=sc().codes,h=f.ERR_INVALID_ARG_TYPE,d=f.ERR_METHOD_NOT_IMPLEMENTED,p=f.ERR_MULTIPLE_CALLBACK,g=f.ERR_STREAM_CANNOT_PIPE,b=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,x=f.ERR_STREAM_WRITE_AFTER_END,A=f.ERR_UNKNOWN_ENCODING,w=c.errorOrDestroy;oc(D,r);function _(){}function C(L,O,W){t=t||cc(),L=L||{},typeof W!="boolean"&&(W=O instanceof t),this.objectMode=!!L.objectMode,W&&(this.objectMode=this.objectMode||!!L.writableObjectMode),this.highWaterMark=u(this,L,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var j=L.decodeStrings===!1;this.decodeStrings=!j,this.defaultEncoding=L.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){st(O,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=L.emitClose!==!1,this.autoDestroy=!!L.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}C.prototype.getBuffer=function(){for(var O=this.bufferedRequest,W=[];O;)W.push(O),O=O.next;return W},function(){try{Object.defineProperty(C.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(D,Symbol.hasInstance,{value:function(O){return I.call(this,O)?!0:this!==D?!1:O&&O._writableState instanceof C}})):I=function(O){return O instanceof this};function D(L){t=t||cc();var O=this instanceof t;if(!O&&!I.call(D,this))return new D(L);this._writableState=new C(L,this,O),this.writable=!0,L&&(typeof L.write=="function"&&(this._write=L.write),typeof L.writev=="function"&&(this._writev=L.writev),typeof L.destroy=="function"&&(this._destroy=L.destroy),typeof L.final=="function"&&(this._final=L.final)),r.call(this)}D.prototype.pipe=function(){w(this,new g)};function B(L,O){var W=new x;w(L,W),process.nextTick(O,W)}function G(L,O,W,j){var Q;return W===null?Q=new v:typeof W!="string"&&!O.objectMode&&(Q=new h("chunk",["string","Buffer"],W)),Q?(w(L,Q),process.nextTick(j,Q),!1):!0}D.prototype.write=function(L,O,W){var j=this._writableState,Q=!1,T=!j.objectMode&&s(L);return T&&!i.isBuffer(L)&&(L=o(L)),typeof O=="function"&&(W=O,O=null),T?O="buffer":O||(O=j.defaultEncoding),typeof W!="function"&&(W=_),j.ending?B(this,W):(T||G(this,j,L,W))&&(j.pendingcb++,Q=ae(this,j,T,L,O,W)),Q},D.prototype.cork=function(){this._writableState.corked++},D.prototype.uncork=function(){var L=this._writableState;L.corked&&(L.corked--,!L.writing&&!L.corked&&!L.bufferProcessing&&L.bufferedRequest&&tt(this,L))},D.prototype.setDefaultEncoding=function(O){if(typeof O=="string"&&(O=O.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((O+"").toLowerCase())>-1))throw new A(O);return this._writableState.defaultEncoding=O,this},Object.defineProperty(D.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function z(L,O,W){return!L.objectMode&&L.decodeStrings!==!1&&typeof O=="string"&&(O=i.from(O,W)),O}Object.defineProperty(D.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ae(L,O,W,j,Q,T){if(!W){var S=z(O,j,Q);j!==S&&(W=!0,Q="buffer",j=S)}var V=O.objectMode?1:j.length;O.length+=V;var Y=O.length<O.highWaterMark;if(Y||(O.needDrain=!0),O.writing||O.corked){var de=O.lastBufferedRequest;O.lastBufferedRequest={chunk:j,encoding:Q,isBuf:W,callback:T,next:null},de?de.next=O.lastBufferedRequest:O.bufferedRequest=O.lastBufferedRequest,O.bufferedRequestCount+=1}else se(L,O,!1,V,j,Q,T);return Y}function se(L,O,W,j,Q,T,S){O.writelen=j,O.writecb=S,O.writing=!0,O.sync=!0,O.destroyed?O.onwrite(new b("write")):W?L._writev(Q,O.onwrite):L._write(Q,T,O.onwrite),O.sync=!1}function ve(L,O,W,j,Q){--O.pendingcb,W?(process.nextTick(Q,j),process.nextTick(Rt,L,O),L._writableState.errorEmitted=!0,w(L,j)):(Q(j),L._writableState.errorEmitted=!0,w(L,j),Rt(L,O))}function Pe(L){L.writing=!1,L.writecb=null,L.length-=L.writelen,L.writelen=0}function st(L,O){var W=L._writableState,j=W.sync,Q=W.writecb;if(typeof Q!="function")throw new p;if(Pe(W),O)ve(L,W,j,O,Q);else{var T=ut(W)||L.destroyed;!T&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&tt(L,W),j?process.nextTick(Ne,L,W,T,Q):Ne(L,W,T,Q)}}function Ne(L,O,W,j){W||lt(L,O),O.pendingcb--,j(),Rt(L,O)}function lt(L,O){O.length===0&&O.needDrain&&(O.needDrain=!1,L.emit("drain"))}function tt(L,O){O.bufferProcessing=!0;var W=O.bufferedRequest;if(L._writev&&W&&W.next){var j=O.bufferedRequestCount,Q=new Array(j),T=O.corkedRequestsFree;T.entry=W;for(var S=0,V=!0;W;)Q[S]=W,W.isBuf||(V=!1),W=W.next,S+=1;Q.allBuffers=V,se(L,O,!0,O.length,Q,"",T.finish),O.pendingcb++,O.lastBufferedRequest=null,T.next?(O.corkedRequestsFree=T.next,T.next=null):O.corkedRequestsFree=new e(O),O.bufferedRequestCount=0}else{for(;W;){var Y=W.chunk,de=W.encoding,ie=W.callback,pe=O.objectMode?1:Y.length;if(se(L,O,!1,pe,Y,de,ie),W=W.next,O.bufferedRequestCount--,O.writing)break}W===null&&(O.lastBufferedRequest=null)}O.bufferedRequest=W,O.bufferProcessing=!1}D.prototype._write=function(L,O,W){W(new d("_write()"))},D.prototype._writev=null,D.prototype.end=function(L,O,W){var j=this._writableState;return typeof L=="function"?(W=L,L=null,O=null):typeof O=="function"&&(W=O,O=null),L!=null&&this.write(L,O),j.corked&&(j.corked=1,this.uncork()),j.ending||ln(this,j,W),this},Object.defineProperty(D.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ut(L){return L.ending&&L.length===0&&L.bufferedRequest===null&&!L.finished&&!L.writing}function Te(L,O){L._final(function(W){O.pendingcb--,W&&w(L,W),O.prefinished=!0,L.emit("prefinish"),Rt(L,O)})}function Ie(L,O){!O.prefinished&&!O.finalCalled&&(typeof L._final=="function"&&!O.destroyed?(O.pendingcb++,O.finalCalled=!0,process.nextTick(Te,L,O)):(O.prefinished=!0,L.emit("prefinish")))}function Rt(L,O){var W=ut(O);if(W&&(Ie(L,O),O.pendingcb===0&&(O.finished=!0,L.emit("finish"),O.autoDestroy))){var j=L._readableState;(!j||j.autoDestroy&&j.endEmitted)&&L.destroy()}return W}function ln(L,O,W){O.ending=!0,Rt(L,O),W&&(O.finished?process.nextTick(W):L.once("finish",W)),O.ended=!0,L.writable=!1}function Ve(L,O,W){var j=L.entry;for(L.entry=null;j;){var Q=j.callback;O.pendingcb--,Q(W),j=j.next}O.corkedRequestsFree.next=L}return Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(O){this._writableState&&(this._writableState.destroyed=O)}}),D.prototype.destroy=c.destroy,D.prototype._undestroy=c.undestroy,D.prototype._destroy=function(L,O){O(L)},A2}var E2,Qk;function cc(){if(Qk)return E2;Qk=1;var e=Object.keys||function(l){var u=[];for(var f in l)u.push(f);return u};E2=o;var t=nT(),n=Zk();oc(o,t);for(var r=e(n.prototype),i=0;i<r.length;i++){var a=r[i];o.prototype[a]||(o.prototype[a]=n.prototype[a])}function o(l){if(!(this instanceof o))return new o(l);t.call(this,l),n.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",s)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function s(){this._writableState.ended||process.nextTick(c,this)}function c(l){l.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),E2}var S2={},_2={exports:{}};(function(e,t){var n=we,r=n.Buffer;function i(o,s){for(var c in o)s[c]=o[c]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(i(n,t),t.Buffer=a);function a(o,s,c){return r(o,s,c)}i(r,a),a.from=function(o,s,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,s,c)},a.alloc=function(o,s,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=r(o);return s!==void 0?typeof c=="string"?l.fill(s,c):l.fill(s):l.fill(0),l},a.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},a.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(o)}})(_2,_2.exports);var uJ=_2.exports,C2=uJ.Buffer,Xk=C2.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function fJ(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function hJ(e){var t=fJ(e);if(typeof t!="string"&&(C2.isEncoding===Xk||!Xk(e)))throw new Error("Unknown encoding: "+e);return t||e}var dJ=S2.StringDecoder=Ku;function Ku(e){this.encoding=hJ(e);var t;switch(this.encoding){case"utf16le":this.text=vJ,this.end=wJ,t=4;break;case"utf8":this.fillLast=mJ,t=4;break;case"base64":this.text=xJ,this.end=AJ,t=3;break;default:this.write=EJ,this.end=SJ;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=C2.allocUnsafe(t)}Ku.prototype.write=function(e){if(e.length===0)return"";var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},Ku.prototype.end=yJ,Ku.prototype.text=bJ,Ku.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function k2(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function pJ(e,t,n){var r=t.length-1;if(r<n)return 0;var i=k2(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=k2(t[r]),i>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=k2(t[r]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function gJ(e,t,n){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"�"}}function mJ(e){var t=this.lastTotal-this.lastNeed,n=gJ(this,e);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function bJ(e,t){var n=pJ(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function yJ(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function vJ(e,t){if((e.length-t)%2===0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function wJ(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function xJ(e,t){var n=(e.length-t)%3;return n===0?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function AJ(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function EJ(e){return e.toString(this.encoding)}function SJ(e){return e&&e.length?this.write(e):""}var T2,Kk;function I2(){if(Kk)return T2;Kk=1;var e=sc().codes.ERR_STREAM_PREMATURE_CLOSE;function t(a){var o=!1;return function(){if(!o){o=!0;for(var s=arguments.length,c=new Array(s),l=0;l<s;l++)c[l]=arguments[l];a.apply(this,c)}}}function n(){}function r(a){return a.setHeader&&typeof a.abort=="function"}function i(a,o,s){if(typeof o=="function")return i(a,null,o);o||(o={}),s=t(s||n);var c=o.readable||o.readable!==!1&&a.readable,l=o.writable||o.writable!==!1&&a.writable,u=function(){a.writable||h()},f=a._writableState&&a._writableState.finished,h=function(){l=!1,f=!0,c||s.call(a)},d=a._readableState&&a._readableState.endEmitted,p=function(){c=!1,d=!0,l||s.call(a)},g=function(A){s.call(a,A)},b=function(){var A;if(c&&!d)return(!a._readableState||!a._readableState.ended)&&(A=new e),s.call(a,A);if(l&&!f)return(!a._writableState||!a._writableState.ended)&&(A=new e),s.call(a,A)},v=function(){a.req.on("finish",h)};return r(a)?(a.on("complete",h),a.on("abort",b),a.req?v():a.on("request",v)):l&&!a._writableState&&(a.on("end",u),a.on("close",u)),a.on("end",p),a.on("finish",h),o.error!==!1&&a.on("error",g),a.on("close",b),function(){a.removeListener("complete",h),a.removeListener("abort",b),a.removeListener("request",v),a.req&&a.req.removeListener("finish",h),a.removeListener("end",u),a.removeListener("close",u),a.removeListener("finish",h),a.removeListener("end",p),a.removeListener("error",g),a.removeListener("close",b)}}return T2=i,T2}var R2,Jk;function _J(){if(Jk)return R2;Jk=1;var e;function t(A,w,_){return w=n(w),w in A?Object.defineProperty(A,w,{value:_,enumerable:!0,configurable:!0,writable:!0}):A[w]=_,A}function n(A){var w=r(A,"string");return typeof w=="symbol"?w:String(w)}function r(A,w){if(typeof A!="object"||A===null)return A;var _=A[Symbol.toPrimitive];if(_!==void 0){var C=_.call(A,w||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(A)}var i=I2(),a=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),f=Symbol("stream");function h(A,w){return{value:A,done:w}}function d(A){var w=A[a];if(w!==null){var _=A[f].read();_!==null&&(A[l]=null,A[a]=null,A[o]=null,w(h(_,!1)))}}function p(A){process.nextTick(d,A)}function g(A,w){return function(_,C){A.then(function(){if(w[c]){_(h(void 0,!0));return}w[u](_,C)},C)}}var b=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var w=this,_=this[s];if(_!==null)return Promise.reject(_);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(B,G){process.nextTick(function(){w[s]?G(w[s]):B(h(void 0,!0))})});var C=this[l],I;if(C)I=new Promise(g(C,this));else{var D=this[f].read();if(D!==null)return Promise.resolve(h(D,!1));I=new Promise(this[u])}return this[l]=I,I}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var w=this;return new Promise(function(_,C){w[f].destroy(null,function(I){if(I){C(I);return}_(h(void 0,!0))})})}),e),b),x=function(w){var _,C=Object.create(v,(_={},t(_,f,{value:w,writable:!0}),t(_,a,{value:null,writable:!0}),t(_,o,{value:null,writable:!0}),t(_,s,{value:null,writable:!0}),t(_,c,{value:w._readableState.endEmitted,writable:!0}),t(_,u,{value:function(D,B){var G=C[f].read();G?(C[l]=null,C[a]=null,C[o]=null,D(h(G,!1))):(C[a]=D,C[o]=B)},writable:!0}),_));return C[l]=null,i(w,function(I){if(I&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"){var D=C[o];D!==null&&(C[l]=null,C[a]=null,C[o]=null,D(I)),C[s]=I;return}var B=C[a];B!==null&&(C[l]=null,C[a]=null,C[o]=null,B(h(void 0,!0))),C[c]=!0}),w.on("readable",p.bind(null,C)),C};return R2=x,R2}var D2,eT;function CJ(){return eT||(eT=1,D2=function(){throw new Error("Readable.from is not available in the browser")}),D2}var B2,tT;function nT(){if(tT)return B2;tT=1,B2=B;var e;B.ReadableState=D,p2.EventEmitter;var t=function(S,V){return S.listeners(V).length},n=zk(),r=we.Buffer,i=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(T){return r.from(T)}function o(T){return r.isBuffer(T)||T instanceof i}var s=Uk,c;s&&s.debuglog?c=s.debuglog("stream"):c=function(){};var l=cJ(),u=Gk(),f=qk(),h=f.getHighWaterMark,d=sc().codes,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_STREAM_PUSH_AFTER_EOF,b=d.ERR_METHOD_NOT_IMPLEMENTED,v=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,A,w;oc(B,n);var _=u.errorOrDestroy,C=["error","close","destroy","pause","resume"];function I(T,S,V){if(typeof T.prependListener=="function")return T.prependListener(S,V);!T._events||!T._events[S]?T.on(S,V):Array.isArray(T._events[S])?T._events[S].unshift(V):T._events[S]=[V,T._events[S]]}function D(T,S,V){e=e||cc(),T=T||{},typeof V!="boolean"&&(V=S instanceof e),this.objectMode=!!T.objectMode,V&&(this.objectMode=this.objectMode||!!T.readableObjectMode),this.highWaterMark=h(this,T,"readableHighWaterMark",V),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=T.emitClose!==!1,this.autoDestroy=!!T.autoDestroy,this.destroyed=!1,this.defaultEncoding=T.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,T.encoding&&(x||(x=S2.StringDecoder),this.decoder=new x(T.encoding),this.encoding=T.encoding)}function B(T){if(e=e||cc(),!(this instanceof B))return new B(T);var S=this instanceof e;this._readableState=new D(T,this,S),this.readable=!0,T&&(typeof T.read=="function"&&(this._read=T.read),typeof T.destroy=="function"&&(this._destroy=T.destroy)),n.call(this)}Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(S){this._readableState&&(this._readableState.destroyed=S)}}),B.prototype.destroy=u.destroy,B.prototype._undestroy=u.undestroy,B.prototype._destroy=function(T,S){S(T)},B.prototype.push=function(T,S){var V=this._readableState,Y;return V.objectMode?Y=!0:typeof T=="string"&&(S=S||V.defaultEncoding,S!==V.encoding&&(T=r.from(T,S),S=""),Y=!0),G(this,T,S,!1,Y)},B.prototype.unshift=function(T){return G(this,T,null,!0,!1)};function G(T,S,V,Y,de){c("readableAddChunk",S);var ie=T._readableState;if(S===null)ie.reading=!1,st(T,ie);else{var pe;if(de||(pe=ae(ie,S)),pe)_(T,pe);else if(ie.objectMode||S&&S.length>0)if(typeof S!="string"&&!ie.objectMode&&Object.getPrototypeOf(S)!==r.prototype&&(S=a(S)),Y)ie.endEmitted?_(T,new v):z(T,ie,S,!0);else if(ie.ended)_(T,new g);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!V?(S=ie.decoder.write(S),ie.objectMode||S.length!==0?z(T,ie,S,!1):tt(T,ie)):z(T,ie,S,!1)}else Y||(ie.reading=!1,tt(T,ie))}return!ie.ended&&(ie.length<ie.highWaterMark||ie.length===0)}function z(T,S,V,Y){S.flowing&&S.length===0&&!S.sync?(S.awaitDrain=0,T.emit("data",V)):(S.length+=S.objectMode?1:V.length,Y?S.buffer.unshift(V):S.buffer.push(V),S.needReadable&&Ne(T)),tt(T,S)}function ae(T,S){var V;return!o(S)&&typeof S!="string"&&S!==void 0&&!T.objectMode&&(V=new p("chunk",["string","Buffer","Uint8Array"],S)),V}B.prototype.isPaused=function(){return this._readableState.flowing===!1},B.prototype.setEncoding=function(T){x||(x=S2.StringDecoder);var S=new x(T);this._readableState.decoder=S,this._readableState.encoding=this._readableState.decoder.encoding;for(var V=this._readableState.buffer.head,Y="";V!==null;)Y+=S.write(V.data),V=V.next;return this._readableState.buffer.clear(),Y!==""&&this._readableState.buffer.push(Y),this._readableState.length=Y.length,this};var se=1073741824;function ve(T){return T>=se?T=se:(T--,T|=T>>>1,T|=T>>>2,T|=T>>>4,T|=T>>>8,T|=T>>>16,T++),T}function Pe(T,S){return T<=0||S.length===0&&S.ended?0:S.objectMode?1:T!==T?S.flowing&&S.length?S.buffer.head.data.length:S.length:(T>S.highWaterMark&&(S.highWaterMark=ve(T)),T<=S.length?T:S.ended?S.length:(S.needReadable=!0,0))}B.prototype.read=function(T){c("read",T),T=parseInt(T,10);var S=this._readableState,V=T;if(T!==0&&(S.emittedReadable=!1),T===0&&S.needReadable&&((S.highWaterMark!==0?S.length>=S.highWaterMark:S.length>0)||S.ended))return c("read: emitReadable",S.length,S.ended),S.length===0&&S.ended?W(this):Ne(this),null;if(T=Pe(T,S),T===0&&S.ended)return S.length===0&&W(this),null;var Y=S.needReadable;c("need readable",Y),(S.length===0||S.length-T<S.highWaterMark)&&(Y=!0,c("length less than watermark",Y)),S.ended||S.reading?(Y=!1,c("reading or ended",Y)):Y&&(c("do read"),S.reading=!0,S.sync=!0,S.length===0&&(S.needReadable=!0),this._read(S.highWaterMark),S.sync=!1,S.reading||(T=Pe(V,S)));var de;return T>0?de=O(T,S):de=null,de===null?(S.needReadable=S.length<=S.highWaterMark,T=0):(S.length-=T,S.awaitDrain=0),S.length===0&&(S.ended||(S.needReadable=!0),V!==T&&S.ended&&W(this)),de!==null&&this.emit("data",de),de};function st(T,S){if(c("onEofChunk"),!S.ended){if(S.decoder){var V=S.decoder.end();V&&V.length&&(S.buffer.push(V),S.length+=S.objectMode?1:V.length)}S.ended=!0,S.sync?Ne(T):(S.needReadable=!1,S.emittedReadable||(S.emittedReadable=!0,lt(T)))}}function Ne(T){var S=T._readableState;c("emitReadable",S.needReadable,S.emittedReadable),S.needReadable=!1,S.emittedReadable||(c("emitReadable",S.flowing),S.emittedReadable=!0,process.nextTick(lt,T))}function lt(T){var S=T._readableState;c("emitReadable_",S.destroyed,S.length,S.ended),!S.destroyed&&(S.length||S.ended)&&(T.emit("readable"),S.emittedReadable=!1),S.needReadable=!S.flowing&&!S.ended&&S.length<=S.highWaterMark,L(T)}function tt(T,S){S.readingMore||(S.readingMore=!0,process.nextTick(ut,T,S))}function ut(T,S){for(;!S.reading&&!S.ended&&(S.length<S.highWaterMark||S.flowing&&S.length===0);){var V=S.length;if(c("maybeReadMore read 0"),T.read(0),V===S.length)break}S.readingMore=!1}B.prototype._read=function(T){_(this,new b("_read()"))},B.prototype.pipe=function(T,S){var V=this,Y=this._readableState;switch(Y.pipesCount){case 0:Y.pipes=T;break;case 1:Y.pipes=[Y.pipes,T];break;default:Y.pipes.push(T);break}Y.pipesCount+=1,c("pipe count=%d opts=%j",Y.pipesCount,S);var de=(!S||S.end!==!1)&&T!==process.stdout&&T!==process.stderr,ie=de?un:Dr;Y.endEmitted?process.nextTick(ie):V.once("end",ie),T.on("unpipe",pe);function pe(E,m){c("onunpipe"),E===V&&m&&m.hasUnpiped===!1&&(m.hasUnpiped=!0,da())}function un(){c("onend"),T.end()}var fa=Te(V);T.on("drain",fa);var ha=!1;function da(){c("cleanup"),T.removeListener("close",pa),T.removeListener("finish",fn),T.removeListener("drain",fa),T.removeListener("error",fi),T.removeListener("unpipe",pe),V.removeListener("end",un),V.removeListener("end",Dr),V.removeListener("data",Gt),ha=!0,Y.awaitDrain&&(!T._writableState||T._writableState.needDrain)&&fa()}V.on("data",Gt);function Gt(E){c("ondata");var m=T.write(E);c("dest.write",m),m===!1&&((Y.pipesCount===1&&Y.pipes===T||Y.pipesCount>1&&Q(Y.pipes,T)!==-1)&&!ha&&(c("false write response, pause",Y.awaitDrain),Y.awaitDrain++),V.pause())}function fi(E){c("onerror",E),Dr(),T.removeListener("error",fi),t(T,"error")===0&&_(T,E)}I(T,"error",fi);function pa(){T.removeListener("finish",fn),Dr()}T.once("close",pa);function fn(){c("onfinish"),T.removeListener("close",pa),Dr()}T.once("finish",fn);function Dr(){c("unpipe"),V.unpipe(T)}return T.emit("pipe",V),Y.flowing||(c("pipe resume"),V.resume()),T};function Te(T){return function(){var V=T._readableState;c("pipeOnDrain",V.awaitDrain),V.awaitDrain&&V.awaitDrain--,V.awaitDrain===0&&t(T,"data")&&(V.flowing=!0,L(T))}}B.prototype.unpipe=function(T){var S=this._readableState,V={hasUnpiped:!1};if(S.pipesCount===0)return this;if(S.pipesCount===1)return T&&T!==S.pipes?this:(T||(T=S.pipes),S.pipes=null,S.pipesCount=0,S.flowing=!1,T&&T.emit("unpipe",this,V),this);if(!T){var Y=S.pipes,de=S.pipesCount;S.pipes=null,S.pipesCount=0,S.flowing=!1;for(var ie=0;ie<de;ie++)Y[ie].emit("unpipe",this,{hasUnpiped:!1});return this}var pe=Q(S.pipes,T);return pe===-1?this:(S.pipes.splice(pe,1),S.pipesCount-=1,S.pipesCount===1&&(S.pipes=S.pipes[0]),T.emit("unpipe",this,V),this)},B.prototype.on=function(T,S){var V=n.prototype.on.call(this,T,S),Y=this._readableState;return T==="data"?(Y.readableListening=this.listenerCount("readable")>0,Y.flowing!==!1&&this.resume()):T==="readable"&&!Y.endEmitted&&!Y.readableListening&&(Y.readableListening=Y.needReadable=!0,Y.flowing=!1,Y.emittedReadable=!1,c("on readable",Y.length,Y.reading),Y.length?Ne(this):Y.reading||process.nextTick(Rt,this)),V},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(T,S){var V=n.prototype.removeListener.call(this,T,S);return T==="readable"&&process.nextTick(Ie,this),V},B.prototype.removeAllListeners=function(T){var S=n.prototype.removeAllListeners.apply(this,arguments);return(T==="readable"||T===void 0)&&process.nextTick(Ie,this),S};function Ie(T){var S=T._readableState;S.readableListening=T.listenerCount("readable")>0,S.resumeScheduled&&!S.paused?S.flowing=!0:T.listenerCount("data")>0&&T.resume()}function Rt(T){c("readable nexttick read 0"),T.read(0)}B.prototype.resume=function(){var T=this._readableState;return T.flowing||(c("resume"),T.flowing=!T.readableListening,ln(this,T)),T.paused=!1,this};function ln(T,S){S.resumeScheduled||(S.resumeScheduled=!0,process.nextTick(Ve,T,S))}function Ve(T,S){c("resume",S.reading),S.reading||T.read(0),S.resumeScheduled=!1,T.emit("resume"),L(T),S.flowing&&!S.reading&&T.read(0)}B.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function L(T){var S=T._readableState;for(c("flow",S.flowing);S.flowing&&T.read()!==null;);}B.prototype.wrap=function(T){var S=this,V=this._readableState,Y=!1;T.on("end",function(){if(c("wrapped end"),V.decoder&&!V.ended){var pe=V.decoder.end();pe&&pe.length&&S.push(pe)}S.push(null)}),T.on("data",function(pe){if(c("wrapped data"),V.decoder&&(pe=V.decoder.write(pe)),!(V.objectMode&&pe==null)&&!(!V.objectMode&&(!pe||!pe.length))){var un=S.push(pe);un||(Y=!0,T.pause())}});for(var de in T)this[de]===void 0&&typeof T[de]=="function"&&(this[de]=function(un){return function(){return T[un].apply(T,arguments)}}(de));for(var ie=0;ie<C.length;ie++)T.on(C[ie],this.emit.bind(this,C[ie]));return this._read=function(pe){c("wrapped _read",pe),Y&&(Y=!1,T.resume())},this},typeof Symbol=="function"&&(B.prototype[Symbol.asyncIterator]=function(){return A===void 0&&(A=_J()),A(this)}),Object.defineProperty(B.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(B.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(B.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(S){this._readableState&&(this._readableState.flowing=S)}}),B._fromList=O,Object.defineProperty(B.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function O(T,S){if(S.length===0)return null;var V;return S.objectMode?V=S.buffer.shift():!T||T>=S.length?(S.decoder?V=S.buffer.join(""):S.buffer.length===1?V=S.buffer.first():V=S.buffer.concat(S.length),S.buffer.clear()):V=S.buffer.consume(T,S.decoder),V}function W(T){var S=T._readableState;c("endReadable",S.endEmitted),S.endEmitted||(S.ended=!0,process.nextTick(j,S,T))}function j(T,S){if(c("endReadableNT",T.endEmitted,T.length),!T.endEmitted&&T.length===0&&(T.endEmitted=!0,S.readable=!1,S.emit("end"),T.autoDestroy)){var V=S._writableState;(!V||V.autoDestroy&&V.finished)&&S.destroy()}}typeof Symbol=="function"&&(B.from=function(T,S){return w===void 0&&(w=CJ()),w(B,T,S)});function Q(T,S){for(var V=0,Y=T.length;V<Y;V++)if(T[V]===S)return V;return-1}return B2}var F2,rT;function iT(){if(rT)return F2;rT=1,F2=s;var e=sc().codes,t=e.ERR_METHOD_NOT_IMPLEMENTED,n=e.ERR_MULTIPLE_CALLBACK,r=e.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=e.ERR_TRANSFORM_WITH_LENGTH_0,a=cc();oc(s,a);function o(u,f){var h=this._transformState;h.transforming=!1;var d=h.writecb;if(d===null)return this.emit("error",new n);h.writechunk=null,h.writecb=null,f!=null&&this.push(f),d(u);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function s(u){if(!(this instanceof s))return new s(u);a.call(this,u),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",c)}function c(){var u=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(f,h){l(u,f,h)}):l(this,null,null)}s.prototype.push=function(u,f){return this._transformState.needTransform=!1,a.prototype.push.call(this,u,f)},s.prototype._transform=function(u,f,h){h(new t("_transform()"))},s.prototype._write=function(u,f,h){var d=this._transformState;if(d.writecb=h,d.writechunk=u,d.writeencoding=f,!d.transforming){var p=this._readableState;(d.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},s.prototype._read=function(u){var f=this._transformState;f.writechunk!==null&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},s.prototype._destroy=function(u,f){a.prototype._destroy.call(this,u,function(h){f(h)})};function l(u,f,h){if(f)return u.emit("error",f);if(h!=null&&u.push(h),u._writableState.length)throw new i;if(u._transformState.transforming)throw new r;return u.push(null)}return F2}var P2,aT;function kJ(){if(aT)return P2;aT=1,P2=t;var e=iT();oc(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,r,i){i(null,n)},P2}var M2,oT;function TJ(){if(oT)return M2;oT=1;var e;function t(h){var d=!1;return function(){d||(d=!0,h.apply(void 0,arguments))}}var n=sc().codes,r=n.ERR_MISSING_ARGS,i=n.ERR_STREAM_DESTROYED;function a(h){if(h)throw h}function o(h){return h.setHeader&&typeof h.abort=="function"}function s(h,d,p,g){g=t(g);var b=!1;h.on("close",function(){b=!0}),e===void 0&&(e=I2()),e(h,{readable:d,writable:p},function(x){if(x)return g(x);b=!0,g()});var v=!1;return function(x){if(!b&&!v){if(v=!0,o(h))return h.abort();if(typeof h.destroy=="function")return h.destroy();g(x||new i("pipe"))}}}function c(h){h()}function l(h,d){return h.pipe(d)}function u(h){return!h.length||typeof h[h.length-1]!="function"?a:h.pop()}function f(){for(var h=arguments.length,d=new Array(h),p=0;p<h;p++)d[p]=arguments[p];var g=u(d);if(Array.isArray(d[0])&&(d=d[0]),d.length<2)throw new r("streams");var b,v=d.map(function(x,A){var w=A<d.length-1,_=A>0;return s(x,w,_,function(C){b||(b=C),C&&v.forEach(c),!w&&(v.forEach(c),g(b))})});return d.reduce(l)}return M2=f,M2}var sT=On,O2=p2.EventEmitter,IJ=oc;IJ(On,O2),On.Readable=nT(),On.Writable=Zk(),On.Duplex=cc(),On.Transform=iT(),On.PassThrough=kJ(),On.finished=I2(),On.pipeline=TJ(),On.Stream=On;function On(){O2.call(this)}On.prototype.pipe=function(e,t){var n=this;function r(u){e.writable&&e.write(u)===!1&&n.pause&&n.pause()}n.on("data",r);function i(){n.readable&&n.resume&&n.resume()}e.on("drain",i),!e._isStdio&&(!t||t.end!==!1)&&(n.on("end",o),n.on("close",s));var a=!1;function o(){a||(a=!0,e.end())}function s(){a||(a=!0,typeof e.destroy=="function"&&e.destroy())}function c(u){if(l(),O2.listenerCount(this,"error")===0)throw u}n.on("error",c),e.on("error",c);function l(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",o),n.removeListener("close",s),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",l),n.removeListener("close",l),e.removeListener("close",l)}return n.on("end",l),n.on("close",l),e.on("close",l),e.emit("pipe",n),e};function Ju(e){return e.replace(/%([0-9A-Fa-f]{2})/g,(t,n)=>String.fromCharCode(parseInt(n,16)))}function cT(e,t){return String(t).replace(e,n=>`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)}function ef(e){return cT(/[\n;\r\t=%&,\x00-\x1f\x7f-\xff]/g,e)}function ii(e){return cT(/[\n\r\t%\x00-\x1f\x7f-\xff]/g,e)}function lT(e){if(!(e&&e.length)||e===".")return{};const t={};return e.replace(/\r?\n$/,"").split(";").forEach(n=>{const r=n.split("=",2);if(!(r[1]&&r[1].length))return;r[0]=r[0].trim();let i=t[r[0].trim()];i||(i=[],t[r[0]]=i),i.push(...r[1].split(",").map(a=>a.trim()).map(Ju))}),t}function uT(e){const t=e.split(" ").map(r=>r==="."||r===""?null:r);return{seq_id:t[0]&&Ju(t[0]),source:t[1]&&Ju(t[1]),type:t[2]&&Ju(t[2]),start:t[3]===null?null:parseInt(t[3],10),end:t[4]===null?null:parseInt(t[4],10),score:t[5]===null?null:parseFloat(t[5]),strand:t[6],phase:t[7],attributes:t[8]===null?null:lT(t[8])}}function fT(e){const t=/^\s*##\s*(\S+)\s*(.*)/.exec(e);if(!t)return null;const[,n]=t;let[,,r]=t;const i={directive:n};if(r.length&&(r=r.replace(/\r?\n$/,""),i.value=r),n==="sequence-region"){const a=r.split(/\s+/,3);return{...i,seq_id:a[0],start:a[1]&&a[1].replace(/\D/g,""),end:a[2]&&a[2].replace(/\D/g,"")}}else if(n==="genome-build"){const[a,o]=r.split(/\s+/,2);return{...i,source:a,buildName:o}}return i}function hT(e){const t=[];return Object.entries(e).forEach(([n,r])=>{if(!r)return;let i;r.hasOwnProperty("toString")?i=ef(r.toString()):Array.isArray(r)?i=r.map(ef).join(","):i=ef(r),t.push(`${ef(n)}=${i}`)}),t.length?t.join(";"):"."}function RJ(e,t){const n=e.attributes===null||e.attributes===void 0?".":hT(e.attributes),i=`${[e.seq_id===null?".":ii(e.seq_id),e.source===null?".":ii(e.source),e.type===null?".":ii(e.type),e.start===null?".":ii(e.start),e.end===null?".":ii(e.end),e.score===null?".":ii(e.score),e.strand===null?".":ii(e.strand),e.phase===null?".":ii(e.phase),n].join(" ")}
|
3368
3368
|
`;return t[i]?"":(t[i]=!0,i)}function H0(e,t){if(Array.isArray(e))return e.map(r=>H0(r,t)).join("");const n=[RJ(e,t)];return DJ(e)&&n.push(...e.child_features.map(r=>H0(r,t)),...e.derived_features.map(r=>H0(r,t))),n.join("")}function dT(e){return H0(e,{})}function pT(e){let t=`##${e.directive}`;return e.value&&(t+=` ${e.value}`),t+=`
|
3369
3369
|
`,t}function gT(e){return`# ${e.comment}
|
3370
3370
|
`}function L2(e){return`>${e.id}${e.description?` ${e.description}`:""}
|