Files
PozzettiAndrea 7947ff3f23 Vendor viewer JS, drop comfy-3d-viewers
Vendor the viewer JavaScript into javascript/ and drop the
comfy-3d-viewers dependency. The viewers were previously copied into web/ at
every startup by prestartup_script.py, which made the served frontend depend on
a second package resolving at runtime.

Bundles are vendored as .mjs so ComfyUI's **/*.js auto-import glob skips them:
they are iframe-only and must never enter the shared main browser realm. Only
the widget entry points stay .js.

Also replace comfy_env.copy_files with a local helper. Its two extra features
(frame-derived source dir, silent no-op on a missing source) were unused here,
and the asset seeding now resolves the input directory through
folder_paths.get_input_directory() so it follows ComfyUI Desktop and
--input-directory instead of writing into the code tree.

comfy-test.toml moves to the current schema: [test.workflows] cuda (there is no
"gpu" key -- the accelerator is named by backend, and the old spelling parsed to
an empty list, so CUDA runners silently ran the full unfiltered set), an
explicit [test.platforms] platforms allowlist (per-platform booleans are no
longer supported), and the javascript level.

DisplayName becomes "DepthAnythingV3": the namespace enforced on
registerExtension names is derived from it, and the space in "Depth Anything
V3" made that prefix invalid.

Delete the 21 loose js/viewer/*.js modules -- they are already inside
viewer-bundle-vtk.mjs, so shipping them loose leaked the whole viewer into the
shared realm.
2026-08-22 19:44:03 +02:00

2 lines
1.4 MiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! For license information please see vtk-gltf.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vtk=t():e.vtk=t()}(globalThis,()=>(()=>{var e={581(e,t,r){"use strict";r.d(t,{default:()=>J_});var n={};r.r(n),r.d(n,{add:()=>Q,adjoint:()=>y,clone:()=>c,copy:()=>d,create:()=>u,determinant:()=>v,equals:()=>ne,exactEquals:()=>re,frob:()=>J,fromQuat:()=>U,fromQuat2:()=>M,fromRotation:()=>D,fromRotationTranslation:()=>N,fromRotationTranslationScale:()=>L,fromRotationTranslationScaleOrigin:()=>k,fromScaling:()=>E,fromTranslation:()=>A,fromValues:()=>p,fromXRotation:()=>P,fromYRotation:()=>I,fromZRotation:()=>O,frustum:()=>V,getRotation:()=>B,getScaling:()=>F,getTranslation:()=>R,identity:()=>h,invert:()=>g,lookAt:()=>$,mul:()=>oe,multiply:()=>b,multiplyScalar:()=>ee,multiplyScalarAndAdd:()=>te,ortho:()=>K,orthoNO:()=>H,orthoZO:()=>X,perspective:()=>z,perspectiveFromFieldOfView:()=>W,perspectiveNO:()=>G,perspectiveZO:()=>j,rotate:()=>S,rotateX:()=>C,rotateY:()=>T,rotateZ:()=>w,scale:()=>_,set:()=>f,str:()=>Y,sub:()=>ie,subtract:()=>Z,targetTo:()=>q,translate:()=>x,transpose:()=>m});var o={};r.r(o),r.d(o,{add:()=>Ie,adjoint:()=>me,clone:()=>le,copy:()=>ue,create:()=>ae,determinant:()=>ge,equals:()=>Fe,exactEquals:()=>Re,frob:()=>Pe,fromMat2d:()=>Te,fromMat4:()=>se,fromQuat:()=>we,fromRotation:()=>Se,fromScaling:()=>Ce,fromTranslation:()=>_e,fromValues:()=>ce,identity:()=>pe,invert:()=>he,mul:()=>Be,multiply:()=>ye,multiplyScalar:()=>Ne,multiplyScalarAndAdd:()=>Me,normalFromMat4:()=>Ae,projection:()=>Ee,rotate:()=>be,scale:()=>xe,set:()=>de,str:()=>De,sub:()=>Le,subtract:()=>Oe,translate:()=>ve,transpose:()=>fe});var i=1e-6,a="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;var s=Math.PI/180;function l(e){return e*s}function u(){var e=new a(16);return a!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function c(e){var t=new a(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function d(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function p(e,t,r,n,o,i,s,l,u,c,d,p,f,h,m,g){var y=new a(16);return y[0]=e,y[1]=t,y[2]=r,y[3]=n,y[4]=o,y[5]=i,y[6]=s,y[7]=l,y[8]=u,y[9]=c,y[10]=d,y[11]=p,y[12]=f,y[13]=h,y[14]=m,y[15]=g,y}function f(e,t,r,n,o,i,a,s,l,u,c,d,p,f,h,m,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=o,e[4]=i,e[5]=a,e[6]=s,e[7]=l,e[8]=u,e[9]=c,e[10]=d,e[11]=p,e[12]=f,e[13]=h,e[14]=m,e[15]=g,e}function h(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function m(e,t){if(e===t){var r=t[1],n=t[2],o=t[3],i=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=i,e[11]=t[14],e[12]=o,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function g(e,t){var r=t[0],n=t[1],o=t[2],i=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],h=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*a,b=r*l-o*a,x=r*u-i*a,_=n*l-o*s,S=n*u-i*s,C=o*u-i*l,T=c*m-d*h,w=c*g-p*h,A=c*y-f*h,E=d*g-p*m,D=d*y-f*m,P=p*y-f*g,I=v*P-b*D+x*E+_*A-S*w+C*T;return I?(I=1/I,e[0]=(s*P-l*D+u*E)*I,e[1]=(o*D-n*P-i*E)*I,e[2]=(m*C-g*S+y*_)*I,e[3]=(p*S-d*C-f*_)*I,e[4]=(l*A-a*P-u*w)*I,e[5]=(r*P-o*A+i*w)*I,e[6]=(g*x-h*C-y*b)*I,e[7]=(c*C-p*x+f*b)*I,e[8]=(a*D-s*A+u*T)*I,e[9]=(n*A-r*D-i*T)*I,e[10]=(h*S-m*x+y*v)*I,e[11]=(d*x-c*S-f*v)*I,e[12]=(s*w-a*E-l*T)*I,e[13]=(r*E-n*w+o*T)*I,e[14]=(m*b-h*_-g*v)*I,e[15]=(c*_-d*b+p*v)*I,e):null}function y(e,t){var r=t[0],n=t[1],o=t[2],i=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],h=t[12],m=t[13],g=t[14],y=t[15];return e[0]=s*(p*y-f*g)-d*(l*y-u*g)+m*(l*f-u*p),e[1]=-(n*(p*y-f*g)-d*(o*y-i*g)+m*(o*f-i*p)),e[2]=n*(l*y-u*g)-s*(o*y-i*g)+m*(o*u-i*l),e[3]=-(n*(l*f-u*p)-s*(o*f-i*p)+d*(o*u-i*l)),e[4]=-(a*(p*y-f*g)-c*(l*y-u*g)+h*(l*f-u*p)),e[5]=r*(p*y-f*g)-c*(o*y-i*g)+h*(o*f-i*p),e[6]=-(r*(l*y-u*g)-a*(o*y-i*g)+h*(o*u-i*l)),e[7]=r*(l*f-u*p)-a*(o*f-i*p)+c*(o*u-i*l),e[8]=a*(d*y-f*m)-c*(s*y-u*m)+h*(s*f-u*d),e[9]=-(r*(d*y-f*m)-c*(n*y-i*m)+h*(n*f-i*d)),e[10]=r*(s*y-u*m)-a*(n*y-i*m)+h*(n*u-i*s),e[11]=-(r*(s*f-u*d)-a*(n*f-i*d)+c*(n*u-i*s)),e[12]=-(a*(d*g-p*m)-c*(s*g-l*m)+h*(s*p-l*d)),e[13]=r*(d*g-p*m)-c*(n*g-o*m)+h*(n*p-o*d),e[14]=-(r*(s*g-l*m)-a*(n*g-o*m)+h*(n*l-o*s)),e[15]=r*(s*p-l*d)-a*(n*p-o*d)+c*(n*l-o*s),e}function v(e){var t=e[0],r=e[1],n=e[2],o=e[3],i=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],d=e[10],p=e[11],f=e[12],h=e[13],m=e[14],g=e[15];return(t*a-r*i)*(d*g-p*m)-(t*s-n*i)*(c*g-p*h)+(t*l-o*i)*(c*m-d*h)+(r*s-n*a)*(u*g-p*f)-(r*l-o*a)*(u*m-d*f)+(n*l-o*s)*(u*h-c*f)}function b(e,t,r){var n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],p=t[9],f=t[10],h=t[11],m=t[12],g=t[13],y=t[14],v=t[15],b=r[0],x=r[1],_=r[2],S=r[3];return e[0]=b*n+x*s+_*d+S*m,e[1]=b*o+x*l+_*p+S*g,e[2]=b*i+x*u+_*f+S*y,e[3]=b*a+x*c+_*h+S*v,b=r[4],x=r[5],_=r[6],S=r[7],e[4]=b*n+x*s+_*d+S*m,e[5]=b*o+x*l+_*p+S*g,e[6]=b*i+x*u+_*f+S*y,e[7]=b*a+x*c+_*h+S*v,b=r[8],x=r[9],_=r[10],S=r[11],e[8]=b*n+x*s+_*d+S*m,e[9]=b*o+x*l+_*p+S*g,e[10]=b*i+x*u+_*f+S*y,e[11]=b*a+x*c+_*h+S*v,b=r[12],x=r[13],_=r[14],S=r[15],e[12]=b*n+x*s+_*d+S*m,e[13]=b*o+x*l+_*p+S*g,e[14]=b*i+x*u+_*f+S*y,e[15]=b*a+x*c+_*h+S*v,e}function x(e,t,r){var n,o,i,a,s,l,u,c,d,p,f,h,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],p=t[9],f=t[10],h=t[11],e[0]=n,e[1]=o,e[2]=i,e[3]=a,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=d,e[9]=p,e[10]=f,e[11]=h,e[12]=n*m+s*g+d*y+t[12],e[13]=o*m+l*g+p*y+t[13],e[14]=i*m+u*g+f*y+t[14],e[15]=a*m+c*g+h*y+t[15]),e}function _(e,t,r){var n=r[0],o=r[1],i=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7]*o,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function S(e,t,r,n){var o,a,s,l,u,c,d,p,f,h,m,g,y,v,b,x,_,S,C,T,w,A,E,D,P=n[0],I=n[1],O=n[2],N=Math.hypot(P,I,O);return N<i?null:(P*=N=1/N,I*=N,O*=N,o=Math.sin(r),s=1-(a=Math.cos(r)),l=t[0],u=t[1],c=t[2],d=t[3],p=t[4],f=t[5],h=t[6],m=t[7],g=t[8],y=t[9],v=t[10],b=t[11],x=P*P*s+a,_=I*P*s+O*o,S=O*P*s-I*o,C=P*I*s-O*o,T=I*I*s+a,w=O*I*s+P*o,A=P*O*s+I*o,E=I*O*s-P*o,D=O*O*s+a,e[0]=l*x+p*_+g*S,e[1]=u*x+f*_+y*S,e[2]=c*x+h*_+v*S,e[3]=d*x+m*_+b*S,e[4]=l*C+p*T+g*w,e[5]=u*C+f*T+y*w,e[6]=c*C+h*T+v*w,e[7]=d*C+m*T+b*w,e[8]=l*A+p*E+g*D,e[9]=u*A+f*E+y*D,e[10]=c*A+h*E+v*D,e[11]=d*A+m*E+b*D,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function C(e,t,r){var n=Math.sin(r),o=Math.cos(r),i=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],d=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=i*o+u*n,e[5]=a*o+c*n,e[6]=s*o+d*n,e[7]=l*o+p*n,e[8]=u*o-i*n,e[9]=c*o-a*n,e[10]=d*o-s*n,e[11]=p*o-l*n,e}function T(e,t,r){var n=Math.sin(r),o=Math.cos(r),i=t[0],a=t[1],s=t[2],l=t[3],u=t[8],c=t[9],d=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*o-u*n,e[1]=a*o-c*n,e[2]=s*o-d*n,e[3]=l*o-p*n,e[8]=i*n+u*o,e[9]=a*n+c*o,e[10]=s*n+d*o,e[11]=l*n+p*o,e}function w(e,t,r){var n=Math.sin(r),o=Math.cos(r),i=t[0],a=t[1],s=t[2],l=t[3],u=t[4],c=t[5],d=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=i*o+u*n,e[1]=a*o+c*n,e[2]=s*o+d*n,e[3]=l*o+p*n,e[4]=u*o-i*n,e[5]=c*o-a*n,e[6]=d*o-s*n,e[7]=p*o-l*n,e}function A(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function E(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function D(e,t,r){var n,o,a,s=r[0],l=r[1],u=r[2],c=Math.hypot(s,l,u);return c<i?null:(s*=c=1/c,l*=c,u*=c,n=Math.sin(t),a=1-(o=Math.cos(t)),e[0]=s*s*a+o,e[1]=l*s*a+u*n,e[2]=u*s*a-l*n,e[3]=0,e[4]=s*l*a-u*n,e[5]=l*l*a+o,e[6]=u*l*a+s*n,e[7]=0,e[8]=s*u*a+l*n,e[9]=l*u*a-s*n,e[10]=u*u*a+o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function P(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function I(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function O(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N(e,t,r){var n=t[0],o=t[1],i=t[2],a=t[3],s=n+n,l=o+o,u=i+i,c=n*s,d=n*l,p=n*u,f=o*l,h=o*u,m=i*u,g=a*s,y=a*l,v=a*u;return e[0]=1-(f+m),e[1]=d+v,e[2]=p-y,e[3]=0,e[4]=d-v,e[5]=1-(c+m),e[6]=h+g,e[7]=0,e[8]=p+y,e[9]=h-g,e[10]=1-(c+f),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function M(e,t){var r=new a(3),n=-t[0],o=-t[1],i=-t[2],s=t[3],l=t[4],u=t[5],c=t[6],d=t[7],p=n*n+o*o+i*i+s*s;return p>0?(r[0]=2*(l*s+d*n+u*i-c*o)/p,r[1]=2*(u*s+d*o+c*n-l*i)/p,r[2]=2*(c*s+d*i+l*o-u*n)/p):(r[0]=2*(l*s+d*n+u*i-c*o),r[1]=2*(u*s+d*o+c*n-l*i),r[2]=2*(c*s+d*i+l*o-u*n)),N(e,t,r),e}function R(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function F(e,t){var r=t[0],n=t[1],o=t[2],i=t[4],a=t[5],s=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.hypot(r,n,o),e[1]=Math.hypot(i,a,s),e[2]=Math.hypot(l,u,c),e}function B(e,t){var r=new a(3);F(r,t);var n=1/r[0],o=1/r[1],i=1/r[2],s=t[0]*n,l=t[1]*o,u=t[2]*i,c=t[4]*n,d=t[5]*o,p=t[6]*i,f=t[8]*n,h=t[9]*o,m=t[10]*i,g=s+d+m,y=0;return g>0?(y=2*Math.sqrt(g+1),e[3]=.25*y,e[0]=(p-h)/y,e[1]=(f-u)/y,e[2]=(l-c)/y):s>d&&s>m?(y=2*Math.sqrt(1+s-d-m),e[3]=(p-h)/y,e[0]=.25*y,e[1]=(l+c)/y,e[2]=(f+u)/y):d>m?(y=2*Math.sqrt(1+d-s-m),e[3]=(f-u)/y,e[0]=(l+c)/y,e[1]=.25*y,e[2]=(p+h)/y):(y=2*Math.sqrt(1+m-s-d),e[3]=(l-c)/y,e[0]=(f+u)/y,e[1]=(p+h)/y,e[2]=.25*y),e}function L(e,t,r,n){var o=t[0],i=t[1],a=t[2],s=t[3],l=o+o,u=i+i,c=a+a,d=o*l,p=o*u,f=o*c,h=i*u,m=i*c,g=a*c,y=s*l,v=s*u,b=s*c,x=n[0],_=n[1],S=n[2];return e[0]=(1-(h+g))*x,e[1]=(p+b)*x,e[2]=(f-v)*x,e[3]=0,e[4]=(p-b)*_,e[5]=(1-(d+g))*_,e[6]=(m+y)*_,e[7]=0,e[8]=(f+v)*S,e[9]=(m-y)*S,e[10]=(1-(d+h))*S,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function k(e,t,r,n,o){var i=t[0],a=t[1],s=t[2],l=t[3],u=i+i,c=a+a,d=s+s,p=i*u,f=i*c,h=i*d,m=a*c,g=a*d,y=s*d,v=l*u,b=l*c,x=l*d,_=n[0],S=n[1],C=n[2],T=o[0],w=o[1],A=o[2],E=(1-(m+y))*_,D=(f+x)*_,P=(h-b)*_,I=(f-x)*S,O=(1-(p+y))*S,N=(g+v)*S,M=(h+b)*C,R=(g-v)*C,F=(1-(p+m))*C;return e[0]=E,e[1]=D,e[2]=P,e[3]=0,e[4]=I,e[5]=O,e[6]=N,e[7]=0,e[8]=M,e[9]=R,e[10]=F,e[11]=0,e[12]=r[0]+T-(E*T+I*w+M*A),e[13]=r[1]+w-(D*T+O*w+R*A),e[14]=r[2]+A-(P*T+N*w+F*A),e[15]=1,e}function U(e,t){var r=t[0],n=t[1],o=t[2],i=t[3],a=r+r,s=n+n,l=o+o,u=r*a,c=n*a,d=n*s,p=o*a,f=o*s,h=o*l,m=i*a,g=i*s,y=i*l;return e[0]=1-d-h,e[1]=c+y,e[2]=p-g,e[3]=0,e[4]=c-y,e[5]=1-u-h,e[6]=f+m,e[7]=0,e[8]=p+g,e[9]=f-m,e[10]=1-u-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function V(e,t,r,n,o,i,a){var s=1/(r-t),l=1/(o-n),u=1/(i-a);return e[0]=2*i*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*i*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(o+n)*l,e[10]=(a+i)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*i*2*u,e[15]=0,e}function G(e,t,r,n,o){var i,a=1/Math.tan(t/2);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=o&&o!==1/0?(i=1/(n-o),e[10]=(o+n)*i,e[14]=2*o*n*i):(e[10]=-1,e[14]=-2*n),e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var z=G;function j(e,t,r,n,o){var i,a=1/Math.tan(t/2);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=o&&o!==1/0?(i=1/(n-o),e[10]=o*i,e[14]=o*n*i):(e[10]=-1,e[14]=-n),e}function W(e,t,r,n){var o=Math.tan(t.upDegrees*Math.PI/180),i=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(a+s),u=2/(o+i);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(a-s)*l*.5,e[9]=(o-i)*u*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function H(e,t,r,n,o,i,a){var s=1/(t-r),l=1/(n-o),u=1/(i-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(o+n)*l,e[14]=(a+i)*u,e[15]=1,e}var K=H;function X(e,t,r,n,o,i,a){var s=1/(t-r),l=1/(n-o),u=1/(i-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=u,e[11]=0,e[12]=(t+r)*s,e[13]=(o+n)*l,e[14]=i*u,e[15]=1,e}function $(e,t,r,n){var o,a,s,l,u,c,d,p,f,m,g=t[0],y=t[1],v=t[2],b=n[0],x=n[1],_=n[2],S=r[0],C=r[1],T=r[2];return Math.abs(g-S)<i&&Math.abs(y-C)<i&&Math.abs(v-T)<i?h(e):(d=g-S,p=y-C,f=v-T,o=x*(f*=m=1/Math.hypot(d,p,f))-_*(p*=m),a=_*(d*=m)-b*f,s=b*p-x*d,(m=Math.hypot(o,a,s))?(o*=m=1/m,a*=m,s*=m):(o=0,a=0,s=0),l=p*s-f*a,u=f*o-d*s,c=d*a-p*o,(m=Math.hypot(l,u,c))?(l*=m=1/m,u*=m,c*=m):(l=0,u=0,c=0),e[0]=o,e[1]=l,e[2]=d,e[3]=0,e[4]=a,e[5]=u,e[6]=p,e[7]=0,e[8]=s,e[9]=c,e[10]=f,e[11]=0,e[12]=-(o*g+a*y+s*v),e[13]=-(l*g+u*y+c*v),e[14]=-(d*g+p*y+f*v),e[15]=1,e)}function q(e,t,r,n){var o=t[0],i=t[1],a=t[2],s=n[0],l=n[1],u=n[2],c=o-r[0],d=i-r[1],p=a-r[2],f=c*c+d*d+p*p;f>0&&(c*=f=1/Math.sqrt(f),d*=f,p*=f);var h=l*p-u*d,m=u*c-s*p,g=s*d-l*c;return(f=h*h+m*m+g*g)>0&&(h*=f=1/Math.sqrt(f),m*=f,g*=f),e[0]=h,e[1]=m,e[2]=g,e[3]=0,e[4]=d*g-p*m,e[5]=p*h-c*g,e[6]=c*m-d*h,e[7]=0,e[8]=c,e[9]=d,e[10]=p,e[11]=0,e[12]=o,e[13]=i,e[14]=a,e[15]=1,e}function Y(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function J(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Q(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function Z(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function ee(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function te(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function re(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function ne(e,t){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],p=e[9],f=e[10],h=e[11],m=e[12],g=e[13],y=e[14],v=e[15],b=t[0],x=t[1],_=t[2],S=t[3],C=t[4],T=t[5],w=t[6],A=t[7],E=t[8],D=t[9],P=t[10],I=t[11],O=t[12],N=t[13],M=t[14],R=t[15];return Math.abs(r-b)<=i*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-x)<=i*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(o-_)<=i*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=i*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(s-C)<=i*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(l-T)<=i*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(u-w)<=i*Math.max(1,Math.abs(u),Math.abs(w))&&Math.abs(c-A)<=i*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(d-E)<=i*Math.max(1,Math.abs(d),Math.abs(E))&&Math.abs(p-D)<=i*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(f-P)<=i*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(h-I)<=i*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(m-O)<=i*Math.max(1,Math.abs(m),Math.abs(O))&&Math.abs(g-N)<=i*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-M)<=i*Math.max(1,Math.abs(y),Math.abs(M))&&Math.abs(v-R)<=i*Math.max(1,Math.abs(v),Math.abs(R))}var oe=b,ie=Z;function ae(){var e=new a(9);return a!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function se(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function le(e){var t=new a(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function ue(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function ce(e,t,r,n,o,i,s,l,u){var c=new a(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=n,c[4]=o,c[5]=i,c[6]=s,c[7]=l,c[8]=u,c}function de(e,t,r,n,o,i,a,s,l,u){return e[0]=t,e[1]=r,e[2]=n,e[3]=o,e[4]=i,e[5]=a,e[6]=s,e[7]=l,e[8]=u,e}function pe(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function fe(e,t){if(e===t){var r=t[1],n=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function he(e,t){var r=t[0],n=t[1],o=t[2],i=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],d=c*a-s*u,p=-c*i+s*l,f=u*i-a*l,h=r*d+n*p+o*f;return h?(h=1/h,e[0]=d*h,e[1]=(-c*n+o*u)*h,e[2]=(s*n-o*a)*h,e[3]=p*h,e[4]=(c*r-o*l)*h,e[5]=(-s*r+o*i)*h,e[6]=f*h,e[7]=(-u*r+n*l)*h,e[8]=(a*r-n*i)*h,e):null}function me(e,t){var r=t[0],n=t[1],o=t[2],i=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8];return e[0]=a*c-s*u,e[1]=o*u-n*c,e[2]=n*s-o*a,e[3]=s*l-i*c,e[4]=r*c-o*l,e[5]=o*i-r*s,e[6]=i*u-a*l,e[7]=n*l-r*u,e[8]=r*a-n*i,e}function ge(e){var t=e[0],r=e[1],n=e[2],o=e[3],i=e[4],a=e[5],s=e[6],l=e[7],u=e[8];return t*(u*i-a*l)+r*(-u*o+a*s)+n*(l*o-i*s)}function ye(e,t,r){var n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],p=r[0],f=r[1],h=r[2],m=r[3],g=r[4],y=r[5],v=r[6],b=r[7],x=r[8];return e[0]=p*n+f*a+h*u,e[1]=p*o+f*s+h*c,e[2]=p*i+f*l+h*d,e[3]=m*n+g*a+y*u,e[4]=m*o+g*s+y*c,e[5]=m*i+g*l+y*d,e[6]=v*n+b*a+x*u,e[7]=v*o+b*s+x*c,e[8]=v*i+b*l+x*d,e}function ve(e,t,r){var n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],p=r[0],f=r[1];return e[0]=n,e[1]=o,e[2]=i,e[3]=a,e[4]=s,e[5]=l,e[6]=p*n+f*a+u,e[7]=p*o+f*s+c,e[8]=p*i+f*l+d,e}function be(e,t,r){var n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],p=Math.sin(r),f=Math.cos(r);return e[0]=f*n+p*a,e[1]=f*o+p*s,e[2]=f*i+p*l,e[3]=f*a-p*n,e[4]=f*s-p*o,e[5]=f*l-p*i,e[6]=u,e[7]=c,e[8]=d,e}function xe(e,t,r){var n=r[0],o=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function _e(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Se(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Ce(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Te(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function we(e,t){var r=t[0],n=t[1],o=t[2],i=t[3],a=r+r,s=n+n,l=o+o,u=r*a,c=n*a,d=n*s,p=o*a,f=o*s,h=o*l,m=i*a,g=i*s,y=i*l;return e[0]=1-d-h,e[3]=c-y,e[6]=p+g,e[1]=c+y,e[4]=1-u-h,e[7]=f-m,e[2]=p-g,e[5]=f+m,e[8]=1-u-d,e}function Ae(e,t){var r=t[0],n=t[1],o=t[2],i=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],d=t[9],p=t[10],f=t[11],h=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*a,b=r*l-o*a,x=r*u-i*a,_=n*l-o*s,S=n*u-i*s,C=o*u-i*l,T=c*m-d*h,w=c*g-p*h,A=c*y-f*h,E=d*g-p*m,D=d*y-f*m,P=p*y-f*g,I=v*P-b*D+x*E+_*A-S*w+C*T;return I?(I=1/I,e[0]=(s*P-l*D+u*E)*I,e[1]=(l*A-a*P-u*w)*I,e[2]=(a*D-s*A+u*T)*I,e[3]=(o*D-n*P-i*E)*I,e[4]=(r*P-o*A+i*w)*I,e[5]=(n*A-r*D-i*T)*I,e[6]=(m*C-g*S+y*_)*I,e[7]=(g*x-h*C-y*b)*I,e[8]=(h*S-m*x+y*v)*I,e):null}function Ee(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function De(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function Pe(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}function Ie(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e}function Oe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function Ne(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e}function Me(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e}function Re(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function Fe(e,t){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],p=t[0],f=t[1],h=t[2],m=t[3],g=t[4],y=t[5],v=t[6],b=t[7],x=t[8];return Math.abs(r-p)<=i*Math.max(1,Math.abs(r),Math.abs(p))&&Math.abs(n-f)<=i*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(o-h)<=i*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-m)<=i*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(s-g)<=i*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(l-y)<=i*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(u-v)<=i*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(c-b)<=i*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(d-x)<=i*Math.max(1,Math.abs(d),Math.abs(x))}var Be=ye,Le=Oe,ke=r(17);const Ue=r(170)(),Ve={vtkObject:()=>null};function Ge(e){if(null==e)return e;if(e.isA)return e;if(!e.vtkClass)return Ue.console&&Ue.console.error&&Ue.console.error("Invalid VTK object"),null;const t=Ve[e.vtkClass];if(!t)return Ue.console&&Ue.console.error&&Ue.console.error(`No vtk class found for Object of type ${e.vtkClass}`),null;const r={...e};Object.keys(r).forEach(e=>{r[e]&&"object"==typeof r[e]&&r[e].vtkClass&&(r[e]=Ge(r[e]))});const n=t(r);return n&&n.modified&&n.modified(),n}Ge.register=function(e,t){Ve[e]=t};class ze extends Array{push(){for(let e=0;e<arguments.length;e++)this.includes(arguments[e])||super.push(arguments[e]);return this.length}}let je=0;const We=e=>{throw new Error(`Named parameter '${e}' is missing`)},He=Symbol("void"),Ke={};function Xe(){}["log","debug","info","warn","error","time","timeEnd","group","groupEnd"].forEach(e=>{Ke[e]=Xe}),Ue.console=console.hasOwnProperty("log")?console:Ke;const $e={debug:Xe,error:Ue.console.error||Xe,info:Ue.console.info||Xe,log:Ue.console.log||Xe,warn:Ue.console.warn||Xe};function qe(e,t){$e[e]&&($e[e]=t||Xe)}function Ye(){$e.log(...arguments)}function Je(){$e.info(...arguments)}function Qe(){$e.debug(...arguments)}function Ze(){$e.error(...arguments)}function et(){$e.warn(...arguments)}const tt={};function rt(e){tt[e]||($e.error(e),tt[e]=!0)}const nt=Object.create(null);nt.Float32Array=Float32Array,nt.Float64Array=Float64Array,nt.Uint8Array=Uint8Array,nt.Int8Array=Int8Array,nt.Uint16Array=Uint16Array,nt.Int16Array=Int16Array,nt.Uint32Array=Uint32Array,nt.Int32Array=Int32Array,nt.Uint8ClampedArray=Uint8ClampedArray;try{nt.BigInt64Array=BigInt64Array,nt.BigUint64Array=BigUint64Array}catch{}function ot(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new(nt[e]||Float64Array)(...r)}function it(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return(nt[e]||Float64Array).from(...r)}function at(e){return e.charAt(0).toUpperCase()+e.slice(1)}function st(e){return at("_"===e[0]?e.slice(1):e)}function lt(e){return e.charAt(0).toLowerCase()+e.slice(1)}function ut(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;const n=["TB","GB","MB","KB"];let o=Number(e),i="B";for(;o>r;)o/=r,i=n.pop();return`${o.toFixed(t)} ${i}`}function ct(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";const r=[];let n=e;for(;n>1e3;)r.push(("000"+n%1e3).slice(-3)),n=Math.floor(n/1e3);return n>0&&r.push(n),r.reverse(),r.join(t)}function dt(e){Object.keys(e).forEach(t=>{Array.isArray(e[t])&&(e[t]=[].concat(e[t]))})}function pt(e){return e&&e.isA?e.getState():e}function ft(e){setTimeout(e,0)}function ht(e,t){const r=performance.now();e.finally(()=>{const e=performance.now()-r;t(e)})}function mt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};dt(t);const r=[];if(Number.isInteger(t.mtime)||(t.mtime=++je),"classHierarchy"in t){if(!(t.classHierarchy instanceof ze)){const e=new ze;for(let r=0;r<t.classHierarchy.length;r++)e.push(t.classHierarchy[r]);t.classHierarchy=e}}else t.classHierarchy=new ze("vtkObject");function n(e){r[e]=null}return e.isDeleted=()=>!!t.deleted,e.modified=n=>{t.deleted?Ze("instance deleted - cannot call any method"):n&&n<e.getMTime()||(t.mtime=++je,r.forEach(t=>t&&t(e)))},e.onModified=e=>{if(t.deleted)return Ze("instance deleted - cannot call any method"),null;const o=r.length;return r.push(e),function(e){return Object.freeze({unsubscribe:function(){n(e)}})}(o)},e.getMTime=()=>t.mtime,e.isA=e=>{let r=t.classHierarchy.length;for(;r--;)if(t.classHierarchy[r]===e)return!0;return!1},e.getClassName=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.classHierarchy[t.classHierarchy.length-1-e]},e.set=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!1;return Object.keys(r).forEach(a=>{const s=o?null:e[`set${at(a)}`];s&&Array.isArray(r[a])&&s.length>1?i=s(...r[a])||i:s?i=s(r[a])||i:(-1!==["mtime"].indexOf(a)||n||et(`Warning: Set value to model directly ${a}, ${r[a]}`),i=t[a]!==r[a]||i,t[a]=r[a])}),i},e.get=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return t;const o={};return r.forEach(e=>{o[e]=t[e]}),o},e.getReferenceByName=e=>t[e],e.delete=()=>{Object.keys(t).forEach(e=>delete t[e]),r.forEach((e,t)=>n(t)),t.deleted=!0},e.getState=()=>{if(t.deleted)return null;const r={...t,vtkClass:e.getClassName()};Object.keys(r).forEach(e=>{null===r[e]||void 0===r[e]||"_"===e[0]?delete r[e]:r[e].isA?r[e]=r[e].getState():Array.isArray(r[e])?r[e]=r[e].map(pt):function(e){return Object.values(nt).some(t=>e instanceof t)}(r[e])&&(r[e]=Array.from(r[e]))});const n={};return Object.keys(r).sort().forEach(e=>{n[e]=r[e]}),n.mtime&&delete n.mtime,n},e.shallowCopy=function(r){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r.getClassName()!==e.getClassName())throw new Error(`Cannot ShallowCopy ${r.getClassName()} into ${e.getClassName()}`);const o=r.get(),i=Object.keys(t).sort();Object.keys(o).sort().forEach(e=>{const r=i.indexOf(e);-1===r?n&&Qe(`add ${e} in shallowCopy`):i.splice(r,1),t[e]=o[e]}),i.length&&n&&Qe(`Untouched keys: ${i.join(", ")}`),e.modified()},e.toJSON=function(){return e.getState()},e}const gt={object:(e,t,r)=>function(){return{...t[r.name]}}};function yt(e,t,r){r.forEach(r=>{if("object"==typeof r){const n=gt[r.type];e[`get${st(r.name)}`]=n?n(e,t,r):()=>t[r.name]}else e[`get${st(r)}`]=()=>t[r]})}const vt={enum(e,t,r){const n=`_on${st(r.name)}Changed`;return o=>{if("string"==typeof o){if(void 0!==r.enum[o])return t[r.name]!==r.enum[o]&&(t[r.name]=r.enum[o],e.modified(),!0);throw Ze(`Set Enum with invalid argument ${r}, ${o}`),new RangeError("Set Enum with invalid string argument")}if("number"==typeof o){if(t[r.name]!==o){if(-1!==Object.keys(r.enum).map(e=>r.enum[e]).indexOf(o)){const i=t[r.name];return t[r.name]=o,t[n]?.(e,t,o,i),e.modified(),!0}throw Ze(`Set Enum outside numeric range ${r}, ${o}`),new RangeError("Set Enum outside numeric range")}return!1}throw Ze(`Set Enum with invalid argument (String/Number) ${r}, ${o}`),new TypeError("Set Enum with invalid argument (String/Number)")}},object(e,t,r){1===r.params?.length&&et('Setter of type "object" with a single "param" field is not supported');const n=`_on${st(r.name)}Changed`;return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];let s;if(s=i.length>1&&r.params?.length?r.params.reduce((e,t,r)=>Object.assign(e,{[t]:i[r]}),{}):i[0],!ke(t[r.name],s)){const o=t[r.name];return t[r.name]=s,t[n]?.(e,t,s,o),e.modified(),!0}return!1}}};function bt(e){if("object"==typeof e){const t=vt[e.type];if(t)return(r,n)=>t(r,n,e);throw Ze(`No setter for field ${e}`),new TypeError("No setter for field")}return function(t,r){const n=`_on${st(e)}Changed`;return function(o){if(r.deleted)return Ze("instance deleted - cannot call any method"),!1;if(r[e]!==o){const i=r[e.name];return r[e]=o,r[n]?.(t,r,o,i),t.modified(),!0}return!1}}}function xt(e,t,r){r.forEach(r=>{"object"==typeof r?e[`set${st(r.name)}`]=bt(r)(e,t):e[`set${st(r)}`]=bt(r)(e,t)})}function _t(e,t,r){yt(e,t,r),xt(e,t,r)}function St(e,t,r){r.forEach(r=>{e[`get${st(r)}`]=()=>t[r]?Array.from(t[r]):t[r],e[`get${st(r)}ByReference`]=()=>t[r]})}function Ct(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;r.forEach(r=>{if(t[r]&&n&&t[r].length!==n)throw new RangeError(`Invalid initial number of values for array (${r})`);const i=`_on${st(r)}Changed`;e[`set${st(r)}`]=function(){if(t.deleted)return Ze("instance deleted - cannot call any method"),!1;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];let u,c=s,d=!1;if(1===c.length&&(null==c[0]||c[0].length>=0)&&(c=c[0],d=!0),null==c)u=t[r]!==c;else{if(n&&c.length!==n){if(!(c.length<n&&void 0!==o))throw new RangeError(`Invalid number of values for array setter (${r})`);for(c=Array.from(c),d=!1;c.length<n;)c.push(o)}u=null==t[r]||t[r].length!==c.length;for(let e=0;!u&&e<c.length;++e)u=t[r][e]!==c[e];u&&d&&(c=Array.from(c))}if(u){const n=t[r.name];t[r]=c,t[i]?.(e,t,c,n),e.modified()}return u},e[`set${st(r)}From`]=e=>{const n=t[r];e.forEach((e,t)=>{n[t]=e})}})}function Tt(e,t,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;St(e,t,r),Ct(e,t,r,n,o)}function wt(e,t,r){for(let e=0;e<r.length;e++){const n=r[e];void 0!==t[n]&&(t[`_${n}`]=t[n],delete t[n])}}function At(e,t,r,n){function o(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t.deleted?Ze("instance deleted - cannot call any method"):n>=t.numberOfInputs?Ze(`algorithm ${e.getClassName()} only has ${t.numberOfInputs} input ports. To add more input ports, use addInputData()`):(t.inputData[n]!==r||t.inputConnection[n])&&(t.inputData[n]=r,t.inputConnection[n]=null,e.modified&&e.modified())}function i(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t.deleted)Ze("instance deleted - cannot call any method");else{if(n>=t.numberOfInputs){let r=`algorithm ${e.getClassName()} only has `;return r+=`${t.numberOfInputs}`,r+=" input ports. To add more input ports, use addInputConnection()",void Ze(r)}t.inputData[n]=null,t.inputConnection[n]=r}}function a(){let e=t.numberOfInputs;for(;e&&!t.inputData[e-1]&&!t.inputConnection[e-1];)e--;return e===t.numberOfInputs&&t.numberOfInputs++,e}function s(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.deleted?(Ze("instance deleted - cannot call any method"),null):(e.shouldUpdate()&&e.update(),t.output[r])}if(t.inputData?t.inputData=t.inputData.map(Ge):t.inputData=[],t.inputConnection?t.inputConnection=t.inputConnection.map(Ge):t.inputConnection=[],t.output?t.output=t.output.map(Ge):t.output=[],t.inputArrayToProcess?t.inputArrayToProcess=t.inputArrayToProcess.map(Ge):t.inputArrayToProcess=[],t.numberOfInputs=r,e.shouldUpdate=()=>{const r=e.getMTime();let o=1/0,i=n;for(;i--;){if(!t.output[i]||t.output[i].isDeleted())return!0;const e=t.output[i].getMTime();if(e<r)return!0;e<o&&(o=e)}for(i=t.numberOfInputs;i--;)if(t.inputConnection[i]?.filter.shouldUpdate()||e.getInputData(i)?.getMTime()>o)return!0;return!1},t.numberOfInputs){let r=t.numberOfInputs;for(;r--;)t.inputData.push(null),t.inputConnection.push(null);e.setInputData=o,e.setInputConnection=i,e.addInputData=function(e){t.deleted?Ze("instance deleted - cannot call any method"):o(e,a())},e.addInputConnection=function(e){t.deleted?Ze("instance deleted - cannot call any method"):i(e,a())},e.getInputData=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]&&(t.inputData[e]=t.inputConnection[e]()),t.inputData[e]},e.getInputConnection=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t.inputConnection[e]}}n&&(e.getOutputData=s,e.getOutputPort=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const r=()=>s(t);return r.filter=e,r}),e.update=()=>{const r=[];if(t.numberOfInputs){let n=0;for(;n<t.numberOfInputs;)r[n]=e.getInputData(n),n++}e.requestData&&!e.isDeleted()&&e.shouldUpdate()&&e.requestData(r,t.output)},e.getNumberOfInputPorts=()=>t.numberOfInputs,e.getNumberOfOutputPorts=()=>n||t.output.length,e.getInputArrayToProcess=e=>{const r=t.inputArrayToProcess[e],n=t.inputData[e];return r&&n?n[`get${r.fieldAssociation}`]().getArray(r.arrayName):null},e.setInputArrayToProcess=function(e,r,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Scalars";for(;t.inputArrayToProcess.length<e;)t.inputArrayToProcess.push(null);t.inputArrayToProcess[e]={arrayName:r,fieldAssociation:n,attributeType:o}}}const Et=Symbol("Event abort");function Dt(e,t,r){const n=[],o=e.delete;let i=1;function a(e){for(let t=0;t<n.length;++t){const[r]=n[t];if(r===e)return void n.splice(t,1)}}e[`invoke${st(r)}`]=function(){if(t.deleted)return void Ze("instance deleted - cannot call any method");const r=n.slice();for(let t=0;t<r.length;++t){const[,n,o]=r[t];if(n)if(o<0)setTimeout(()=>n.apply(e,arguments),1-o);else if(n.apply(e,arguments)===Et)break}},e[`on${st(r)}`]=function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!e.apply)return console.error(`Invalid callback for event ${r}`),null;if(t.deleted)return Ze("instance deleted - cannot call any method"),null;const s=i++;return n.push([s,e,o]),n.sort((e,t)=>t[2]-e[2]),function(e){return Object.freeze({unsubscribe:function(){a(e)}})}(s)},e.delete=()=>{o(),n.forEach(e=>{let[t]=e;return a(t)})}}function Pt(e,t){const r=function(){const t={};return e(t,{},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Object.freeze(t)};return t&&Ge.register(t,r),r}function It(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return t.filter(e=>!!e).map(e=>e(...r))}}function Ot(e){return e&&e.isA&&e.isA("vtkObject")}function Nt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(Ot(e)){if(n.indexOf(e)>=0)return r;n.push(e);const o=t(e);void 0!==o&&r.push(o);const i=e.get();Object.keys(i).forEach(e=>{const o=i[e];Array.isArray(o)?o.forEach(e=>{Nt(e,t,r,n)}):Nt(o,t,r,n)})}return r}function Mt(e,t,r){var n=this;let o;const i=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];const l=n,u=r&&!o;clearTimeout(o),o=setTimeout(()=>{o=null,r||e.apply(l,a)},t),u&&e.apply(l,a)};return i.cancel=()=>clearTimeout(o),i}function Rt(e,t){let r=!1,n=null;function o(){r=!1,null!==n&&(i(...n),n=null)}function i(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];r?n=a:(r=!0,e(...a),setTimeout(o,t))}return i}function Ft(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.keystore=Object.assign(t.keystore||{},r),e.setKey=(e,r)=>{t.keystore[e]=r},e.getKey=e=>t.keystore[e],e.getAllKeys=()=>Object.keys(t.keystore),e.deleteKey=e=>delete t.keystore[e],e.clearKeystore=()=>e.getAllKeys().forEach(e=>delete t.keystore[e])}let Bt=1;const Lt="__root__";function kt(e,t){Ft(e,t);const r=e.delete;t.proxyId=""+Bt++,t.ui=JSON.parse(JSON.stringify(t.ui||[])),yt(e,t,["proxyId","proxyGroup","proxyName"]),_t(e,t,["proxyManager"]);const n={},o={};function i(e,t){o[t]||(o[t]=[]);const r=o[t];for(let t=0;t<e.length;t++)r.push(e[t].name),n[e[t].name]=e[t],e[t].children&&e[t].children.length&&i(e[t].children,e[t].name)}function a(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lt;const n=[],i=t.proxyId,s=function(){return o[arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lt]}(r)||[];for(let t=0;t<s.length;t++){const r=s[t],o=e[`get${st(r)}`],l={id:i,name:r,value:o?o():void 0},u=a(r);u.length&&(l.children=u),n.push(l)}return n}i(t.ui,Lt),e.updateUI=r=>{t.ui=JSON.parse(JSON.stringify(r||[])),Object.keys(n).forEach(e=>delete n[e]),Object.keys(o).forEach(e=>delete o[e]),i(t.ui,Lt),e.modified()},e.updateProxyProperty=(e,t)=>{const r=n[e];r?Object.assign(r,t):n[e]={...t}},e.activate=()=>{if(t.proxyManager){const r=`setActive${st(e.getProxyGroup().slice(0,-1))}`;t.proxyManager[r]&&t.proxyManager[r](e)}},t.propertyLinkSubscribers={},e.registerPropertyLinkForGC=(e,r)=>{r in t.propertyLinkSubscribers||(t.propertyLinkSubscribers[r]=[]),t.propertyLinkSubscribers[r].push(e)},e.gcPropertyLinks=r=>{const n=t.propertyLinkSubscribers[r]||[];for(;n.length;)n.pop().unbind(e)},t.propertyLinkMap={},e.getPropertyLink=function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.propertyLinkMap[e])return t.propertyLinkMap[e];let n=null;const o=[];let i=0,a=!1;function s(r){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(a)return null;const l=[];let u=null;for(i=o.length;i--;){const e=o[i];e.instance===r?u=e:l.push(e)}if(!u)return null;const c=u.instance[`get${st(u.propertyName)}`]();if(!function(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}(c,n)||s){for(n=c,a=!0;l.length;){const e=l.pop();e.instance.set({[e.propertyName]:n})}a=!1}return t.propertyLinkMap[e].persistent&&(t.propertyLinkMap[e].value=c),c}function l(e,t){const r=[];for(i=o.length;i--;){const n=o[i];n.instance!==e||n.propertyName!==t&&void 0!==t||(n.subscription.unsubscribe(),r.push(i))}for(;r.length;)o.splice(r.pop(),1)}const u={bind:function(r,n){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=r.onModified(s),u=o[0];return o.push({instance:r,propertyName:n,subscription:a}),i&&(t.propertyLinkMap[e].persistent&&void 0!==t.propertyLinkMap[e].value?r.set({[n]:t.propertyLinkMap[e].value}):u&&s(u.instance,!0)),{unsubscribe:()=>l(r,n)}},unbind:l,unsubscribe:function(){for(;o.length;)o.pop().subscription.unsubscribe()},persistent:r};return t.propertyLinkMap[e]=u,u},e.listPropertyNames=()=>a().map(e=>e.name),e.getPropertyByName=e=>a().find(t=>t.name===e),e.getPropertyDomainByName=e=>(n[e]||{}).domain,e.getProxySection=()=>({id:t.proxyId,name:t.proxyGroup,ui:t.ui,properties:a()}),e.delete=()=>{const n=Object.keys(t.propertyLinkMap);let o=n.length;for(;o--;)t.propertyLinkMap[n[o]].unsubscribe();Object.keys(t.propertyLinkSubscribers).forEach(e.gcPropertyLinks),r()},e.getState=()=>null,ft(function(){if(t.links)for(let r=0;r<t.links.length;r++){const{link:n,property:o,persistent:i,updateOnBind:a,type:s}=t.links[r];if("application"===s){const r=t.proxyManager.getPropertyLink(n,i);e.registerPropertyLinkForGC(r,"application"),r.bind(e,o,a)}}})}function Ut(e,t,r){const n=e.delete,o=[],i=Object.keys(r);let a=i.length;for(;a--;){const n=i[a],{modelKey:s,property:l,modified:u=!0}=r[n],c=st(l),d=st(n);e[`get${d}`]=t[s][`get${c}`],e[`set${d}`]=t[s][`set${c}`],u&&o.push(t[s].onModified(e.modified))}e.delete=()=>{for(;o.length;)o.pop().unsubscribe();n()}}function Vt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};function o(e){const r=Object.keys(e);let n=r.length;for(;n--;){const o=r[n];t[o].set(e[o])}}t.this=e;const i=Object.keys(n);let a=i.length;for(;a--;){const s=i[a];t[s]=n[s];const l=r[s];e[`set${st(s)}`]=r=>{r!==t[s]&&(t[s]=r,o(l[r]),e.modified())}}i.length&&yt(e,t,i)}function Gt(e){let t=0,r=0,n=0,o=0;return"detail"in e&&(r=e.detail),"wheelDelta"in e&&(r=-e.wheelDelta/120),"wheelDeltaY"in e&&(r=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=r,r=0),n=10*t,o=10*r,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(n=e.deltaX),(n||o)&&e.deltaMode&&(1===e.deltaMode?(n*=40,o*=40):(n*=800,o*=800)),n&&!t&&(t=n<1?-1:1),o&&!r&&(r=o<1?-1:1),{spinX:t,spinY:r||t,pixelX:n,pixelY:o||n}}var zt={algo:At,capitalize:at,chain:It,debounce:Mt,enumToString:function(e,t){return Object.keys(e).find(r=>e[r]===t)},event:Dt,EVENT_ABORT:Et,formatBytesToProperUnit:ut,formatNumbersWithThousandSeparator:ct,get:yt,getArray:St,getCurrentGlobalMTime:function(){return je},getStateArrayMapFunc:pt,isVtkObject:Ot,keystore:Ft,measurePromiseExecution:ht,moveToProtected:wt,newInstance:Pt,newTypedArray:ot,newTypedArrayFrom:it,normalizeWheel:Gt,obj:mt,proxy:kt,proxyPropertyMapping:Ut,proxyPropertyState:Vt,safeArrays:dt,set:xt,setArray:Ct,setGet:_t,setGetArray:Tt,setImmediate:ft,setLoggerFunction:qe,throttle:Rt,traverseInstanceTree:Nt,TYPED_ARRAYS:nt,uncapitalize:lt,VOID:He,vtkDebugMacro:Qe,vtkErrorMacro:Ze,vtkInfoMacro:Je,vtkLogMacro:Ye,vtkOnceErrorMacro:rt,vtkWarningMacro:et,objectSetterMap:vt,requiredParam:We},jt=Object.freeze({__proto__:null,requiredParam:We,VOID:He,setLoggerFunction:qe,vtkLogMacro:Ye,vtkInfoMacro:Je,vtkDebugMacro:Qe,vtkErrorMacro:Ze,vtkWarningMacro:et,vtkOnceErrorMacro:rt,TYPED_ARRAYS:nt,newTypedArray:ot,newTypedArrayFrom:it,capitalize:at,_capitalize:st,uncapitalize:lt,formatBytesToProperUnit:ut,formatNumbersWithThousandSeparator:ct,setImmediateVTK:ft,measurePromiseExecution:ht,obj:mt,get:yt,set:xt,setGet:_t,getArray:St,setArray:Ct,setGetArray:Tt,moveToProtected:wt,algo:At,EVENT_ABORT:Et,event:Dt,newInstance:Pt,chain:It,isVtkObject:Ot,traverseInstanceTree:Nt,debounce:Mt,throttle:Rt,keystore:Ft,proxy:kt,proxyPropertyMapping:Ut,proxyPropertyState:Vt,normalizeWheel:Gt,default:zt});const{vtkErrorMacro:Wt}=zt,Ht={renderable:null,myFactory:null,children:[],visited:!1};function Kt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ht,r),zt.obj(e,t),zt.event(e,t,"event"),t._renderableChildMap=new Map,zt.get(e,t,["visited"]),zt.setGet(e,t,["_parent","renderable","myFactory"]),zt.getArray(e,t,["children"]),zt.moveToProtected(e,t,["parent"]),function(e,t){function r(e,r){for(let n=0;n<t.children.length;++n){const o=(r+1+n)%t.children.length;if(t.children[o]===e)return t.children[o]=t.children[r],t.children[r]=e,!0}return!1}t.classHierarchy.push("vtkViewNode"),e.build=e=>{},e.render=e=>{},e.traverse=r=>{const n=r.getTraverseOperation(),o=e[n];if(o)o(r);else{e.apply(r,!0);for(let e=0;e<t.children.length;e++)t.children[e].traverse(r);e.apply(r,!1)}},e.apply=(t,r)=>{const n=e[t.getOperation()];n&&n(r,t)},e.getViewNodeFor=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(n&&n.renderable===r)return n;if(t.renderable===r)return e;for(let e=0;e<t.children.length;++e){const n=t.children[e].getViewNodeFor(r);if(n)return n}},e.getFirstAncestorOfType=e=>t._parent?t._parent.isA(e)?t._parent:t._parent.getFirstAncestorOfType(e):null,e.getLastAncestorOfType=e=>t._parent?t._parent.getLastAncestorOfType(e)||(t._parent.isA(e)?t._parent:null):null,e.addMissingNode=r=>{if(!r)return;const n=t._renderableChildMap.get(r);if(void 0!==n)return n.setVisited(!0),n;const o=e.createViewNode(r);return o?(o.setParent(e),o.setVisited(!0),t._renderableChildMap.set(r,o),t.children.push(o),o):void 0},e.addMissingNodes=function(n){let o,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n&&n.length)for(let a=0;a<n.length;++a){const s=n[a],l=e.addMissingNode(s);i&&void 0!==l&&(void 0===o?o=t.children.lastIndexOf(l):t.children[o]!==l&&r(t.children,l),o++)}},e.addMissingChildren=r=>{if(r&&r.length)for(let n=0;n<r.length;++n){const o=r[n];if(-1===t.children.indexOf(o)){o.setParent(e),t.children.push(o);const r=o.getRenderable();r&&t._renderableChildMap.set(r,o)}o.setVisited(!0)}},e.removeNode=e=>{const r=t.children.findIndex(t=>t===e);if(r<0)return!1;const n=e.getRenderable();return n&&t._renderableChildMap.delete(n),e.delete(),t.children.splice(r,1),!0},e.prepareNodes=()=>{for(let e=0;e<t.children.length;++e)t.children[e].setVisited(!1)},e.setVisited=e=>{t.visited=e},e.removeUnusedNodes=()=>{let e=0;for(let r=0;r<t.children.length;++r){const n=t.children[r];if(n.getVisited())t.children[e++]=n,n.setVisited(!1);else{const e=n.getRenderable();e&&t._renderableChildMap.delete(e),n.delete()}}t.children.length=e},e.createViewNode=e=>{if(!t.myFactory)return Wt("Cannot create view nodes without my own factory"),null;const r=t.myFactory.createNode(e);return r&&r.setRenderable(e),r};const n=e.delete;e.delete=()=>{for(let e=0;e<t.children.length;e++)t.children[e].delete();n()}}(e,t)}var Xt={newInstance:zt.newInstance(Kt,"vtkViewNode"),extend:Kt,PASS_TYPES:["Build","Render"]};const $t={};function qt(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$t,r),zt.obj(e,t),function(e,t){t.overrides||(t.overrides={}),t.classHierarchy.push("vtkViewNodeFactory"),e.createNode=r=>{if(r.isDeleted())return null;let n=0,o=r.getClassName(n++),i=!1;const a=Object.keys(t.overrides);for(;o&&!i;)-1!==a.indexOf(o)?i=!0:o=r.getClassName(n++);if(!i)return null;const s=t.overrides[o]();return s.setMyFactory(e),s}}(e,t)}var Yt={newInstance:zt.newInstance(qt,"vtkViewNodeFactory"),extend:qt};const Jt=Object.create(null);function Qt(e,t){Jt[e]=t}const Zt={};function er(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zt,r),t.overrides=Jt,Yt.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkOpenGLViewNodeFactory")}(0,t)}var tr={newInstance:zt.newInstance(er,"vtkOpenGLViewNodeFactory"),extend:er};const rr={context:null,lastRenderer:null,keyMatrixTime:null,keyMatrices:null};const nr=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rr,r),Xt.extend(e,t,r),t.keyMatrixTime={},mt(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(9),vcpc:new Float64Array(16),wcvc:new Float64Array(16),wcpc:new Float64Array(16)},_t(e,t,["context","keyMatrixTime"]),function(e,t){t.classHierarchy.push("vtkOpenGLCamera"),e.buildPass=r=>{r&&(t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getParent(),t.context=t._openGLRenderWindow.getContext())},e.opaquePass=e=>{if(e){const e=t._openGLRenderer.getTiledSizeAndOrigin();t.context.viewport(e.lowerLeftU,e.lowerLeftV,e.usize,e.vsize),t.context.scissor(e.lowerLeftU,e.lowerLeftV,e.usize,e.vsize)}},e.translucentPass=e.opaquePass,e.zBufferPass=e.opaquePass,e.opaqueZBufferPass=e.opaquePass,e.volumePass=e.opaquePass,e.getKeyMatrices=r=>{if(r!==t.lastRenderer||t._openGLRenderWindow.getMTime()>t.keyMatrixTime.getMTime()||e.getMTime()>t.keyMatrixTime.getMTime()||r.getMTime()>t.keyMatrixTime.getMTime()||t.renderable.getMTime()>t.keyMatrixTime.getMTime()){d(t.keyMatrices.wcvc,t.renderable.getViewMatrix()),se(t.keyMatrices.normalMatrix,t.keyMatrices.wcvc),he(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),m(t.keyMatrices.wcvc,t.keyMatrices.wcvc);const e=t._openGLRenderer.getAspectRatio();d(t.keyMatrices.vcpc,t.renderable.getProjectionMatrix(e,-1,1)),m(t.keyMatrices.vcpc,t.keyMatrices.vcpc),b(t.keyMatrices.wcpc,t.keyMatrices.vcpc,t.keyMatrices.wcvc),t.keyMatrixTime.modified(),t.lastRenderer=r}return t.keyMatrices}}(e,t)});Qt("vtkCamera",nr);const{vtkDebugMacro:or}=jt,ir={context:null,_openGLRenderWindow:null,selector:null};const ar=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ir,r),Xt.extend(e,t,r),yt(e,t,["shaderCache"]),_t(e,t,["selector"]),wt(0,t,["openGLRenderWindow"]),function(e,t){t.classHierarchy.push("vtkOpenGLRenderer"),e.buildPass=r=>{if(r){if(!t.renderable)return;e.updateLights(),e.prepareNodes(),e.addMissingNode(t.renderable.getActiveCamera()),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps(),!0),e.removeUnusedNodes()}},e.updateLights=()=>{let e=0;const r=t.renderable.getLightsByReference();for(let t=0;t<r.length;++t)r[t].getSwitch()>0&&e++;return e||(or("No lights are on, creating one."),t.renderable.createLight()),e},e.zBufferPass=r=>{if(r){let r=0;const n=t.context;t.renderable.getTransparent()||(t.context.clearColor(1,0,0,1),r|=n.COLOR_BUFFER_BIT),t.renderable.getPreserveDepthBuffer()||(n.clearDepth(1),r|=n.DEPTH_BUFFER_BIT,t.context.depthMask(!0));const o=e.getTiledSizeAndOrigin();n.enable(n.SCISSOR_TEST),n.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.colorMask(!0,!0,!0,!0),r&&n.clear(r),n.enable(n.DEPTH_TEST)}},e.opaqueZBufferPass=t=>e.zBufferPass(t),e.cameraPass=t=>{t&&e.clear()},e.getAspectRatio=()=>{const e=t._parent.getSizeByReference(),r=t.renderable.getViewportByReference();return e[0]*(r[2]-r[0])/((r[3]-r[1])*e[1])},e.getTiledSizeAndOrigin=()=>{const e=t.renderable.getViewportByReference(),r=[0,0,1,1],n=e[0]-r[0],o=e[1]-r[1],i=t._parent.normalizedDisplayToDisplay(n,o),a=Math.round(i[0]),s=Math.round(i[1]),l=e[2]-r[0],u=e[3]-r[1],c=t._parent.normalizedDisplayToDisplay(l,u);let d=Math.round(c[0])-a,p=Math.round(c[1])-s;return d<0&&(d=0),p<0&&(p=0),{usize:d,vsize:p,lowerLeftU:a,lowerLeftV:s}},e.clear=()=>{let r=0;const n=t.context;if(!t.renderable.getTransparent()){const e=t.renderable.getBackgroundByReference();n.clearColor(e[0],e[1],e[2],e[3]),r|=n.COLOR_BUFFER_BIT}t.renderable.getPreserveDepthBuffer()||(n.clearDepth(1),r|=n.DEPTH_BUFFER_BIT,n.depthMask(!0)),n.colorMask(!0,!0,!0,!0);const o=e.getTiledSizeAndOrigin();n.enable(n.SCISSOR_TEST),n.scissor(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),n.viewport(o.lowerLeftU,o.lowerLeftV,o.usize,o.vsize),r&&n.clear(r),n.enable(n.DEPTH_TEST)},e.releaseGraphicsResources=()=>{null!==t.selector&&t.selector.releaseGraphicsResources(),t.renderable&&t.renderable.getViewProps().forEach(e=>{e.modified()})},e.setOpenGLRenderWindow=r=>{t._openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t._openGLRenderWindow=r,t.context=null,r&&(t.context=t._openGLRenderWindow.getContext()))}}(e,t)},"vtkOpenGLRenderer");Qt("vtkRenderer",ar);const sr={context:null,keyMatrixTime:null,keyMatrices:null,activeTextures:null};const lr=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sr,r),Xt.extend(e,t,r),t.keyMatrixTime={},mt(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:pe(new Float64Array(9)),mcwc:h(new Float64Array(16))},_t(e,t,["context"]),yt(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLActor"),e.buildPass=r=>{if(r){t._openGLRenderWindow=e.getLastAncestorOfType("vtkOpenGLRenderWindow"),t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t._openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes(),t.ogltextures=null,t.activeTextures=null;for(let e=0;e<t.children.length;e++){const r=t.children[e];r.isA("vtkOpenGLTexture")?(t.ogltextures||(t.ogltextures=[]),t.ogltextures.push(r)):t.oglmapper=r}}},e.traverseZBufferPass=r=>{t.renderable&&t.renderable.getNestedVisibility()&&(!t._openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.oglmapper.traverse(r),e.apply(r,!1))},e.traverseOpaqueZBufferPass=t=>e.traverseOpaquePass(t),e.traverseOpaquePass=r=>{t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t._openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.oglmapper.traverse(r),e.apply(r,!1))},e.traverseTranslucentPass=r=>{!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t._openGLRenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.oglmapper.traverse(r),e.apply(r,!1))},e.activateTextures=()=>{if(t.ogltextures){t.activeTextures=[];for(let e=0;e<t.ogltextures.length;e++){const r=t.ogltextures[e];r.render(),r.getHandle()&&t.activeTextures.push(r)}}},e.queryPass=(e,r)=>{if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.zBufferPass=(t,r)=>e.opaquePass(t,r),e.opaqueZBufferPass=(t,r)=>e.opaquePass(t,r),e.opaquePass=(r,n)=>{if(r)t.context.depthMask(!0),e.activateTextures();else if(t.activeTextures)for(let e=0;e<t.activeTextures.length;e++)t.activeTextures[e].deactivate()},e.translucentPass=(r,n)=>{if(r)t.context.depthMask(t._openGLRenderer.getSelector()&&t.renderable.getNestedPickable()),e.activateTextures();else if(t.activeTextures)for(let e=0;e<t.activeTextures.length;e++)t.activeTextures[e].deactivate()},e.getKeyMatrices=()=>(t.renderable.getMTime()>t.keyMatrixTime.getMTime()&&(t.renderable.computeMatrix(),d(t.keyMatrices.mcwc,t.renderable.getMatrix()),m(t.keyMatrices.mcwc,t.keyMatrices.mcwc),t.renderable.getIsIdentity()?pe(t.keyMatrices.normalMatrix):(se(t.keyMatrices.normalMatrix,t.keyMatrices.mcwc),he(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),fe(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),t.keyMatrixTime.modified()),t.keyMatrices)}(e,t)});Qt("vtkActor",lr);const ur={context:null,activeTextures:null};const cr=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ur,r),Xt.extend(e,t,r),_t(e,t,["context"]),yt(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLActor2D"),e.buildPass=r=>{if(r){if(!t.renderable)return;t._openGLRenderWindow=e.getLastAncestorOfType("vtkOpenGLRenderWindow"),t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t.context=t._openGLRenderWindow.getContext(),e.prepareNodes(),e.addMissingNodes(t.renderable.getTextures()),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes(),t.ogltextures=null,t.activeTextures=null;for(let e=0;e<t.children.length;e++){const r=t.children[e];r.isA("vtkOpenGLTexture")?(t.ogltextures||(t.ogltextures=[]),t.ogltextures.push(r)):t.oglmapper=r}}},e.queryPass=(e,r)=>{if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementOverlayActorCount()}},e.traverseOpaquePass=r=>{t.oglmapper&&t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t._openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.oglmapper.traverse(r),e.apply(r,!1))},e.traverseTranslucentPass=r=>{t.oglmapper&&t.renderable&&t.renderable.getNestedVisibility()&&!t.renderable.getIsOpaque()&&(!t._openGLRenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.oglmapper.traverse(r),e.apply(r,!1))},e.traverseOverlayPass=r=>{t.oglmapper&&t.renderable&&t.renderable.getNestedVisibility()&&(!t._openGLRenderer.getSelector()||t.renderable.getNestedPickable)&&(e.apply(r,!0),t.oglmapper.traverse(r),e.apply(r,!1))},e.activateTextures=()=>{if(t.ogltextures){t.activeTextures=[];for(let e=0;e<t.ogltextures.length;e++){const r=t.ogltextures[e];r.render(),r.getHandle()&&t.activeTextures.push(r)}}},e.opaquePass=(r,n)=>{if(r)t.context.depthMask(!0),e.activateTextures();else if(t.activeTextures)for(let e=0;e<t.activeTextures.length;e++)t.activeTextures[e].deactivate()},e.translucentPass=(r,n)=>{if(r)t.context.depthMask(!1),e.activateTextures();else if(t.activeTextures)for(let e=0;e<t.activeTextures.length;e++)t.activeTextures[e].deactivate()},e.overlayPass=(r,n)=>{if(r)t.context.depthMask(!0),e.activateTextures();else if(t.activeTextures)for(let e=0;e<t.activeTextures.length;e++)t.activeTextures[e].deactivate()}}(e,t)});function dr(){var e=new a(3);return a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function pr(e){var t=e[0],r=e[1],n=e[2];return Math.hypot(t,r,n)}function fr(e,t,r){var n=new a(3);return n[0]=e,n[1]=t,n[2]=r,n}function hr(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function mr(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function gr(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function yr(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function vr(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function br(e,t){var r=t[0],n=t[1],o=t[2],i=r*r+n*n+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function xr(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function _r(e,t,r){var n=t[0],o=t[1],i=t[2],a=r[0],s=r[1],l=r[2];return e[0]=o*l-i*s,e[1]=i*a-n*l,e[2]=n*s-o*a,e}function Sr(e,t,r){var n=t[0],o=t[1],i=t[2],a=r[3]*n+r[7]*o+r[11]*i+r[15];return a=a||1,e[0]=(r[0]*n+r[4]*o+r[8]*i+r[12])/a,e[1]=(r[1]*n+r[5]*o+r[9]*i+r[13])/a,e[2]=(r[2]*n+r[6]*o+r[10]*i+r[14])/a,e}function Cr(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Tr(e,t){var r=e[0],n=e[1],o=e[2],a=t[0],s=t[1],l=t[2];return Math.abs(r-a)<=i*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=i*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(o-l)<=i*Math.max(1,Math.abs(o),Math.abs(l))}Qt("vtkActor2D",cr);var wr=yr,Ar=pr;dr();const Er=Math.sqrt(50),Dr=Math.sqrt(10),Pr=Math.sqrt(2);function Ir(e,t,r){const n=(t-e)/Math.max(0,r),o=Math.floor(Math.log10(n)),i=n/Math.pow(10,o),a=i>=Er?10:i>=Dr?5:i>=Pr?2:1;let s,l,u;return o<0?(u=Math.pow(10,-o)/a,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,o)*a,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=r&&r<2?Ir(e,t,2*r):[s,l,u]}function Or(e,t,r){return Ir(e=+e,t=+t,r=+r)[2]}function Nr(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Mr(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Rr(e){let t,r,n;function o(e,n,o=0,i=e.length){if(o<i){if(0!==t(n,n))return i;do{const t=o+i>>>1;r(e[t],n)<0?o=t+1:i=t}while(o<i)}return o}return 2!==e.length?(t=Nr,r=(t,r)=>Nr(e(t),r),n=(t,r)=>e(t)-r):(t=e===Nr||e===Mr?e:Fr,r=e,n=e),{left:o,center:function(e,t,r=0,i=e.length){const a=o(e,t,r,i-1);return a>r&&n(e[a-1],t)>-n(e[a],t)?a-1:a},right:function(e,n,o=0,i=e.length){if(o<i){if(0!==t(n,n))return i;do{const t=o+i>>>1;r(e[t],n)<=0?o=t+1:i=t}while(o<i)}return o}}}function Fr(){return 0}const Br=Rr(Nr),Lr=Br.right,kr=(Br.left,Rr(function(e){return null===e?NaN:+e}).center,Lr);function Ur(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Vr(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Gr(){}var zr=.7,jr=1/zr,Wr="\\s*([+-]?\\d+)\\s*",Hr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xr=/^#([0-9a-f]{3,8})$/,$r=new RegExp(`^rgb\\(${Wr},${Wr},${Wr}\\)$`),qr=new RegExp(`^rgb\\(${Kr},${Kr},${Kr}\\)$`),Yr=new RegExp(`^rgba\\(${Wr},${Wr},${Wr},${Hr}\\)$`),Jr=new RegExp(`^rgba\\(${Kr},${Kr},${Kr},${Hr}\\)$`),Qr=new RegExp(`^hsl\\(${Hr},${Kr},${Kr}\\)$`),Zr=new RegExp(`^hsla\\(${Hr},${Kr},${Kr},${Hr}\\)$`),en={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};function tn(){return this.rgb().formatHex()}function rn(){return this.rgb().formatRgb()}function nn(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Xr.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?on(t):3===r?new ln(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?an(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?an(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=$r.exec(e))?new ln(t[1],t[2],t[3],1):(t=qr.exec(e))?new ln(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Yr.exec(e))?an(t[1],t[2],t[3],t[4]):(t=Jr.exec(e))?an(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Qr.exec(e))?hn(t[1],t[2]/100,t[3]/100,1):(t=Zr.exec(e))?hn(t[1],t[2]/100,t[3]/100,t[4]):en.hasOwnProperty(e)?on(en[e]):"transparent"===e?new ln(NaN,NaN,NaN,0):null}function on(e){return new ln(e>>16&255,e>>8&255,255&e,1)}function an(e,t,r,n){return n<=0&&(e=t=r=NaN),new ln(e,t,r,n)}function sn(e,t,r,n){return 1===arguments.length?((o=e)instanceof Gr||(o=nn(o)),o?new ln((o=o.rgb()).r,o.g,o.b,o.opacity):new ln):new ln(e,t,r,null==n?1:n);var o}function ln(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function un(){return`#${fn(this.r)}${fn(this.g)}${fn(this.b)}`}function cn(){const e=dn(this.opacity);return`${1===e?"rgb(":"rgba("}${pn(this.r)}, ${pn(this.g)}, ${pn(this.b)}${1===e?")":`, ${e})`}`}function dn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fn(e){return((e=pn(e))<16?"0":"")+e.toString(16)}function hn(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new gn(e,t,r,n)}function mn(e){if(e instanceof gn)return new gn(e.h,e.s,e.l,e.opacity);if(e instanceof Gr||(e=nn(e)),!e)return new gn;if(e instanceof gn)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),i=Math.max(t,r,n),a=NaN,s=i-o,l=(i+o)/2;return s?(a=t===i?(r-n)/s+6*(r<n):r===i?(n-t)/s+2:(t-r)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new gn(a,s,l,e.opacity)}function gn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function yn(e){return(e=(e||0)%360)<0?e+360:e}function vn(e){return Math.max(0,Math.min(1,e||0))}function bn(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function xn(e,t,r,n,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*r+(1+3*e+3*i-3*a)*n+a*o)/6}Ur(Gr,nn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tn,formatHex:tn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mn(this).formatHsl()},formatRgb:rn,toString:rn}),Ur(ln,sn,Vr(Gr,{brighter(e){return e=null==e?jr:Math.pow(jr,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?zr:Math.pow(zr,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ln(pn(this.r),pn(this.g),pn(this.b),dn(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:un,formatHex:un,formatHex8:function(){return`#${fn(this.r)}${fn(this.g)}${fn(this.b)}${fn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:cn,toString:cn})),Ur(gn,function(e,t,r,n){return 1===arguments.length?mn(e):new gn(e,t,r,null==n?1:n)},Vr(Gr,{brighter(e){return e=null==e?jr:Math.pow(jr,e),new gn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?zr:Math.pow(zr,e),new gn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new ln(bn(e>=240?e-240:e+120,o,n),bn(e,o,n),bn(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new gn(yn(this.h),vn(this.s),vn(this.l),dn(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=dn(this.opacity);return`${1===e?"hsl(":"hsla("}${yn(this.h)}, ${100*vn(this.s)}%, ${100*vn(this.l)}%${1===e?")":`, ${e})`}`}}));const _n=e=>()=>e;function Sn(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):_n(isNaN(e)?t:e)}const Cn=function e(t){var r=function(e){return 1===(e=+e)?Sn:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):_n(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=sn(e)).r,(t=sn(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=Sn(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);function Tn(e){return function(t){var r,n,o=t.length,i=new Array(o),a=new Array(o),s=new Array(o);for(r=0;r<o;++r)n=sn(t[r]),i[r]=n.r||0,a[r]=n.g||0,s[r]=n.b||0;return i=e(i),a=e(a),s=e(s),n.opacity=1,function(e){return n.r=i(e),n.g=a(e),n.b=s(e),n+""}}}function wn(e,t){var r,n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),a=new Array(n);for(r=0;r<o;++r)i[r]=Mn(e[r],t[r]);for(;r<n;++r)a[r]=t[r];return function(e){for(r=0;r<o;++r)a[r]=i[r](e);return a}}function An(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function En(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Dn(e,t){var r,n={},o={};for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=Mn(e[r],t[r]):o[r]=t[r];return function(e){for(r in n)o[r]=n[r](e);return o}}Tn(function(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),o=e[n],i=e[n+1],a=n>0?e[n-1]:2*o-i,s=n<t-1?e[n+2]:2*i-o;return xn((r-n/t)*t,a,o,i,s)}}),Tn(function(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),o=e[(n+t-1)%t],i=e[n%t],a=e[(n+1)%t],s=e[(n+2)%t];return xn((r-n/t)*t,o,i,a,s)}});var Pn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,In=new RegExp(Pn.source,"g");function On(e,t){var r,n,o,i=Pn.lastIndex=In.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(r=Pn.exec(e))&&(n=In.exec(t));)(o=n.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,l.push({i:a,x:En(r,n)})),i=In.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}function Nn(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function Mn(e,t){var r,n=typeof t;return null==t||"boolean"===n?_n(t):("number"===n?En:"string"===n?(r=nn(t))?(t=r,Cn):On:t instanceof nn?Cn:t instanceof Date?An:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Nn:Array.isArray(t)?wn:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Dn:En)(e,t)}function Rn(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function Fn(e){return+e}var Bn=[0,1];function Ln(e){return e}function kn(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Un(e,t,r){var n=e[0],o=e[1],i=t[0],a=t[1];return o<n?(n=kn(o,n),i=r(a,i)):(n=kn(n,o),i=r(i,a)),function(e){return i(n(e))}}function Vn(e,t,r){var n=Math.min(e.length,t.length)-1,o=new Array(n),i=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)o[a]=kn(e[a],e[a+1]),i[a]=r(t[a],t[a+1]);return function(t){var r=kr(e,t,1,n)-1;return i[r](o[r](t))}}function Gn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var zn,jn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wn(e){if(!(t=jn.exec(e)))throw new Error("invalid format: "+e);var t;return new Hn({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]})}function Hn(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Kn(e,t){if(!isFinite(e)||0===e)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Xn(e){return(e=Kn(Math.abs(e)))?e[1]:NaN}function $n(e,t){var r=Kn(e,t);if(!r)return e+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}Wn.prototype=Hn.prototype,Hn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const qn={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},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)=>$n(100*e,t),r:$n,s:function(e,t){var r=Kn(e,t);if(!r)return zn=void 0,e.toPrecision(t);var n=r[0],o=r[1],i=o-(zn=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Kn(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Yn(e){return e}var Jn,Qn,Zn,eo=Array.prototype.map,to=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ro(e){var t=e.domain;return e.ticks=function(e){var r=t();return function(e,t,r){if(!((r=+r)>0))return[];if((e=+e)===(t=+t))return[e];const n=t<e,[o,i,a]=n?Ir(t,e,r):Ir(e,t,r);if(!(i>=o))return[];const s=i-o+1,l=new Array(s);if(n)if(a<0)for(let e=0;e<s;++e)l[e]=(i-e)/-a;else for(let e=0;e<s;++e)l[e]=(i-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(o+e)/-a;else for(let e=0;e<s;++e)l[e]=(o+e)*a;return l}(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return function(e,t,r,n){var o,i=function(e,t,r){r=+r;const n=(t=+t)<(e=+e),o=n?Or(t,e,r):Or(e,t,r);return(n?-1:1)*(o<0?1/-o:o)}(e,t,r);switch((n=Wn(null==n?",f":n)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Xn(t)/3)))-Xn(Math.abs(e)))}(i,a))||(n.precision=o),Zn(n,a);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xn(t)-Xn(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))||(n.precision=o-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(o=function(e){return Math.max(0,-Xn(Math.abs(e)))}(i))||(n.precision=o-2*("%"===n.type))}return Qn(n)}(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,o,i=t(),a=0,s=i.length-1,l=i[a],u=i[s],c=10;for(u<l&&(o=l,l=u,u=o,o=a,a=s,s=o);c-- >0;){if((o=Or(l,u,r))===n)return i[a]=l,i[s]=u,t(i);if(o>0)l=Math.floor(l/o)*o,u=Math.ceil(u/o)*o;else{if(!(o<0))break;l=Math.ceil(l*o)/o,u=Math.floor(u*o)/o}n=o}return e},e}function no(){var e=function(){var e,t,r,n,o,i,a=Bn,s=Bn,l=Mn,u=Ln;function c(){var e,t,r,l=Math.min(a.length,s.length);return u!==Ln&&(e=a[0],t=a[l-1],e>t&&(r=e,e=t,t=r),u=function(r){return Math.max(e,Math.min(t,r))}),n=l>2?Vn:Un,o=i=null,d}function d(t){return null==t||isNaN(t=+t)?r:(o||(o=n(a.map(e),s,l)))(e(u(t)))}return d.invert=function(r){return u(t((i||(i=n(s,a.map(e),En)))(r)))},d.domain=function(e){return arguments.length?(a=Array.from(e,Fn),c()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=Rn,c()},d.clamp=function(e){return arguments.length?(u=!!e||Ln,c()):u!==Ln},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(r=e,d):r},function(r,n){return e=r,t=n,c()}}()(Ln,Ln);return e.copy=function(){return t=e,no().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},Gn.apply(e,arguments),ro(e)}Jn=function(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?Yn:(t=eo.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var o=e.length,i=[],a=0,s=t[0],l=0;o>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),i.push(e.substring(o-=s,o+s)),!((l+=s+1)>n));)s=t[a=(a+1)%t.length];return i.reverse().join(r)}),o=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?Yn:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(eo.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function d(e,t){var r=(e=Wn(e)).fill,d=e.align,p=e.sign,f=e.symbol,h=e.zero,m=e.width,g=e.comma,y=e.precision,v=e.trim,b=e.type;"n"===b?(g=!0,b="g"):qn[b]||(void 0===y&&(y=12),v=!0,b="g"),(h||"0"===r&&"="===d)&&(h=!0,r="0",d="=");var x=(t&&void 0!==t.prefix?t.prefix:"")+("$"===f?o:"#"===f&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),_=("$"===f?i:/[%p]/.test(b)?l:"")+(t&&void 0!==t.suffix?t.suffix:""),S=qn[b],C=/[defgprs%]/.test(b);function T(e){var t,o,i,l=x,f=_;if("c"===b)f=S(e)+f,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),y),v&&(e=function(e){e:for(var t,r=e.length,n=1,o=-1;n<r;++n)switch(e[n]){case".":o=t=n;break;case"0":0===o&&(o=n),t=n;break;default:if(!+e[n])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),T&&0===+e&&"+"!==p&&(T=!1),l=(T?"("===p?p:u:"-"===p||"("===p?"":p)+l,f=("s"!==b||isNaN(e)||void 0===zn?"":to[8+zn/3])+f+(T&&"("===p?")":""),C)for(t=-1,o=e.length;++t<o;)if(48>(i=e.charCodeAt(t))||i>57){f=(46===i?a+e.slice(t+1):e.slice(t))+f,e=e.slice(0,t);break}}g&&!h&&(e=n(e,1/0));var w=l.length+e.length+f.length,A=w<m?new Array(m-w+1).join(r):"";switch(g&&h&&(e=n(A+e,A.length?m-f.length:1/0),A=""),d){case"<":e=l+e+f+A;break;case"=":e=l+A+e+f;break;case"^":e=A.slice(0,w=A.length>>1)+l+e+f+A.slice(w);break;default:e=A+l+e+f}return s(e)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),T.toString=function(){return e+""},T}return{format:d,formatPrefix:function(e,t){var r=3*Math.max(-8,Math.min(8,Math.floor(Xn(t)/3))),n=Math.pow(10,-r),o=d(((e=Wn(e)).type="f",e),{suffix:to[8+r/3]});return function(e){return o(n*e)}}}}({thousands:",",grouping:[3],currency:["$",""]}),Qn=Jn.format,Zn=Jn.formatPrefix;var oo=r(391);const io=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],ao=[1,0,0,0,1,0,0,0,1],so=1e-6,lo=1e-12,{vtkErrorMacro:uo,vtkWarningMacro:co}=zt;let po=0;function fo(e){return()=>uo(`vtkMath::${e} - NOT IMPLEMENTED`)}function ho(e,t,r,n){let o;for(let i=0;i<t;i++)o=e[r*t+i],e[r*t+i]=e[n*t+i],e[n*t+i]=o}function mo(e,t,r,n){let o;for(let i=0;i<t;i++)o=e[i*t+r],e[i*t+r]=e[i*t+n],e[i*t+n]=o}function go(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;const t=Array(e);for(let r=0;r<e;++r)t[r]=0;return t}function yo(e){return e/180*Math.PI}function vo(e){return 180*e/Math.PI}const{round:bo,floor:xo,ceil:_o,min:So,max:Co}=Math;const To=fo("ceilLog2"),wo=fo("factorial");function Ao(e){let t=1;for(;t<e;)t*=2;return t}function Eo(e){return e===Ao(e)}const Do=fo("gaussian");function Po(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}function Io(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}function Oo(e,t){return e[0]*=t,e[1]*=t,e[2]*=t,e}function No(e,t){return e[0]*=t,e[1]*=t,e}function Mo(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n[2]=e[2]+t[2]*r,n}function Ro(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fo(e,t,r){const n=e[1]*t[2]-e[2]*t[1],o=e[2]*t[0]-e[0]*t[2],i=e[0]*t[1]-e[1]*t[0];return r[0]=n,r[1]=o,r[2]=i,r}function Bo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;switch(t){case 1:return Math.abs(e);case 2:return Math.sqrt(e[0]*e[0]+e[1]*e[1]);case 3:return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);default:{let r=0;for(let n=0;n<t;n++)r+=e[n]*e[n];return Math.sqrt(r)}}}function Lo(e){const t=Bo(e);return 0!==t&&(e[0]/=t,e[1]/=t,e[2]/=t),t}function ko(e){const t=Bo(e,3);return 0!==t&&(e[0]/=t,e[1]/=t,e[2]/=t,e[3]/=t),t}function Uo(e,t){return e[0]*t[0]+e[1]*t[1]}function Vo(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])+(e[2]-t[2])*(e[2]-t[2])}function Go(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function zo(e){const t=Go(e);return 0!==t&&(e[0]/=t,e[1]/=t),t}function jo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return 2===t.length?t[0][0]*t[1][1]-t[1][0]*t[0][1]:4===t.length?t[0]*t[3]-t[1]*t[2]:Number.NaN}function Wo(e,t,r){const n=[...e],o=[...t];for(let e=0;e<3;e++)r[e]=n[0]*o[e]+n[1]*o[e+3]+n[2]*o[e+6],r[e+3]=n[3]*o[e]+n[4]*o[e+3]+n[5]*o[e+6],r[e+6]=n[6]*o[e]+n[7]*o[e+3]+n[8]*o[e+6]}function Ho(e,t){let r;r=e[3],t[3]=e[1],t[1]=r,r=e[6],t[6]=e[2],t[2]=r,r=e[7],t[7]=e[5],t[5]=r,t[0]=e[0],t[4]=e[4],t[8]=e[8]}function Ko(e){return e[0]*e[4]*e[8]+e[3]*e[7]*e[2]+e[6]*e[1]*e[5]-e[0]*e[7]*e[5]-e[3]*e[1]*e[8]-e[6]*e[4]*e[2]}function Xo(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:so;return e.length===t.length&&e.every(function(e,n){return Math.abs(e-t[n])<=r})}const $o=Xo;function qo(e){for(let t=0;t<3;t++)e[3*t]=e[3*t+1]=e[3*t+2]=0,e[3*t+t]=1}function Yo(e,t){for(let r=0;r<e;r++){for(let n=0;n<e;n++)t[r*e+n]=0;t[r*e+r]=1}return t}function Jo(e,t){const r=e[0]*e[0],n=e[0]*e[1],o=e[0]*e[2],i=e[0]*e[3],a=e[1]*e[1],s=e[2]*e[2],l=e[3]*e[3],u=e[1]*e[2],c=e[1]*e[3],d=e[2]*e[3],p=a+s+l;let f=1/(r+p);const h=(r-p)*f;f*=2,t[0]=a*f+h,t[3]=(u+i)*f,t[6]=(c-o)*f,t[1]=(u-i)*f,t[4]=s*f+h,t[7]=(d+n)*f,t[2]=(c+o)*f,t[5]=(d-n)*f,t[8]=l*f+h}function Qo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!`${e}`.includes("e"))return+`${Math.round(`${e}e+${t}`)}e-${t}`;const r=`${e}`.split("e");let n="";return+r[1]+t>0&&(n="+"),+`${Math.round(`${+r[0]}e${n}${+r[1]+t}`)}e-${t}`}function Zo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t[0]=Qo(e[0],r),t[1]=Qo(e[1],r),t[2]=Qo(e[2],r),t}function ei(e,t,r,n){let o,i,a,s,l,u,c,d,p,f,h,m,g,y,v,b;const x=go(t),_=go(t),S=(e,t,r)=>{y=e[t],g=e[r],e[t]=y-m*(g+y*f),e[r]=g+m*(y-g*f)};for(Yo(t,n),l=0;l<t;l++)x[l]=r[l]=e[l+l*t],_[l]=0;for(o=0;o<20;o++){for(h=0,l=0;l<t-1;l++)for(s=l+1;s<t;s++)h+=Math.abs(e[l*t+s]);if(0===h)break;for(c=o<3?.2*h/(t*t):0,l=0;l<t-1;l++)for(s=l+1;s<t;s++)if(y=100*Math.abs(e[l*t+s]),o>3&&Math.abs(r[l])+y===Math.abs(r[l])&&Math.abs(r[s])+y===Math.abs(r[s]))e[l*t+s]=0;else if(Math.abs(e[l*t+s])>c){for(g=r[s]-r[l],Math.abs(g)+y===Math.abs(g)?p=e[l*t+s]/g:(d=.5*g/e[l*t+s],p=1/(Math.abs(d)+Math.sqrt(1+d*d)),d<0&&(p=-p)),v=1/Math.sqrt(1+p*p),m=p*v,f=m/(1+v),g=p*e[l*t+s],_[l]-=g,_[s]+=g,r[l]-=g,r[s]+=g,e[l*t+s]=0,i=0;i<=l-1;i++)S(e,i*t+l,i*t+s);for(i=l+1;i<=s-1;i++)S(e,l*t+i,i*t+s);for(i=s+1;i<t;i++)S(e,l*t+i,s*t+i);for(i=0;i<t;i++)S(n,i*t+l,i*t+s)}for(l=0;l<t;l++)x[l]+=_[l],r[l]=x[l],_[l]=0}if(o>=20)return co("vtkMath::Jacobi: Error extracting eigenfunctions"),0;for(i=0;i<t-1;i++){for(a=i,b=r[a],o=i+1;o<t;o++)(r[o]>=b||Math.abs(r[o]-b)<lo)&&(a=o,b=r[a]);a!==i&&(r[a]=r[i],r[i]=b,mo(n,t,i,a))}const C=(t>>1)+(1&t);for(u=0,o=0;o<t*t;o++)n[o]>=0&&u++;if(u<C)for(o=0;o<t;o++)n[o*t+i]*=-1;return 1}function ti(e,t){const r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];r[0]=e[0]+e[4]+e[8],r[5]=e[0]-e[4]-e[8],r[10]=-e[0]+e[4]-e[8],r[15]=-e[0]-e[4]+e[8],r[1]=r[4]=e[7]-e[5],r[2]=r[8]=e[2]-e[6],r[3]=r[12]=e[3]-e[1],r[6]=r[9]=e[3]+e[1],r[7]=r[13]=e[2]+e[6],r[11]=r[14]=e[7]+e[5];const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];ei([...r],4,[0,0,0,0],n),t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12]}function ri(e,t){for(let r=0;r<9;r++)t[r]=e[r];const r=go(3),n=go(3);let o;for(let e=0;e<3;e++){const n=Math.abs(t[3*e]),i=Math.abs(t[3*e+1]),a=Math.abs(t[3*e+2]);o=i>n?i:n,o=a>o?a:o,r[e]=1,0!==o&&(r[e]/=o)}const i=Math.abs(t[0])*r[0],a=Math.abs(t[3])*r[1],s=Math.abs(t[6])*r[2];n[0]=0,o=i,a>=o&&(o=a,n[0]=1),s>=o&&(n[0]=2),0!==n[0]&&(mo(t,3,n[0],0),r[n[0]]=r[0]);const l=Math.abs(t[4])*r[1],u=Math.abs(t[7])*r[2];n[1]=1,o=l,u>=o&&(n[1]=2,mo(t,3,1,2)),n[2]=2;let c=0;if(Ko(t)<0){c=1;for(let e=0;e<9;e++)t[e]=-t[e]}const d=go(4);if(ti(t,d),Jo(d,t),c)for(let e=0;e<9;e++)t[e]=-t[e];1!==n[1]&&mo(t,3,n[1],1),0!==n[0]&&mo(t,3,n[0],0)}function ni(e,t,r){let n,o,i,a,s,l;if(ei([...e],3,t,r),t[0]!==t[1]||t[0]!==t[2]){for(Ho(r,r),n=0;n<3;n++)if(t[(n+1)%3]===t[(n+2)%3]){for(l=Math.abs(r[3*n]),a=0,o=1;o<3;o++)l<(s=Math.abs(r[3*n+o]))&&(l=s,a=o);a!==n&&(s=t[a],t[a]=t[n],t[n]=s,ho(r,3,n,a)),r[3*a+a]<0&&(r[3*a]=-r[3*a],r[3*a+1]=-r[3*a+1],r[3*a+2]=-r[3*a+2]),o=(a+1)%3,i=(a+2)%3,r[3*o]=0,r[3*o+1]=0,r[3*o+2]=0,r[3*o+o]=1;const e=Fo([r[3*a],r[3*a+1],r[3*a+2]],[r[3*o],r[3*o+1],r[3*o+2]],[]);Lo(e);const u=Fo(e,[r[3*a],r[3*a+1],r[3*a+2]],[]);for(let t=0;t<3;t++)r[3*i+t]=e[t],r[3*o+t]=u[t];return void Ho(r,r)}for(l=Math.abs(r[0]),a=0,n=1;n<3;n++)l<(s=Math.abs(r[3*n]))&&(l=s,a=n);if(0!==a){const e=t[a];t[a]=t[0],t[0]=e,ho(r,3,a,0)}if(Math.abs(r[4])<Math.abs(r[7])){const e=t[2];t[2]=t[1],t[1]=e,ho(r,3,1,2)}for(n=0;n<2;n++)r[3*n+n]<0&&(r[3*n]=-r[3*n],r[3*n+1]=-r[3*n+1],r[3*n+2]=-r[3*n+2]);Ko(r)<0&&(r[6]=-r[6],r[7]=-r[7],r[8]=-r[8]),Ho(r,r)}else qo(r)}function oi(e,t,r){let n,o,i,a,s,l,u,c=0;const d=go(r);for(n=0;n<r;n++){for(a=0,o=0;o<r;o++)(u=Math.abs(e[n*r+o]))>a&&(a=u);if(0===a)return co("Unable to factor linear system"),0;d[n]=1/a}for(o=0;o<r;o++){for(n=0;n<o;n++){for(s=e[n*r+o],i=0;i<n;i++)s-=e[n*r+i]*e[i*r+o];e[n*r+o]=s}for(a=0,n=o;n<r;n++){for(s=e[n*r+o],i=0;i<o;i++)s-=e[n*r+i]*e[i*r+o];e[n*r+o]=s,(l=d[n]*Math.abs(s))>=a&&(a=l,c=n)}if(o!==c){for(i=0;i<r;i++)l=e[c*r+i],e[c*r+i]=e[o*r+i],e[o*r+i]=l;d[c]=d[o]}if(t[o]=c,Math.abs(e[o*r+o])<=lo)return co("Unable to factor linear system"),0;if(o!==r-1)for(l=1/e[o*r+o],n=o+1;n<r;n++)e[n*r+o]*=l}return 1}function ii(e,t,r,n){let o,i,a,s,l;for(a=-1,o=0;o<n;o++){if(s=t[o],l=r[s],r[s]=r[o],a>=0)for(i=a;i<=o-1;i++)l-=e[o*n+i]*r[i];else 0!==l&&(a=o);r[o]=l}for(o=n-1;o>=0;o--){for(l=r[o],i=o+1;i<n;i++)l-=e[o*n+i]*r[i];r[o]=l/e[o*n+o]}}function ai(e,t,r){if(2===r){const r=go(2),n=jo(e[0],e[1],e[2],e[3]);return 0===n?0:(r[0]=(e[3]*t[0]-e[1]*t[1])/n,r[1]=(-e[2]*t[0]+e[0]*t[1])/n,t[0]=r[0],t[1]=r[1],1)}if(1===r)return 0===e[0]?0:(t[0]/=e[0],1);const n=go(r);return 0===oi(e,n,r)?0:(ii(e,n,t,r),1)}function si(e,t,r){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:null)||go(r),i=n||go(r);if(0===oi(e,o,r))return null;for(let n=0;n<r;n++){for(let e=0;e<r;e++)i[e]=0;i[n]=1,ii(e,o,i,r);for(let e=0;e<r;e++)t[e*r+n]=i[e]}return t}function li(e,t,r,n){if(e<r)return co("Insufficient number of samples. Underdetermined."),0;let o,i,a;const s=go(r*r),l=go(r),u=go(r*r);for(a=0;a<e;a++)for(o=0;o<r;o++)for(i=o;i<r;i++)s[o*r+i]+=t[a*r+o]*t[a*r+i];for(o=0;o<r;o++)for(i=0;i<o;i++)s[o*r+i]=s[i*r+o];for(ei(s,r,l,u),o=0;o<r;o++)n[o]=u[o*r+r-1];return 1}function ui(e,t){let r,n;const[o,i,a]=e,s=1/6;let l=o,u=o;i>l?l=i:i<u&&(u=i),a>l?l=a:a<u&&(u=a);const c=l;n=c>0?(l-u)/l:0,n>0?(r=o===l?s*(i-a)/(l-u):i===l?1/3+s*(a-o)/(l-u):2/3+s*(o-i)/(l-u),r<0&&(r+=1)):r=0,t[0]=r,t[1]=n,t[2]=c}function ci(e,t){const[r,n,o]=e,i=1/3,a=1/6,s=2/3,l=5/6;let u,c,d;r>a&&r<=i?(c=1,u=(i-r)/a,d=0):r>i&&r<=.5?(c=1,d=(r-i)/a,u=0):r>.5&&r<=s?(d=1,c=(s-r)/a,u=0):r>s&&r<=l?(d=1,u=(r-s)/a,c=0):r>l&&r<=1?(u=1,d=(1-r)/a,c=0):(u=1,c=r/a,d=0),u=n*u+(1-n),c=n*c+(1-n),d=n*d+(1-n),u*=o,c*=o,d*=o,t[0]=u,t[1]=c,t[2]=d}function di(e,t){const[r,n,o]=e;let i=(r+16)/116,a=n/500+i,s=i-o/200;i**3>.008856?i**=3:i=(i-16/116)/7.787,a**3>.008856?a**=3:a=(a-16/116)/7.787,s**3>.008856?s**=3:s=(s-16/116)/7.787,t[0]=.9505*a,t[1]=1*i,t[2]=1.089*s}function pi(e,t){const[r,n,o]=e;let i=r/.9505,a=n/1,s=o/1.089;i>.008856?i**=1/3:i=7.787*i+16/116,a>.008856?a**=1/3:a=7.787*a+16/116,s>.008856?s**=1/3:s=7.787*s+16/116,t[0]=116*a-16,t[1]=500*(i-a),t[2]=200*(a-s)}function fi(e,t){const[r,n,o]=e;let i=3.2406*r+-1.5372*n+-.4986*o,a=-.9689*r+1.8758*n+.0415*o,s=.0557*r+-.204*n+1.057*o;i>.0031308?i=1.055*i**(1/2.4)-.055:i*=12.92,a>.0031308?a=1.055*a**(1/2.4)-.055:a*=12.92,s>.0031308?s=1.055*s**(1/2.4)-.055:s*=12.92;let l=i;l<a&&(l=a),l<s&&(l=s),l>1&&(i/=l,a/=l,s/=l),i<0&&(i=0),a<0&&(a=0),s<0&&(s=0),t[0]=i,t[1]=a,t[2]=s}function hi(e,t){let[r,n,o]=e;r>.04045?r=((r+.055)/1.055)**2.4:r/=12.92,n>.04045?n=((n+.055)/1.055)**2.4:n/=12.92,o>.04045?o=((o+.055)/1.055)**2.4:o/=12.92,t[0]=.4124*r+.3576*n+.1805*o,t[1]=.2126*r+.7152*n+.0722*o,t[2]=.0193*r+.1192*n+.9505*o}function mi(e,t){const r=[0,0,0];hi(e,r),pi(r,t)}function gi(e,t){const r=[0,0,0];di(e,r),fi(r,t)}function yi(e){return e[0]=1,e[1]=-1,e[2]=1,e[3]=-1,e[4]=1,e[5]=-1,e}function vi(e){return!(e[1]-e[0]<0)}function bi(e,t,r){return e<t?t:e>r?r:e}function xi(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[0,0,0];return n[0]=bi(e[0],t[0],r[0]),n[1]=bi(e[1],t[1],r[1]),n[2]=bi(e[2],t[2],r[2]),n}const _i=fo("GetScalarTypeFittingRange"),Si=fo("GetAdjustedScalarRange");const Ci=e=>!Number.isFinite(e),{isFinite:Ti,isNaN:wi}=Number,Ai=wi;function Ei(){return[].concat([Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE])}function Di(e){const t=Math.floor(255*e);return t>15?t.toString(16):`0${t.toString(16)}`}function Pi(e){return Math.round(255*e)}var Ii,Oi={Pi:()=>Math.PI,ldexp:function(e,t){return t>1023?e*2**1023*2**(t-1023):t<-1074?5e-324*e*2**(t+1074):e*2**t},radiansFromDegrees:yo,degreesFromRadians:vo,round:bo,floor:xo,ceil:_o,ceilLog2:To,min:So,max:Co,arrayMin:function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=1/0;for(let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=e.length;n<o;n+=t)e[n]<r&&(r=e[n]);return r},arrayMax:function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=-1/0;for(let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=e.length;n<o;n+=t)r<e[n]&&(r=e[n]);return r},arrayRange:function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=1/0,n=-1/0;for(let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=e.length;o<i;o+=t)e[o]<r&&(r=e[o]),n<e[o]&&(n=e[o]);return[r,n]},isPowerOfTwo:Eo,nearestPowerOfTwo:Ao,factorial:wo,binomial:function(e,t){let r=1;for(let n=1;n<=t;++n)r*=(e-n+1)/n;return Math.floor(r)},beginCombination:function(e,t){if(e<t)return 0;const r=go(t);for(let e=0;e<t;++e)r[e]=e;return r},nextCombination:function(e,t,r){let n=0;for(let o=t-1;o>=0;--o)if(r[o]<e-t+o){let e=r[o]+1;for(;o<t;)r[o++]=e++;n=1;break}return n},randomSeed:function(e){oo(`${e}`,{global:!0}),po=e},getSeed:function(){return po},random:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e+((arguments.length>1&&void 0!==arguments[1]?arguments[1]:1)-e)*Math.random()},gaussian:Do,add:Po,subtract:Io,multiplyScalar:Oo,multiplyScalar2D:No,multiplyAccumulate:Mo,multiplyAccumulate2D:function(e,t,r,n){return n[0]=e[0]+t[0]*r,n[1]=e[1]+t[1]*r,n},dot:Ro,outer:function(e,t,r){r[0]=e[0]*t[0],r[1]=e[0]*t[1],r[2]=e[0]*t[2],r[3]=e[1]*t[0],r[4]=e[1]*t[1],r[5]=e[1]*t[2],r[6]=e[2]*t[0],r[7]=e[2]*t[1],r[8]=e[2]*t[2]},cross:Fo,norm:Bo,normalize:Lo,perpendiculars:function(e,t,r,n){const o=e[0]*e[0],i=e[1]*e[1],a=e[2]*e[2],s=Math.sqrt(o+i+a);let l,u,c;o>i&&o>a?(l=0,u=1,c=2):i>a?(l=1,u=2,c=0):(l=2,u=0,c=1);const d=e[l]/s,p=e[u]/s,f=e[c]/s,h=Math.sqrt(d*d+f*f);if(0!==n){const e=Math.sin(n),o=Math.cos(n);t&&(t[l]=(f*o-d*p*e)/h,t[u]=e*h,t[c]=(-d*o-p*f*e)/h),r&&(r[l]=(-f*e-d*p*o)/h,r[u]=o*h,r[c]=(d*e-p*f*o)/h)}else t&&(t[l]=f/h,t[u]=0,t[c]=-d/h),r&&(r[l]=-d*p/h,r[u]=h,r[c]=-p*f/h)},projectVector:function(e,t,r){const n=Ro(t,t);if(0===n)return r[0]=0,r[1]=0,r[2]=0,!1;const o=Ro(e,t)/n;for(let e=0;e<3;e++)r[e]=t[e];return Oo(r,o),!0},projectVector2D:function(e,t,r){const n=Uo(t,t);if(0===n)return r[0]=0,r[1]=0,!1;const o=Uo(e,t)/n;for(let e=0;e<2;e++)r[e]=t[e];return No(r,o),!0},distance2BetweenPoints:Vo,angleBetweenVectors:function(e,t){const r=[0,0,0];return Fo(e,t,r),Math.atan2(Bo(r),Ro(e,t))},gaussianAmplitude:function(e,t,r){const n=Math.abs(e-r);return 1/Math.sqrt(2*Math.PI*t)*Math.exp(-(n**2)/(2*t))},gaussianWeight:function(e,t,r){const n=Math.abs(e-r);return Math.exp(-(n**2)/(2*t))},dot2D:Uo,outer2D:function(e,t,r){r[0]=e[0]*t[0],r[1]=e[0]*t[1],r[2]=e[1]*t[0],r[3]=e[1]*t[1]},norm2D:Go,normalize2D:zo,determinant2x2:jo,LUFactor3x3:function(e,t){let r,n,o;const i=[0,0,0];for(let t=0;t<3;t++)o=Math.abs(e[3*t]),(n=Math.abs(e[3*t+1]))>o&&(o=n),(n=Math.abs(e[3*t+2]))>o&&(o=n),i[t]=1/o;o=i[0]*Math.abs(e[0]),r=0,(n=i[1]*Math.abs(e[3]))>=o&&(o=n,r=1),(n=i[2]*Math.abs(e[6]))>=o&&(r=2),0!==r&&(ho(e,3,r,0),i[r]=i[0]),t[0]=r,e[3]/=e[0],e[6]/=e[0],e[4]-=e[3]*e[1],e[7]-=e[6]*e[1],o=i[1]*Math.abs(e[4]),r=1,(n=i[2]*Math.abs(e[7]))>=o&&(r=2,ho(e,3,1,2),i[2]=i[1]),t[1]=r,e[7]/=e[4],e[5]-=e[3]*e[2],e[8]-=e[6]*e[2]+e[7]*e[5],t[2]=2},LUSolve3x3:function(e,t,r){let n=r[t[0]];r[t[0]]=r[0],r[0]=n,n=r[t[1]],r[t[1]]=r[1],r[1]=n-e[3]*r[0],n=r[t[2]],r[t[2]]=r[2],r[2]=n-e[6]*r[0]-e[7]*r[1],r[2]/=e[8],r[1]=(r[1]-e[5]*r[2])/e[4],r[0]=(r[0]-e[1]*r[1]-e[2]*r[2])/e[0]},linearSolve3x3:function(e,t,r){const n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],p=+jo(s,c,l,d),f=-jo(a,u,l,d),h=+jo(a,u,s,c),m=-jo(o,c,i,d),g=+jo(n,u,i,d),y=-jo(n,u,o,c),v=+jo(o,s,i,l),b=-jo(n,a,i,l),x=+jo(n,a,o,s),_=n*p+o*f+i*h,S=p*t[0]+m*t[1]+v*t[2],C=f*t[0]+g*t[1]+b*t[2],T=h*t[0]+y*t[1]+x*t[2];r[0]=S/_,r[1]=C/_,r[2]=T/_},multiply3x3_vect3:function(e,t,r){const n=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],o=e[3]*t[0]+e[4]*t[1]+e[5]*t[2],i=e[6]*t[0]+e[7]*t[1]+e[8]*t[2];r[0]=n,r[1]=o,r[2]=i},multiply3x3_mat3:Wo,multiplyMatrix:function(e,t,r,n,o,i,a){n!==o&&uo("Number of columns of A must match number of rows of B.");const s=[...e],l=[...t];for(let e=0;e<r;e++)for(let t=0;t<i;t++){a[e*i+t]=0;for(let r=0;r<n;r++)a[e*i+t]+=s[e*n+r]*l[t+i*r]}},transpose3x3:Ho,invert3x3:function(e,t){const r=e[0],n=e[1],o=e[2],i=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],d=+jo(a,u,s,c),p=-jo(i,l,s,c),f=+jo(i,l,a,u),h=-jo(n,u,o,c),m=+jo(r,l,o,c),g=-jo(r,l,n,u),y=+jo(n,a,o,s),v=-jo(r,i,o,s),b=+jo(r,i,n,a),x=r*d+n*p+o*f;0===x&&co("Matrix has 0 determinant"),t[0]=d/x,t[3]=p/x,t[6]=f/x,t[1]=h/x,t[4]=m/x,t[7]=g/x,t[2]=y/x,t[5]=v/x,t[8]=b/x},identity3x3:qo,identity:Yo,isIdentity:function(e){return $o(e,io,arguments.length>1&&void 0!==arguments[1]?arguments[1]:so)},isIdentity3x3:function(e){return $o(e,ao,arguments.length>1&&void 0!==arguments[1]?arguments[1]:so)},determinant3x3:Ko,quaternionToMatrix3x3:Jo,areEquals:Xo,areMatricesEqual:$o,roundNumber:Qo,roundVector:Zo,matrix3x3ToQuaternion:ti,multiplyQuaternion:function(e,t,r){const n=e[0]*t[0],o=e[0]*t[1],i=e[0]*t[2],a=e[0]*t[3],s=e[1]*t[0],l=e[1]*t[1],u=e[1]*t[2],c=e[1]*t[3],d=e[2]*t[0],p=e[2]*t[1],f=e[2]*t[2],h=e[2]*t[3],m=e[3]*t[0],g=e[3]*t[1],y=e[3]*t[2],v=e[3]*t[3];r[0]=n-l-f-v,r[1]=o+s+h-y,r[2]=i-c+d+g,r[3]=a+u-p+m},orthogonalize3x3:ri,diagonalize3x3:ni,singularValueDecomposition3x3:function(e,t,r,n){let o;const i=[...e],a=Ko(i);if(a<0)for(o=0;o<9;o++)i[o]=-i[o];ri(i,t),Ho(i,i),Wo(i,t,n),ni(n,r,n),Wo(t,n,t),Ho(n,n),a<0&&(r[0]=-r[0],r[1]=-r[1],r[2]=-r[2])},solveLinearSystem:ai,invertMatrix:si,luFactorLinearSystem:oi,luSolveLinearSystem:ii,estimateMatrixCondition:function(e,t){let r=+Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let r=0;r<t;r++)for(let o=r;o<t;o++)Math.abs(e[r*t+o])>n&&(n=Math.abs(e[r*t+o]));for(let n=0;n<t;n++)Math.abs(e[n*t+n])<r&&(r=Math.abs(e[n*t+n]));return 0===r?Number.MAX_VALUE:n/r},jacobi:function(e,t,r){return ei(e,3,t,r)},jacobiN:ei,solveHomogeneousLeastSquares:li,solveLeastSquares:function(e,t,r,n,o,i){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];if(e<r||e<o)return co("Insufficient number of samples. Underdetermined."),0;const s=go(o);let l,u,c,d,p=1,f=0,h=0;if(a){for(c=0;c<o;c++)s[c]=1;for(u=0;u<e;u++)for(c=0;c<o;c++)Math.abs(n[u*o+c])>lo&&(p=0,s[c]=0);if(p&&1===o)return co("Detected homogeneous system (Y=0), calling SolveHomogeneousLeastSquares()"),li(e,t,r,i);if(p)h=1;else for(c=0;c<o;c++)s[c]&&(h=1)}h&&(l=go(r),f=li(e,t,r,l));const m=go(r*r),g=go(r*r),y=go(r*o);for(d=0;d<e;d++)for(u=0;u<r;u++){for(c=u;c<r;c++)m[u*r+c]+=t[d*r+u]*t[d*r+c];for(c=0;c<o;c++)y[u*o+c]+=t[d*r+u]*n[d*o+c]}for(u=0;u<r;u++)for(c=0;c<u;c++)m[u*r+c]=m[c*r+u];const v=si(m,g,r);if(v)for(u=0;u<r;u++)for(c=0;c<o;c++)for(i[u*o+c]=0,d=0;d<r;d++)i[u*o+c]+=g[u*r+d]*y[d*o+c];if(h)for(c=0;c<o;c++)if(s[c])for(u=0;u<r;u++)i[u*o+c]=l[u*o];return h?f&&v:v},hex2float:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,.5,1];switch(e.length){case 3:return t[0]=17*parseInt(e[0],16)/255,t[1]=17*parseInt(e[1],16)/255,t[2]=17*parseInt(e[2],16)/255,t;case 4:return t[0]=17*parseInt(e[1],16)/255,t[1]=17*parseInt(e[2],16)/255,t[2]=17*parseInt(e[3],16)/255,t;case 6:return t[0]=parseInt(e.substr(0,2),16)/255,t[1]=parseInt(e.substr(2,2),16)/255,t[2]=parseInt(e.substr(4,2),16)/255,t;case 7:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t;case 9:return t[0]=parseInt(e.substr(1,2),16)/255,t[1]=parseInt(e.substr(3,2),16)/255,t[2]=parseInt(e.substr(5,2),16)/255,t[3]=parseInt(e.substr(7,2),16)/255,t;default:return t}},rgb2hsv:ui,hsv2rgb:ci,lab2xyz:di,xyz2lab:pi,xyz2rgb:fi,rgb2xyz:hi,rgb2lab:mi,lab2rgb:gi,uninitializeBounds:yi,areBoundsInitialized:vi,computeBoundsFromPoints:function(e,t,r){return r[0]=Math.min(e[0],t[0]),r[1]=Math.max(e[0],t[0]),r[2]=Math.min(e[1],t[1]),r[3]=Math.max(e[1],t[1]),r[4]=Math.min(e[2],t[2]),r[5]=Math.max(e[2],t[2]),r},clampValue:bi,clampVector:xi,clampAndNormalizeValue:function(e,t){let r=0;return t[0]!==t[1]&&(r=e<t[0]?t[0]:e>t[1]?t[1]:e,r=(r-t[0])/(t[1]-t[0])),r},getScalarTypeFittingRange:_i,getAdjustedScalarRange:Si,extentIsWithinOtherExtent:function(e,t){if(!e||!t)return 0;for(let r=0;r<6;r+=2)if(e[r]<t[r]||e[r]>t[r+1]||e[r+1]<t[r]||e[r+1]>t[r+1])return 0;return 1},boundsIsWithinOtherBounds:function(e,t,r){if(!e||!t)return 0;for(let n=0;n<6;n+=2)if(e[n]+r[n/2]<t[n]||e[n]-r[n/2]>t[n+1]||e[n+1]+r[n/2]<t[n]||e[n+1]-r[n/2]>t[n+1])return 0;return 1},pointIsWithinBounds:function(e,t,r){if(!e||!t||!r)return 0;for(let n=0;n<3;n++)if(e[n]+r[n]<t[2*n]||e[n]-r[n]>t[2*n+1])return 0;return 1},solve3PointCircle:function(e,t,r,n){const o=go(3),i=go(3),a=go(3),s=go(3),l=go(3),u=go(3);for(let n=0;n<3;++n)o[n]=e[n]-t[n],i[n]=t[n]-r[n],a[n]=r[n]-e[n],s[n]=-o[n],l[n]=-i[n],u[n]=-a[n];const c=Bo(s),d=Bo(l),p=Bo(a),f=go(3);Fo(o,i,f);const h=Bo(f),m=c*d*p/(2*h),g=2*h*h,y=d*d*Ro(o,u)/g,v=p*p*Ro(s,i)/g,b=c*c*Ro(a,l)/g;for(let o=0;o<3;++o)n[o]=y*e[o]+v*t[o]+b*r[o];return m},inf:1/0,negInf:-1/0,isInf:Ci,isNan:wi,isNaN:wi,isFinite:Ti,createUninitializedBounds:Ei,getMajorAxisIndex:function(e){let t=-1,r=-1;for(let n=0;n<e.length;n++){const o=Math.abs(e[n]);o>t&&(r=n,t=o)}return r},getSparseOrthogonalMatrix:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const r=new Array(t),n=new Array(t);for(let e=0;e<t;++e)r[e]=e,n[e]=e;for(let o=t-1;o>0;o--){let i=-1/0,a=0,s=0;for(let l=0;l<=o;++l){const u=r[l];for(let r=0;r<=o;++r){const o=n[r],c=Math.abs(e[u+t*o]);c>i&&(i=c,a=l,s=r)}}[r[o],r[a]]=[r[a],r[o]],[n[o],n[s]]=[n[s],n[o]]}const o=new Array(t*t).fill(0);for(let i=0;i<t;++i){const a=r[i]+t*n[i];o[a]=e[a]<0?-1:1}return o},floatToHex2:Di,floatRGB2HexCode:function(e){return`${arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#"}${e.map(Di).join("")}`},float2CssRGBA:function(e){return 3===e.length?`rgb(${e.map(Pi).join(", ")})`:`rgba(${Pi(e[0]||0)}, ${Pi(e[1]||0)}, ${Pi(e[2]||0)}, ${e[3]||0})`}};function Ni(e,t,r){var n=t[0],o=t[1],i=t[2],a=t[3];return e[0]=r[0]*n+r[4]*o+r[8]*i+r[12]*a,e[1]=r[1]*n+r[5]*o+r[9]*i+r[13]*a,e[2]=r[2]*n+r[6]*o+r[10]*i+r[14]*a,e[3]=r[3]*n+r[7]*o+r[11]*i+r[15]*a,e}function Mi(){var e=new a(4);return a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Ri(e,t,r){r*=.5;var n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Fi(e,t){var r=2*Math.acos(t[3]),n=Math.sin(r/2);return n>i?(e[0]=t[0]/n,e[1]=t[1]/n,e[2]=t[2]/n):(e[0]=1,e[1]=0,e[2]=0),r}function Bi(e,t,r){var n=t[0],o=t[1],i=t[2],a=t[3],s=r[0],l=r[1],u=r[2],c=r[3];return e[0]=n*c+a*s+o*u-i*l,e[1]=o*c+a*l+i*s-n*u,e[2]=i*c+a*u+n*l-o*s,e[3]=a*c-n*s-o*l-i*u,e}function Li(e,t,r,n){var o,a,s,l,u,c=t[0],d=t[1],p=t[2],f=t[3],h=r[0],m=r[1],g=r[2],y=r[3];return(a=c*h+d*m+p*g+f*y)<0&&(a=-a,h=-h,m=-m,g=-g,y=-y),1-a>i?(o=Math.acos(a),s=Math.sin(o),l=Math.sin((1-n)*o)/s,u=Math.sin(n*o)/s):(l=1-n,u=n),e[0]=l*c+u*h,e[1]=l*d+u*m,e[2]=l*p+u*g,e[3]=l*f+u*y,e}Ii=new a(4),a!=Float32Array&&(Ii[0]=0,Ii[1]=0,Ii[2]=0,Ii[3]=0);var ki=function(e,t,r,n){var o=new a(4);return o[0]=e,o[1]=t,o[2]=r,o[3]=n,o};dr(),fr(1,0,0),fr(0,1,0),Mi(),Mi(),ae();const Ui={};function Vi(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ui,r),zt.obj(e,t),zt.setGet(e,t,["transform"]),function(e,t){t.classHierarchy.push("vtkImplicitFunction"),e.functionValue=r=>{if(!t.transform)return e.evaluateFunction(r);const n=[];return t.transform.transformPoint(r,n),e.evaluateFunction(n)},e.evaluateFunction=e=>{zt.vtkErrorMacro("not implemented")}}(e,t)}var Gi={newInstance:zt.newInstance(Vi,"vtkImplicitFunction"),extend:Vi};const zi=1e-6,ji="coincide",Wi="disjoint";function Hi(e,t,r){const n=r[0]*(e[0]-t[0])+r[1]*(e[1]-t[1])+r[2]*(e[2]-t[2]);return Math.abs(n)}function Ki(e,t,r,n){const o=[];Io(e,t,o);const i=Ro(r,o);n[0]=e[0]-i*r[0],n[1]=e[1]-i*r[1],n[2]=e[2]-i*r[2]}function Xi(e,t,r){const n=Ro(e,t);let o=Ro(t,t);return 0===o&&(o=1),r[0]=e[0]-n*t[0]/o,r[1]=e[1]-n*t[1]/o,r[2]=e[2]-n*t[2]/o,r}function $i(e,t,r,n){const o=[];Io(e,t,o);const i=Ro(r,o),a=Ro(r,r);0!==a?(n[0]=e[0]-i*r[0]/a,n[1]=e[1]-i*r[1]/a,n[2]=e[2]-i*r[2]/a):(n[0]=e[0],n[1]=e[1],n[2]=e[2])}function qi(e,t,r,n){const o={intersection:!1,betweenPoints:!1,t:Number.MAX_VALUE,x:[]},i=[],a=[];Io(t,e,i),Io(r,e,a);const s=Ro(n,a),l=Ro(n,i);let u,c;return u=l<0?-l:l,c=s<0?-s*zi:s*zi,u<=c||(o.t=s/l,o.x[0]=e[0]+o.t*i[0],o.x[1]=e[1]+o.t*i[1],o.x[2]=e[2]+o.t*i[2],o.intersection=!0,o.betweenPoints=o.t>=0&&o.t<=1),o}function Yi(e,t,r,n){const o={intersection:!1,l0:[],l1:[],error:null},i=[];Fo(t,n,i);const a=i.map(e=>Math.abs(e));if(a[0]+a[1]+a[2]<zi){const n=[];return Io(e,r,n),0===Ro(t,n)?o.error=ji:o.error=Wi,o}let s;s=a[0]>a[1]&&a[0]>a[2]?"x":a[1]>a[2]?"y":"z";const l=[],u=-Ro(t,e),c=-Ro(n,r);switch(s){case"x":l[0]=0,l[1]=(c*t[2]-u*n[2])/i[0],l[2]=(u*n[1]-c*t[1])/i[0];break;case"y":l[0]=(u*n[2]-c*t[2])/i[1],l[1]=0,l[2]=(c*t[0]-u*n[0])/i[1];break;case"z":l[0]=(c*t[1]-u*n[1])/i[2],l[1]=(u*n[0]-c*t[0])/i[2],l[2]=0}return o.l0=l,Po(l,i,o.l1),o.intersection=!0,o}const Ji={evaluate:function(e,t,r){return e[0]*(r[0]-t[0])+e[1]*(r[1]-t[1])+e[2]*(r[2]-t[2])},distanceToPlane:Hi,projectPoint:Ki,projectVector:Xi,generalizedProjectPoint:$i,intersectWithLine:qi,intersectWithPlane:Yi,DISJOINT:Wi,COINCIDE:ji},Qi={normal:[0,0,1],origin:[0,0,0]};function Zi(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qi,r),Gi.extend(e,t,r),zt.setGetArray(e,t,["normal","origin"],3),function(e,t){t.classHierarchy.push("vtkPlane"),e.distanceToPlane=e=>Hi(e,t.origin,t.normal),e.projectPoint=(e,r)=>{Ki(e,t.origin,t.normal,r)},e.projectVector=(e,r)=>Xi(e,t.normal,r),e.push=e=>{if(0!==e)for(let r=0;r<3;r++)t.origin[r]+=e*t.normal[r]},e.generalizedProjectPoint=(e,r)=>{$i(e,t.origin,t.normal,r)},e.evaluateFunction=(e,r,n)=>Array.isArray(e)?t.normal[0]*(e[0]-t.origin[0])+t.normal[1]*(e[1]-t.origin[1])+t.normal[2]*(e[2]-t.origin[2]):t.normal[0]*(e-t.origin[0])+t.normal[1]*(r-t.origin[1])+t.normal[2]*(n-t.origin[2]),e.evaluateGradient=e=>[t.normal[0],t.normal[1],t.normal[2]],e.intersectWithLine=(e,r)=>qi(e,r,t.origin,t.normal),e.intersectWithPlane=(e,r)=>Yi(e,r,t.origin,t.normal)}(e,t)}var ea={newInstance:zt.newInstance(Zi,"vtkPlane"),extend:Zi,...Ji};const ta=[Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE];function ra(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function na(e){return e?.length>=6&&e[0]<=e[1]&&e[2]<=e[3]&&e[4]<=e[5]}function oa(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function ia(e){return oa(e,ta)}function aa(e,t,r,n){const[o,i,a,s,l,u]=e;return e[0]=o<t?o:t,e[1]=i>t?i:t,e[2]=a<r?a:r,e[3]=s>r?s:r,e[4]=l<n?l:n,e[5]=u>n?u:n,e}function sa(e,t){if(0===t.length)return e;if(Array.isArray(t[0]))for(let r=0;r<t.length;++r)aa(e,...t[r]);else for(let r=0;r<t.length;r+=3)aa(e,...t.slice(r,r+3));return e}function la(e,t,r,n,o,i,a){const[s,l,u,c,d,p]=e;return void 0===a?(e[0]=Math.min(t[0],s),e[1]=Math.max(t[1],l),e[2]=Math.min(t[2],u),e[3]=Math.max(t[3],c),e[4]=Math.min(t[4],d),e[5]=Math.max(t[5],p)):(e[0]=Math.min(t,s),e[1]=Math.max(r,l),e[2]=Math.min(n,u),e[3]=Math.max(o,c),e[4]=Math.min(i,d),e[5]=Math.max(a,p)),e}function ua(e,t,r,n){const[o,i,a,s,l,u]=e;return e[0]=t,e[1]=t>i?t:i,e[2]=r,e[3]=r>s?r:s,e[4]=n,e[5]=n>u?n:u,o!==t||a!==r||l!==n}function ca(e,t,r,n){const[o,i,a,s,l,u]=e;return e[0]=t<o?t:o,e[1]=t,e[2]=r<a?r:a,e[3]=r,e[4]=n<l?n:l,e[5]=n,i!==t||s!==r||u!==n}function da(e,t){return null==t?function(e){const t=[0,0,0];let r=-1,n=0,o=0;for(let i=0;i<3;++i)o=e[2*i+1]-e[2*i],o>n&&(n=o,r=i),t[i]=o>0?1:0;if(r<0)return da(e,.5);for(let r=0;r<3;++r)if(!t[r]){const t=.005*n;e[2*r]-=t,e[2*r+1]+=t}return e}(e):(e[0]-=t,e[1]+=t,e[2]-=t,e[3]+=t,e[4]-=t,e[5]+=t,e)}function pa(e,t,r,n){return!!na(e)&&(t>=0?(e[0]*=t,e[1]*=t):(e[0]=t*e[1],e[1]=t*e[0]),r>=0?(e[2]*=r,e[3]*=r):(e[2]=r*e[3],e[3]=r*e[2]),n>=0?(e[4]*=n,e[5]*=n):(e[4]=n*e[5],e[5]=n*e[4]),!0)}function fa(e){return[.5*(e[0]+e[1]),.5*(e[2]+e[3]),.5*(e[4]+e[5])]}function ha(e,t){return e[2*t+1]-e[2*t]}function ma(e){return[ha(e,0),ha(e,1),ha(e,2)]}function ga(e){return e.slice(0,2)}function ya(e){return e.slice(2,4)}function va(e){return e.slice(4,6)}function ba(e){const t=ma(e);return t[0]>t[1]?t[0]>t[2]?t[0]:t[2]:t[1]>t[2]?t[1]:t[2]}function xa(e){if(na(e)){const t=ma(e);return t[0]*t[0]+t[1]*t[1]+t[2]*t[2]}return null}function _a(e){const t=xa(e);return null!==t?Math.sqrt(t):null}function Sa(e){return[e[0],e[2],e[4]]}function Ca(e){return[e[1],e[3],e[5]]}function Ta(e,t){return e<=0&&t>=0||e>=0&&t<=0}function wa(e,t){return t[0]=[e[0],e[2],e[4]],t[1]=[e[0],e[2],e[5]],t[2]=[e[0],e[3],e[4]],t[3]=[e[0],e[3],e[5]],t[4]=[e[1],e[2],e[4]],t[5]=[e[1],e[2],e[5]],t[6]=[e[1],e[3],e[4]],t[7]=[e[1],e[3],e[5]],t}function Aa(e,t,r){return t[0]=e[0],t[1]=e[2],t[2]=e[4],r[0]=e[1],r[1]=e[3],r[2]=e[5],t}function Ea(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=wa(e,[]);for(let e=0;e<n.length;++e)Sr(n[e],n[e],t);return ia(r),sa(r,n)}function Da(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t[0]=.5*(e[1]-e[0]),t[1]=.5*(e[3]-e[2]),t[2]=.5*(e[5]-e[4]),t}function Pa(e,t,r,n){const o=[].concat(ta),i=e.getData();for(let e=0;e<i.length;e+=3){const a=[i[e],i[e+1],i[e+2]],s=Ro(a,t);o[0]=Math.min(s,o[0]),o[1]=Math.max(s,o[1]);const l=Ro(a,r);o[2]=Math.min(l,o[2]),o[3]=Math.max(l,o[3]);const u=Ro(a,n);o[4]=Math.min(u,o[4]),o[5]=Math.max(u,o[5])}return o}function Ia(e,t,r,n,o){let i=!0;const a=[];let s=0;const l=[],u=[0,0,0];for(let r=0;r<3;r++)t[r]<e[2*r]?(a[r]=1,u[r]=e[2*r],i=!1):t[r]>e[2*r+1]?(a[r]=0,u[r]=e[2*r+1],i=!1):a[r]=2;if(i)return n[0]=t[0],n[1]=t[1],n[2]=t[2],o[0]=0,1;for(let e=0;e<3;e++)2!==a[e]&&0!==r[e]?l[e]=(u[e]-t[e])/r[e]:l[e]=-1;for(let e=0;e<3;e++)l[s]<l[e]&&(s=e);if(l[s]>1||l[s]<0)return 0;o[0]=l[s];for(let o=0;o<3;o++)if(s!==o){if(n[o]=t[o]+l[s]*r[o],n[o]<e[2*o]||n[o]>e[2*o+1])return 0}else n[o]=u[o];return 1}function Oa(e,t,r){const n=[];let o=0,i=1,a=1;for(let s=4;s<=5;++s){n[2]=e[s];for(let s=2;s<=3;++s){n[1]=e[s];for(let s=0;s<=1;++s)if(n[0]=e[s],o=ea.evaluate(r,t,n),a&&(i=o>=0?1:-1,a=0),0===o||i>0&&o<0||i<0&&o>0)return 1}}return 0}function Na(e,t){if(!na(e)||!na(t))return!1;const r=[0,0,0,0,0,0];let n;for(let o=0;o<3;o++)if(n=!1,t[2*o]>=e[2*o]&&t[2*o]<=e[2*o+1]?(n=!0,r[2*o]=t[2*o]):e[2*o]>=t[2*o]&&e[2*o]<=t[2*o+1]&&(n=!0,r[2*o]=e[2*o]),t[2*o+1]>=e[2*o]&&t[2*o+1]<=e[2*o+1]?(n=!0,r[2*o+1]=t[2*o+1]):e[2*o+1]>=t[2*o]&&e[2*o+1]<=t[2*o+1]&&(n=!0,r[2*o+1]=e[2*o+1]),!n)return!1;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],!0}function Ma(e,t){if(!na(e)||!na(t))return!1;for(let r=0;r<3;r++)if(!(t[2*r]>=e[2*r]&&t[2*r]<=e[2*r+1]||e[2*r]>=t[2*r]&&e[2*r]<=t[2*r+1]||t[2*r+1]>=e[2*r]&&t[2*r+1]<=e[2*r+1]||e[2*r+1]>=t[2*r]&&e[2*r+1]<=t[2*r+1]))return!1;return!0}function Ra(e,t,r,n){return!(t<e[0]||t>e[1]||r<e[2]||r>e[3]||n<e[4]||n>e[5])}function Fa(e,t,r){const n=[[0,1,2,3,4,5,6,7],[0,1,4,5,2,3,6,7],[0,2,4,6,1,3,5,7]],o=[0,0,0,0,0,0,0,0];let i=0;for(let n=0;n<2;n++)for(let a=2;a<4;a++)for(let s=4;s<6;s++){const l=[e[n],e[a],e[s]];o[i++]=ea.evaluate(r,t,l)}let a=2;for(;a--&&!(Ta(o[n[a][0]],o[n[a][4]])&&Ta(o[n[a][1]],o[n[a][5]])&&Ta(o[n[a][2]],o[n[a][6]])&&Ta(o[n[a][3]],o[n[a][7]])););if(a<0)return!1;const s=Math.sign(r[a]),l=Math.abs((e[2*a+1]-e[2*a])*r[a]);let u=s>0?1:0;for(let e=0;e<4;e++){if(0===l)continue;const t=Math.abs(o[n[a][e]])/l;s>0&&t<u&&(u=t),s<0&&t>u&&(u=t)}const c=(1-u)*e[2*a]+u*e[2*a+1];return s>0?e[2*a]=c:e[2*a+1]=c,!0}function Ba(e,t){for(let e=0;e<3;++e)t[e]=t[e]<1?1:t[e];let r=t[0]*t[1]*t[2];for(;r>e;){for(let e=0;e<3;++e)t[e]=t[e]>1?t[e]-1:1;r=t[0]*t[1]*t[2]}}function La(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];t=t<=0?1:t;let o=0;const i=[0,0,0];let a=-1,s=0;const l=ma(e),u=l[0]+l[1]+l[2],c=u*(.001/3);for(let e=0;e<3;++e)l[e]>s&&(a=e,s=l[e]),l[e]>c?(i[e]=1,o++):i[e]=0;const d=Sa(e),p=Ca(e);if(o<1)return r[0]=1,r[1]=1,r[2]=1,n[0]=d[0]-.5,n[1]=p[0]+.5,n[2]=d[1]-.5,n[3]=p[1]+.5,n[4]=d[2]-.5,n[5]=p[2]+.5,1;let f=t;f/=i[0]?l[0]/u:1,f/=i[1]?l[1]/u:1,f/=i[2]?l[2]/u:1,f**=1/o;for(let e=0;e<3;++e)r[e]=i[e]?Math.floor(f*l[e]/u):1,r[e]=r[e]<1?1:r[e];Ba(t,r);const h=.5*l[a]/r[a];for(let e=0;e<3;++e)i[e]?(n[2*e]=d[e],n[2*e+1]=p[e]):(n[2*e]=d[e]-h,n[2*e+1]=p[e]+h);return r[0]*r[1]*r[2]}function ka(e,t){if(e[0]>=t[0]&&e[0]<=t[1]&&e[1]>=t[2]&&e[1]<=t[3]&&e[2]>=t[4]&&e[2]<=t[5])return 0;const r=[0,0,0];return e[0]<t[0]?r[0]=t[0]-e[0]:e[0]>t[1]&&(r[0]=e[0]-t[1]),e[1]<t[2]?r[1]=t[2]-e[1]:e[1]>t[3]&&(r[1]=e[1]-t[3]),e[2]<t[4]?r[2]=t[4]-e[2]:e[2]>t[5]&&(r[2]=e[2]-t[5]),Ro(r,r)}class Ua{constructor(e){this.bounds=e,this.bounds||(this.bounds=new Float64Array(ta))}getBounds(){return this.bounds}equals(e){return ra(this.bounds,e)}isValid(){return na(this.bounds)}setBounds(e){return oa(this.bounds,e)}reset(){return ia(this.bounds)}addPoint(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return aa(this.bounds,...t)}addPoints(e){return sa(this.bounds,e)}addBounds(e,t,r,n,o,i){return la(this.bounds,e,t,r,n,o,i)}setMinPoint(e,t,r){return ua(this.bounds,e,t,r)}setMaxPoint(e,t,r){return ca(this.bounds,e,t,r)}inflate(e){return da(this.bounds,e)}scale(e,t,r){return pa(this.bounds,e,t,r)}getCenter(){return fa(this.bounds)}getLength(e){return ha(this.bounds,e)}getLengths(){return ma(this.bounds)}getMaxLength(){return ba(this.bounds)}getDiagonalLength(){return _a(this.bounds)}getDiagonalLength2(){return xa(this.bounds)}getMinPoint(){return Sa(this.bounds)}getMaxPoint(){return Ca(this.bounds)}getXRange(){return ga(this.bounds)}getYRange(){return ya(this.bounds)}getZRange(){return va(this.bounds)}getCorners(e){return wa(this.bounds,e)}computeCornerPoints(e,t){return Aa(this.bounds,e,t)}computeLocalBounds(e,t,r){return Pa(this.bounds,e,t,r)}transformBounds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Ea(this.bounds,e,t)}computeScale3(e){return Da(this.bounds,e)}cutWithPlane(e,t){return Fa(this.bounds,e,t)}intersectBox(e,t,r,n){return Ia(this.bounds,e,t,r,n)}intersectPlane(e,t){return Oa(this.bounds,e,t)}intersect(e){return Na(this.bounds,e)}intersects(e){return Ma(this.bounds,e)}containsPoint(e,t,r){return Ra(this.bounds,e,t,r)}contains(e){return Ma(this.bounds,e)}computeDivisions(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return La(this.bounds,e,t,r)}distance2ToBounds(e){return ka(e,this.bounds)}}var Va={newInstance:function(e){const t=e&&e.bounds;return new Ua(t)},equals:ra,isValid:na,setBounds:oa,reset:ia,addPoint:aa,addPoints:sa,addBounds:la,setMinPoint:ua,setMaxPoint:ca,inflate:da,scale:pa,scaleAboutCenter:function(e,t,r,n){if(!na(e))return!1;const o=fa(e);return e[0]-=o[0],e[1]-=o[0],e[2]-=o[1],e[3]-=o[1],e[4]-=o[2],e[5]-=o[2],pa(e,t,r,n),e[0]+=o[0],e[1]+=o[0],e[2]+=o[1],e[3]+=o[1],e[4]+=o[2],e[5]+=o[2],!0},getCenter:fa,getLength:ha,getLengths:ma,getMaxLength:ba,getDiagonalLength:_a,getDiagonalLength2:xa,getMinPoint:Sa,getMaxPoint:Ca,getXRange:ga,getYRange:ya,getZRange:va,getCorners:wa,computeCornerPoints:Aa,computeLocalBounds:Pa,transformBounds:Ea,computeScale3:Da,cutWithPlane:Fa,intersectBox:Ia,intersectPlane:Oa,intersect:Na,intersects:Ma,containsPoint:Ra,contains:function(e,t){return!!Ma(e,t)&&!!Ra(e,...Sa(t))&&!!Ra(e,...Ca(t))},computeDivisions:La,clampDivisions:Ba,distance2ToBounds:ka,INIT_BOUNDS:ta},Ga={CoordinateSystem:{DISPLAY:0,WORLD:1}};const{CoordinateSystem:za}=Ga;function ja(e){return()=>zt.vtkErrorMacro(`vtkProp::${e} - NOT IMPLEMENTED`)}const Wa={allocatedRenderTime:10,coordinateSystem:za.WORLD,dragable:!0,estimatedRenderTime:0,paths:null,pickable:!0,renderTimeMultiplier:1,savedEstimatedRenderTime:0,textures:[],useBounds:!0,visibility:!0};function Ha(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Wa,r),zt.obj(e,t),zt.get(e,t,["estimatedRenderTime","allocatedRenderTime"]),zt.setGet(e,t,["_parentProp","coordinateSystem","dragable","pickable","renderTimeMultiplier","useBounds","visibility"]),zt.moveToProtected(e,t,["parentProp"]),function(e,t){t.classHierarchy.push("vtkProp"),e.getMTime=()=>{let e=t.mtime;for(let r=0;r<t.textures.length;++r){const n=t.textures[r].getMTime();n>e&&(e=n)}return e},e.processSelectorPixelBuffers=(e,t)=>{},e.getNestedProps=()=>null,e.getActors=()=>[],e.getActors2D=()=>[],e.getVolumes=()=>[],e.pick=ja("pick"),e.hasKey=ja("hasKey"),e.getNestedVisibility=()=>t.visibility&&(!t._parentProp||t._parentProp.getNestedVisibility()),e.getNestedPickable=()=>t.pickable&&(!t._parentProp||t._parentProp.getNestedPickable()),e.getNestedDragable=()=>t.dragable&&(!t._parentProp||t._parentProp.getNestedDragable()),e.getRedrawMTime=()=>t.mtime,e.setEstimatedRenderTime=e=>{t.estimatedRenderTime=e,t.savedEstimatedRenderTime=e},e.restoreEstimatedRenderTime=()=>{t.estimatedRenderTime=t.savedEstimatedRenderTime},e.addEstimatedRenderTime=e=>{t.estimatedRenderTime+=e},e.setAllocatedRenderTime=e=>{t.allocatedRenderTime=e,t.savedEstimatedRenderTime=t.estimatedRenderTime,t.estimatedRenderTime=0},e.getSupportsSelection=()=>!1,e.getTextures=()=>t.textures,e.hasTexture=e=>-1!==t.textures.indexOf(e),e.addTexture=r=>{r&&!e.hasTexture(r)&&(t.textures=t.textures.concat(r),e.modified())},e.removeTexture=r=>{const n=t.textures.filter(e=>e!==r);t.textures.length!==n.length&&(t.textures=n,e.modified())},e.removeAllTextures=()=>{t.textures=[],e.modified()},e.setCoordinateSystemToWorld=()=>e.setCoordinateSystem(za.WORLD),e.setCoordinateSystemToDisplay=()=>e.setCoordinateSystem(za.DISPLAY)}(e,t)}var Ka={newInstance:zt.newInstance(Ha,"vtkProp"),extend:Ha,...Ga};const Xa={origin:[0,0,0],position:[0,0,0],orientation:[0,0,0],rotation:null,scale:[1,1,1],bounds:[...Va.INIT_BOUNDS],properties:[],userMatrix:null,userMatrixMTime:null,cachedProp3D:null,isIdentity:!0,matrixMTime:null};function $a(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xa,r),Ka.extend(e,t,r),t.matrixMTime={},zt.obj(t.matrixMTime),zt.get(e,t,["isIdentity"]),zt.getArray(e,t,["orientation"]),zt.setGetArray(e,t,["origin","position","scale"],3),zt.setGet(e,t,["properties"]),t.matrix=h(new Float64Array(16)),t.rotation=h(new Float64Array(16)),t.userMatrix=h(new Float64Array(16)),t.transform=null,function(e,t){t.classHierarchy.push("vtkProp3D"),e.addPosition=r=>{t.position=t.position.map((e,t)=>e+r[t]),e.modified()},e.getOrientationWXYZ=()=>{const e=Mi();B(e,t.rotation);const r=new Float64Array(3);return[vo(Fi(r,e)),r[0],r[1],r[2]]},e.getOrientationQuaternion=function(){return B(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t.rotation)},e.rotateX=r=>{0!==r&&(C(t.rotation,t.rotation,yo(r)),e.modified())},e.rotateY=r=>{0!==r&&(T(t.rotation,t.rotation,yo(r)),e.modified())},e.rotateZ=r=>{0!==r&&(w(t.rotation,t.rotation,yo(r)),e.modified())},e.rotateWXYZ=(r,n,o,i)=>{if(0===r||0===n&&0===o&&0===i)return;const a=yo(r),s=Mi();Ri(s,[n,o,i],a);const l=new Float64Array(16);U(l,s),b(t.rotation,t.rotation,l),e.modified()},e.rotateQuaternion=r=>{if(Math.abs(r[3])>=.999999)return;const n=U(new Float64Array(16),r);b(t.rotation,t.rotation,n),e.modified()},e.setOrientation=(r,n,o)=>(r!==t.orientation[0]||n!==t.orientation[1]||o!==t.orientation[2])&&(t.orientation=[r,n,o],h(t.rotation),e.rotateZ(o),e.rotateX(r),e.rotateY(n),e.modified(),!0),e.setOrientationFromQuaternion=r=>{const n=u();return U(n,r),!$o(n,t.rotation)&&(t.rotation=n,e.modified(),!0)},e.setUserMatrix=r=>!$o(t.userMatrix,r)&&(d(t.userMatrix,r),e.modified(),!0),e.getMatrix=()=>(e.computeMatrix(),t.matrix),e.computeMatrix=()=>{if(e.getMTime()>t.matrixMTime.getMTime()){h(t.matrix),t.userMatrix&&b(t.matrix,t.matrix,t.userMatrix),x(t.matrix,t.matrix,t.origin),x(t.matrix,t.matrix,t.position),b(t.matrix,t.matrix,t.rotation),_(t.matrix,t.matrix,t.scale),x(t.matrix,t.matrix,[-t.origin[0],-t.origin[1],-t.origin[2]]),m(t.matrix,t.matrix),t.isIdentity=!0;for(let e=0;e<4;++e)for(let r=0;r<4;++r)(e===r?1:0)!==t.matrix[e+4*r]&&(t.isIdentity=!1);t.matrixMTime.modified()}},e.getBoundsByReference=()=>{if(null===t.mapper)return t.bounds;const r=t.mapper.getBounds();if(!r||6!==r.length)return r;if(r[0]>r[1])return t.mapperBounds=r,t.bounds=[...Va.INIT_BOUNDS],t.boundsMTime.modified(),r;if(!t.mapperBounds||!r.every((e,n)=>r[n]===t.mapperBounds[n])||e.getMTime()>t.boundsMTime.getMTime()){zt.vtkDebugMacro("Recomputing bounds..."),t.mapperBounds=r,e.computeMatrix();const n=new Float64Array(16);m(n,t.matrix),Va.transformBounds(r,n,t.bounds),t.boundsMTime.modified()}return t.bounds},e.getBounds=()=>{const t=e.getBoundsByReference();try{return[...t]}catch{return t}},e.getCenter=()=>Va.getCenter(t.bounds),e.getLength=()=>Va.getLength(t.bounds),e.getXRange=()=>Va.getXRange(t.bounds),e.getYRange=()=>Va.getYRange(t.bounds),e.getZRange=()=>Va.getZRange(t.bounds),e.getUserMatrix=()=>t.userMatrix,e.onModified(function(){e.computeMatrix()}),e.getProperty=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null==t.properties[r]&&(t.properties[r]=e.makeProperty?.()),t.properties[r]},e.getProperties=()=>(0===t.properties.length&&(t.properties[0]=e.makeProperty?.()),t.properties),e.setProperty=(e,r)=>{const n=Number.isInteger(e),[o,i]=n?[e,r]:[0,e];return t.properties[o]!==i&&(t.properties[o]=i,!0)},e.getMTime=()=>{let e=t.mtime;return t.properties.forEach(t=>{if(null!==t){const r=t.getMTime();e=r>e?r:e}}),e}}(e,t)}var qa={newInstance:zt.newInstance($a,"vtkProp3D"),extend:$a};const Ya={FLAT:0,GOURAUD:1,PHONG:2},Ja={POINTS:0,WIREFRAME:1,SURFACE:2};var Qa={Shading:Ya,Representation:Ja,Interpolation:Ya};const{Representation:Za,Interpolation:es}=Qa;function ts(e){return()=>zt.vtkErrorMacro(`vtkProperty::${e} - NOT IMPLEMENTED`)}const rs={color:[1,1,1],ambientColor:[1,1,1],diffuseColor:[1,1,1],specularColor:[1,1,1],edgeColor:[0,0,0],ambient:0,diffuse:1,metallic:0,roughness:.6,normalStrength:1,emission:1,baseIOR:1.45,specular:0,specularPower:1,opacity:1,interpolation:es.GOURAUD,representation:Za.SURFACE,edgeVisibility:!1,backfaceCulling:!1,frontfaceCulling:!1,pointSize:1,lineWidth:1,lighting:!0,shading:!1,materialName:null,ORMTexture:null,RMTexture:null};function ns(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rs,r),zt.obj(e,t),zt.setGet(e,t,["lighting","interpolation","ambient","diffuse","metallic","roughness","normalStrength","emission","baseIOR","specular","specularPower","opacity","edgeVisibility","lineWidth","pointSize","backfaceCulling","frontfaceCulling","representation","diffuseTexture","metallicTexture","roughnessTexture","normalTexture","ambientOcclusionTexture","emissionTexture","ORMTexture","RMTexture"]),zt.setGetArray(e,t,["ambientColor","specularColor","diffuseColor","edgeColor"],3),function(e,t){t.classHierarchy.push("vtkProperty"),e.setColor=(r,n,o)=>{Array.isArray(r)?t.color[0]===r[0]&&t.color[1]===r[1]&&t.color[2]===r[2]||(t.color[0]=r[0],t.color[1]=r[1],t.color[2]=r[2],e.modified()):t.color[0]===r&&t.color[1]===n&&t.color[2]===o||(t.color[0]=r,t.color[1]=n,t.color[2]=o,e.modified()),e.setDiffuseColor(t.color),e.setAmbientColor(t.color),e.setSpecularColor(t.color)},e.computeCompositeColor=ts("ComputeCompositeColor"),e.getColor=()=>{let e=0;t.ambient+t.diffuse+t.specular>0&&(e=1/(t.ambient+t.diffuse+t.specular));for(let r=0;r<3;r++)t.color[r]=e*(t.ambient*t.ambientColor[r]+t.diffuse*t.diffuseColor[r]+t.specular*t.specularColor[r]);return[].concat(t.color)},e.setSpecularPower=r=>{const n=1/Math.max(1,r);t.roughness===n&&t.specularPower===r||(t.specularPower=r,t.roughness=n,e.modified())},e.addShaderVariable=ts("AddShaderVariable"),e.setInterpolationToFlat=()=>e.setInterpolation(es.FLAT),e.setInterpolationToGouraud=()=>e.setInterpolation(es.GOURAUD),e.setInterpolationToPhong=()=>e.setInterpolation(es.PHONG),e.getInterpolationAsString=()=>zt.enumToString(es,t.interpolation),e.setRepresentationToWireframe=()=>e.setRepresentation(Za.WIREFRAME),e.setRepresentationToSurface=()=>e.setRepresentation(Za.SURFACE),e.setRepresentationToPoints=()=>e.setRepresentation(Za.POINTS),e.getRepresentationAsString=()=>zt.enumToString(Za,t.representation)}(e,t)}var os={newInstance:zt.newInstance(ns,"vtkProperty"),extend:ns,...Qa};const is={mapper:null,backfaceProperty:null,forceOpaque:!1,forceTranslucent:!1};function as(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,is,r),qa.extend(e,t,r),t.boundsMTime={},zt.obj(t.boundsMTime),zt.setGet(e,t,["backfaceProperty","forceOpaque","forceTranslucent","mapper"]),function(e,t){t.classHierarchy.push("vtkActor");const r={...e};e.getActors=()=>[e],e.getIsOpaque=()=>{if(t.forceOpaque)return!0;if(t.forceTranslucent)return!1;t.properties[0]||e.getProperty();let r=t.properties[0].getOpacity()>=1;return r=r&&(!t.texture||!t.texture.isTranslucent()),r=r&&(!t.mapper||t.mapper.getIsOpaque()),r},e.hasTranslucentPolygonalGeometry=()=>null!==t.mapper&&(t.properties[0]||e.getProperty(),!e.getIsOpaque()),e.makeProperty=os.newInstance,e.getMTime=()=>{let e=r.getMTime();if(null!==t.backfaceProperty){const r=t.backfaceProperty.getMTime();e=r>e?r:e}return e},e.getRedrawMTime=()=>{let e=t.mtime;if(null!==t.mapper){let r=t.mapper.getMTime();e=r>e?r:e,null!==t.mapper.getInput()&&(t.mapper.getInputAlgorithm().update(),r=t.mapper.getInput().getMTime(),e=r>e?r:e)}return e},e.getSupportsSelection=()=>!!t.mapper&&t.mapper.getSupportsSelection(),e.processSelectorPixelBuffers=(e,r)=>{t.mapper&&t.mapper.processSelectorPixelBuffers&&t.mapper.processSelectorPixelBuffers(e,r)}}(e,t)}var ss={newInstance:zt.newInstance(as,"vtkActor"),extend:as};const ls={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},us={VOID:"",CHAR:"Int8Array",SIGNED_CHAR:"Int8Array",UNSIGNED_CHAR:"Uint8Array",UNSIGNED_CHAR_CLAMPED:"Uint8ClampedArray",SHORT:"Int16Array",UNSIGNED_SHORT:"Uint16Array",INT:"Int32Array",UNSIGNED_INT:"Uint32Array",FLOAT:"Float32Array",DOUBLE:"Float64Array"};var cs={DefaultDataType:us.FLOAT,DataTypeByteSize:ls,VtkDataTypes:us};const{vtkErrorMacro:ds}=jt,{DefaultDataType:ps}=cs;function fs(e,t,r){const n=e.length;let o,i,a=Number.MAX_VALUE,s=-Number.MAX_VALUE;for(i=t;i<n;i+=r)if(!Number.isNaN(e[i])){a=e[i],s=a;break}for(;i<n;i+=r)o=e[i],o<a?a=o:o>s&&(s=o);return{min:a,max:s}}function hs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(t<0&&r>1){const t=e.length/r,n=new Float64Array(t);for(let o=0,i=0;o<t;++o){for(let t=i+r;i<t;++i)n[o]+=e[i]*e[i];n[o]**=.5}return fs(n,0,1)}return fs(e,t<0?0:t,r)}function ms(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=e||[];for(;r.length<=t;)r.push(null);return r}function gs(e){return Object.prototype.toString.call(e).slice(8,-1)}const ys={computeRange:hs,createRangeHelper:function(){let e=Number.MAX_VALUE,t=-Number.MAX_VALUE,r=0,n=0;return{add(o){e>o&&(e=o),t<o&&(t=o),r++,n+=o},get:()=>({min:e,max:t,count:r,sum:n,mean:n/r}),getRange:()=>({min:e,max:t})}},fastComputeRange:fs,getDataType:gs,getMaxNorm:function(e){const t=e.getNumberOfComponents();let r=0;const n=new Array(t);for(let o=0;o<e.getNumberOfTuples();++o){e.getTuple(o,n);const i=Bo(n,t);i>r&&(r=i)}return r}},vs={name:"",numberOfComponents:1,dataType:ps,rangeTuple:[0,0]};function bs(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,vs,r),Array.isArray(r.values)&&void 0===r.dataType&&console.warn("vtkDataArray.newInstance: no dataType provided, converting to Float32Array"),!t.empty&&!t.values&&!t.size)throw new TypeError("Cannot create vtkDataArray object without: size > 0, values");if(t.values?Array.isArray(t.values)&&(t.values=it(t.dataType,t.values)):t.values=ot(t.dataType,t.size),t.values&&(t.size=t.size??t.values.length,t.dataType=gs(t.values)),mt(e,t),xt(e,t,["name","numberOfComponents"]),t.size%t.numberOfComponents!==0)throw new RangeError("model.size is not a multiple of model.numberOfComponents");!function(e,t){function r(r){if(r<0)return!1;const n=e.getNumberOfComponents(),o=t.values.length/(n>0?n:1);if(r===o)return!0;if(r>o){const e=t.values;return t.values=ot(t.dataType,(r+o)*n),t.values.set(e),!0}return t.size>r*n&&(t.size=r*n,e.dataChange()),!0}t.classHierarchy.push("vtkDataArray"),e.dataChange=()=>{t.ranges=null,e.modified()},e.allocate=t=>{r(e.getNumberOfTuples()+t)},e.resize=n=>{r(n);const o=n*e.getNumberOfComponents();return t.size!==o&&(t.size=o,e.dataChange(),!0)},e.initialize=()=>(e.resize(0),e),e.getElementComponentSize=()=>t.values.BYTES_PER_ELEMENT,e.getComponent=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+r]},e.setComponent=(r,n,o)=>{o!==t.values[r*t.numberOfComponents+n]&&(t.values[r*t.numberOfComponents+n]=o,e.dataChange())},e.getValue=r=>{const n=r/t.numberOfComponents,o=r%t.numberOfComponents;return e.getComponent(n,o)},e.setValue=(r,n)=>{const o=r/t.numberOfComponents,i=r%t.numberOfComponents;e.setComponent(o,i,n)},e.getData=()=>t.size===t.values.length?t.values:t.values.subarray(0,t.size),e.getRange=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=r;n<0&&(n=1===t.numberOfComponents?0:t.numberOfComponents);let o=null;return t.ranges||(t.ranges=ms(t.ranges,t.numberOfComponents)),o=t.ranges[n],o?(t.rangeTuple[0]=o.min,t.rangeTuple[1]=o.max,t.rangeTuple):(o=hs(e.getData(),r,t.numberOfComponents),t.ranges[n]=o,t.rangeTuple[0]=o.min,t.rangeTuple[1]=o.max,t.rangeTuple)},e.setRange=(e,r)=>{t.ranges||(t.ranges=ms(t.ranges,t.numberOfComponents));const n={min:e.min,max:e.max};return t.ranges[r]=n,t.rangeTuple[0]=n.min,t.rangeTuple[1]=n.max,t.rangeTuple},e.getRanges=function(){if(arguments.length>0&&void 0!==arguments[0]&&!arguments[0])return structuredClone(t.ranges);const r=[];for(let n=0;n<t.numberOfComponents;n++){const[t,o]=e.getRange(n),i={min:t,max:o};r.push(i)}if(t.numberOfComponents>1){const[t,n]=e.getRange(-1),o={min:t,max:n};r.push(o)}return r},e.setTuple=(e,r)=>{const n=e*t.numberOfComponents;for(let e=0;e<t.numberOfComponents;e++)t.values[n+e]=r[e]},e.setTuples=(e,r)=>{let n=e*t.numberOfComponents;const o=Math.min(r.length,t.size-n);for(let e=0;e<o;)t.values[n++]=r[e++]},e.insertTuple=(n,o)=>(t.size<=n*t.numberOfComponents&&(t.size=(n+1)*t.numberOfComponents,r(n+1)),e.setTuple(n,o),n),e.insertTuples=(n,o)=>{const i=n+o.length/t.numberOfComponents;return t.size<i*t.numberOfComponents&&(t.size=i*t.numberOfComponents,r(i)),e.setTuples(n,o),i},e.insertNextTuple=r=>{const n=t.size/t.numberOfComponents;return e.insertTuple(n,r)},e.insertNextTuples=r=>{const n=t.size/t.numberOfComponents;return e.insertTuples(n,r)},e.findTuple=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-6;for(let n=0;n<t.size;n+=t.numberOfComponents)if(Math.abs(e[0]-t.values[n])<=r){let o=!0;for(let i=1;i<t.numberOfComponents;++i)if(Math.abs(e[i]-t.values[n+i])>r){o=!1;break}if(o)return n/t.numberOfComponents}return-1},e.getTuple=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=t.numberOfComponents||1,o=e*n;switch(n){case 4:r[3]=t.values[o+3];case 3:r[2]=t.values[o+2];case 2:r[1]=t.values[o+1];case 1:r[0]=t.values[o];break;default:for(let e=n-1;e>=0;--e)r[e]=t.values[o+e]}return r},e.getTuples=(r,n)=>{const o=(r??0)*t.numberOfComponents,i=(n??e.getNumberOfTuples())*t.numberOfComponents,a=e.getData().subarray(o,i);return a.length>0?a:null},e.getTupleLocation=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*t.numberOfComponents},e.getNumberOfComponents=()=>t.numberOfComponents,e.getNumberOfValues=()=>t.size,e.getNumberOfTuples=()=>t.size/t.numberOfComponents,e.getDataType=()=>t.dataType,e.newClone=()=>xs({empty:!0,name:t.name,dataType:t.dataType,numberOfComponents:t.numberOfComponents}),e.getName=()=>(t.name||(e.modified(),t.name=`vtkDataArray${e.getMTime()}`),t.name),e.setData=(r,n)=>{t.values=r,t.size=r.length,t.dataType=gs(r),n&&(t.numberOfComponents=n),t.size%t.numberOfComponents!==0&&(t.numberOfComponents=1),e.dataChange()},e.getState=()=>{if(t.deleted)return null;const r={...t,vtkClass:e.getClassName()};r.values=Array.from(r.values),delete r.buffer,Object.keys(r).forEach(e=>{r[e]||delete r[e]});const n={};return Object.keys(r).sort().forEach(e=>{n[e]=r[e]}),n.mtime&&delete n.mtime,n},e.deepCopy=r=>{const n=e.getDataType(),o=t.values;e.shallowCopy(r),t.ranges=structuredClone(r.getRanges()),o?.length>=r.getNumberOfValues()&&n===r.getDataType()?(o.set(r.getData()),t.values=o,e.dataChange()):e.setData(r.getData().slice())},e.interpolateTuple=(r,n,o,i,a,s)=>{const l=t.numberOfComponents||1;l===n.getNumberOfComponents()&&l===i.getNumberOfComponents()||ds("numberOfComponents must match");const u=n.getTuple(o),c=i.getTuple(a),d=[];switch(d.length=l,l){case 4:d[3]=u[3]+(c[3]-u[3])*s;case 3:d[2]=u[2]+(c[2]-u[2])*s;case 2:d[1]=u[1]+(c[1]-u[1])*s;case 1:d[0]=u[0]+(c[0]-u[0])*s;break;default:for(let e=0;e<l;e++)d[e]=u[e]+(c[e]-u[e])*s}return e.insertTuple(r,d)}}(e,t)}const xs=Pt(bs,"vtkDataArray");var _s={newInstance:xs,extend:bs,...ys,...cs};const Ss={clippingPlanes:[]};var Cs=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ss,r),zt.obj(e,t),zt.algo(e,t,1,0),t.clippingPlanes||(t.clippingPlanes=[]),function(e,t){t.classHierarchy.push("vtkAbstractMapper"),e.update=()=>{e.getInputData()},e.addClippingPlane=r=>!!r.isA("vtkPlane")&&!t.clippingPlanes.includes(r)&&(t.clippingPlanes.push(r),e.modified(),!0),e.getNumberOfClippingPlanes=()=>t.clippingPlanes.length,e.removeAllClippingPlanes=()=>0!==t.clippingPlanes.length&&(t.clippingPlanes.length=0,e.modified(),!0),e.removeClippingPlane=r=>{const n=t.clippingPlanes.indexOf(r);return-1!==n&&(t.clippingPlanes.splice(n,1),e.modified(),!0)},e.getClippingPlanes=()=>t.clippingPlanes,e.setClippingPlanes=t=>{if(t)if(Array.isArray(t)){const r=t.length;for(let n=0;n<r&&n<6;n++)e.addClippingPlane(t[n])}else e.addClippingPlane(t)},e.getClippingPlaneInDataCoords=(e,r,n)=>{const o=t.clippingPlanes,i=e;if(o){const e=o.length;if(r>=0&&r<e){const e=o[r],t=e.getNormal(),a=e.getOrigin(),s=t[0],l=t[1],u=t[2],c=-(s*a[0]+l*a[1]+u*a[2]);return n[0]=s*i[0]+l*i[4]+u*i[8]+c*i[12],n[1]=s*i[1]+l*i[5]+u*i[9]+c*i[13],n[2]=s*i[2]+l*i[6]+u*i[10]+c*i[14],void(n[3]=s*i[3]+l*i[7]+u*i[11]+c*i[15])}}zt.vtkErrorMacro(`Clipping plane index ${r} is out of range.`)}}(e,t)},Ts=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,(e=>({bounds:[...Va.INIT_BOUNDS],center:[0,0,0],viewSpecificProperties:{},...e}))(r)),Cs(e,t,r),zt.setGet(e,t,["viewSpecificProperties"]),function(e,t){e.getBounds=()=>(zt.vtkErrorMacro("vtkAbstractMapper3D.getBounds - NOT IMPLEMENTED"),Ei()),e.getCenter=()=>{const r=e.getBounds();return t.center=Va.isValid(r)?Va.getCenter(r):null,t.center?.slice()},e.getLength=()=>{const t=e.getBounds();return Va.getDiagonalLength(t)}}(e,t)};const{vtkErrorMacro:ws,vtkWarningMacro:As}=zt,Es={arrays:[],copyFieldFlags:[],doCopyAllOn:!0,doCopyAllOff:!1};function Ds(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Es,r),zt.obj(e,t),function(e,t){t.classHierarchy.push("vtkFieldData");const r=e.getState;t.arrays&&(t.arrays=t.arrays.map(e=>({data:Ge(e.data)}))),e.initialize=()=>{e.initializeFields(),e.copyAllOn(),e.clearFieldFlags()},e.initializeFields=()=>{t.arrays=[],t.copyFieldFlags={},e.modified()},e.copyStructure=r=>{e.initializeFields(),t.copyFieldFlags=r.getCopyFieldFlags().map(e=>e),t.arrays=r.getArrays().map(e=>({data:e}))},e.getNumberOfArrays=()=>t.arrays.length,e.getNumberOfActiveArrays=()=>t.arrays.length,e.addArray=r=>{const n=r.getName(),{array:o,index:i}=e.getArrayWithIndex(n);return null!=o?(t.arrays[i]={data:r},i):(t.arrays=[].concat(t.arrays,{data:r}),t.arrays.length-1)},e.removeAllArrays=()=>{t.arrays=[]},e.removeArray=r=>{const n=t.arrays.findIndex(e=>e.data.getName()===r);return e.removeArrayByIndex(n)},e.removeArrayByIndex=e=>-1!==e&&e<t.arrays.length&&(t.arrays.splice(e,1),!0),e.getArrays=()=>t.arrays.map(e=>e.data),e.getArray=t=>"number"==typeof t?e.getArrayByIndex(t):e.getArrayByName(t),e.getArrayByName=e=>t.arrays.reduce((t,r,n)=>r.data.getName()===e?r.data:t,null),e.getArrayWithIndex=e=>{const r=t.arrays.findIndex(t=>t.data.getName()===e);return{array:-1!==r?t.arrays[r].data:null,index:r}},e.getArrayByIndex=e=>e>=0&&e<t.arrays.length?t.arrays[e].data:null,e.hasArray=t=>e.getArrayWithIndex(t).index>=0,e.getArrayName=e=>{const r=t.arrays[e];return r?r.data.getName():""},e.getCopyFieldFlags=()=>t.copyFieldFlags,e.getFlag=e=>t.copyFieldFlags[e],e.passData=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;r.getArrays().forEach(i=>{const a=e.getFlag(i.getName());if(!1!==a&&(!t.doCopyAllOff||!0===a)&&i){let t=e.getArrayByName(i.getName());if(t)if(i.getNumberOfComponents()===t.getNumberOfComponents())if(n>-1&&n<i.getNumberOfTuples()){const e=o>-1?o:n;t.insertTuple(e,i.getTuple(n))}else t.insertTuples(0,i.getTuples());else ws("Unhandled case in passData");else if(n<0||n>i.getNumberOfTuples())e.addArray(i),r.getAttributes(i).forEach(t=>{e.setAttribute(i,t)});else{const a=i.getNumberOfComponents();let s=i.getNumberOfValues();const l=o>-1?o:n;s<=l*a&&(s=(l+1)*a),t=_s.newInstance({name:i.getName(),dataType:i.getDataType(),numberOfComponents:a,values:zt.newTypedArray(i.getDataType(),s),size:0}),t.insertTuple(l,i.getTuple(n)),e.addArray(t),r.getAttributes(i).forEach(r=>{e.setAttribute(t,r)})}}})},e.interpolateData=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5;r.getArrays().forEach(s=>{const l=e.getFlag(s.getName());if(!1!==l&&(!t.doCopyAllOff||!0===l)&&s){let t=e.getArrayByName(s.getName());if(t)if(s.getNumberOfComponents()===t.getNumberOfComponents())if(n>-1&&n<s.getNumberOfTuples()){const e=i>-1?i:n;t.interpolateTuple(e,s,n,s,o,a),As("Unexpected case in interpolateData")}else t.insertTuples(s.getTuples());else ws("Unhandled case in interpolateData");else if(n<0||o<0||n>s.getNumberOfTuples())e.addArray(s),r.getAttributes(s).forEach(t=>{e.setAttribute(s,t)});else{const l=s.getNumberOfComponents();let u=s.getNumberOfValues();const c=i>-1?i:n;u<=c*l&&(u=(c+1)*l),t=_s.newInstance({name:s.getName(),dataType:s.getDataType(),numberOfComponents:l,values:zt.newTypedArray(s.getDataType(),u),size:0}),t.interpolateTuple(c,s,n,s,o,a),e.addArray(t),r.getAttributes(s).forEach(r=>{e.setAttribute(t,r)})}}})},e.copyFieldOn=e=>{t.copyFieldFlags[e]=!0},e.copyFieldOff=e=>{t.copyFieldFlags[e]=!1},e.copyAllOn=()=>{t.doCopyAllOn&&!t.doCopyAllOff||(t.doCopyAllOn=!0,t.doCopyAllOff=!1,e.modified())},e.copyAllOff=()=>{!t.doCopyAllOn&&t.doCopyAllOff||(t.doCopyAllOn=!1,t.doCopyAllOff=!0,e.modified())},e.clearFieldFlags=()=>{t.copyFieldFlags={}},e.deepCopy=e=>{t.arrays=e.getArrays().map(e=>{const t=e.newClone();return t.deepCopy(e),{data:t}})},e.copyFlags=e=>e.getCopyFieldFlags().map(e=>e),e.reset=()=>t.arrays.forEach(e=>e.data.reset()),e.getMTime=()=>t.arrays.reduce((e,t)=>t.data.getMTime()>e?t.data.getMTime():e,t.mtime),e.getNumberOfComponents=()=>t.arrays.reduce((e,t)=>e+t.data.getNumberOfComponents(),0),e.getNumberOfTuples=()=>t.arrays.length>0?t.arrays[0].getNumberOfTuples():0,e.getState=()=>{const e=r();return e&&(e.arrays=t.arrays.map(e=>({data:e.data.getState()}))),e}}(e,t)}var Ps={newInstance:zt.newInstance(Ds,"vtkFieldData"),extend:Ds};const Is={SCALARS:0,VECTORS:1,NORMALS:2,TCOORDS:3,TENSORS:4,GLOBALIDS:5,PEDIGREEIDS:6,EDGEFLAG:7,NUM_ATTRIBUTES:8};var Os={AttributeCopyOperations:{COPYTUPLE:0,INTERPOLATE:1,PASSDATA:2,ALLCOPY:3},AttributeLimitTypes:{MAX:0,EXACT:1,NOLIMIT:2},AttributeTypes:Is,CellGhostTypes:{DUPLICATECELL:1,HIGHCONNECTIVITYCELL:2,LOWCONNECTIVITYCELL:4,REFINEDCELL:8,EXTERIORCELL:16,HIDDENCELL:32},DesiredOutputPrecision:{DEFAULT:0,SINGLE:1,DOUBLE:2},PointGhostTypes:{DUPLICATEPOINT:1,HIDDENPOINT:2},ghostArrayName:"vtkGhostType"};const{AttributeTypes:Ns,AttributeCopyOperations:Ms}=Os,{vtkWarningMacro:Rs}=zt,Fs={activeScalars:-1,activeVectors:-1,activeTensors:-1,activeNormals:-1,activeTCoords:-1,activeGlobalIds:-1,activePedigreeIds:-1};function Bs(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fs,r),Ps.extend(e,t,r),zt.setGet(e,t,["activeScalars","activeNormals","activeTCoords","activeVectors","activeTensors","activeGlobalIds","activePedigreeIds"]),t.arrays||(t.arrays={}),function(e,t){const r=["Scalars","Vectors","Normals","TCoords","Tensors","GlobalIds","PedigreeIds"];function n(e){let t=r.find(t=>Ns[t.toUpperCase()]===e||"number"!=typeof e&&t.toLowerCase()===e.toLowerCase());return void 0===t&&(t=null),t}t.classHierarchy.push("vtkDataSetAttributes");const o={...e};e.checkNumberOfComponents=e=>!0,e.setAttribute=(r,o)=>{const i=n(o);if(r&&"PEDIGREEIDS"===i.toUpperCase()&&!r.isA("vtkDataArray"))return Rs(`Cannot set attribute ${i}. The attribute must be a vtkDataArray.`),-1;if(r&&!e.checkNumberOfComponents(r,i))return Rs(`Cannot set attribute ${i}. Incorrect number of components.`),-1;if(r){const n=e.addArray(r);t[`active${i}`]=n}else t[`active${i}`]=-1;return e.modified(),t[`active${i}`]},e.getAttributes=t=>r.filter(r=>e[`get${r}`]()===t),e.setActiveAttributeByName=(t,r)=>e.setActiveAttributeByIndex(e.getArrayWithIndex(t).index,r),e.setActiveAttributeByIndex=(r,o)=>{const i=n(o);if(r>=0&&r<t.arrays.length){if("PEDIGREEIDS"!==i.toUpperCase()){const t=e.getArrayByIndex(r);if(!t.isA("vtkDataArray"))return Rs(`Cannot set attribute ${i}. Only vtkDataArray subclasses can be set as active attributes.`),-1;if(!e.checkNumberOfComponents(t,i))return Rs(`Cannot set attribute ${i}. Incorrect number of components.`),-1}return t[`active${i}`]=r,e.modified(),r}return-1===r&&(t[`active${i}`]=r,e.modified()),-1},e.getActiveAttribute=t=>{const r=n(t);return e[`get${r}`]()},e.removeAllArrays=()=>{r.forEach(e=>{t[`active${e}`]=-1}),o.removeAllArrays()},e.removeArrayByIndex=e=>(-1!==e&&r.forEach(r=>{e===t[`active${r}`]?t[`active${r}`]=-1:e<t[`active${r}`]&&(t[`active${r}`]-=1)}),o.removeArrayByIndex(e)),r.forEach(r=>{const n=`active${r}`;e[`get${r}`]=()=>e.getArrayByIndex(t[n]),e[`set${r}`]=t=>e.setAttribute(t,r),e[`setActive${r}`]=t=>e.setActiveAttributeByIndex(e.getArrayWithIndex(t).index,r),e[`copy${r}Off`]=()=>{const e=r.toUpperCase();t.copyAttributeFlags[Ms.PASSDATA][Ns[e]]=!1},e[`copy${r}On`]=()=>{const e=r.toUpperCase();t.copyAttributeFlags[Ms.PASSDATA][Ns[e]]=!0}}),e.initializeAttributeCopyFlags=()=>{t.copyAttributeFlags=[],Object.keys(Ms).filter(e=>"ALLCOPY"!==e).forEach(e=>{t.copyAttributeFlags[Ms[e]]=Object.keys(Ns).filter(e=>"NUM_ATTRIBUTES"!==e).reduce((e,t)=>(e[Ns[t]]=!0,e),[])}),t.copyAttributeFlags[Ms.COPYTUPLE][Ns.GLOBALIDS]=!1,t.copyAttributeFlags[Ms.INTERPOLATE][Ns.GLOBALIDS]=!1,t.copyAttributeFlags[Ms.COPYTUPLE][Ns.PEDIGREEIDS]=!1},e.initialize=zt.chain(e.initialize,e.initializeAttributeCopyFlags),t.dataArrays&&Object.keys(t.dataArrays).length&&Object.keys(t.dataArrays).forEach(r=>{t.dataArrays[r].ref||"vtkDataArray"!==t.dataArrays[r].type||e.addArray(_s.newInstance(t.dataArrays[r]))});const i=e.shallowCopy;e.shallowCopy=(e,r)=>{i(e,r),t.arrays=e.getArrays().map(e=>{const t=e.newClone();return t.shallowCopy(e,r),{data:t}})},e.initializeAttributeCopyFlags()}(e,t)}var Ls={newInstance:zt.newInstance(Bs,"vtkDataSetAttributes"),extend:Bs,...Os};const ks=["pointData","cellData","fieldData"],Us={};function Vs(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Us,r),zt.obj(e,t),zt.setGet(e,t,ks),zt.getArray(e,t,["bounds"],6),function(e,t){t.classHierarchy.push("vtkDataSet"),ks.forEach(e=>{t[e]?t[e]=Ge(t[e]):t[e]=Ls.newInstance()}),e.computeBounds=()=>{if(t.modifiedTime&&t.computeTime&&t.modifiedTime>t.computeTime||!t.computeTime){const r=e.getPoints();r?.getNumberOfPoints()?Va.setBounds(t.bounds,r.getBoundsByReference()):t.bounds=Oi.createUninitializedBounds(),t.computeTime=zt.getCurrentGlobalMTime()}},e.getLength2=()=>{const t=e.getBoundsByReference();return t&&6===t.length?Va.getDiagonalLength2(t):0},e.getLength=()=>Math.sqrt(e.getLength2()),e.getCenter=()=>{const t=e.getBoundsByReference();return t&&6===t.length?Va.getCenter(t):[0,0,0]},e.getCellBounds=t=>{const r=e.getCell(t);return r?r.getBounds():Oi.createUninitializedBounds()},e.getBounds=zt.chain(()=>e.computeBounds,e.getBounds),e.getBoundsByReference=zt.chain(()=>e.computeBounds,e.getBoundsByReference);const r=e.shallowCopy;e.shallowCopy=function(e){r(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]),ks.forEach(r=>{t[r]=Ls.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))})};const n=e.getMTime;e.getMTime=()=>ks.reduce((e,r)=>Math.max(e,t[r]?.getMTime()??e),n()),e.initialize=()=>(ks.forEach(e=>t[e]?.initialize()),e)}(e,t)}var Gs={newInstance:zt.newInstance(Vs,"vtkDataSet"),extend:Vs,FieldDataTypes:{UNIFORM:0,DATA_OBJECT_FIELD:0,COORDINATE:1,POINT_DATA:1,POINT:2,POINT_FIELD_DATA:2,CELL:3,CELL_FIELD_DATA:3,VERTEX:4,VERTEX_FIELD_DATA:4,EDGE:5,EDGE_FIELD_DATA:5,ROW:6,ROW_DATA:6},FieldAssociations:{FIELD_ASSOCIATION_POINTS:0,FIELD_ASSOCIATION_CELLS:1,FIELD_ASSOCIATION_NONE:2,FIELD_ASSOCIATION_POINTS_THEN_CELLS:3,FIELD_ASSOCIATION_VERTICES:4,FIELD_ASSOCIATION_EDGES:5,FIELD_ASSOCIATION_ROWS:6,NUMBER_OF_ASSOCIATIONS:7}};const zs={UNCHANGED:0,SINGLE_POINT:1,X_LINE:2,Y_LINE:3,Z_LINE:4,XY_PLANE:5,YZ_PLANE:6,XZ_PLANE:7,XYZ_GRID:8,EMPTY:9};var js={StructuredType:zs};const{StructuredType:Ws}=js;var Hs={getDataDescriptionFromExtent:function(e){let t=0;for(let r=0;r<3;++r)e[2*r]<e[2*r+1]&&t++;return e[0]>e[1]||e[2]>e[3]||e[4]>e[5]?Ws.EMPTY:3===t?Ws.XYZ_GRID:2===t?e[0]===e[1]?Ws.YZ_PLANE:e[2]===e[3]?Ws.XZ_PLANE:Ws.XY_PLANE:1===t?e[0]<e[1]?Ws.X_LINE:e[2]<e[3]?Ws.Y_LINE:Ws.Z_LINE:Ws.SINGLE_POINT},...js};const{vtkErrorMacro:Ks}=zt,Xs={direction:null,indexToWorld:null,worldToIndex:null,spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:zs.EMPTY};function $s(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xs,r),Gs.extend(e,t,r),t.direction?Array.isArray(t.direction)&&(t.direction=new Float64Array(t.direction.slice(0,9))):t.direction=pe(new Float64Array(9)),t.indexToWorld=new Float64Array(16),t.worldToIndex=new Float64Array(16),zt.get(e,t,["indexToWorld","worldToIndex"]),zt.setGetArray(e,t,["origin","spacing"],3),zt.setGetArray(e,t,["direction"],9),zt.getArray(e,t,["extent"],6),function(e,t){t.classHierarchy.push("vtkImageData"),e.setExtent=function(){if(t.deleted)return Ks("instance deleted - cannot call any method"),!1;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const i=1===n.length?n[0]:n;if(6!==i.length)return!1;const a=t.extent.some((e,t)=>e!==i[t]);return a&&(t.extent=i.slice(),t.dataDescription=Hs.getDataDescriptionFromExtent(t.extent),e.modified()),a},e.setDimensions=function(){let r,n,o;if(t.deleted)Ks("instance deleted - cannot call any method");else{if(1===arguments.length){const e=arguments.length<=0?void 0:arguments[0];r=e[0],n=e[1],o=e[2]}else{if(3!==arguments.length)return void Ks("Bad dimension specification");r=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]}e.setExtent(0,r-1,0,n-1,0,o-1)}},e.getDimensions=()=>[t.extent[1]-t.extent[0]+1,t.extent[3]-t.extent[2]+1,t.extent[5]-t.extent[4]+1],e.getNumberOfCells=()=>{const t=e.getDimensions();let r=1;for(let e=0;e<3;e++){if(0===t[e])return 0;t[e]>1&&(r*=t[e]-1)}return r},e.getNumberOfPoints=()=>{const t=e.getDimensions();return t[0]*t[1]*t[2]},e.getPoint=r=>{const n=e.getDimensions();if(0===n[0]||0===n[1]||0===n[2])return Ks("Requesting a point from an empty image."),null;const o=new Float64Array(3);switch(t.dataDescription){case zs.EMPTY:return null;case zs.SINGLE_POINT:break;case zs.X_LINE:o[0]=r;break;case zs.Y_LINE:o[1]=r;break;case zs.Z_LINE:o[2]=r;break;case zs.XY_PLANE:o[0]=r%n[0],o[1]=r/n[0];break;case zs.YZ_PLANE:o[1]=r%n[1],o[2]=r/n[1];break;case zs.XZ_PLANE:o[0]=r%n[0],o[2]=r/n[0];break;case zs.XYZ_GRID:o[0]=r%n[0],o[1]=r/n[0]%n[1],o[2]=r/(n[0]*n[1]);break;default:Ks("Invalid dataDescription")}const i=[0,0,0];return e.indexToWorld(o,i),i},e.getBounds=()=>e.extentToBounds(e.getSpatialExtent()),e.extentToBounds=e=>Va.transformBounds(e,t.indexToWorld),e.getSpatialExtent=()=>Va.inflate([...t.extent],.5),e.computeTransforms=()=>{A(t.indexToWorld,t.origin),t.indexToWorld[0]=t.direction[0],t.indexToWorld[1]=t.direction[1],t.indexToWorld[2]=t.direction[2],t.indexToWorld[4]=t.direction[3],t.indexToWorld[5]=t.direction[4],t.indexToWorld[6]=t.direction[5],t.indexToWorld[8]=t.direction[6],t.indexToWorld[9]=t.direction[7],t.indexToWorld[10]=t.direction[8],_(t.indexToWorld,t.indexToWorld,t.spacing),g(t.worldToIndex,t.indexToWorld)},e.indexToWorld=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Sr(r,e,t.indexToWorld),r},e.indexToWorldVec3=e.indexToWorld,e.worldToIndex=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Sr(r,e,t.worldToIndex),r},e.worldToIndexVec3=e.worldToIndex,e.indexToWorldBounds=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Va.transformBounds(e,t.indexToWorld,r)},e.worldToIndexBounds=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Va.transformBounds(e,t.worldToIndex,r)},t._onOriginChanged=e.computeTransforms,t._onDirectionChanged=e.computeTransforms,t._onSpacingChanged=e.computeTransforms,e.computeTransforms(),e.getCenter=()=>Va.getCenter(e.getBounds()),e.computeHistogram=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[0,0,0,0,0,0];e.worldToIndexBounds(t,n);const o=[0,0,0],i=[0,0,0];Va.computeCornerPoints(n,o,i),Zo(o,o),Zo(i,i);const a=e.getDimensions();xi(o,[0,0,0],[a[0]-1,a[1]-1,a[2]-1],o),xi(i,[0,0,0],[a[0]-1,a[1]-1,a[2]-1],i);const s=a[0],l=a[0]*a[1],u=e.getPointData().getScalars().getData();let c=-1/0,d=1/0,p=0,f=0,h=0;for(let e=o[2];e<=i[2];e++)for(let t=o[1];t<=i[1];t++){let a=o[0]+t*s+e*l;for(let s=o[0];s<=i[0];s++){if(!r||r([s,t,e],n)){const e=u[a];e>c&&(c=e),e<d&&(d=e),p+=e*e,f+=e,h+=1}++a}}const m=h>0?f/h:0,g=h?Math.abs(p/h-m*m):0;return{minimum:d,maximum:c,average:m,variance:g,sigma:Math.sqrt(g),count:h}},e.computeIncrements=function(e){const t=[];let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;for(let n=0;n<3;++n)t[n]=r,r*=e[2*n+1]-e[2*n]+1;return t},e.computeOffsetIndex=t=>{let[r,n,o]=t;const i=e.getExtent(),a=e.getPointData().getScalars().getNumberOfComponents(),s=e.computeIncrements(i,a);return Math.floor((Math.round(r)-i[0])*s[0]+(Math.round(n)-i[2])*s[1]+(Math.round(o)-i[4])*s[2])},e.getOffsetIndexFromWorld=t=>{const r=e.getExtent(),n=e.worldToIndex(t);for(let e=0;e<3;++e)if(n[e]<r[2*e]||n[e]>r[2*e+1])return Ks(`GetScalarPointer: Pixel ${n} is not in memory. Current extent = ${r}`),NaN;return e.computeOffsetIndex(n)},e.getScalarValueFromWorld=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e.getPointData().getScalars().getNumberOfComponents();if(r<0||r>=n)return Ks(`GetScalarPointer: Scalar Component ${r} is not within bounds. Current Scalar numberOfComponents: ${n}`),NaN;const o=e.getOffsetIndexFromWorld(t);return Number.isNaN(o)?o:e.getPointData().getScalars().getComponent(o,r)};const r=e.initialize;e.initialize=()=>(e.set({direction:pe(t.direction),spacing:[1,1,1],origin:[0,0,0],extent:[0,-1,0,-1,0,-1],dataDescription:zs.EMPTY}),r())}(e,t)}var qs={newInstance:zt.newInstance($s,"vtkImageData"),extend:$s};const Ys={LUMINANCE:1,LUMINANCE_ALPHA:2,RGB:3,RGBA:4};var Js={VectorMode:{MAGNITUDE:0,COMPONENT:1,RGBCOLORS:2},ScalarMappingTarget:Ys,Scale:{LINEAR:0,LOG10:1}},Qs={ColorMode:{DEFAULT:0,MAP_SCALARS:1,DIRECT_SCALARS:2},GetArray:{BY_ID:0,BY_NAME:1},ScalarMode:{DEFAULT:0,USE_POINT_DATA:1,USE_CELL_DATA:2,USE_POINT_FIELD_DATA:3,USE_CELL_FIELD_DATA:4,USE_FIELD_DATA:5}};const{ScalarMappingTarget:Zs,Scale:el,VectorMode:tl}=Js,{VtkDataTypes:rl}=_s,{ColorMode:nl}=Qs,{vtkErrorMacro:ol}=zt;function il(e){return e}function al(e){return Math.floor(255*e+.5)}const sl={alpha:1,vectorComponent:0,vectorSize:-1,vectorMode:tl.COMPONENT,mappingRange:null,annotationArray:null,annotatedValueMap:null,indexedLookup:!1,scale:el.LINEAR};function ll(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sl,r),zt.obj(e,t),t.mappingRange=[0,255],t.annotationArray=[],t.annotatedValueMap=[],zt.setGet(e,t,["vectorSize","vectorComponent","vectorMode","alpha","indexedLookup"]),zt.setArray(e,t,["mappingRange"],2),zt.getArray(e,t,["mappingRange"]),function(e,t){t.classHierarchy.push("vtkScalarsToColors"),e.setVectorModeToMagnitude=()=>e.setVectorMode(tl.MAGNITUDE),e.setVectorModeToComponent=()=>e.setVectorMode(tl.COMPONENT),e.setVectorModeToRGBColors=()=>e.setVectorMode(tl.RGBCOLORS),e.build=()=>{},e.isOpaque=()=>!0,e.setAnnotations=(r,n)=>{if(!(r&&!n||!r&&n))if(r&&n&&r.length!==n.length)ol("Values and annotations do not have the same number of tuples so ignoring");else{if(t.annotationArray=[],n&&r){const e=n.length;for(let o=0;o<e;o++)t.annotationArray.push({value:r[o],annotation:String(n[o])})}e.updateAnnotatedValueMap(),e.modified()}},e.setAnnotation=(r,n)=>{let o=e.checkForAnnotatedValue(r),i=!1;return o>=0?t.annotationArray[o].annotation!==n&&(t.annotationArray[o].annotation=n,i=!0):(t.annotationArray.push({value:r,annotation:n}),o=t.annotationArray.length-1,i=!0),i&&(e.updateAnnotatedValueMap(),e.modified()),o},e.getNumberOfAnnotatedValues=()=>t.annotationArray.length,e.getAnnotatedValue=e=>e<0||e>=t.annotationArray.length?null:t.annotationArray[e].value,e.getAnnotation=e=>void 0===t.annotationArray[e]?null:t.annotationArray[e].annotation,e.getAnnotatedValueIndex=r=>t.annotationArray.length?e.checkForAnnotatedValue(r):-1,e.removeAnnotation=r=>{const n=e.checkForAnnotatedValue(r),o=n>=0;return o&&(t.annotationArray.splice(n,1),e.updateAnnotatedValueMap(),e.modified()),o},e.resetAnnotations=()=>{t.annotationArray=[],t.annotatedValueMap=[],e.modified()},e.getAnnotationColor=(r,n)=>{if(t.indexedLookup){const t=e.getAnnotatedValueIndex(r);e.getIndexedColor(t,n)}else e.getColor(parseFloat(r),n),n[3]=1},e.checkForAnnotatedValue=t=>e.getAnnotatedValueIndexInternal(t),e.getAnnotatedValueIndexInternal=e=>{if(void 0!==t.annotatedValueMap[e]){const r=t.annotationArray.length;return t.annotatedValueMap[e]%r}return-1},e.getIndexedColor=(e,t)=>{t[0]=0,t[1]=0,t[2]=0,t[3]=0},e.updateAnnotatedValueMap=()=>{t.annotatedValueMap=[];const e=t.annotationArray.length;for(let r=0;r<e;r++)t.annotatedValueMap[t.annotationArray[r].value]=r},e.mapScalars=(t,r,n)=>{const o=t.getNumberOfComponents();let i=null;if(r===nl.DEFAULT&&(t.getDataType()===rl.UNSIGNED_CHAR||t.getDataType()===rl.UNSIGNED_CHAR_CLAMPED)||r===nl.DIRECT_SCALARS&&t)i=e.convertToRGBA(t,o,t.getNumberOfTuples());else{const r={type:"vtkDataArray",name:"temp",numberOfComponents:4,dataType:rl.UNSIGNED_CHAR},a=zt.newTypedArray(r.dataType,4*t.getNumberOfTuples());r.values=a,r.size=a.length,i=_s.newInstance(r);let s=n;s<0&&o>1?e.mapVectorsThroughTable(t,i,Zs.RGBA,-1,-1):(s<0&&(s=0),s>=o&&(s=o-1),e.mapScalarsThroughTable(t,i,Zs.RGBA,s))}return i},e.mapVectorsToMagnitude=(e,t,r)=>{const n=e.getNumberOfTuples(),o=e.getNumberOfComponents(),i=t.getData(),a=e.getData();for(let e=0;e<n;e++){let t=0;for(let n=0;n<r;n++)t+=a[e*o+n]*a[e*o+n];i[e]=Math.sqrt(t)}},e.mapVectorsThroughTable=(t,r,n,o,i)=>{let a=e.getVectorMode(),s=i,l=o;const u=t.getNumberOfComponents();a===tl.COMPONENT?(-1===l&&(l=e.getVectorComponent()),l<0&&(l=0),l>=u&&(l=u-1)):(-1===s&&(s=e.getVectorSize()),s<=0?(l=0,s=u):(l<0&&(l=0),l>=u&&(l=u-1),l+s>u&&(s=u-l)),a!==tl.MAGNITUDE||1!==u&&1!==s||(a=tl.COMPONENT));let c=0;switch(l>0&&(c=l),a){case tl.COMPONENT:e.mapScalarsThroughTable(t,r,n,c);break;case tl.RGBCOLORS:break;case tl.MAGNITUDE:default:{const o=_s.newInstance({numberOfComponents:1,values:new Float32Array(t.getNumberOfTuples())});e.mapVectorsToMagnitude(t,o,s),e.mapScalarsThroughTable(o,r,n,0);break}}},e.luminanceToRGBA=(e,t,r,n)=>{const o=n(r),i=t.getData(),a=e.getData(),s=i.length;let l=0;for(let e=0;e<s;e+=1){const t=n(i[e]);a[4*l]=t,a[4*l+1]=t,a[4*l+2]=t,a[4*l+3]=o,l++}},e.luminanceAlphaToRGBA=(e,t,r,n)=>{const o=t.getData(),i=e.getData(),a=o.length;let s=0;for(let e=0;e<a;e+=2){const t=n(o[e]);i[s]=t,i[s+1]=t,i[s+2]=t,i[s+3]=n(o[e+1])*r,s+=4}},e.rGBToRGBA=(e,t,r,n)=>{const o=al(r),i=t.getData(),a=e.getData(),s=i.length;let l=0;for(let e=0;e<s;e+=3)a[4*l]=n(i[e]),a[4*l+1]=n(i[e+1]),a[4*l+2]=n(i[e+2]),a[4*l+3]=o,l++},e.rGBAToRGBA=(e,t,r,n)=>{const o=t.getData(),i=e.getData(),a=o.length;let s=0;for(let e=0;e<a;e+=4)i[4*s]=n(o[e]),i[4*s+1]=n(o[e+1]),i[4*s+2]=n(o[e+2]),i[4*s+3]=n(o[e+3])*r,s++},e.convertToRGBA=(r,n,o)=>{let{alpha:i}=t;if(4===n&&i>=1&&r.getDataType()===rl.UNSIGNED_CHAR)return r;const a=_s.newInstance({numberOfComponents:4,empty:!0,size:4*o,dataType:rl.UNSIGNED_CHAR});if(o<=0)return a;i=i>0?i:0,i=i<1?i:1;let s=il;switch(r.getDataType()!==rl.FLOAT&&r.getDataType()!==rl.DOUBLE||(s=al),n){case 1:e.luminanceToRGBA(a,r,i,s);break;case 2:e.luminanceAlphaToRGBA(a,r,s);break;case 3:e.rGBToRGBA(a,r,i,s);break;case 4:e.rGBAToRGBA(a,r,i,s);break;default:return ol("Cannot convert colors"),null}return a},e.usingLogScale=()=>!1,e.getNumberOfAvailableColors=()=>16777216,e.setRange=(t,r)=>e.setMappingRange(t,r),e.getRange=()=>e.getMappingRange(),e.areScalarsOpaque=(r,n,o)=>{if(!r)return e.isOpaque();const i=r.getNumberOfComponents();return(n!==nl.DEFAULT||r.getDataType()!==rl.UNSIGNED_CHAR)&&n!==nl.DIRECT_SCALARS||(3===i||1===i?t.alpha>=1:255===r.getRange(i-1)[0])}}(e,t)}var ul={newInstance:zt.newInstance(ll,"vtkScalarsToColors"),extend:ll,...Js};const{vtkErrorMacro:cl}=zt,dl={numberOfColors:256,hueRange:[0,.66667],saturationRange:[1,1],valueRange:[1,1],alphaRange:[1,1],nanColor:[.5,0,0,1],belowRangeColor:[0,0,0,1],aboveRangeColor:[1,1,1,1],useAboveRangeColor:!1,useBelowRangeColor:!1,alpha:1};function pl(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,dl,r),ul.extend(e,t,r),t.table||(t.table=[]),t.buildTime={},zt.obj(t.buildTime),t.opaqueFlagBuildTime={},zt.obj(t.opaqueFlagBuildTime,{mtime:0}),t.insertTime={},zt.obj(t.insertTime,{mtime:0}),zt.get(e,t,["buildTime"]),zt.setGet(e,t,["numberOfColors","useAboveRangeColor","useBelowRangeColor"]),zt.setArray(e,t,["alphaRange","hueRange","saturationRange","valueRange"],2),zt.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),zt.getArray(e,t,["hueRange","saturationRange","valueRange","alphaRange","nanColor","belowRangeColor","aboveRangeColor"]),function(e,t){t.classHierarchy.push("vtkLookupTable"),e.isOpaque=()=>{if(t.opaqueFlagBuildTime.getMTime()<e.getMTime()){let e=!0;t.nanColor[3]<1&&(e=0),t.useBelowRangeColor&&t.belowRangeColor[3]<1&&(e=0),t.useAboveRangeColor&&t.aboveRangeColor[3]<1&&(e=0);for(let r=3;r<t.table.length&&e;r+=4)t.table[r]<255&&(e=!1);t.opaqueFlag=e,t.opaqueFlagBuildTime.modified()}return t.opaqueFlag},e.usingLogScale=()=>!1,e.getNumberOfAvailableColors=()=>t.table.length/4-3,e.linearIndexLookup=(e,t)=>{let r=0;const n=Number(e);return n<t.range[0]?r=t.maxIndex+0+1.5:n>t.range[1]?r=t.maxIndex+1+1.5:(r=(n+t.shift)*t.scale,r=r<t.maxIndex?r:t.maxIndex),Math.floor(r)},e.linearLookup=(t,r,n)=>{let o=0;o=Ai(t)?Math.floor(n.maxIndex+1.5+2):e.linearIndexLookup(t,n);const i=4*o;return r.slice(i,i+4)},e.indexedLookupFunction=(r,n,o)=>{let i=e.getAnnotatedValueIndexInternal(r);-1===i&&(i=t.numberOfColors+2);const a=4*i;return[n[a],n[a+1],n[a+2],n[a+3]]},e.lookupShiftAndScale=(e,t)=>{t.shift=-e[0],t.scale=Number.MAX_VALUE,e[1]>e[0]&&(t.scale=(t.maxIndex+1)/(e[1]-e[0]))},e.mapScalarsThroughTable=(r,n,o,i)=>{let a=e.linearLookup;t.indexedLookup&&(a=e.indexedLookupFunction);const s=e.getMappingRange(),l={maxIndex:e.getNumberOfColors()-1,range:s,shift:0,scale:0};e.lookupShiftAndScale(s,l);const u=e.getAlpha(),c=r.getNumberOfTuples(),d=r.getNumberOfComponents(),p=n.getData(),f=r.getData();if(u>=1){if(o===Ys.RGBA)for(let e=0;e<c;e++){const r=a(f[e*d+i],t.table,l);p[4*e]=r[0],p[4*e+1]=r[1],p[4*e+2]=r[2],p[4*e+3]=r[3]}}else if(o===Ys.RGBA)for(let e=0;e<c;e++){const r=a(f[e*d+i],t.table,l);p[4*e]=r[0],p[4*e+1]=r[1],p[4*e+2]=r[2],p[4*e+3]=Math.floor(r[3]*u+.5)}},e.forceBuild=()=>{let r=0,n=0,o=0,i=0;const a=t.numberOfColors-1;a&&(r=(t.hueRange[1]-t.hueRange[0])/a,n=(t.saturationRange[1]-t.saturationRange[0])/a,o=(t.valueRange[1]-t.valueRange[0])/a,i=(t.alphaRange[1]-t.alphaRange[0])/a),t.table.length=4*a+16;const s=[],l=[];for(let e=0;e<=a;e++)s[0]=t.hueRange[0]+e*r,s[1]=t.saturationRange[0]+e*n,s[2]=t.valueRange[0]+e*o,ci(s,l),l[3]=t.alphaRange[0]+e*i,t.table[4*e]=255*l[0]+.5,t.table[4*e+1]=255*l[1]+.5,t.table[4*e+2]=255*l[2]+.5,t.table[4*e+3]=255*l[3]+.5;e.buildSpecialColors(),t.buildTime.modified()},e.setTable=r=>{if(Array.isArray(r)){const n=r[0].length;t.numberOfColors=r.length;const o=4-n;let i=0;for(let e=0;e<t.numberOfColors;e++)t.table[4*e]=255,t.table[4*e+1]=255,t.table[4*e+2]=255,t.table[4*e+3]=255;for(let e=0;e<r.length;e++){const a=r[e];for(let e=0;e<n;e++)t.table[i++]=a[e];i+=o}return e.buildSpecialColors(),t.insertTime.modified(),e.modified(),!0}if(4!==r.getNumberOfComponents())return cl("Expected 4 components for RGBA colors"),!1;if(r.getDataType()!==us.UNSIGNED_CHAR)return cl("Expected unsigned char values for RGBA colors"),!1;t.numberOfColors=r.getNumberOfTuples();const n=r.getData();t.table.length=n.length;for(let e=0;e<n.length;e++)t.table[e]=n[e];return e.buildSpecialColors(),t.insertTime.modified(),e.modified(),!0},e.buildSpecialColors=()=>{const{numberOfColors:e}=t,r=t.table;let n=4*(e+0);t.useBelowRangeColor||0===e?(r[n]=255*t.belowRangeColor[0]+.5,r[n+1]=255*t.belowRangeColor[1]+.5,r[n+2]=255*t.belowRangeColor[2]+.5,r[n+3]=255*t.belowRangeColor[3]+.5):(r[n]=r[0],r[n+1]=r[1],r[n+2]=r[2],r[n+3]=r[3]),n=4*(e+1),t.useAboveRangeColor||0===e?(r[n]=255*t.aboveRangeColor[0]+.5,r[n+1]=255*t.aboveRangeColor[1]+.5,r[n+2]=255*t.aboveRangeColor[2]+.5,r[n+3]=255*t.aboveRangeColor[3]+.5):(r[n]=r[4*(e-1)+0],r[n+1]=r[4*(e-1)+1],r[n+2]=r[4*(e-1)+2],r[n+3]=r[4*(e-1)+3]),n=4*(e+2),r[n]=255*t.nanColor[0]+.5,r[n+1]=255*t.nanColor[1]+.5,r[n+2]=255*t.nanColor[2]+.5,r[n+3]=255*t.nanColor[3]+.5},e.build=()=>{(t.table.length<1||e.getMTime()>t.buildTime.getMTime()&&t.insertTime.getMTime()<=t.buildTime.getMTime())&&e.forceBuild()},t.table.length>0&&(e.buildSpecialColors(),t.insertTime.modified())}(e,t)}var fl={newInstance:zt.newInstance(pl,"vtkLookupTable"),extend:pl};const hl={Off:0,PolygonOffset:1};let ml=hl.PolygonOffset,gl=hl.Off;const yl=["VTK_RESOLVE_OFF","VTK_RESOLVE_POLYGON_OFFSET"];function vl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const t=gl===e;return gl=e,t}var bl={Resolve:hl,getResolveCoincidentTopologyAsString:function(){return yl[gl]},getResolveCoincidentTopologyPolygonOffsetFaces:function(){return ml},getResolveCoincidentTopology:function(){return gl},setResolveCoincidentTopology:vl,setResolveCoincidentTopologyPolygonOffsetFaces:function(e){const t=ml===e;return ml=e,t},setResolveCoincidentTopologyToDefault:function(){return vl(hl.Off)},setResolveCoincidentTopologyToOff:function(){return vl(hl.Off)},setResolveCoincidentTopologyToPolygonOffset:function(){return vl(hl.PolygonOffset)}};function xl(e,t,r){r.forEach(r=>{e[`get${r.method}`]=()=>t[r.key],e[`set${r.method}`]=zt.objectSetterMap.object(e,t,{name:r.key,params:["factor","offset"]})})}const _l=["Polygon","Line","Point"],Sl={modified:()=>{}};xl(Sl,{Polygon:{factor:2,offset:0},Line:{factor:1,offset:-1},Point:{factor:0,offset:-2}},_l.map(e=>({key:e,method:`ResolveCoincidentTopology${e}OffsetParameters`})));var Cl={implementCoincidentTopologyMethods:function(e,t){void 0===t.resolveCoincidentTopology&&(t.resolveCoincidentTopology=!1),zt.setGet(e,t,["resolveCoincidentTopology"]),t.topologyOffset={Polygon:{factor:0,offset:0},Line:{factor:0,offset:0},Point:{factor:0,offset:0}},Object.keys(bl).forEach(t=>{e[t]=bl[t]}),Object.keys(Sl).filter(e=>"modified"!==e).forEach(t=>{e[t]=Sl[t]}),xl(e,t.topologyOffset,_l.map(e=>({key:e,method:`RelativeCoincidentTopology${e}OffsetParameters`}))),e.getCoincidentTopologyPolygonOffsetParameters=()=>{const t=Sl.getResolveCoincidentTopologyPolygonOffsetParameters(),r=e.getRelativeCoincidentTopologyPolygonOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyLineOffsetParameters=()=>{const t=Sl.getResolveCoincidentTopologyLineOffsetParameters(),r=e.getRelativeCoincidentTopologyLineOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}},e.getCoincidentTopologyPointOffsetParameter=()=>{const t=Sl.getResolveCoincidentTopologyPointOffsetParameters(),r=e.getRelativeCoincidentTopologyPointOffsetParameters();return{factor:t.factor+r.factor,offset:t.offset+r.offset}}},staticOffsetAPI:Sl,otherStaticMethods:bl,CATEGORIES:_l,Resolve:hl};const Tl={MIN_KNOWN_PASS:0,ACTOR_PASS:0,COMPOSITE_INDEX_PASS:1,ID_LOW24:2,ID_HIGH24:3,MAX_KNOWN_PASS:3};var wl={PassTypes:Tl};const{FieldAssociations:Al}=Gs,{staticOffsetAPI:El,otherStaticMethods:Dl}=Cl,{ColorMode:Pl,ScalarMode:Il,GetArray:Ol}=Qs,{VectorMode:Nl}=Js,{VtkDataTypes:Ml}=_s;function Rl(e){return()=>zt.vtkErrorMacro(`vtkMapper::${e} - NOT IMPLEMENTED`)}function Fl(e,t){const r=e[1]%2==0?1:-1;if(e[0]+=r,e[0]>=t[0]||e[0]<0){const n=e[2]%2==0?1:-1;e[0]-=r,e[1]+=n,(e[1]>=t[1]||e[1]<0)&&(e[1]-=n,e[2]++)}}function Bl(e,t){return e[0]+t[0]*(e[1]+t[1]*e[2])}function Ll(e,t,r){const n=Math.floor(t),o=n%(2*r[0]);let i,a;o<r[0]?(e[0]=o,i=1,a=e[0]===r[0]-1):(e[0]=2*r[0]-1-o,i=-1,a=0===e[0]);const s=Math.floor(n/r[0]),l=s%(2*r[1]);let u,c;l<r[1]?(e[1]=l,u=1,c=e[1]===r[1]-1):(e[1]=2*r[1]-1-l,u=-1,c=0===e[1]),e[2]=Math.floor(s/r[1]);const d=t-n;a?c?e[2]+=d:e[1]+=u*d:e[0]+=i*d,e[0]=(e[0]+.5)/r[0],e[1]=(e[1]+.5)/r[1],e[2]=(e[2]+.5)/r[2]}const kl=new WeakMap;const Ul={colorMapColors:null,areScalarsMappedFromCells:!1,static:!1,lookupTable:null,scalarVisibility:!0,scalarRange:[0,1],useLookupTableScalarRange:!1,colorMode:0,scalarMode:0,arrayAccessMode:1,renderTime:0,colorByArrayName:null,fieldDataTupleId:-1,populateSelectionSettings:!0,selectionWebGLIdsToVTKIds:null,interpolateScalarsBeforeMapping:!1,colorCoordinates:null,colorTextureMap:null,numberOfColorsInRange:0,forceCompileOnly:0,useInvertibleColors:!1,invertibleScalars:null,customShaderAttributes:[]};function Vl(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ul,r),Ts(e,t,r),zt.get(e,t,["areScalarsMappedFromCells","colorCoordinates","colorMapColors","colorTextureMap","numberOfColorsInRange","selectionWebGLIdsToVTKIds"]),zt.setGet(e,t,["colorByArrayName","arrayAccessMode","colorMode","fieldDataTupleId","interpolateScalarsBeforeMapping","lookupTable","populateSelectionSettings","renderTime","scalarMode","scalarVisibility","static","useLookupTableScalarRange","customShaderAttributes"]),zt.setGetArray(e,t,["scalarRange"],2),Cl.implementCoincidentTopologyMethods(e,t),function(e,t){t.classHierarchy.push("vtkMapper"),e.getBounds=()=>{const r=e.getInputData();return r?(t.static||e.update(),t.bounds=r.getBounds()):t.bounds=Ei(),t.bounds},e.setForceCompileOnly=e=>{t.forceCompileOnly=e},e.setSelectionWebGLIdsToVTKIds=e=>{t.selectionWebGLIdsToVTKIds=e},e.createDefaultLookupTable=()=>{t.lookupTable=fl.newInstance()},e.getColorModeAsString=()=>zt.enumToString(Pl,t.colorMode),e.setColorModeToDefault=()=>e.setColorMode(0),e.setColorModeToMapScalars=()=>e.setColorMode(1),e.setColorModeToDirectScalars=()=>e.setColorMode(2),e.getScalarModeAsString=()=>zt.enumToString(Il,t.scalarMode),e.setScalarModeToDefault=()=>e.setScalarMode(0),e.setScalarModeToUsePointData=()=>e.setScalarMode(1),e.setScalarModeToUseCellData=()=>e.setScalarMode(2),e.setScalarModeToUsePointFieldData=()=>e.setScalarMode(3),e.setScalarModeToUseCellFieldData=()=>e.setScalarMode(4),e.setScalarModeToUseFieldData=()=>e.setScalarMode(5),e.getAbstractScalars=(e,r,n,o,i)=>{if(!e||!t.scalarVisibility)return{scalars:null,cellFlag:!1};let a=null,s=!1;if(r===Il.DEFAULT)a=e.getPointData().getScalars(),a||(a=e.getCellData().getScalars(),s=!0);else if(r===Il.USE_POINT_DATA)a=e.getPointData().getScalars();else if(r===Il.USE_CELL_DATA)a=e.getCellData().getScalars(),s=!0;else if(r===Il.USE_POINT_FIELD_DATA){const t=e.getPointData();a=n===Ol.BY_ID?t.getArrayByIndex(o):t.getArrayByName(i)}else if(r===Il.USE_CELL_FIELD_DATA){const t=e.getCellData();s=!0,a=n===Ol.BY_ID?t.getArrayByIndex(o):t.getArrayByName(i)}else if(r===Il.USE_FIELD_DATA){const t=e.getFieldData();a=n===Ol.BY_ID?t.getArrayByIndex(o):t.getArrayByName(i)}return{scalars:a,cellFlag:s}},e.mapScalars=(r,n)=>{const{scalars:o,cellFlag:i}=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName);if(t.areScalarsMappedFromCells=i,!o)return t.colorCoordinates=null,t.colorTextureMap=null,void(t.colorMapColors=null);const a=`${e.getMTime()}${o.getMTime()}${n}`;if(t.colorBuildString!==a){if(t.useLookupTableScalarRange||e.getLookupTable().setRange(t.scalarRange[0],t.scalarRange[1]),e.canUseTextureMapForColoring(o,i))t.mapScalarsToTexture(o,i,n);else{t.colorCoordinates=null,t.colorTextureMap=null;const r=e.getLookupTable();r&&(r.build(),t.colorMapColors=r.mapScalars(o,t.colorMode,t.fieldDataTupleId))}t.colorBuildString=`${e.getMTime()}${o.getMTime()}${n}`}},t.mapScalarsToTexture=(r,n,o)=>{const i=t.lookupTable.getRange(),a=t.lookupTable.usingLogScale(),s=t.lookupTable.getAlpha(),l=a?[Math.log10(i[0]),Math.log10(i[1])]:i;if(t.colorMapColors=null,null==t.colorTextureMap||e.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getMTime()>t.colorTextureMap.getMTime()||t.lookupTable.getAlpha()!==o){t.lookupTable.setAlpha(o),t.colorTextureMap=null,t.lookupTable.build();const e=t.lookupTable.getNumberOfAvailableColors(),r=2048,i=2,u=n?r**3-3:4094;t.numberOfColorsInRange=Math.min(Math.max(e,i),u);const c=t.numberOfColorsInRange+3,d=t.numberOfColorsInRange+2,p=n?[Math.min(Math.ceil(c/r**0),r),Math.min(Math.ceil(c/r**1),r),Math.min(Math.ceil(c/r**2),r)]:[d,2,1],f=p[0]*p[1]*p[2],h=new Float64Array(f);h.fill(NaN);const m=t.numberOfColorsInRange,g=m+2,y=[0,0,0],v=l[0],b=l[1]-l[0];for(let e=0;e<g;++e){const t=v+b*(e-1)/(m-1),r=a?10**t:t;h[Bl(y,p)]=r,Fl(y,p)}const x=_s.newInstance({numberOfComponents:1,values:h}),_=t.lookupTable.mapScalars(x,t.colorMode,0);t.colorTextureMap=qs.newInstance(),t.colorTextureMap.setDimensions(p),t.colorTextureMap.getPointData().setScalars(_),t.lookupTable.setAlpha(s)}const u=t.lookupTable.getVectorMode()===Nl.MAGNITUDE&&r.getNumberOfComponents()>1?-1:t.lookupTable.getVectorComponent();t.colorCoordinates=function(e,t,r,n,o,i,a){const s=new Array(arguments.length);for(let e=0;e<arguments.length;++e){const t=arguments[e];s[e]=t.getMTime?.()??t}const l=s.join("/"),u=kl.get(e);if(u&&u.stringHash===l)return u.textureCoordinates;const c=(r[1]-r[0])/(o-1),[d,p]=[r[0]-c,r[1]+c],f=d-.5*c,h=1/(p-d+c),m=d,g=(o+1)/(p-d),y=e.getData(),v=e.getNumberOfTuples(),b=e.getNumberOfComponents(),x=t<0||t>=b,_=i[2]<=1?2:3,S=_s.newInstance({numberOfComponents:_,values:new Float32Array(v*_)}),C=S.getData(),T=[0,0,0];Ll(T,o+2,i);let w=0,A=0;const E=[.5,.5,.5];for(let e=0;e<v;++e){let e;if(x){let t=0;for(let e=0;e<b;++e){const r=Number(y[w+e]);t+=r*r}e=Math.sqrt(t)}else e=Number(y[w+t]);if(n&&(e=Math.log10(e)),w+=b,Ai(e))E[0]=T[0],E[1]=T[1],E[2]=T[2];else if(a){let t=(e-m)*g;t<1?t=0:t>o&&(t=o+1),Ll(E,t,i)}else{E[1]=.49;const t=(e-f)*h;E[0]=t>1e3?1e3:t<-1e3?-1e3:t}for(let e=0;e<_;++e)C[A++]=E[e]}return kl.set(e,{stringHash:l,textureCoordinates:S}),S}(r,u,l,a,t.numberOfColorsInRange,t.colorTextureMap.getDimensions(),n)},e.getIsOpaque=()=>{const r=e.getInputData(),n=e.getAbstractScalars(r,t.scalarMode,t.arrayAccessMode,t.arrayId,t.colorByArrayName).scalars;if(!t.scalarVisibility||null==n)return!0;const o=e.getLookupTable();return!o||(o.build(),o.areScalarsOpaque(n,t.colorMode,-1))},e.canUseTextureMapForColoring=(e,r)=>!((!r||t.colorMode===Pl.DIRECT_SCALARS)&&(!t.interpolateScalarsBeforeMapping||t.lookupTable&&t.lookupTable.getIndexedLookup()||!e||t.colorMode===Pl.DEFAULT&&e.getDataType()===Ml.UNSIGNED_CHAR||t.colorMode===Pl.DIRECT_SCALARS)),e.clearColorArrays=()=>{t.colorMapColors=null,t.colorCoordinates=null,t.colorTextureMap=null},e.getLookupTable=()=>(t.lookupTable||e.createDefaultLookupTable(),t.lookupTable),e.getMTime=()=>{let e=t.mtime;if(null!==t.lookupTable){const r=t.lookupTable.getMTime();e=r>e?r:e}return e},e.getPrimitiveCount=()=>{const t=e.getInputData();return{points:t.getPoints().getNumberOfValues()/3,verts:t.getVerts().getNumberOfValues()-t.getVerts().getNumberOfCells(),lines:t.getLines().getNumberOfValues()-2*t.getLines().getNumberOfCells(),triangles:t.getPolys().getNumberOfValues()-3*t.getPolys().getNumberOfCells()}},e.acquireInvertibleLookupTable=Rl("AcquireInvertibleLookupTable"),e.valueToColor=Rl("ValueToColor"),e.colorToValue=Rl("ColorToValue"),e.useInvertibleColorFor=Rl("UseInvertibleColorFor"),e.clearInvertibleColor=Rl("ClearInvertibleColor"),e.processSelectorPixelBuffers=(e,r)=>{if(!e||!t.selectionWebGLIdsToVTKIds||!t.populateSelectionSettings)return;const n=e.getRawPixelBuffer(Tl.ID_LOW24),o=e.getRawPixelBuffer(Tl.ID_HIGH24),i=e.getCurrentPass(),a=e.getFieldAssociation();let s=null;a===Al.FIELD_ASSOCIATION_POINTS?s=t.selectionWebGLIdsToVTKIds.points:a===Al.FIELD_ASSOCIATION_CELLS&&(s=t.selectionWebGLIdsToVTKIds.cells),s&&r.forEach(t=>{if(i===Tl.ID_LOW24){let r=0;o&&(r+=o[t],r*=256),r+=n[t+2],r*=256,r+=n[t+1],r*=256,r+=n[t];const i=s[r],a=e.getPixelBuffer(Tl.ID_LOW24);a[t]=255&i,a[t+1]=(65280&i)>>8,a[t+2]=(16711680&i)>>16}else if(i===Tl.ID_HIGH24&&o){let r=0;r+=o[t],r*=256,r+=n[t+2],r*=256,r+=n[t+1],r*=256,r+=n[t];const i=s[r];e.getPixelBuffer(Tl.ID_HIGH24)[t]=(4278190080&i)>>24}})}}(e,t)}var Gl={newInstance:zt.newInstance(Vl,"vtkMapper"),extend:Vl,...El,...Dl,...Qs};const{isVtkObject:zl}=zt;function jl(e){let t=0;return e.filter((e,r)=>r===t&&(t+=e+1,!0))}function Wl(e){let t=0;for(let r=0;r<e.length;)r+=e[r]+1,t++;return t}const Hl={extractCellSizes:jl,getNumberOfCells:Wl};function Kl(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_s.extend(e,t,function(e){return{empty:!0,numberOfComponents:1,dataType:us.UNSIGNED_INT,...e}}(r)),function(e,t){t.classHierarchy.push("vtkCellArray");const r={...e};e.getNumberOfCells=r=>void 0===t.numberOfCells||r?(t.cellSizes?t.numberOfCells=t.cellSizes.length:t.numberOfCells=Wl(e.getData()),t.numberOfCells):t.numberOfCells,e.getCellSizes=r=>void 0===t.cellSizes||r?(t.cellSizes=jl(e.getData()),t.cellSizes):t.cellSizes,e.resize=n=>{const o=e.getNumberOfTuples();r.resize(n);const i=e.getNumberOfTuples();i<o&&(0===i?(t.numberOfCells=0,t.cellSizes=[]):(t.numberOfCells=void 0,t.cellSizes=void 0))},e.setData=e=>{r.setData(e,1),t.numberOfCells=void 0,t.cellSizes=void 0},e.getCell=e=>{let r=e;const n=t.values[r++];return t.values.subarray(r,r+n)},e.insertNextCell=r=>{let n;n=zl(r)?r.getPointsIds():r;const o=e.getNumberOfCells();return e.insertNextTuples([n.length,...n]),++t.numberOfCells,null!=t.cellSizes&&t.cellSizes.push(n.length),o},e.getMaxCellSize=()=>e.getCellSizes().reduce((e,t)=>Math.max(e,t),0)}(e,t)}var Xl={newInstance:zt.newInstance(Kl,"vtkCellArray"),extend:Kl,...Hl};const{vtkErrorMacro:$l}=zt,ql={empty:!0,numberOfComponents:3,dataType:us.FLOAT,bounds:[1,-1,1,-1,1,-1]};function Yl(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ql,r),_s.extend(e,t,r),zt.getArray(e,t,["bounds"],6),function(e,t){let r=0;t.classHierarchy.push("vtkPoints"),e.getNumberOfPoints=e.getNumberOfTuples,e.setNumberOfPoints=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;e.getNumberOfPoints()!==r&&(t.size=r*n,t.values=zt.newTypedArray(t.dataType,t.size),e.setNumberOfComponents(n),e.modified())},e.setPoint=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];e.setTuple(t,n)},e.getPoint=e.getTuple,e.findPoint=e.findTuple,e.insertNextPoint=(t,r,n)=>e.insertNextTuple([t,r,n]),e.insertPoint=(t,r)=>e.insertTuple(t,r);const n=e.getBounds;e.getBounds=()=>(r<t.mtime&&e.computeBounds(),n());const o=e.getBoundsByReference;e.getBoundsByReference=()=>(r<t.mtime&&e.computeBounds(),o()),e.computeBounds=()=>{if(3===e.getNumberOfComponents()){const r=e.getRange(0);t.bounds[0]=r[0],t.bounds[1]=r[1];const n=e.getRange(1);t.bounds[2]=n[0],t.bounds[3]=n[1];const o=e.getRange(2);t.bounds[4]=o[0],t.bounds[5]=o[1]}else if(2===e.getNumberOfComponents()){const r=e.getRange(0);t.bounds[0]=r[0],t.bounds[1]=r[1];const n=e.getRange(1);t.bounds[2]=n[0],t.bounds[3]=n[1],t.bounds[4]=0,t.bounds[5]=0}else $l(`getBounds called on an array with components of ${e.getNumberOfComponents()}`),yi(t.bounds);r=zt.getCurrentGlobalMTime()},e.setNumberOfComponents(t.numberOfComponents<2?3:t.numberOfComponents)}(e,t)}var Jl={newInstance:zt.newInstance(Yl,"vtkPoints"),extend:Yl};const Ql={bounds:[-1,-1,-1,-1,-1,-1],pointsIds:[]};function Zl(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ql,r),zt.obj(e,t),t.points||(t.points=Jl.newInstance()),zt.get(e,t,["points","pointsIds"]),function(e,t){t.classHierarchy.push("vtkCell"),e.initialize=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){t.pointsIds=r;let n=t.points.getData();n.length!==3*t.pointsIds.length&&(n=zt.newTypedArray(e.getDataType(),3*t.pointsIds.length));const o=e.getData();t.pointsIds.forEach((e,t)=>{let r=3*e,i=3*t;n[i]=o[r],n[++i]=o[++r],n[++i]=o[++r]}),t.points.setData(n)}else{t.points=e,t.pointsIds=new Array(e.getNumberOfPoints());for(let r=e.getNumberOfPoints()-1;r>=0;--r)t.pointsIds[r]=r}},e.getBounds=()=>t.points.getBounds(),e.getLength2=()=>{const t=Va.getLengths(e.getBounds());return t[0]*t[0]+t[1]*t[1]+t[2]*t[2]},e.getParametricDistance=e=>{let t,r=0;for(let n=0;n<3;n++)t=e[n]<0?-e[n]:e[n]>1?e[n]-1:0,t>r&&(r=t);return r},e.getNumberOfPoints=()=>t.points.getNumberOfPoints(),e.deepCopy=e=>{e.initialize(t.points,t.pointsIds)},e.getCellDimension=()=>{},e.intersectWithLine=(e,t,r,n,o,i,a)=>{},e.evaluatePosition=(e,t,r,n,o,i)=>{zt.vtkErrorMacro("vtkCell.evaluatePosition is not implemented.")}}(e,t)}var eu={newInstance:zt.newInstance(Zl,"vtkCell"),extend:Zl};const tu={array:null,maxId:0,extend:0};function ru(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,tu,r),zt.obj(e,t),function(e,t){t.classHierarchy.push("vtkCellLinks"),e.buildLinks=r=>{const n=r.getPoints().getNumberOfPoints(),o=r.getNumberOfCells(),i=new Uint32Array(n);if(r.isA("vtkPolyData")){for(let t=0;t<o;++t){const{cellPointIds:n}=r.getCellPoints(t);n.forEach(t=>{e.incrementLinkCount(t)})}e.allocateLinks(n),t.maxId=n-1;for(let t=0;t<o;++t){const{cellPointIds:n}=r.getCellPoints(t);n.forEach(r=>{e.insertCellReference(r,i[r]++,t)})}}else{for(let t=0;t<o;t++)eu.newInstance().getPointsIds().forEach(t=>{e.incrementLinkCount(t)});e.allocateLinks(n),t.maxId=n-1;for(let t=0;t<o;++t)eu.newInstance().getPointsIds().forEach(r=>{e.insertCellReference(r,i[r]++,t)})}},e.allocate=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;t.array=Array(e).fill().map(()=>({ncells:0,cells:null})),t.extend=r,t.maxId=-1},e.initialize=()=>{t.array=null},e.getLink=e=>t.array[e],e.getNcells=e=>t.array[e].ncells,e.getCells=e=>t.array[e].cells,e.insertNextPoint=e=>{t.array.push({ncells:e,cells:Array(e)}),++t.maxId},e.insertNextCellReference=(e,r)=>{t.array[e].cells[t.array[e].ncells++]=r},e.deletePoint=e=>{t.array[e].ncells=0,t.array[e].cells=null},e.removeCellReference=(e,r)=>{t.array[r].cells=t.array[r].cells.filter(t=>t!==e),t.array[r].ncells=t.array[r].cells.length},e.addCellReference=(e,r)=>{t.array[r].cells[t.array[r].ncells++]=e},e.resizeCellList=(e,r)=>{t.array[e].cells.length=r},e.squeeze=()=>{!function(e,t){let r=t;for(t>=e.array.length&&(r+=e.array.length);r>e.array.length;)e.array.push({ncells:0,cells:null});e.array.length=r}(t,t.maxId+1)},e.reset=()=>{t.maxId=-1},e.deepCopy=e=>{t.array=[...e.array],t.extend=e.extend,t.maxId=e.maxId},e.incrementLinkCount=e=>{++t.array[e].ncells},e.allocateLinks=e=>{for(let r=0;r<e;++r)t.array[r].cells=new Array(t.array[r].ncells)},e.insertCellReference=(e,r,n)=>{t.array[e].cells[r]=n}}(e,t)}var nu={newInstance:zt.newInstance(ru,"vtkCellLinks"),extend:ru};const ou=0,iu=1,au=2,su=3,lu=4,uu=5,cu=6,du=7,pu=9,fu=21,hu=41,mu=42,gu=["vtkEmptyCell","vtkVertex","vtkPolyVertex","vtkLine","vtkPolyLine","vtkTriangle","vtkTriangleStrip","vtkPolygon","vtkPixel","vtkQuad","vtkTetra","vtkVoxel","vtkHexahedron","vtkWedge","vtkPyramid","vtkPentagonalPrism","vtkHexagonalPrism","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkQuadraticEdge","vtkQuadraticTriangle","vtkQuadraticQuad","vtkQuadraticTetra","vtkQuadraticHexahedron","vtkQuadraticWedge","vtkQuadraticPyramid","vtkBiQuadraticQuad","vtkTriQuadraticHexahedron","vtkQuadraticLinearQuad","vtkQuadraticLinearWedge","vtkBiQuadraticQuadraticWedge","vtkBiQuadraticQuadraticHexahedron","vtkBiQuadraticTriangle","vtkCubicLine","vtkQuadraticPolygon","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkConvexPointSet","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","UnknownClass","vtkParametricCurve","vtkParametricSurface","vtkParametricTriSurface","vtkParametricQuadSurface","vtkParametricTetraRegion","vtkParametricHexRegion","UnknownClass","UnknownClass","UnknownClass","vtkHigherOrderEdge","vtkHigherOrderTriangle","vtkHigherOrderQuad","vtkHigherOrderPolygon","vtkHigherOrderTetrahedron","vtkHigherOrderWedge","vtkHigherOrderPyramid","vtkHigherOrderHexahedron"],yu={getClassNameFromTypeId:function(e){return e<gu.length?gu[e]:"UnknownClass"},getTypeIdFromClassName:function(e){return gu.findIndex(e)},isLinear:function(e){return e<fu||e===hu||e===mu},hasSubCells:function(e){return e===cu||e===lu||e===au}},vu={size:0,maxId:-1,extend:1e3};function bu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vu,r),zt.obj(e,t),zt.get(e,t,["size","maxId","extend"]),zt.getArray(e,t,["typeArray","locationArray"]),function(e,t){t.classHierarchy.push("vtkCellTypes"),e.allocate=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:512,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;t.size=e>0?e:1,t.extend=r>0?r:1,t.maxId=-1,t.typeArray=new Uint8Array(e),t.locationArray=new Uint32Array(e)},e.insertCell=(e,r,n)=>{t.typeArray[e]=r,t.locationArray[e]=n,e>t.maxId&&(t.maxId=e)},e.insertNextCell=(r,n)=>(e.insertCell(++t.maxId,r,n),t.maxId),e.setCellTypes=(e,r,n)=>{t.size=e,t.typeArray=r,t.locationArray=n,t.maxId=e-1},e.getCellLocation=e=>t.locationArray[e],e.deleteCell=e=>{t.typeArray[e]=ou},e.getNumberOfTypes=()=>t.maxId+1,e.isType=t=>{const r=e.getNumberOfTypes();for(let n=0;n<r;++n)if(t===e.getCellType(n))return!0;return!1},e.insertNextType=t=>e.insertNextCell(t,-1),e.getCellType=e=>t.typeArray[e],e.reset=()=>{t.maxId=-1},e.deepCopy=r=>{e.allocate(r.getSize(),r.getExtend()),t.typeArray.set(r.getTypeArray()),t.locationArray.set(r.getLocationArray()),t.maxId=r.getMaxId()}}(e,t)}var xu={newInstance:zt.newInstance(bu,"vtkCellTypes"),extend:bu,...yu};const _u={NO_INTERSECTION:0,YES_INTERSECTION:1,ON_LINE:2};var Su={IntersectionState:_u};const{IntersectionState:Cu}=Su;function Tu(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const o={t:Number.MIN_VALUE,distance:0},i=[];let a;i[0]=r[0]-t[0],i[1]=r[1]-t[1],i[2]=r[2]-t[2];const s=i[0]*(e[0]-t[0])+i[1]*(e[1]-t[1])+i[2]*(e[2]-t[2]),l=Ro(i,i);let u=1e-5*s;return 0!==l&&(o.t=s/l),u<0&&(u=-u),-u<l&&l<u||l<=0||o.t<0?a=t:o.t>1?a=r:(a=i,i[0]=t[0]+o.t*i[0],i[1]=t[1]+o.t*i[1],i[2]=t[2]+o.t*i[2]),n&&(n[0]=a[0],n[1]=a[1],n[2]=a[2]),o.distance=Vo(a,e),o}function wu(e,t,r,n,o,i){const a=[],s=[],l=[];o[0]=0,i[0]=0,Io(t,e,a),Io(n,r,s),Io(r,e,l);const u=[Ro(a,a),-Ro(a,s),-Ro(a,s),Ro(s,s)],c=[];if(c[0]=Ro(a,l),c[1]=-Ro(s,l),0===ai(u,c,2)){let a=Number.MAX_VALUE;const s=[e,t,r,n],l=[r,r,e,e],u=[n,n,t,t];let c;i[0],i[0],o[0],o[0],o[0],o[0],i[0],i[0];for(let e=0;e<4;e++)c=Tu(s[e],l[e],u[e]),c.distance<a&&(a=c.distance,c.t);return Cu.ON_LINE}return o[0]=c[0],i[0]=c[1],o[0]>=0&&o[0]<=1&&i[0]>=0&&i[0]<=1?Cu.YES_INTERSECTION:Cu.NO_INTERSECTION}const Au={distanceToLine:Tu,intersection:wu},Eu={orientations:null};function Du(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Eu,r),eu.extend(e,t,r),zt.setGet(e,t,["orientations"]),function(e,t){t.classHierarchy.push("vtkLine"),e.getCellDimension=()=>1,e.intersectWithLine=(e,r,n,o,i)=>{const a={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null};i[1]=0,i[2]=0;const s=[],l=[],u=[];t.points.getPoint(0,l),t.points.getPoint(1,u);const c=[],d=[],p=wu(e,r,l,u,c,d);var f;if(a.t=c[0],a.betweenPoints=(f=a.t)>=0&&f<=1,i[0]=d[0],p===Cu.YES_INTERSECTION){for(let t=0;t<3;t++)o[t]=l[t]+i[0]*(u[t]-l[t]),s[t]=e[t]+a.t*(r[t]-e[t]);if(Vo(o,s)<=n*n)return a.intersect=1,a}else{let t;if(a.t<0)return t=Tu(e,l,u,o),t.distance<=n*n?(a.t=0,a.intersect=1,a.betweenPoints=!0,a):a;if(a.t>1)return t=Tu(r,l,u,o),t.distance<=n*n?(a.t=1,a.intersect=1,a.betweenPoints=!0,a):a;if(i[0]<0)return i[0]=0,t=Tu(l,e,r,o),a.t=t.t,t.distance<=n*n?(a.intersect=1,a):a;if(i[0]>1)return i[0]=1,t=Tu(u,e,r,o),a.t=t.t,t.distance<=n*n?(a.intersect=1,a):a}return a},e.evaluateLocation=(e,r,n)=>{const o=[],i=[];t.points.getPoint(0,o),t.points.getPoint(1,i);for(let t=0;t<3;t++)r[t]=o[t]+e[0]*(i[t]-o[t]);n[0]=1-e[0],n[1]=e[0]},e.evaluateOrientation=(e,r,n)=>!!t.orientations&&(Li(r,t.orientations[0],t.orientations[1],e[0]),n[0]=1-e[0],n[1]=e[0],!0)}(e,t)}var Pu={newInstance:zt.newInstance(Du,"vtkLine"),extend:Du,...Au,...Su};const Iu={};function Ou(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Iu,r),Gs.extend(e,t,r),zt.setGet(e,t,["points"]),function(e,t){t.classHierarchy.push("vtkPointSet"),t.points?t.points=Ge(t.points):t.points=Jl.newInstance(),e.getNumberOfPoints=()=>t.points.getNumberOfPoints(),e.getBounds=()=>t.points.getBounds(),e.computeBounds=()=>{e.getBounds()};const r=e.shallowCopy;e.shallowCopy=function(e){r(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]),t.points=Jl.newInstance(),t.points.shallowCopy(e.getPoints())};const n=e.getMTime;e.getMTime=()=>{const e=n();return Math.max(e,t.points?.getMTime()??e)};const o=e.initialize;e.initialize=()=>(t.points?.initialize(),o())}(e,t)}var Nu={newInstance:zt.newInstance(Ou,"vtkPointSet"),extend:Ou};const Mu={orientations:null,distanceFunction:function(e,t){var r=t[0]-e[0],n=t[1]-e[1],o=t[2]-e[2];return Math.hypot(r,n,o)}};function Ru(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mu,r),eu.extend(e,t,r),zt.setGet(e,t,["orientations","distanceFunction"]),t.distancesTime={},zt.obj(t.distancesTime,{mtime:0}),function(e,t){t.classHierarchy.push("vtkPolyLine");const r=Pu.newInstance();r.getPoints().setNumberOfPoints(2),e.getCellDimension=()=>1,e.intersectWithLine=(n,o,i,a,s,l,u)=>{const c={intersect:0,t:Number.MAX_VALUE,subId:0,betweenPoints:null},d=e.getNumberOfPoints()-1;let p=Number.MAX_VALUE;for(let e=0;e<d;e++){const d=[0,0,0];r.getPoints().getData().set(t.points.getData().subarray(3*e,3*(e+2)));const f=r.intersectWithLine(i,a,s,l,u);if(1===f.intersect&&f.t<=c.t+s&&f.t>=n&&f.t<=o){c.intersect=1;const t=r.getParametricDistance(d);if(t<p||t===p&&f.t<c.t){c.subId=e,c.t=f.t,p=t;for(let e=0;e<3;e++)l[e],d[e]}}}return c},e.evaluateLocation=(e,n,o,i)=>(r.getPoints().getData().set(t.points.getData().subarray(3*e,3*(e+2))),r.evaluateLocation(n,o,i)),e.evaluateOrientation=(e,n,o,i)=>(t.orientations?r.setOrientations([t.orientations[e],t.orientations[e+1]]):r.setOrientations(null),r.evaluateOrientation(n,o,i)),e.getDistancesToFirstPoint=()=>{const r=t.distancesTime.getMTime();if(r<t.points.getMTime()||r<e.getMTime()){const r=e.getNumberOfPoints();if(t.distances?t.distances.length=r:t.distances=new Array(r),r>0){const e=new Array(3),n=new Array(3);let o=0;t.distances[0]=o,t.points.getPoint(0,e);for(let i=1;i<r;++i)t.points.getPoint(i,n),o+=t.distanceFunction(e,n),t.distances[i]=o,hr(e,n)}t.distancesTime.modified()}return t.distances},e.findPointIdAtDistanceFromFirstPoint=t=>{const r=e.getDistancesToFirstPoint();if(r.length<2)return-1;let n=0,o=r.length-1;if(t<r[n]||t>r[o]||0===r[o])return-1;for(;o-n>1;){const e=Math.floor((n+o)/2);r[e]<=t?n=e:o=e}return n}}(e,t)}var Fu={newInstance:zt.newInstance(Ru,"vtkPolyLine"),extend:Ru};const Bu={elements:[]};function Lu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Bu,r),zt.obj(e,t),function(e,t){t.classHierarchy.push("vtkPriorityQueue"),e.push=(e,r)=>{const n=t.elements.findIndex(t=>t.priority>e);t.elements.splice(n,0,{priority:e,element:r})},e.pop=()=>t.elements.length>0?t.elements.shift().element:null,e.deleteById=e=>{t.elements=t.elements.filter(t=>{let{element:r}=t;return r.id!==e})},e.length=()=>t.elements.length}(e,t)}var ku={newInstance:zt.newInstance(Lu,"vtkPriorityQueue"),extend:Lu};const Uu=1e-6,Vu=1.1920929e-7,Gu={FAILURE:-1,OUTSIDE:0,INSIDE:1,INTERSECTION:2,ON_LINE:3};function zu(e,t,r,n,o){return(n[e]-r[e])*(o[t]-r[t])-(o[e]-r[e])*(n[t]-r[t])}const ju={PolygonWithPointIntersectionState:Gu,pointInPolygon:function(e,t,r,n){if(e[0]<r[0]||e[0]>r[1]||e[1]<r[2]||e[1]>r[3]||e[2]<r[4]||e[2]>r[5])return Gu.OUTSIDE;if(Lo(n)<=Vu)return Gu.FAILURE;let o=1e-8*((r[1]-r[0])*(r[1]-r[0])+(r[3]-r[2])*(r[3]-r[2])+(r[5]-r[4])*(r[5]-r[4]));o*=o,o=0===o?Vu:o;const i=[],a=[];for(let r=0;r<t.length;){if(i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],Vo(e,i)<=o)return Gu.INSIDE;const{distance:n,t:s}=Pu.distanceToLine(e,i,a);if(n<=o&&s>0&&s<1)return Gu.INSIDE}let s,l;Math.abs(n[0])>Math.abs(n[1])?Math.abs(n[0])>Math.abs(n[2])?(s=1,l=2):(s=0,l=1):Math.abs(n[1])>Math.abs(n[2])?(s=0,l=2):(s=0,l=1);let u=0;for(let r=0;r<t.length;)i[0]=t[r++],i[1]=t[r++],i[2]=t[r++],r<t.length?(a[0]=t[r],a[1]=t[r+1],a[2]=t[r+2]):(a[0]=t[0],a[1]=t[1],a[2]=t[2]),i[l]<=e[l]?a[l]>e[l]&&zu(s,l,i,a,e)>0&&++u:a[l]<=e[l]&&zu(s,l,i,a,e)<0&&--u;return 0===u?Gu.OUTSIDE:Gu.INSIDE},getBounds:function(e,t,r){const n=e.length,o=[];t.getPoint(e[0],o),r[0]=o[0],r[1]=o[0],r[2]=o[1],r[3]=o[1],r[4]=o[2],r[5]=o[2];for(let i=1;i<n;i++)t.getPoint(e[i],o),Va.addPoint(r,...o);const i=Va.getLengths(r);return Ro(i,i)},getNormal:function(e,t,r){r.length=3,r[0]=0,r[1]=0,r[2]=0;const n=[];let o=[],i=[];const a=[],s=[];t.getPoint(e[0],n),t.getPoint(e[1],o);for(let l=2;l<e.length;l++){t.getPoint(e[l],i),Io(i,o,a),Io(n,o,s);const u=[0,0,0];Fo(a,s,u),Po(r,u,r),[o,i]=[i,o]}return Lo(r)},computeCentroid:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];r[0]=0,r[1]=0,r[2]=0;const n=e.length,o=[];for(let i=0;i<n;i++)t.getPoint(e[i],o),r[0]+=o[0],r[1]+=o[1],r[2]+=o[2];return r[0]/=n,r[1]/=n,r[2]/=n,r}};function Wu(e,t){function r(e){const r=[0,0,0],n=[0,0,0],o=[0,0,0],i=[0,0,0];Io(e.point,e.previous.point,r),Io(e.next.point,e.point,n),Io(e.previous.point,e.next.point,o),Fo(r,n,i);const a=Ro(i,t.normal);if(a<=0)return-1;const s=Bo(r)+Bo(n)+Bo(o);return s*s/a}function n(e){if(t.pointCount<=3)return!0;const r=e.previous,n=e.next,o=[0,0,0];Io(n.point,r.point,o);const i=[0,0,0];if(Fo(o,t.normal,i),Lo(i),0===Bo(i))return!1;let a=ea.evaluate(i,r.point,n.next.point),s=a>Uu?1:a<-1e-6?-1:0,l=s<0?1:0;for(let e=n.next.next;e.id!==r.id;e=e.next){const t=e.previous;a=ea.evaluate(i,r.point,e.point);const o=a>Uu?1:a<-1e-6?-1:0;if(o!==s){if(l||(l=o<=0?1:0),Pu.intersection(r.point,n.point,e.point,t.point,[0],[0])===_u.YES_INTERSECTION)return!1;s=o}}return 1===l}function o(e,n){t.pointCount-=1;const o=e.previous,i=e.next;t.tris=t.tris.concat(e.point),t.tris=t.tris.concat(i.point),t.tris=t.tris.concat(o.point),o.next=i,i.previous=o,n.deleteById(o.id),n.deleteById(i.id);const a=r(o);a>0&&n.push(a,o);const s=r(i);s>0&&n.push(s,i),e.id===t.firstPoint.id&&(t.firstPoint=i)}t.classHierarchy.push("vtkPolygon"),e.triangulate=()=>t.firstPoint?function(){!function(){const e=[0,0,0],r=[0,0,0];t.normal=[0,0,0];const n=[...t.firstPoint.point];let o=t.firstPoint;for(let i=0;i<t.pointCount;i++){Io(o.point,n,e),Io(o.next.point,n,r);const i=[0,0,0];Fo(e,r,i),Po(t.normal,i,t.normal),o=o.next}Lo(t.normal)}();const e=ku.newInstance();let i=t.firstPoint;for(let n=0;n<t.pointCount;n++){const t=r(i);t>0&&e.push(t,i),i=i.next}for(;t.pointCount>2&&e.length()>0;)if(t.pointCount===e.length())o(e.pop(),e);else{const t=e.pop();n(t)&&o(t,e)}return t.pointCount<=2}():null,e.setPoints=e=>{t.pointCount=e.length,t.firstPoint={id:0,point:e[0],next:null,previous:null};let r=t.firstPoint;for(let n=1;n<t.pointCount;n++)r.next={id:n,point:e[n],next:null,previous:r},r=r.next;t.firstPoint.previous=r,r.next=t.firstPoint},e.getPointArray=()=>t.tris}const Hu={firstPoint:null,pointCount:0,tris:[]};function Ku(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hu,r),zt.obj(e,t),Wu(e,t)}var Xu={newInstance:zt.newInstance(Ku,"vtkPolygon"),extend:Ku,...ju};function $u(e,t,r,n){const o=r[0]-t[0],i=r[1]-t[1],a=r[2]-t[2],s=e[0]-t[0],l=e[1]-t[1],u=e[2]-t[2];n[0]=i*u-a*l,n[1]=a*s-o*u,n[2]=o*l-i*s}function qu(e,t,r,n){$u(e,t,r,n);const o=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);0!==o&&(n[0]/=o,n[1]/=o,n[2]/=o)}function Yu(e){e[0]=-1,e[1]=1,e[2]=0,e[3]=-1,e[4]=0,e[5]=1}const Ju={computeNormalDirection:$u,computeNormal:qu,interpolationDerivs:Yu,intersectWithTriangle:function(e,t,r,n,o,i){let a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1e-6,s=!1;const l=[],u=[],c=[],d=[],p=[];qu(e,t,r,d),qu(n,o,i,p);const f=-Ro(d,e),h=-Ro(p,n),m=[Ro(p,e)+h,Ro(p,t)+h,Ro(p,r)+h];if(m[0]*m[1]>a&&m[0]*m[2]>a)return{intersect:!1,coplanar:s,pt1:l,pt2:u,surfaceId:c};const g=[Ro(d,n)+f,Ro(d,o)+f,Ro(d,i)+f];if(g[0]*g[1]>a&&g[0]*g[2]>a)return{intersect:!1,coplanar:s,pt1:l,pt2:u,surfaceId:c};if(Math.abs(d[0]-p[0])<1e-9&&Math.abs(d[1]-p[1])<1e-9&&Math.abs(d[2]-p[2])<1e-9&&Math.abs(f-h)<1e-9)return s=!0,{intersect:!1,coplanar:s,pt1:l,pt2:u,surfaceId:c};const y=[e,t,r],v=[n,o,i],b=Ro(d,p),x=(f-h*b)/(b*b-1),_=(h-f*b)/(b*b-1),S=[x*d[0]+_*p[0],x*d[1]+_*p[1],x*d[2]+_*p[2]],C=Fo(d,p,[]);Lo(C);let T=0,w=0;const A=[],E=[];let D,P,I=50,O=50;for(let t=0;t<3;t++){const r=t,o=(t+1)%3,i=ea.intersectWithLine(y[r],y[o],n,p);i.intersection&&i.t>0-a&&i.t<1+a&&(i.t<1+a&&i.t>1-a&&(I=T),A[T++]=Ro(i.x,C)-Ro(S,C));const s=ea.intersectWithLine(v[r],v[o],e,d);s.intersection&&s.t>0-a&&s.t<1+a&&(s.t<1+a&&s.t>1-a&&(O=w),E[w++]=Ro(s.x,C)-Ro(S,C))}if(T>2){T--;const e=A[2];A[2]=A[I],A[I]=e}if(w>2){w--;const e=E[2];E[2]=E[O],E[O]=e}if(2!==T||2!==w)return{intersect:!1,coplanar:s,pt1:l,pt2:u,surfaceId:c};if(Number.isNaN(A[0])||Number.isNaN(A[1])||Number.isNaN(E[0])||Number.isNaN(E[1]))return{intersect:!1,coplanar:s,pt1:l,pt2:u,surfaceId:c};if(A[0]>A[1]){const e=A[1];A[1]=A[0],A[0]=e}if(E[0]>E[1]){const e=E[1];E[1]=E[0],E[0]=e}return A[1]<E[0]||E[1]<A[0]?{intersect:!1,coplanar:s,pt1:l,pt2:u,surfaceId:c}:(A[0]<E[0]?A[1]<E[1]?(c[0]=2,c[1]=1,D=E[0],P=A[1]):(c[0]=2,c[1]=2,D=E[0],P=E[1]):A[1]<E[1]?(c[0]=1,c[1]=1,D=A[0],P=A[1]):(c[0]=1,c[1]=2,D=A[0],P=E[1]),Mo(S,C,D,l),Mo(S,C,P,u),{intersect:!0,coplanar:s,pt1:l,pt2:u,surfaceId:c})}},Qu={};function Zu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qu,r),eu.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkTriangle"),e.getCellDimension=()=>2,e.intersectWithLine=(r,n,o,i,a)=>{const s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};a[2]=0;const l=[],u=o*o,c=[],d=[],p=[];t.points.getPoint(0,c),t.points.getPoint(1,d),t.points.getPoint(2,p);const f=[],h=[];if(qu(c,d,p,f),0!==f[0]||0!==f[1]||0!==f[2]){const t=ea.intersectWithLine(r,n,c,f);if(s.betweenPoints=t.betweenPoints,s.t=t.t,i[0]=t.x[0],i[1]=t.x[1],i[2]=t.x[2],!t.intersection)return a[0]=0,a[1]=0,s.intersect=0,s;const o=e.evaluatePosition(i,l,a,h);if(o.evaluation>=0)return o.dist2<=u?(s.intersect=1,s):(s.intersect=o.evaluation,s)}const m=Vo(c,d),g=Vo(d,p),y=Vo(p,c);t.line||(t.line=Pu.newInstance()),m>g&&m>y?(t.line.getPoints().setPoint(0,c),t.line.getPoints().setPoint(1,d)):g>y&&g>m?(t.line.getPoints().setPoint(0,d),t.line.getPoints().setPoint(1,p)):(t.line.getPoints().setPoint(0,p),t.line.getPoints().setPoint(1,c));const v=t.line.intersectWithLine(r,n,o,i,a);if(s.betweenPoints=v.betweenPoints,s.t=v.t,v.intersect){const e=[],t=[],r=[];for(let n=0;n<3;n++)e[n]=c[n]-p[n],t[n]=d[n]-p[n],r[n]=i[n]-p[n];return a[0]=Ro(r,e)/y,a[1]=Ro(r,t)/g,s.intersect=1,s}return a[0]=0,a[1]=0,s.intersect=0,s},e.evaluatePosition=(e,r,n,o)=>{const i={subId:0,dist2:0,evaluation:-1};let a,s;const l=[],u=[],c=[],d=[];let p;const f=[],h=[],m=[];let g=0,y=0;const v=[];let b,x,_,S=[];const C=[],T=[],w=[];i.subId=0,n[2]=0,t.points.getPoint(1,l),t.points.getPoint(2,u),t.points.getPoint(0,c),$u(l,u,c,d),ea.generalizedProjectPoint(e,l,d,w);let A=0;for(a=0;a<3;a++)p=d[a]<0?-d[a]:d[a],p>A&&(A=p,y=a);for(s=0,a=0;a<3;a++)a!==y&&(v[s++]=a);for(a=0;a<2;a++)f[a]=w[v[a]]-c[v[a]],h[a]=l[v[a]]-c[v[a]],m[a]=u[v[a]]-c[v[a]];if(g=jo(h,m),0===g)return n[0]=0,n[1]=0,i.evaluation=-1,i;if(n[0]=jo(f,m)/g,n[1]=jo(h,f)/g,o[0]=1-(n[0]+n[1]),o[1]=n[0],o[2]=n[1],o[0]>=0&&o[0]<=1&&o[1]>=0&&o[1]<=1&&o[2]>=0&&o[2]<=1)r&&(i.dist2=Vo(w,e),r[0]=w[0],r[1]=w[1],r[2]=w[2]),i.evaluation=1;else{let t;if(r)if(o[1]<0&&o[2]<0)for(b=Vo(e,c),x=Pu.distanceToLine(e,l,c,t,C),_=Pu.distanceToLine(e,c,u,t,T),b<x?(i.dist2=b,S=c):(i.dist2=x,S=C),_<i.dist2&&(i.dist2=_,S=T),a=0;a<3;a++)r[a]=S[a];else if(o[2]<0&&o[0]<0)for(b=Vo(e,l),x=Pu.distanceToLine(e,l,c,t,C),_=Pu.distanceToLine(e,l,u,t,T),b<x?(i.dist2=b,S=l):(i.dist2=x,S=C),_<i.dist2&&(i.dist2=_,S=T),a=0;a<3;a++)r[a]=S[a];else if(o[1]<0&&o[0]<0)for(b=Vo(e,u),x=Pu.distanceToLine(e,u,c,t,C),_=Pu.distanceToLine(e,l,u,t,T),b<x?(i.dist2=b,S=u):(i.dist2=x,S=C),_<i.dist2&&(i.dist2=_,S=T),a=0;a<3;a++)r[a]=S[a];else if(o[0]<0){const t=Pu.distanceToLine(e,l,u,r);i.dist2=t.distance}else if(o[1]<0){const t=Pu.distanceToLine(e,u,c,r);i.dist2=t.distance}else if(o[2]<0){const t=Pu.distanceToLine(e,l,c,r);i.dist2=t.distance}i.evaluation=0}return i},e.evaluateLocation=(e,r,n)=>{const o=[],i=[],a=[];t.points.getPoint(0,o),t.points.getPoint(1,i),t.points.getPoint(2,a);const s=1-e[0]-e[1];for(let t=0;t<3;t++)r[t]=o[t]*s+i[t]*e[0]+a[t]*e[1];n[0]=s,n[1]=e[0],n[2]=e[1]},e.getParametricDistance=e=>{let t,r=0;const n=[];n[0]=e[0],n[1]=e[1],n[2]=1-e[0]-e[1];for(let e=0;e<3;e++)t=n[e]<0?-n[e]:n[e]>1?n[e]-1:0,t>r&&(r=t);return r},e.derivatives=(e,r,n,o,i)=>{const a=t.points.getPoint(0),s=t.points.getPoint(1),l=t.points.getPoint(2),u=[],c=[],d=[],p=[];qu(a,s,l,u),Io(s,a,c),Io(l,a,p),Fo(u,c,d);const f=Lo(c);if(f<=0||Lo(d)<=0){for(let e=0;e<o;e++)for(let t=0;t<3;t++)i[e*o+t]=0;return}const h=[0,0],m=[f,0],g=[Ro(p,c),Ro(p,d)],y=new Array(6);Yu(y);const v=[m[0]-h[0],m[1]-h[1],g[0]-h[0],g[1]-h[1]],b=zt.newTypedArray(nt.Float64Array,4);si(v,b,2);for(let e=0;e<o;e++){let t=0,r=0;for(let i=0;i<3;i++)t+=y[i]*n[o*i+e],r+=y[3+i]*n[o*i+e];const a=t*b[0]+r*b[1],s=t*b[2]+r*b[3];i[3*e]=a*c[0]+s*d[0],i[3*e+1]=a*c[1]+s*d[1],i[3*e+2]=a*c[2]+s*d[2]}},e.cellBoundary=(e,r,n)=>{const o=r[0]-r[1],i=.5*(1-r[0])-r[1],a=2*r[0]+r[1]-1;return o>=0&&i>=0?(n[0]=t.pointsIds[0],n[1]=t.pointsIds[1]):i<0&&a>=0?(n[0]=t.pointsIds[1],n[1]=t.pointsIds[2]):(n[0]=t.pointsIds[2],n[1]=t.pointsIds[0]),!(r[0]<0||r[1]<0||r[0]>1||r[1]>1||1-r[0]-r[1]<0)}}(e,t)}var ec={newInstance:zt.newInstance(Zu,"vtkTriangle"),extend:Zu,...Ju};const tc={};function rc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,tc,r),eu.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkQuad"),e.getCellDimension=()=>2,e.getCellType=()=>pu,e.getNumberOfEdges=()=>4,e.getNumberOfFaces=()=>0,e.intersectWithLine=(e,r,n,o,i)=>{let a,s={subId:0,t:Number.MAX_VALUE,intersect:0,betweenPoints:!1};const l=t.points.getPoint(0,[]),u=t.points.getPoint(1,[]),c=t.points.getPoint(2,[]),d=t.points.getPoint(3,[]),p=Vo(l,c),f=Vo(u,d);if(p===f){let e,r=0,n=0;for(let o=0;o<4;o++)e=t.pointsIds[o],e>r&&(r=e,n=o);a=0===n||2===n?0:1}else a=p<f?0:1;let h,m=null;t.triangle?m=t.triangle.getPoints():(t.triangle=ec.newInstance(),m=Jl.newInstance(),m.setNumberOfPoints(3),t.triangle.initialize(m));const g=[0,0,0],y=[0,0,0];let v;const b=[0,0,0],x=[0,0,0];let _,S;switch(a){case 0:m.setPoint(0,...l),m.setPoint(1,...u),m.setPoint(2,...c),h=t.triangle.intersectWithLine(e,r,n,g,y),m.setPoint(0,...c),m.setPoint(1,...d),m.setPoint(2,...l),v=t.triangle.intersectWithLine(e,r,n,b,x),_=h.intersect&&v.intersect?h.t<=v.t:h.intersect,S=h.intersect&&v.intersect?v.t<h.t:v.intersect,_?(s=h,o[0]=g[0],o[1]=g[1],o[2]=g[2],i[0]=y[0]+y[1],i[1]=y[1],i[2]=y[2]):S&&(s=v,o[0]=b[0],o[1]=b[1],o[2]=b[2],i[0]=1-(x[0]+x[1]),i[1]=1-x[1],i[2]=x[2]);break;case 1:m.setPoint(0,...l),m.setPoint(1,...u),m.setPoint(2,...d),h=t.triangle.intersectWithLine(e,r,n,g,y),m.setPoint(0,...c),m.setPoint(1,...d),m.setPoint(2,...u),v=t.triangle.intersectWithLine(e,r,n,b,x),_=h.intersect&&v.intersect?h.t<=v.t:h.intersect,S=h.intersect&&v.intersect?v.t<h.t:v.intersect,_?(s=h,o[0]=g[0],o[1]=g[1],o[2]=g[2],i[0]=y[0],i[1]=y[1],i[2]=y[2]):S&&(s=v,o[0]=b[0],o[1]=b[1],o[2]=b[2],i[0]=1-x[0],i[1]=1-x[1],i[2]=x[2])}return s},e.interpolationFunctions=(e,t)=>{const r=1-e[0],n=1-e[1];t[0]=r*n,t[1]=e[0]*n,t[2]=e[0]*e[1],t[3]=r*e[1]},e.evaluateLocation=(r,n,o)=>{const i=[];e.interpolationFunctions(r,o),n[0]=0,n[1]=0,n[2]=0;for(let e=0;e<4;e++){t.points.getPoint(e,i);for(let t=0;t<3;t++)n[t]+=i[t]*o[e]}}}(e,t)}var nc={newInstance:zt.newInstance(rc,"vtkQuad"),extend:rc};const{vtkErrorMacro:oc}=zt;function ic(e){return()=>oc(`vtkTriangleStrip.${e} - NOT IMPLEMENTED`)}const ac={decomposeStrip:function(e,t){if(!Array.isArray(e)||e.length<3)return void oc("decomposeStrip - Invalid points array");let r=e[0],n=e[1];for(let o=0;o<e.length-2;o++){const i=e[o+2];o%2?t.insertNextCell([n,r,i]):t.insertNextCell([r,n,i]),r=n,n=i}}},sc={line:null,triangle:null,tris:null};function lc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sc,r),eu.extend(e,t,r),t.line||(t.line=Pu.newInstance()),t.triangle||(t.triangle=ec.newInstance()),function(e,t){t.classHierarchy.push("vtkTriangleStrip");const r=e.initialize;e.initialize=(e,n)=>{t.triangle.initialize(e,n),r(e,n)},e.getCellType=()=>cu,e.getCellDimension=()=>2,e.getNumberOfEdges=()=>t.pointsIds.length,e.getNumberOfFaces=()=>0,e.evaluatePosition=(e,r,n,o,i)=>{const a=[0,0,0];let s=Number.MAX_VALUE,l=0;const u=[],c=[],d=[];n[2]=0,c[0]=0,c[1]=0,c[2]=0;const p=t.triangle.getPoints();p.setNumberOfPoints(3);const f=t.triangle.getPointsIds().length;for(let e=0;e<f;e++)i[e]=0;for(let o=0;o<f-2;o++){const i=[];p.getPoint(o,i);const f=[];p.getPoint(o+1,f);const h=[];p.getPoint(o+2,h),p.setData(Float32Array.from([...i,...f,...h]),3);const m=t.triangle.evaluatePosition(e,d,a,u),g=m.dist2;m.evaluation>=0&&(g<s||g===s&&0===l)&&(l=m,r&&(r[0]=d[0],r[1]=d[1],r[2]=d[2]),n[0]=a[0],n[1]=a[1],s=g,c[0]=u[0],c[1]=u[1],c[2]=u[2])}return o[0]=s,i[0]=c[0],i[1]=c[1],i[2]=c[2],l},e.evaluateLocation=(e,r,n,o)=>{const i=[[0,1,2],[1,0,2]],a=e%2,s=t.pointsIds.length;for(let e=0;e<s;e++)o[e]=0;const l=1-r[0]-r[1];o[e]=l,o[e+1]=r[0],o[e+2]=r[1];const u=[];t.points.getPoint(e+i[a][0],u);const c=[];t.points.getPoint(e+i[a][1],c);const d=[];t.points.getPoint(e+i[a][2],d);for(let t=0;t<3;t++)n[t]=u[t]*o[e]+c[t]*o[e+1]+d[t]*o[e+2]},e.cellBoundary=(e,r,n)=>{const o=[[0,1,2],[1,0,2]],i=e%2,a=t.triangle.getPointsIds();return a[0]=t.pointsIds[o[i][0]],a[1]=t.pointsIds[o[i][1]],a[2]=t.pointsIds[o[i][2]],t.triangle.cellBoundary(0,r,n)},e.getEdge=e=>{let r,n;const o=t.pointsIds.length;return 0===e?(r=0,n=1):e===o-1?(r=e-1,n=e):(r=e-1,n=e+1),t.line.getPointsIds()[0]=t.pointsIds[r],t.line.getPointsIds()[1]=t.pointsIds[n],t.line.getPoints().setPoint(0,t.points.getPoint(r)),t.line.getPoints().setPoint(1,t.points.getPoint(n)),t.line},e.intersectWithLine=(e,r,n,o,i)=>{const a=t.pointsIds.length-2,s=t.triangle.getPoints();s.setNumberOfPoints(3);for(let l=0;l<a;l++){const a=[];t.points.getPoint(t.pointsIds[l],a);const u=[];t.points.getPoint(t.pointsIds[l+1],u);const c=[];t.points.getPoint(t.pointsIds[l+2],c),s.setData(Float32Array.from([...a,...u,...c]),3);const d=t.triangle.intersectWithLine(e,r,n,o,i);if(d.intersect)return d}return!1},e.triangulate=()=>{const e=t.points.getNumberOfPoints()-2;t.tris=new Array(3*e);const r=[[0,1,2],[1,0,2]];for(let n=0;n<e;n++){const e=n%2;for(let o=0;o<3;o++)t.tris[3*n+o]=n+r[e][o]}return!0},e.getPointArray=()=>t.tris,e.derivatives=(e,r,n,o,i)=>{const a=[];t.points.getPoint(e,a);const s=[];t.points.getPoint(e+1,s);const l=[];t.points.getPoint(e+2,l);const u=t.triangle.getPoints();u.setPoint(0,...a),u.setPoint(1,...s),u.setPoint(2,...l),t.triangle.derivatives(0,r,n,o,i)},e.getParametricCenter=e=>(e[0]=.333333,e[1]=.333333,e[2]=0,Math.floor((t.pointsIds.length-2)/2)),e.contour=(e,t,r,n,o,i,a,s,l,u,c)=>ic("contour")(),e.clip=(e,t,r,n,o,i,a,s,l,u)=>ic("clip")()}(e,t)}var uc={newInstance:zt.newInstance(lc,"vtkTriangleStrip"),extend:lc,...ac};const cc=["verts","lines","polys","strips"],{vtkWarningMacro:dc}=zt,pc={[su]:Pu,[pu]:nc,[lu]:Pu,[uu]:ec,[cu]:uc,[lu]:Fu,[du]:Xu},fc={};function hc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fc,r),Nu.extend(e,t,r),zt.get(e,t,["cells","links"]),zt.setGet(e,t,["verts","lines","polys","strips"]),function(e,t){function r(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,e=>e.toUpperCase()).replace(/\s+/g,"")}function n(){t.cells=void 0,t.links=void 0}t.classHierarchy.push("vtkPolyData"),cc.forEach(o=>{e[`getNumberOf${r(o)}`]=()=>t[o].getNumberOfCells(),t[o]?t[o]=Ge(t[o]):t[o]=Xl.newInstance(),t[`_on${r(o)}Changed`]=n}),e.getNumberOfCells=()=>cc.reduce((e,r)=>e+t[r].getNumberOfCells(),0);const o=e.shallowCopy;e.shallowCopy=function(e){o(e,arguments.length>1&&void 0!==arguments[1]&&arguments[1]),cc.forEach(r=>{t[r]=Xl.newInstance(),t[r].shallowCopy(e.getReferenceByName(r))})};const i=e.getMTime;e.getMTime=()=>cc.reduce((e,r)=>Math.max(e,t[r]?.getMTime()??e),i());const a=e.initialize;e.initialize=()=>(cc.forEach(e=>t[e]?.initialize()),n(),a()),e.buildCells=()=>{const r=e.getNumberOfVerts(),n=e.getNumberOfLines(),o=e.getNumberOfPolys(),i=e.getNumberOfStrips(),a=r+n+o+i,s=new Uint8Array(a);let l=s;const u=new Uint32Array(a);let c=u;if(r){let e=0;t.verts.getCellSizes().forEach((t,r)=>{c[r]=e,l[r]=t>1?au:iu,e+=t+1}),c=c.subarray(r),l=l.subarray(r)}if(n){let e=0;t.lines.getCellSizes().forEach((t,r)=>{c[r]=e,l[r]=t>2?lu:su,1===t&&dc("Building VTK_LINE ",r," with only one point, but VTK_LINE needs at least two points. Check the input."),e+=t+1}),c=c.subarray(n),l=l.subarray(n)}if(o){let e=0;t.polys.getCellSizes().forEach((t,r)=>{switch(c[r]=e,t){case 3:l[r]=uu;break;case 4:l[r]=pu;break;default:l[r]=du}t<3&&dc("Building VTK_TRIANGLE ",r," with less than three points, but VTK_TRIANGLE needs at least three points. Check the input."),e+=t+1}),c+=c.subarray(o),l+=l.subarray(o)}if(i){let e=0;l.fill(cu,0,i),t.strips.getCellSizes().forEach((t,r)=>{c[r]=e,e+=t+1})}t.cells=xu.newInstance(),t.cells.setCellTypes(a,s,u)},e.buildLinks=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;null==t.cells&&e.buildCells(),t.links=nu.newInstance(),r>0?t.links.allocate(r):t.links.allocate(e.getPoints().getNumberOfPoints()),t.links.buildLinks(e)},e.getCellType=e=>t.cells.getCellType(e),e.getCellPoints=r=>{const n=e.getCellType(r);let o=null;switch(n){case iu:case au:o=t.verts;break;case su:case lu:o=t.lines;break;case uu:case pu:case du:o=t.polys;break;case cu:o=t.strips;break;default:return o=null,{type:0,cellPointIds:null}}const i=t.cells.getCellLocation(r);return{cellType:n,cellPointIds:o.getCell(i)}},e.getPointCells=e=>t.links.getCells(e),e.getCellEdgeNeighbors=(e,r,n)=>{const o=t.links.getLink(r),i=t.links.getLink(n);return o.cells.filter(t=>t!==e&&-1!==i.cells.indexOf(t))},e.getCell=function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=e.getCellPoints(t),o=r||pc[n.cellType].newInstance();return o.initialize(e.getPoints(),n.cellPointIds),o},e.getMaxCellSize=()=>cc.reduce((e,r)=>Math.max(e,t[r]?.getMaxCellSize?.()??0),0)}(e,t)}var mc={newInstance:zt.newInstance(hc,"vtkPolyData"),extend:hc};const gc={image:null,canvas:null,jsImageData:null,imageBitmap:null,imageLoaded:!1,repeat:!1,interpolate:!1,edgeClamp:!1,mipLevel:0,resizable:!1};function yc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gc,r),zt.obj(e,t),zt.algo(e,t,6,0),zt.get(e,t,["canvas","image","jsImageData","imageBitmap","imageLoaded","resizable"]),zt.setGet(e,t,["repeat","edgeClamp","interpolate","mipLevel"]),function(e,t){t.classHierarchy.push("vtkTexture"),e.imageLoaded=()=>{t.image.removeEventListener("load",e.imageLoaded),t.imageLoaded=!0,e.modified()},e.setJsImageData=r=>{t.jsImageData!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.canvas=null,t.imageBitmap=null),t.jsImageData=r,t.imageLoaded=!0,e.modified())},e.setImageBitmap=r=>{t.imageBitmap!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.canvas=null,t.jsImageData=null),t.imageBitmap=r,t.imageLoaded=!0,e.modified())},e.setCanvas=r=>{t.canvas!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.image=null,t.imageBitmap=null,t.jsImageData=null),t.canvas=r,e.modified())},e.setImage=r=>{t.image!==r&&(null!==r&&(e.setInputData(null),e.setInputConnection(null),t.canvas=null,t.jsImageData=null,t.imageBitmap=null),t.image=r,t.imageLoaded=!1,r.complete?e.imageLoaded():r.addEventListener("load",e.imageLoaded),e.modified())},e.getDimensionality=()=>{let r=0,n=0,o=1;if(e.getInputData()){const t=e.getInputData();r=t.getDimensions()[0],n=t.getDimensions()[1],o=t.getDimensions()[2]}return t.jsImageData&&(r=t.jsImageData.width,n=t.jsImageData.height),t.canvas&&(r=t.canvas.width,n=t.canvas.height),t.image&&(r=t.image.width,n=t.image.height),t.imageBitmap&&(r=t.imageBitmap.width,n=t.imageBitmap.height),(r>1)+(n>1)+(o>1)},e.getInputAsJsImageData=()=>{if(!t.imageLoaded||e.getInputData())return null;if(t.jsImageData)return t.jsImageData;if(t.imageBitmap)return t.imageBitmap;if(t.canvas)return t.canvas.getContext("2d").getImageData(0,0,t.canvas.width,t.canvas.height);if(t.image){const e=t.image.width,r=t.image.height,n=new OffscreenCanvas(e,r).getContext("2d");return n.translate(0,r),n.scale(1,-1),n.drawImage(t.image,0,0,e,r),n.getImageData(0,0,e,r)}return null}}(e,t)}var vc={newInstance:zt.newInstance(yc,"vtkTexture"),extend:yc,generateMipmaps:(e,t,r)=>{const n=e.createShaderModule({code:"\n @group(0) @binding(0) var inputTexture: texture_2d<f32>;\n @group(0) @binding(1) var outputTexture: texture_storage_2d<rgba8unorm, write>;\n\n @compute @workgroup_size(8, 8)\n fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {\n let texelCoord = vec2<i32>(global_id.xy);\n let outputSize = textureDimensions(outputTexture);\n\n if (texelCoord.x >= i32(outputSize.x) || texelCoord.y >= i32(outputSize.y)) {\n return;\n }\n\n let inputSize = textureDimensions(inputTexture);\n let scale = vec2<f32>(inputSize) / vec2<f32>(outputSize);\n\n // Compute the floating-point source coordinate\n let srcCoord = (vec2<f32>(texelCoord) + 0.5) * scale - 0.5;\n\n // Get integer coordinates for the four surrounding texels\n let x0 = i32(floor(srcCoord.x));\n let x1 = min(x0 + 1, i32(inputSize.x) - 1);\n let y0 = i32(floor(srcCoord.y));\n let y1 = min(y0 + 1, i32(inputSize.y) - 1);\n\n // Compute the weights\n let wx = srcCoord.x - f32(x0);\n let wy = srcCoord.y - f32(y0);\n\n // Fetch the four texels\n let c00 = textureLoad(inputTexture, vec2<i32>(x0, y0), 0);\n let c10 = textureLoad(inputTexture, vec2<i32>(x1, y0), 0);\n let c01 = textureLoad(inputTexture, vec2<i32>(x0, y1), 0);\n let c11 = textureLoad(inputTexture, vec2<i32>(x1, y1), 0);\n\n // Bilinear interpolation\n let color = mix(\n mix(c00, c10, wx),\n mix(c01, c11, wx),\n wy\n );\n\n textureStore(outputTexture, texelCoord, color);\n }\n "}),o=e.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.COMPUTE,texture:{sampleType:"float"}},{binding:1,visibility:GPUShaderStage.COMPUTE,storageTexture:{format:"rgba8unorm",access:"write-only"}},{binding:2,visibility:GPUShaderStage.COMPUTE,sampler:{type:"filtering"}}]}),i=e.createPipelineLayout({bindGroupLayouts:[o]}),a=e.createComputePipeline({label:"ComputeMipmapPipeline",layout:i,compute:{module:n,entryPoint:"main"}}),s=e.createSampler({magFilter:"linear",minFilter:"linear"});for(let n=1;n<r;n++){const r=t.createView({baseMipLevel:n-1,mipLevelCount:1}),o=t.createView({baseMipLevel:n,mipLevelCount:1}),i=e.createBindGroup({layout:a.getBindGroupLayout(0),entries:[{binding:0,resource:r},{binding:1,resource:o},{binding:2,resource:s}]}),l=e.createCommandEncoder({label:"MipmapGenerateCommandEncoder"}),u=l.beginComputePass();u.setPipeline(a),u.setBindGroup(0,i);const c=Math.max(1,t.width>>n),d=Math.max(1,t.height>>n),p=Math.ceil(c/8),f=Math.ceil(d/8);u.dispatchWorkgroups(p,f),u.end(),e.queue.submit([l.finish()])}}};const bc=[[-1,0,0],[1,0,0],[0,-1,0],[0,1,0],[0,0,-1],[0,0,1]],xc=[[8,7,11,3],[9,1,10,5],[4,9,0,8],[2,11,6,10],[0,3,2,1],[4,5,6,7]],_c=[[0,1],[1,3],[2,3],[0,2],[4,5],[5,7],[6,7],[4,6],[0,4],[1,5],[3,7],[2,6]],Sc=[0,1,0,1,0,1,0,1,2,2,2,2],Cc=[[1,2],[1,2],[0,2],[0,2],[0,1],[0,1]],Tc=new Float64Array(3),wc=new Float64Array(3),Ac=new Float64Array(3),Ec=new Float64Array(3),Dc=new Float64Array(3),Pc=new Float64Array(3),Ic=new Float64Array(16);function Oc(e,t){e.strokeStyle=t.strokeColor,e.lineWidth=t.strokeSize,e.fillStyle=t.fontColor,e.font=`${t.fontStyle} ${t.fontSize}px ${t.fontFamily}`}function Nc(e){const t=[],r=[];for(let n=0;n<3;n++){const o=no().domain([e[2*n],e[2*n+1]]);t[n]=o.ticks(5);const i=o.tickFormat(5);r[n]=t[n].map(i)}return{ticks:t,tickStrings:r}}const Mc=zt.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),zt.obj(e,t),t.tmPolyData=mc.newInstance(),t.tmMapper=Gl.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmActor=ss.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),zt.setGet(e,t,["renderable"]),zt.get(e,t,["lastSize","lastAspectRatio","axisTextStyle","tickTextStyle","tmActor","ticks"]),t.forceUpdate=!1,t.lastRedrawTime={},zt.obj(t.lastRedrawTime,{mtime:0}),t.lastRebuildTime={},zt.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.lastTickBounds=[],function(e,t){t.classHierarchy.push("vtkCubeAxesActorHelper"),e.setRenderable=r=>{t.renderable!==r&&(t.renderable=r,t.tmActor.addTexture(t.renderable.getTmTexture()),t.tmActor.setProperty(r.getProperty()),t.tmActor.setParentProp(r),e.modified())},e.createPolyDataForOneLabel=(e,r,n,o,i,a,s)=>{const l=t.renderable.get_tmAtlas().get(e);if(!l)return;const u=t.renderable.getTextPolyData().getPoints().getData(),c=t.lastSize;Tc[0]=u[3*r],Tc[1]=u[3*r+1],Tc[2]=u[3*r+2],Sr(Ac,Tc,n),Ac[0]+=.1,Sr(wc,Ac,o),yr(Dc,wc,Tc),Ac[0]-=.1,Ac[1]+=.1,Sr(wc,Ac,o),yr(Pc,wc,Tc);for(let e=0;e<3;e++)Dc[e]/=.05*c[0],Pc[e]/=.05*c[1];let d=s.ptIdx,p=s.cellIdx;Tc[0]=u[3*r],Tc[1]=u[3*r+1],Tc[2]=u[3*r+2],i[0]<-.5?vr(Ac,Dc,i[0]*a-l.width):i[0]>.5?vr(Ac,Dc,i[0]*a):vr(Ac,Dc,i[0]*a-l.width/2),gr(Tc,Tc,Ac),vr(Ac,Pc,i[1]*a-l.height/2),gr(Tc,Tc,Ac),s.points[3*d]=Tc[0],s.points[3*d+1]=Tc[1],s.points[3*d+2]=Tc[2],s.tcoords[2*d]=l.tcoords[0],s.tcoords[2*d+1]=l.tcoords[1],d++,vr(Ac,Dc,l.width),gr(Tc,Tc,Ac),s.points[3*d]=Tc[0],s.points[3*d+1]=Tc[1],s.points[3*d+2]=Tc[2],s.tcoords[2*d]=l.tcoords[2],s.tcoords[2*d+1]=l.tcoords[3],d++,vr(Ac,Pc,l.height),gr(Tc,Tc,Ac),s.points[3*d]=Tc[0],s.points[3*d+1]=Tc[1],s.points[3*d+2]=Tc[2],s.tcoords[2*d]=l.tcoords[4],s.tcoords[2*d+1]=l.tcoords[5],d++,vr(Ac,Dc,l.width),yr(Tc,Tc,Ac),s.points[3*d]=Tc[0],s.points[3*d+1]=Tc[1],s.points[3*d+2]=Tc[2],s.tcoords[2*d]=l.tcoords[6],s.tcoords[2*d+1]=l.tcoords[7],d++,s.polys[4*p]=3,s.polys[4*p+1]=d-4,s.polys[4*p+2]=d-3,s.polys[4*p+3]=d-2,p++,s.polys[4*p]=3,s.polys[4*p+1]=d-4,s.polys[4*p+2]=d-2,s.polys[4*p+3]=d-1,s.ptIdx+=4,s.cellIdx+=2},e.updateTexturePolyData=()=>{const r=t.camera.getCompositeProjectionMatrix(t.lastAspectRatio,-1,1);m(r,r);const n=t.renderable.getTextValues().length,o=4*n,i=2*n,a=new Float64Array(3*o),s=new Uint16Array(4*i),l=new Float32Array(2*o);g(Ic,r);const u={ptIdx:0,cellIdx:0,polys:s,points:a,tcoords:l};let c=0,d=0,p=0;const f=t.renderable.getTextPolyData().getPoints().getData(),h=t.renderable.getTextValues();for(;c<f.length/3;){Tc[0]=f[3*c],Tc[1]=f[3*c+1],Tc[2]=f[3*c+2],Sr(Ac,Tc,r),Tc[0]=f[3*c+3],Tc[1]=f[3*c+4],Tc[2]=f[3*c+5],Sr(Ec,Tc,r),yr(Ac,Ac,Ec);const n=[Ac[0],Ac[1]];zo(n),e.createPolyDataForOneLabel(h[d],c,r,Ic,n,t.renderable.getAxisTitlePixelOffset(),u),c+=2,d++;for(let o=0;o<t.renderable.getTickCounts()[p];o++)e.createPolyDataForOneLabel(h[d],c,r,Ic,n,t.renderable.getTickLabelPixelOffset(),u),c++,d++;p++}const y=_s.newInstance({numberOfComponents:2,values:l,name:"TextureCoordinates"});t.tmPolyData.getPointData().setTCoords(y),t.tmPolyData.getPoints().setData(a,3),t.tmPolyData.getPoints().modified(),t.tmPolyData.getPolys().setData(s,1),t.tmPolyData.getPolys().modified(),t.tmPolyData.modified()},e.updateAPISpecificData=(r,n,o)=>{t.lastSize[0]===r[0]&&t.lastSize[1]===r[1]||(t.lastSize[0]=r[0],t.lastSize[1]=r[1],t.lastAspectRatio=r[0]/r[1],t.forceUpdate=!0),t.camera=n,e.updateTexturePolyData()}}(e,t)},"vtkCubeAxesActorHelper");function Rc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ss.extend(e,t,function(e,t,r){return{boundsScaleFactor:1.3,camera:null,dataBounds:[...Va.INIT_BOUNDS],faceVisibilityAngle:8,gridLines:!0,axisLabels:null,axisTitlePixelOffset:35,tickLabelPixelOffset:12,generateTicks:Nc,...r,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:18,fontFamily:"serif",...r?.axisTextStyle},tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:14,fontFamily:"serif",...r?.tickTextStyle}}}(0,0,r)),t.lastFacesToDraw=[!1,!1,!1,!1,!1,!1],t.axisLabels=["X-Axis","Y-Axis","Z-Axis"],t.tickCounts=[],t.textValues=[],t.lastTickBounds=[],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.tmTexture=vc.newInstance({resizable:!0}),t.tmTexture.setInterpolate(!1),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),t.gridMapper=Gl.newInstance(),t.polyData=mc.newInstance(),t.gridMapper.setInputData(t.polyData),t.gridActor=ss.newInstance(),t.gridActor.setMapper(t.gridMapper),t.gridActor.setProperty(e.getProperty()),t.gridActor.setParentProp(e),t.textPolyData=mc.newInstance(),zt.setGet(e,t,["axisTitlePixelOffset","boundsScaleFactor","faceVisibilityAngle","gridLines","tickLabelPixelOffset","generateTicks"]),zt.setGetArray(e,t,["dataBounds"],6),zt.setGetArray(e,t,["axisLabels"],3),zt.get(e,t,["axisTextStyle","tickTextStyle","camera","tmTexture","textValues","textPolyData","tickCounts","gridActor"]),function(e,t){t.classHierarchy.push("vtkCubeAxesActor"),e.setCamera=r=>{t.camera!==r&&(t.cameraModifiedSub&&(t.cameraModifiedSub.unsubscribe(),t.cameraModifiedSub=null),t.camera=r,r&&(t.cameraModifiedSub=r.onModified(e.update)),e.update(),e.modified())},e.computeFacesToDraw=()=>{const e=t.camera.getViewMatrix();m(e,e);let r=!1;const n=Va.getDiagonalLength(t.dataBounds),o=Math.sin(t.faceVisibilityAngle*Math.PI/180);for(let i=0;i<6;i++){let a=!1;const s=Math.floor(i/2),l=(s+1)%3,u=(s+2)%3;t.dataBounds[2*l]!==t.dataBounds[2*l+1]&&t.dataBounds[2*u]!==t.dataBounds[2*u+1]&&(Tc[s]=t.dataBounds[i]-.1*n*bc[i][s],Tc[l]=.5*(t.dataBounds[2*l]+t.dataBounds[2*l+1]),Tc[u]=.5*(t.dataBounds[2*u]+t.dataBounds[2*u+1]),Sr(Ac,Tc,e),Tc[s]=t.dataBounds[i],Sr(Ec,Tc,e),yr(Ac,Ec,Ac),br(Ac,Ac),a=Ac[2]>o,t.camera.getParallelProjection()||(br(Ec,Ec),a=xr(Ec,Ac)>o)),a!==t.lastFacesToDraw[i]&&(t.lastFacesToDraw[i]=a,r=!0)}return r},e.updatePolyData=(e,r,n)=>{let o=0,i=0;o+=8;let a=0;for(let e=0;e<12;e++)r[e]>0&&a++;if(i+=a,t.gridLines)for(let t=0;t<6;t++)e[t]&&(o+=2*n[Cc[t][0]].length+2*n[Cc[t][1]].length,i+=n[Cc[t][0]].length+n[Cc[t][1]].length);const s=new Float64Array(3*o),l=new Uint32Array(3*i);let u=0,c=0;for(let e=0;e<2;e++)for(let r=0;r<2;r++)for(let n=0;n<2;n++)s[3*u]=t.dataBounds[n],s[3*u+1]=t.dataBounds[2+r],s[3*u+2]=t.dataBounds[4+e],u++;for(let e=0;e<12;e++)r[e]>0&&(l[3*c]=2,l[3*c+1]=_c[e][0],l[3*c+2]=_c[e][1],c++);if(t.gridLines)for(let r=0;r<6;r++)if(e[r]){const e=Math.floor(r/2);let o=n[Cc[r][0]];for(let n=0;n<o.length;n++)s[3*u+e]=t.dataBounds[r],s[3*u+Cc[r][0]]=o[n],s[3*u+Cc[r][1]]=t.dataBounds[2*Cc[r][1]],u++,s[3*u+e]=t.dataBounds[r],s[3*u+Cc[r][0]]=o[n],s[3*u+Cc[r][1]]=t.dataBounds[2*Cc[r][1]+1],u++,l[3*c]=2,l[3*c+1]=u-2,l[3*c+2]=u-1,c++;o=n[Cc[r][1]];for(let n=0;n<o.length;n++)s[3*u+e]=t.dataBounds[r],s[3*u+Cc[r][1]]=o[n],s[3*u+Cc[r][0]]=t.dataBounds[2*Cc[r][0]],u++,s[3*u+e]=t.dataBounds[r],s[3*u+Cc[r][1]]=o[n],s[3*u+Cc[r][0]]=t.dataBounds[2*Cc[r][0]+1],u++,l[3*c]=2,l[3*c+1]=u-2,l[3*c+2]=u-1,c++}t.polyData.getPoints().setData(s,3),t.polyData.getPoints().modified(),t.polyData.getLines().setData(l,1),t.polyData.getLines().modified(),t.polyData.modified()},e.updateTextData=(e,r,n,o)=>{let i=0;for(let e=0;e<12;e++)1===r[e]&&(i+=2,i+=n[Sc[e]].length);const a=t.polyData.getPoints().getData(),s=new Float64Array(3*i);let l=0,u=0,c=0;for(let i=0;i<6;i++)if(e[i])for(let e=0;e<4;e++){const d=xc[i][e];if(1===r[d]){const e=Sc[d],r=3*_c[d][0],p=3*_c[d][1];s[3*l]=.5*(a[r]+a[p]),s[3*l+1]=.5*(a[r+1]+a[p+1]),s[3*l+2]=.5*(a[r+2]+a[p+2]),l++,s[3*l+Math.floor(i/2)]=t.dataBounds[i],s[3*l+Cc[i][0]]=.5*(t.dataBounds[2*Cc[i][0]]+t.dataBounds[2*Cc[i][0]+1]),s[3*l+Cc[i][1]]=.5*(t.dataBounds[2*Cc[i][1]]+t.dataBounds[2*Cc[i][1]+1]),l++,t.textValues[u]=t.axisLabels[e],u++;const f=(e+1)%3,h=(e+2)%3,m=n[e],g=o[e];t.tickCounts[c]=m.length;for(let n=0;n<m.length;n++)s[3*l+e]=m[n],s[3*l+f]=a[r+f],s[3*l+h]=a[r+h],l++,t.textValues[u]=g[n],u++;c++}}t.textPolyData.getPoints().setData(s,3),t.textPolyData.modified()},e.update=()=>{if(!t.camera)return;const r=e.computeFacesToDraw(),n=t.lastFacesToDraw;let o=!1;for(let e=0;e<6;e++)t.dataBounds[e]!==t.lastTickBounds[e]&&(o=!0,t.lastTickBounds[e]=t.dataBounds[e]);if(r||o||t.forceUpdate){const r=new Array(12).fill(0);for(let e=0;e<6;e++)if(n[e])for(let t=0;t<4;t++)r[xc[e][t]]++;const i=t.generateTicks(t.dataBounds);e.updatePolyData(n,r,i.ticks),e.updateTextData(n,r,i.ticks,i.tickStrings),(o||t.forceUpdate)&&e.updateTextureAtlas(i.tickStrings)}t.forceUpdate=!1},e.updateTextureAtlas=e=>{t.tmContext.textBaseline="bottom",t.tmContext.textAlign="left",t._tmAtlas.clear();let r=0,n=1;for(let o=0;o<3;o++){if(!t._tmAtlas.has(t.axisLabels[o])){Oc(t.tmContext,t.axisTextStyle);const e=t.tmContext.measureText(t.axisLabels[o]),i={height:e.actualBoundingBoxAscent+2,startingHeight:n,width:e.width+2,textStyle:t.axisTextStyle};t._tmAtlas.set(t.axisLabels[o],i),n+=i.height,r<i.width&&(r=i.width)}Oc(t.tmContext,t.tickTextStyle);for(let i=0;i<e[o].length;i++)if(!t._tmAtlas.has(e[o][i])){const a=t.tmContext.measureText(e[o][i]),s={height:a.actualBoundingBoxAscent+2,startingHeight:n,width:a.width+2,textStyle:t.tickTextStyle};t._tmAtlas.set(e[o][i],s),n+=s.height,r<s.width&&(r=s.width)}}r=Ao(r),n=Ao(n),t._tmAtlas.forEach(e=>{e.tcoords=[0,(n-e.startingHeight-e.height)/n,e.width/r,(n-e.startingHeight-e.height)/n,e.width/r,(n-e.startingHeight)/n,0,(n-e.startingHeight)/n]}),t.tmCanvas.width=r,t.tmCanvas.height=n,t.tmContext.textBaseline="bottom",t.tmContext.textAlign="left",t.tmContext.clearRect(0,0,r,n),t._tmAtlas.forEach((e,r)=>{Oc(t.tmContext,e.textStyle),t.tmContext.fillText(r,1,e.startingHeight+e.height-1)}),t.tmTexture.setCanvas(t.tmCanvas),t.tmTexture.modified()},e.onModified(()=>{t.forceUpdate=!0,e.update()}),e.setTickTextStyle=r=>{t.tickTextStyle={...t.tickTextStyle,...r},e.modified()},e.setAxisTextStyle=r=>{t.axisTextStyle={...t.axisTextStyle,...r},e.modified()},e.get_tmAtlas=()=>t._tmAtlas,e.getBounds=()=>(e.update(),Va.setBounds(t.bounds,t.gridActor.getBounds()),Va.scaleAboutCenter(t.bounds,t.boundsScaleFactor,t.boundsScaleFactor,t.boundsScaleFactor),t.bounds);const r=zt.chain(e.setProperty,t.gridActor.setProperty);e.setProperty=e=>r(e)[0]}(e,t)}var Fc={newInstance:zt.newInstance(Rc,"vtkCubeAxesActor"),extend:Rc,newCubeAxesActorHelper:Mc,defaultGenerateTicks:Nc};const Bc={};const Lc=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Bc,r),Xt.extend(e,t,r),t.CubeAxesActorHelper=Fc.newCubeAxesActorHelper(),function(e,t){t.classHierarchy.push("vtkOpenGLCubeAxesActor"),e.buildPass=r=>{r&&(t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=(e,r)=>{if(e){const e=t._openGLRenderer?t._openGLRenderer.getRenderable().getActiveCamera():null,r=t._openGLRenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([r.usize,r.vsize],e,t._openGLRenderWindow.getRenderable())}}}(e,t)},"vtkOpenGLCubeAxesActor");Qt("vtkCubeAxesActor",Lc);const kc={ARRAY_BUFFER:0,ELEMENT_ARRAY_BUFFER:1,TEXTURE_BUFFER:2};var Uc={ObjectType:kc};const{ObjectType:Vc}=Uc,Gc={objectType:Vc.ARRAY_BUFFER,context:null,allocatedGPUMemoryInBytes:0};function zc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Gc,r),zt.obj(e,t),zt.get(e,t,["_openGLRenderWindow","allocatedGPUMemoryInBytes"]),zt.moveToProtected(e,t,["openGLRenderWindow"]),function(e,t){function r(e){switch(e){case Vc.ELEMENT_ARRAY_BUFFER:return t.context.ELEMENT_ARRAY_BUFFER;case Vc.TEXTURE_BUFFER:if("TEXTURE_BUFFER"in t.context)return t.context.TEXTURE_BUFFER;case Vc.ARRAY_BUFFER:default:return t.context.ARRAY_BUFFER}}t.classHierarchy.push("vtkOpenGLBufferObject");let n=null,o=null,i=!0,a="";e.getType=()=>n,e.setType=e=>{n=e},e.getHandle=()=>o,e.isReady=()=>!1===i,e.generateBuffer=e=>{const i=r(e);return null===o&&(o=t.context.createBuffer(),n=e),r(n)===i},e.upload=(s,l)=>e.generateBuffer(l)?(t.context.bindBuffer(r(n),o),t.context.bufferData(r(n),s,t.context.STATIC_DRAW),t.allocatedGPUMemoryInBytes=s.length*s.BYTES_PER_ELEMENT,i=!1,!0):(a="Trying to upload array buffer to incompatible buffer.",!1),e.bind=()=>!!o&&(t.context.bindBuffer(r(n),o),!0),e.release=()=>!!o&&(t.context.bindBuffer(r(n),null),!0),e.releaseGraphicsResources=()=>{null!==o&&(t.context.bindBuffer(r(n),null),t.context.deleteBuffer(o),o=null,t.allocatedGPUMemoryInBytes=0)},e.setOpenGLRenderWindow=r=>{t._openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t._openGLRenderWindow=r,t.context=null,r&&(t.context=t._openGLRenderWindow.getContext()))},e.getError=()=>a}(e,t)}var jc={newInstance:zt.newInstance(zc),extend:zc,...Uc};const{vtkErrorMacro:Wc}=zt;function Hc(e,t){t.classHierarchy.push("vtkOpenGLCellArrayBufferObject"),e.setType(kc.ARRAY_BUFFER),e.createVBO=function(r,n,o,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(!r.getData()||!r.getData().length)return t.elementCount=0,0;t.blockSize=3,t.vertexOffset=0,t.normalOffset=0,t.tCoordOffset=0,t.tCoordComponents=0,t.colorComponents=0,t.colorOffset=0,t.customData=[];const s=i.points.getData();let l=null,u=null,c=null;const d=i.colors?i.colors.getNumberOfComponents():0,p=i.tcoords?i.tcoords.getNumberOfComponents():0;i.normals&&(t.normalOffset=4*t.blockSize,t.blockSize+=3,l=i.normals.getData()),i.customAttributes&&i.customAttributes.forEach(e=>{e&&(t.customData.push({data:e.getData(),offset:4*t.blockSize,components:e.getNumberOfComponents(),name:e.getName()}),t.blockSize+=e.getNumberOfComponents())}),i.tcoords&&(t.tCoordOffset=4*t.blockSize,t.tCoordComponents=p,t.blockSize+=p,u=i.tcoords.getData()),i.colors?(t.colorComponents=i.colors.getNumberOfComponents(),t.colorOffset=0,c=i.colors.getData(),t.colorBO||(t.colorBO=jc.newInstance()),t.colorBO.setOpenGLRenderWindow(t._openGLRenderWindow)):t.colorBO=null,t.stride=4*t.blockSize;let f,h=0,m=0,g=0,y=0,v=0,b=0;const x={anythingToPoints(e,t,r,n){for(let o=0;o<e;++o)f(t[r+o],n)},linesToWireframe(e,t,r,n){for(let o=0;o<e-1;++o)f(t[r+o],n),f(t[r+o+1],n)},polysToWireframe(e,t,r,n){if(e>2)for(let o=0;o<e;++o)f(t[r+o],n),f(t[r+(o+1)%e],n)},stripsToWireframe(e,t,r,n){if(e>2){for(let o=0;o<e-1;++o)f(t[r+o],n),f(t[r+o+1],n);for(let o=0;o<e-2;o++)f(t[r+o],n),f(t[r+o+2],n)}},polysToSurface(e,t,r,n){for(let o=0;o<e-2;o++)f(t[r+0],n),f(t[r+o+1],n),f(t[r+o+2],n)},stripsToSurface(e,t,r,n){for(let o=0;o<e-2;o++)f(t[r+o],n),f(t[r+o+1+o%2],n),f(t[r+o+1+(o+1)%2],n)}},_={anythingToPoints:(e,t)=>e,linesToWireframe:(e,t)=>e>1?2*(e-1):0,polysToWireframe:(e,t)=>e>2?2*e:0,stripsToWireframe:(e,t)=>e>2?4*e-6:0,polysToSurface:(e,t)=>e>2?3*(e-2):0,stripsToSurface:(e,t,r)=>e>2?3*(e-2):0};let S=null,C=null;o===Ja.POINTS||"verts"===n?(S=x.anythingToPoints,C=_.anythingToPoints):o===Ja.WIREFRAME||"lines"===n?(S=x[`${n}ToWireframe`],C=_[`${n}ToWireframe`]):(S=x[`${n}ToSurface`],C=_[`${n}ToSurface`]);const T=r.getData(),w=T.length;let A=0;for(let e=0;e<w;)A+=C(T[e],T),e+=T[e]+1;let E=null;const D=new Float32Array(A*t.blockSize);c&&(E=new Uint8Array(4*A));let P=0,I=0;const{useShiftAndScale:O,coordShift:N,coordScale:M}=function(e){let t=0,r=0;for(let n=0;n<3;++n){const o=e.getRange(n),i=o[1]-o[0];t+=i*i;const a=.5*(o[1]+o[0]);r+=a*a}const n=t>0&&(Math.abs(r)/t>1e6||Math.abs(Math.log10(t))>3||0===t&&r>1e6);if(n){const t=new Float64Array(3),r=new Float64Array(3);for(let n=0;n<3;++n){const o=e.getRange(n),i=o[1]-o[0];t[n]=.5*(o[1]+o[0]),r[n]=i>0?1/i:1}return{useShiftAndScale:n,coordShift:t,coordScale:r}}return{useShiftAndScale:n,coordShift:new Float32Array([0,0,0]),coordScale:new Float32Array([1,1,1])}}(i.points);if(O?e.setCoordShiftAndScale(N,M):!0===t.coordShiftAndScaleEnabled&&e.setCoordShiftAndScale(null,null),a)if(a.points||a.cells){const e=new Int32Array(A+a.points.length);e.set(a.points),a.points=e;const t=new Int32Array(A+a.cells.length);t.set(a.cells),a.cells=t}else a.points=new Int32Array(A),a.cells=new Int32Array(A);let R=i.vertexOffset;f=function(e,r){if(a&&(a.points[R]=e,a.cells[R]=b+i.cellOffset),++R,h=3*e,t.coordShiftAndScaleEnabled?(D[P++]=(s[h++]-t.coordShift[0])*t.coordScale[0],D[P++]=(s[h++]-t.coordShift[1])*t.coordScale[1],D[P++]=(s[h++]-t.coordShift[2])*t.coordScale[2]):(D[P++]=s[h++],D[P++]=s[h++],D[P++]=s[h++]),null!==l&&(m=i.haveCellNormals?3*(b+i.cellOffset):3*e,D[P++]=l[m++],D[P++]=l[m++],D[P++]=l[m++]),t.customData.forEach(t=>{v=e*t.components;for(let e=0;e<t.components;++e)D[P++]=t.data[v++]}),null!==u){g=i.useTCoordsPerCell?r*p:e*p;for(let e=0;e<p;++e)D[P++]=u[g++]}null!==c&&(y=i.haveCellScalars?(b+i.cellOffset)*d:e*d,E[I++]=c[y++],E[I++]=c[y++],E[I++]=c[y++],E[I++]=4===d?c[y++]:255)};for(let e=0;e<w;e+=T[e]+1,b++)S(T[e],T,e+1,b+i.cellOffset);return t.elementCount=A,e.upload(D,kc.ARRAY_BUFFER),t.colorBO&&(t.colorBOStride=4,t.colorBO.upload(E,kc.ARRAY_BUFFER)),b},e.setCoordShiftAndScale=(e,r)=>{null===e||e.constructor===Float64Array&&3===e.length?null===r||r.constructor===Float64Array&&3===r.length?(null!==t.coordShift&&null!==e&&Tr(e,t.coordShift)||(t.coordShift=e),null!==t.coordScale&&null!==r&&Tr(r,t.coordScale)||(t.coordScale=r),t.coordShiftAndScaleEnabled=function(e,t){return null!==e&&null!==t&&!(Cr(e,[0,0,0])&&Cr(t,[1,1,1]))}(t.coordShift,t.coordScale),t.coordShiftAndScaleEnabled?t.inverseShiftAndScaleMatrix=function(e,t){const r=new Float64Array(3);var n,o;o=t,(n=r)[0]=1/o[0],n[1]=1/o[1],n[2]=1/o[2];const i=new Float64Array(16);return L(i,Mi(),e,r),i}(t.coordShift,t.coordScale):t.inverseShiftAndScaleMatrix=null):Wc("Wrong type for coordScale, expected vec3 or null"):Wc("Wrong type for coordShift, expected vec3 or null")}}const Kc={elementCount:0,stride:0,colorBOStride:0,vertexOffset:0,normalOffset:0,tCoordOffset:0,tCoordComponents:0,colorOffset:0,colorComponents:0,tcoordBO:null,customData:[],coordShift:null,coordScale:null,coordShiftAndScaleEnabled:!1,inverseShiftAndScaleMatrix:null};function Xc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Kc,r),jc.extend(e,t,r),zt.setGet(e,t,["colorBO","elementCount","stride","colorBOStride","vertexOffset","normalOffset","tCoordOffset","tCoordComponents","colorOffset","colorComponents","customData"]),zt.get(e,t,["coordShift","coordScale","coordShiftAndScaleEnabled","inverseShiftAndScaleMatrix"]),Hc(e,t)}var $c={newInstance:zt.newInstance(Xc),extend:Xc};const{vtkErrorMacro:qc}=zt,Yc={shaderType:"Unknown",source:"",error:"",handle:0,dirty:!1,context:null};function Jc(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yc,r),zt.obj(e,t),zt.setGet(e,t,["shaderType","source","error","handle","context"]),function(e,t){t.classHierarchy.push("vtkShader"),e.compile=()=>{let e=t.context.VERTEX_SHADER;if(!t.source||!t.source.length||"Unknown"===t.shaderType)return!1;if(0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0),e="Fragment"===t.shaderType?t.context.FRAGMENT_SHADER:t.context.VERTEX_SHADER,t.handle=t.context.createShader(e),t.context.shaderSource(t.handle,t.source),t.context.compileShader(t.handle),!t.context.getShaderParameter(t.handle,t.context.COMPILE_STATUS)){const e=t.context.getShaderInfoLog(t.handle);return qc(`Error compiling shader '${t.source}': ${e}`),t.context.deleteShader(t.handle),t.handle=0,!1}return!0},e.cleanup=()=>{"Unknown"!==t.shaderType&&0!==t.handle&&(t.context.deleteShader(t.handle),t.handle=0,t.dirty=!0)}}(e,t)}var Qc={newInstance:zt.newInstance(Jc,"vtkShader"),extend:Jc};const{vtkErrorMacro:Zc}=zt,ed={vertexShaderHandle:0,fragmentShaderHandle:0,geometryShaderHandle:0,vertexShader:null,fragmentShader:null,geometryShader:null,linked:!1,bound:!1,compiled:!1,error:"",handle:0,numberOfOutputs:0,attributesLocs:null,uniformLocs:null,md5Hash:0,context:null,lastCameraMTime:null};function td(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ed,r),t.attributesLocs={},t.uniformLocs={},t.vertexShader=Qc.newInstance(),t.vertexShader.setShaderType("Vertex"),t.fragmentShader=Qc.newInstance(),t.fragmentShader.setShaderType("Fragment"),t.geometryShader=Qc.newInstance(),t.geometryShader.setShaderType("Geometry"),zt.obj(e,t),zt.get(e,t,["lastCameraMTime"]),zt.setGet(e,t,["error","handle","compiled","bound","md5Hash","vertexShader","fragmentShader","geometryShader","linked"]),function(e,t){t.classHierarchy.push("vtkShaderProgram"),e.compileShader=()=>t.vertexShader.compile()?t.fragmentShader.compile()?e.attachShader(t.vertexShader)&&e.attachShader(t.fragmentShader)?e.link()?(e.setCompiled(!0),1):(Zc(`Links failed: ${t.error}`),0):(Zc(t.error),0):(Zc(t.fragmentShader.getSource().split("\n").map((e,t)=>`${t}: ${e}`).join("\n")),Zc(t.fragmentShader.getError()),0):(Zc(t.vertexShader.getSource().split("\n").map((e,t)=>`${t}: ${e}`).join("\n")),Zc(t.vertexShader.getError()),0),e.cleanup=()=>{"Unknown"!==t.shaderType&&0!==t.handle&&(e.release(),0!==t.vertexShaderHandle&&(t.context.detachShader(t.handle,t.vertexShaderHandle),t.vertexShaderHandle=0),0!==t.fragmentShaderHandle&&(t.context.detachShader(t.handle,t.fragmentShaderHandle),t.fragmentShaderHandle=0),t.context.deleteProgram(t.handle),t.handle=0,e.setCompiled(!1))},e.bind=()=>!(!t.linked&&!e.link()||(t.context.useProgram(t.handle),e.setBound(!0),0)),e.isBound=()=>!!t.bound,e.release=()=>{t.context.useProgram(null),e.setBound(!1)},e.setContext=e=>{t.vertexShader.setContext(e),t.fragmentShader.setContext(e),t.geometryShader.setContext(e)},e.link=()=>{if(t.linked)return!0;if(0===t.handle)return t.error="Program has not been initialized, and/or does not have shaders.",!1;if(t.uniformLocs={},t.context.linkProgram(t.handle),!t.context.getProgramParameter(t.handle,t.context.LINK_STATUS)){const e=t.context.getProgramInfoLog(t.handle);return Zc(`Error linking shader ${e}`),t.handle=0,!1}return e.setLinked(!0),t.attributeLocs={},!0},e.setUniformMatrix=(r,n)=>{const o=e.findUniform(r);if(-1===o)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;const i=new Float32Array(n);return t.context.uniformMatrix4fv(o,!1,i),!0},e.setUniformMatrix3x3=(r,n)=>{const o=e.findUniform(r);if(-1===o)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;const i=new Float32Array(n);return t.context.uniformMatrix3fv(o,!1,i),!0},e.setUniformf=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform1f(o,n),!0)},e.setUniformfv=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform1fv(o,n),!0)},e.setUniformi=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform1i(o,n),!0)},e.setUniformiv=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform1iv(o,n),!0)},e.setUniform2f=(r,n,o)=>{const i=e.findUniform(r);if(-1===i)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;if(void 0===o)throw new RangeError("Invalid number of values for array");return t.context.uniform2f(i,n,o),!0},e.setUniform2fv=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform2fv(o,n),!0)},e.setUniform2i=(r,n,o)=>{const i=e.findUniform(r);if(-1===i)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;if(void 0===o)throw new RangeError("Invalid number of values for array");return t.context.uniform2i(i,n,o),!0},e.setUniform2iv=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform2iv(o,n),!0)},e.setUniform3f=(r,n,o,i)=>{const a=e.findUniform(r);if(-1===a)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;if(void 0===i)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(a,n,o,i),!0},e.setUniform3fArray=(r,n)=>{const o=e.findUniform(r);if(-1===o)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;if(!Array.isArray(n)||3!==n.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3f(o,n[0],n[1],n[2]),!0},e.setUniform3fv=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform3fv(o,n),!0)},e.setUniform3i=function(r){const n=e.findUniform(r);if(-1===n)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];let s=i;if(1===s.length&&Array.isArray(s[0])&&(s=s[0]),3!==s.length)throw new RangeError("Invalid number of values for array");return t.context.uniform3i(n,s[0],s[1],s[2]),!0},e.setUniform3iv=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform3iv(o,n),!0)},e.setUniform4f=function(r){const n=e.findUniform(r);if(-1===n)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];let s=i;if(1===s.length&&Array.isArray(s[0])&&(s=s[0]),4!==s.length)throw new RangeError("Invalid number of values for array");return t.context.uniform4f(n,s[0],s[1],s[2],s[3]),!0},e.setUniform4fv=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform4fv(o,n),!0)},e.setUniform4i=function(r){const n=e.findUniform(r);if(-1===n)return t.error=`Could not set uniform ${r} . No such uniform.`,!1;for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];let s=i;if(1===s.length&&Array.isArray(s[0])&&(s=s[0]),4!==s.length)throw new RangeError("Invalid number of values for array");return t.context.uniform4i(n,s[0],s[1],s[2],s[3]),!0},e.setUniform4iv=(r,n)=>{const o=e.findUniform(r);return-1===o?(t.error=`Could not set uniform ${r} . No such uniform.`,!1):(t.context.uniform4iv(o,n),!0)},e.findUniform=e=>{if(!e||!t.linked)return-1;let r=t.uniformLocs[e];return void 0!==r?r:(r=t.context.getUniformLocation(t.handle,e),null===r?(t.error=`Uniform ${e} not found in current shader program.`,t.uniformLocs[e]=-1,-1):(t.uniformLocs[e]=r,r))},e.isUniformUsed=e=>{if(!e)return!1;let r=t.uniformLocs[e];return void 0!==r?null!==r:t.linked?(r=t.context.getUniformLocation(t.handle,e),t.uniformLocs[e]=r,null!==r):(Zc("attempt to find uniform when the shader program is not linked"),!1)},e.isAttributeUsed=e=>{if(!e)return!1;if(e in t.attributeLocs)return!0;if(!t.linked)return Zc("attempt to find uniform when the shader program is not linked"),!1;const r=t.context.getAttribLocation(t.handle,e);return-1!==r&&(t.attributeLocs[e]=r,!0)},e.attachShader=r=>{if(0===r.getHandle())return t.error="Shader object was not initialized, cannot attach it.",!1;if("Unknown"===r.getShaderType())return t.error="Shader object is of type Unknown and cannot be used.",!1;if(0===t.handle){const e=t.context.createProgram();if(0===e)return t.error="Could not create shader program.",!1;t.handle=e,t.linked=!1}return"Vertex"===r.getShaderType()&&(0!==t.vertexShaderHandle&&t.context.detachShader(t.handle,t.vertexShaderHandle),t.vertexShaderHandle=r.getHandle()),"Fragment"===r.getShaderType()&&(0!==t.fragmentShaderHandle&&t.context.detachShader(t.handle,t.fragmentShaderHandle),t.fragmentShaderHandle=r.getHandle()),t.context.attachShader(t.handle,r.getHandle()),e.setLinked(!1),!0},e.detachShader=e=>{if(0===e.getHandle())return t.error="shader object was not initialized, cannot attach it.",!1;if("Unknown"===e.getShaderType())return t.error="Shader object is of type Unknown and cannot be used.",!1;switch(0===t.handle&&(t.error="This shader program has not been initialized yet."),e.getShaderType()){case"Vertex":return t.vertexShaderHandle!==e.getHandle()?(t.error="The supplied shader was not attached to this program.",!1):(t.context.detachShader(t.handle,e.getHandle()),t.vertexShaderHandle=0,t.linked=!1,!0);case"Fragment":return t.fragmentShaderHandle!==e.getHandle()?(t.error="The supplied shader was not attached to this program.",!1):(t.context.detachShader(t.handle,e.getHandle()),t.fragmentShaderHandle=0,t.linked=!1,!0);default:return!1}},e.setContext=e=>{t.context=e,t.vertexShader.setContext(e),t.fragmentShader.setContext(e),t.geometryShader.setContext(e)},e.setLastCameraMTime=e=>{t.lastCameraMTime=e}}(e,t)}var rd={newInstance:zt.newInstance(td,"vtkShaderProgram"),extend:td,substitute:function(e,t,r,n){const o="string"==typeof r?r:r.join("\n"),i=!1===n?t:new RegExp(t,"g"),a=e.replace(i,o);return{replace:a!==o,result:a}}};const nd={forceEmulation:!1,handleVAO:0,handleProgram:0,supported:!0,buffers:null,context:null};function od(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nd,r),t.buffers=[],zt.obj(e,t),zt.get(e,t,["supported"]),zt.setGet(e,t,["forceEmulation"]),function(e,t){t.classHierarchy.push("vtkOpenGLVertexArrayObject"),e.exposedMethod=()=>{},e.initialize=()=>{t.instancingExtension=null,t._openGLRenderWindow.getWebgl2()||(t.instancingExtension=t.context.getExtension("ANGLE_instanced_arrays")),!t.forceEmulation&&t._openGLRenderWindow&&t._openGLRenderWindow.getWebgl2()?(t.extension=null,t.supported=!0,t.handleVAO=t.context.createVertexArray()):(t.extension=t.context.getExtension("OES_vertex_array_object"),!t.forceEmulation&&t.extension?(t.supported=!0,t.handleVAO=t.extension.createVertexArrayOES()):t.supported=!1)},e.isReady=()=>0!==t.handleVAO||!1===t.supported,e.bind=()=>{if(e.isReady()||e.initialize(),e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(t.handleVAO):t.context.bindVertexArray(t.handleVAO);else if(e.isReady()){const e=t.context;for(let r=0;r<t.buffers.length;++r){const n=t.buffers[r];t.context.bindBuffer(e.ARRAY_BUFFER,n.buffer);for(let r=0;r<n.attributes.length;++r){const o=n.attributes[r],i=o.isMatrix?o.size:1;for(let r=0;r<i;++r)e.enableVertexAttribArray(o.index+r),e.vertexAttribPointer(o.index+r,o.size,o.type,o.normalize,o.stride,o.offset+o.stride*r/o.size),o.divisor>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(o.index+r,1):e.vertexAttribDivisor(o.index+r,1))}}}},e.release=()=>{if(e.isReady()&&t.supported)t.extension?t.extension.bindVertexArrayOES(null):t.context.bindVertexArray(null);else if(e.isReady()){const e=t.context;for(let r=0;r<t.buffers.length;++r){const n=t.buffers[r];t.context.bindBuffer(e.ARRAY_BUFFER,n.buffer);for(let r=0;r<n.attributes.length;++r){const o=n.attributes[r],i=o.isMatrix?o.size:1;for(let r=0;r<i;++r)e.enableVertexAttribArray(o.index+r),e.vertexAttribPointer(o.index+r,o.size,o.type,o.normalize,o.stride,o.offset+o.stride*r/o.size),o.divisor>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(o.index+r,0):e.vertexAttribDivisor(o.index+r,0)),e.disableVertexAttribArray(o.index+r)}}}},e.shaderProgramChanged=()=>{e.release(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.handleProgram=0},e.releaseGraphicsResources=()=>{e.shaderProgramChanged(),t.handleVAO&&(t.extension?t.extension.deleteVertexArrayOES(t.handleVAO):t.context.deleteVertexArray(t.handleVAO)),t.handleVAO=0,t.supported=!0,t.handleProgram=0},e.addAttributeArray=(t,r,n,o,i,a,s,l)=>e.addAttributeArrayWithDivisor(t,r,n,o,i,a,s,l,0,!1),e.addAttributeArrayWithDivisor=(r,n,o,i,a,s,l,u,c,d)=>{if(!r)return!1;if(!r.isBound()||0===n.getHandle()||n.getType()!==kc.ARRAY_BUFFER)return!1;if(0===t.handleProgram&&(t.handleProgram=r.getHandle()),e.isReady()||e.initialize(),!e.isReady()||t.handleProgram!==r.getHandle())return!1;const p=t.context,f={};if(f.name=o,f.index=p.getAttribLocation(t.handleProgram,o),f.offset=i,f.stride=a,f.type=s,f.size=l,f.normalize=u,f.isMatrix=d,f.divisor=c,-1===f.Index)return!1;if(n.bind(),p.enableVertexAttribArray(f.index),p.vertexAttribPointer(f.index,f.size,f.type,f.normalize,f.stride,f.offset),c>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(f.index,1):p.vertexAttribDivisor(f.index,1)),f.buffer=n.getHandle(),!t.supported){let e=!1;for(let r=0;r<t.buffers.length;++r){const n=t.buffers[r];if(n.buffer===f.buffer){e=!0;let t=!1;for(let e=0;e<n.attributes.length;++e)n.attributes[e].name===o&&(t=!0,n.attributes[e]=f);t||n.attributes.push(f)}}e||t.buffers.push({buffer:f.buffer,attributes:[f]})}return!0},e.addAttributeMatrixWithDivisor=(r,n,o,i,a,s,l,u,c)=>{const d=e.addAttributeArrayWithDivisor(r,n,o,i,a,s,l,u,c,!0);if(!d)return d;const p=t.context,f=p.getAttribLocation(t.handleProgram,o);for(let e=1;e<l;e++)p.enableVertexAttribArray(f+e),p.vertexAttribPointer(f+e,l,s,u,a,i+a*e/l),c>0&&(t.instancingExtension?t.instancingExtension.vertexAttribDivisorANGLE(f+e,1):p.vertexAttribDivisor(f+e,1));return!0},e.removeAttributeArray=r=>{if(!e.isReady()||0===t.handleProgram)return!1;if(!t.supported)for(let e=0;e<t.buffers.length;++e){const n=t.buffers[e];for(let o=0;o<n.attributes.length;++o)if(n.attributes[o].name===r)return n.attributes.splice(o,1),n.attributes.length||t.buffers.splice(e,1),!0}return!0},e.setOpenGLRenderWindow=r=>{t._openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t._openGLRenderWindow=r,t.context=null,r&&(t.context=t._openGLRenderWindow.getContext()))}}(e,t)}var id={newInstance:zt.newInstance(od,"vtkOpenGLVertexArrayObject"),extend:od};const ad={Start:0,Points:0,Lines:1,Tris:2,TriStrips:3,TrisEdges:4,TriStripsEdges:5,End:6},sd={context:null,program:null,shaderSourceTime:null,VAO:null,attributeUpdateTime:null,CABO:null,primitiveType:0,pointPicking:!1};function ld(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sd,r),zt.obj(e,t),t.shaderSourceTime={},zt.obj(t.shaderSourceTime),t.attributeUpdateTime={},zt.obj(t.attributeUpdateTime),zt.setGet(e,t,["program","shaderSourceTime","VAO","attributeUpdateTime","CABO","primitiveType","pointPicking"]),t.program=rd.newInstance(),t.VAO=id.newInstance(),t.CABO=$c.newInstance(),function(e,t){t.classHierarchy.push("vtkOpenGLHelper"),e.setOpenGLRenderWindow=e=>{t.context=e.getContext(),t.program.setContext(t.context),t.VAO.setOpenGLRenderWindow(e),t.CABO.setOpenGLRenderWindow(e)},e.releaseGraphicsResources=e=>{t.VAO.releaseGraphicsResources(),t.CABO.releaseGraphicsResources(),t.CABO.setElementCount(0)},e.drawArrays=(r,n,o,i)=>{if(t.CABO.getElementCount()){const a=e.getOpenGLMode(o),s=e.haveWideLines(r,n),l=t.context,u=l.getParameter(l.DEPTH_WRITEMASK);t.pointPicking&&l.depthMask(!1),a===l.LINES&&s?(e.updateShaders(r,n,i),l.drawArraysInstanced(a,0,t.CABO.getElementCount(),2*Math.ceil(n.getProperty().getLineWidth()))):(l.lineWidth(n.getProperty().getLineWidth()),e.updateShaders(r,n,i),l.drawArrays(a,0,t.CABO.getElementCount()),l.lineWidth(1));const c=(a===l.POINTS?1:0)||(a===l.LINES?2:3);return t.pointPicking&&l.depthMask(u),t.CABO.getElementCount()/c}return 0},e.getOpenGLMode=e=>{if(t.pointPicking)return t.context.POINTS;const r=t.primitiveType;return e===Ja.POINTS||r===ad.Points?t.context.POINTS:e===Ja.WIREFRAME||r===ad.Lines||r===ad.TrisEdges||r===ad.TriStripsEdges?t.context.LINES:t.context.TRIANGLES},e.haveWideLines=(e,r)=>r.getProperty().getLineWidth()>1&&!(t.CABO.getOpenGLRenderWindow()&&t.CABO.getOpenGLRenderWindow().getHardwareMaximumLineWidth()>=r.getProperty().getLineWidth()),e.getNeedToRebuildShaders=(t,r,n)=>!!(n.getNeedToRebuildShaders(e,t,r)||0===e.getProgram()||e.getShaderSourceTime().getMTime()<n.getMTime()||e.getShaderSourceTime().getMTime()<r.getMTime()),e.updateShaders=(r,n,o)=>{if(e.getNeedToRebuildShaders(r,n,o)){const i={Vertex:null,Fragment:null,Geometry:null};o.buildShaders(i,r,n);const a=t.CABO.getOpenGLRenderWindow().getShaderCache().readyShaderProgramArray(i.Vertex,i.Fragment,i.Geometry);a!==e.getProgram()&&(e.setProgram(a),e.getVAO().releaseGraphicsResources()),e.getShaderSourceTime().modified()}else t.CABO.getOpenGLRenderWindow().getShaderCache().readyShaderProgram(e.getProgram());e.getVAO().bind(),o.setMapperShaderParameters(e,r,n),o.setPropertyShaderParameters(e,r,n),o.setCameraShaderParameters(e,r,n),o.setLightingShaderParameters(e,r,n),o.invokeShaderCallbacks(e,r,n)},e.setMapperShaderParameters=(r,n,o)=>{if(e.haveWideLines(r,n)){e.getProgram().setUniform2f("viewportSize",o.usize,o.vsize);const t=parseFloat(n.getProperty().getLineWidth()),r=t/2;e.getProgram().setUniformf("lineWidthStepSize",t/Math.ceil(t)),e.getProgram().setUniformf("halfLineWidth",r)}t.primitiveType===ad.Points||n.getProperty().getRepresentation()===Ja.POINTS?e.getProgram().setUniformf("pointSize",n.getProperty().getPointSize()):t.pointPicking&&e.getProgram().setUniformf("pointSize",e.getPointPickingPrimitiveSize())},e.replaceShaderPositionVC=(r,n,o)=>{let i=r.Vertex;i=rd.substitute(i,"//VTK::PositionVC::Dec",["//VTK::PositionVC::Dec","uniform float pointSize;"]).result,i=rd.substitute(i,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," gl_PointSize = pointSize;"],!1).result,e.getOpenGLMode(o.getProperty().getRepresentation())===t.context.LINES&&e.haveWideLines(n,o)&&(i=rd.substitute(i,"//VTK::PositionVC::Dec",["//VTK::PositionVC::Dec","uniform vec2 viewportSize;","uniform float lineWidthStepSize;","uniform float halfLineWidth;"]).result,i=rd.substitute(i,"//VTK::PositionVC::Impl",["//VTK::PositionVC::Impl"," if (halfLineWidth > 0.0)"," {"," float offset = float(gl_InstanceID / 2) * lineWidthStepSize - halfLineWidth;"," vec4 tmpPos = gl_Position;"," vec3 tmpPos2 = tmpPos.xyz / tmpPos.w;"," tmpPos2.x = tmpPos2.x + 2.0 * mod(float(gl_InstanceID), 2.0) * offset / viewportSize[0];"," tmpPos2.y = tmpPos2.y + 2.0 * mod(float(gl_InstanceID + 1), 2.0) * offset / viewportSize[1];"," gl_Position = vec4(tmpPos2.xyz * tmpPos.w, tmpPos.w);"," }"]).result),r.Vertex=i},e.getPointPickingPrimitiveSize=()=>t.primitiveType===ad.Points?2:t.primitiveType===ad.Lines?4:6,e.getAllocatedGPUMemoryInBytes=()=>e.getCABO().getAllocatedGPUMemoryInBytes()}(e,t)}var ud={newInstance:zt.newInstance(ld),extend:ld,primTypes:ad};const cd={NEAREST:0,LINEAR:1,NEAREST_MIPMAP_NEAREST:2,NEAREST_MIPMAP_LINEAR:3,LINEAR_MIPMAP_NEAREST:4,LINEAR_MIPMAP_LINEAR:5};var dd={Wrap:{CLAMP_TO_EDGE:0,REPEAT:1,MIRRORED_REPEAT:2},Filter:cd};const pd=new Float32Array(1),fd=new Int32Array(pd.buffer);var hd={fromHalf:function(e){const t=(32768&e)>>15,r=(31744&e)>>10,n=1023&e;return 0===r?(t?-1:1)*2**-14*(n/1024):31===r?n?NaN:1/0*(t?-1:1):(t?-1:1)*2**(r-15)*(1+n/1024)},toHalf:function(e){pd[0]=e;const t=fd[0];let r=t>>16&32768,n=t>>12&2047;const o=t>>23&255;return o<103?r:o>142?(r|=31744,r|=(255===o?0:1)&&8388607&t,r):o<113?(n|=2048,r|=(n>>114-o)+(n>>113-o&1),r):(r|=o-112<<10|n>>1,r+=1&n,r)}};let md;const{Wrap:gd,Filter:yd}=dd,{VtkDataTypes:vd}=_s,{vtkDebugMacro:bd,vtkErrorMacro:xd,vtkWarningMacro:_d,requiredParam:Sd}=jt,{toHalf:Cd}=hd;function Td(e,t){function r(){return{internalFormat:t.internalFormat,format:t.format,openGLDataType:t.openGLDataType,width:t.width,height:t.height}}t.classHierarchy.push("vtkOpenGLTexture"),e.render=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(r?t._openGLRenderWindow=r:(t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow")),t.context=t._openGLRenderWindow.getContext(),t.renderable.getInterpolate()?(t.generateMipmap?e.setMinificationFilter(yd.LINEAR_MIPMAP_LINEAR):e.setMinificationFilter(yd.LINEAR),e.setMagnificationFilter(yd.LINEAR)):(e.setMinificationFilter(yd.NEAREST),e.setMagnificationFilter(yd.NEAREST)),t.renderable.getRepeat()&&(e.setWrapR(gd.REPEAT),e.setWrapS(gd.REPEAT),e.setWrapT(gd.REPEAT)),t.renderable.getInputData()&&t.renderable.setImage(null),!t.handle||t.renderable.getMTime()>t.textureBuildTime.getMTime()){if(null!==t.renderable.getImageBitmap()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(yd.LINEAR_MIPMAP_LINEAR)),t.renderable.getImageBitmap()&&t.renderable.getImageLoaded()&&(e.create2DFromImageBitmap(t.renderable.getImageBitmap()),e.activate(),e.sendParameters(),t.textureBuildTime.modified())),null!==t.renderable.getImage()&&(t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(yd.LINEAR_MIPMAP_LINEAR)),t.renderable.getImage()&&t.renderable.getImageLoaded()&&(e.create2DFromImage(t.renderable.getImage()),e.activate(),e.sendParameters(),t.textureBuildTime.modified())),null!==t.renderable.getCanvas()){t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(yd.LINEAR_MIPMAP_LINEAR));const r=t.renderable.getCanvas();e.create2DFromRaw({width:r.width,height:r.height,numComps:4,dataType:vd.UNSIGNED_CHAR,data:r,flip:!0}),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}if(null!==t.renderable.getJsImageData()){const r=t.renderable.getJsImageData();t.renderable.getInterpolate()&&(t.generateMipmap=!0,e.setMinificationFilter(yd.LINEAR_MIPMAP_LINEAR)),e.create2DFromRaw({width:r.width,height:r.height,numComps:4,dataType:vd.UNSIGNED_CHAR,data:r.data,flip:!0}),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}const r=t.renderable.getInputData(0);if(r&&r.getPointData().getScalars()){const n=r.getExtent(),o=r.getPointData().getScalars(),i=[];for(let e=0;e<t.renderable.getNumberOfInputPorts();++e){const r=t.renderable.getInputData(e),n=r?r.getPointData().getScalars().getData():null;n&&i.push(n)}t.renderable.getInterpolate()&&4===o.getNumberOfComponents()&&(t.generateMipmap=!0,e.setMinificationFilter(yd.LINEAR_MIPMAP_LINEAR)),i.length%6==0?e.createCubeFromRaw({width:n[1]-n[0]+1,height:n[3]-n[2]+1,numComps:o.getNumberOfComponents(),dataType:o.getDataType(),data:i}):e.create2DFromRaw({width:n[1]-n[0]+1,height:n[3]-n[2]+1,numComps:o.getNumberOfComponents(),dataType:o.getDataType(),data:o.getData()}),e.activate(),e.sendParameters(),t.textureBuildTime.modified()}}t.handle&&e.activate()};const n=()=>{if(t.minificationFilter!==yd.LINEAR&&t.magnificationFilter!==yd.LINEAR||(void 0===md&&(md=function(){try{const e=4,t=2,r=1,n=new Int16Array([0,32767]),o=[1,1],i=document.createElement("canvas");i.width=e,i.height=e;const a=i.getContext("webgl2");if(!a)return!1;const s=a.getExtension("EXT_texture_norm16");if(!s)return!1;const l=`#version 300 es\n void main() {\n gl_PointSize = ${e.toFixed(1)};\n gl_Position = vec4(0, 0, 0, 1);\n }\n `,u="#version 300 es\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n\n uniform sampler2D u_image;\n\n out vec4 color;\n\n void main() {\n vec4 intColor = texture(u_image, gl_PointCoord.xy);\n color = vec4(vec3(intColor.rrr), 1);\n }\n ",c=a.createShader(a.VERTEX_SHADER);if(a.shaderSource(c,l),a.compileShader(c),!a.getShaderParameter(c,a.COMPILE_STATUS))return!1;const d=a.createShader(a.FRAGMENT_SHADER);if(a.shaderSource(d,u),a.compileShader(d),!a.getShaderParameter(d,a.COMPILE_STATUS))return!1;const p=a.createProgram();if(a.attachShader(p,c),a.attachShader(p,d),a.linkProgram(p),!a.getProgramParameter(p,a.LINK_STATUS))return!1;const f=a.createTexture();a.bindTexture(a.TEXTURE_2D,f),a.texImage2D(a.TEXTURE_2D,0,s.R16_SNORM_EXT,t,r,0,a.RED,a.SHORT,n),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.useProgram(p),a.drawArrays(a.POINTS,0,1);const h=new Uint8Array(4);a.readPixels(o[0],o[1],1,1,a.RGBA,a.UNSIGNED_BYTE,h);const[m,g,y]=h,v=a.getExtension("WEBGL_lose_context");return v&&v.loseContext(),m===g&&g===y&&0!==m}catch(e){return!1}}()),md))return t.oglNorm16Ext};function o(e){const[t,r,n,o,i,a]=e;return[r-t+1,o-n+1,a-i+1]}function i(e){const[t,r,n]=o(e);return t*r*n}function a(e,r){const n=new((arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||e.constructor)(r.reduce((e,t)=>e+i(t),0)),o=[t.width,t.height,t.depth];let a=0;return r.forEach(t=>{!function(e,t,r,n,o){const[i,a,s,l,u,c]=r,[d,p]=t,f=d*p;let h=o;for(let t=u;t<=c;t++){const r=t*f;for(let t=s;t<=l;t++){const o=r+t*d;for(let t=o+i,r=o+a;t<=r;t++,h++)n[h]=e[t]}}}(e,o,t,n,a),a+=i(t)}),n}function s(e){if(t._openGLRenderWindow.getWebgl2())return e;const r=[],n=t.width,o=t.height,i=t.components;if(e&&(!Eo(n)||!Eo(o))){const a=t.context.getExtension("OES_texture_half_float"),s=Ao(n),l=Ao(o),u=s*l*t.components;for(let c=0;c<e.length;c++)if(null!==e[c]){let d=null;const p=o/l,f=n/s;let h=!1;t.openGLDataType===t.context.FLOAT?d=new Float32Array(u):a&&t.openGLDataType===a.HALF_FLOAT_OES?(d=new Uint16Array(u),h=!0):d=new Uint8Array(u);for(let t=0;t<l;t++){const r=t*s*i,a=t*p;let l=Math.floor(a),u=Math.ceil(a);u>=o&&(u=o-1);const m=a-l,g=1-m;l=l*n*i,u=u*n*i;for(let t=0;t<s;t++){const o=t*i,a=t*f;let s=Math.floor(a),p=Math.ceil(a);p>=n&&(p=n-1);const y=a-s;s*=i,p*=i;for(let t=0;t<i;t++)d[r+o+t]=h?hd.toHalf(hd.fromHalf(e[c][l+s+t])*g*(1-y)+hd.fromHalf(e[c][l+p+t])*g*y+hd.fromHalf(e[c][u+s+t])*m*(1-y)+hd.fromHalf(e[c][u+p+t])*m*y):e[c][l+s+t]*g*(1-y)+e[c][l+p+t]*g*y+e[c][u+s+t]*m*(1-y)+e[c][u+p+t]*m*y}}r.push(d),t.width=s,t.height=l}else r.push(null)}if(0===r.length)for(let t=0;t<e.length;t++)r.push(e[t]);return r}function l(e){return!!t._openGLRenderWindow&&(!t.resizable&&!t.renderable?.getResizable()&&(!!t._openGLRenderWindow.getWebgl2()&&(!(t._openGLRenderWindow.getGLInformations().RENDERER.value.match(/WebKit/gi)&&navigator.platform.match(/Mac/gi)&&n())||e!==vd.UNSIGNED_SHORT&&e!==vd.SHORT)))}function u(r,n){const o=r.getNumberOfComponents(),i=r.getDataType(),a=r.getData(),s=new Array(o),l=new Array(o);for(let e=0;e<o;++e){const[t,n]=r.getRange(e);s[e]=t,l[e]=n}const u=function(e,t,r){const n=new Array(r),o=new Array(r);for(let i=0;i<r;++i)n[i]=e[i],o[i]=t[i]-e[i]||1;return{scale:o,offset:n}}(s,l,o);return function(r,n,o,i){e.getOpenGLDataType(r);const a=function(e,t){for(let r=0;r<e.length;r++){const n=e[r],o=t[r]+n;if(n<-2048||n>2048||o<-2048||o>2048)return!1}return!0}(n,o)||i;let s=!1;if(t._openGLRenderWindow.getWebgl2())s=t.openGLDataType===t.context.FLOAT&&null===t.context.getExtension("OES_texture_float_linear")&&a||t.openGLDataType===t.context.HALF_FLOAT;else{const e=t.context.getExtension("OES_texture_half_float");s=e&&t.openGLDataType===e.HALF_FLOAT_OES}t.canUseHalfFloat=s&&a}(i,u.offset,u.scale,n),e.useHalfFloat()||e.getOpenGLDataType(i,!0),{numComps:o,dataType:i,data:a,scaleOffsets:u}}e.destroyTexture=()=>{e.deactivate(),t.context&&t.handle&&t.context.deleteTexture(t.handle),t._prevTexParams=null,t.handle=0,t.numberOfDimensions=0,t.target=0,t.components=0,t.width=0,t.height=0,t.depth=0,e.resetFormatAndType()},e.createTexture=()=>{t.handle||(t.handle=t.context.createTexture(),t.target&&(t.context.bindTexture(t.target,t.handle),t.context.texParameteri(t.target,t.context.TEXTURE_MIN_FILTER,e.getOpenGLFilterMode(t.minificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_MAG_FILTER,e.getOpenGLFilterMode(t.magnificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_S,e.getOpenGLWrapMode(t.wrapS)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_T,e.getOpenGLWrapMode(t.wrapT)),t._openGLRenderWindow.getWebgl2()&&t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_R,e.getOpenGLWrapMode(t.wrapR)),t.context.bindTexture(t.target,null)))},e.getTextureUnit=()=>t._openGLRenderWindow?t._openGLRenderWindow.getTextureUnitForTexture(e):-1,e.activate=()=>{t._openGLRenderWindow.activateTexture(e),e.bind()},e.deactivate=()=>{t._openGLRenderWindow&&t._openGLRenderWindow.deactivateTexture(e)},e.releaseGraphicsResources=r=>{r&&t.handle&&(r.activateTexture(e),r.deactivateTexture(e),t.context.deleteTexture(t.handle),t._prevTexParams=null,t.handle=0,t.numberOfDimensions=0,t.target=0,t.internalFormat=0,t.format=0,t.openGLDataType=0,t.components=0,t.width=0,t.height=0,t.depth=0,t.allocatedGPUMemoryInBytes=0),t.shaderProgram&&(t.shaderProgram.releaseGraphicsResources(r),t.shaderProgram=null)},e.bind=()=>{t.context.bindTexture(t.target,t.handle),t.autoParameters&&e.getMTime()>t.sendParametersTime.getMTime()&&e.sendParameters()},e.isBound=()=>{let e=!1;if(t.context&&t.handle){let r=0;t.target===t.context.TEXTURE_2D?r=t.context.TEXTURE_BINDING_2D:_d("impossible case"),e=t.context.getIntegerv(r)===t.handle}return e},e.sendParameters=()=>{t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_S,e.getOpenGLWrapMode(t.wrapS)),t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_T,e.getOpenGLWrapMode(t.wrapT)),t._openGLRenderWindow.getWebgl2()&&t.context.texParameteri(t.target,t.context.TEXTURE_WRAP_R,e.getOpenGLWrapMode(t.wrapR)),t.context.texParameteri(t.target,t.context.TEXTURE_MIN_FILTER,e.getOpenGLFilterMode(t.minificationFilter)),t.context.texParameteri(t.target,t.context.TEXTURE_MAG_FILTER,e.getOpenGLFilterMode(t.magnificationFilter)),t._openGLRenderWindow.getWebgl2()&&(t.context.texParameteri(t.target,t.context.TEXTURE_BASE_LEVEL,t.baseLevel),t.context.texParameteri(t.target,t.context.TEXTURE_MAX_LEVEL,t.maxLevel)),t.sendParametersTime.modified()},e.getInternalFormat=(r,n)=>(t._forceInternalFormat||(t.internalFormat=e.getDefaultInternalFormat(r,n)),t.internalFormat||bd(`Unable to find suitable internal format for T=${r} NC= ${n}`),[t.context.R32F,t.context.RG32F,t.context.RGB32F,t.context.RGBA32F].includes(t.internalFormat)&&!t.context.getExtension("OES_texture_float_linear")&&_d("Failed to load OES_texture_float_linear. Texture filtering is not available for *32F internal formats."),t.internalFormat),e.getDefaultInternalFormat=(r,o)=>{let i=0;return i=t._openGLRenderWindow.getDefaultTextureInternalFormat(r,o,n(),e.useHalfFloat()),i||(i||(bd("Unsupported internal texture type!"),bd(`Unable to find suitable internal format for T=${r} NC= ${o}`)),i)},e.useHalfFloat=()=>t.enableUseHalfFloat&&t.canUseHalfFloat,e.setInternalFormat=r=>{t._forceInternalFormat=!0,r!==t.internalFormat&&(t.internalFormat=r,e.modified())},e.getFormat=(r,n)=>(t.format=e.getDefaultFormat(r,n),t.format),e.getDefaultFormat=(e,r)=>{if(t._openGLRenderWindow.getWebgl2())switch(r){case 1:return t.context.RED;case 2:return t.context.RG;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}else switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:default:return t.context.RGB;case 4:return t.context.RGBA}},e.resetFormatAndType=()=>{t._prevTexParams=null,t.format=0,t.internalFormat=0,t._forceInternalFormat=!1,t.openGLDataType=0},e.getDefaultDataType=r=>{const o=e.useHalfFloat();if(t._openGLRenderWindow.getWebgl2())switch(r){case vd.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case n()&&!o&&vd.SHORT:return t.context.SHORT;case n()&&!o&&vd.UNSIGNED_SHORT:return t.context.UNSIGNED_SHORT;case o&&vd.SHORT:case o&&vd.UNSIGNED_SHORT:return t.context.HALF_FLOAT;case vd.FLOAT:case vd.VOID:default:return t.context.FLOAT}switch(r){case vd.UNSIGNED_CHAR:return t.context.UNSIGNED_BYTE;case vd.FLOAT:case vd.VOID:default:if(t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear"))return t.context.FLOAT;{const e=t.context.getExtension("OES_texture_half_float");if(e&&t.context.getExtension("OES_texture_half_float_linear"))return e.HALF_FLOAT_OES}return t.context.UNSIGNED_BYTE}},e.getOpenGLDataType=function(r){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.openGLDataType&&!n||(t.openGLDataType=e.getDefaultDataType(r)),t.openGLDataType},e.getShiftAndScale=()=>{let e=0,r=1;switch(t.openGLDataType){case t.context.BYTE:r=127.5,e=r-128;break;case t.context.UNSIGNED_BYTE:r=255,e=0;break;case t.context.SHORT:r=32767.5,e=r-32768;break;case t.context.UNSIGNED_SHORT:r=65536,e=0;break;case t.context.INT:r=2147483647.5,e=r-2147483648;break;case t.context.UNSIGNED_INT:r=4294967295,e=0;case t.context.FLOAT:}return{shift:e,scale:r}},e.getOpenGLFilterMode=e=>{switch(e){case yd.NEAREST:return t.context.NEAREST;case yd.LINEAR:return t.context.LINEAR;case yd.NEAREST_MIPMAP_NEAREST:return t.context.NEAREST_MIPMAP_NEAREST;case yd.NEAREST_MIPMAP_LINEAR:return t.context.NEAREST_MIPMAP_LINEAR;case yd.LINEAR_MIPMAP_NEAREST:return t.context.LINEAR_MIPMAP_NEAREST;case yd.LINEAR_MIPMAP_LINEAR:return t.context.LINEAR_MIPMAP_LINEAR;default:return t.context.NEAREST}},e.getOpenGLWrapMode=e=>{switch(e){case gd.CLAMP_TO_EDGE:return t.context.CLAMP_TO_EDGE;case gd.REPEAT:return t.context.REPEAT;case gd.MIRRORED_REPEAT:return t.context.MIRRORED_REPEAT;default:return t.context.CLAMP_TO_EDGE}},e.updateArrayDataTypeForGL=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const i=[];let s=t.width*t.height*t.components;n&&(s*=t.depth);const l=!!o.length;if(e!==vd.FLOAT&&t.openGLDataType===t.context.FLOAT)for(let e=0;e<r.length;e++)if(r[e])if(l)i.push(a(r[e],o,Float32Array));else{const t=r[e].length>s?r[e].subarray(0,s):r[e];i.push(new Float32Array(t))}else i.push(null);if(e!==vd.UNSIGNED_CHAR&&t.openGLDataType===t.context.UNSIGNED_BYTE)for(let e=0;e<r.length;e++)if(r[e])if(l)i.push(a(r[e],o,Uint8Array));else{const t=r[e].length>s?r[e].subarray(0,s):r[e];i.push(new Uint8Array(t))}else i.push(null);let u=!1;if(t._openGLRenderWindow.getWebgl2())u=t.openGLDataType===t.context.HALF_FLOAT;else{const e=t.context.getExtension("OES_texture_half_float");u=e&&t.openGLDataType===e.HALF_FLOAT_OES}if(u)for(let e=0;e<r.length;e++)if(r[e]){const t=l?a(r[e],o):r[e],n=new Uint16Array(l?t.length:s),u=n.length;for(let e=0;e<u;e++)n[e]=Cd(t[e]);i.push(n)}else i.push(null);if(0===i.length)for(let e=0;e<r.length;e++)i.push(l&&r[e]?a(r[e],o):r[e]);return i},e.create2DFromRaw=function(){let{width:r=Sd("width"),height:o=Sd("height"),numComps:i=Sd("numComps"),dataType:a=Sd("dataType"),data:u=Sd("data"),flip:c=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.getOpenGLDataType(a,!0),e.getInternalFormat(a,i),e.getFormat(a,i),!t.internalFormat||!t.format||!t.openGLDataType)return xd("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();const d=[u],p=s(e.updateArrayDataTypeForGL(a,d));return t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,c),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),l(a)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),null!=p[0]&&t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,p[0])):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,p[0]),t.generateMipmap&&t.context.generateMipmap(t.target),c&&t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,!1),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*i*t._openGLRenderWindow.getDefaultTextureByteSize(a,n(),e.useHalfFloat()),e.deactivate(),!0},e.createCubeFromRaw=function(){let{width:r=Sd("width"),height:o=Sd("height"),numComps:i=Sd("numComps"),dataType:a=Sd("dataType"),data:u=Sd("data")}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.getOpenGLDataType(a),e.getInternalFormat(a,i),e.getFormat(a,i),!t.internalFormat||!t.format||!t.openGLDataType)return xd("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_CUBE_MAP,t.components=i,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),t.maxLevel=u.length/6-1,e.createTexture(),e.bind();const c=s(e.updateArrayDataTypeForGL(a,u)),d=[];let p=t.width,f=t.height;for(let e=0;e<c.length;e++){e%6==0&&0!==e&&(p/=2,f/=2),d[e]=ot(a,f*p*t.components);for(let r=0;r<f;++r){const n=r*p*t.components,o=(f-r-1)*p*t.components;d[e].set(c[e].slice(o,o+p*t.components),n)}}t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),l(a)&&t.context.texStorage2D(t.target,6,t.internalFormat,t.width,t.height);for(let e=0;e<6;e++){let r=0,n=t.width,o=t.height;for(;n>=1&&o>=1;){let i=null;r<=t.maxLevel&&(i=d[6*r+e]),l(a)?null!=i&&t.context.texSubImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,n,o,t.format,t.openGLDataType,i):t.context.texImage2D(t.context.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,t.internalFormat,n,o,0,t.format,t.openGLDataType,i),r++,n/=2,o/=2}}return t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*i*t._openGLRenderWindow.getDefaultTextureByteSize(a,n(),e.useHalfFloat()),e.deactivate(),!0},e.createDepthFromRaw=function(){let{width:r=Sd("width"),height:o=Sd("height"),dataType:i=Sd("dataType"),data:a=Sd("data")}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.getOpenGLDataType(i),t.format=t.context.DEPTH_COMPONENT,t._openGLRenderWindow.getWebgl2()?i===vd.FLOAT?t.internalFormat=t.context.DEPTH_COMPONENT32F:t.internalFormat=t.context.DEPTH_COMPONENT16:t.internalFormat=t.context.DEPTH_COMPONENT,t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_2D,t.components=1,t.width=r,t.height=o,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),l(i)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),null!=a&&t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,a)):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,a),t.generateMipmap&&t.context.generateMipmap(t.target),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*t.components*t._openGLRenderWindow.getDefaultTextureByteSize(i,n(),e.useHalfFloat()),e.deactivate(),!0):(xd("Failed to determine texture parameters."),!1)},e.create2DFromImage=r=>{if(e.getOpenGLDataType(vd.UNSIGNED_CHAR),e.getInternalFormat(vd.UNSIGNED_CHAR,4),e.getFormat(vd.UNSIGNED_CHAR,4),!t.internalFormat||!t.format||!t.openGLDataType)return xd("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=4,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();const o=!(t._openGLRenderWindow.getWebgl2()||Eo(r.width)&&Eo(r.height));let i=r,a=r.width,s=r.height,u=!0;const c=window.chrome;if(o||c){const e=new OffscreenCanvas(Ao(r.width),Ao(r.height));a=e.width,s=e.height;const t=e.getContext("2d");t.translate(0,e.height),t.scale(1,-1),t.drawImage(r,0,0,r.width,r.height,0,0,e.width,e.height),i=e,u=!1}return t.width=a,t.height=s,t.context.pixelStorei(t.context.UNPACK_FLIP_Y_WEBGL,u),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),l(vd.UNSIGNED_CHAR)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,i)):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,i),t.generateMipmap&&t.context.generateMipmap(t.target),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*t.components*t._openGLRenderWindow.getDefaultTextureByteSize(vd.UNSIGNED_CHAR,n(),e.useHalfFloat()),e.deactivate(),!0},e.create2DFromImageBitmap=r=>(e.getOpenGLDataType(vd.UNSIGNED_CHAR),e.getInternalFormat(vd.UNSIGNED_CHAR,4),e.getFormat(vd.UNSIGNED_CHAR,4),t.internalFormat&&t.format&&t.openGLDataType?(t.target=t.context.TEXTURE_2D,t.components=4,t.depth=1,t.numberOfDimensions=2,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),t.width=r.width,t.height=r.height,l(vd.UNSIGNED_CHAR)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,r)):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,r),t.generateMipmap&&t.context.generateMipmap(t.target),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*t.components*t._openGLRenderWindow.getDefaultTextureByteSize(vd.UNSIGNED_CHAR,n(),e.useHalfFloat()),e.deactivate(),!0):(xd("Failed to determine texture parameters."),!1)),e.create2DFilterableFromRaw=function(){let{width:t=Sd("width"),height:r=Sd("height"),numComps:n=Sd("numComps"),dataType:o=Sd("dataType"),data:i=Sd("data"),preferSizeOverAccuracy:a=!1,ranges:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.create2DFilterableFromDataArray({width:t,height:r,dataArray:_s.newInstance({numberOfComponents:n,dataType:o,values:i,ranges:s}),preferSizeOverAccuracy:a})},e.create2DFilterableFromDataArray=function(){let{width:t=Sd("width"),height:r=Sd("height"),dataArray:n=Sd("dataArray"),preferSizeOverAccuracy:o=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{numComps:i,dataType:a,data:s}=u(n,o);e.create2DFromRaw({width:t,height:r,numComps:i,dataType:a,data:s})},e.updateVolumeInfoForGL=(r,o)=>{let i=!1;const a=e.useHalfFloat();t.volumeInfo?.scale&&t.volumeInfo?.offset||(t.volumeInfo={scale:new Array(o),offset:new Array(o)});for(let e=0;e<o;++e)t.volumeInfo.scale[e]=1,t.volumeInfo.offset[e]=0;if(n()&&!a&&r===vd.SHORT){for(let e=0;e<o;++e)t.volumeInfo.scale[e]=32767;i=!0}if(n()&&!a&&r===vd.UNSIGNED_SHORT){for(let e=0;e<o;++e)t.volumeInfo.scale[e]=65535;i=!0}if(r===vd.UNSIGNED_CHAR){for(let e=0;e<o;++e)t.volumeInfo.scale[e]=255;i=!0}return(r===vd.FLOAT||a&&(r===vd.SHORT||r===vd.UNSIGNED_SHORT))&&(i=!0),i},e.create3DFromRaw=function(){let{width:a=Sd("width"),height:u=Sd("height"),depth:c=Sd("depth"),numComps:d=Sd("numComps"),dataType:p=Sd("dataType"),data:f=Sd("data"),updatedExtents:h=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},m=p,g=f;if(!e.updateVolumeInfoForGL(m,d)&&g){const e=a*u*c,r=structuredClone(t.volumeInfo),n=new Float32Array(e*d);t.volumeInfo.offset=r.offset,t.volumeInfo.scale=r.scale;let o=0;const i=r.scale.map(e=>1/e);for(let t=0;t<e;t++)for(let e=0;e<d;e++)n[o]=(g[o]-r.offset[e])*i[e],o++;m=vd.FLOAT,g=n}if(e.getOpenGLDataType(m),e.getInternalFormat(m,d),e.getFormat(m,d),!t.internalFormat||!t.format||!t.openGLDataType)return xd("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_3D,t.components=d,t.width=a,t.height=u,t.depth=c,t.numberOfDimensions=3,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind();const y=h.length>0,v=!y||!ke(t._prevTexParams,r()),b=[g],x=s(e.updateArrayDataTypeForGL(m,b,!0,v?[]:h));if(t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),v)l(m)?(t.context.texStorage3D(t.target,1,t.internalFormat,t.width,t.height,t.depth),null!=x[0]&&t.context.texSubImage3D(t.target,0,0,0,0,t.width,t.height,t.depth,t.format,t.openGLDataType,x[0])):t.context.texImage3D(t.target,0,t.internalFormat,t.width,t.height,t.depth,0,t.format,t.openGLDataType,x[0]),t._prevTexParams=r();else if(y){const e=x[0];let r=0;for(let n=0;n<h.length;n++){const a=h[n],s=o(a),l=i(a),u=new e.constructor(e.buffer,r,l);r+=u.byteLength,t.context.texSubImage3D(t.target,0,a[0],a[2],a[4],s[0],s[1],s[2],t.format,t.openGLDataType,u)}}return t.generateMipmap&&t.context.generateMipmap(t.target),t.allocatedGPUMemoryInBytes=t.width*t.height*t.depth*t.components*t._openGLRenderWindow.getDefaultTextureByteSize(m,n(),e.useHalfFloat()),e.deactivate(),!0},e.create3DFilterableFromRaw=function(){let{width:t=Sd("width"),height:r=Sd("height"),depth:n=Sd("depth"),numComps:o=Sd("numComps"),dataType:i=Sd("dataType"),data:a=Sd("data"),preferSizeOverAccuracy:s=!1,ranges:l,updatedExtents:u=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.create3DFilterableFromDataArray({width:t,height:r,depth:n,dataArray:_s.newInstance({numberOfComponents:o,dataType:i,values:a,ranges:l}),preferSizeOverAccuracy:s,updatedExtents:u})},e.create3DFilterableFromDataArray=function(){let{width:r=Sd("width"),height:n=Sd("height"),depth:o=Sd("depth"),dataArray:i=Sd("dataArray"),preferSizeOverAccuracy:a=!1,updatedExtents:s=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{numComps:c,dataType:d,data:p,scaleOffsets:f}=u(i,a),h=[],m=[];for(let e=0;e<c;++e)h[e]=0,m[e]=1;if(t.volumeInfo={scale:m,offset:h,dataComputedScale:f.scale,dataComputedOffset:f.offset,width:r,height:n,depth:o},t._openGLRenderWindow.getWebgl2())return e.create3DFromRaw({width:r,height:n,depth:o,numComps:c,dataType:d,data:p,updatedExtents:s});const g=r*n*o,y=structuredClone(f);let v=(e,t,r,n,o)=>{e[t]=r},b=vd.UNSIGNED_CHAR;if(d===vd.UNSIGNED_CHAR)for(let e=0;e<c;++e)y.offset[e]=0,y.scale[e]=255;else t.context.getExtension("OES_texture_float")&&t.context.getExtension("OES_texture_float_linear")?(b=vd.FLOAT,v=(e,t,r,n,o)=>{e[t]=(r-n)/o}):(b=vd.UNSIGNED_CHAR,v=(e,t,r,n,o)=>{e[t]=255*(r-n)/o});if(e.getOpenGLDataType(b),e.getInternalFormat(b,c),e.getFormat(b,c),!t.internalFormat||!t.format||!t.openGLDataType)return xd("Failed to determine texture parameters."),!1;t.target=t.context.TEXTURE_2D,t.components=c,t.depth=1,t.numberOfDimensions=2;let x=t.context.getParameter(t.context.MAX_TEXTURE_SIZE);x>4096&&(b===vd.FLOAT||c>=3)&&(x=4096);let _=1,S=1;g>x*x&&(_=Math.ceil(Math.sqrt(g/(x*x))),S=_);let C=Math.sqrt(g)/_;C=Ao(C);const T=Math.floor(C*_/r),w=Math.ceil(o/T),A=Ao(n*w/S);let E;t.width=C,t.height=A,t._openGLRenderWindow.activateTexture(e),e.createTexture(),e.bind(),t.volumeInfo.xreps=T,t.volumeInfo.yreps=w,t.volumeInfo.xstride=_,t.volumeInfo.ystride=S,t.volumeInfo.offset=y.offset,t.volumeInfo.scale=y.scale;const D=C*A*c;E=b===vd.FLOAT?new Float32Array(D):new Uint8Array(D);let P=0;const I=Math.floor(r/_),O=Math.floor(n/S);for(let e=0;e<w;e++){const i=Math.min(T,o-e*T),a=c*(t.width-i*Math.floor(r/_));for(let t=0;t<O;t++){for(let o=0;o<i;o++){const i=c*((e*T+o)*r*n+S*t*r);for(let e=0;e<I;e++)for(let t=0;t<c;t++)v(E,P,p[i+_*e*c+t],y.offset[t],y.scale[t]),P++}P+=a}}return t.context.pixelStorei(t.context.UNPACK_ALIGNMENT,1),l(b)?(t.context.texStorage2D(t.target,1,t.internalFormat,t.width,t.height),null!=E&&t.context.texSubImage2D(t.target,0,0,0,t.width,t.height,t.format,t.openGLDataType,E)):t.context.texImage2D(t.target,0,t.internalFormat,t.width,t.height,0,t.format,t.openGLDataType,E),e.deactivate(),!0},e.setOpenGLRenderWindow=r=>{t._openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t._openGLRenderWindow=r,t.context=null,r&&(t.context=t._openGLRenderWindow.getContext()))},e.getMaximumTextureSize=e=>e&&e.isCurrent()?e.getIntegerv(e.MAX_TEXTURE_SIZE):-1,e.enableUseHalfFloat=e=>{t.enableUseHalfFloat=e}}const wd={_openGLRenderWindow:null,_forceInternalFormat:!1,_prevTexParams:null,context:null,handle:0,sendParametersTime:null,textureBuildTime:null,numberOfDimensions:0,target:0,format:0,openGLDataType:0,components:0,width:0,height:0,depth:0,autoParameters:!0,wrapS:gd.CLAMP_TO_EDGE,wrapT:gd.CLAMP_TO_EDGE,wrapR:gd.CLAMP_TO_EDGE,minificationFilter:yd.NEAREST,magnificationFilter:yd.NEAREST,minLOD:-1e3,maxLOD:1e3,baseLevel:0,maxLevel:1e3,generateMipmap:!1,oglNorm16Ext:null,allocatedGPUMemoryInBytes:0,enableUseHalfFloat:!0,canUseHalfFloat:!1};function Ad(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,wd,r),Xt.extend(e,t,r),t.sendParametersTime={},mt(t.sendParametersTime,{mtime:0}),t.textureBuildTime={},mt(t.textureBuildTime,{mtime:0}),xt(e,t,["format","openGLDataType"]),_t(e,t,["keyMatrixTime","minificationFilter","magnificationFilter","wrapS","wrapT","wrapR","generateMipmap","oglNorm16Ext"]),yt(e,t,["width","height","volumeInfo","components","handle","target","allocatedGPUMemoryInBytes"]),wt(0,t,["openGLRenderWindow"]),Td(e,t)}const Ed=Pt(Ad,"vtkOpenGLTexture");var Dd={newInstance:Ed,extend:Ad,...dd};Qt("vtkTexture",Ed);var Pd=function(e,t){e.replaceShaderCoincidentOffset=(r,n,o)=>{const i=e.getCoincidentParameters(n,o);if(i&&(0!==i.factor||0!==i.offset)){let e=r.Fragment;e=rd.substitute(e,"//VTK::Coincident::Dec",["uniform float cfactor;","uniform float coffset;"]).result,t.context.getExtension("EXT_frag_depth")&&(0!==i.factor?(e=rd.substitute(e,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,e=rd.substitute(e,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):e=rd.substitute(e,"//VTK::Depth::Impl","gl_FragDepthEXT = gl_FragCoord.z + 0.000016*coffset;").result),t._openGLRenderWindow.getWebgl2()&&(0!==i.factor?(e=rd.substitute(e,"//VTK::UniformFlow::Impl",["float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));","//VTK::UniformFlow::Impl"],!1).result,e=rd.substitute(e,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;").result):e=rd.substitute(e,"//VTK::Depth::Impl","gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;").result),r.Fragment=e}}},Id=function(e,t){e.applyShaderReplacements=(e,t,r)=>{let n=null;if(t&&(n=t.ShaderReplacements),n)for(let t=0;t<n.length;t++){const o=n[t];if(r&&o.replaceFirst||!r&&!o.replaceFirst){const t=o.shaderType,r=e[t],n=rd.substitute(r,o.originalValue,o.replacementValue,o.replaceAll);e[t]=n.result}}},e.buildShaders=(r,n,o)=>{e.getReplacedShaderTemplate(r,n,o),t.lastRenderPassShaderReplacement=t.currentRenderPass?t.currentRenderPass.getShaderReplacement():null,t.lastRenderPassShaderReplacement&&t.lastRenderPassShaderReplacement(r);const i=t.renderable.getViewSpecificProperties().OpenGL;e.applyShaderReplacements(r,i,!0),e.replaceShaderValues(r,n,o),e.applyShaderReplacements(r,i)},e.getReplacedShaderTemplate=(r,n,o)=>{const i=t.renderable.getViewSpecificProperties().OpenGL;e.getShaderTemplate(r,n,o);let a=r.Vertex;if(i){const e=i.VertexShaderCode;void 0!==e&&""!==e&&(a=e)}r.Vertex=a;let s=r.Fragment;if(i){const e=i.FragmentShaderCode;void 0!==e&&""!==e&&(s=e)}r.Fragment=s;let l=r.Geometry;if(i){const e=i.GeometryShaderCode;void 0!==e&&(l=e)}r.Geometry=l}};const{FieldAssociations:Od}=Gs,{primTypes:Nd}=ud,{Representation:Md,Shading:Rd}=os,{ScalarMode:Fd}=Gl,{Filter:Bd,Wrap:Ld}=Dd,{vtkErrorMacro:kd}=jt,Ud={type:"StartEvent"},Vd={type:"EndEvent"},{CoordinateSystem:Gd}=Ka;const zd={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null,tmpMat4:null,ambientColor:[],diffuseColor:[],specularColor:[],lightColor:[],lightDirection:[],lastHaveSeenDepthRequest:!1,haveSeenDepthRequest:!1,lastSelectionState:Tl.MIN_KNOWN_PASS-1,selectionStateChanged:null,selectionWebGLIdsToVTKIds:null,pointPicking:!1};const jd=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zd,r),Xt.extend(e,t,r),Pd(e,t,r),Id(e,t,r),t.primitives=[],t.primTypes=Nd,t.tmpMat3=pe(new Float64Array(9)),t.tmpMat4=h(new Float64Array(16));for(let e=Nd.Start;e<Nd.End;e++)t.primitives[e]=ud.newInstance(),t.primitives[e].setPrimitiveType(e),t.primitives[e].set({lastLightComplexity:0,lastLightCount:0,lastSelectionPass:!1},!0);_t(e,t,["context"]),t.VBOBuildTime={},mt(t.VBOBuildTime,{mtime:0}),t.selectionStateChanged={},mt(t.selectionStateChanged,{mtime:0}),function(e,t){function r(e,t,r){return t.identity(r),e.reduce((e,r,n)=>0===n?r?t.copy(e,r):t.identity(e):r?t.multiply(e,e,r):e,r)}t.classHierarchy.push("vtkOpenGLPolyDataMapper"),e.buildPass=r=>{r&&(t.currentRenderPass=null,t.openGLActor=e.getFirstAncestorOfType("vtkOpenGLActor"),t._openGLRenderer=t.openGLActor.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),t.openGLCamera=t._openGLRenderer.getViewNodeFor(t._openGLRenderer.getRenderable().getActiveCamera(),t.openGLCamera))},e.translucentPass=(r,n)=>{r&&(t.currentRenderPass=n,e.render())},e.zBufferPass=r=>{r&&(t.haveSeenDepthRequest=!0,t.renderDepth=!0,e.render(),t.renderDepth=!1)},e.opaqueZBufferPass=t=>e.zBufferPass(t),e.opaquePass=t=>{t&&e.render()},e.render=()=>{const r=t._openGLRenderWindow.getContext();if(t.context!==r){t.context=r;for(let e=Nd.Start;e<Nd.End;e++)t.primitives[e].setOpenGLRenderWindow(t._openGLRenderWindow)}const n=t.openGLActor.getRenderable(),o=t._openGLRenderer.getRenderable();e.renderPiece(o,n)},e.getShaderTemplate=(e,t,r)=>{e.Vertex="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataVS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n\nattribute vec4 vertexMC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// optional normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// camera and actor matrix values\n//VTK::Camera::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// picking support\n//VTK::Picking::Dec\n\nvoid main()\n{\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Clip::Impl\n\n //VTK::PrimID::Impl\n\n //VTK::PositionVC::Impl\n\n //VTK::Light::Impl\n\n //VTK::Picking::Impl\n}\n",e.Fragment="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyDataFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n// Template for the polydata mappers fragment shader\n\nuniform int PrimitiveIDOffset;\n\n// VC position of this fragment\n//VTK::PositionVC::Dec\n\n// optional color passed in from the vertex shader, vertexColor\n//VTK::Color::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n// extra lighting parameters\n//VTK::Light::Dec\n\n// define vtkImageLabelOutlineOn\n//VTK::ImageLabelOutlineOn\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// Depth Peeling Support\n//VTK::DepthPeeling::Dec\n\n// clipping plane vars\n//VTK::Clip::Dec\n\n// label outline \n//VTK::LabelOutline::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\n// handle coincident offsets\n//VTK::Coincident::Dec\n\n//VTK::ZBuffer::Dec\n\n//VTK::LabelOutlineHelperFunction\n\nvoid main()\n{\n // VC position of this fragment. This should not branch/return/discard.\n //VTK::PositionVC::Impl\n\n // Place any calls that require uniform flow (e.g. dFdx) here.\n //VTK::UniformFlow::Impl\n\n // Set gl_FragDepth here (gl_FragCoord.z by default)\n //VTK::Depth::Impl\n\n // Early depth peeling abort:\n //VTK::DepthPeeling::PreColor\n\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Clip::Impl\n\n //VTK::Color::Impl\n\n // Generate the normal if we are not passed in one\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Light::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n\n //VTK::DepthPeeling::Impl\n\n //VTK::Picking::Impl\n\n // handle coincident offsets\n //VTK::Coincident::Impl\n\n //VTK::ZBuffer::Impl\n\n //VTK::RenderPassFragmentShader::Impl\n}\n",e.Geometry=""},e.replaceShaderColor=(e,r,n)=>{let o=e.Vertex,i=e.Geometry,a=e.Fragment;const s=t.lastBoundBO.getReferenceByName("lastLightComplexity");let l=["uniform float ambient;","uniform float diffuse;","uniform float specular;","uniform float opacityUniform; // the fragment opacity","uniform vec3 ambientColorUniform;","uniform vec3 diffuseColorUniform;"];s&&(l=l.concat(["uniform vec3 specularColorUniform;","uniform float specularPowerUniform;"]));let u=["vec3 ambientColor;"," vec3 diffuseColor;"," float opacity;"];s&&(u=u.concat([" vec3 specularColor;"," float specularPower;"])),u=u.concat([" ambientColor = ambientColorUniform;"," diffuseColor = diffuseColorUniform;"," opacity = opacityUniform;"]),s&&(u=u.concat([" specularColor = specularColorUniform;"," specularPower = specularPowerUniform;"])),0===t.lastBoundBO.getCABO().getColorComponents()||t.drawingEdges||(l=l.concat(["varying vec4 vertexColorVSOutput;"]),o=rd.substitute(o,"//VTK::Color::Dec",["attribute vec4 scalarColor;","varying vec4 vertexColorVSOutput;"]).result,o=rd.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = scalarColor;"]).result,i=rd.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=rd.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result),0===t.lastBoundBO.getCABO().getColorComponents()||t.drawingEdges?(t.renderable.getAreScalarsMappedFromCells()||t.renderable.getInterpolateScalarsBeforeMapping())&&t.renderable.getColorCoordinates()&&!t.drawingEdges?a=rd.substitute(a,"//VTK::Color::Impl",u.concat([" vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);"," diffuseColor = texColor.rgb;"," ambientColor = texColor.rgb;"," opacity = opacity*texColor.a;"])).result:(n.getBackfaceProperty()&&!t.drawingEdges&&(l=l.concat(["uniform float opacityUniformBF; // the fragment opacity","uniform float ambientIntensityBF; // the material ambient","uniform float diffuseIntensityBF; // the material diffuse","uniform vec3 ambientColorUniformBF; // ambient material color","uniform vec3 diffuseColorUniformBF; // diffuse material color"]),s?(l=l.concat(["uniform float specularIntensityBF; // the material specular intensity","uniform vec3 specularColorUniformBF; // intensity weighted color","uniform float specularPowerUniformBF;"]),u=u.concat(["if (gl_FrontFacing == false) {"," ambientColor = ambientIntensityBF * ambientColorUniformBF;"," diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;"," specularColor = specularIntensityBF * specularColorUniformBF;"," specularPower = specularPowerUniformBF;"," opacity = opacityUniformBF; }"])):u=u.concat(["if (gl_FrontFacing == false) {"," ambientColor = ambientIntensityBF * ambientColorUniformBF;"," diffuseColor = diffuseIntensityBF * diffuseColorUniformBF;"," opacity = opacityUniformBF; }"])),t.haveCellScalars&&!t.drawingEdges&&(l=l.concat(["uniform samplerBuffer texture1;"])),a=rd.substitute(a,"//VTK::Color::Impl",u).result):a=rd.substitute(a,"//VTK::Color::Impl",u.concat([" diffuseColor = vertexColorVSOutput.rgb;"," ambientColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])).result,a=rd.substitute(a,"//VTK::Color::Dec",l).result,e.Vertex=o,e.Geometry=i,e.Fragment=a},e.replaceShaderLight=(e,r,n)=>{let o=e.Fragment;const i=t.lastBoundBO.getReferenceByName("lastLightComplexity"),a=t.lastBoundBO.getReferenceByName("lastLightCount");let s=[];switch(i){case 0:o=rd.substitute(o,"//VTK::Light::Impl",[" gl_FragData[0] = vec4(ambientColor * ambient + diffuseColor * diffuse, opacity);"," //VTK::Light::Impl"],!1).result;break;case 1:o=rd.substitute(o,"//VTK::Light::Impl",[" float df = max(0.0, normalVCVSOutput.z);"," float sf = pow(df, specularPower);"," vec3 diffuseL = df * diffuseColor;"," vec3 specularL = sf * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"],!1).result;break;case 2:for(let e=0;e<a;++e)s=s.concat([`uniform vec3 lightColor${e};`,`uniform vec3 lightDirectionVC${e}; // normalized`,`uniform vec3 lightHalfAngleVC${e}; // normalized`]);o=rd.substitute(o,"//VTK::Light::Dec",s).result,s=["vec3 diffuseL = vec3(0,0,0);"," vec3 specularL = vec3(0,0,0);"," float df;"];for(let e=0;e<a;++e)s=s.concat([` df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC${e}));`,` diffuseL += ((df) * lightColor${e});`,` if (dot(normalVCVSOutput, lightDirectionVC${e}) < 0.0)`," {",` float sf = sign(df)*pow(max(1e-5,\n dot(reflect(lightDirectionVC${e},normalVCVSOutput),\n normalize(-vertexVC.xyz))),\n specularPower);`,` specularL += (sf * lightColor${e});`," }"]);s=s.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),o=rd.substitute(o,"//VTK::Light::Impl",s,!1).result;break;case 3:for(let e=0;e<a;++e)s=s.concat([`uniform vec3 lightColor${e};`,`uniform vec3 lightDirectionVC${e}; // normalized`,`uniform vec3 lightHalfAngleVC${e}; // normalized`,`uniform vec3 lightPositionVC${e};`,`uniform vec3 lightAttenuation${e};`,`uniform float lightConeAngle${e};`,`uniform float lightExponent${e};`,`uniform int lightPositional${e};`]);o=rd.substitute(o,"//VTK::Light::Dec",s).result,s=["vec3 diffuseL = vec3(0,0,0);"," vec3 specularL = vec3(0,0,0);"," vec3 vertLightDirectionVC;"," float attenuation;"," float df;"];for(let e=0;e<a;++e)s=s.concat([" attenuation = 1.0;",` if (lightPositional${e} == 0)`," {",` vertLightDirectionVC = lightDirectionVC${e};`," }"," else"," {",` vertLightDirectionVC = vertexVC.xyz - lightPositionVC${e};`," float distanceVC = length(vertLightDirectionVC);"," vertLightDirectionVC = normalize(vertLightDirectionVC);"," attenuation = 1.0 /",` (lightAttenuation${e}.x`,` + lightAttenuation${e}.y * distanceVC`,` + lightAttenuation${e}.z * distanceVC * distanceVC);`," // per OpenGL standard cone angle is 90 or less for a spot light",` if (lightConeAngle${e} <= 90.0)`," {",` float coneDot = dot(vertLightDirectionVC, lightDirectionVC${e});`," // if inside the cone",` if (coneDot >= cos(radians(lightConeAngle${e})))`," {",` attenuation = attenuation * pow(coneDot, lightExponent${e});`," }"," else"," {"," attenuation = 0.0;"," }"," }"," }"," df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));",` diffuseL += ((df) * lightColor${e});`," if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)"," {",` float sf = sign(df)*attenuation*pow(max(1e-5,\n dot(reflect(lightDirectionVC${e},\n normalVCVSOutput),\n normalize(-vertexVC.xyz))),\n specularPower);`,` specularL += ((sf) * lightColor${e});`," }"]);s=s.concat([" diffuseL = diffuseL * diffuseColor;"," specularL = specularL * specularColor;"," gl_FragData[0] = vec4(ambientColor * ambient + diffuseL * diffuse + specularL * specular, opacity);"," //VTK::Light::Impl"]),o=rd.substitute(o,"//VTK::Light::Impl",s,!1).result;break;default:kd("bad light complexity")}e.Fragment=o},e.replaceShaderNormal=(e,r,n)=>{if(t.lastBoundBO.getReferenceByName("lastLightComplexity")>0){let r=e.Vertex,o=e.Geometry,i=e.Fragment;t.lastBoundBO.getCABO().getNormalOffset()?(r=rd.substitute(r,"//VTK::Normal::Dec",["attribute vec3 normalMC;","uniform mat3 normalMatrix;","varying vec3 normalVCVSOutput;"]).result,r=rd.substitute(r,"//VTK::Normal::Impl",["normalVCVSOutput = normalMatrix * normalMC;"]).result,o=rd.substitute(o,"//VTK::Normal::Dec",["in vec3 normalVCVSOutput[];","out vec3 normalVCGSOutput;"]).result,o=rd.substitute(o,"//VTK::Normal::Impl",["normalVCGSOutput = normalVCVSOutput[i];"]).result,i=rd.substitute(i,"//VTK::Normal::Dec",["varying vec3 normalVCVSOutput;"]).result,i=rd.substitute(i,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalVCVSOutput);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):t.haveCellNormals?(i=rd.substitute(i,"//VTK::Normal::Dec",["uniform mat3 normalMatrix;","uniform samplerBuffer textureN;"]).result,i=rd.substitute(i,"//VTK::Normal::Impl",["vec3 normalVCVSOutput = normalize(normalMatrix *"," texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);"," if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }"]).result):t.lastBoundBO.getOpenGLMode(n.getProperty().getRepresentation())===t.context.LINES?(i=rd.substitute(i,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,i=rd.substitute(i,"//VTK::Normal::Impl",["vec3 normalVCVSOutput;"," if (abs(fdx.x) > 0.0)"," { fdx = normalize(fdx); normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }"," else { fdy = normalize(fdy); normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"]).result):(i=rd.substitute(i,"//VTK::Normal::Dec",["uniform int cameraParallel;"]).result,i=rd.substitute(i,"//VTK::UniformFlow::Impl",[" vec3 fdx = dFdx(vertexVC.xyz);"," vec3 fdy = dFdy(vertexVC.xyz);"," //VTK::UniformFlow::Impl"]).result,i=rd.substitute(i,"//VTK::Normal::Impl",[" fdx = normalize(fdx);"," fdy = normalize(fdy);"," vec3 normalVCVSOutput = normalize(cross(fdx,fdy));"," if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"," if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVC.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"]).result),e.Vertex=r,e.Geometry=o,e.Fragment=i}},e.replaceShaderPositionVC=(e,r,n)=>{t.lastBoundBO.replaceShaderPositionVC(e,r,n);let o=e.Vertex,i=e.Geometry,a=e.Fragment;t.lastBoundBO.getReferenceByName("lastLightComplexity")>0?(o=rd.substitute(o,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,o=rd.substitute(o,"//VTK::PositionVC::Impl",["vertexVCVSOutput = MCVCMatrix * vertexMC;"," gl_Position = MCPCMatrix * vertexMC;"]).result,o=rd.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;","uniform mat4 MCVCMatrix;"]).result,i=rd.substitute(i,"//VTK::PositionVC::Dec",["in vec4 vertexVCVSOutput[];","out vec4 vertexVCGSOutput;"]).result,i=rd.substitute(i,"//VTK::PositionVC::Impl",["vertexVCGSOutput = vertexVCVSOutput[i];"]).result,a=rd.substitute(a,"//VTK::PositionVC::Dec",["varying vec4 vertexVCVSOutput;"]).result,a=rd.substitute(a,"//VTK::PositionVC::Impl",["vec4 vertexVC = vertexVCVSOutput;"]).result):(o=rd.substitute(o,"//VTK::Camera::Dec",["uniform mat4 MCPCMatrix;"]).result,o=rd.substitute(o,"//VTK::PositionVC::Impl",[" gl_Position = MCPCMatrix * vertexMC;"]).result),e.Vertex=o,e.Geometry=i,e.Fragment=a},e.replaceShaderTCoord=(e,r,n)=>{if(t.lastBoundBO.getCABO().getTCoordOffset()){let r=e.Vertex,n=e.Geometry,o=e.Fragment;if(t.drawingEdges)return;r=rd.substitute(r,"//VTK::TCoord::Impl","tcoordVCVSOutput = tcoordMC;").result;const i=t.openGLActor.getActiveTextures();let a=2,s=2;if(i&&i.length>0&&(a=i[0].getComponents(),i[0].getTarget()===t.context.TEXTURE_CUBE_MAP&&(s=3)),t.renderable.getColorTextureMap()&&(a=t.renderable.getColorTextureMap().getPointData().getScalars().getNumberOfComponents(),s=2),2===s){if(r=rd.substitute(r,"//VTK::TCoord::Dec","attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;").result,n=rd.substitute(n,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];","out vec2 tcoordVCGSOutput;"]).result,n=rd.substitute(n,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,o=rd.substitute(o,"//VTK::TCoord::Dec",["varying vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,i&&i.length>=1)switch(a){case 1:o=rd.substitute(o,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:o=rd.substitute(o,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:o=rd.substitute(o,"//VTK::TCoord::Impl",[" vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}}else switch(r=rd.substitute(r,"//VTK::TCoord::Dec","attribute vec3 tcoordMC; varying vec3 tcoordVCVSOutput;").result,n=rd.substitute(n,"//VTK::TCoord::Dec",["in vec3 tcoordVCVSOutput[];","out vec3 tcoordVCGSOutput;"]).result,n=rd.substitute(n,"//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];").result,o=rd.substitute(o,"//VTK::TCoord::Dec",["varying vec3 tcoordVCVSOutput;","uniform samplerCube texture1;"]).result,a){case 1:o=rd.substitute(o,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"]).result;break;case 2:o=rd.substitute(o,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.r;"," diffuseColor = diffuseColor*tcolor.r;"," opacity = opacity * tcolor.g;"]).result;break;default:o=rd.substitute(o,"//VTK::TCoord::Impl",[" vec4 tcolor = textureCube(texture1, tcoordVCVSOutput);"," ambientColor = ambientColor*tcolor.rgb;"," diffuseColor = diffuseColor*tcolor.rgb;"," opacity = opacity * tcolor.a;"]).result}e.Vertex=r,e.Geometry=n,e.Fragment=o}},e.replaceShaderClip=(e,r,n)=>{let o=e.Vertex,i=e.Fragment;if(t.renderable.getNumberOfClippingPlanes()){const e=t.renderable.getNumberOfClippingPlanes();o=rd.substitute(o,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`uniform vec4 clipPlanes[${e}];`,`varying float clipDistancesVSOutput[${e}];`]).result,o=rd.substitute(o,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${e}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);"," }"]).result,i=rd.substitute(i,"//VTK::Clip::Dec",["uniform int numClipPlanes;",`varying float clipDistancesVSOutput[${e}];`]).result,i=rd.substitute(i,"//VTK::Clip::Impl",[`for (int planeNum = 0; planeNum < ${e}; planeNum++)`," {"," if (planeNum >= numClipPlanes)"," {"," break;"," }"," if (clipDistancesVSOutput[planeNum] < 0.0) discard;"," }"]).result}e.Vertex=o,e.Fragment=i},e.getCoincidentParameters=(e,r)=>{let n={factor:0,offset:0};const o=r.getProperty();if(t.renderable.getResolveCoincidentTopology()==hl.PolygonOffset||o.getEdgeVisibility()&&o.getRepresentation()===Md.SURFACE){const e=t.lastBoundBO.getPrimitiveType();e===Nd.Points||o.getRepresentation()===Md.POINTS?n=t.renderable.getCoincidentTopologyPointOffsetParameter():e===Nd.Lines||o.getRepresentation()===Md.WIREFRAME?n=t.renderable.getCoincidentTopologyLineOffsetParameters():e!==Nd.Tris&&e!==Nd.TriStrips||(n=t.renderable.getCoincidentTopologyPolygonOffsetParameters()),e!==Nd.TrisEdges&&e!==Nd.TriStripsEdges||(n=t.renderable.getCoincidentTopologyPolygonOffsetParameters(),n.factor/=2,n.offset/=2)}const i=t._openGLRenderer.getSelector();return i&&i.getFieldAssociation()===Od.FIELD_ASSOCIATION_POINTS&&(n.offset-=2),n},e.replaceShaderPicking=(e,r,n)=>{let o=e.Fragment,i=e.Vertex;if(o=rd.substitute(o,"//VTK::Picking::Dec",["uniform int picking;","//VTK::Picking::Dec"]).result,t._openGLRenderer.getSelector()){switch(t.lastSelectionState!==Tl.ID_LOW24&&t.lastSelectionState!==Tl.ID_HIGH24||(i=rd.substitute(i,"//VTK::Picking::Dec",["flat out int vertexIDVSOutput;\n","uniform int VertexIDOffset;\n"]).result,i=rd.substitute(i,"//VTK::Picking::Impl"," vertexIDVSOutput = gl_VertexID + VertexIDOffset;\n").result,o=rd.substitute(o,"//VTK::Picking::Dec","flat in int vertexIDVSOutput;\n").result,o=rd.substitute(o,"//VTK::Picking::Impl",[" int idx = vertexIDVSOutput;","//VTK::Picking::Impl"]).result),t.lastSelectionState){case Tl.ID_LOW24:o=rd.substitute(o,"//VTK::Picking::Impl"," gl_FragData[0] = vec4(float(idx%256)/255.0, float((idx/256)%256)/255.0, float((idx/65536)%256)/255.0, 1.0);").result;break;case Tl.ID_HIGH24:o=rd.substitute(o,"//VTK::Picking::Impl"," gl_FragData[0] = vec4(float((idx/16777216)%256)/255.0, 0.0, 0.0, 1.0);").result;break;default:o=rd.substitute(o,"//VTK::Picking::Dec","uniform vec3 mapperIndex;").result,o=rd.substitute(o,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result}e.Fragment=o,e.Vertex=i}},e.replaceShaderValues=(r,n,o)=>{if(e.replaceShaderColor(r,n,o),e.replaceShaderNormal(r,n,o),e.replaceShaderLight(r,n,o),e.replaceShaderTCoord(r,n,o),e.replaceShaderPicking(r,n,o),e.replaceShaderClip(r,n,o),e.replaceShaderCoincidentOffset(r,n,o),e.replaceShaderPositionVC(r,n,o),t.haveSeenDepthRequest){let e=r.Fragment;e=rd.substitute(e,"//VTK::ZBuffer::Dec","uniform int depthRequest;").result,e=rd.substitute(e,"//VTK::ZBuffer::Impl",["if (depthRequest == 1) {","float iz = floor(gl_FragCoord.z*65535.0 + 0.1);","float rf = floor(iz/256.0)/255.0;","float gf = mod(iz,256.0)/255.0;","gl_FragData[0] = vec4(rf, gf, 0.0, 1.0); }"]).result,r.Fragment=e}},e.getNeedToRebuildShaders=(e,r,n)=>{let o=0,i=0;const a=e.getPrimitiveType(),s=t.currentInput;let l=!1;const u=s.getPointData().getNormals(),c=s.getCellData().getNormals(),d=n.getProperty().getInterpolation()===Rd.FLAT,p=n.getProperty().getRepresentation(),f=e.getOpenGLMode(p,a);if(f===t.context.TRIANGLES||c&&!u||!d&&u?l=!0:d||f!==t.context.LINES||(l=!0),n.getProperty().getLighting()&&l){o=0;const e=r.getLightsByReference();for(let t=0;t<e.length;++t){const r=e[t];r.getSwitch()>0&&(i++,0===o&&(o=1)),1===o&&(i>1||1!==r.getIntensity()||!r.lightTypeIsHeadLight())&&(o=2),o<3&&r.getPositional()&&(o=3)}}let h=!1;const m=t.lastBoundBO.getReferenceByName("lastLightComplexity"),g=t.lastBoundBO.getReferenceByName("lastLightCount");return m===o&&g===i||(t.lastBoundBO.set({lastLightComplexity:o},!0),t.lastBoundBO.set({lastLightCount:i},!0),h=!0),(!t.currentRenderPass&&t.lastRenderPassShaderReplacement||t.currentRenderPass&&t.currentRenderPass.getShaderReplacement()!==t.lastRenderPassShaderReplacement)&&(h=!0),!!(t.lastHaveSeenDepthRequest!==t.haveSeenDepthRequest||e.getShaderSourceTime().getMTime()<t.renderable.getMTime()||e.getShaderSourceTime().getMTime()<t.currentInput.getMTime()||e.getShaderSourceTime().getMTime()<t.selectionStateChanged.getMTime()||h)&&(t.lastHaveSeenDepthRequest=t.haveSeenDepthRequest,!0)},e.invokeShaderCallbacks=(e,r,n)=>{const o=t.renderable.getViewSpecificProperties().ShadersCallbacks;o&&o.forEach(t=>{t.callback(t.userData,e,r,n)})},e.setMapperShaderParameters=(r,n,o)=>{if(r.getProgram().isUniformUsed("PrimitiveIDOffset")&&r.getProgram().setUniformi("PrimitiveIDOffset",t.primitiveIDOffset),r.getProgram().isUniformUsed("VertexIDOffset")&&r.getProgram().setUniformi("VertexIDOffset",t.vertexIDOffset),r.getCABO().getElementCount()&&(t.VBOBuildTime.getMTime()>r.getAttributeUpdateTime().getMTime()||r.getShaderSourceTime().getMTime()>r.getAttributeUpdateTime().getMTime())){const e=t.lastBoundBO.getReferenceByName("lastLightComplexity");r.getProgram().isAttributeUsed("vertexMC")&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"vertexMC",r.getCABO().getVertexOffset(),r.getCABO().getStride(),t.context.FLOAT,3,!1)||kd("Error setting vertexMC in shader VAO.")),r.getProgram().isAttributeUsed("normalMC")&&r.getCABO().getNormalOffset()&&e>0?r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"normalMC",r.getCABO().getNormalOffset(),r.getCABO().getStride(),t.context.FLOAT,3,!1)||kd("Error setting normalMC in shader VAO."):r.getVAO().removeAttributeArray("normalMC"),t.renderable.getCustomShaderAttributes().forEach((e,n)=>{r.getProgram().isAttributeUsed(`${e}MC`)&&(r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),`${e}MC`,r.getCABO().getCustomData()[n].offset,r.getCABO().getStride(),t.context.FLOAT,r.getCABO().getCustomData()[n].components,!1)||kd(`Error setting ${e}MC in shader VAO.`))}),r.getProgram().isAttributeUsed("tcoordMC")&&r.getCABO().getTCoordOffset()?r.getVAO().addAttributeArray(r.getProgram(),r.getCABO(),"tcoordMC",r.getCABO().getTCoordOffset(),r.getCABO().getStride(),t.context.FLOAT,r.getCABO().getTCoordComponents(),!1)||kd("Error setting tcoordMC in shader VAO."):r.getVAO().removeAttributeArray("tcoordMC"),r.getProgram().isAttributeUsed("scalarColor")&&r.getCABO().getColorComponents()?r.getVAO().addAttributeArray(r.getProgram(),r.getCABO().getColorBO(),"scalarColor",r.getCABO().getColorOffset(),r.getCABO().getColorBOStride(),t.context.UNSIGNED_BYTE,4,!0)||kd("Error setting scalarColor in shader VAO."):r.getVAO().removeAttributeArray("scalarColor"),r.getAttributeUpdateTime().modified()}if(t.renderable.getNumberOfClippingPlanes()){const e=t.renderable.getNumberOfClippingPlanes(),n=[],i=r.getCABO().getCoordShiftAndScaleEnabled()?r.getCABO().getInverseShiftAndScaleMatrix():null,a=i?d(t.tmpMat4,o.getMatrix()):o.getMatrix();i&&(m(a,a),b(a,a,i),m(a,a));for(let r=0;r<e;r++){const e=[];t.renderable.getClippingPlaneInDataCoords(a,r,e);for(let t=0;t<4;t++)n.push(e[t])}r.getProgram().setUniformi("numClipPlanes",e),r.getProgram().setUniform4fv("clipPlanes",n)}t.internalColorTexture&&r.getProgram().isUniformUsed("texture1")&&r.getProgram().setUniformi("texture1",t.internalColorTexture.getTextureUnit());const i=t.openGLActor.getActiveTextures();if(i)for(let e=0;e<i.length;++e){const t=i[e].getTextureUnit(),n=`texture${t+1}`;r.getProgram().isUniformUsed(n)&&r.getProgram().setUniformi(n,t)}if(t.haveSeenDepthRequest&&r.getProgram().setUniformi("depthRequest",t.renderDepth?1:0),r.getProgram().isUniformUsed("coffset")){const t=e.getCoincidentParameters(n,o);r.getProgram().setUniformf("coffset",t.offset),r.getProgram().isUniformUsed("cfactor")&&r.getProgram().setUniformf("cfactor",t.factor)}r.setMapperShaderParameters(n,o,t._openGLRenderer.getTiledSizeAndOrigin());const a=t._openGLRenderer.getSelector();r.getProgram().setUniform3fArray("mapperIndex",a?a.getPropColorValue():[0,0,0]),r.getProgram().setUniformi("picking",a?a.getCurrentPass()+1:0)},e.setLightingShaderParameters=(e,r,n)=>{const o=t.lastBoundBO.getReferenceByName("lastLightComplexity");if(o<2)return;const i=e.getProgram();let a=0;const s=r.getLightsByReference();for(let e=0;e<s.length;++e){const n=s[e];if(n.getSwitch()>0){const e=n.getColorByReference(),o=n.getIntensity();t.lightColor[0]=e[0]*o,t.lightColor[1]=e[1]*o,t.lightColor[2]=e[2]*o;const s=n.getDirection(),l=r.getActiveCamera().getViewMatrix(),u=[...s];n.lightTypeIsSceneLight()&&(u[0]=l[0]*s[0]+l[1]*s[1]+l[2]*s[2],u[1]=l[4]*s[0]+l[5]*s[1]+l[6]*s[2],u[2]=l[8]*s[0]+l[9]*s[1]+l[10]*s[2],Lo(u)),t.lightDirection[0]=u[0],t.lightDirection[1]=u[1],t.lightDirection[2]=u[2],Lo(t.lightDirection),i.setUniform3fArray(`lightColor${a}`,t.lightColor),i.setUniform3fArray(`lightDirectionVC${a}`,t.lightDirection),a++}}if(o<3)return;const l=r.getActiveCamera().getViewMatrix();m(l,l),a=0;for(let e=0;e<s.length;++e){const t=s[e];if(t.getSwitch()>0){const e=t.getTransformedPosition(),r=new Float64Array(3);Sr(r,e,l),i.setUniform3fArray(`lightAttenuation${a}`,t.getAttenuationValuesByReference()),i.setUniformi(`lightPositional${a}`,t.getPositional()),i.setUniformf(`lightExponent${a}`,t.getExponent()),i.setUniformf(`lightConeAngle${a}`,t.getConeAngle()),i.setUniform3fArray(`lightPositionVC${a}`,[r[0],r[1],r[2]]),a++}}},e.setCameraShaderParameters=(e,i,a)=>{const s=e.getProgram(),l=t.openGLCamera.getKeyMatrices(i),u=i.getActiveCamera(),c=t.openGLCamera.getKeyMatrixTime().getMTime(),d=s.getLastCameraMTime(),p=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,f=a.getIsIdentity(),m=f?{mcwc:null,normalMatrix:null}:t.openGLActor.getKeyMatrices();if(a.getCoordinateSystem()===Gd.DISPLAY){const e=t._openGLRenderer.getTiledSizeAndOrigin();h(t.tmpMat4),t.tmpMat4[0]=2/e.usize,t.tmpMat4[12]=-1,t.tmpMat4[5]=2/e.vsize,t.tmpMat4[13]=-1,b(t.tmpMat4,t.tmpMat4,p),s.setUniformMatrix("MCPCMatrix",t.tmpMat4)}else s.setUniformMatrix("MCPCMatrix",r([l.wcpc,m.mcwc,p],n,t.tmpMat4));s.isUniformUsed("MCVCMatrix")&&s.setUniformMatrix("MCVCMatrix",r([l.wcvc,m.mcwc,p],n,t.tmpMat4)),s.isUniformUsed("normalMatrix")&&s.setUniformMatrix3x3("normalMatrix",r([l.normalMatrix,m.normalMatrix],o,t.tmpMat3)),d!==c&&(s.isUniformUsed("cameraParallel")&&s.setUniformi("cameraParallel",u.getParallelProjection()),s.setLastCameraMTime(c)),f||s.setLastCameraMTime(0)},e.setPropertyShaderParameters=(e,r,n)=>{const o=e.getProgram();let i=n.getProperty(),a=i.getOpacity(),s=t.drawingEdges?i.getEdgeColorByReference():i.getAmbientColorByReference(),l=t.drawingEdges?i.getEdgeColorByReference():i.getDiffuseColorByReference(),u=t.drawingEdges?1:i.getAmbient(),c=t.drawingEdges?0:i.getDiffuse(),d=t.drawingEdges?0:i.getSpecular();const p=i.getSpecularPower();o.setUniformf("opacityUniform",a),o.setUniform3fArray("ambientColorUniform",s),o.setUniform3fArray("diffuseColorUniform",l),o.setUniformf("ambient",u),o.setUniformf("diffuse",c);const f=t.lastBoundBO.getReferenceByName("lastLightComplexity");if(f<1)return;let h=i.getSpecularColorByReference();if(o.setUniform3fArray("specularColorUniform",h),o.setUniformf("specularPowerUniform",p),o.setUniformf("specular",d),o.isUniformUsed("ambientIntensityBF")){if(i=n.getBackfaceProperty(),a=i.getOpacity(),s=i.getAmbientColor(),u=i.getAmbient(),l=i.getDiffuseColor(),c=i.getDiffuse(),h=i.getSpecularColor(),d=i.getSpecular(),o.setUniformf("ambientIntensityBF",u),o.setUniformf("diffuseIntensityBF",c),o.setUniformf("opacityUniformBF",a),o.setUniform3fArray("ambientColorUniformBF",s),o.setUniform3fArray("diffuseColorUniformBF",l),f<1)return;o.setUniformf("specularIntensityBF",d),o.setUniform3fArray("specularColorUniformBF",h),o.setUniformf("specularPowerUniformBF",p)}},e.updateMaximumPointCellIds=(e,r)=>{const n=t._openGLRenderer.getSelector();if(n){if(t.selectionWebGLIdsToVTKIds?.points?.length){const e=t.selectionWebGLIdsToVTKIds.points.length;n.setMaximumPointId(e-1)}if(t.selectionWebGLIdsToVTKIds?.cells?.length){const e=t.selectionWebGLIdsToVTKIds.cells.length;n.setMaximumCellId(e-1)}n.getFieldAssociation()===Od.FIELD_ASSOCIATION_POINTS&&(t.pointPicking=!0)}},e.renderPieceStart=(r,n)=>{t.primitiveIDOffset=0,t.vertexIDOffset=0;const o=function(e){const t=e.getSelector();return t?t.getCurrentPass():Tl.MIN_KNOWN_PASS-1}(t._openGLRenderer);t.lastSelectionState!==o&&(t.selectionStateChanged.modified(),t.lastSelectionState=o),t._openGLRenderer.getSelector()&&t._openGLRenderer.getSelector().renderProp(n),e.updateBufferObjects(r,n),t.renderable.getColorTextureMap()&&t.internalColorTexture.activate(),t.lastBoundBO=null},e.renderPieceDraw=(r,n)=>{const o=n.getProperty().getRepresentation(),i=n.getProperty().getEdgeVisibility()&&o===Md.SURFACE,a=t._openGLRenderer.getSelector(),s=a&&a.getFieldAssociation()===Od.FIELD_ASSOCIATION_POINTS&&(t.lastSelectionState===Tl.ID_LOW24||t.lastSelectionState===Tl.ID_HIGH24);for(let a=Nd.Start;a<Nd.End;a++)t.primitives[a].setPointPicking(s),t.primitives[a].getCABO().getElementCount()&&(t.drawingEdges=i&&(a===Nd.TrisEdges||a===Nd.TriStripsEdges),t.drawingEdges&&(t.renderDepth||t.lastSelectionState>=0)||(t.lastBoundBO=t.primitives[a],t.primitiveIDOffset+=t.primitives[a].drawArrays(r,n,o,e),t.vertexIDOffset+=t.primitives[a].getCABO().getElementCount()))},e.renderPieceFinish=(e,r)=>{t.LastBoundBO&&t.LastBoundBO.getVAO().release(),t.renderable.getColorTextureMap()&&t.internalColorTexture.deactivate()},e.renderPiece=(r,n)=>{if(e.invokeEvent(Ud),t.renderable.getStatic()||t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent(Vd),!t.currentInput)return void kd("No input!");if(!t.currentInput.getPoints||!t.currentInput.getPoints().getNumberOfValues())return;const o=t.context,i=n.getProperty().getBackfaceCulling(),a=n.getProperty().getFrontfaceCulling();i||a?a?(t._openGLRenderWindow.enableCullFace(),o.cullFace(o.FRONT)):(t._openGLRenderWindow.enableCullFace(),o.cullFace(o.BACK)):t._openGLRenderWindow.disableCullFace(),e.renderPieceStart(r,n),e.renderPieceDraw(r,n),e.renderPieceFinish(r,n)},e.updateBufferObjects=(t,r)=>{e.getNeedToRebuildBufferObjects(t,r)&&e.buildBufferObjects(t,r),e.updateMaximumPointCellIds()},e.getNeedToRebuildBufferObjects=(r,n)=>{const o=t.VBOBuildTime.getMTime();return o<e.getMTime()||o<t.renderable.getMTime()||o<n.getMTime()||o<t.currentInput.getMTime()},e.buildBufferObjects=(e,r)=>{const n=t.currentInput;if(null===n)return;t.renderable.mapScalars(n,1);const o=t.renderable.getColorMapColors();t.haveCellScalars=!1;const i=t.renderable.getScalarMode();t.renderable.getScalarVisibility()&&(i!==Fd.USE_CELL_DATA&&i!==Fd.USE_CELL_FIELD_DATA&&i!==Fd.USE_FIELD_DATA&&n.getPointData().getScalars()||i===Fd.USE_POINT_FIELD_DATA||!o||(t.haveCellScalars=!0));let a=r.getProperty().getInterpolation()!==Rd.FLAT?n.getPointData().getNormals():null;null===a&&n.getCellData().getNormals()&&(t.haveCellNormals=!0,a=n.getCellData().getNormals());const s=r.getProperty().getRepresentation();let l=n.getPointData().getTCoords();t.openGLActor.getActiveTextures()||(l=null);let u=!1;if(t.renderable.getColorCoordinates()){l=t.renderable.getColorCoordinates(),u=t.renderable.getAreScalarsMappedFromCells(),t.internalColorTexture||(t.internalColorTexture=Dd.newInstance({resizable:!0}));const e=t.internalColorTexture;e.setMinificationFilter(Bd.NEAREST),e.setMagnificationFilter(Bd.NEAREST),e.setWrapS(Ld.CLAMP_TO_EDGE),e.setWrapT(Ld.CLAMP_TO_EDGE),e.setOpenGLRenderWindow(t._openGLRenderWindow);const r=t.renderable.getColorTextureMap(),n=r.getExtent(),o=r.getPointData().getScalars();e.create2DFromRaw({width:n[1]-n[0]+1,height:n[3]-n[2]+1,numComps:o.getNumberOfComponents(),dataType:o.getDataType(),data:o.getData()}),e.activate(),e.sendParameters(),e.deactivate()}const c=t.renderable.getCustomShaderAttributes().map(e=>n.getPointData().getArrayByName(e)),d=`${n.getMTime()}A${s}B${n.getMTime()}C${a?a.getMTime():1}D${o?o.getMTime():1}E${r.getProperty().getEdgeVisibility()}F${l?l.getMTime():1}G${c.map(e=>e.getMTime()).join(",")}`;if(t.VBOBuildString!==d){const e={points:n.getPoints(),normals:a,tcoords:l,colors:o,cellOffset:0,vertexOffset:0,useTCoordsPerCell:u,haveCellScalars:t.haveCellScalars,haveCellNormals:t.haveCellNormals,customAttributes:c};t.renderable.getPopulateSelectionSettings()&&(t.selectionWebGLIdsToVTKIds={points:null,cells:null});const i=[{inRep:"verts",cells:n.getVerts()},{inRep:"lines",cells:n.getLines()},{inRep:"polys",cells:n.getPolys()},{inRep:"strips",cells:n.getStrips()},{inRep:"polys",cells:n.getPolys()},{inRep:"strips",cells:n.getStrips()}],p=r.getProperty().getEdgeVisibility()&&s===Md.SURFACE;for(let r=Nd.Start;r<Nd.End;r++)r!==Nd.TrisEdges&&r!==Nd.TriStripsEdges?(e.cellOffset+=t.primitives[r].getCABO().createVBO(i[r].cells,i[r].inRep,s,e,t.selectionWebGLIdsToVTKIds),e.vertexOffset+=t.primitives[r].getCABO().getElementCount()):p?t.primitives[r].getCABO().createVBO(i[r].cells,i[r].inRep,Md.WIREFRAME,{...e,tcoords:null,colors:null,haveCellScalars:!1,haveCellNormals:!1}):t.primitives[r].releaseGraphicsResources();t.renderable.getPopulateSelectionSettings()&&t.renderable.setSelectionWebGLIdsToVTKIds(t.selectionWebGLIdsToVTKIds),t.VBOBuildString=d}t.VBOBuildTime.modified()},e.getAllocatedGPUMemoryInBytes=()=>{let e=0;return t.primitives.forEach(t=>{e+=t.getAllocatedGPUMemoryInBytes()}),e}}(e,t)},"vtkOpenGLPolyDataMapper");Qt("vtkMapper",jd);const Wd={BACKGROUND:0,FOREGROUND:1};var Hd={DisplayLocation:Wd};const{primTypes:Kd}=ud,{Filter:Xd,Wrap:$d}=Dd,{vtkErrorMacro:qd}=jt,Yd={type:"StartEvent"},Jd={type:"EndEvent"},Qd={context:null,VBOBuildTime:0,VBOBuildString:null,primitives:null,primTypes:null,shaderRebuildString:null};const Zd=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qd,r),Xt.extend(e,t,r),Pd(e,t,r),Id(e,t,r),t.primitives=[],t.primTypes=Kd,t.tmpMat4=h(new Float64Array(16));for(let e=Kd.Start;e<Kd.End;e++)t.primitives[e]=ud.newInstance(),t.primitives[e].setPrimitiveType(e),t.primitives[e].set({lastLightComplexity:0,lastLightCount:0,lastSelectionPass:!1},!0);_t(e,t,["context"]),t.VBOBuildTime={},mt(t.VBOBuildTime,{mtime:0}),function(e,t){t.classHierarchy.push("vtkOpenGLPolyDataMapper2D"),e.buildPass=r=>{r&&(t.openGLActor2D=e.getFirstAncestorOfType("vtkOpenGLActor2D"),t._openGLRenderer=t.openGLActor2D.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow"),t.openGLCamera=t._openGLRenderer.getViewNodeFor(t._openGLRenderer.getRenderable().getActiveCamera(),t.openGLCamera))},e.overlayPass=t=>{t&&e.render()},e.getShaderTemplate=(e,t,r)=>{e.Vertex="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DVS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n\n// all variables that represent positions or directions have a suffix\n// indicating the coordinate system they are in. The possible values are\n// MC - Model Coordinates\n// WC - WC world coordinates\n// VC - View Coordinates\n// DC - Display Coordinates\n\nin vec4 vertexWC;\n\n// frag position in VC\n//VTK::PositionVC::Dec\n\n// material property values\n//VTK::Color::Dec\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nuniform mat4 WCVCMatrix; // World to view matrix\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n gl_Position = WCVCMatrix*vertexWC;\n\n //VTK::TCoord::Impl\n\n //VTK::Color::Impl\n\n //VTK::PositionVC::Impl\n}\n",e.Fragment="//VTK::System::Dec\n\n/*=========================================================================\n\n Program: Visualization Toolkit\n Module: vtkPolyData2DFS.glsl\n\n Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen\n All rights reserved.\n See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n\n This software is distributed WITHOUT ANY WARRANTY; without even\n the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n PURPOSE. See the above copyright notice for more information.\n\n=========================================================================*/\n\nuniform int PrimitiveIDOffset;\n\n// Texture coordinates\n//VTK::TCoord::Dec\n\n// Scalar coloring\n//VTK::Color::Dec\n\n// Depth Peeling\n//VTK::DepthPeeling::Dec\n\n// picking support\n//VTK::Picking::Dec\n\n// the output of this shader\n//VTK::Output::Dec\n\n// Apple Bug\n//VTK::PrimID::Dec\n\nvoid main()\n{\n // Apple Bug\n //VTK::PrimID::Impl\n\n //VTK::Color::Impl\n //VTK::TCoord::Impl\n\n //VTK::DepthPeeling::Impl\n //VTK::Picking::Impl\n\n if (gl_FragData[0].a <= 0.0)\n {\n discard;\n }\n}\n",e.Geometry=""},e.render=()=>{const r=t._openGLRenderWindow.getContext();if(t.context!==r){t.context=r;for(let e=Kd.Start;e<Kd.End;e++)t.primitives[e].setOpenGLRenderWindow(t._openGLRenderWindow)}const n=t.openGLActor2D.getRenderable(),o=t._openGLRenderer.getRenderable();e.renderPiece(o,n)},e.renderPiece=(r,n)=>{if(e.invokeEvent(Yd),t.renderable.getStatic()||t.renderable.update(),t.currentInput=t.renderable.getInputData(),e.invokeEvent(Jd),!t.currentInput)return void qd("No input!");if(!t.currentInput.getPoints||!t.currentInput.getPoints().getNumberOfValues())return;const o=t.context;t._openGLRenderWindow.enableCullFace(),o.cullFace(o.BACK),e.renderPieceStart(r,n),e.renderPieceDraw(r,n),e.renderPieceFinish(r,n)},e.renderPieceStart=(r,n)=>{t.primitiveIDOffset=0,t._openGLRenderer.getSelector()&&(t._openGLRenderer.getSelector().getCurrentPass(),t._openGLRenderer.getSelector().renderProp(n)),t.renderable.getColorTextureMap()&&t.internalColorTexture.activate(),e.updateBufferObjects(r,n),t.lastBoundBO=null},e.getNeedToRebuildShaders=(e,r,n)=>e.getShaderSourceTime().getMTime()<t.renderable.getMTime()||e.getShaderSourceTime().getMTime()<t.currentInput.getMTime(),e.updateBufferObjects=(t,r)=>{e.getNeedToRebuildBufferObjects(t,r)&&e.buildBufferObjects(t,r)},e.getNeedToRebuildBufferObjects=(r,n)=>{const o=t.VBOBuildTime.getMTime();return!!(o<e.getMTime()||o<t._openGLRenderWindow.getMTime()||o<t.renderable.getMTime()||o<n.getMTime()||o<t.currentInput.getMTime()||t.renderable.getTransformCoordinate()&&o<r.getMTime())},e.buildBufferObjects=(e,r)=>{const n=t.currentInput;if(null===n)return;t.renderable.mapScalars(n,r.getProperty().getOpacity());const o=t.renderable.getColorMapColors(),i=r.getProperty().getRepresentation();let a=n.getPointData().getTCoords();t.openGLActor2D.getActiveTextures()||(a=null);let s=!1;if(t.renderable.getColorCoordinates()){a=t.renderable.getColorCoordinates(),s=t.renderable.getAreScalarsMappedFromCells(),t.internalColorTexture||(t.internalColorTexture=Dd.newInstance({resizable:!0}));const e=t.internalColorTexture;e.setMinificationFilter(Xd.NEAREST),e.setMagnificationFilter(Xd.NEAREST),e.setWrapS($d.CLAMP_TO_EDGE),e.setWrapT($d.CLAMP_TO_EDGE),e.setOpenGLRenderWindow(t._openGLRenderWindow);const r=t.renderable.getColorTextureMap(),n=r.getExtent(),o=r.getPointData().getScalars();e.create2DFromRaw({width:n[1]-n[0]+1,height:n[3]-n[2]+1,numComps:o.getNumberOfComponents(),dataType:o.getDataType(),data:o.getData()}),e.activate(),e.sendParameters(),e.deactivate()}const l=t.renderable.getTransformCoordinate(),u=e.getRenderWindow().getViews()[0].getViewportSize(e),c=`${n.getMTime()}A${i}B${n.getMTime()}C${o?o.getMTime():1}D${a?a.getMTime():1}E${l?e.getMTime():1}F${u}`;if(t.VBOBuildString!==c){let r=n.getPoints();if(l){const t=Jl.newInstance(),n=r.getNumberOfPoints();t.setNumberOfPoints(n);const o=[];for(let i=0;i<n;++i){r.getPoint(i,o),l.setValue(o);const n=l.getComputedDoubleViewportValue(e);t.setPoint(i,n[0],n[1],0)}r=t}const u={points:r,tcoords:a,colors:o,cellOffset:0,useTCoordsPerCell:s,haveCellScalars:t.renderable.getAreScalarsMappedFromCells(),customAttributes:t.renderable.getCustomShaderAttributes().map(e=>n.getPointData().getArrayByName(e))};u.cellOffset+=t.primitives[Kd.Points].getCABO().createVBO(n.getVerts(),"verts",i,u),u.cellOffset+=t.primitives[Kd.Lines].getCABO().createVBO(n.getLines(),"lines",i,u),u.cellOffset+=t.primitives[Kd.Tris].getCABO().createVBO(n.getPolys(),"polys",i,u),u.cellOffset+=t.primitives[Kd.TriStrips].getCABO().createVBO(n.getStrips(),"strips",i,u),t.VBOBuildTime.modified(),t.VBOBuildString=c}},e.renderPieceDraw=(r,n)=>{const o=n.getProperty().getRepresentation();t.context.depthMask(!0);for(let i=Kd.Start;i<Kd.End;i++)t.primitives[i].getCABO().getElementCount()&&(t.lastBoundBO=t.primitives[i],t.primitiveIDOffset+=t.primitives[i].drawArrays(r,n,o,e))},e.renderPieceFinish=(e,r)=>{t.lastBoundBO&&t.lastBoundBO.getVAO().release(),t.renderable.getColorTextureMap()&&t.internalColorTexture.deactivate()},e.replaceShaderValues=(t,r,n)=>{e.replaceShaderColor(t,r,n),e.replaceShaderTCoord(t,r,n),e.replaceShaderPicking(t,r,n),e.replaceShaderPositionVC(t,r,n)},e.replaceShaderColor=(e,r,n)=>{let o=e.Vertex,i=e.Geometry,a=e.Fragment,s=["uniform vec3 diffuseColorUniform;","uniform float opacityUniform;"],l=["vec3 diffuseColor = diffuseColorUniform;","float opacity = opacityUniform;"];0!==t.lastBoundBO.getCABO().getColorComponents()?(s=s.concat(["varying vec4 vertexColorVSOutput;"]),o=rd.substitute(o,"//VTK::Color::Dec",["attribute vec4 scalarColor;","varying vec4 vertexColorVSOutput;"]).result,o=rd.substitute(o,"//VTK::Color::Impl",["vertexColorVSOutput = scalarColor;"]).result,i=rd.substitute(i,"//VTK::Color::Dec",["in vec4 vertexColorVSOutput[];","out vec4 vertexColorGSOutput;"]).result,i=rd.substitute(i,"//VTK::Color::Impl",["vertexColorGSOutput = vertexColorVSOutput[i];"]).result,a=rd.substitute(a,"//VTK::Color::Impl",l.concat([" diffuseColor = vertexColorVSOutput.rgb;"," opacity = opacity*vertexColorVSOutput.a;"])).result):t.renderable.getAreScalarsMappedFromCells()&&(l=l.concat([" vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);"," diffuseColor = texColor.rgb;"," opacity = opacity*texColor.a;"])),l=l.concat(["gl_FragData[0] = vec4(diffuseColor, opacity);"]),a=rd.substitute(a,"//VTK::Color::Dec",s).result,a=rd.substitute(a,"//VTK::Color::Impl",l).result,e.Vertex=o,e.Geometry=i,e.Fragment=a},e.replaceShaderTCoord=(e,r,n)=>{if(t.lastBoundBO.getCABO().getTCoordOffset()){let r=e.Vertex,n=e.Geometry,o=e.Fragment;const i=t.lastBoundBO.getCABO().getTCoordComponents();1===i?(r=rd.substitute(r,"//VTK::TCoord::Dec",["in float tcoordMC;","out float tcoordVCVSOutput;"]).result,r=rd.substitute(r,"//VTK::TCoord::Impl",["tcoordVCVSOutput = tcoordMC;"]).result,n=rd.substitute(n,"//VTK::TCoord::Dec",["in float tcoordVCVSOutput[];\n","out float tcoordVCGSOutput;"]).result,n=rd.substitute(n,["//VTK::TCoord::Impl","tcoordVCGSOutput = tcoordVCVSOutput[i];"]).result,o=rd.substitute(o,"//VTK::TCoord::Dec",["in float tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,o=rd.substitute(o,"//VTK::TCoord::Impl",["gl_FragData[0] = gl_FragData[0]*texture2D(texture1, vec2(tcoordVCVSOutput,0));"]).result):2===i&&(r=rd.substitute(r,"//VTK::TCoord::Dec",["in vec2 tcoordMC;","out vec2 tcoordVCVSOutput;"]).result,r=rd.substitute(r,"//VTK::TCoord::Impl",["tcoordVCVSOutput = tcoordMC;"]).result,n=rd.substitute(n,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput[];\n","out vec2 tcoordVCGSOutput;"]).result,n=rd.substitute(n,"//VTK::TCoord::Impl",["tcoordVCGSOutput = tcoordVCVSOutput[i];"]).result,o=rd.substitute(o,"//VTK::TCoord::Dec",["in vec2 tcoordVCVSOutput;","uniform sampler2D texture1;"]).result,o=rd.substitute(o,"//VTK::TCoord::Impl",["gl_FragData[0] = gl_FragData[0]*texture2D(texture1, tcoordVCVSOutput.st);"]).result),t.renderable.getAreScalarsMappedFromCells()&&(n=rd.substitute(n,"//VTK::PrimID::Impl",["gl_PrimitiveID = gl_PrimitiveIDIn;"]).result),e.Vertex=r,e.Geometry=n,e.Fragment=o}},e.replaceShaderPicking=(e,t,r)=>{let n=e.Fragment;n=rd.substitute(n,"//VTK::Picking::Dec",["uniform vec3 mapperIndex;","uniform int picking;"]).result,n=rd.substitute(n,"//VTK::Picking::Impl"," gl_FragData[0] = picking != 0 ? vec4(mapperIndex,1.0) : gl_FragData[0];").result,e.Fragment=n},e.replaceShaderPositionVC=(e,r,n)=>{t.lastBoundBO.replaceShaderPositionVC(e,r,n)},e.invokeShaderCallbacks=(e,r,n)=>{const o=t.renderable.getViewSpecificProperties().ShadersCallbacks;o&&o.forEach(t=>{t.callback(t.userData,e,r,n)})},e.setMapperShaderParameters=(e,r,n)=>{if(e.getProgram().isUniformUsed("PrimitiveIDOffset")&&e.getProgram().setUniformi("PrimitiveIDOffset",t.primitiveIDOffset),e.getProgram().isAttributeUsed("vertexWC")&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),"vertexWC",e.getCABO().getVertexOffset(),e.getCABO().getStride(),t.context.FLOAT,3,!1)||qd("Error setting vertexWC in shader VAO.")),e.getCABO().getElementCount()&&(t.VBOBuildTime.getMTime()>e.getAttributeUpdateTime().getMTime()||e.getShaderSourceTime().getMTime()>e.getAttributeUpdateTime().getMTime())){t.renderable.getCustomShaderAttributes().forEach((r,n)=>{e.getProgram().isAttributeUsed(`${r}MC`)&&(e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),`${r}MC`,e.getCABO().getCustomData()[n].offset,e.getCABO().getStride(),t.context.FLOAT,e.getCABO().getCustomData()[n].components,!1)||qd(`Error setting ${r}MC in shader VAO.`))}),e.getProgram().isAttributeUsed("tcoordMC")&&e.getCABO().getTCoordOffset()?e.getVAO().addAttributeArray(e.getProgram(),e.getCABO(),"tcoordMC",e.getCABO().getTCoordOffset(),e.getCABO().getStride(),t.context.FLOAT,e.getCABO().getTCoordComponents(),!1)||qd("Error setting tcoordMC in shader VAO."):e.getVAO().removeAttributeArray("tcoordMC"),e.getProgram().isAttributeUsed("scalarColor")&&e.getCABO().getColorComponents()?e.getVAO().addAttributeArray(e.getProgram(),e.getCABO().getColorBO(),"scalarColor",e.getCABO().getColorOffset(),e.getCABO().getColorBOStride(),t.context.UNSIGNED_BYTE,4,!0)||qd("Error setting scalarColor in shader VAO."):e.getVAO().removeAttributeArray("scalarColor"),t.internalColorTexture&&e.getProgram().isUniformUsed("texture1")&&t.internalColorTexture.getTextureUnit()>-1&&e.getProgram().setUniformi("texture1",t.internalColorTexture.getTextureUnit());const o=t.openGLActor2D.getActiveTextures();if(o)for(let t=0;t<o.length;++t){const r=o[t].getTextureUnit(),n=`texture${r+1}`;e.getProgram().isUniformUsed(n)&&e.getProgram().setUniformi(n,r)}e.setMapperShaderParameters(r,n,t._openGLRenderer.getTiledSizeAndOrigin());const i=t._openGLRenderer.getSelector();e.getProgram().setUniform3fArray("mapperIndex",i?i.getPropColorValue():[0,0,0]),e.getProgram().setUniformi("picking",i?i.getCurrentPass()+1:0)}},e.setPropertyShaderParameters=(e,r,n)=>{const o=t.renderable.getColorMapColors();if(!o||0===o.getNumberOfComponents()){const t=e.getProgram(),r=n.getProperty(),o=r.getOpacity();t.setUniformf("opacityUniform",o);const i=r.getColor();t.setUniform3fArray("diffuseColorUniform",i)}},e.setLightingShaderParameters=(e,t,r)=>{},e.setCameraShaderParameters=(e,r,o)=>{const i=e.getProgram(),a=e.getCABO().getCoordShiftAndScaleEnabled()?e.getCABO().getInverseShiftAndScaleMatrix():null,s=r.getRenderWindow().getViews()[0].getViewportSize(r),l=r.getViewport(),u=o.getActualPositionCoordinate().getComputedDoubleViewportValue(r),c=[0,0,1,1],d=[0,0,1,1];if(d[0]=l[0]>=c[0]?l[0]:c[0],d[1]=l[1]>=c[1]?l[1]:c[1],d[2]=l[2]<=c[2]?l[2]:c[2],d[3]=l[3]<=c[3]?l[3]:c[3],d[0]>=d[2])return;if(d[1]>=d[3])return;s[0]=bo(s[0]*(d[2]-d[0])/(l[2]-l[0])),s[1]=bo(s[1]*(d[3]-d[1])/(l[3]-l[1]));const p=t._openGLRenderer.getParent().getSize(),f=bo(u[0]-(d[0]-l[0])*p[0]),g=bo(u[1]-(d[1]-l[1])*p[1]),y=-f;let v=-f+s[0];const b=-g;let x=-g+s[1];y===v&&(v=y+1),b===x&&(x=b+1);const _=h(new Float64Array(16));var S,C,T;_[0]=2/(v-y),_[5]=2/(x-b),_[3]=-1*(v+y)/(v-y),_[7]=-1*(x+b)/(x-b),_[10]=0,_[11]=o.getProperty().getDisplayLocation()===Wd.FOREGROUND?-1:1,_[15]=1,m(_,_),i.setUniformMatrix("WCVCMatrix",(S=[_,a],C=n,T=t.tmpMat4,C.identity(T),S.reduce((e,t,r)=>0===r?t?C.copy(e,t):C.identity(e):t?C.multiply(e,e,t):e,T)))},e.getAllocatedGPUMemoryInBytes=()=>{let e=0;return t.primitives.forEach(t=>{e+=t.getAllocatedGPUMemoryInBytes()}),e}}(e,t)},"vtkOpenGLPolyDataMapper2D");Qt("vtkMapper2D",Zd);var ep={Orientation:{HORIZONTAL:"horizontal",VERTICAL:"vertical",AUTO:"auto"}};const{VectorMode:tp}=ul,{Orientation:rp}=ep;function np(e,t,r){e.strokeStyle=t.strokeColor,e.lineWidth=t.strokeSize,e.fillStyle=t.fontColor;const n=t.fontSize??r;e.font=`${t.fontStyle} ${n}px ${t.fontFamily}`}function op(e,t){return e=>{const r=e.getLastSize(),n=(r[0]/700)**.8,o=(r[1]/700)**.8,i=Math.min(n,o),a=e.getAxisTextStyle(),s=e.getTickTextStyle();Object.assign(a,t.axisTextStyle),Object.assign(s,t.tickTextStyle),void 0===a.fontSize&&(a.fontSize=Math.max(24*i,12)),void 0===s.fontSize&&(e.getLastAspectRatio()>1?s.fontSize=Math.max(20*i,10):s.fontSize=Math.max(16*i,10));const l=e.updateTextureAtlas();e.setTopTitle(!1);const u=e.getBoxSizeByReference();let c=!1;if(c=t.orientation===rp.VERTICAL||t.orientation!==rp.HORIZONTAL&&e.getLastAspectRatio()>1,c)e.setTickLabelPixelOffset(.3*s.fontSize),l.titleWidth<=l.tickWidth+e.getTickLabelPixelOffset()+.8*s.fontSize?(e.setTopTitle(!0),e.setAxisTitlePixelOffset(.2*s.fontSize),u[0]=2*(l.tickWidth+e.getTickLabelPixelOffset()+.8*s.fontSize)/r[0],e.setBoxPosition([.98-u[0],-.92])):(e.setAxisTitlePixelOffset(.2*s.fontSize),u[0]=2*(l.titleHeight+e.getAxisTitlePixelOffset()+l.tickWidth+e.getTickLabelPixelOffset()+.8*s.fontSize)/r[0],e.setBoxPosition([.99-u[0],-.92])),u[1]=Math.max(1.2,Math.min(1.84/o,1.84));else{e.setAxisTitlePixelOffset(1.2*s.fontSize),e.setTickLabelPixelOffset(.1*s.fontSize);const t=2*(.8*s.fontSize+l.titleHeight+e.getAxisTitlePixelOffset())/r[1],n=2*l.tickWidth/r[0];u[0]=Math.min(1.9,Math.max(1.4,1.4*n*(e.getTicks().length+3))),u[1]=t,e.setBoxPosition([-.5*u[0],-.97])}e.recomputeBarSegments(l)}}function ip(e,t){return e=>{const t=e.getLastTickBounds(),r=no().domain([t[0],t[1]]),n=r.ticks(5),o=r.tickFormat(5);e.setTicks(n),e.setTickStrings(n.map(o))}}const ap=zt.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{renderable:null};Object.assign(t,{},r),zt.obj(e,t),zt.setGet(e,t,["axisTitlePixelOffset","tickLabelPixelOffset","renderable","topTitle","ticks","tickStrings","tickPositions"]),zt.get(e,t,["lastSize","lastAspectRatio","lastTickBounds","axisTextStyle","tickTextStyle","barActor","tmActor"]),zt.getArray(e,t,["boxPosition","boxSize"]),zt.setArray(e,t,["boxPosition","boxSize"],2),t.forceUpdate=!1,t.lastRebuildTime={},zt.obj(t.lastRebuildTime,{mtime:0}),t.lastSize=[-1,-1],t.tmCanvas=document.createElement("canvas"),t.tmContext=t.tmCanvas.getContext("2d"),t._tmAtlas=new Map,t.barMapper=Gl.newInstance(),t.barMapper.setInterpolateScalarsBeforeMapping(!0),t.barMapper.setUseLookupTableScalarRange(!0),t.polyData=mc.newInstance(),t.barMapper.setInputData(t.polyData),t.barActor=ss.newInstance(),t.barActor.setMapper(t.barMapper),t.tmPolyData=mc.newInstance(),t.tmMapper=Gl.newInstance(),t.tmMapper.setInputData(t.tmPolyData),t.tmTexture=vc.newInstance({resizable:!0}),t.tmTexture.setInterpolate(!1),t.tmActor=ss.newInstance({parentProp:e}),t.tmActor.setMapper(t.tmMapper),t.tmActor.addTexture(t.tmTexture),t.barPosition=[0,0],t.barSize=[0,0],t.boxPosition=[.88,-.92],t.boxSize=[.1,1.1],t.lastTickBounds=[],function(e,t){t.classHierarchy.push("vtkScalarBarActorHelper"),e.setRenderable=r=>{t.renderable!==r&&(t.renderable=r,t.barActor.setProperty(r.getProperty()),t.barActor.setParentProp(r),t.barActor.setCoordinateSystemToDisplay(),t.tmActor.setProperty(r.getProperty()),t.tmActor.setParentProp(r),t.tmActor.setCoordinateSystemToDisplay(),t.generateTicks=r.generateTicks,t.axisTextStyle={...r.getAxisTextStyle()},t.tickTextStyle={...r.getTickTextStyle()},e.modified())},e.updateAPISpecificData=(r,n,o)=>{t.lastSize[0]===r[0]&&t.lastSize[1]===r[1]||(t.lastSize[0]=r[0],t.lastSize[1]=r[1],t.lastAspectRatio=r[0]/r[1],t.forceUpdate=!0);const i=t.renderable.getScalarsToColors();if(i&&t.renderable.getVisibility()&&(t.barMapper.setLookupTable(i),t.camera=n,t.renderWindow=o,t.forceUpdate||Math.max(i.getMTime(),e.getMTime(),t.renderable.getMTime())>t.lastRebuildTime.getMTime())){const r=i.getMappingRange();if(t.lastTickBounds=[...r],t.renderable.getGenerateTicks()(e),t.renderable.getAutomated())t.renderable.getAutoLayout()(e);else{t.axisTextStyle={...t.renderable.getAxisTextStyle()},t.tickTextStyle={...t.renderable.getTickTextStyle()},t.barPosition=[...t.renderable.getBarPosition()],t.barSize=[...t.renderable.getBarSize()],t.boxPosition=[...t.renderable.getBoxPosition()],t.boxSize=[...t.renderable.getBoxSize()],t.axisTitlePixelOffset=t.renderable.getAxisTitlePixelOffset(),t.tickLabelPixelOffset=t.renderable.getTickLabelPixelOffset();const r=e.updateTextureAtlas();e.recomputeBarSegments(r)}e.updatePolyDataForLabels(),e.updatePolyDataForBarSegments(),t.lastRebuildTime.modified(),t.forceUpdate=!1}},e.updateTextureAtlas=()=>{t.tmContext.textBaseline="bottom",t.tmContext.textAlign="left";const r={},n=new Map;let o=0,i=1;np(t.tmContext,t.axisTextStyle,18);let a=t.tmContext.measureText(t.renderable.getAxisLabel()),s={height:a.actualBoundingBoxAscent+2,startingHeight:i,width:a.width+2,textStyle:t.axisTextStyle};n.set(t.renderable.getAxisLabel(),s),i+=s.height,o=s.width,r.titleWidth=s.width,r.titleHeight=s.height,r.tickWidth=0,r.tickHeight=0,np(t.tmContext,t.tickTextStyle,14);const l=[...e.getTickStrings(),"NaN","Below","Above"];for(let e=0;e<l.length;e++)n.has(l[e])||(a=t.tmContext.measureText(l[e]),s={height:a.actualBoundingBoxAscent+2,startingHeight:i,width:a.width+2,textStyle:t.tickTextStyle},n.set(l[e],s),i+=s.height,o<s.width&&(o=s.width),r.tickWidth<s.width&&(r.tickWidth=s.width),r.tickHeight<s.height&&(r.tickHeight=s.height));return o=Ao(o),i=Ao(i),n.forEach(e=>{e.tcoords=[0,(i-e.startingHeight-e.height)/i,e.width/o,(i-e.startingHeight-e.height)/i,e.width/o,(i-e.startingHeight)/i,0,(i-e.startingHeight)/i]}),t.tmCanvas.width=o,t.tmCanvas.height=i,t.tmContext.textBaseline="bottom",t.tmContext.textAlign="left",t.tmContext.clearRect(0,0,o,i),n.forEach((e,r)=>{const n=e.textStyle===t.axisTextStyle?18:14;np(t.tmContext,e.textStyle,n),t.tmContext.fillText(r,1,e.startingHeight+e.height-1)}),t.tmTexture.setCanvas(t.tmCanvas),t.tmTexture.modified(),t._tmAtlas=n,r},e.computeBarSize=e=>{t.vertical=t.boxSize[1]>t.boxSize[0];const r=2*e.tickHeight/t.lastSize[1],n=[1,1];if(t.vertical){const o=2*(e.tickWidth+t.tickLabelPixelOffset)/t.lastSize[0];if(t.topTitle){const r=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0]-o,t.barSize[1]=t.boxSize[1]-r}else{const r=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[0];t.barSize[0]=t.boxSize[0]-r-o,t.barSize[1]=t.boxSize[1]}t.barPosition[0]=t.boxPosition[0]+o,t.barPosition[1]=t.boxPosition[1],n[1]=r}else{const r=(2*e.tickWidth-8)/t.lastSize[0],o=2*(e.titleHeight+t.axisTitlePixelOffset)/t.lastSize[1];t.barSize[0]=t.boxSize[0],t.barPosition[0]=t.boxPosition[0],t.barSize[1]=t.boxSize[1]-o,t.barPosition[1]=t.boxPosition[1],n[0]=r}return n},e.recomputeBarSegments=r=>{const n=e.computeBarSize(r);t.barSegments=[];const o=[0,0],i=t.vertical?1:0,a=t.vertical?.01:.02;function s(e,r){t.barSegments.push({corners:[[...o],[o[0]+n[0],o[1]],[o[0]+n[0],o[1]+n[1]],[o[0],o[1]+n[1]]],scalars:r,title:e}),o[i]+=n[i]+a}t.renderable.getDrawNanAnnotation()&&t.renderable.getScalarsToColors().getNanColor()&&s("NaN",[NaN,NaN,NaN,NaN]),t.renderable.getDrawBelowRangeSwatch()&&t.renderable.getScalarsToColors().getUseBelowRangeColor?.()&&s("Below",[-.1,-.1,-.1,-.1]);const l=t.renderable.getScalarsToColors().getUseAboveRangeColor?.();o[i]+=a;const u=n[i];n[i]=l?1-2*a-n[i]-o[i]:1-a-o[i],s("ticks",t.vertical?[0,0,.995,.995]:[0,.995,.995,0]),t.renderable.getDrawAboveRangeSwatch()&&l&&(n[i]=u,o[i]+=a,s("Above",[1.1,1.1,1.1,1.1]))};const r=new Float64Array(3);e.createPolyDataForOneLabel=(e,n,o,i,a,s)=>{const l=t._tmAtlas.get(e);if(!l)return;let u=s.ptIdx,c=s.cellIdx;r[0]=(.5*n[0]+.5)*t.lastSize[0],r[1]=(.5*n[1]+.5)*t.lastSize[1],r[2]=n[2],r[0]+=a[0],r[1]+=a[1];const d=[],p="vertical"===i?[1,0]:[0,1];"vertical"===i?(d[0]=l.width,d[1]=-l.height,"middle"===o[0]?r[1]-=l.width/2:"right"===o[0]&&(r[1]-=l.width),"middle"===o[1]?r[0]+=l.height/2:"top"===o[1]&&(r[0]+=l.height)):(d[0]=l.width,d[1]=l.height,"middle"===o[0]?r[0]-=l.width/2:"right"===o[0]&&(r[0]-=l.width),"middle"===o[1]?r[1]-=l.height/2:"top"===o[1]&&(r[1]-=l.height)),s.points[3*u]=r[0],s.points[3*u+1]=r[1],s.points[3*u+2]=r[2],s.tcoords[2*u]=l.tcoords[0],s.tcoords[2*u+1]=l.tcoords[1],u++,r[p[0]]+=d[0],s.points[3*u]=r[0],s.points[3*u+1]=r[1],s.points[3*u+2]=r[2],s.tcoords[2*u]=l.tcoords[2],s.tcoords[2*u+1]=l.tcoords[3],u++,r[p[1]]+=d[1],s.points[3*u]=r[0],s.points[3*u+1]=r[1],s.points[3*u+2]=r[2],s.tcoords[2*u]=l.tcoords[4],s.tcoords[2*u+1]=l.tcoords[5],u++,r[p[0]]-=d[0],s.points[3*u]=r[0],s.points[3*u+1]=r[1],s.points[3*u+2]=r[2],s.tcoords[2*u]=l.tcoords[6],s.tcoords[2*u+1]=l.tcoords[7],u++,s.polys[4*c]=3,s.polys[4*c+1]=u-4,s.polys[4*c+2]=u-3,s.polys[4*c+3]=u-2,c++,s.polys[4*c]=3,s.polys[4*c+1]=u-4,s.polys[4*c+2]=u-2,s.polys[4*c+3]=u-1,s.ptIdx+=4,s.cellIdx+=2};const n=new Float64Array(3);e.updatePolyDataForLabels=()=>{const r=e.getTickStrings().length+t.barSegments.length,o=4*r,i=2*r,a=new Float64Array(3*o),s=new Uint16Array(4*i),l=new Float32Array(2*o),u={ptIdx:0,cellIdx:0,polys:s,points:a,tcoords:l},c=t.vertical?0:1,d=t.vertical?1:0;n[2]=-.99;const p=t.vertical?["right","middle"]:["middle","bottom"];let f=[0,1];const h=[0,0];t.vertical?(h[0]=-t.tickLabelPixelOffset,t.topTitle?(n[0]=t.boxPosition[0]+.5*t.boxSize[0],n[1]=t.barPosition[1]+t.barSize[1],e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),n,["middle","bottom"],"horizontal",[0,t.axisTitlePixelOffset],u)):(n[0]=t.barPosition[0]+t.barSize[0],n[1]=t.barPosition[1]+.5*t.barSize[1],e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),n,["middle","top"],"vertical",[t.axisTitlePixelOffset,0],u)),f=[-1,0]):(h[1]=t.tickLabelPixelOffset,n[0]=t.barPosition[0]+.5*t.barSize[0],n[1]=t.barPosition[1]+t.barSize[1],e.createPolyDataForOneLabel(t.renderable.getAxisLabel(),n,["middle","bottom"],"horizontal",[0,t.axisTitlePixelOffset],u)),n[c]=t.barPosition[c]+(.5*f[c]+.5)*t.barSize[c],n[d]=t.barPosition[d]+.5*t.barSize[d];let m=null;for(let r=0;r<t.barSegments.length;r++){const o=t.barSegments[r];"ticks"===o.title?m=o:(n[d]=t.barPosition[d]+.5*t.barSize[d]*(o.corners[2][d]+o.corners[0][d]),e.createPolyDataForOneLabel(o.title,n,p,"horizontal",h,u))}const g=t.barPosition[d]+t.barSize[d]*m.corners[0][d],y=t.barSize[d]*(m.corners[2][d]-m.corners[0][d]),v=e.getTicks(),b=e.getTickStrings(),x=e.getTickPositions();for(let r=0;r<v.length;r++){const o=x?x[r]:(v[r]-t.lastTickBounds[0])/(t.lastTickBounds[1]-t.lastTickBounds[0]);n[d]=g+y*o,e.createPolyDataForOneLabel(b[r],n,p,"horizontal",h,u)}const _=_s.newInstance({numberOfComponents:2,values:l,name:"TextureCoordinates"});t.tmPolyData.getPointData().setTCoords(_),t.tmPolyData.getPoints().setData(a,3),t.tmPolyData.getPoints().modified(),t.tmPolyData.getPolys().setData(s,1),t.tmPolyData.getPolys().modified(),t.tmPolyData.modified()},e.updatePolyDataForBarSegments=()=>{const e=t.renderable.getScalarsToColors();let r=0;t.renderable.getDrawNanAnnotation()&&e.getNanColor()&&(r+=1),t.renderable.getDrawBelowRangeSwatch()&&e.getUseBelowRangeColor?.()&&(r+=1),t.renderable.getDrawAboveRangeSwatch()&&e.getUseAboveRangeColor?.()&&(r+=1);const o=4*(1+r),i=o;let a=1;e.getVectorMode()===tp.COMPONENT&&(a=e.getVectorComponent()+1);const s=new Float64Array(3*o),l=new Uint16Array(5*i),u=new Float32Array(o*a);let c=0,d=0;for(let e=0;e<t.barSegments.length;e++){const r=t.barSegments[e];for(let e=0;e<4;e++){n[0]=t.barPosition[0]+r.corners[e][0]*t.barSize[0],n[1]=t.barPosition[1]+r.corners[e][1]*t.barSize[1],s[3*c]=(.5*n[0]+.5)*t.lastSize[0],s[3*c+1]=(.5*n[1]+.5)*t.lastSize[1],s[3*c+2]=n[2];for(let n=0;n<a;n++)u[c*a+n]=t.lastTickBounds[0]+r.scalars[e]*(t.lastTickBounds[1]-t.lastTickBounds[0]);c++}l[5*d]=4,l[5*d+1]=c-4,l[5*d+2]=c-3,l[5*d+3]=c-2,l[5*d+4]=c-1,d++}const p=_s.newInstance({numberOfComponents:a,values:u,name:"Scalars"});t.polyData.getPointData().setScalars(p),t.polyData.getPoints().setData(s,3),t.polyData.getPoints().modified(),t.polyData.getPolys().setData(l,1),t.polyData.getPolys().modified(),t.polyData.modified()}}(e,t)},"vtkScalarBarActorHelper");function sp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,function(e){return{automated:!0,autoLayout:null,axisLabel:"Scalar Value",barPosition:[0,0],barSize:[0,0],boxPosition:[.88,-.92],boxSize:[.1,1.1],scalarToColors:null,axisTitlePixelOffset:36,axisTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:void 0,fontFamily:"serif"},tickLabelPixelOffset:14,tickTextStyle:{fontColor:"white",fontStyle:"normal",fontSize:void 0,fontFamily:"serif"},generateTicks:null,drawNanAnnotation:!0,drawBelowRangeSwatch:!0,drawAboveRangeSwatch:!0,orientation:null,...e}}(r)),t.autoLayout||(t.autoLayout=op(0,t)),t.generateTicks||(t.generateTicks=ip()),ss.extend(e,t,r),e.getProperty().setDiffuse(0),e.getProperty().setAmbient(1),zt.setGet(e,t,["automated","autoLayout","axisTitlePixelOffset","axisLabel","scalarsToColors","tickLabelPixelOffset","generateTicks","drawNanAnnotation","drawBelowRangeSwatch","drawAboveRangeSwatch","orientation"]),zt.get(e,t,["axisTextStyle","tickTextStyle"]),zt.getArray(e,t,["barPosition","barSize","boxPosition","boxSize"]),zt.setArray(e,t,["barPosition","barSize","boxPosition","boxSize"],2),function(e,t){t.classHierarchy.push("vtkScalarBarActor"),e.setTickTextStyle=r=>{t.tickTextStyle={...t.tickTextStyle,...r},e.modified()},e.setAxisTextStyle=r=>{t.axisTextStyle={...t.axisTextStyle,...r},e.modified()},e.setOrientationToHorizontal=()=>e.setOrientation(rp.HORIZONTAL),e.setOrientationToVertical=()=>e.setOrientation(rp.VERTICAL),e.resetAutoLayoutToDefault=()=>{e.setAutoLayout(op(0,t))},e.resetGenerateTicksToDefault=()=>{e.setGenerateTicks(ip())}}(e,t)}var lp={newInstance:zt.newInstance(sp,"vtkScalarBarActor"),extend:sp,newScalarBarActorHelper:ap,...ep};const up={};const cp=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,up,r),Xt.extend(e,t,r),t.scalarBarActorHelper=lp.newScalarBarActorHelper(),function(e,t){t.classHierarchy.push("vtkOpenGLScalarBarActor"),e.buildPass=r=>{r&&(t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getParent(),t.scalarBarActorHelper.getRenderable()||t.scalarBarActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.scalarBarActorHelper.getBarActor()),e.addMissingNode(t.scalarBarActorHelper.getTmActor()),e.removeUnusedNodes())},e.opaquePass=(e,r)=>{if(e){const e=t._openGLRenderer?t._openGLRenderer.getRenderable().getActiveCamera():null,r=t._openGLRenderer.getTiledSizeAndOrigin();t.scalarBarActorHelper.updateAPISpecificData([r.usize,r.vsize],e,t._openGLRenderWindow.getRenderable())}}}(e,t)},"vtkOpenGLScalarBarActor");Qt("vtkScalarBarActor",cp);const{vtkErrorMacro:dp}=jt,pp={context:null};const fp=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,pp,r),Xt.extend(e,t,r),t.openGLTexture=Dd.newInstance(),t.tris=ud.newInstance(),t.keyMatrixTime={},mt(t.keyMatrixTime,{mtime:0}),t.keyMatrices={normalMatrix:pe(new Float64Array(9)),mcwc:h(new Float64Array(16))},_t(e,t,["context"]),yt(e,t,["activeTextures"]),function(e,t){t.classHierarchy.push("vtkOpenGLSkybox"),e.buildPass=r=>{if(r){t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getParent(),t.context=t._openGLRenderWindow.getContext(),t.tris.setOpenGLRenderWindow(t._openGLRenderWindow),t.openGLTexture.setOpenGLRenderWindow(t._openGLRenderWindow);const r=t._openGLRenderer.getRenderable();t.openGLCamera=t._openGLRenderer.getViewNodeFor(r.getActiveCamera(),t.openGLCamera)}},e.queryPass=(e,r)=>{if(e){if(!t.renderable||!t.renderable.getVisibility())return;r.incrementOpaqueActorCount()}},e.opaquePass=(r,n)=>{if(r&&!t._openGLRenderer.getSelector()){e.updateBufferObjects(),t.context.depthMask(!0),t._openGLRenderWindow.getShaderCache().readyShaderProgram(t.tris.getProgram()),t.openGLTexture.render(t._openGLRenderWindow);const r=t.openGLTexture.getTextureUnit();t.tris.getProgram().setUniformi("sbtexture",r);const n=t._openGLRenderer.getRenderable(),o=t.openGLCamera.getKeyMatrices(n),i=new Float64Array(16);if(g(i,o.wcpc),t.tris.getProgram().setUniformMatrix("IMCPCMatrix",i),"box"===t.lastFormat){const e=n.getActiveCamera().getPosition();t.tris.getProgram().setUniform3f("camPos",e[0],e[1],e[2])}t.tris.getVAO().bind(),t.context.drawArrays(t.context.TRIANGLES,0,t.tris.getCABO().getElementCount()),t.tris.getVAO().release(),t.openGLTexture.deactivate()}},e.updateBufferObjects=()=>{if(!t.tris.getCABO().getElementCount()){const e=new Float32Array(12);for(let t=0;t<4;t++)e[3*t]=t%2*2-1,e[3*t+1]=t>1?1:-1,e[3*t+2]=1;const r=_s.newInstance({numberOfComponents:3,values:e});r.setName("points");const n=new Uint16Array(8);n[0]=3,n[1]=0,n[2]=1,n[3]=3,n[4]=3,n[5]=0,n[6]=3,n[7]=2;const o=_s.newInstance({numberOfComponents:1,values:n});t.tris.getCABO().createVBO(o,"polys",Ja.SURFACE,{points:r,cellOffset:0})}t.renderable.getFormat()!==t.lastFormat&&(t.lastFormat=t.renderable.getFormat(),"box"===t.lastFormat&&t.tris.setProgram(t._openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec3 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = wpos.xyz/wpos.w;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec3 TexCoords;\n uniform samplerCube sbtexture;\n uniform vec3 camPos;\n void main () {\n // skybox looks from inside out\n // which means we have to adjust\n // our tcoords. Otherwise text would\n // be flipped\n vec3 tc = normalize(TexCoords - camPos);\n if (abs(tc.z) < max(abs(tc.x),abs(tc.y)))\n {\n tc = vec3(1.0, 1.0, -1.0) * tc;\n }\n else\n {\n tc = vec3(-1.0, 1.0, 1.0) * tc;\n }\n gl_FragData[0] = textureCube(sbtexture, tc);\n }","")),"background"===t.lastFormat&&t.tris.setProgram(t._openGLRenderWindow.getShaderCache().readyShaderProgramArray("//VTK::System::Dec\n attribute vec3 vertexMC;\n uniform mat4 IMCPCMatrix;\n varying vec2 TexCoords;\n void main () {\n gl_Position = vec4(vertexMC.xyz, 1.0);\n vec4 wpos = IMCPCMatrix * gl_Position;\n TexCoords = vec2(vertexMC.x, vertexMC.y)*0.5 + 0.5;\n }","//VTK::System::Dec\n //VTK::Output::Dec\n varying vec2 TexCoords;\n uniform sampler2D sbtexture;\n void main () {\n gl_FragData[0] = texture2D(sbtexture, TexCoords);\n }","")),t.tris.getShaderSourceTime().modified(),t.tris.getVAO().bind(),t.tris.getVAO().addAttributeArray(t.tris.getProgram(),t.tris.getCABO(),"vertexMC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),t.context.FLOAT,3,t.context.FALSE)||dp("Error setting vertexMC in shader VAO."));const e=t.renderable.getTextures();e.length||dp("vtkSkybox requires a texture map"),t.openGLTexture.getRenderable()!==e[0]&&(t.openGLTexture.releaseGraphicsResources(t._openGLRenderWindow),t.openGLTexture.setRenderable(e[0]))}}(e,t)});Qt("vtkSkybox",fp);const{vtkDebugMacro:hp}=jt,mp={};const gp=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,mp,r),Xt.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkOpenGLPixelSpaceCallbackMapper"),e.opaquePass=(r,n)=>{t._openGLRenderer=e.getFirstAncestorOfType("vtkOpenGLRenderer"),t._openGLRenderWindow=t._openGLRenderer.getLastAncestorOfType("vtkOpenGLRenderWindow");const o=t._openGLRenderer.getAspectRatio(),i=t._openGLRenderer?t._openGLRenderer.getRenderable().getActiveCamera():null,a=t._openGLRenderer.getTiledSizeAndOrigin();let s=null;if(t.renderable.getUseZValues()){const e=n.getZBufferTexture(),r=Math.floor(e.getWidth()),o=Math.floor(e.getHeight()),i=t._openGLRenderWindow.getContext();e.bind();const a=n.getFramebuffer();a?a.saveCurrentBindingsAndBuffers():hp("No framebuffer to save/restore");const l=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,l),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e.getHandle(),0),i.checkFramebufferStatus(i.FRAMEBUFFER)===i.FRAMEBUFFER_COMPLETE&&(s=new Uint8Array(r*o*4),i.viewport(0,0,r,o),i.readPixels(0,0,r,o,i.RGBA,i.UNSIGNED_BYTE,s)),a&&a.restorePreviousBindingsAndBuffers(),i.deleteFramebuffer(l)}t.renderable.invokeCallback(t.renderable.getInputData(),i,o,a,s)},e.queryPass=(e,r)=>{e&&t.renderable.getUseZValues()&&r.requestDepth()}}(e,t)},"vtkOpenGLPixelSpaceCallbackMapper");Qt("vtkPixelSpaceCallbackMapper",gp);const yp=Object.create(null);function vp(e,t){yp[e]=t}const bp={};function xp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,bp,r),t.overrides=yp,Yt.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkWebGPUViewNodeFactory")}(0,t)}var _p={newInstance:zt.newInstance(xp,"vtkWebGPUViewNodeFactory"),extend:xp};const Sp={keyMatrixTime:null,keyMatrices:null};const Cp=zt.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sp,r),Xt.extend(e,t,r),t.keyMatrixTime={},zt.obj(t.keyMatrixTime),t.keyMatrices={normalMatrix:new Float64Array(16),vcpc:new Float64Array(16),pcsc:new Float64Array(16),wcvc:new Float64Array(16),scpc:new Float64Array(16),scvc:new Float64Array(16)},zt.setGet(e,t,["keyMatrixTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUCamera"),e.getProjectionMatrix=(e,r,n,o)=>{if(h(e),t.renderable.getParallelProjection()){const i=t.renderable.getParallelScale(),a=i*r,s=i,l=(o[0]-1)*a,u=(o[0]+1)*a,c=(o[1]-1)*s,d=(o[1]+1)*s,p=1/(u-l),f=1/(d-c);e[0]=2*p,e[5]=2*f,e[10]=1/(n[1]-n[0]),e[12]=(u+l)*p,e[13]=(d+c)*f,e[14]=n[1]/(n[1]-n[0])}else{const i=Math.tan(Math.PI*t.renderable.getViewAngle()/360);let a,s;!0===t.renderable.getUseHorizontalViewAngle()?(a=n[0]*i,s=n[0]*i/r):(a=n[0]*i*r,s=n[0]*i);const l=(o[0]-1)*a,u=(o[0]+1)*a,c=(o[1]-1)*s,d=(o[1]+1)*s;e[0]=2*n[0]/(u-l),e[5]=2*n[0]/(d-c),e[12]=(l+u)/(u-l),e[13]=(c+d)/(d-c),e[10]=0,e[14]=n[0],e[11]=-1,e[15]=0}},e.convertToOpenGLDepth=e=>{if(t.renderable.getParallelProjection())return 1-e;const r=t.renderable.getClippingRangeByReference();let n=-r[0]/e;return n=(r[0]+r[1])/(r[1]-r[0])+2*r[0]*r[1]/(n*(r[1]-r[0])),.5*n+.5},e.getKeyMatrices=r=>{const n=r.getRenderable(),o=r.getParent();if(Math.max(o.getMTime(),e.getMTime(),n.getMTime(),t.renderable.getMTime(),r.getStabilizedTime())>t.keyMatrixTime.getMTime()){const n=t.renderable.getViewMatrix();d(t.keyMatrices.normalMatrix,n),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,g(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),m(t.keyMatrices.wcvc,n);const o=r.getStabilizedCenterByReference();x(t.keyMatrices.scvc,t.keyMatrices.wcvc,o);const i=r.getAspectRatio(),a=t.renderable.getClippingRangeByReference();e.getProjectionMatrix(t.keyMatrices.vcpc,i,a,t.renderable.getWindowCenterByReference()),b(t.keyMatrices.scpc,t.keyMatrices.vcpc,t.keyMatrices.scvc),g(t.keyMatrices.pcsc,t.keyMatrices.scpc),t.keyMatrixTime.modified()}return t.keyMatrices}}(e,t)});vp("vtkCamera",Cp);const Tp={device:null,handle:null,label:null};function wp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Tp,r),zt.obj(e,t),t.bindables=[],t.bindGroupTime={},zt.obj(t.bindGroupTime,{mtime:0}),zt.get(e,t,["bindGroupTime","handle","sizeInBytes","usage"]),zt.setGet(e,t,["label","device","arrayInformation"]),function(e,t){t.classHierarchy.push("vtkWebGPUBindGroup"),e.setBindables=r=>{if(t.bindables.length===r.length){let e=!0;for(let n=0;n<t.bindables.length;n++)t.bindables[n]!==r[n]&&(e=!1);if(e)return}t.bindables=r,e.modified()},e.getBindGroupLayout=e=>{const r=[];for(let e=0;e<t.bindables.length;e++){const n=t.bindables[e].getBindGroupLayoutEntry();n.binding=e,r.push(n)}return e.getBindGroupLayout({entries:r})},e.getBindGroup=r=>{let n=e.getMTime();for(let e=0;e<t.bindables.length;e++){const r=t.bindables[e].getBindGroupTime().getMTime();n=r>n?r:n}if(n<t.bindGroupTime.getMTime())return t.bindGroup;const o=[];for(let e=0;e<t.bindables.length;e++){const r=t.bindables[e].getBindGroupEntry();r.binding=e,o.push(r)}return t.bindGroup=r.getHandle().createBindGroup({layout:e.getBindGroupLayout(r),entries:o,label:t.label}),t.bindGroupTime.modified(),t.bindGroup},e.getShaderCode=e=>{const r=[],n=e.getBindGroupLayoutCount(t.label);for(let e=0;e<t.bindables.length;e++)r.push(t.bindables[e].getShaderCode(e,n));return r.join("\n")}}(e,t)}var Ap={newInstance:zt.newInstance(wp),extend:wp};const Ep={device:null,handle:null};function Dp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ep,r),zt.obj(e,t),zt.get(e,t,["lastCameraMTime"]),zt.setGet(e,t,["device","handle"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderModule"),e.initialize=(e,r)=>{t.device=e,t.handle=t.device.getHandle().createShaderModule({code:r.getCode()})}}(e,t)}var Pp={newInstance:zt.newInstance(Dp,"vtkWebGPUShaderModule"),extend:Dp};const Ip={shaderModules:null,device:null,window:null};function Op(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ip,r),t._shaderModules=new Map,zt.obj(e,t),zt.setGet(e,t,["device","window"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderCache"),e.getShaderModule=e=>{const r=e.getType(),n=e.getHash(),o=t._shaderModules.keys();for(let e=0;e<o.length;e++){const i=o[e];if(i.getHash()===n&&i.getType()===r)return t._shaderModules.get(i)}const i=Pp.newInstance();return i.initialize(t.device,e),t._shaderModules.set(e,i),i}}(e,t)}var Np={newInstance:zt.newInstance(Op,"vtkWebGPUShaderCache"),extend:Op,substitute:function(e,t,r){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const o=Array.isArray(r)?r.join("\n"):r;let i=!1;-1!==e.search(t)&&(i=!0);let a="";n&&(a="g");const s=new RegExp(t,a);return{replace:i,result:e.replace(s,o)}}};const Mp={handle:null,layouts:null,renderEncoder:null,shaderDescriptions:null,vertexState:null,topology:null,pipelineDescription:null};function Rp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mp,r),mt(e,t),t.layouts=[],t.shaderDescriptions=[],yt(e,t,["handle","pipelineDescription"]),_t(e,t,["device","renderEncoder","topology","vertexState"]),function(e,t){t.classHierarchy.push("vtkWebGPUPipeline"),e.getShaderDescriptions=()=>t.shaderDescriptions,e.initialize=(e,r)=>{t.pipelineDescription=t.renderEncoder.getPipelineSettings(),t.pipelineDescription.primitive.topology=t.topology,t.pipelineDescription.vertex=t.vertexState,t.pipelineDescription.label=r;const n=[];for(let e=0;e<t.layouts.length;e++)n.push(t.layouts[e].layout);t.pipelineLayout=e.getHandle().createPipelineLayout({bindGroupLayouts:n}),t.pipelineDescription.layout=t.pipelineLayout;for(let r=0;r<t.shaderDescriptions.length;r++){const n=t.shaderDescriptions[r],o=e.getShaderModule(n);"vertex"===n.getType()&&(t.pipelineDescription.vertex.module=o.getHandle(),t.pipelineDescription.vertex.entryPoint="main"),"fragment"===n.getType()&&(t.pipelineDescription.fragment.module=o.getHandle(),t.pipelineDescription.fragment.entryPoint="main")}t.handle=e.getHandle().createRenderPipeline(t.pipelineDescription)},e.getShaderDescription=e=>{for(let r=0;r<t.shaderDescriptions.length;r++)if(t.shaderDescriptions[r].getType()===e)return t.shaderDescriptions[r];return null},e.addBindGroupLayout=e=>{e&&t.layouts.push({layout:e.getBindGroupLayout(t.device),label:e.getLabel()})},e.getBindGroupLayout=e=>t.layouts[e].layout,e.getBindGroupLayoutCount=e=>{for(let r=0;r<t.layouts.length;r++)if(t.layouts[r].label===e)return r;return 0},e.bindVertexInput=(e,t)=>{t.bindBuffers(e)}}(e,t)}var Fp={newInstance:Pt(Rp,"vtkWebGPUPipeline"),extend:Rp};const Bp={type:null,hash:null,code:null,outputNames:null,outputTypes:null};function Lp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Bp,r),t.outputNames=[],t.outputTypes=[],t.outputInterpolations=[],t.builtinOutputNames=[],t.builtinOutputTypes=[],t.builtinInputNames=[],t.builtinInputTypes=[],zt.obj(e,t),zt.setGet(e,t,["type","hash","code"]),zt.getArray(e,t,["outputTypes","outputNames","outputInterpolations"]),function(e,t){t.classHierarchy.push("vtkWebGPUShaderDescription"),e.hasOutput=e=>t.outputNames.includes(e),e.addOutput=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t.outputTypes.push(e),t.outputNames.push(r),t.outputInterpolations.push(n)},e.addBuiltinOutput=(e,r)=>{t.builtinOutputTypes.push(e),t.builtinOutputNames.push(r)},e.addBuiltinInput=(e,r)=>{t.builtinInputTypes.push(e),t.builtinInputNames.push(r)},e.replaceShaderCode=(e,r)=>{const n=[];let o=[];if(r&&n.push(r.getShaderCode()),e||t.builtinInputNames.length){const r=[];if(r.push(`struct ${t.type}Input\n{`),e){const t=e.getOutputNamesByReference(),n=e.getOutputTypesByReference(),o=e.getOutputInterpolationsByReference();for(let e=0;e<t.length;e++)void 0!==o[e]?r.push(` @location(${e}) @interpolate(${o[e]}) ${t[e]} : ${n[e]},`):r.push(` @location(${e}) ${t[e]} : ${n[e]},`)}for(let e=0;e<t.builtinInputNames.length;e++)r.push(` ${t.builtinInputNames[e]} : ${t.builtinInputTypes[e]},`);r.length>1&&(r.push("};"),o=r,n[n.length-1]+=",",n.push(`input: ${t.type}Input`))}if(n.length&&(t.code=Np.substitute(t.code,"//VTK::IOStructs::Input",n).result),t.outputNames.length+t.builtinOutputNames.length){const e=[`struct ${t.type}Output\n{`];for(let r=0;r<t.outputNames.length;r++)void 0!==t.outputInterpolations[r]?e.push(` @location(${r}) @interpolate(${t.outputInterpolations[r]}) ${t.outputNames[r]} : ${t.outputTypes[r]},`):e.push(` @location(${r}) ${t.outputNames[r]} : ${t.outputTypes[r]},`);for(let r=0;r<t.builtinOutputNames.length;r++)e.push(` ${t.builtinOutputNames[r]} : ${t.builtinOutputTypes[r]},`);e.push("};"),o=o.concat(e),t.code=Np.substitute(t.code,"//VTK::IOStructs::Output",[`-> ${t.type}Output`]).result}t.code=Np.substitute(t.code,"//VTK::IOStructs::Dec",o).result}}(e,t)}var kp={newInstance:zt.newInstance(Lp,"vtkWebGPUShaderDescription"),extend:Lp};const Up={r8unorm:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"float"},r8snorm:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"float"},r8uint:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},r8sint:{numComponents:1,nativeType:Int8Array,stride:1,elementSize:1,sampleType:"sint"},r16uint:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"uint"},r16sint:{numComponents:1,nativeType:Int16Array,stride:2,elementSize:2,sampleType:"sint"},r16float:{numComponents:1,nativeType:Float32Array,stride:2,elementSize:2,sampleType:"float"},rg8unorm:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"float"},rg8snorm:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"float"},rg8uint:{numComponents:2,nativeType:Uint8Array,stride:2,elementSize:1,sampleType:"uint"},rg8sint:{numComponents:2,nativeType:Int8Array,stride:2,elementSize:1,sampleType:"sint"},r32uint:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:4,sampleType:"uint"},r32sint:{numComponents:1,nativeType:Int32Array,stride:4,elementSize:4,sampleType:"sint"},r32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"unfilterable-float"},rg16uint:{numComponents:2,nativeType:Uint16Array,stride:4,elementSize:2,sampleType:"uint"},rg16sint:{numComponents:2,nativeType:Int16Array,stride:4,elementSize:2,sampleType:"sint"},rg16float:{numComponents:2,nativeType:Float32Array,stride:4,elementSize:2,sampleType:"float"},rgba8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"rgba8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgba8snorm:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"float"},rgba8uint:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"uint"},rgba8sint:{numComponents:4,nativeType:Int8Array,stride:4,elementSize:1,sampleType:"sint"},bgra8unorm:{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},"bgra8unorm-srgb":{numComponents:4,nativeType:Uint8Array,stride:4,elementSize:1,sampleType:"float"},rgb9e5ufloat:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rgb10a2unorm:{numComponents:4,nativeType:Uint32Array,stride:4,sampleType:"float"},rg11b10ufloat:{numComponents:4,nativeType:Float32Array,stride:4,sampleType:"float"},rg32uint:{numComponents:2,nativeType:Uint32Array,stride:8,elementSize:4,sampleType:"uint"},rg32sint:{numComponents:2,nativeType:Int32Array,stride:8,elementSize:4,sampleType:"sint"},rg32float:{numComponents:2,nativeType:Float32Array,stride:8,elementSize:4,sampleType:"unfilterable-float"},rgba16uint:{numComponents:4,nativeType:Uint16Array,stride:8,elementSize:2,sampleType:"uint"},rgba16sint:{numComponents:4,nativeType:Int16Array,stride:8,elementSize:2,sampleType:"sint"},rgba16float:{numComponents:4,nativeType:Float32Array,stride:8,elementSize:2,sampleType:"float"},rgba32uint:{numComponents:4,nativeType:Uint32Array,stride:16,elementSize:4,sampleType:"uint"},rgba32sint:{numComponents:4,nativeType:Int32Array,stride:16,elementSize:4,sampleType:"sint"},rgba32float:{numComponents:4,nativeType:Float32Array,stride:16,elementSize:4,sampleType:"unfilterable-float"},stencil8:{numComponents:1,nativeType:Uint8Array,stride:1,elementSize:1,sampleType:"uint"},depth16unorm:{numComponents:1,nativeType:Uint16Array,stride:2,elementSize:2,sampleType:"depth"},depth24plus:{numComponents:1,nativeType:Uint32Array,stride:4,elementSize:3,sampleType:"depth"},"depth24plus-stencil8":{numComponents:2,nativeType:Uint32Array,stride:4,sampleType:"mixed"},depth32float:{numComponents:1,nativeType:Float32Array,stride:4,elementSize:4,sampleType:"depth"}};var Vp=function(e){return!e||e.length<6?0:e in Up==1?Up[e]:(Ze(`unknown format ${e}`),null)},Gp=function(e){if(!e||e.length<5)return 0;let t=1;"x"===e[e.length-2]&&(t=Number(e[e.length-1]));const r=1===t?e.length-1:e.length-3,n=Number(e[r]);return Number.isNaN(n)?(Ze(`unknown format ${e}`),0):t*(5-n/2)},zp=function(e){if(!e||e.length<5)return 0;let t=1;return"x"===e[e.length-2]&&(t=Number(e[e.length-1])),t},jp=function(e){if(!e||e.length<5)return 0;let t;if("f"===e[0])t="Float";else if("s"===e[0])t="Int";else{if("u"!==e[0])return void Ze(`unknown format ${e}`);t="Uint"}const r=e.split("x")[0],n=Number(r[r.length-1]);if(!Number.isNaN(n))return t+=8*(5-n/2),t+="Array",t;Ze(`unknown format ${e}`)},Wp=function(e){let t;if("f"===e[0]||"n"===e[1])t="f32";else if("s"===e[0]&&"i"===e[1])t="i32";else{if("u"!==e[0]||"i"!==e[1])return void Ze(`unknown format ${e}`);t="u32"}let r=1;return"x"===e[e.length-2]&&(r=Number(e[e.length-1])),4===r?`vec4<${t}>`:3===r?`vec3<${t}>`:2===r?`vec2<${t}>`:t},Hp=function(e){if(!e)return 0;let t=1;return"vec"===e.substring(0,3)?t=Number(e[3]):"mat"===e.substring(0,3)&&(t=e[3]*e[5]),4*t},Kp=function(e){if(e)return e.includes("f32")?"Float32Array":e.includes("i32")?"Int32Array":e.includes("u32")?"Uint32Array":void Ze(`unknown format ${e}`)};function Xp(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!t.includes(e[r]))return!1;return!0}const $p={inputs:null,bindingDescriptions:!1,attributeDescriptions:null,indexBuffer:null};function qp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$p,r),mt(e,t),t.bindingDescriptions=[],t.attributeDescriptions=[],t.inputs=[],_t(e,t,["created","device","handle","indexBuffer"]),function(e,t){t.classHierarchy.push("vtkWebGPUVertexInput"),e.addBuffer=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"vertex",o=r;Array.isArray(o)||(o=[o]);for(let r=0;r<t.inputs.length;r++)if(Xp(t.inputs[r].names,o)){if(t.inputs[r].buffer===e)return;return void(t.inputs[r].buffer=e)}t.inputs.push({buffer:e,stepMode:n,names:o}),t.inputs=t.inputs.sort((e,t)=>e.names[0]<t.names[0]?-1:e.names[0]>t.names[0]?1:0)},e.removeBufferIfPresent=e=>{for(let r=0;r<t.inputs.length;r++)t.inputs[r].names.includes(e)&&t.inputs.splice(r,1)},e.getBuffer=e=>{for(let r=0;r<t.inputs.length;r++)if(t.inputs[r].names.includes(e))return t.inputs[r].buffer;return null},e.hasAttribute=e=>{for(let r=0;r<t.inputs.length;r++)if(t.inputs[r].names.includes(e))return!0;return!1},e.getAttributeTime=e=>{for(let r=0;r<t.inputs.length;r++)if(t.inputs[r].names.includes(e))return t.inputs[r].buffer.getSourceTime();return 0},e.getShaderCode=()=>{let e="",r=0;for(let n=0;n<t.inputs.length;n++)for(let o=0;o<t.inputs[n].names.length;o++){const i=t.inputs[n].buffer.getArrayInformation()[o],a=Wp(i.format);r>0&&(e+=",\n"),e=`${e} @location(${r}) ${t.inputs[n].names[o]} : ${a}`,r++}return e},e.getVertexInputInformation=()=>{const e={};if(t.inputs.length){const r=[];let n=0;for(let e=0;e<t.inputs.length;e++){const o=t.inputs[e].buffer,i={arrayStride:o.getStrideInBytes(),stepMode:t.inputs[e].stepMode,attributes:[]},a=o.getArrayInformation();for(let r=0;r<t.inputs[e].names.length;r++)i.attributes.push({shaderLocation:n,offset:a[r].offset,format:a[r].format}),n++;r.push(i)}e.buffers=r}return e},e.bindBuffers=e=>{for(let r=0;r<t.inputs.length;r++)e.setVertexBuffer(r,t.inputs[r].buffer.getHandle());t.indexBuffer&&e.setIndexBuffer(t.indexBuffer.getHandle(),t.indexBuffer.getArrayInformation()[0].format)},e.getReady=()=>{},e.releaseGraphicsResources=()=>{t.created&&(t.inputs=[],t.bindingDescriptions=[],t.attributeDescriptions=[])}}(e,t)}var Yp={newInstance:Pt(qp,"vtkWebGPUVertexInput"),extend:qp};const Jp={additionalBindables:void 0,bindGroup:null,device:null,fragmentShaderTemplate:null,numberOfInstances:1,numberOfVertices:0,pipelineHash:null,shaderReplacements:null,SSBO:null,textureViews:null,topology:"triangle-list",UBO:null,vertexShaderTemplate:null,WebGPURenderer:null};function Qp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jp,r),Xt.extend(e,t,r),t.textureViews=[],t.vertexInput=Yp.newInstance(),t.bindGroup=Ap.newInstance({label:"mapperBG"}),t.additionalBindables=[],t.fragmentShaderTemplate=t.fragmentShaderTemplate||"\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::Light::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n // var computedColor:vec4<f32> = vec4<f32>(1.0,0.5,0.5,1.0);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n",t.vertexShaderTemplate=t.vertexShaderTemplate||"\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@vertex\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n // var vertex: vec4<f32> = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",t.shaderReplacements=new Map,zt.get(e,t,["pipeline","vertexInput"]),zt.setGet(e,t,["additionalBindables","device","fragmentShaderTemplate","interpolate","numberOfInstances","numberOfVertices","pipelineHash","shaderReplacements","SSBO","textureViews","topology","UBO","vertexShaderTemplate","WebGPURenderer"]),function(e,t){t.classHierarchy.push("vtkWebGPUSimpleMapper"),e.generateShaderDescriptions=(r,n,o)=>{const i=kp.newInstance({type:"vertex",hash:r,code:t.vertexShaderTemplate}),a=kp.newInstance({type:"fragment",hash:r,code:t.fragmentShaderTemplate}),s=n.getShaderDescriptions();s.push(i),s.push(a);const l=t.vertexShaderTemplate+t.fragmentShaderTemplate,u=new RegExp("//VTK::[^:]*::","g"),c=l.match(u).filter((e,t,r)=>r.indexOf(e)===t),d=c.map(e=>`replaceShader${e.substring(7,e.length-2)}`);for(let e=0;e<d.length;e++){const i=d[e];"replaceShaderIOStructs"!==i&&t.shaderReplacements.has(i)&&t.shaderReplacements.get(i)(r,n,o)}e.replaceShaderIOStructs(r,n,o)},e.replaceShaderIOStructs=(e,t,r)=>{const n=t.getShaderDescription("vertex");n.replaceShaderCode(null,r),t.getShaderDescription("fragment").replaceShaderCode(n)},e.replaceShaderRenderEncoder=(e,r,n)=>{t.renderEncoder.replaceShaderCode(r)},t.shaderReplacements.set("replaceShaderRenderEncoder",e.replaceShaderRenderEncoder),e.replaceShaderRenderer=(e,r,n)=>{if(!t.WebGPURenderer)return;const o=t.WebGPURenderer.getBindGroup().getShaderCode(r),i=r.getShaderDescription("vertex");let a=i.getCode();a=Np.substitute(a,"//VTK::Renderer::Dec",[o]).result,i.setCode(a);const s=r.getShaderDescription("fragment");a=s.getCode(),a=Np.substitute(a,"//VTK::Renderer::Dec",[o]).result,s.setCode(a)},t.shaderReplacements.set("replaceShaderRenderer",e.replaceShaderRenderer),e.replaceShaderMapper=(e,r,n)=>{const o=t.bindGroup.getShaderCode(r),i=r.getShaderDescription("vertex");let a=i.getCode();a=Np.substitute(a,"//VTK::Mapper::Dec",[o]).result,i.setCode(a);const s=r.getShaderDescription("fragment");s.addBuiltinInput("bool","@builtin(front_facing) frontFacing"),a=s.getCode(),a=Np.substitute(a,"//VTK::Mapper::Dec",[o]).result,s.setCode(a)},t.shaderReplacements.set("replaceShaderMapper",e.replaceShaderMapper),e.replaceShaderPosition=(e,t,r)=>{const n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4<f32>","@builtin(position) Position");let o=n.getCode();o=Np.substitute(o,"//VTK::Position::Impl",[" output.Position = rendererUBO.SCPCMatrix*vertexBC;"]).result,n.setCode(o)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderTCoord=(e,t,r)=>{t.getShaderDescription("vertex").addOutput("vec2<f32>","tcoordVS")},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.addTextureView=e=>{t.textureViews.includes(e)||t.textureViews.push(e)},e.prepareToDraw=r=>{t.renderEncoder=r,e.updateInput(),e.updateBuffers(),e.updateBindings(),e.updatePipeline()},e.updateInput=()=>{},e.updateBuffers=()=>{},e.updateBindings=()=>{t.bindGroup.setBindables(e.getBindables())},e.computePipelineHash=()=>{},e.registerDrawCallback=r=>{r.registerDrawCallback(t.pipeline,e.draw)},e.prepareAndDraw=r=>{e.prepareToDraw(r),r.setPipeline(t.pipeline),e.draw(r)},e.draw=e=>{const r=e.getBoundPipeline();e.activateBindGroup(t.bindGroup),t.WebGPURenderer&&t.WebGPURenderer.bindUBO(e),r.bindVertexInput(e,t.vertexInput);const n=t.vertexInput.getIndexBuffer();n?e.drawIndexed(n.getIndexCount(),t.numberOfInstances,0,0,0):e.draw(t.numberOfVertices,t.numberOfInstances,0,0)},e.getBindables=()=>{const e=[...t.additionalBindables];t.UBO&&e.push(t.UBO),t.SSBO&&e.push(t.SSBO);for(let r=0;r<t.textureViews.length;r++){e.push(t.textureViews[r]);const n=t.textureViews[r].getSampler();n&&e.push(n)}return e},e.updatePipeline=()=>{e.computePipelineHash(),t.pipeline=t.device.getPipeline(t.pipelineHash),t.pipeline||(t.pipeline=Fp.newInstance(),t.pipeline.setDevice(t.device),t.WebGPURenderer&&t.pipeline.addBindGroupLayout(t.WebGPURenderer.getBindGroup()),t.pipeline.addBindGroupLayout(t.bindGroup),e.generateShaderDescriptions(t.pipelineHash,t.pipeline,t.vertexInput),t.pipeline.setTopology(t.topology),t.pipeline.setRenderEncoder(t.renderEncoder),t.pipeline.setVertexState(t.vertexInput.getVertexInputInformation()),t.device.createPipeline(t.pipelineHash,t.pipeline))}}(e,t)}var Zp={newInstance:zt.newInstance(Qp,"vtkWebGPUSimpleMapper"),extend:Qp};const ef={};function tf(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,ef,r),Zp.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkWebGPUFullScreenQuad"),e.replaceShaderPosition=(e,t,r)=>{const n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4<f32>","@builtin(position) Position"),n.addOutput("vec4<f32>","vertexVC");let o=n.getCode();o=Np.substitute(o,"//VTK::Position::Impl",["output.tcoordVS = vec2<f32>(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4<f32>(vertexBC, 1.0);","output.vertexVC = vec4<f32>(vertexBC, 1);"]).result,n.setCode(o)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.updateBuffers=()=>{const e=t.device.getBufferManager().getFullScreenQuadBuffer();t.vertexInput.addBuffer(e,["vertexBC"]),t.numberOfVertices=6}}(e,t)}var rf={newInstance:zt.newInstance(tf,"vtkWebGPUFullScreenQuad"),extend:tf},nf={BufferUsage:{Verts:0,Lines:1,Triangles:2,Strips:3,LinesFromStrips:4,LinesFromTriangles:5,Points:6,UniformArray:7,PointArray:8,NormalsFromPoints:9,Texture:10,RawVertex:11,Storage:12,Index:13},PrimitiveTypes:{Start:0,Points:0,Lines:1,Triangles:2,TriangleStrips:3,TriangleEdges:4,TriangleStripEdges:5,End:6}};const of=["getMappedRange","mapAsync","unmap"];const af={device:null,handle:null,sizeInBytes:0,strideInBytes:0,arrayInformation:null,usage:null,label:null,sourceTime:null};function sf(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,af,r),zt.obj(e,t),zt.get(e,t,["handle","sizeInBytes","usage"]),zt.setGet(e,t,["strideInBytes","device","arrayInformation","label","sourceTime"]),function(e,t){t.classHierarchy.push("vtkWebGPUBuffer"),e.create=(e,r)=>{t.handle=t.device.getHandle().createBuffer({size:e,usage:r,label:t.label}),t.sizeInBytes=e,t.usage=r},e.write=e=>{!function(e,t,r,n){const o=n.byteLength,i=e.createBuffer({size:o,usage:GPUBufferUsage.COPY_SRC,mappedAtCreation:!0}),a=i.getMappedRange(0,o);new Uint8Array(a).set(new Uint8Array(n)),i.unmap();const s=e.createCommandEncoder();s.copyBufferToBuffer(i,0,t,0,o);const l=s.finish();e.queue.submit([l]),i.destroy()}(t.device.getHandle(),t.handle,0,e.buffer)},e.createAndWrite=(e,r)=>{const n=4*Math.ceil(e.byteLength/4);t.handle=t.device.getHandle().createBuffer({size:n,usage:r,mappedAtCreation:!0,label:t.label}),t.sizeInBytes=n,t.usage=r,new Uint8Array(t.handle.getMappedRange()).set(new Uint8Array(e.buffer)),t.handle.unmap()};for(let r=0;r<of.length;r++)e[of[r]]=function(){return t.handle[of[r]](...arguments)}}(e,t)}var lf={newInstance:zt.newInstance(sf),extend:sf,...nf};const{Representation:uf}=os,{PrimitiveTypes:cf}=nf;class df{constructor(){this.keys=new Uint32Array(10),this.values=new Uint32Array(10),this.count=0}clear(){this.count=0}has(e){for(let t=0;t<this.count;t++)if(this.keys[t]===e)return!0}get(e){for(let t=0;t<this.count;t++)if(this.keys[t]===e)return this.values[t]}set(e,t){this.count<9&&(this.keys[this.count]=e,this.values[this.count++]=t)}}function pf(e,t,r){let n=e.pointIdToFlatId[t];return n<0&&(n=e.flatId,e.pointIdToFlatId[t]=n,e.flatIdToPointId[e.flatId]=t,e.flatIdToCellId[e.flatId]=r,e.flatId++),n}function ff(e,t,r){const n=e.length;for(let o=0;o<n;o++){let i=e[o];if(r.cellProvokedMap.has(i)){r.ibo[r.iboId++]=r.cellProvokedMap.get(i);for(let a=o+1;a<o+n;a++){i=e[a%n];const o=pf(r,i,t);r.ibo[r.iboId++]=o}return}}for(let o=0;o<n;o++){let i=e[o];if(!r.provokedPointIds[i]){let a=pf(r,i,t);r.provokedPointIds[i]=1,r.cellProvokedMap.set(i,a),r.flatIdToCellId[a]=t,r.ibo[r.iboId++]=a;for(let s=o+1;s<o+n;s++)i=e[s%n],a=pf(r,i,t),r.ibo[r.iboId++]=a;return}}let o=e[0],i=r.flatId;r.cellProvokedMap.set(o,i),r.flatIdToPointId[r.flatId]=o,r.flatIdToCellId[r.flatId]=t,r.flatId++,r.ibo[r.iboId++]=i;for(let a=1;a<n;a++)o=e[a],i=pf(r,o,t),r.ibo[r.iboId++]=i}function hf(e,t,r){const n=e.length;r.iboSize+=n;for(let t=0;t<n;t++){const n=e[t];if(r.cellProvokedMap.has(n))return}for(let t=0;t<n;t++){const n=e[t];if(!r.provokedPointIds[n])return r.provokedPointIds[n]=1,void r.cellProvokedMap.set(n,1)}r.cellProvokedMap.set(e[0],1),r.extraPoints++}let mf;const gf=new Uint32Array(1),yf=new Uint32Array(2),vf=new Uint32Array(3),bf={anythingToPoints(e,t,r,n,o){for(let i=0;i<e;++i)gf[0]=t[r+i],mf(gf,n,o)},linesToWireframe(e,t,r,n,o){for(let i=0;i<e-1;++i)yf[0]=t[r+i],yf[1]=t[r+i+1],mf(yf,n,o)},polysToWireframe(e,t,r,n,o){if(e>2)for(let i=0;i<e;++i)yf[0]=t[r+i],yf[1]=t[r+(i+1)%e],mf(yf,n,o)},stripsToWireframe(e,t,r,n,o){if(e>2){for(let i=0;i<e-1;++i)yf[0]=t[r+i],yf[1]=t[r+i+1],mf(yf,n,o);for(let i=0;i<e-2;i++)yf[0]=t[r+i],yf[1]=t[r+i+2],mf(yf,n,o)}},polysToSurface(e,t,r,n,o){for(let i=0;i<e-2;i++)vf[0]=t[r],vf[1]=t[r+i+1],vf[2]=t[r+i+2],mf(vf,n,o)},stripsToSurface(e,t,r,n,o){for(let i=0;i<e-2;i++)vf[0]=t[r+i],vf[1]=t[r+i+1+i%2],vf[2]=t[r+i+1+(i+1)%2],mf(vf,n,o)}};const xf={flatIdToPointId:null,flatIdToCellId:null,flatSize:0,indexCount:0};function _f(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,xf,r),lf.extend(e,t,r),zt.setGet(e,t,["flatIdToPointId","flatIdToCellId","flatSize","indexCount"]),function(e,t){t.classHierarchy.push("vtkWebGPUIndexBuffer"),e.buildIndexBuffer=e=>{const r=e.cells,n=e.primitiveType,o=e.representation,i=e.cellOffset,a=r.getData(),s=a.length,l=function(e){switch(e){case cf.Points:return"points";case cf.Lines:return"lines";case cf.Triangles:case cf.TriangleEdges:return"polys";case cf.TriangleStripEdges:case cf.TriangleStrips:return"strips";default:return""}}(n),u=e.numberOfPoints,c={provokedPointIds:new Uint8Array(u),extraPoints:0,iboSize:0,flatId:0,iboId:0,cellProvokedMap:new df};let d=null;d=o===uf.POINTS||n===cf.Points?bf.anythingToPoints:o===uf.WIREFRAME||n===cf.Lines?bf[`${l}ToWireframe`]:bf[`${l}ToSurface`],mf=hf;let p=i||0;for(let e=0;e<s;)c.cellProvokedMap.clear(),d(a[e],a,e+1,p,c),e+=a[e]+1,p++;c.flatIdToPointId=u<=65535?new Uint16Array(u+c.extraPoints):new Uint32Array(u+c.extraPoints),u+c.extraPoints<36863?c.pointIdToFlatId=new Int16Array(u):c.pointIdToFlatId=new Int32Array(u),u+c.extraPoints<=65535?(c.ibo=new Uint16Array(c.iboSize),e.format="uint16"):(c.ibo=new Uint32Array(c.iboSize),e.format="uint32"),c.flatIdToCellId=p<=65535?new Uint16Array(u+c.extraPoints):new Uint32Array(u+c.extraPoints),c.pointIdToFlatId.fill(-1),c.provokedPointIds.fill(0),mf=ff,p=i||0;for(let e=0;e<s;)c.cellProvokedMap.clear(),d(a[e],a,e+1,p,c),e+=a[e]+1,p++;delete c.provokedPointIds,delete c.pointIdToFlatId,e.nativeArray=c.ibo,t.flatIdToPointId=c.flatIdToPointId,t.flatIdToCellId=c.flatIdToCellId,t.flatSize=c.flatId,t.indexCount=c.iboId}}(e,t)}var Sf={newInstance:zt.newInstance(_f),extend:_f,...nf};const{BufferUsage:Cf}=nf,{vtkErrorMacro:Tf}=jt,{VtkDataTypes:wf}=_s;function Af(e,t,r,n,o){const i={},a=e.getFlatSize();if(!a)return i;let s=[0,0,0,0];o.shift&&(o.shift.length?s=o.shift:s.fill(o.shift));let l=[1,1,1,1];o.scale&&(o.scale.length?l=o.scale:l.fill(o.scale));const u=!!Object.prototype.hasOwnProperty.call(o,"packExtra")&&o.packExtra;let c,d=0;const p=ot(n,a*(r+(u?1:0)));let f=e.getFlatIdToPointId();o.cellData&&(f=e.getFlatIdToCellId()),1===r?c=function(e){p[d++]=l[0]*t[e]+s[0]}:2===r?c=function(e){p[d++]=l[0]*t[e]+s[0],p[d++]=l[1]*t[e+1]+s[1]}:3!==r||u?3===r&&u?c=function(e){p[d++]=l[0]*t[e]+s[0],p[d++]=l[1]*t[e+1]+s[1],p[d++]=l[2]*t[e+2]+s[2],p[d++]=1*l[3]+s[3]}:4===r&&(c=function(e){p[d++]=l[0]*t[e]+s[0],p[d++]=l[1]*t[e+1]+s[1],p[d++]=l[2]*t[e+2]+s[2],p[d++]=l[3]*t[e+3]+s[3]}):c=function(e){p[d++]=l[0]*t[e]+s[0],p[d++]=l[1]*t[e+1]+s[1],p[d++]=l[2]*t[e+2]+s[2]};for(let e=0;e<a;e++)c(r*f[e]);return i.nativeArray=p,i}function Ef(e,t,r,n){const o=[];return Fo([e[3*n]-e[3*r],e[3*n+1]-e[3*r+1],e[3*n+2]-e[3*r+2]],[e[3*t]-e[3*r],e[3*t+1]-e[3*r+1],e[3*t+2]-e[3*r+2]],o),Lo(o),o}const Df={device:null,fullScreenQuadBuffer:null};function Pf(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Df,r),mt(e,t),_t(e,t,["device"]),function(e,t){function r(e){let r,n;if(e.dataArray&&!e.nativeArray&&(e.nativeArray=e.dataArray.getData()),e.usage===Cf.Index&&(r=Sf.newInstance({label:e.label}),r.setDevice(t.device),n=GPUBufferUsage.INDEX|GPUBufferUsage.COPY_DST,r.buildIndexBuffer(e),r.createAndWrite(e.nativeArray,n),r.setArrayInformation([{format:e.format}])),r||(r=lf.newInstance({label:e.label}),r.setDevice(t.device)),e.usage===Cf.UniformArray&&(n=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,r.createAndWrite(e.nativeArray,n)),e.usage===Cf.Storage&&(n=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST,r.createAndWrite(e.nativeArray,n)),e.usage===Cf.Texture&&(n=GPUBufferUsage.COPY_SRC,r.createAndWrite(e.nativeArray,n)),e.usage===Cf.PointArray){n=GPUBufferUsage.VERTEX;const t=jp(e.format),o=Af(e.indexBuffer,e.dataArray.getData(),e.dataArray.getNumberOfComponents(),t,{packExtra:e.packExtra,shift:e.shift,scale:e.scale,cellData:e.cellData,cellOffset:e.cellOffset});r.createAndWrite(o.nativeArray,n),r.setStrideInBytes(Gp(e.format)),r.setArrayInformation([{offset:0,format:e.format,interpolation:e.cellData?"flat":"perspective"}])}if(e.usage===Cf.NormalsFromPoints){n=GPUBufferUsage.VERTEX;const t=jp(e.format),o=function(e,t){const r=t.getData(),n=e.getData();if(!n||!r)return null;const o=new Int8Array(4*e.getNumberOfCells()),i=n.length;let a=0;for(let e=0;e<i;){const t=Ef(r,n[e+1],n[e+2],n[e+3]);o[a++]=127*t[0],o[a++]=127*t[1],o[a++]=127*t[2],o[a++]=127,e+=n[e]+1}return o}(e.cells,e.dataArray),i=Af(e.indexBuffer,o,4,t,{cellData:!0});r.createAndWrite(i.nativeArray,n),r.setStrideInBytes(Gp(e.format)),r.setArrayInformation([{offset:0,format:e.format,interpolation:"flat"}])}return e.usage===Cf.RawVertex&&(n=GPUBufferUsage.VERTEX,r.createAndWrite(e.nativeArray,n),r.setStrideInBytes(Gp(e.format)),r.setArrayInformation([{offset:0,format:e.format}])),r.setSourceTime(e.time),r}t.classHierarchy.push("vtkWebGPUBufferManager"),e.hasBuffer=e=>t.device.hasCachedObject(e),e.getBuffer=e=>e.hash?t.device.getCachedObject(e.hash,r,e):r(e),e.getBufferForPointArray=(t,r)=>{const n=function(e){let t;switch(e.getDataType()){case wf.UNSIGNED_CHAR:t="uint8";break;case wf.FLOAT:t="float32";break;case wf.UNSIGNED_INT:t="uint32";break;case wf.INT:t="sint32";break;case wf.DOUBLE:t="float32";break;case wf.UNSIGNED_SHORT:t="uint16";break;case wf.SHORT:t="sin16";break;default:t="float32"}switch(e.getNumberOfComponents()){case 2:t+="x2";break;case 3:t.includes("32")||Tf(`unsupported x3 type for ${t}`),t+="x3";break;case 4:t+="x4"}return t}(t),o={hash:`${t.getMTime()}I${r.getMTime()}${n}`,usage:Cf.PointArray,format:n,dataArray:t,indexBuffer:r};return e.getBuffer(o)},e.getFullScreenQuadBuffer=()=>{if(t.fullScreenQuadBuffer)return t.fullScreenQuadBuffer;t.fullScreenQuadBuffer=lf.newInstance(),t.fullScreenQuadBuffer.setDevice(t.device);const e=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,1,0]);return t.fullScreenQuadBuffer.createAndWrite(e,GPUBufferUsage.VERTEX),t.fullScreenQuadBuffer.setStrideInBytes(12),t.fullScreenQuadBuffer.setArrayInformation([{offset:0,format:"float32x3"}]),t.fullScreenQuadBuffer}}(e,t)}var If={newInstance:Pt(Pf),extend:Pf,...nf};const{BufferUsage:Of}=If,{vtkErrorMacro:Nf}=zt,Mf={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,numberOfInstances:1};function Rf(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mf,r),zt.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t._sendTime={},zt.obj(t._sendTime,{mtime:0}),t.bindGroupTime={},zt.obj(t.bindGroupTime,{mtime:0}),t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"read-only-storage"}},zt.get(e,t,["bindGroupTime"]),zt.setGet(e,t,["device","bindGroupLayoutEntry","label","numberOfInstances","sizeInBytes"]),function(e,t){t.classHierarchy.push("vtkWebGPUStorageBuffer"),e.addEntry=(e,r)=>{if(t._bufferEntryNames.has(e))return void Nf(`entry named ${e} already exists`);t._bufferEntryNames.set(e,t.bufferEntries.length);const n=Hp(r);t.bufferEntries.push({name:e,type:r,sizeInBytes:n,offset:t.sizeInBytes,nativeType:Kp(r)}),t.sizeInBytes+=n},e.send=e=>{if(!t._buffer){const r={nativeArray:t.Float32Array,usage:Of.Storage,label:t.label};return t._buffer=e.getBufferManager().getBuffer(r),t.bindGroupTime.modified(),void t._sendTime.modified()}e.getHandle().queue.writeBuffer(t._buffer.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes*t.numberOfInstances),t._sendTime.modified()},e.createView=e=>{e in t==0&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes*t.numberOfInstances)),t[e]=zt.newTypedArray(e,t.arrayBuffer))},e.setValue=(r,n,o)=>{const i=t._bufferEntryNames.get(r);if(void 0===i)return void Nf(`entry named ${r} not found in UBO`);const a=t.bufferEntries[i];e.createView(a.nativeType);const s=t[a.nativeType];s[(a.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT]=o},e.setArray=(r,n,o)=>{const i=t._bufferEntryNames.get(r);if(void 0===i)return void Nf(`entry named ${r} not found in UBO`);const a=t.bufferEntries[i];e.createView(a.nativeType);const s=t[a.nativeType],l=(a.offset+n*t.sizeInBytes)/s.BYTES_PER_ELEMENT;for(let e=0;e<o.length;e++)s[l+e]=o[e]},e.setAllInstancesFromArray=(r,n)=>{const o=t._bufferEntryNames.get(r);if(void 0===o)return void Nf(`entry named ${r} not found in UBO`);const i=t.bufferEntries[o];e.createView(i.nativeType);const a=t[i.nativeType],s=n.length/t.numberOfInstances;for(let e=0;e<t.numberOfInstances;e++){const r=(i.offset+e*t.sizeInBytes)/a.BYTES_PER_ELEMENT;for(let t=0;t<s;t++)a[r+t]=n[e*s+t]}},e.setAllInstancesFromArrayColorToFloat=(r,n)=>{const o=t._bufferEntryNames.get(r);if(void 0===o)return void Nf(`entry named ${r} not found in UBO`);const i=t.bufferEntries[o];e.createView(i.nativeType);const a=t[i.nativeType],s=n.length/t.numberOfInstances;for(let e=0;e<t.numberOfInstances;e++){const r=(i.offset+e*t.sizeInBytes)/a.BYTES_PER_ELEMENT;for(let t=0;t<s;t++)a[r+t]=n[e*s+t]/255}},e.setAllInstancesFromArray3x3To4x4=(r,n)=>{const o=t._bufferEntryNames.get(r);if(void 0===o)return void Nf(`entry named ${r} not found in UBO`);const i=t.bufferEntries[o];e.createView(i.nativeType);const a=t[i.nativeType];for(let e=0;e<t.numberOfInstances;e++){const r=(i.offset+e*t.sizeInBytes)/a.BYTES_PER_ELEMENT;for(let t=0;t<3;t++)for(let o=0;o<3;o++)a[r+4*t+o]=n[9*e+3*t+o]}},e.getSendTime=()=>t._sendTime.getMTime(),e.getShaderCode=(e,r)=>{const n=[`struct ${t.label}StructEntry\n{`];for(let e=0;e<t.bufferEntries.length;e++){const r=t.bufferEntries[e];n.push(` ${r.name}: ${r.type},`)}return n.push(`\n};\nstruct ${t.label}Struct\n{\n values: array<${t.label}StructEntry>,\n};\n@binding(${e}) @group(${r}) var<storage, read> ${t.label}: ${t.label}Struct;\n`),n.join("\n")},e.getBindGroupEntry=()=>({resource:{buffer:t._buffer.getHandle()}}),e.clearData=()=>{t.numberOfInstances=0,t.sizeInBytes=0,t.bufferEntries=[],t._bufferEntryNames=new Map,t._buffer=null,delete t.arrayBuffer,delete t.Float32Array}}(e,t)}var Ff={newInstance:zt.newInstance(Rf,"vtkWebGPUStorageBuffer"),extend:Rf};const{BufferUsage:Bf}=If,{vtkErrorMacro:Lf}=zt,kf={bufferEntries:null,bufferEntryNames:null,sizeInBytes:0,label:null,bindGroupLayoutEntry:null,bindGroupEntry:null};function Uf(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kf,r),zt.obj(e,t),t._bufferEntryNames=new Map,t.bufferEntries=[],t.bindGroupLayoutEntry=t.bindGroupLayoutEntry||{buffer:{type:"uniform"}},t.sendTime={},zt.obj(t.sendTime,{mtime:0}),t.bindGroupTime={},zt.obj(t.bindGroupTime,{mtime:0}),t.sendDirty=!0,t.sortDirty=!0,zt.get(e,t,["binding","bindGroupTime"]),zt.setGet(e,t,["bindGroupLayoutEntry","device","label","sizeInBytes"]),function(e,t){t.classHierarchy.push("vtkWebGPUUniformBuffer"),e.addEntry=(e,r)=>{t._bufferEntryNames.has(e)?Lf(`entry named ${e} already exists`):(t.sortDirty=!0,t._bufferEntryNames.set(e,t.bufferEntries.length),t.bufferEntries.push({name:e,type:r,sizeInBytes:Hp(r),offset:-1,nativeType:Kp(r),packed:!1}))},e.sortBufferEntries=()=>{if(!t.sortDirty)return;let e=0;const r=[];let n=4;for(let e=0;e<t.bufferEntries.length;e++){const r=t.bufferEntries[e];r.sizeInBytes%16==0&&(n=Math.max(16,n)),r.sizeInBytes%8==0&&(n=Math.max(8,n))}for(let n=0;n<t.bufferEntries.length;n++){const o=t.bufferEntries[n];!1===o.packed&&o.sizeInBytes%16==0&&(o.packed=!0,o.offset=e,r.push(o),e+=o.sizeInBytes)}for(let n=0;n<t.bufferEntries.length;n++){const o=t.bufferEntries[n];if(!1===o.packed&&12===o.sizeInBytes)for(let n=0;n<t.bufferEntries.length;n++){const i=t.bufferEntries[n];if(!1===i.packed&&4===i.sizeInBytes){o.packed=!0,o.offset=e,r.push(o),e+=o.sizeInBytes,i.packed=!0,i.offset=e,r.push(i),e+=i.sizeInBytes;break}}}for(let n=0;n<t.bufferEntries.length;n++){const o=t.bufferEntries[n];if(!o.packed&&o.sizeInBytes%8==0)for(let i=n+1;i<t.bufferEntries.length;i++){const n=t.bufferEntries[i];if(!n.packed&&n.sizeInBytes%8==0){o.packed=!0,o.offset=e,r.push(o),e+=o.sizeInBytes,n.packed=!0,n.offset=e,r.push(n),e+=n.sizeInBytes;break}}}for(let n=0;n<t.bufferEntries.length;n++){const o=t.bufferEntries[n];if(!o.packed&&o.sizeInBytes%8==0){let n=!1;for(let i=0;!n&&i<t.bufferEntries.length;i++){const a=t.bufferEntries[i];if(!a.packed&&4===a.sizeInBytes)for(let s=i+1;s<t.bufferEntries.length;s++){const i=t.bufferEntries[s];if(!i.packed&&4===i.sizeInBytes){o.packed=!0,o.offset=e,r.push(o),e+=o.sizeInBytes,a.packed=!0,a.offset=e,r.push(a),e+=a.sizeInBytes,i.packed=!0,i.offset=e,r.push(i),e+=i.sizeInBytes,n=!0;break}}}}}for(let n=0;n<t.bufferEntries.length;n++){const o=t.bufferEntries[n];!o.packed&&o.sizeInBytes>4&&(o.packed=!0,o.offset=e,r.push(o),e+=o.sizeInBytes)}for(let n=0;n<t.bufferEntries.length;n++){const o=t.bufferEntries[n];o.packed||(o.packed=!0,o.offset=e,r.push(o),e+=o.sizeInBytes)}t.bufferEntries=r,t._bufferEntryNames.clear();for(let e=0;e<t.bufferEntries.length;e++)t._bufferEntryNames.set(t.bufferEntries[e].name,e);t.sizeInBytes=e,t.sizeInBytes=n*Math.ceil(t.sizeInBytes/n),t.sortDirty=!1},e.sendIfNeeded=e=>{if(!t.UBO){const r={nativeArray:t.Float32Array,usage:Bf.UniformArray,label:t.label};t.UBO=e.getBufferManager().getBuffer(r),t.bindGroupTime.modified(),t.sendDirty=!1}t.sendDirty&&(e.getHandle().queue.writeBuffer(t.UBO.getHandle(),0,t.arrayBuffer,0,t.sizeInBytes),t.sendDirty=!1),t.sendTime.modified()},e.createView=e=>{e in t==0&&(t.arrayBuffer||(t.arrayBuffer=new ArrayBuffer(t.sizeInBytes)),t[e]=zt.newTypedArray(e,t.arrayBuffer))},e.setValue=(r,n)=>{e.sortBufferEntries();const o=t._bufferEntryNames.get(r);if(void 0===o)return void Lf(`entry named ${r} not found in UBO`);const i=t.bufferEntries[o];e.createView(i.nativeType);const a=t[i.nativeType];i.lastValue!==n&&(a[i.offset/a.BYTES_PER_ELEMENT]=n,t.sendDirty=!0),i.lastValue=n},e.setArray=(r,n)=>{e.sortBufferEntries();const o=t._bufferEntryNames.get(r);if(void 0===o)return void Lf(`entry named ${r} not found in UBO`);const i=t.bufferEntries[o];e.createView(i.nativeType);const a=t[i.nativeType];let s=!1;for(let e=0;e<n.length;e++)i.lastValue&&i.lastValue[e]===n[e]||(a[i.offset/a.BYTES_PER_ELEMENT+e]=n[e],s=!0);s&&(t.sendDirty=!0,i.lastValue=[...n])},e.getBindGroupEntry=()=>({resource:{buffer:t.UBO.getHandle()}}),e.getSendTime=()=>t.sendTime.getMTime(),e.getShaderCode=(r,n)=>{e.sortBufferEntries();const o=[`struct ${t.label}Struct\n{`];for(let e=0;e<t.bufferEntries.length;e++){const r=t.bufferEntries[e];o.push(` ${r.name}: ${r.type},`)}return o.push(`};\n@binding(${r}) @group(${n}) var<uniform> ${t.label}: ${t.label}Struct;`),o.join("\n")}}(e,t)}var Vf={newInstance:zt.newInstance(Uf,"vtkWebGPUUniformBuffer"),extend:Uf};const{vtkDebugMacro:Gf}=jt,zf="\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4<f32> = mapperUBO.BackgroundColor;\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n",jf=new Float64Array(16),Wf=new Float64Array(16);function Hf(e){return e.getPositional()?e.getConeAngle()>=90?0:2:1}const Kf={bindGroup:null,selector:null,renderEncoder:null,recenterThreshold:20,suppressClear:!1,stabilizedCenter:[0,0,0]};const Xf=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Kf,r),Xt.extend(e,t,r),t.UBO=Vf.newInstance({label:"rendererUBO"}),t.UBO.addEntry("WCVCMatrix","mat4x4<f32>"),t.UBO.addEntry("SCPCMatrix","mat4x4<f32>"),t.UBO.addEntry("PCSCMatrix","mat4x4<f32>"),t.UBO.addEntry("SCVCMatrix","mat4x4<f32>"),t.UBO.addEntry("VCPCMatrix","mat4x4<f32>"),t.UBO.addEntry("WCVCNormals","mat4x4<f32>"),t.UBO.addEntry("viewportSize","vec2<f32>"),t.UBO.addEntry("LightCount","i32"),t.UBO.addEntry("MaxEnvironmentMipLevel","f32"),t.UBO.addEntry("BackgroundDiffuseStrength","f32"),t.UBO.addEntry("BackgroundSpecularStrength","f32"),t.UBO.addEntry("cameraParallel","u32"),t.SSBO=Ff.newInstance({label:"rendererLightSSBO"}),t.lightTimeString="",t.bindGroup=Ap.newInstance({label:"rendererBG"}),t.bindGroup.setBindables([t.UBO,t.SSBO]),t.tmpMat4=h(new Float64Array(16)),t.stabilizedTime={},mt(t.stabilizedTime,{mtime:0}),yt(e,t,["bindGroup","stabilizedTime"]),St(e,t,["stabilizedCenter"]),_t(e,t,["renderEncoder","selector","suppressClear","UBO"]),function(e,t){t.classHierarchy.push("vtkWebGPURenderer"),e.buildPass=r=>{if(r){if(!t.renderable)return;t.camera=t.renderable.getActiveCamera(),e.updateLights(),e.prepareNodes(),e.addMissingNode(t.camera),e.addMissingNodes(t.renderable.getViewPropsWithNestedProps()),e.removeUnusedNodes(),t.webgpuCamera=e.getViewNodeFor(t.camera,t.webgpuCamera),e.updateStabilizedMatrix()}},e.updateStabilizedMatrix=()=>{const e=t.camera.getClippingRange(),r=t.camera.getPositionByReference(),n=[],o=[];vr(o,t.camera.getDirectionOfProjectionByReference(),.5*(e[0]+e[1])),gr(n,r,o),wr(o,n,t.stabilizedCenter),Ar(o)/(e[1]-e[0])>t.recenterThreshold&&(t.stabilizedCenter=n,t.stabilizedTime.modified())},e.updateLights=()=>{let e=0;const r=t.renderable.getLightsByReference();for(let t=0;t<r.length;++t)r[t].getSwitch()>0&&e++;return e||(Gf("No lights are on, creating one."),t.renderable.createLight()),e},e.updateUBO=()=>{const r=t.UBO.getSendTime();if(t._parent.getMTime()>r||e.getMTime()>r||t.camera.getMTime()>r||t.renderable.getMTime()>r){const r=t.webgpuCamera.getKeyMatrices(e);t.UBO.setArray("WCVCMatrix",r.wcvc),t.UBO.setArray("SCPCMatrix",r.scpc),t.UBO.setArray("PCSCMatrix",r.pcsc),t.UBO.setArray("SCVCMatrix",r.scvc),t.UBO.setArray("VCPCMatrix",r.vcpc),t.UBO.setArray("WCVCNormals",r.normalMatrix),t.UBO.setValue("LightCount",t.renderable.getLights().length),t.UBO.setValue("MaxEnvironmentMipLevel",t.renderable.getEnvironmentTexture()?.getMipLevel()),t.UBO.setValue("BackgroundDiffuseStrength",t.renderable.getEnvironmentTextureDiffuseStrength()),t.UBO.setValue("BackgroundSpecularStrength",t.renderable.getEnvironmentTextureSpecularStrength());const n=e.getYInvertedTiledSizeAndOrigin();t.UBO.setArray("viewportSize",[n.usize,n.vsize]),t.UBO.setValue("cameraParallel",t.camera.getParallelProjection());const o=t._parent.getDevice();t.UBO.sendIfNeeded(o)}},e.updateSSBO=()=>{const r=t.renderable.getLights(),n=t.webgpuCamera.getKeyMatrices(e);let o=`${t.renderable.getMTime()}`;for(let e=0;e<r.length;e++)o+=r[e].getMTime();if(o!==t.lightTimeString){const e=new Float32Array(4*r.length),o=new Float32Array(4*r.length),i=new Float32Array(4*r.length),a=new Float32Array(4*r.length);for(let t=0;t<r.length;t++){const s=4*t,l=r[t].getPosition();Sr(l,l,n.wcvc),e[s]=l[0],e[s+1]=l[1],e[s+2]=l[2],e[s+3]=0,o[s]=-r[t].getDirection()[0],o[s+1]=-r[t].getDirection()[1],o[s+2]=-r[t].getDirection()[2],o[s+3]=0,i[s]=r[t].getColor()[0],i[s+1]=r[t].getColor()[1],i[s+2]=r[t].getColor()[2],i[s+3]=5*r[t].getIntensity(),a[s]=Hf(r[t]),a[s+1]=Math.cos(yo(r[t].getConeAngle())),a[s+2]=Math.cos(yo(r[t].getConeAngle()+r[t].getConeFalloff())),a[s+3]=0}t.SSBO.clearData(),t.SSBO.setNumberOfInstances(r.length),t.SSBO.addEntry("LightPos","vec4<f32>"),t.SSBO.addEntry("LightDir","vec4<f32>"),t.SSBO.addEntry("LightColor","vec4<f32>"),t.SSBO.addEntry("LightData","vec4<f32>"),t.SSBO.setAllInstancesFromArray("LightPos",e),t.SSBO.setAllInstancesFromArray("LightDir",o),t.SSBO.setAllInstancesFromArray("LightColor",i),t.SSBO.setAllInstancesFromArray("LightData",a);const s=t._parent.getDevice();t.SSBO.send(s)}t.lightTimeString=o},e.scissorAndViewport=t=>{const r=e.getYInvertedTiledSizeAndOrigin();t.getHandle().setViewport(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize,0,1),t.getHandle().setScissorRect(r.lowerLeftU,r.lowerLeftV,r.usize,r.vsize)},e.bindUBO=e=>{e.activateBindGroup(t.bindGroup)},e.opaquePass=r=>{r?(t.renderEncoder.begin(t._parent.getCommandEncoder()),e.updateUBO(),e.updateSSBO()):(e.scissorAndViewport(t.renderEncoder),e.clear(),t.renderEncoder.end())},e.clear=()=>{if(t.renderable.getTransparent()||t.suppressClear)return;const r=t._parent.getDevice();if(!t.clearFSQ){t.clearFSQ=rf.newInstance(),t.clearFSQ.setDevice(r),t.clearFSQ.setPipelineHash("clearfsq"),t.clearFSQ.setFragmentShaderTemplate(zf);const e=Vf.newInstance({label:"mapperUBO"});e.addEntry("FSQMatrix","mat4x4<f32>"),e.addEntry("BackgroundColor","vec4<f32>"),t.clearFSQ.setUBO(e),t.backgroundTex=t.renderable.getEnvironmentTexture()}if("clearfsqwithtexture"!==t.clearFSQ.getPipelineHash()&&t.renderable.getUseEnvironmentTextureAsBackground()&&t.backgroundTex?.getImageLoaded()){t.clearFSQ.setFragmentShaderTemplate("\nfn vecToRectCoord(dir: vec3<f32>) -> vec2<f32> {\n var tau: f32 = 6.28318530718;\n var pi: f32 = 3.14159265359;\n var out: vec2<f32> = vec2<f32>(0.0);\n\n out.x = atan2(dir.z, dir.x) / tau;\n out.x += 0.5;\n\n var phix: f32 = length(vec2(dir.x, dir.z));\n out.y = atan2(dir.y, phix) / pi + 0.5;\n\n return out;\n}\n\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var tcoord: vec4<f32> = vec4<f32>(input.vertexVC.xy, -1, 1);\n var V: vec4<f32> = normalize(mapperUBO.FSQMatrix * tcoord); // vec2<f32>((input.tcoordVS.x - 0.5) * 2, -(input.tcoordVS.y - 0.5) * 2);\n // textureSampleLevel gets rid of some ugly artifacts\n var background = textureSampleLevel(EnvironmentTexture, EnvironmentTextureSampler, vecToRectCoord(V.xyz), 0.0);\n var computedColor: vec4<f32> = vec4<f32>(background.rgb, 1);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n");const e=Vf.newInstance({label:"mapperUBO"});e.addEntry("FSQMatrix","mat4x4<f32>"),e.addEntry("BackgroundColor","vec4<f32>"),t.clearFSQ.setUBO(e);const n=r.getTextureManager().getTextureForVTKTexture(t.backgroundTex,"EnvironmentTexture");if(n.getReady()){const e=n.createView("EnvironmentTexture");t.clearFSQ.setTextureViews([e]),t.backgroundTexLoaded=!0;const o=t.backgroundTex.getInterpolate()?"linear":"nearest";e.addSampler(r,{addressModeU:"repeat",addressModeV:"clamp-to-edge",addressModeW:"repeat",minFilter:o,magFilter:o,mipmapFilter:"linear"})}t.clearFSQ.setPipelineHash("clearfsqwithtexture")}else if("clearfsqwithtexture"===t.clearFSQ.getPipelineHash()&&!t.renderable.getUseEnvironmentTextureAsBackground()){t.clearFSQ=rf.newInstance(),t.clearFSQ.setDevice(r),t.clearFSQ.setPipelineHash("clearfsq"),t.clearFSQ.setFragmentShaderTemplate(zf);const e=Vf.newInstance({label:"mapperUBO"});e.addEntry("FSQMatrix","mat4x4<f32>"),e.addEntry("BackgroundColor","vec4<f32>"),t.clearFSQ.setUBO(e)}const n=t.webgpuCamera.getKeyMatrices(e),o=t.renderable.getBackgroundByReference();t.clearFSQ.getUBO().setArray("BackgroundColor",o),m(Wf,n.normalMatrix),oe(jf,n.scvc,n.pcsc),oe(jf,Wf,jf),t.clearFSQ.getUBO().setArray("FSQMatrix",jf),t.clearFSQ.getUBO().sendIfNeeded(r),t.clearFSQ.prepareAndDraw(t.renderEncoder)},e.translucentPass=r=>{r?t.renderEncoder.begin(t._parent.getCommandEncoder()):(e.scissorAndViewport(t.renderEncoder),t.renderEncoder.end())},e.volumeDepthRangePass=r=>{r?t.renderEncoder.begin(t._parent.getCommandEncoder()):(e.scissorAndViewport(t.renderEncoder),t.renderEncoder.end())},e.getAspectRatio=()=>{const e=t._parent.getSizeByReference(),r=t.renderable.getViewportByReference();return e[0]*(r[2]-r[0])/((r[3]-r[1])*e[1])},e.convertToOpenGLDepth=e=>t.webgpuCamera.convertToOpenGLDepth(e),e.getYInvertedTiledSizeAndOrigin=()=>{const r=e.getTiledSizeAndOrigin(),n=t._parent.getSizeByReference();return r.lowerLeftV=n[1]-r.vsize-r.lowerLeftV,r},e.getTiledSizeAndOrigin=()=>{const e=t.renderable.getViewportByReference(),r=[0,0,1,1],n=e[0]-r[0],o=e[1]-r[1],i=t._parent.normalizedDisplayToDisplay(n,o),a=Math.round(i[0]),s=Math.round(i[1]),l=e[2]-r[0],u=e[3]-r[1],c=t._parent.normalizedDisplayToDisplay(l,u);let d=Math.round(c[0])-a,p=Math.round(c[1])-s;return d<0&&(d=0),p<0&&(p=0),{usize:d,vsize:p,lowerLeftU:a,lowerLeftV:s}},e.getPropFromID=e=>{for(let r=0;r<t.children.length;r++)if((t.children[r].getPropID?t.children[r].getPropID():-1)===e)return t.children[r];return null},e.getStabilizedTime=()=>t.stabilizedTime.getMTime(),e.releaseGraphicsResources=()=>{null!==t.selector&&t.selector.releaseGraphicsResources()}}(e,t)},"vtkWebGPURenderer");vp("vtkRenderer",Xf);const{CoordinateSystem:$f}=Ka,qf={keyMatricesTime:null,keyMatrices:null,propID:void 0,bufferShift:void 0};const Yf=zt.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,qf,r),Xt.extend(e,t,r),t.keyMatricesTime={},zt.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},zt.get(e,t,["propID","keyMatricesTime"]),t.bufferShift=[0,0,0,0],function(e,t){t.classHierarchy.push("vtkWebGPUActor"),e.buildPass=r=>{r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.traverseOpaquePass=r=>{t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.traverseTranslucentPass=r=>{!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.queryPass=(e,r)=>{if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=r=>(e.getKeyMatrices(r),t.bufferShift),e.getKeyMatrices=e=>{if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.renderable.computeMatrix();const r=t.renderable.getMatrix();t.bufferShift[0]=r[3],t.bufferShift[1]=r[7],t.bufferShift[2]=r[11];const n=e.getStabilizedCenterByReference();t.renderable.getCoordinateSystem()===$f.WORLD&&(t.bufferShift[0]-=n[0],t.bufferShift[1]-=n[1],t.bufferShift[2]-=n[2]),m(t.keyMatrices.bcwc,r),t.renderable.getIsIdentity()?h(t.keyMatrices.normalMatrix):(d(t.keyMatrices.normalMatrix,t.keyMatrices.bcwc),t.keyMatrices.normalMatrix[3]=0,t.keyMatrices.normalMatrix[7]=0,t.keyMatrices.normalMatrix[11]=0,g(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix),m(t.keyMatrices.normalMatrix,t.keyMatrices.normalMatrix)),x(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),t.renderable.getCoordinateSystem()===$f.WORLD?x(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-n[0],-n[1],-n[2]]):d(t.keyMatrices.bcsc,t.keyMatrices.bcwc),t.keyMatricesTime.modified()}return t.keyMatrices}}(e,t)});vp("vtkActor",Yf);const{CoordinateSystem:Jf}=Ka,Qf={keyMatricesTime:null,keyMatrices:null,propID:void 0,bufferShift:void 0};const Zf=zt.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Qf,r),Xt.extend(e,t,r),t.keyMatricesTime={},zt.obj(t.keyMatricesTime,{mtime:0}),t.keyMatrices={normalMatrix:new Float64Array(16),bcwc:new Float64Array(16),bcsc:new Float64Array(16)},zt.get(e,t,["propID","keyMatricesTime"]),t.bufferShift=[0,0,0,0],function(e,t){t.classHierarchy.push("vtkWebGPUActor2D"),e.buildPass=r=>{r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getFirstAncestorOfType("vtkWebGPURenderWindow"),void 0===t.propID&&(t.propID=t.WebGPURenderWindow.getUniquePropID()),e.prepareNodes(),e.addMissingNode(t.renderable.getMapper()),e.removeUnusedNodes())},e.traverseOpaquePass=r=>{t.renderable&&t.renderable.getNestedVisibility()&&t.renderable.getIsOpaque()&&(!t.WebGPURenderer.getSelector()||t.renderable.getNestedPickable())&&(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.traverseTranslucentPass=r=>{!t.renderable||!t.renderable.getNestedVisibility()||t.renderable.getIsOpaque()||t.WebGPURenderer.getSelector()&&!t.renderable.getNestedPickable()||(e.apply(r,!0),t.children[0]&&t.children[0].traverse(r),e.apply(r,!1))},e.queryPass=(e,r)=>{if(e){if(!t.renderable||!t.renderable.getVisibility())return;t.renderable.getIsOpaque()?r.incrementOpaqueActorCount():r.incrementTranslucentActorCount()}},e.getBufferShift=r=>(e.getKeyMatrices(r),t.bufferShift),e.getKeyMatrices=e=>{if(Math.max(t.renderable.getMTime(),e.getStabilizedTime())>t.keyMatricesTime.getMTime()){t.bufferShift[0]=0,t.bufferShift[1]=0,t.bufferShift[2]=0;const r=e.getStabilizedCenterByReference();t.renderable.getCoordinateSystem()===Jf.WORLD&&(t.bufferShift[0]-=r[0],t.bufferShift[1]-=r[1],t.bufferShift[2]-=r[2]),h(t.keyMatrices.bcwc),h(t.keyMatrices.normalMatrix),x(t.keyMatrices.bcwc,t.keyMatrices.bcwc,[-t.bufferShift[0],-t.bufferShift[1],-t.bufferShift[2]]),t.renderable.getCoordinateSystem()===Jf.WORLD?x(t.keyMatrices.bcsc,t.keyMatrices.bcwc,[-r[0],-r[1],-r[2]]):d(t.keyMatrices.bcsc,t.keyMatrices.bcwc),t.keyMatricesTime.modified()}return t.keyMatrices}}(e,t)});vp("vtkActor2D",Zf);const eh={};const th=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,eh,r),Xt.extend(e,t,r),t.CubeAxesActorHelper=Fc.newCubeAxesActorHelper(),function(e,t){t.classHierarchy.push("vtkWebGPUCubeAxesActor"),e.buildPass=r=>{r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.CubeAxesActorHelper.getRenderable()||t.CubeAxesActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.CubeAxesActorHelper.getTmActor()),e.addMissingNode(t.renderable.getGridActor()),e.removeUnusedNodes())},e.opaquePass=(e,r)=>{if(e){const e=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,r=t.WebGPURenderer.getTiledSizeAndOrigin();t.CubeAxesActorHelper.updateAPISpecificData([r.usize,r.vsize],e,t.WebGPURenderWindow.getRenderable())}}}(e,t)},"vtkWebGPUCubeAxesActor");vp("vtkCubeAxesActor",th);const{DisplayLocation:rh}=Hd,nh={color:[1,1,1],opacity:1,pointSize:1,lineWidth:1,representation:Ja.SURFACE,displayLocation:rh.FOREGROUND};function oh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,nh,r),zt.obj(e,t),zt.setGet(e,t,["opacity","lineWidth","pointSize","displayLocation","representation"]),zt.setGetArray(e,t,["color"],3),function(e,t){t.classHierarchy.push("vtkProperty2D"),e.setDisplayLocationToBackground=()=>e.setDisplayLocation(rh.BACKGROUND),e.setDisplayLocationToForeground=()=>e.setDisplayLocation(rh.FOREGROUND),e.setRepresentationToWireframe=()=>e.setRepresentation(Ja.WIREFRAME),e.setRepresentationToSurface=()=>e.setRepresentation(Ja.SURFACE),e.setRepresentationToPoints=()=>e.setRepresentation(Ja.POINTS),e.getRepresentationAsString=()=>zt.enumToString(Ja,t.representation)}(e,t)}var ih={newInstance:zt.newInstance(oh,"vtkProperty2D"),extend:oh,...Hd};const{BufferUsage:ah,PrimitiveTypes:sh}=If,{Representation:lh}=os,{ScalarMode:uh}=Gl,{CoordinateSystem:ch}=Ka,{DisplayLocation:dh}=ih;function ph(e){return e.indexOf("edge")>=0}const fh={is2D:!1,cellArray:null,currentInput:null,cellOffset:0,primitiveType:0,colorTexture:null,renderEncoder:null,textures:null};function hh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,fh,r),Zp.extend(e,t,r),t.fragmentShaderTemplate='\nstruct PBRData {\n diffuse: vec3<f32>,\n specular: vec3<f32>,\n}\n\nstruct Material {\n ior: f32,\n roughness: f32,\n metallic: f32,\n base: vec3<f32>,\n};\n\nstruct DirectionalLight {\n direction: vec3<f32>,\n color: vec3<f32>,\n};\n\nstruct PointLight {\n position: vec3<f32>,\n color: vec3<f32>,\n};\n\nstruct SpotLight {\n position: vec3<f32>,\n direction: vec3<f32>,\n cones: vec2<f32>,\n color: vec3<f32>,\n};\n\nconst pi: f32 = 3.14159265359;\n\n// Dot product with the max already in it\nfn mdot(a: vec3<f32>, b: vec3<f32>) -> f32 {\n return max(0.0, dot(a, b));\n}\n// Dot product with a max in it that does not allow for negative values\n// Physically based rendering is accurate as long as normals are accurate,\n// however this is pretty often not the case. In order to prevent negative\n// values from ruining light calculations and creating zones of zero light,\n// this remapping is used, which smoothly clamps the dot product between\n// zero and one while still maintaining a good amount of accuracy.\nfn cdot(a: vec3<f32>, b: vec3<f32>) -> f32 {\n var d: f32 = max(0.0, dot(a, b));\n d = pow((d + 1.0) / 2.0, 2.6);\n return d;\n}\n\n// Lambertian diffuse model\nfn lambertDiffuse(base: vec3<f32>, N: vec3<f32>, L: vec3<f32>) -> vec3<f32> {\n var NdotL: f32 = mdot(N, L);\n NdotL = pow(NdotL, 1.5);\n return (base/pi)*NdotL;\n}\n\n// Yasuhiro Fujii improvement on the Oren-Nayar model\n// https://mimosa-pudica.net/improved-oren-nayar.html\n// p is surface color, o is roughness\nfn fujiiOrenNayar(p: vec3<f32>, o: f32, N: vec3<f32>, L: vec3<f32>, V: vec3<f32>) -> vec3<f32> {\n var invpi: f32 = 0.31830988618; // 1/pi\n\n var o2 = o*o;\n var NdotL: f32 = mdot(N, L);\n NdotL = pow(NdotL, 1.5); // Less physically accurate, but hides the "seams" between lights better\n\n var NdotV: f32 = mdot(N, V);\n var LdotV: f32 = mdot(L, V);\n\n var s: f32 = LdotV - NdotL*NdotV;\n var t: f32 = mix(1.0, max(NdotL, NdotV), step(0.0, s)); // Mix with step is the equivalent of an if statement\n var A: vec3<f32> = 0.5*(o2 / (o2 + 0.33)) + 0.17*p*(o2 / (o2 + 0.13));\n A = invpi*(1 - A);\n var B: f32 = 0.45*(o2 / (o2 + 0.09));\n B = invpi*B;\n\n return p*NdotL*(A + B*(s/t));\n}\n\n// Fresnel portion of BRDF (IOR only, simplified)\nfn schlickFresnelIOR(V: vec3<f32>, N: vec3<f32>, ior: f32, k: f32) -> f32 {\n var NdotV: f32 = mdot(V, N);\n var F0: f32 = (pow((ior - 1.0), 2.0) + k*k) / (pow((ior + 1.0), 2.0) + k*k); // This takes into account the roughness, which the other one does not\n return F0 + (1.0 - F0) * pow((1.0-NdotV), 5.0);\n}\n\n// Fresnel portion of BRDF (Color ior, better)\nfn schlickFresnelRGB(V: vec3<f32>, N: vec3<f32>, F0: vec3<f32>) -> vec3<f32> {\n var NdotV: f32 = mdot(V, N);\n return F0 + (1.0 - F0) * pow((1-NdotV), 5.0);\n}\n\n// Normal portion of BRDF\n// https://learnopengl.com/PBR/Theory\n// Trowbridge-Reitz GGX functions: normal, halfway, roughness^2\nfn trGGX(N: vec3<f32>, H: vec3<f32>, a: f32) -> f32 {\n var a2: f32 = a*a;\n var NdotH = mdot(N, H);\n var NdotH2 = NdotH*NdotH;\n\n var denom: f32 = NdotH2 * (a2 - 1.0) + 1.0;\n\n return a2 / max((pi*denom*denom), 0.000001);\n}\n\n// A VERY bad approximation of anisotropy. Real anisotropic calculations require tangent and bitangent\nfn anisotrophicTrGGX(N: vec3<f32>, H: vec3<f32>, O: vec3<f32>, s: f32, a: f32) -> f32 {\n var Op: vec3<f32> = (rendererUBO.WCVCNormals * vec4<f32>(normalize(O) * s, 0.)).xyz;\n\n var ggx1: f32 = trGGX(N + Op*s, H, a);\n var ggx2: f32 = trGGX(N - Op*s, H, a);\n return (0.5 * ggx1 + 0.5 * ggx2);\n}\n\n// Geometry portion of BRDF\nfn schlickGGX(N: vec3<f32>, X: vec3<f32>, k: f32) -> f32 {\n var NdotX = cdot(N, X);\n return NdotX / max(0.000001, (NdotX*(1.0-k) + k));\n}\n\nfn smithSurfaceRoughness(N: vec3<f32>, V: vec3<f32>, L: vec3<f32>, k: f32) -> f32 {\n var ggx1: f32 = min(1.0, schlickGGX(N, V, k));\n var ggx2: f32 = min(1.0, schlickGGX(N, L, k));\n return ggx1*ggx2;\n}\n\n// BRDF Combination\nfn cookTorrance(D: f32, F: f32, G: f32, N: vec3<f32>, V: vec3<f32>, L: vec3<f32>) -> f32 {\n var num: f32 = D*F*G;\n var denom: f32 = 4*cdot(V, N)*cdot(L, N);\n\n return num / max(denom, 0.000001);\n}\n\n// Different lighting calculations for different light sources\nfn calcDirectionalLight(N: vec3<f32>, V: vec3<f32>, mat: Material, light: DirectionalLight) -> PBRData {\n var L: vec3<f32> = normalize(light.direction); // Light Vector\n var H: vec3<f32> = normalize(L + V); // Halfway Vector\n\n var alpha = mat.roughness * mat.roughness;\n var k: f32 = alpha * alpha / 2.0;\n\n var D: f32 = trGGX(N, H, alpha); // Distribution\n // var F: f32 = schlickFresnelIOR(V, N, ior, k); // Fresnel\n var G: f32 = smithSurfaceRoughness(N, V, L, k); // Geometry\n\n var brdf: f32 = cookTorrance(D, 1.0, G, N, V, L); // Fresnel term is replaced with 1 because it is added later\n var incoming: vec3<f32> = light.color;\n var angle: f32 = mdot(L, N);\n angle = pow(angle, 1.5);\n\n var specular: vec3<f32> = brdf * incoming * angle;\n // Oren-Nayar gives a clay-like effect when fully rough which some people may not want, so it might be better to give a separate\n // control property for the diffuse vs specular roughness\n var diffuse: vec3<f32> = incoming * fujiiOrenNayar(mat.base, mat.roughness, N, L, V);\n // Stores the specular and diffuse separately to allow for finer post processing\n var out = PBRData(diffuse, specular);\n\n return out; // Returns angle along with color of light so the final color can be multiplied by angle as well (creates black areas)\n}\n\nfn calcPointLight(N: vec3<f32>, V: vec3<f32>, fragPos: vec3<f32>, mat: Material, light: PointLight) -> PBRData {\n var L: vec3<f32> = normalize(light.position - fragPos);\n var H: vec3<f32> = normalize(L + V);\n var dist = distance(light.position, fragPos);\n\n var alpha = mat.roughness * mat.roughness;\n var k: f32 = alpha * alpha / 2.0;\n\n var D: f32 = trGGX(N, H, alpha); // Distribution\n var F: f32 = schlickFresnelIOR(V, N, mat.ior, k); // Fresnel\n var G: f32 = smithSurfaceRoughness(N, V, L, k); // Geometry\n\n var brdf: f32 = cookTorrance(D, 1.0, G, N, V, L);\n var incoming: vec3<f32> = light.color * (1.0 / (dist * dist));\n var angle: f32 = mdot(L, N);\n angle = pow(angle, 1.5); // Smoothing factor makes it less accurate, but reduces ugly "seams" between light sources\n\n var specular: vec3<f32> = brdf * incoming * angle;\n var diffuse: vec3<f32> = incoming * fujiiOrenNayar(mat.base, mat.roughness, N, L, V);\n // Stores the specular and diffuse separately to allow for finer post processing\n // Could also be done (propably more properly) with a struct\n var out = PBRData(diffuse, specular);\n\n return out; // Returns angle along with color of light so the final color can be multiplied by angle as well (creates black areas)\n}\n\n// For a reason unknown to me, spheres dont seem to behave propperly with head-on spot lights\nfn calcSpotLight(N: vec3<f32>, V: vec3<f32>, fragPos: vec3<f32>, mat: Material, light: SpotLight) -> PBRData {\n var L: vec3<f32> = normalize(light.position - fragPos);\n var H: vec3<f32> = normalize(L + V); // Halfway Vector\n var dist = distance(light.position, fragPos);\n\n var alpha = mat.roughness * mat.roughness;\n var k: f32 = alpha * alpha / 2.0; // could also be pow(alpha + 1.0, 2) / 8\n\n var D: f32 = trGGX(N, H, alpha); // Distribution\n // var F: f32 = schlickFresnelIOR(V, N, ior, k); // Fresnel\n var G: f32 = smithSurfaceRoughness(N, V, L, k); // Geometry\n\n var brdf: f32 = cookTorrance(D, 1.0, G, N, V, L);\n\n var theta: f32 = mdot(normalize(light.direction), L);\n var epsilon: f32 = light.cones.x - light.cones.y;\n var intensity: f32 = (theta - light.cones.y) / epsilon;\n intensity = clamp(intensity, 0.0, 1.0);\n intensity /= dist * dist;\n\n var incoming: vec3<f32> = light.color * intensity;\n\n var angle: f32 = mdot(L, N);\n angle = pow(angle, 1.5); // Smoothing factor makes it less accurate, but reduces ugly "seams" between light sources\n\n var specular: vec3<f32> = brdf * incoming * angle;\n var diffuse: vec3<f32> = incoming * fujiiOrenNayar(mat.base, mat.roughness, N, L, V);\n\n // Stores the specular and diffuse separately to allow for finer post processing\n // Could also be done (propably more properly) with a struct\n var out = PBRData(diffuse, specular);\n\n return out; // Returns angle along with color of light so the final color can be multiplied by angle as well (creates black areas)\n}\n\n// Environment mapping stuff\n// Takes in a vector and converts it to an equivalent coordinate in a rectilinear texture. Should be replaced with cubemaps at some point\nfn vecToRectCoord(dir: vec3<f32>) -> vec2<f32> {\n var tau: f32 = 6.28318530718;\n var out: vec2<f32> = vec2<f32>(0.0);\n\n out.x = atan2(dir.z, dir.x) / tau;\n out.x += 0.5;\n\n var phix: f32 = length(vec2(dir.x, dir.z));\n out.y = atan2(dir.y, phix) / pi + 0.5;\n\n return out;\n}\n\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::TCoord::Dec\n\n// optional surface normal declaration\n//VTK::Normal::Dec\n\n//VTK::Select::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n // Temporary ambient, diffuse, and opacity\n var ambientColor: vec4<f32> = mapperUBO.AmbientColor;\n var diffuseColor: vec4<f32> = mapperUBO.DiffuseColor;\n var opacity: f32 = mapperUBO.Opacity;\n var ior: f32 = mapperUBO.BaseIOR;\n\n // This should be declared somewhere else\n var _diffuseMap: vec4<f32> = vec4<f32>(1.0);\n var _roughnessMap: vec4<f32> = vec4<f32>(1.0);\n var _metallicMap: vec4<f32> = vec4<f32>(1.0);\n var _normalMap: vec4<f32> = vec4<f32>(0.0, 0.0, 1.0, 0.0); // normal map was setting off the normal vector detection in fragment\n var _ambientOcclusionMap: vec4<f32> = vec4<f32>(1.);\n var _emissionMap: vec4<f32> = vec4<f32>(0.);\n\n //VTK::Color::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Normal::Impl\n\n var computedColor: vec4<f32> = vec4<f32>(diffuseColor.rgb, 1.0);\n\n //VTK::Light::Impl\n\n //VTK::Select::Impl\n\n // Use texture alpha for transparency\n computedColor.a = mapperUBO.Opacity * _diffuseMap.a;\n if (computedColor.a == 0.0) { discard; };\n\n //VTK::Position::Impl\n\n //VTK::RenderEncoder::Impl\n\n return output;\n}\n',t.vertexShaderTemplate="\n//VTK::Renderer::Dec\n\n//VTK::Color::Dec\n\n//VTK::Normal::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Select::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@vertex\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : vertexOutput;\n\n var vertex: vec4<f32> = vertexBC;\n\n //VTK::Color::Impl\n\n //VTK::Normal::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::Select::Impl\n\n //VTK::Position::Impl\n\n return output;\n}\n",t._tmpMat3=pe(new Float64Array(9)),t._tmpMat4=h(new Float64Array(16)),t.UBO=Vf.newInstance({label:"mapperUBO"}),t.UBO.addEntry("BCWCMatrix","mat4x4<f32>"),t.UBO.addEntry("BCSCMatrix","mat4x4<f32>"),t.UBO.addEntry("MCWCNormals","mat4x4<f32>"),t.UBO.addEntry("AmbientColor","vec4<f32>"),t.UBO.addEntry("DiffuseColor","vec4<f32>"),t.UBO.addEntry("EdgeColor","vec4<f32>"),t.UBO.addEntry("SpecularColor","vec4<f32>"),t.UBO.addEntry("AmbientIntensity","f32"),t.UBO.addEntry("DiffuseIntensity","f32"),t.UBO.addEntry("Roughness","f32"),t.UBO.addEntry("Metallic","f32"),t.UBO.addEntry("Ambient","f32"),t.UBO.addEntry("Normal","f32"),t.UBO.addEntry("Emission","f32"),t.UBO.addEntry("NormalStrength","f32"),t.UBO.addEntry("BaseIOR","f32"),t.UBO.addEntry("SpecularIntensity","f32"),t.UBO.addEntry("LineWidth","f32"),t.UBO.addEntry("Opacity","f32"),t.UBO.addEntry("ZValue","f32"),t.UBO.addEntry("PropID","u32"),t.UBO.addEntry("ClipNear","f32"),t.UBO.addEntry("ClipFar","f32"),t.UBO.addEntry("Time","u32"),_t(e,t,["cellArray","currentInput","cellOffset","is2D","primitiveType","renderEncoder"]),t.textures=[],function(e,t){t.classHierarchy.push("vtkWebGPUCellArrayMapper"),e.buildPass=r=>{r&&(t.is2D?(t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor2D"),t.forceZValue=!0):(t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor"),t.forceZValue=!1),t.coordinateSystem=t.WebGPUActor.getRenderable().getCoordinateSystem(),t.useRendererMatrix=t.coordinateSystem!==ch.DISPLAY,t.WebGPURenderer=t.WebGPUActor.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.device=t.WebGPURenderWindow.getDevice())},e.translucentPass=r=>{r&&(e.prepareToDraw(t.WebGPURenderer.getRenderEncoder()),t.renderEncoder.registerDrawCallback(t.pipeline,e.draw))},e.opaquePass=r=>{r&&(e.prepareToDraw(t.WebGPURenderer.getRenderEncoder()),t.renderEncoder.registerDrawCallback(t.pipeline,e.draw))},e.updateUBO=()=>{const r=t.WebGPUActor.getRenderable().getProperty(),n=t.UBO.getSendTime();if(e.getMTime()<=n&&r.getMTime()<=n&&t.renderable.getMTime()<=n)return;const o=t.WebGPUActor.getKeyMatrices(t.WebGPURenderer);if(t.UBO.setArray("BCWCMatrix",o.bcwc),t.UBO.setArray("BCSCMatrix",o.bcsc),t.UBO.setArray("MCWCNormals",o.normalMatrix),t.is2D){const e=r.getDisplayLocation?.()??dh.BACKGROUND;t.UBO.setValue("ZValue",e===dh.FOREGROUND?1:0);const n=r.getColorByReference();t.UBO.setValue("AmbientIntensity",1),t.UBO.setArray("DiffuseColor",[...n,1]),t.UBO.setValue("DiffuseIntensity",0),t.UBO.setValue("SpecularIntensity",0)}else t.UBO.setValue("AmbientIntensity",r.getAmbient()),t.UBO.setArray("AmbientColor",[...r.getAmbientColorByReference(),1]),t.UBO.setValue("DiffuseIntensity",r.getDiffuse()),t.UBO.setArray("DiffuseColor",[...r.getDiffuseColorByReference(),1]),t.UBO.setValue("Roughness",r.getRoughness()),t.UBO.setValue("BaseIOR",r.getBaseIOR()),t.UBO.setValue("Metallic",r.getMetallic()),t.UBO.setValue("NormalStrength",r.getNormalStrength()),t.UBO.setValue("Emission",r.getEmission()),t.UBO.setValue("SpecularIntensity",r.getSpecular()),r.getSpecularColorByReference()&&t.UBO.setArray("SpecularColor",[...r.getSpecularColorByReference(),1]);const i=r.getEdgeColorByReference?.();i&&t.UBO.setArray("EdgeColor",[...i,1]),t.UBO.setValue("LineWidth",r.getLineWidth()),t.UBO.setValue("Opacity",r.getOpacity()),t.UBO.setValue("PropID",t.WebGPUActor.getPropID()),t.UBO.sendIfNeeded(t.WebGPURenderWindow.getDevice())},e.haveWideLines=()=>{const e=t.WebGPUActor.getRenderable(),r=e.getProperty().getRepresentation();return!(e.getProperty().getLineWidth()<=1)&&t.primitiveType!==sh.Verts&&(t.primitiveType!==sh.Triangles&&t.primitiveType!==sh.TriangleStrips||r===lh.WIREFRAME)},e.replaceShaderPosition=(r,n,o)=>{const i=n.getShaderDescription("vertex");i.addBuiltinOutput("vec4<f32>","@builtin(position) Position"),i.hasOutput("vertexVC")||i.addOutput("vec4<f32>","vertexVC");let a=i.getCode();t.useRendererMatrix?(a=Np.substitute(a,"//VTK::Position::Impl",[" var pCoord: vec4<f32> = rendererUBO.SCPCMatrix*mapperUBO.BCSCMatrix*vertexBC;"," output.vertexVC = rendererUBO.SCVCMatrix * mapperUBO.BCSCMatrix * vec4<f32>(vertexBC.xyz, 1.0);","//VTK::Position::Impl"]).result,t.forceZValue&&(a=Np.substitute(a,"//VTK::Position::Impl",["pCoord = vec4<f32>(pCoord.xyz/pCoord.w, 1.0);","pCoord.z = mapperUBO.ZValue;","//VTK::Position::Impl"]).result)):(a=Np.substitute(a,"//VTK::Position::Impl",[" var pCoord: vec4<f32> = mapperUBO.BCSCMatrix*vertexBC;"," pCoord.x = 2.0* pCoord.x / rendererUBO.viewportSize.x - 1.0;"," pCoord.y = 2.0* pCoord.y / rendererUBO.viewportSize.y - 1.0;"," pCoord.z = 0.5 - 0.5 * pCoord.z;","//VTK::Position::Impl"]).result,t.forceZValue&&(a=Np.substitute(a,"//VTK::Position::Impl",[" pCoord.z = mapperUBO.ZValue;","//VTK::Position::Impl"]).result)),e.haveWideLines()&&(i.addBuiltinInput("u32","@builtin(instance_index) instanceIndex"),a=Np.substitute(a,"//VTK::Position::Impl",[" var tmpPos: vec4<f32> = pCoord;"," var numSteps: f32 = ceil(mapperUBO.LineWidth - 1.0);"," var offset: f32 = (mapperUBO.LineWidth - 1.0) * (f32(input.instanceIndex / 2u) - numSteps/2.0) / numSteps;"," var tmpPos2: vec3<f32> = tmpPos.xyz / tmpPos.w;"," tmpPos2.x = tmpPos2.x + 2.0 * (f32(input.instanceIndex) % 2.0) * offset / rendererUBO.viewportSize.x;"," tmpPos2.y = tmpPos2.y + 2.0 * (f32(input.instanceIndex + 1u) % 2.0) * offset / rendererUBO.viewportSize.y;"," tmpPos2.z = min(1.0, tmpPos2.z + 0.00001);"," pCoord = vec4<f32>(tmpPos2.xyz * tmpPos.w, tmpPos.w);","//VTK::Position::Impl"]).result),a=Np.substitute(a,"//VTK::Position::Impl",[" output.Position = pCoord;"]).result,i.setCode(a)},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderNormal=(e,r,n)=>{const o=n.getBuffer("normalMC"),i=t.WebGPUActor.getRenderable();if(o){const e=r.getShaderDescription("vertex");e.hasOutput("normalVC")||e.addOutput("vec3<f32>","normalVC",o.getArrayInformation()[0].interpolation),e.hasOutput("tangentVC")||e.addOutput("vec3<f32>","tangentVC",o.getArrayInformation()[0].interpolation),e.hasOutput("bitangentVC")||e.addOutput("vec3<f32>","bitangentVC",o.getArrayInformation()[0].interpolation);let t=e.getCode();t=Np.substitute(t,"//VTK::Normal::Impl",[" output.normalVC = normalize((rendererUBO.WCVCNormals * mapperUBO.MCWCNormals * normalMC).xyz);"," var c1: vec3<f32> = cross(output.normalVC, vec3<f32>(0, 0, 1));"," var c2: vec3<f32> = cross(output.normalVC, vec3<f32>(0, 1, 0));"," var tangent: vec3<f32> = mix(c1, c2, distance(c1, c2));"," output.tangentVC = normalize(tangent);"," output.bitangentVC = normalize(cross(output.normalVC, tangent));"]).result,e.setCode(t);const n=r.getShaderDescription("fragment");t=n.getCode(),t=i.getProperty().getNormalTexture()?Np.substitute(t,"//VTK::Normal::Impl",[" var normal: vec3<f32> = input.normalVC;"," if (!input.frontFacing) { normal = -normal; }"," var tangent: vec3<f32> = input.tangentVC;"," var bitangent: vec3<f32> = input.bitangentVC;"," var TCVCMatrix: mat3x3<f32> = mat3x3<f32>("," tangent.x, bitangent.x, normal.x,"," tangent.y, bitangent.y, normal.y,"," tangent.z, bitangent.z, normal.z,"," );"," var mappedNormal: vec3<f32> = TCVCMatrix * (_normalMap.xyz * 2 - 1);"," normal = mix(normal, mappedNormal, mapperUBO.NormalStrength);"," normal = normalize(normal);"]).result:Np.substitute(t,"//VTK::Normal::Impl",[" var normal: vec3<f32> = input.normalVC;"," if (!input.frontFacing) { normal = -normal; }"," normal = normalize(normal);"]).result,n.setCode(t)}},t.shaderReplacements.set("replaceShaderNormal",e.replaceShaderNormal),e.replaceShaderLight=(e,r,n)=>{if(e.includes("sel"))return;const o=r.getShaderDescription("vertex");o.hasOutput("vertexVC")||o.addOutput("vec4<f32>","vertexVC");const i=t.WebGPURenderer.getRenderable(),a=r.getShaderDescription("fragment");let s=a.getCode();if(!s.includes("var normal:")||!t.useRendererMatrix||ph(e)||t.is2D||e.includes("sel"))s=Np.substitute(s,"//VTK::Light::Impl",[" let diffuse = diffuseColor.rgb;"," let specular = mapperUBO.SpecularColor.rgb * mapperUBO.SpecularColor.a;"," computedColor = vec4<f32>(diffuse * _diffuseMap.rgb, mapperUBO.Opacity);"]).result,a.setCode(s);else{const e=[" let fragPos = vec3<f32>(input.vertexVC.xyz);"," let V = mix(normalize(-fragPos), vec3<f32>(0, 0, 1), f32(rendererUBO.cameraParallel)); // View Vector"," let baseColor = _diffuseMap.rgb * diffuseColor.rgb;"," let roughness = max(0.000001, mapperUBO.Roughness * _roughnessMap.r);"," let metallic = mapperUBO.Metallic * _metallicMap.r;"," let alpha = roughness * roughness;"," let k = alpha * alpha / 2.0;"," var diffuse = vec3<f32>(0.);"," var specular = vec3<f32>(0.);"," let emission = _emissionMap.rgb * mapperUBO.Emission;",""," // Material struct"," let mat = Material(ior, roughness, metallic, baseColor);",""," {"," var i = 0;"," loop {"," if (!(i < rendererUBO.LightCount)) { break; }"," switch (i32(rendererLightSSBO.values[i].LightData.x)) {"," // Point Light"," case 0 {"," let color = rendererLightSSBO.values[i].LightColor.rgb * rendererLightSSBO.values[i].LightColor.w;"," let pos = (rendererLightSSBO.values[i].LightPos).xyz;"," let pointLight = PointLight(pos, color);"," let result = calcPointLight(normal, V, fragPos, mat, pointLight);"," diffuse += max(vec3<f32>(0), result.diffuse);"," specular += max(vec3<f32>(0), result.specular);"," }"," // Directional light"," case 1 {"," let dir = normalize((rendererUBO.WCVCNormals * vec4<f32>(normalize(rendererLightSSBO.values[i].LightDir.xyz), 0.)).xyz);"," let color = rendererLightSSBO.values[i].LightColor.rgb * rendererLightSSBO.values[i].LightColor.w;"," let dirLight = DirectionalLight(dir, color);"," let result = calcDirectionalLight(normal, V, mat, dirLight); // diffuseColor.rgb needs to be fixed with a more dynamic diffuse color"," diffuse += max(vec3<f32>(0), result.diffuse);"," specular += max(vec3<f32>(0), result.specular);"," }"," // Spot Light"," case 2 {"," let color = rendererLightSSBO.values[i].LightColor.rgb * rendererLightSSBO.values[i].LightColor.w;"," let pos = (rendererLightSSBO.values[i].LightPos).xyz;"," let dir = normalize((rendererUBO.WCVCNormals * vec4<f32>(normalize(rendererLightSSBO.values[i].LightDir.xyz), 0.)).xyz);"," let cones = vec2<f32>(rendererLightSSBO.values[i].LightData.y, rendererLightSSBO.values[i].LightData.z);"," let spotLight = SpotLight(pos, dir, cones, color);"," let result = calcSpotLight(normal, V, fragPos, mat, spotLight);"," diffuse += max(vec3<f32>(0), result.diffuse);"," specular += max(vec3<f32>(0), result.specular);"," }"," default { continue; }"," }"," continuing { i++; }"," }"," }"," let fresnel = min(1.0, schlickFresnelIOR(V, normal, ior, k)); // Fresnel"," // This could be controlled with its own variable (that isnt base color) for better artistic control"," let fresnelMetallic = schlickFresnelRGB(V, normal, baseColor); // Fresnel for metal, takes color into account"," let kS = min(vec3<f32>(1.0), mix(vec3<f32>(fresnel), fresnelMetallic, metallic));"," let kD = (1.0 - kS) * (1.0 - metallic);"," let PBR = mapperUBO.DiffuseIntensity * kD * diffuse + kS * specular;"," computedColor = vec4<f32>(PBR + emission, mapperUBO.Opacity);"];i.getEnvironmentTexture()?.getImageLoaded()&&e.push(" // To get diffuse IBL, the texture is sampled with normals in worldspace"," let diffuseIBLCoords = (transpose(rendererUBO.WCVCNormals) * vec4<f32>(normal, 1.)).xyz;"," let diffuseCoords = vecToRectCoord(diffuseIBLCoords);"," // To get specular IBL, the texture is sampled as the worldspace reflection between the normal and view vectors"," // Reflections are first calculated in viewspace, then converted to worldspace to sample the environment"," let VreflN = normalize(reflect(-V, normal));"," let reflectionIBLCoords = (transpose(rendererUBO.WCVCNormals) * vec4<f32>(VreflN, 1.)).xyz;"," let specularCoords = vecToRectCoord(reflectionIBLCoords);"," let diffuseIBL = textureSampleLevel(EnvironmentTexture, EnvironmentTextureSampler, diffuseCoords, rendererUBO.MaxEnvironmentMipLevel);"," let level = roughness * rendererUBO.MaxEnvironmentMipLevel;"," let specularIBL = textureSampleLevel(EnvironmentTexture, EnvironmentTextureSampler, specularCoords, level);"," let specularIBLContribution = specularIBL.rgb * rendererUBO.BackgroundSpecularStrength;"," computedColor += vec4<f32>(specularIBLContribution * kS, 0);"," let diffuseIBLContribution = diffuseIBL.rgb * rendererUBO.BackgroundDiffuseStrength;"," computedColor += vec4<f32>(diffuseIBLContribution * baseColor * _ambientOcclusionMap.rgb * kD, 0);"),s=Np.substitute(s,"//VTK::Light::Impl",e).result,a.setCode(s)}},t.shaderReplacements.set("replaceShaderLight",e.replaceShaderLight),e.replaceShaderColor=(e,t,r)=>{if(ph(e)){const e=t.getShaderDescription("fragment");let r=e.getCode();return r=Np.substitute(r,"//VTK::Color::Impl",["ambientColor = mapperUBO.EdgeColor;","diffuseColor = mapperUBO.EdgeColor;"]).result,void e.setCode(r)}const n=r.getBuffer("colorVI");if(!n)return;const o=t.getShaderDescription("vertex");o.addOutput("vec4<f32>","color",n.getArrayInformation()[0].interpolation);let i=o.getCode();i=Np.substitute(i,"//VTK::Color::Impl",[" output.color = colorVI;"]).result,o.setCode(i);const a=t.getShaderDescription("fragment");i=a.getCode(),i=Np.substitute(i,"//VTK::Color::Impl",["ambientColor = input.color;","diffuseColor = input.color;","opacity = mapperUBO.Opacity * input.color.a;"]).result,a.setCode(i)},t.shaderReplacements.set("replaceShaderColor",e.replaceShaderColor),e.replaceShaderTCoord=(e,r,n)=>{if(!n.hasAttribute("tcoord"))return;const o=r.getShaderDescription("vertex"),i=n.getBuffer("tcoord"),a=zp(i.getArrayInformation()[0].format);let s=o.getCode();o.addOutput(`vec${a}<f32>`,"tcoordVS"),s=Np.substitute(s,"//VTK::TCoord::Impl",[" output.tcoordVS = tcoord;"]).result,o.setCode(s);const l=r.getShaderDescription("fragment");s=l.getCode();const u=t.WebGPUActor.getRenderable(),c=u.getProperty(),d=e=>!!e&&e.getDimensionality()===a,p=[],f=c.getDiffuseTexture?.();(f?.getImageLoaded()||u.getTextures()[0]||t.colorTexture)&&(d(f)||d(u.getTextures()[0])||d(t.colorTexture))&&p.push("_diffuseMap = textureSample(DiffuseTexture, DiffuseTextureSampler, input.tcoordVS);");const h=c.getORMTexture?.(),m=c.getRMTexture?.(),g=c.getRoughnessTexture?.(),y=c.getMetallicTexture?.(),v=c.getAmbientOcclusionTexture?.(),b=c.getEmissionTexture?.(),x=c.getNormalTexture?.();h?.getImageLoaded()?d(h)&&p.push("_ambientOcclusionMap = textureSample(ORMTexture, ORMTextureSampler, input.tcoordVS).rrra;","_roughnessMap = textureSample(ORMTexture, ORMTextureSampler, input.tcoordVS).ggga;","_metallicMap = textureSample(ORMTexture, ORMTextureSampler, input.tcoordVS).bbba;"):m?.getImageLoaded()?d(m)&&p.push("_roughnessMap = textureSample(RMTexture, RMTextureSampler, input.tcoordVS).ggga;","_metallicMap = textureSample(RMTexture, RMTextureSampler, input.tcoordVS).bbba;"):(g?.getImageLoaded()&&d(g)&&p.push("_roughnessMap = textureSample(RoughnessTexture, RoughnessTextureSampler, input.tcoordVS).ggga;"),y?.getImageLoaded()&&d(y)&&p.push("_metallicMap = textureSample(MetallicTexture, MetallicTextureSampler, input.tcoordVS).bbba;"),v?.getImageLoaded()&&d(v)&&p.push("_ambientOcclusionMap = textureSample(AmbientOcclusionTexture, AmbientOcclusionTextureSampler, input.tcoordVS).rrra;")),b?.getImageLoaded()&&d(b)&&p.push("_emissionMap = textureSample(EmissionTexture, EmissionTextureSampler, input.tcoordVS);"),x?.getImageLoaded()&&d(x)&&p.push("_normalMap = textureSample(NormalTexture, NormalTextureSampler, input.tcoordVS);"),s=Np.substitute(s,"//VTK::TCoord::Impl",p).result,l.setCode(s)},t.shaderReplacements.set("replaceShaderTCoord",e.replaceShaderTCoord),e.replaceShaderSelect=(e,t,r)=>{if(e.includes("sel")){const e=t.getShaderDescription("fragment");let r=e.getCode();r=Np.substitute(r,"//VTK::Select::Impl",[" var compositeID: u32 = 0u;"]).result,e.setCode(r)}},t.shaderReplacements.set("replaceShaderSelect",e.replaceShaderSelect),e.getUsage=(e,t)=>e===lh.POINTS||t===sh.Points?ah.Verts:t===sh.Lines?ah.Lines:e===lh.WIREFRAME?t===sh.Triangles?ah.LinesFromTriangles:ah.LinesFromStrips:t===sh.Triangles?ah.Triangles:t===sh.TriangleStrips?ah.Strips:t===sh.TriangleEdges?ah.LinesFromTriangles:ah.LinesFromStrips,e.getHashFromUsage=e=>`pt${e}`,e.getTopologyFromUsage=e=>{switch(e){case ah.Triangles:return"triangle-list";case ah.Verts:return"point-list";case ah.Lines:default:return"line-list"}},e.buildVertexInput=()=>{const r=t.currentInput,n=t.cellArray,o=t.primitiveType;let i=t.WebGPUActor.getRenderable().getProperty().getRepresentation();const a=t.WebGPURenderWindow.getDevice();let s=!1;o===sh.TriangleEdges&&(s=!0,i=lh.WIREFRAME);const l=t.vertexInput,u=r.getPoints();let c=null;if(n?(c=a.getBufferManager().getBuffer({hash:`R${i}P${o}${n.getMTime()}`,usage:ah.Index,cells:n,numberOfPoints:u.getNumberOfPoints(),primitiveType:o,representation:i}),l.setIndexBuffer(c)):l.setIndexBuffer(null),u){const e=t.WebGPUActor.getBufferShift(t.WebGPURenderer);l.addBuffer(a.getBufferManager().getBuffer({hash:`${u.getMTime()}I${c?.getMTime?.()??0}${e.join()}float32x4`,usage:ah.PointArray,format:"float32x4",dataArray:u,indexBuffer:c,shift:e,packExtra:!0}),["vertexBC"])}else l.removeBufferIfPresent("vertexBC");const d=e.getUsage(i,o);if(t._usesCellNormals=!1,t.is2D||d!==ah.Triangles&&d!==ah.Strips)l.removeBufferIfPresent("normalMC");else{const e=r.getPointData().getNormals(),i={format:"snorm8x4",indexBuffer:c,packExtra:!0,shift:0,scale:127};e?(i.hash=`${e.getMTime()}I${c.getMTime()}snorm8x4`,i.dataArray=e,i.usage=ah.PointArray,l.addBuffer(a.getBufferManager().getBuffer(i),["normalMC"])):o===sh.Triangles?(t._usesCellNormals=!0,i.hash=`PFN${u.getMTime()}I${c.getMTime()}snorm8x4`,i.dataArray=u,i.cells=n,i.usage=ah.NormalsFromPoints,l.addBuffer(a.getBufferManager().getBuffer(i),["normalMC"])):l.removeBufferIfPresent("normalMC")}let p=!1;if(t.renderable.getScalarVisibility()){const e=t.renderable.getColorMapColors();if(e&&!s){const n=t.renderable.getScalarMode(),o=(n===uh.USE_CELL_DATA||n===uh.USE_CELL_FIELD_DATA||n===uh.USE_FIELD_DATA||!r.getPointData().getScalars())&&n!==uh.USE_POINT_FIELD_DATA&&e;l.addBuffer(a.getBufferManager().getBuffer({usage:ah.PointArray,format:"unorm8x4",hash:`${o}${e.getMTime()}I${c.getMTime()}unorm8x4`,dataArray:e,indexBuffer:c,cellData:o,cellOffset:0}),["colorVI"]),p=!0}}p||l.removeBufferIfPresent("colorVI");let f=null;f=t.renderable.getInterpolateScalarsBeforeMapping?.()&&t.renderable.getColorCoordinates()?t.renderable.getColorCoordinates():r.getPointData().getTCoords(),f&&!s?l.addBuffer(a.getBufferManager().getBufferForPointArray(f,l.getIndexBuffer()),["tcoord"]):l.removeBufferIfPresent("tcoord")},e.updateTextures=()=>{const e=[],r=[],n=t.renderable.getColorTextureMap?.();n&&!t.colorTexture&&(t.colorTexture=vc.newInstance({label:"polyDataColor"})),n&&(t.colorTexture.setInputData(n),r.push(["DiffuseTexture",t.colorTexture]));const o=t.WebGPUActor.getRenderable(),i=t.WebGPURenderer.getRenderable();[["DiffuseTexture",o.getProperty().getDiffuseTexture?.()],["DiffuseTexture",o.getTextures()[0]],["DiffuseTexture",t.colorTexture],["ORMTexture",o.getProperty().getORMTexture?.()],["RMTexture",o.getProperty().getRMTexture?.()],["RoughnessTexture",o.getProperty().getRoughnessTexture?.()],["MetallicTexture",o.getProperty().getMetallicTexture?.()],["NormalTexture",o.getProperty().getNormalTexture?.()],["AmbientOcclusionTexture",o.getProperty().getAmbientOcclusionTexture?.()],["EmissionTexture",o.getProperty().getEmissionTexture?.()],["EnvironmentTexture",i.getEnvironmentTexture?.()]].forEach(e=>{let[t,n]=e;n&&((n.getInputData()||n.getJsImageData()||n.getCanvas()||n.getImageBitmap())&&r.push([t,n]),n.getImage()&&n.getImageLoaded()&&r.push([t,n]))}),r.forEach(r=>{let[n,o]=r;const i=t.device.getTextureManager().getTextureForVTKTexture(o,n);if(!i.getReady())return;let a=!1;for(let r=0;r<t.textures.length;++r)if(t.textures[r]===i){a=!0,e[r]=!0;break}if(!a){e[t.textures.length]=!0;const r=i.createView(n);t.textures.push(i),t.textureViews.push(r);const a=o.getInterpolate()?"linear":"nearest";let s=null;o.getEdgeClamp()&&o.getRepeat()?s="mirror-repeat":o.getEdgeClamp()?s="clamp-to-edge":o.getRepeat()&&(s="repeat");let l={addressModeU:s,addressModeV:s,addressModeW:s,minFilter:a,magFilter:a};"EnvironmentTexture"===n&&(l={addressModeU:"repeat",addressModeV:"clamp-to-edge",addressModeW:"repeat",minFilter:a,magFilter:a,mipmapFilter:"linear"}),r.addSampler(t.device,l)}});for(let r=t.textures.length-1;r>=0;r--)e[r]||(t.textures.splice(r,1),t.textureViews.splice(r,1))},e.computePipelineHash=()=>{let r=`pd${t.useRendererMatrix?"r":""}${t.forceZValue?"z":""}`;if(t.primitiveType===sh.TriangleEdges||t.primitiveType===sh.TriangleStripEdges)r+="edge";else{if(t.vertexInput.hasAttribute("normalMC")&&(r+="n"),t.vertexInput.hasAttribute("colorVI")&&(r+="c"),t.vertexInput.hasAttribute("tcoord")){const e=t.vertexInput.getBuffer("tcoord");r+=`t${zp(e.getArrayInformation()[0].format)}`}t.textures.length&&(r+=`tx${t.textures.length}`)}t._usesCellNormals&&(r+="cn"),t.SSBO&&(r+="ssbo"),r+=e.getHashFromUsage(t.usage),r+=t.renderEncoder.getPipelineHash(),t.pipelineHash=r},e.updateBuffers=()=>{t.primitiveType!==sh.TriangleEdges&&t.primitiveType!==sh.TriangleStripEdges&&e.updateTextures();const r=t.WebGPUActor.getRenderable(),n=r.getProperty().getRepresentation();t.usage=e.getUsage(n,t.primitiveType),e.buildVertexInput();const o=t.vertexInput.getBuffer("vertexBC");if(e.setNumberOfVertices(o.getSizeInBytes()/o.getStrideInBytes()),e.setTopology(e.getTopologyFromUsage(t.usage)),e.updateUBO(),e.haveWideLines()){const t=r.getProperty();e.setNumberOfInstances(Math.ceil(2*t.getLineWidth()))}else e.setNumberOfInstances(1)}}(e,t)}var mh={newInstance:Pt(hh,"vtkWebGPUCellArrayMapper"),extend:hh};const{PrimitiveTypes:gh}=If,yh={primitives:null};const vh=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,yh,r),Xt.extend(e,t,r),t.primitives=[],function(e,t){t.classHierarchy.push("vtkWebGPUPolyDataMapper"),e.createCellArrayMapper=()=>mh.newInstance(),e.buildPass=r=>{if(r){t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor"),t.renderable.getStatic()||t.renderable.update();const r=t.renderable.getInputData();t.renderable.mapScalars(r,1),e.updateCellArrayMappers(r)}},e.updateCellArrayMappers=r=>{if(!r)return void Ze("No input!");const n=[r.getVerts(),r.getLines(),r.getPolys(),r.getStrips()],o=[];let i=0;for(let a=gh.Points;a<=gh.TriangleStrips;a++)if(n[a].getNumberOfValues()>0){t.primitives[a]||(t.primitives[a]=e.createCellArrayMapper());const s=t.primitives[a];s.setCellArray(n[a]),s.setCurrentInput(r),s.setCellOffset(i),s.setPrimitiveType(a),s.setRenderable(t.renderable),i+=n[a].getNumberOfCells(),o.push(s)}else t.primitives[a]=null;if(t.WebGPUActor.getRenderable().getProperty().getEdgeVisibility()){if(n[gh.Triangles].getNumberOfValues()>0){const i=gh.TriangleEdges;t.primitives[i]||(t.primitives[i]=e.createCellArrayMapper());const a=t.primitives[i];a.setCellArray(n[gh.Triangles]),a.setCurrentInput(r),a.setCellOffset(t.primitives[gh.Triangles].getCellOffset()),a.setPrimitiveType(i),a.setRenderable(t.renderable),o.push(a)}else t.primitives[gh.TriangleEdges]=null;if(n[gh.TriangleStrips].getNumberOfValues()>0){const i=gh.TriangleStripEdges;t.primitives[i]||(t.primitives[i]=e.createCellArrayMapper());const a=t.primitives[i];a.setCellArray(n[gh.TriangleStrips]),a.setCurrentInput(r),a.setCellOffset(t.primitives[gh.TriangleStrips].getCellOffset()),a.setPrimitiveType(i),a.setRenderable(t.renderable),o.push(a)}else t.primitives[gh.TriangleStripEdges]=null}e.prepareNodes(),e.addMissingChildren(o),e.removeUnusedNodes()}}(e,t)},"vtkWebGPUPolyDataMapper");vp("vtkMapper",vh);const{PrimitiveTypes:bh}=If;const xh=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,function(e){return{primitives:[],...e}}(r)),Xt.extend(e,t,r),t.primitives=[],function(e,t){t.classHierarchy.push("vtkWebGPUPolyDataMapper2D"),e.createCellArrayMapper=()=>mh.newInstance(),e.buildPass=r=>{if(r){t.WebGPUActor=e.getFirstAncestorOfType("vtkWebGPUActor2D"),t.renderable.getStatic()||t.renderable.update();const r=t.renderable.getInputData();t.renderable.mapScalars(r,1),e.updateCellArrayMappers(r)}},e.updateCellArrayMappers=r=>{const n=[r.getVerts(),r.getLines(),r.getPolys(),r.getStrips()],o=[];let i=0;for(let a=bh.Points;a<=bh.Triangles;a++)if(n[a].getNumberOfValues()>0){t.primitives[a]||(t.primitives[a]=e.createCellArrayMapper());const s=t.primitives[a];s.setCellArray(n[a]),s.setCurrentInput(r),s.setCellOffset(i),s.setPrimitiveType(a),s.setRenderable(t.renderable),s.setIs2D(!0),i+=n[a].getNumberOfCells(),o.push(s)}else t.primitives[a]=null;e.prepareNodes(),e.addMissingChildren(o),e.removeUnusedNodes()}}(e,t)},"vtkWebGPUPolyDataMapper2D");vp("vtkMapper2D",xh);const _h={};const Sh=Pt(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,_h,r),Xt.extend(e,t,r),t.scalarBarActorHelper=lp.newScalarBarActorHelper(),function(e,t){t.classHierarchy.push("vtkWebGPUScalarBarActor"),e.buildPass=r=>{r&&(t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent(),t.scalarBarActorHelper.getRenderable()||t.scalarBarActorHelper.setRenderable(t.renderable),e.prepareNodes(),e.addMissingNode(t.scalarBarActorHelper.getBarActor()),e.addMissingNode(t.scalarBarActorHelper.getTmActor()),e.removeUnusedNodes())},e.opaquePass=(e,r)=>{if(e){const e=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,r=t.WebGPURenderer.getTiledSizeAndOrigin();t.scalarBarActorHelper.updateAPISpecificData([r.usize,r.vsize],e,t.WebGPURenderWindow.getRenderable())}}}(e,t)},"vtkWebGPUScalarBarActor");vp("vtkScalarBarActor",Sh);const Ch={device:null,handle:null,label:null,options:null};function Th(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ch,r),zt.obj(e,t),t.options={},t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,sampler:{}},t.bindGroupTime={},zt.obj(t.bindGroupTime,{mtime:0}),zt.get(e,t,["bindGroupTime","handle","options"]),zt.setGet(e,t,["bindGroupLayoutEntry","device","label"]),function(e,t){t.classHierarchy.push("vtkWebGPUSampler"),e.create=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.device=e,t.options.addressModeU=r.addressModeU?r.addressModeU:"clamp-to-edge",t.options.addressModeV=r.addressModeV?r.addressModeV:"clamp-to-edge",t.options.addressModeW=r.addressModeW?r.addressModeW:"clamp-to-edge",t.options.magFilter=r.magFilter?r.magFilter:"nearest",t.options.minFilter=r.minFilter?r.minFilter:"nearest",t.options.mipmapFilter=r.mipmapFilter?r.mipmapFilter:"nearest",t.options.label=t.label,t.handle=t.device.getHandle().createSampler(t.options),t.bindGroupTime.modified()},e.getShaderCode=(e,r)=>`@binding(${e}) @group(${r}) var ${t.label}: sampler;`,e.getBindGroupEntry=()=>({resource:t.handle})}(e,t)}var wh={newInstance:zt.newInstance(Th),extend:Th};const Ah={texture:null,handle:null,sampler:null,label:null};function Eh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ah,r),zt.obj(e,t),t.bindGroupLayoutEntry={visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d"}},t.bindGroupTime={},zt.obj(t.bindGroupTime,{mtime:0}),zt.get(e,t,["bindGroupTime","texture"]),zt.setGet(e,t,["bindGroupLayoutEntry","label","sampler"]),function(e,t){t.classHierarchy.push("vtkWebGPUTextureView"),e.create=(e,r)=>{t.texture=e,t.options=r,t.options.dimension=t.options.dimension||"2d",t.options.label=t.label,t.textureHandle=e.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupLayoutEntry.texture.viewDimension=t.options.dimension;const n=Vp(t.texture.getFormat());t.bindGroupLayoutEntry.texture.sampleType=n.sampleType},e.createFromTextureHandle=(e,r)=>{t.texture=null,t.options=r,t.options.dimension=t.options.dimension||"2d",t.options.label=t.label,t.textureHandle=e,t.handle=t.textureHandle.createView(t.options),t.bindGroupLayoutEntry.texture.viewDimension=t.options.dimension;const n=Vp(r.format);t.bindGroupLayoutEntry.texture.sampleType=n.sampleType,t.bindGroupTime.modified()},e.getBindGroupEntry=()=>({resource:e.getHandle()}),e.getShaderCode=(e,r)=>{let n="f32";"sint"===t.bindGroupLayoutEntry.texture.sampleType?n="i32":"uint"===t.bindGroupLayoutEntry.texture.sampleType&&(n="u32");let o=`@binding(${e}) @group(${r}) var ${t.label}: texture_${t.options.dimension}<${n}>;`;return"depth"===t.bindGroupLayoutEntry.texture.sampleType&&(o=`@binding(${e}) @group(${r}) var ${t.label}: texture_depth_${t.options.dimension};`),o},e.addSampler=(r,n)=>{const o=wh.newInstance({label:`${t.label}Sampler`});o.create(r,n),e.setSampler(o)},e.getBindGroupTime=()=>(t.texture&&t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.bindGroupTime),e.getHandle=()=>(t.texture&&t.texture.getHandle()!==t.textureHandle&&(t.textureHandle=t.texture.getHandle(),t.handle=t.textureHandle.createView(t.options),t.bindGroupTime.modified()),t.handle)}(e,t)}var Dh={newInstance:zt.newInstance(Eh),extend:Eh};const Ph={device:null,handle:null,buffer:null,ready:!1,label:null};function Ih(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ph,r),zt.obj(e,t),zt.get(e,t,["handle","ready","width","height","depth","format","usage"]),zt.setGet(e,t,["device","label"]),function(e,t){t.classHierarchy.push("vtkWebGPUTexture"),e.create=(e,r)=>{t.device=e,t.width=r.width,t.height=r.height,t.depth=r.depth?r.depth:1;const n=1===t.depth?"2d":"3d";t.format=r.format?r.format:"rgba8unorm",t.mipLevel=r.mipLevel?r.mipLevel:0,t.usage=r.usage?r.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label,dimension:n,mipLevelCount:t.mipLevel+1})},e.assignFromHandle=(e,r,n)=>{t.device=e,t.handle=r,t.width=n.width,t.height=n.height,t.depth=n.depth?n.depth:1,t.format=n.format?n.format:"rgba8unorm",t.usage=n.usage?n.usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST},e.writeImageData=r=>{let n=[];const o=n=>{t.device.getHandle().queue.copyExternalImageToTexture({source:n,flipY:r.flip},{texture:t.handle,premultipliedAlpha:!0,mipLevel:0,origin:{x:0,y:0,z:0}},[n.width,n.height,t.depth]),3!==e.getDimensionality()&&t.mipLevel>0&&vc.generateMipmaps(t.device.getHandle(),t.handle,t.mipLevel+1),t.ready=!0};if(r.canvas)return void o(r.canvas);if(r.imageBitmap)return r.width=r.imageBitmap.width,r.height=r.imageBitmap.height,r.depth=1,r.format="rgba8unorm",r.flip=!0,void o(r.imageBitmap);if(r.jsImageData)return r.width=r.jsImageData.width,r.height=r.jsImageData.height,r.depth=1,r.format="rgba8unorm",r.flip=!0,void o(r.jsImageData);if(r.image)return r.width=r.image.width,r.height=r.image.height,r.depth=1,r.format="rgba8unorm",r.flip=!0,void o(r.image);const i=Vp(t.format);let a=t.width*i.stride;r.nativeArray&&(n=r.nativeArray);const s=3===e.getDimensionality(),l=((e,t,r)=>{const n=2===i.elementSize&&"float"===i.sampleType,o=e.BYTES_PER_ELEMENT,a=e.length/(t*r)*o;if(!n&&a%256==0)return[e,a];const s=a/o,l=i.elementSize,u=256*Math.floor((s*l+255)/256),c=u/l,d=zt.newTypedArray(n?"Uint16Array":e.constructor.name,c*t*r),p=t*r;if(n)for(let t=0;t<p;t++){const r=t*s,n=t*c;for(let t=0;t<s;t++)d[n+t]=hd.toHalf(e[r+t])}else if(c===s)d.set(e);else for(let t=0;t<p;t++)d.set(e.subarray(t*s,(t+1)*s),t*c);return[d,u]})(n,t.height,s?t.depth:1);a=l[1];const u=l[0];t.device.getHandle().queue.writeTexture({texture:t.handle,mipLevel:0,origin:{x:0,y:0,z:0}},u,{offset:0,bytesPerRow:a,rowsPerImage:t.height},{width:t.width,height:t.height,depthOrArrayLayers:s?t.depth:1}),!s&&t.mipLevel>0&&vc.generateMipmaps(t.device.getHandle(),t.handle,t.mipLevel+1),t.ready=!0},e.getScale=()=>{const e=Vp(t.format);return 2===e.elementSize&&"float"===e.sampleType?1:255},e.getNumberOfComponents=()=>Vp(t.format).numComponents,e.getDimensionality=()=>{let e=0;return t.width>1&&e++,t.height>1&&e++,t.depth>1&&e++,e},e.resizeToMatch=e=>{e.getWidth()===t.width&&e.getHeight()===t.height&&e.getDepth()===t.depth||(t.width=e.getWidth(),t.height=e.getHeight(),t.depth=e.getDepth(),t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label}))},e.resize=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;e===t.width&&r===t.height&&n===t.depth||(t.width=e,t.height=r,t.depth=n,t.handle=t.device.getHandle().createTexture({size:[t.width,t.height,t.depth],format:t.format,usage:t.usage,label:t.label}))},e.createView=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.dimension||(n.dimension=1===t.depth?"2d":"3d");const o=Dh.newInstance({label:r});return o.create(e,n),o}}(e,t)}var Oh={newInstance:zt.newInstance(Ih),extend:Ih};const Nh={};const Mh=zt.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Nh,r),Xt.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkWebGPUPixelSpaceCallbackMapper"),e.opaquePass=(r,n)=>{t.WebGPURenderer=e.getFirstAncestorOfType("vtkWebGPURenderer"),t.WebGPURenderWindow=t.WebGPURenderer.getParent();const o=t.WebGPURenderer.getAspectRatio(),i=t.WebGPURenderer?t.WebGPURenderer.getRenderable().getActiveCamera():null,a=t.WebGPURenderer.getTiledSizeAndOrigin();t.renderable.getUseZValues(),t.renderable.invokeCallback(t.renderable.getInputData(),i,o,a,null)}}(e,t)},"vtkWebGPUPixelSpaceCallbackMapper");vp("vtkPixelSpaceCallbackMapper",Mh);const{vtkDebugMacro:Rh}=zt,Fh={position:[0,0,1],focalPoint:[0,0,0],viewUp:[0,1,0],directionOfProjection:[0,0,-1],parallelProjection:!1,useHorizontalViewAngle:!1,viewAngle:30,parallelScale:1,clippingRange:[.01,1000.01],windowCenter:[0,0],viewPlaneNormal:[0,0,1],useOffAxisProjection:!1,screenBottomLeft:[-.5,-.5,-.5],screenBottomRight:[.5,-.5,-.5],screenTopRight:[.5,.5,-.5],freezeFocalPoint:!1,projectionMatrix:null,viewMatrix:null,modelTransformMatrix:null,cameraLightTransform:u(),physicalTranslation:[0,0,0],physicalScale:1,physicalViewUp:[0,1,0],physicalViewNorth:[0,0,-1]};function Bh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Fh,r),zt.obj(e,t),zt.get(e,t,["distance"]),zt.setGet(e,t,["parallelProjection","useHorizontalViewAngle","viewAngle","parallelScale","useOffAxisProjection","freezeFocalPoint","physicalScale"]),zt.getArray(e,t,["directionOfProjection","viewPlaneNormal","position","focalPoint"]),zt.setGetArray(e,t,["clippingRange","windowCenter"],2),zt.setGetArray(e,t,["viewUp","screenBottomLeft","screenBottomRight","screenTopRight","physicalTranslation","physicalViewUp","physicalViewNorth"],3),function(e,t){t.classHierarchy.push("vtkCamera");const r=new Float64Array(3),n=new Float64Array([0,0,-1]),o=new Float64Array([0,1,0]),i=h(new Float64Array(16)),a=h(new Float64Array(16)),s=new Float64Array(3),l=new Float64Array(3),u=new Float64Array(3),c=h(new Float64Array(16)),p=h(new Float64Array(16)),f=new Float64Array(3),y=new Float64Array(3);function v(){t.viewPlaneNormal[0]=-t.directionOfProjection[0],t.viewPlaneNormal[1]=-t.directionOfProjection[1],t.viewPlaneNormal[2]=-t.directionOfProjection[2]}e.orthogonalizeViewUp=()=>{const r=e.getViewMatrix();t.viewUp[0]=r[4],t.viewUp[1]=r[5],t.viewUp[2]=r[6],e.modified()},e.setPosition=(r,n,o)=>{r===t.position[0]&&n===t.position[1]&&o===t.position[2]||(t.position[0]=r,t.position[1]=n,t.position[2]=o,e.computeDistance(),e.modified())},e.setFocalPoint=(r,n,o)=>{r===t.focalPoint[0]&&n===t.focalPoint[1]&&o===t.focalPoint[2]||(t.focalPoint[0]=r,t.focalPoint[1]=n,t.focalPoint[2]=o,e.computeDistance(),e.modified())},e.setDistance=r=>{if(t.distance===r)return;t.distance=r,t.distance<1e-20&&(t.distance=1e-20,Rh("Distance is set to minimum."));const n=t.directionOfProjection;t.focalPoint[0]=t.position[0]+n[0]*t.distance,t.focalPoint[1]=t.position[1]+n[1]*t.distance,t.focalPoint[2]=t.position[2]+n[2]*t.distance,e.modified()},e.computeDistance=()=>{const e=t.focalPoint[0]-t.position[0],r=t.focalPoint[1]-t.position[1],n=t.focalPoint[2]-t.position[2];if(t.distance=Math.sqrt(e*e+r*r+n*n),t.distance<1e-20){t.distance=1e-20,Rh("Distance is set to minimum.");const e=t.directionOfProjection;t.focalPoint[0]=t.position[0]+e[0]*t.distance,t.focalPoint[1]=t.position[1]+e[1]*t.distance,t.focalPoint[2]=t.position[2]+e[2]*t.distance}t.directionOfProjection[0]=e/t.distance,t.directionOfProjection[1]=r/t.distance,t.directionOfProjection[2]=n/t.distance,v()},e.dolly=r=>{if(r<=0)return;const n=t.distance/r;e.setPosition(t.focalPoint[0]-n*t.directionOfProjection[0],t.focalPoint[1]-n*t.directionOfProjection[1],t.focalPoint[2]-n*t.directionOfProjection[2])},e.roll=r=>{const n=t.position,o=t.focalPoint,i=t.viewUp,a=new Float64Array([i[0],i[1],i[2],0]);h(c);const s=new Float64Array([o[0]-n[0],o[1]-n[1],o[2]-n[2]]);S(c,c,yo(r),s),Ni(a,a,c),t.viewUp[0]=a[0],t.viewUp[1]=a[1],t.viewUp[2]=a[2],e.modified()},e.azimuth=r=>{const n=t.focalPoint;h(p),x(p,p,n),S(p,p,yo(r),t.viewUp),x(p,p,[-n[0],-n[1],-n[2]]),Sr(f,t.position,p),e.setPosition(f[0],f[1],f[2])},e.yaw=r=>{const n=t.position;h(p),x(p,p,n),S(p,p,yo(r),t.viewUp),x(p,p,[-n[0],-n[1],-n[2]]),Sr(y,t.focalPoint,p),e.setFocalPoint(y[0],y[1],y[2])},e.elevation=r=>{const n=t.focalPoint,o=e.getViewMatrix(),i=[-o[0],-o[1],-o[2]];h(p),x(p,p,n),S(p,p,yo(r),i),x(p,p,[-n[0],-n[1],-n[2]]),Sr(f,t.position,p),e.setPosition(f[0],f[1],f[2])},e.pitch=r=>{const n=t.position,o=e.getViewMatrix(),i=[o[0],o[1],o[2]];h(p),x(p,p,n),S(p,p,yo(r),i),x(p,p,[-n[0],-n[1],-n[2]]),Sr(y,t.focalPoint,p),e.setFocalPoint(...y)},e.zoom=r=>{r<=0||(t.parallelProjection?t.parallelScale/=r:t.viewAngle/=r,e.modified())},e.translate=(r,n,o)=>{const i=[r,n,o];Po(t.position,i,t.position),Po(t.focalPoint,i,t.focalPoint),e.computeDistance(),e.modified()},e.applyTransform=r=>{const n=[...t.viewUp,1],o=[],i=[],a=[];n[0]+=t.position[0],n[1]+=t.position[1],n[2]+=t.position[2],Ni(o,[...t.position,1],r),Ni(i,[...t.focalPoint,1],r),Ni(a,n,r),a[0]-=o[0],a[1]-=o[1],a[2]-=o[2],e.setPosition(...o.slice(0,3)),e.setFocalPoint(...i.slice(0,3)),e.setViewUp(...a.slice(0,3))},e.getThickness=()=>t.clippingRange[1]-t.clippingRange[0],e.setThickness=r=>{let n=r;n<1e-20&&(n=1e-20,Rh("Thickness is set to minimum.")),e.setClippingRange(t.clippingRange[0],t.clippingRange[0]+n)},e.setThicknessFromFocalPoint=r=>{let n=r;n<1e-20&&(n=1e-20,Rh("Thickness is set to minimum.")),e.setClippingRange(t.distance-n/2,t.distance+n/2)},e.setRoll=e=>{},e.getRoll=()=>{},e.setObliqueAngles=(e,t)=>{},e.getOrientation=()=>{},e.getOrientationWXYZ=()=>{},e.getFrustumPlanes=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Float64Array(24);const n=[[1,0,0,1],[-1,0,0,1],[0,1,0,1],[0,-1,0,1],[0,0,1,1],[0,0,-1,1]],o=e.getCompositeProjectionMatrix(t,-1,1);for(let e=0;e<6;e++)Ni(n[e],n[e],o),ko(n[e]),r[4*e+0]=n[e][0],r[4*e+1]=n[e][1],r[4*e+2]=n[e][2],r[4*e+3]=n[e][3];return r},e.getCameraLightTransformMatrix=e=>(d(e,t.cameraLightTransform),e),e.computeCameraLightTransform=()=>{d(i,e.getViewMatrix()),g(i,i),E(a,[t.distance,t.distance,t.distance]),b(i,i,a),h(t.cameraLightTransform),x(t.cameraLightTransform,i,[0,0,-1])},e.deepCopy=e=>{},e.physicalOrientationToWorldDirection=e=>{const t=ki(e[0],e[1],e[2],e[3]),r=Mi(),n=ki(0,0,1,0);var o,i;return i=t,(o=r)[0]=-i[0],o[1]=-i[1],o[2]=-i[2],o[3]=i[3],Bi(n,t,n),Bi(n,n,r),[n[0],n[1],n[2]]},e.getPhysicalToWorldMatrix=t=>{e.getWorldToPhysicalMatrix(t),g(t,t)},e.getWorldToPhysicalMatrix=e=>{h(e);const r=[3];Fo(t.physicalViewNorth,t.physicalViewUp,r),e[0]=r[0],e[1]=r[1],e[2]=r[2],e[4]=t.physicalViewUp[0],e[5]=t.physicalViewUp[1],e[6]=t.physicalViewUp[2],e[8]=-t.physicalViewNorth[0],e[9]=-t.physicalViewNorth[1],e[10]=-t.physicalViewNorth[2],m(e,e),mr(s,1/t.physicalScale,1/t.physicalScale,1/t.physicalScale),_(e,e,s),x(e,e,t.physicalTranslation)},e.computeViewParametersFromViewMatrix=a=>{g(i,a),Sr(s,r,i),e.computeDistance();const c=t.distance;e.setPosition(s[0],s[1],s[2]),Sr(l,n,i),yr(l,l,s),br(l,l),e.setDirectionOfProjection(l[0],l[1],l[2]),Sr(u,o,i),yr(u,u,s),br(u,u),e.setViewUp(u[0],u[1],u[2]),e.setDistance(c)},e.computeViewParametersFromPhysicalMatrix=t=>{e.getWorldToPhysicalMatrix(i),b(i,t,i),e.computeViewParametersFromViewMatrix(i)},e.setModelTransformMatrix=e=>{t.modelTransformMatrix=e},e.getModelTransformMatrix=()=>t.modelTransformMatrix,e.setViewMatrix=r=>{t.viewMatrix=r,t.viewMatrix&&(d(i,t.viewMatrix),e.computeViewParametersFromViewMatrix(i),m(t.viewMatrix,t.viewMatrix))},e.getViewMatrix=()=>{if(t.viewMatrix)return t.modelTransformMatrix?(b(i,t.viewMatrix,t.modelTransformMatrix),i):t.viewMatrix;$(i,t.position,t.focalPoint,t.viewUp),m(i,i);const e=new Float64Array(16);return t.modelTransformMatrix?b(e,i,t.modelTransformMatrix):d(e,i),e},e.setProjectionMatrix=e=>{t.projectionMatrix=e},e.getProjectionMatrix=(e,r,n)=>{const o=new Float64Array(16);if(h(o),t.projectionMatrix){const e=1/t.physicalScale;return mr(s,e,e,e),d(o,t.projectionMatrix),_(o,o,s),m(o,o),o}h(i);const a=t.clippingRange[1]-t.clippingRange[0],l=[t.clippingRange[0]+(r+1)*a/2,t.clippingRange[0]+(n+1)*a/2];if(t.parallelProjection){const r=t.parallelScale*e,n=t.parallelScale,o=(t.windowCenter[0]-1)*r,a=(t.windowCenter[0]+1)*r,s=(t.windowCenter[1]-1)*n,u=(t.windowCenter[1]+1)*n;K(i,o,a,s,u,l[0],l[1]),m(i,i)}else{if(t.useOffAxisProjection)throw new Error("Off-Axis projection is not supported at this time");{const r=Math.tan(yo(t.viewAngle)/2);let n,o;!0===t.useHorizontalViewAngle?(n=t.clippingRange[0]*r,o=t.clippingRange[0]*r/e):(n=t.clippingRange[0]*r*e,o=t.clippingRange[0]*r);const a=(t.windowCenter[0]-1)*n,s=(t.windowCenter[0]+1)*n,u=(t.windowCenter[1]-1)*o,c=(t.windowCenter[1]+1)*o,d=l[0],p=l[1];i[0]=2*d/(s-a),i[5]=2*d/(c-u),i[2]=(a+s)/(s-a),i[6]=(u+c)/(c-u),i[10]=-(d+p)/(p-d),i[14]=-1,i[11]=-2*d*p/(p-d),i[15]=0}}return d(o,i),o},e.getCompositeProjectionMatrix=(t,r,n)=>{const o=e.getViewMatrix(),i=e.getProjectionMatrix(t,r,n);return b(i,o,i),i},e.setDirectionOfProjection=(e,r,n)=>{if(t.directionOfProjection[0]===e&&t.directionOfProjection[1]===r&&t.directionOfProjection[2]===n)return;t.directionOfProjection[0]=e,t.directionOfProjection[1]=r,t.directionOfProjection[2]=n;const o=t.directionOfProjection;t.focalPoint[0]=t.position[0]+o[0]*t.distance,t.focalPoint[1]=t.position[1]+o[1]*t.distance,t.focalPoint[2]=t.position[2]+o[2]*t.distance,v()},e.setDeviceAngles=(r,n,o,i)=>{const a=[3];Fo(t.physicalViewNorth,t.physicalViewUp,a);const s=h(new Float64Array(16));S(s,s,yo(r),t.physicalViewUp),S(s,s,yo(n),a),S(s,s,yo(o),t.physicalViewNorth),S(s,s,yo(-i),t.physicalViewUp);const l=new Float64Array([-t.physicalViewUp[0],-t.physicalViewUp[1],-t.physicalViewUp[2]]),u=new Float64Array(t.physicalViewNorth);Sr(l,l,s),Sr(u,u,s),e.setDirectionOfProjection(l[0],l[1],l[2]),e.setViewUp(u[0],u[1],u[2]),e.modified()},e.setOrientationWXYZ=(t,r,n,o)=>{const i=h(new Float64Array(16));if(0!==t&&(0!==r||0!==n||0!==o)){const e=yo(t),a=Mi();Ri(a,[r,n,o],e),U(i,a)}const a=new Float64Array(3);Sr(a,[0,0,-1],i);const s=new Float64Array(3);Sr(s,[0,1,0],i),e.setDirectionOfProjection(...a),e.setViewUp(...s),e.modified()},e.computeClippingRange=e=>{let r=null,n=null;r=t.viewPlaneNormal,n=t.position;const o=-r[0],i=-r[1],a=-r[2],s=-(o*n[0]+i*n[1]+a*n[2]),l=[o*e[0]+i*e[2]+a*e[4]+s,1e-18];for(let t=0;t<2;t++)for(let r=0;r<2;r++)for(let n=0;n<2;n++){const u=o*e[n]+i*e[2+r]+a*e[4+t]+s;l[0]=u<l[0]?u:l[0],l[1]=u>l[1]?u:l[1]}return l}}(e,t)}var Lh={newInstance:zt.newInstance(Bh,"vtkCamera"),extend:Bh};const kh={switch:!0,intensity:1,color:[1,1,1],position:[0,0,1],focalPoint:[0,0,0],positional:!1,exponent:1,coneAngle:30,coneFalloff:5,attenuationValues:[1,0,0],transformMatrix:null,lightType:"SceneLight",shadowAttenuation:1,direction:[0,0,0],directionMTime:0};function Uh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,kh,r),zt.obj(e,t),zt.setGet(e,t,["intensity","switch","positional","exponent","coneAngle","coneFalloff","transformMatrix","lightType","shadowAttenuation","attenuationValues"]),zt.setGetArray(e,t,["color","position","focalPoint","attenuationValues"],3),function(e,t){t.classHierarchy.push("vtkLight");const r=new Float64Array(3);e.getTransformedPosition=()=>(t.transformMatrix?Sr(r,t.position,t.transformMatrix):mr(r,t.position[0],t.position[1],t.position[2]),r),e.getTransformedFocalPoint=()=>(t.transformMatrix?Sr(r,t.focalPoint,t.transformMatrix):mr(r,t.focalPoint[0],t.focalPoint[1],t.focalPoint[2]),r),e.getDirection=()=>(t.directionMTime<t.mtime&&(wr(t.direction,t.focalPoint,t.position),Lo(t.direction),t.directionMTime=t.mtime),t.direction),e.setDirection=e=>{const r=new Float64Array(3);wr(r,t.position,e),t.focalPoint=r},e.setDirectionAngle=(t,r)=>{const n=yo(t),o=yo(r);e.setPosition(Math.cos(n)*Math.sin(o),Math.sin(n),Math.cos(n)*Math.cos(o)),e.setFocalPoint(0,0,0),e.setPositional(0)},e.setLightTypeToHeadLight=()=>{e.setLightType("HeadLight")},e.setLightTypeToCameraLight=()=>{e.setLightType("CameraLight")},e.setLightTypeToSceneLight=()=>{e.setTransformMatrix(null),e.setLightType("SceneLight")},e.lightTypeIsHeadLight=()=>"HeadLight"===t.lightType,e.lightTypeIsSceneLight=()=>"SceneLight"===t.lightType,e.lightTypeIsCameraLight=()=>"CameraLight"===t.lightType}(e,t)}var Vh={newInstance:zt.newInstance(Uh,"vtkLight"),extend:Uh,LIGHT_TYPES:["HeadLight","CameraLight","SceneLight"]};const{vtkErrorMacro:Gh}=zt;const zh={background:[0,0,0],background2:[.2,.2,.2],gradientBackground:!1,viewport:[0,0,1,1],aspect:[1,1],pixelAspect:[1,1],props:[],actors2D:[]};function jh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zh,r),zt.obj(e,t),zt.event(e,t,"event"),zt.setGetArray(e,t,["viewport"],4),zt.setGetArray(e,t,["background","background2"],3),function(e,t){function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];t.push(e);const n=e.getNestedProps();if(n&&n.length)for(let e=0;e<n.length;e++)r(n[e],t);return t}t.classHierarchy.push("vtkViewport"),e.getViewProps=()=>t.props,e.hasViewProp=e=>t.props.includes(e),e.addViewProp=r=>{r&&!e.hasViewProp(r)&&t.props.push(r)},e.removeViewProp=e=>{const r=t.props.filter(t=>t!==e);t.props.length!==r.length&&(t.props=r)},e.removeAllViewProps=()=>{t.props=[]},e.getViewPropsWithNestedProps=()=>{let e=[];t.actors2D=[];for(let n=0;n<t.props.length;n++){const o=t.props[n].getActors2D();o&&(!Array.isArray(o)||o.length>0)?t.actors2D=t.actors2D.concat(o):r(t.props[n],e)}return t.actors2D.sort((e,t)=>e.getLayerNumber()-t.getLayerNumber()),e=e.concat(t.actors2D),e},e.addActor2D=e.addViewProp,e.removeActor2D=t=>{e.removeViewProp(t)},e.getActors2D=()=>(t.actors2D=[],t.props.forEach(e=>{t.actors2D=t.actors2D.concat(e.getActors2D())}),t.actors2D),e.displayToView=()=>Gh("call displayToView on your view instead"),e.viewToDisplay=()=>Gh("callviewtodisplay on your view instead"),e.getSize=()=>Gh("call getSize on your View instead"),e.normalizedDisplayToProjection=(t,r,n)=>{const o=e.normalizedDisplayToNormalizedViewport(t,r,n);return e.normalizedViewportToProjection(o[0],o[1],o[2])},e.normalizedDisplayToNormalizedViewport=(e,r,n)=>{const o=[t.viewport[2]-t.viewport[0],t.viewport[3]-t.viewport[1]];return[(e-t.viewport[0])/o[0],(r-t.viewport[1])/o[1],n]},e.normalizedViewportToProjection=(e,t,r)=>[2*e-1,2*t-1,2*r-1],e.projectionToNormalizedDisplay=(t,r,n)=>{const o=e.projectionToNormalizedViewport(t,r,n);return e.normalizedViewportToNormalizedDisplay(o[0],o[1],o[2])},e.normalizedViewportToNormalizedDisplay=(e,r,n)=>{const o=[t.viewport[2]-t.viewport[0],t.viewport[3]-t.viewport[1]];return[e*o[0]+t.viewport[0],r*o[1]+t.viewport[1],n]},e.projectionToNormalizedViewport=(e,t,r)=>[.5*(e+1),.5*(t+1),.5*(r+1)],e.PickPropFrom=()=>Gh("vtkViewport::PickPropFrom - NOT IMPLEMENTED")}(e,t)}var Wh={newInstance:zt.newInstance(jh,"vtkViewport"),extend:jh};const{vtkDebugMacro:Hh,vtkErrorMacro:Kh,vtkWarningMacro:Xh}=jt;function $h(e){return()=>Kh(`vtkRenderer::${e} - NOT IMPLEMENTED`)}const qh={pickedProp:null,activeCamera:null,allBounds:[],ambient:[1,1,1],allocatedRenderTime:100,timeFactor:1,automaticLightCreation:!0,twoSidedLighting:!0,lastRenderTimeInSeconds:-1,renderWindow:null,lights:[],actors:[],volumes:[],lightFollowCamera:!0,numberOfPropsRendered:0,propArray:null,pathArray:null,layer:0,preserveColorBuffer:!1,preserveDepthBuffer:!1,computeVisiblePropBounds:Ei(),interactive:!0,nearClippingPlaneTolerance:0,clippingRangeExpansion:.05,erase:!0,draw:!0,useShadows:!1,useDepthPeeling:!1,occlusionRatio:0,maximumNumberOfPeels:4,selector:null,delegate:null,texturedBackground:!1,backgroundTexture:null,environmentTexture:null,environmentTextureDiffuseStrength:1,environmentTextureSpecularStrength:1,useEnvironmentTextureAsBackground:!1,pass:0};function Yh(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(Object.assign(t,qh,r),Wh.extend(e,t,r),t.background||(t.background=[0,0,0,1]);t.background.length<3;)t.background.push(0);3===t.background.length&&t.background.push(1),yt(e,t,["_renderWindow","allocatedRenderTime","timeFactor","lastRenderTimeInSeconds","numberOfPropsRendered","lastRenderingUsedDepthPeeling","selector"]),_t(e,t,["twoSidedLighting","lightFollowCamera","automaticLightCreation","erase","draw","nearClippingPlaneTolerance","clippingRangeExpansion","backingStore","interactive","layer","preserveColorBuffer","preserveDepthBuffer","useDepthPeeling","occlusionRatio","maximumNumberOfPeels","delegate","backgroundTexture","texturedBackground","environmentTexture","environmentTextureDiffuseStrength","environmentTextureSpecularStrength","useEnvironmentTextureAsBackground","useShadows","pass"]),St(e,t,["actors","volumes","lights"]),Tt(e,t,["background"],4,1),wt(0,t,["renderWindow"]),function(e,t){t.classHierarchy.push("vtkRenderer");const r={type:"ComputeVisiblePropBoundsEvent",renderer:e},n={type:"ResetCameraClippingRangeEvent",renderer:e},o={type:"ResetCameraEvent",renderer:e};e.updateCamera=()=>(t.activeCamera||(Hh("No cameras are on, creating one."),e.getActiveCameraAndResetIfCreated()),t.activeCamera.render(e),!0),e.updateLightsGeometryToFollowCamera=()=>{const r=e.getActiveCameraAndResetIfCreated();t.lights.forEach(e=>{e.lightTypeIsSceneLight()||(e.lightTypeIsHeadLight()?(e.setPositionFrom(r.getPositionByReference()),e.setFocalPointFrom(r.getFocalPointByReference()),e.modified(r.getMTime())):e.lightTypeIsCameraLight()?e.setTransformMatrix(r.getCameraLightTransformMatrix(u())):Kh("light has unknown light type",e.get()))})},e.updateLightGeometry=()=>!t.lightFollowCamera||e.updateLightsGeometryToFollowCamera(),e.allocateTime=$h("allocateTime"),e.updateGeometry=$h("updateGeometry"),e.getVTKWindow=()=>t._renderWindow,e.setLayer=r=>{Hh(e.getClassName(),e,"setting Layer to ",r),t.layer!==r&&(t.layer=r,e.modified()),e.setPreserveColorBuffer(!!r)},e.setActiveCamera=r=>t.activeCamera!==r&&(t.activeCamera=r,e.modified(),e.invokeEvent({type:"ActiveCameraEvent",camera:r}),!0),e.makeCamera=()=>{const t=Lh.newInstance();return e.invokeEvent({type:"CreateCameraEvent",camera:t}),t},e.getActiveCamera=()=>(t.activeCamera||(t.activeCamera=e.makeCamera()),t.activeCamera),e.getActiveCameraAndResetIfCreated=()=>(t.activeCamera||(e.getActiveCamera(),e.resetCamera()),t.activeCamera),e.getActors=()=>(t.actors=[],t.props.forEach(e=>{t.actors=t.actors.concat(e.getActors())}),t.actors),e.addActor=e.addViewProp,e.removeActor=r=>{t.actors=t.actors.filter(e=>e!==r),e.removeViewProp(r),e.modified()},e.removeAllActors=()=>{e.getActors().forEach(t=>{e.removeViewProp(t)}),t.actors=[],e.modified()},e.getVolumes=()=>(t.volumes=[],t.props.forEach(e=>{t.volumes=t.volumes.concat(e.getVolumes())}),t.volumes),e.addVolume=e.addViewProp,e.removeVolume=r=>{t.volumes=t.volumes.filter(e=>e!==r),e.removeViewProp(r),e.modified()},e.removeAllVolumes=()=>{e.getVolumes().forEach(t=>{e.removeViewProp(t)}),t.volumes=[],e.modified()},e.hasLight=e=>t.lights.includes(e),e.addLight=r=>{r&&!e.hasLight(r)&&(t.lights.push(r),e.modified())},e.removeLight=r=>{t.lights=t.lights.filter(e=>e!==r),e.modified()},e.removeAllLights=()=>{t.lights=[],e.modified()},e.setLightCollection=r=>{t.lights=r,e.modified()},e.makeLight=Vh.newInstance,e.createLight=()=>{t.automaticLightCreation&&(t._createdLight&&(e.removeLight(t._createdLight),t._createdLight.delete(),t._createdLight=null),t._createdLight=e.makeLight(),e.addLight(t._createdLight),t._createdLight.setLightTypeToHeadLight(),t._createdLight.setPosition(e.getActiveCamera().getPosition()),t._createdLight.setFocalPoint(e.getActiveCamera().getFocalPoint()))},e.normalizedDisplayToWorld=(t,r,n,o)=>{let i=e.normalizedDisplayToProjection(t,r,n);return i=e.projectionToView(i[0],i[1],i[2],o),e.viewToWorld(i[0],i[1],i[2])},e.worldToNormalizedDisplay=(t,r,n,o)=>{let i=e.worldToView(t,r,n);return i=e.viewToProjection(i[0],i[1],i[2],o),e.projectionToNormalizedDisplay(i[0],i[1],i[2])},e.viewToWorld=(e,r,n)=>{if(null===t.activeCamera)return Kh("ViewToWorld: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];const o=t.activeCamera.getViewMatrix();g(o,o),m(o,o);const i=new Float64Array([e,r,n]);return Sr(i,i,o),i},e.projectionToView=(e,r,n,o)=>{if(null===t.activeCamera)return Kh("ProjectionToView: no active camera, cannot compute projection to view, returning 0,0,0"),[0,0,0];const i=t.activeCamera.getProjectionMatrix(o,-1,1);g(i,i),m(i,i);const a=new Float64Array([e,r,n]);return Sr(a,a,i),a},e.worldToView=(e,r,n)=>{if(null===t.activeCamera)return Kh("WorldToView: no active camera, cannot compute view to world, returning 0,0,0"),[0,0,0];const o=t.activeCamera.getViewMatrix();m(o,o);const i=new Float64Array([e,r,n]);return Sr(i,i,o),i},e.viewToProjection=(e,r,n,o)=>{if(null===t.activeCamera)return Kh("ViewToProjection: no active camera, cannot compute view to projection, returning 0,0,0"),[0,0,0];const i=t.activeCamera.getProjectionMatrix(o,-1,1);m(i,i);const a=new Float64Array([e,r,n]);return Sr(a,a,i),a},e.computeVisiblePropBounds=()=>{t.allBounds[0]=Va.INIT_BOUNDS[0],t.allBounds[1]=Va.INIT_BOUNDS[1],t.allBounds[2]=Va.INIT_BOUNDS[2],t.allBounds[3]=Va.INIT_BOUNDS[3],t.allBounds[4]=Va.INIT_BOUNDS[4],t.allBounds[5]=Va.INIT_BOUNDS[5];let n=!0;e.invokeEvent(r);for(let e=0;e<t.props.length;++e){const r=t.props[e];if(r.getVisibility()&&r.getUseBounds()){const e=r.getBounds();e&&vi(e)&&(n=!1,e[0]<t.allBounds[0]&&(t.allBounds[0]=e[0]),e[1]>t.allBounds[1]&&(t.allBounds[1]=e[1]),e[2]<t.allBounds[2]&&(t.allBounds[2]=e[2]),e[3]>t.allBounds[3]&&(t.allBounds[3]=e[3]),e[4]<t.allBounds[4]&&(t.allBounds[4]=e[4]),e[5]>t.allBounds[5]&&(t.allBounds[5]=e[5]))}}return n&&(yi(t.allBounds),Hh("Can't compute bounds, no 3D props are visible")),t.allBounds},e.resetCamera=function(){const r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||e.computeVisiblePropBounds(),n=[0,0,0];if(!vi(r))return Hh("Cannot reset camera!"),!1;let i=null;if(!e.getActiveCamera())return Kh("Trying to reset non-existent camera"),!1;i=t.activeCamera.getViewPlaneNormal(),t.activeCamera.setViewAngle(30),n[0]=(r[0]+r[1])/2,n[1]=(r[2]+r[3])/2,n[2]=(r[4]+r[5])/2;let a=r[1]-r[0],s=r[3]-r[2],l=r[5]-r[4];a*=a,s*=s,l*=l;let u=a+s+l;u=0===u?1:u,u=.5*Math.sqrt(u);const c=yo(t.activeCamera.getViewAngle()),d=u,p=u/Math.sin(.5*c),f=t.activeCamera.getViewUp();return Math.abs(Ro(f,i))>.999&&(Xh("Resetting view-up since view plane normal is parallel"),t.activeCamera.setViewUp(-f[2],f[0],f[1])),t.activeCamera.setFocalPoint(n[0],n[1],n[2]),t.activeCamera.setPosition(n[0]+p*i[0],n[1]+p*i[1],n[2]+p*i[2]),e.resetCameraClippingRange(r),t.activeCamera.setParallelScale(d),t.activeCamera.setPhysicalScale(u),t.activeCamera.setPhysicalTranslation(-n[0],-n[1],-n[2]),e.invokeEvent(o),!0},e.resetCameraClippingRange=function(){const r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||e.computeVisiblePropBounds();if(!vi(r))return Hh("Cannot reset camera clipping range!"),!1;if(e.getActiveCameraAndResetIfCreated(),!t.activeCamera)return Kh("Trying to reset clipping range of non-existent camera"),!1;const o=t.activeCamera.computeClippingRange(r);let i=0;if(t.activeCamera.getParallelProjection())i=.2*t.activeCamera.getParallelScale();else{const e=yo(t.activeCamera.getViewAngle());i=.2*Math.tan(e/2)*o[1]}return o[1]-o[0]<i&&(i=i-o[1]+o[0],o[1]+=i/2,o[0]-=i/2),o[0]<0&&(o[0]=0),o[0]=.99*o[0]-(o[1]-o[0])*t.clippingRangeExpansion,o[1]=1.01*o[1]+(o[1]-o[0])*t.clippingRangeExpansion,o[0]=o[0]>=o[1]?.01*o[1]:o[0],t.nearClippingPlaneTolerance||(t.nearClippingPlaneTolerance=.01),o[0]<t.nearClippingPlaneTolerance*o[1]&&(o[0]=t.nearClippingPlaneTolerance*o[1]),t.activeCamera.setClippingRange(o[0],o[1]),e.invokeEvent(n),!1},e.setRenderWindow=e=>{e!==t._renderWindow&&(t._vtkWindow=e,t._renderWindow=e)},e.visibleActorCount=()=>t.props.filter(e=>e.getVisibility()).length,e.visibleVolumeCount=e.visibleActorCount,e.getMTime=()=>{let e=t.mtime;const r=t.activeCamera?t.activeCamera.getMTime():0;r>e&&(e=r);const n=t._createdLight?t._createdLight.getMTime():0;return n>e&&(e=n),e},e.getTransparent=()=>!!t.preserveColorBuffer,e.isActiveCameraCreated=()=>!!t.activeCamera}(e,t)}var Jh={newInstance:Pt(Yh,"vtkRenderer"),extend:Yh};const Qh=Object.create(null);function Zh(e,t){Qh[e]=t}function em(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Qh[e]&&Qh[e](t)}const tm={defaultViewAPI:"WebGL",renderers:[],views:[],interactor:null,neverRendered:!0,numberOfLayers:1,childRenderWindows:[]};function rm(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,tm,r),zt.obj(e,t),zt.setGet(e,t,["interactor","numberOfLayers","_views","defaultViewAPI"]),zt.get(e,t,["neverRendered"]),zt.getArray(e,t,["renderers","childRenderWindows"]),zt.moveToProtected(e,t,["views"]),zt.event(e,t,"completion"),function(e,t){t.classHierarchy.push("vtkRenderWindow"),e.addRenderer=r=>{e.hasRenderer(r)||(r.setRenderWindow(e),t.renderers.push(r),e.modified())},e.removeRenderer=r=>{t.renderers=t.renderers.filter(e=>e!==r),e.modified()},e.hasRenderer=e=>-1!==t.renderers.indexOf(e),e.newAPISpecificView=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return em(e||t.defaultViewAPI,r)},e.addView=r=>{e.hasView(r)||(r.setRenderable(e),t._views.push(r),e.modified())},e.removeView=r=>{t._views=t._views.filter(e=>e!==r),e.modified()},e.hasView=e=>-1!==t._views.indexOf(e),e.preRender=()=>{t.renderers.forEach(e=>{e.isActiveCameraCreated()||e.resetCamera()})},e.render=()=>{e.preRender(),t.interactor?t.interactor.render():t._views.forEach(e=>e.traverseAllPasses())},e.getStatistics=()=>{const e={propCount:0,invisiblePropCount:0,gpuMemoryMB:0};return t._views.forEach(t=>{t.getGraphicsMemoryInfo&&(e.gpuMemoryMB+=t.getGraphicsMemoryInfo()/1e6)}),t.renderers.forEach(r=>{const n=r.getViewProps(),o=t._views[0].getViewNodeFor(r);n.forEach(t=>{if(t.getVisibility()){e.propCount+=1;const r=t.getMapper&&t.getMapper();if(r&&r.getPrimitiveCount){const t=o.getViewNodeFor(r);if(t){t.getAllocatedGPUMemoryInBytes&&(e.gpuMemoryMB+=t.getAllocatedGPUMemoryInBytes()/1e6);const n=r.getPrimitiveCount();Object.keys(n).forEach(t=>{e[t]||(e[t]=0),e[t]+=n[t]})}}}else e.invisiblePropCount+=1})}),e.str=Object.keys(e).map(t=>`${t}: ${e[t]}`).join("\n"),e},e.captureImages=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return zt.setImmediate(e.render),t._views.map(e=>e.captureNextImage?e.captureNextImage(r,n):void 0).filter(e=>!!e)},e.addRenderWindow=r=>!t.childRenderWindows.includes(r)&&(t.childRenderWindows.push(r),e.modified(),!0),e.removeRenderWindow=r=>{const n=t.childRenderWindows.findIndex(e=>e===r);return!(n<0||(t.childRenderWindows.splice(n,1),e.modified(),0))}}(e,t)}var nm={newInstance:zt.newInstance(rm,"vtkRenderWindow"),extend:rm,registerViewConstructor:Zh,listViewAPIs:function(){return Object.keys(Qh)},newAPISpecificView:em};const om={Unknown:0,LeftController:1,RightController:2},im={Unknown:0,Trigger:1,TrackPad:2,Grip:3,Thumbstick:4,A:5,B:6,ApplicationMenu:7};var am={Device:om,Input:im,Axis:{Unknown:0,TouchpadX:1,TouchpadY:2,ThumbstickX:3,ThumbstickY:4},MouseButton:{LeftButton:1,MiddleButton:2,RightButton:3}};const{Device:sm,Input:lm}=am,{vtkWarningMacro:um,vtkErrorMacro:cm,normalizeWheel:dm,vtkOnceErrorMacro:pm}=zt,fm={ctrlKey:!1,altKey:!1,shiftKey:!1},hm={"xr-standard":[lm.Trigger,lm.Grip,lm.TrackPad,lm.Thumbstick,lm.A,lm.B]},mm=["StartAnimation","Animation","EndAnimation","PointerEnter","PointerLeave","MouseEnter","MouseLeave","StartMouseMove","MouseMove","EndMouseMove","LeftButtonPress","LeftButtonRelease","MiddleButtonPress","MiddleButtonRelease","RightButtonPress","RightButtonRelease","KeyPress","KeyDown","KeyUp","StartMouseWheel","MouseWheel","EndMouseWheel","StartPinch","Pinch","EndPinch","StartPan","Pan","EndPan","StartRotate","Rotate","EndRotate","Button3D","Move3D","StartPointerLock","EndPointerLock","StartInteraction","Interaction","EndInteraction","AnimationFrameRateUpdate"];function gm(e){e.cancelable&&e.preventDefault()}function ym(e){const t=Object.create(null);return e.forEach(e=>{let{pointerId:r,position:n}=e;t[r]=n}),t}const vm={renderWindow:null,interactorStyle:null,picker:null,pickingManager:null,initialized:!1,enabled:!1,enableRender:!0,currentRenderer:null,lightFollowCamera:!0,desiredUpdateRate:30,stillUpdateRate:2,container:null,recognizeGestures:!0,currentGesture:"Start",animationRequest:null,lastFrameTime:.1,recentAnimationFrameRate:10,wheelTimeoutID:0,moveTimeoutID:0,lastGamepadValues:{},preventDefaultOnPointerDown:!1,preventDefaultOnPointerUp:!1,mouseScrollDebounceByPass:!1};function bm(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vm,r),zt.obj(e,t),t._animationExtendedEnd=0,zt.event(e,t,"RenderEvent"),mm.forEach(r=>zt.event(e,t,r)),zt.get(e,t,["initialized","interactorStyle","lastFrameTime","recentAnimationFrameRate","_view"]),zt.setGet(e,t,["container","lightFollowCamera","enabled","enableRender","recognizeGestures","desiredUpdateRate","stillUpdateRate","picker","preventDefaultOnPointerDown","preventDefaultOnPointerUp","mouseScrollDebounceByPass"]),zt.moveToProtected(e,t,["view"]),function(e,t){t.classHierarchy.push("vtkRenderWindowInteractor");const r={...e},n=new Set,o=new Map;let i=1;function a(r,n){t._forcedRenderer||(t.currentRenderer=e.findPokedRenderer(r,n))}e.start=()=>{(t.initialized||(e.initialize(),t.initialized))&&e.startEventLoop()},e.setRenderWindow=e=>{cm("you want to call setView(view) instead of setRenderWindow on a vtk.js interactor")},e.setInteractorStyle=r=>{t.interactorStyle!==r&&(null!=t.interactorStyle&&t.interactorStyle.setInteractor(null),t.interactorStyle=r,null!=t.interactorStyle&&t.interactorStyle.getInteractor()!==e&&t.interactorStyle.setInteractor(e))},e.initialize=()=>{t.initialized=!0,e.enable(),e.render()},e.enable=()=>e.setEnabled(!0),e.disable=()=>e.setEnabled(!1),e.startEventLoop=()=>um("empty event loop"),e.getCurrentRenderer=()=>(t.currentRenderer||a(0,0),t.currentRenderer);const s=t._getScreenEventPositionFor||function(e){const r=t._view.getCanvas(),n=r.getBoundingClientRect(),i=r.width/n.width,s=r.height/n.height,l={x:i*(e.clientX-n.left),y:s*(n.height-e.clientY+n.top),z:0,movementX:i*e.movementX,movementY:s*e.movementY};return(o.size<=1||!t.currentRenderer)&&a(l.x,l.y),l};function l(e){return{controlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey}}function u(e){const t=l(e);return{key:e.key,keyCode:e.charCode,...t}}function c(e){return e.pointerType||""}const d=()=>{if(null===t.container)return;const{container:r}=t;r.addEventListener("contextmenu",gm),r.addEventListener("wheel",e.handleWheel),r.addEventListener("DOMMouseScroll",e.handleWheel),r.addEventListener("pointerenter",e.handlePointerEnter),r.addEventListener("pointerleave",e.handlePointerLeave),r.addEventListener("pointermove",e.handlePointerMove,{passive:!1}),r.addEventListener("pointerdown",e.handlePointerDown,{passive:!1}),r.addEventListener("pointerup",e.handlePointerUp),r.addEventListener("pointercancel",e.handlePointerCancel),r.addEventListener("keypress",e.handleKeyPress),r.addEventListener("keydown",e.handleKeyDown),document.addEventListener("keyup",e.handleKeyUp),document.addEventListener("pointerlockchange",e.handlePointerLockChange),r.tabIndex=0,r.style.touchAction="none",r.style.userSelect="none",r.style.webkitTapHighlightColor="rgba(0,0,0,0)"};e.bindEvents=e=>{null!==e&&r.setContainer(e)&&d()};const p=()=>{clearTimeout(t.moveTimeoutID),clearTimeout(t.wheelTimeoutID),t.moveTimeoutID=0,t.wheelTimeoutID=0,i=1;const{container:r}=t;r&&(r.removeEventListener("contextmenu",gm),r.removeEventListener("wheel",e.handleWheel),r.removeEventListener("DOMMouseScroll",e.handleWheel),r.removeEventListener("pointerenter",e.handlePointerEnter),r.removeEventListener("pointerleave",e.handlePointerLeave),r.removeEventListener("pointermove",e.handlePointerMove,{passive:!1}),r.removeEventListener("pointerdown",e.handlePointerDown,{passive:!1}),r.removeEventListener("pointerup",e.handlePointerUp),r.removeEventListener("pointercancel",e.handlePointerCancel),r.removeEventListener("keypress",e.handleKeyPress),r.removeEventListener("keydown",e.handleKeyDown)),document.removeEventListener("keyup",e.handleKeyUp),document.removeEventListener("pointerlockchange",e.handlePointerLockChange),o.clear()};function f(){t._view&&t.enabled&&t.enableRender&&(t.inRender=!0,t._view.traverseAllPasses(),t.inRender=!1),e.invokeRenderEvent()}e.unbindEvents=()=>{p(),r.setContainer(null)},e.handleKeyPress=t=>{const r=u(t);e.keyPressEvent(r)},e.handleKeyDown=t=>{const r=u(t);e.keyDownEvent(r)},e.handleKeyUp=t=>{const r=u(t);e.keyUpEvent(r)},e.handlePointerEnter=t=>{const r={...l(t),position:s(t),deviceType:c(t)};e.pointerEnterEvent(r),"mouse"===r.deviceType&&e.mouseEnterEvent(r)},e.handlePointerLeave=t=>{const r={...l(t),position:s(t),deviceType:c(t)};e.pointerLeaveEvent(r),"mouse"===r.deviceType&&e.mouseLeaveEvent(r)},e.handlePointerDown=r=>{if(!(r.button>2||e.isPointerLocked()))switch(t.preventDefaultOnPointerDown&&gm(r),r.target.hasPointerCapture(r.pointerId)&&r.target.releasePointerCapture(r.pointerId),t.container.setPointerCapture(r.pointerId),o.has(r.pointerId)&&um("[RenderWindowInteractor] duplicate pointerId detected"),o.set(r.pointerId,{pointerId:r.pointerId,position:s(r)}),r.pointerType){case"pen":case"touch":e.handleTouchStart(r);break;default:e.handleMouseDown(r)}},e.handlePointerUp=r=>{if(o.has(r.pointerId))switch(t.preventDefaultOnPointerUp&&gm(r),o.delete(r.pointerId),t.container.releasePointerCapture(r.pointerId),r.pointerType){case"pen":case"touch":e.handleTouchEnd(r);break;default:e.handleMouseUp(r)}},e.handlePointerCancel=t=>{if(o.has(t.pointerId))switch(o.delete(t.pointerId),t.pointerType){case"pen":case"touch":e.handleTouchEnd(t);break;default:e.handleMouseUp(t)}},e.handlePointerMove=t=>{switch(o.has(t.pointerId)&&(o.get(t.pointerId).position=s(t)),t.pointerType){case"pen":case"touch":e.handleTouchMove(t);break;default:e.handleMouseMove(t)}},e.handleMouseDown=t=>{const r={...l(t),position:s(t),deviceType:c(t)};switch(t.button){case 0:e.leftButtonPressEvent(r);break;case 1:e.middleButtonPressEvent(r);break;case 2:e.rightButtonPressEvent(r);break;default:cm(`Unknown mouse button pressed: ${t.button}`)}},e.requestPointerLock=()=>{t.container&&t.container.requestPointerLock()},e.exitPointerLock=()=>document.exitPointerLock?.(),e.isPointerLocked=()=>!!t.container&&document.pointerLockElement===t.container,e.handlePointerLockChange=()=>{e.isPointerLocked()?e.startPointerLockEvent():e.endPointerLockEvent()},e.requestAnimation=r=>{void 0!==r?n.has(r)?um("requester is already registered for animating"):(n.add(r),t.animationRequest||1!==n.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())):cm("undefined requester, can not start animating")},e.extendAnimation=r=>{const o=Date.now()+r;t._animationExtendedEnd=Math.max(t._animationExtendedEnd,o),t.animationRequest||0!==n.size||t.xrAnimation||(t._animationStartTime=Date.now(),t._animationFrameCount=0,t.animationRequest=requestAnimationFrame(e.handleAnimation),e.startAnimationEvent())},e.isAnimating=()=>t.xrAnimation||null!==t.animationRequest,e.cancelAnimation=function(r){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n.has(r))n.delete(r),t.animationRequest&&0===n.size&&Date.now()>t._animationExtendedEnd&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render());else if(!o){const e=r&&r.getClassName?r.getClassName():r;um(`${e} did not request an animation`)}},e.switchToXRAnimation=()=>{t.animationRequest&&(cancelAnimationFrame(t.animationRequest),t.animationRequest=null),t.xrAnimation=!0},e.returnFromXRAnimation=()=>{t.xrAnimation=!1,0!==n.size&&(t.recentAnimationFrameRate=10,t.animationRequest=requestAnimationFrame(e.handleAnimation))},e.updateXRGamepads=(r,n,o)=>{r.inputSources.forEach(r=>{const i=null==r.gripSpace?null:n.getPose(r.gripSpace,o),a=null==r.gripSpace?null:n.getPose(r.targetRaySpace,o),s=r.gamepad,l=r.handedness;if(s){s.index in t.lastGamepadValues||(t.lastGamepadValues[s.index]={left:{buttons:{}},right:{buttons:{}},none:{buttons:{}}});for(let n=0;n<s.buttons.length;++n)n in t.lastGamepadValues[s.index][l].buttons||(t.lastGamepadValues[s.index][l].buttons[n]=!1),t.lastGamepadValues[s.index][l].buttons[n]!==s.buttons[n].pressed&&null!=i&&(e.button3DEvent({gamepad:s,position:i.transform.position,orientation:i.transform.orientation,targetPosition:a.transform.position,targetOrientation:a.transform.orientation,pressed:s.buttons[n].pressed,device:"left"===r.handedness?sm.LeftController:sm.RightController,input:hm[s.mapping]&&hm[s.mapping][n]?hm[s.mapping][n]:lm.Trigger}),t.lastGamepadValues[s.index][l].buttons[n]=s.buttons[n].pressed),t.lastGamepadValues[s.index][l].buttons[n]&&null!=i&&e.move3DEvent({gamepad:s,position:i.transform.position,orientation:i.transform.orientation,targetPosition:a.transform.position,targetOrientation:a.transform.orientation,device:"left"===r.handedness?sm.LeftController:sm.RightController})}})},e.handleMouseMove=r=>{const n={...l(r),position:s(r),deviceType:c(r)};0===t.moveTimeoutID?e.startMouseMoveEvent(n):(e.mouseMoveEvent(n),clearTimeout(t.moveTimeoutID)),t.moveTimeoutID=setTimeout(()=>{e.endMouseMoveEvent(),t.moveTimeoutID=0},200)},e.handleAnimation=()=>{const r=Date.now();t._animationFrameCount++,r-t._animationStartTime>1e3&&t._animationFrameCount>1&&(t.recentAnimationFrameRate=1e3*(t._animationFrameCount-1)/(r-t._animationStartTime),t.lastFrameTime=1/t.recentAnimationFrameRate,e.animationFrameRateUpdateEvent(),t._animationStartTime=r,t._animationFrameCount=1),e.animationEvent(),f(),n.size>0||Date.now()<t._animationExtendedEnd?t.animationRequest=requestAnimationFrame(e.handleAnimation):(cancelAnimationFrame(t.animationRequest),t.animationRequest=null,e.endAnimationEvent(),e.render())},e.handleWheel=r=>{gm(r);const n={...dm(r),...l(r),position:s(r),deviceType:c(r)};0===t.wheelTimeoutID&&(i=Math.abs(n.spinY)>=.3?Math.abs(n.spinY):1),n.spinY/=i,0===t.wheelTimeoutID?(e.startMouseWheelEvent(n),e.mouseWheelEvent(n)):(e.mouseWheelEvent(n),clearTimeout(t.wheelTimeoutID)),t.mouseScrollDebounceByPass?(e.extendAnimation(600),e.endMouseWheelEvent(),t.wheelTimeoutID=0):t.wheelTimeoutID=setTimeout(()=>{e.extendAnimation(600),e.endMouseWheelEvent(),t.wheelTimeoutID=0},200)},e.handleMouseUp=t=>{const r={...l(t),position:s(t),deviceType:c(t)};switch(t.button){case 0:e.leftButtonReleaseEvent(r);break;case 1:e.middleButtonReleaseEvent(r);break;case 2:e.rightButtonReleaseEvent(r);break;default:cm(`Unknown mouse button released: ${t.button}`)}},e.handleTouchStart=r=>{const n=[...o.values()];if(t.recognizeGestures&&n.length>1){const t=ym(o);if(2===n.length){const t={...l(fm),position:n[0].position,deviceType:c(r)};e.leftButtonReleaseEvent(t)}e.recognizeGesture("TouchStart",t)}else if(1===n.length){const t={...l(fm),position:s(r),deviceType:c(r)};e.leftButtonPressEvent(t)}},e.handleTouchMove=r=>{const n=[...o.values()];if(t.recognizeGestures&&n.length>1){const t=ym(o);e.recognizeGesture("TouchMove",t)}else if(1===n.length){const t={...l(fm),position:n[0].position,deviceType:c(r)};e.mouseMoveEvent(t)}},e.handleTouchEnd=r=>{const n=[...o.values()];if(t.recognizeGestures)if(0===n.length){const t={...l(fm),position:s(r),deviceType:c(r)};e.leftButtonReleaseEvent(t)}else if(1===n.length){const t=ym(o);e.recognizeGesture("TouchEnd",t);const i={...l(fm),position:n[0].position,deviceType:c(r)};e.leftButtonPressEvent(i)}else{const t=ym(o);e.recognizeGesture("TouchMove",t)}else if(1===n.length){const t={...l(fm),position:n[0].position,deviceType:c(r)};e.leftButtonReleaseEvent(t)}},e.setView=r=>{t._view!==r&&(t._view=r,t._view.getRenderable().setInteractor(e),e.modified())},e.getFirstRenderer=()=>t._view?.getRenderable()?.getRenderersByReference()?.[0],e.findPokedRenderer=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t._view)return null;const n=t._view?.getRenderable()?.getRenderers();if(!n||0===n.length)return null;n.sort((e,t)=>e.getLayer()-t.getLayer());let o=null,i=null,a=null,s=n.length;for(;s--;){const l=n[s];if(t._view.isInViewport(e,r,l)&&l.getInteractive()){a=l;break}null===o&&l.getInteractive()&&(o=l),null===i&&t._view.isInViewport(e,r,l)&&(i=l)}return null===a&&(a=o),null===a&&(a=i),null==a&&(a=n[0]),a},e.render=()=>{e.isAnimating()||t.inRender||f()},mm.forEach(r=>{const n=r.charAt(0).toLowerCase()+r.slice(1);e[`${n}Event`]=n=>{if(!t.enabled)return;if(!e.getCurrentRenderer())return void pm("\n Can not forward events without a current renderer on the interactor.\n ");const o={type:r,pokedRenderer:t.currentRenderer,firstRenderer:e.getFirstRenderer(),...n};e[`invoke${r}`](o)}}),e.recognizeGesture=(r,n)=>{if(Object.keys(n).length>2)return;if(t.startingEventPositions||(t.startingEventPositions={}),"TouchStart"===r)return Object.keys(n).forEach(e=>{t.startingEventPositions[e]=n[e]}),void(t.currentGesture="Start");if("TouchEnd"===r)return"Pinch"===t.currentGesture&&(e.render(),e.endPinchEvent()),"Rotate"===t.currentGesture&&(e.render(),e.endRotateEvent()),"Pan"===t.currentGesture&&(e.render(),e.endPanEvent()),t.currentGesture="Start",void(t.startingEventPositions={});let o=0;const i=[],a=[];Object.keys(n).forEach(e=>{i[o]=n[e],a[o]=t.startingEventPositions[e],o++});const s=Math.sqrt((a[0].x-a[1].x)*(a[0].x-a[1].x)+(a[0].y-a[1].y)*(a[0].y-a[1].y)),l=Math.sqrt((i[0].x-i[1].x)*(i[0].x-i[1].x)+(i[0].y-i[1].y)*(i[0].y-i[1].y));let u=vo(Math.atan2(a[1].y-a[0].y,a[1].x-a[0].x)),c=vo(Math.atan2(i[1].y-i[0].y,i[1].x-i[0].x)),d=c-u;c=c+180>=360?c-180:c+180,u=u+180>=360?u-180:u+180,Math.abs(c-u)<Math.abs(d)&&(d=c-u);const p=[];if(p[0]=(i[0].x-a[0].x+i[1].x-a[1].x)/2,p[1]=(i[0].y-a[0].y+i[1].y-a[1].y)/2,"TouchMove"===r)if("Start"===t.currentGesture){let r=.01*Math.sqrt(t.container.clientWidth*t.container.clientWidth+t.container.clientHeight*t.container.clientHeight);r<15&&(r=15);const o=Math.abs(l-s),i=3.1415926*l*Math.abs(d)/360,a=Math.sqrt(p[0]*p[0]+p[1]*p[1]);if(o>r&&o>i&&o>a){t.currentGesture="Pinch";const r={scale:1,touches:n};e.startPinchEvent(r)}else if(i>r&&i>a){t.currentGesture="Rotate";const r={rotation:0,touches:n};e.startRotateEvent(r)}else if(a>r){t.currentGesture="Pan";const r={translation:[0,0],touches:n};e.startPanEvent(r)}}else{if("Rotate"===t.currentGesture){const t={rotation:d,touches:n};e.rotateEvent(t)}if("Pinch"===t.currentGesture){const t={scale:l/s,touches:n};e.pinchEvent(t)}if("Pan"===t.currentGesture){const t={translation:p,touches:n};e.panEvent(t)}}},e.handleVisibilityChange=()=>{t._animationStartTime=Date.now(),t._animationFrameCount=0},e.setCurrentRenderer=e=>{t._forcedRenderer=!!e,t.currentRenderer=e},e.setContainer=e=>{p();const t=r.setContainer(e??null);return t&&d(),t},e.delete=()=>{for(;n.size;)e.cancelAnimation(n.values().next().value);void 0!==document.hidden&&document.removeEventListener("visibilitychange",e.handleVisibilityChange),t.container&&e.setContainer(null),r.delete()},void 0!==document.hidden&&document.addEventListener("visibilitychange",e.handleVisibilityChange,!1)}(e,t)}var xm={newInstance:zt.newInstance(bm,"vtkRenderWindowInteractor"),extend:bm,handledEvents:mm,...am};const{vtkErrorMacro:_m,VOID:Sm}=zt,Cm={enabled:!0,priority:0,processEvents:!0,subscribedEvents:[]};function Tm(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cm,r),zt.obj(e,t),zt.event(e,t,"InteractionEvent"),zt.event(e,t,"StartInteractionEvent"),zt.event(e,t,"EndInteractionEvent"),zt.get(e,t,["_interactor","enabled"]),zt.setGet(e,t,["priority","processEvents"]),zt.moveToProtected(e,t,["interactor"]),function(e,t){t.classHierarchy.push("vtkInteractorObserver");const r={...e};function n(){for(;t.subscribedEvents.length;)t.subscribedEvents.pop().unsubscribe()}function o(){xm.handledEvents.forEach(r=>{e[`handle${r}`]&&t.subscribedEvents.push(t._interactor[`on${r}`](n=>t.processEvents?e[`handle${r}`](n):Sm,t.priority))})}e.setInteractor=r=>{r!==t._interactor&&(n(),t._interactor=r,r&&t.enabled&&o(),e.modified())},e.setEnabled=r=>{r!==t.enabled&&(n(),r&&(t._interactor?o():_m("\n The interactor must be set before subscribing to events\n ")),t.enabled=r,e.modified())},e.computeDisplayToWorld=(e,r,n,o)=>e?t._interactor.getView().displayToWorld(r,n,o,e):null,e.computeWorldToDisplay=(e,r,n,o)=>e?t._interactor.getView().worldToDisplay(r,n,o,e):null,e.setPriority=e=>{r.setPriority(e)&&t._interactor&&(n(),o())}}(e,t)}var wm={newInstance:zt.newInstance(Tm,"vtkInteractorObserver"),extend:Tm,computeWorldToDisplay:function(e,t,r,n){return e.getRenderWindow().getViews()[0].worldToDisplay(t,r,n,e)},computeDisplayToWorld:function(e,t,r,n){return e.getRenderWindow().getViews()[0].displayToWorld(t,r,n,e)}},Am={States:{IS_START:0,IS_NONE:0,IS_ROTATE:1,IS_PAN:2,IS_SPIN:3,IS_DOLLY:4,IS_CAMERA_POSE:11,IS_WINDOW_LEVEL:1024,IS_SLICE:1025}};const{States:Em}=Am,Dm={Rotate:Em.IS_ROTATE,Pan:Em.IS_PAN,Spin:Em.IS_SPIN,Dolly:Em.IS_DOLLY,CameraPose:Em.IS_CAMERA_POSE,WindowLevel:Em.IS_WINDOW_LEVEL,Slice:Em.IS_SLICE},Pm={state:Em.IS_NONE,handleObservers:1,autoAdjustCameraClippingRange:1};function Im(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Pm,r),wm.extend(e,t,r),zt.setGet(e,t,["focusedRenderer"]),function(e,t){t.classHierarchy.push("vtkInteractorStyle"),Object.keys(Dm).forEach(r=>{zt.event(e,t,`Start${r}Event`),e[`start${r}`]=()=>{t.state===Em.IS_NONE&&(t.state=Dm[r],t._interactor.requestAnimation(e),e.invokeStartInteractionEvent({type:"StartInteractionEvent"}),e[`invokeStart${r}Event`]({type:`Start${r}Event`}))},zt.event(e,t,`End${r}Event`),e[`end${r}`]=()=>{t.state===Dm[r]&&(t.state=Em.IS_NONE,t._interactor.cancelAnimation(e),e.invokeEndInteractionEvent({type:"EndInteractionEvent"}),e[`invokeEnd${r}Event`]({type:`End${r}Event`}),t._interactor.render())}}),t.getRenderer=e=>t.focusedRenderer||e.pokedRenderer,e.handleKeyPress=e=>{const r=t._interactor;let n=null;switch(e.key){case"r":case"R":t.getRenderer(e).resetCamera(),r.render();break;case"w":case"W":n=t.getRenderer(e).getActors(),n.forEach(e=>{const t=e.getProperty();t.setRepresentationToWireframe&&t.setRepresentationToWireframe()}),r.render();break;case"s":case"S":n=t.getRenderer(e).getActors(),n.forEach(e=>{const t=e.getProperty();t.setRepresentationToSurface&&t.setRepresentationToSurface()}),r.render();break;case"v":case"V":n=t.getRenderer(e).getActors(),n.forEach(e=>{const t=e.getProperty();t.setRepresentationToPoints&&t.setRepresentationToPoints()}),r.render()}}}(e,t)}var Om={newInstance:zt.newInstance(Im,"vtkInteractorStyle"),extend:Im,...Am};const{States:Nm}=Am,Mm={motionFactor:10,zoomFactor:10};function Rm(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Mm,r),Om.extend(e,t,r),zt.setGet(e,t,["motionFactor","zoomFactor"]),function(e,t){t.classHierarchy.push("vtkInteractorStyleTrackballCamera"),e.handleMouseMove=r=>{const n=r.position,o=t.getRenderer(r);switch(t.state){case Nm.IS_ROTATE:e.handleMouseRotate(o,n),e.invokeInteractionEvent({type:"InteractionEvent"});break;case Nm.IS_PAN:e.handleMousePan(o,n),e.invokeInteractionEvent({type:"InteractionEvent"});break;case Nm.IS_DOLLY:e.handleMouseDolly(o,n),e.invokeInteractionEvent({type:"InteractionEvent"});break;case Nm.IS_SPIN:e.handleMouseSpin(o,n),e.invokeInteractionEvent({type:"InteractionEvent"})}t.previousPosition=n},e.handleButton3D=r=>{!r||!r.pressed||r.device!==om.RightController||r.input!==im.Trigger&&r.input!==im.TrackPad?!r||r.pressed||r.device!==om.RightController||r.input!==im.Trigger&&r.input!==im.TrackPad||t.state!==Nm.IS_CAMERA_POSE||e.endCameraPose():e.startCameraPose()},e.handleMove3D=r=>{t.state===Nm.IS_CAMERA_POSE&&e.updateCameraPose(r)},e.updateCameraPose=e=>{const r=t.getRenderer(e).getActiveCamera(),n=r.getPhysicalTranslation(),o=.025*r.getPhysicalScale(),i=r.physicalOrientationToWorldDirection([e.orientation.x,e.orientation.y,e.orientation.z,e.orientation.w]);r.setPhysicalTranslation(n[0]+i[0]*o,n[1]+i[1]*o,n[2]+i[2]*o)},e.handleLeftButtonPress=r=>{const n=r.position;t.previousPosition=n,r.shiftKey?r.controlKey||r.altKey?e.startDolly():e.startPan():r.controlKey||r.altKey?e.startSpin():e.startRotate()},e.handleLeftButtonRelease=()=>{switch(t.state){case Nm.IS_DOLLY:e.endDolly();break;case Nm.IS_PAN:e.endPan();break;case Nm.IS_SPIN:e.endSpin();break;case Nm.IS_ROTATE:e.endRotate()}},e.handleStartMouseWheel=()=>{e.startDolly()},e.handleEndMouseWheel=()=>{e.endDolly()},e.handleStartPinch=r=>{t.previousScale=r.scale,e.startDolly()},e.handleEndPinch=()=>{e.endDolly()},e.handleStartRotate=r=>{t.previousRotation=r.rotation,e.startRotate()},e.handleEndRotate=()=>{e.endRotate()},e.handleStartPan=r=>{t.previousTranslation=r.translation,e.startPan()},e.handleEndPan=()=>{e.endPan()},e.handlePinch=r=>{e.dollyByFactor(t.getRenderer(r),r.scale/t.previousScale),t.previousScale=r.scale},e.handlePan=r=>{const n=t.getRenderer(r).getActiveCamera();let o=n.getFocalPoint();o=e.computeWorldToDisplay(t.getRenderer(r),o[0],o[1],o[2]);const i=o[2],a=r.translation,s=t.previousTranslation,l=e.computeDisplayToWorld(t.getRenderer(r),o[0]+a[0]-s[0],o[1]+a[1]-s[1],i),u=e.computeDisplayToWorld(t.getRenderer(r),o[0],o[1],i),c=[];c[0]=u[0]-l[0],c[1]=u[1]-l[1],c[2]=u[2]-l[2],o=n.getFocalPoint();const d=n.getPosition();n.setFocalPoint(c[0]+o[0],c[1]+o[1],c[2]+o[2]),n.setPosition(c[0]+d[0],c[1]+d[1],c[2]+d[2]),t._interactor.getLightFollowCamera()&&t.getRenderer(r).updateLightsGeometryToFollowCamera(),n.orthogonalizeViewUp(),t.previousTranslation=r.translation},e.handleRotate=e=>{const r=t.getRenderer(e).getActiveCamera();r.roll(e.rotation-t.previousRotation),r.orthogonalizeViewUp(),t.previousRotation=e.rotation},e.handleMouseRotate=(e,r)=>{if(!t.previousPosition)return;const n=t._interactor,o=r.x-t.previousPosition.x,i=r.y-t.previousPosition.y,a=n.getView().getViewportSize(e);let s=-.1,l=-.1;a[0]&&a[1]&&(s=-20/a[1],l=-20/a[0]);const u=o*l*t.motionFactor,c=i*s*t.motionFactor,d=e.getActiveCamera();Number.isNaN(u)||Number.isNaN(c)||(d.azimuth(u),d.elevation(c),d.orthogonalizeViewUp()),t.autoAdjustCameraClippingRange&&e.resetCameraClippingRange(),n.getLightFollowCamera()&&e.updateLightsGeometryToFollowCamera()},e.handleMouseSpin=(e,r)=>{if(!t.previousPosition)return;const n=t._interactor,o=e.getActiveCamera(),i=n.getView().getViewportCenter(e),a=vo(Math.atan2(t.previousPosition.y-i[1],t.previousPosition.x-i[0])),s=vo(Math.atan2(r.y-i[1],r.x-i[0]))-a;Number.isNaN(s)||(o.roll(s),o.orthogonalizeViewUp())},e.handleMousePan=(r,n)=>{if(!t.previousPosition)return;const o=r.getActiveCamera();let i=o.getFocalPoint();i=e.computeWorldToDisplay(r,i[0],i[1],i[2]);const a=i[2],s=e.computeDisplayToWorld(r,n.x,n.y,a),l=e.computeDisplayToWorld(r,t.previousPosition.x,t.previousPosition.y,a),u=[];u[0]=l[0]-s[0],u[1]=l[1]-s[1],u[2]=l[2]-s[2],i=o.getFocalPoint();const c=o.getPosition();o.setFocalPoint(u[0]+i[0],u[1]+i[1],u[2]+i[2]),o.setPosition(u[0]+c[0],u[1]+c[1],u[2]+c[2]),t._interactor.getLightFollowCamera()&&r.updateLightsGeometryToFollowCamera()},e.handleMouseDolly=(r,n)=>{if(!t.previousPosition)return;const o=n.y-t.previousPosition.y,i=t._interactor.getView().getViewportCenter(r),a=t.motionFactor*o/i[1];e.dollyByFactor(r,1.1**a)},e.handleMouseWheel=r=>{const n=1-r.spinY/t.zoomFactor;e.dollyByFactor(t.getRenderer(r),n)},e.dollyByFactor=(e,r)=>{if(Number.isNaN(r))return;const n=e.getActiveCamera();n.getParallelProjection()?n.setParallelScale(n.getParallelScale()/r):(n.dolly(r),t.autoAdjustCameraClippingRange&&e.resetCameraClippingRange()),t._interactor.getLightFollowCamera()&&e.updateLightsGeometryToFollowCamera()}}(e,t)}var Fm={newInstance:zt.newInstance(Rm,"vtkInteractorStyleTrackballCamera"),extend:Rm};function Bm(e){return e}function Lm(e){return null===e||"null"===e?null:"true"===e||"false"!==e&&(void 0!==e&&"undefined"!==e?"["===e[0]&&"]"===e[e.length-1]?e.substring(1,e.length-1).split(",").map(e=>Lm(e.trim())):""===e||Number.isNaN(Number(e))?e:Number(e):void 0)}var km=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.search;const r={},n=e?Lm:Bm;return new URLSearchParams(t).forEach((e,t)=>{t&&(r[t]=!e||n(e))}),r};const Um={glFramebuffer:null,colorBuffers:null,depthTexture:null,previousDrawBinding:0,previousReadBinding:0,previousDrawBuffer:0,previousReadBuffer:0,previousActiveFramebuffer:null};function Vm(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Um,r),mt(e,t),t.colorBuffers&&Ze("you cannot initialize colorBuffers through the constructor. You should call setColorBuffer() instead."),t.colorBuffers=[],St(e,t,["colorBuffers"]),function(e,t){t.classHierarchy.push("vtkFramebuffer"),e.getBothMode=()=>t.context.FRAMEBUFFER,e.saveCurrentBindingsAndBuffers=t=>{const r=void 0!==t?t:e.getBothMode();e.saveCurrentBindings(r),e.saveCurrentBuffers(r)},e.saveCurrentBindings=e=>{if(!t.context)return void Ze("you must set the OpenGLRenderWindow before calling saveCurrentBindings");const r=t.context;t.previousDrawBinding=r.getParameter(t.context.FRAMEBUFFER_BINDING),t.previousActiveFramebuffer=t._openGLRenderWindow.getActiveFramebuffer()},e.saveCurrentBuffers=e=>{},e.restorePreviousBindingsAndBuffers=t=>{const r=void 0!==t?t:e.getBothMode();e.restorePreviousBindings(r),e.restorePreviousBuffers(r)},e.restorePreviousBindings=e=>{if(!t.context)return void Ze("you must set the OpenGLRenderWindow before calling restorePreviousBindings");const r=t.context;r.bindFramebuffer(r.FRAMEBUFFER,t.previousDrawBinding),t._openGLRenderWindow.setActiveFramebuffer(t.previousActiveFramebuffer)},e.restorePreviousBuffers=e=>{},e.bind=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===r&&(r=t.context.FRAMEBUFFER),t.context.bindFramebuffer(r,t.glFramebuffer);for(let e=0;e<t.colorBuffers.length;e++)t.colorBuffers[e].bind();t._openGLRenderWindow.setActiveFramebuffer(e)},e.create=(e,r)=>{t.context?(t.glFramebuffer=t.context.createFramebuffer(),t.glFramebuffer.width=e,t.glFramebuffer.height=r):Ze("you must set the OpenGLRenderWindow before calling create")},e.setColorBuffer=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=t.context;if(!n)return void Ze("you must set the OpenGLRenderWindow before calling setColorBuffer");let o=n.COLOR_ATTACHMENT0;if(r>0){if(!t._openGLRenderWindow.getWebgl2())return void Ze("Using multiple framebuffer attachments requires WebGL 2");o+=r}t.colorBuffers[r]=e,n.framebufferTexture2D(n.FRAMEBUFFER,o,n.TEXTURE_2D,e.getHandle(),0)},e.removeColorBuffer=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const r=t.context;if(!r)return void Ze("you must set the OpenGLRenderWindow before calling removeColorBuffer");let n=r.COLOR_ATTACHMENT0;if(e>0){if(!t._openGLRenderWindow.getWebgl2())return void Ze("Using multiple framebuffer attachments requires WebGL 2");n+=e}r.framebufferTexture2D(r.FRAMEBUFFER,n,r.TEXTURE_2D,null,0),t.colorBuffers=t.colorBuffers.splice(e,1)},e.setDepthBuffer=e=>{if(t.context)if(t._openGLRenderWindow.getWebgl2()){const r=t.context;r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,e.getHandle(),0)}else Ze("Attaching depth buffer textures to fbo requires WebGL 2");else Ze("you must set the OpenGLRenderWindow before calling setDepthBuffer")},e.removeDepthBuffer=()=>{if(t.context)if(t._openGLRenderWindow.getWebgl2()){const e=t.context;e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,null,0)}else Ze("Attaching depth buffer textures to framebuffers requires WebGL 2");else Ze("you must set the OpenGLRenderWindow before calling removeDepthBuffer")},e.getGLFramebuffer=()=>t.glFramebuffer,e.setOpenGLRenderWindow=r=>{t._openGLRenderWindow!==r&&(e.releaseGraphicsResources(),t._openGLRenderWindow=r,t.context=null,r&&(t.context=t._openGLRenderWindow.getContext()))},e.releaseGraphicsResources=()=>{t.glFramebuffer&&t.context.deleteFramebuffer(t.glFramebuffer)},e.getSize=()=>null==t.glFramebuffer?null:[t.glFramebuffer.width,t.glFramebuffer.height],e.populateFramebuffer=()=>{if(!t.context)return void Ze("you must set the OpenGLRenderWindow before calling populateFrameBuffer");e.bind();const r=t.context,n=Dd.newInstance();n.setOpenGLRenderWindow(t._openGLRenderWindow),n.setMinificationFilter(cd.LINEAR),n.setMagnificationFilter(cd.LINEAR),n.create2DFromRaw({width:t.glFramebuffer.width,height:t.glFramebuffer.height,numComps:4,dataType:us.UNSIGNED_CHAR,data:null}),e.setColorBuffer(n),t.depthTexture=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,t.depthTexture),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,t.glFramebuffer.width,t.glFramebuffer.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,t.depthTexture)},e.getColorTexture=()=>t.colorBuffers[0]}(e,t)}var Gm={newInstance:Pt(Vm,"vtkFramebuffer"),extend:Vm};const zm={delegates:[],currentOperation:null,preDelegateOperations:[],postDelegateOperations:[],currentParent:null};function jm(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zm,r),zt.obj(e,t),zt.get(e,t,["currentOperation"]),zt.setGet(e,t,["delegates","_currentParent","preDelegateOperations","postDelegateOperations"]),zt.moveToProtected(e,t,["currentParent"]),function(e,t){t.classHierarchy.push("vtkRenderPass"),e.getOperation=()=>t.currentOperation,e.setCurrentOperation=e=>{t.currentOperation=e,t.currentTraverseOperation=`traverse${zt.capitalize(t.currentOperation)}`},e.getTraverseOperation=()=>t.currentTraverseOperation,e.traverse=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;t.deleted||(t._currentParent=n,t.preDelegateOperations.forEach(t=>{e.setCurrentOperation(t),r.traverse(e)}),t.delegates.forEach(t=>{t.traverse(r,e)}),t.postDelegateOperations.forEach(t=>{e.setCurrentOperation(t),r.traverse(e)}))}}(e,t)}var Wm={newInstance:zt.newInstance(jm,"vtkRenderPass"),extend:jm};const{Representation:Hm}=os,{vtkErrorMacro:Km}=zt;function Xm(e){const t=rd.substitute(e.Fragment,"//VTK::RenderPassFragmentShader::Impl","\n float weight = gl_FragData[0].a * pow(max(1.1 - gl_FragCoord.z, 0.0), 2.0);\n gl_FragData[0] = vec4(gl_FragData[0].rgb*weight, gl_FragData[0].a);\n gl_FragData[1].r = weight;\n ",!1);e.Fragment=t.result}const $m={framebuffer:null,copyShader:null,tris:null};function qm(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,$m,r),Wm.extend(e,t,r),t.VBOBuildTime={},zt.obj(t.VBOBuildTime,{mtime:0}),t.tris=ud.newInstance(),zt.get(e,t,["framebuffer"]),function(e,t){t.classHierarchy.push("vtkOpenGLOrderIndependentTranslucentPass"),e.createVertexBuffer=()=>{const e=new Float32Array([-1,-1,-1,1,-1,-1,-1,1,-1,1,1,-1]),r=new Float32Array([0,0,1,0,0,1,1,1]),n=new Uint16Array([4,0,1,3,2]),o=_s.newInstance({numberOfComponents:3,values:e});o.setName("points");const i=_s.newInstance({numberOfComponents:2,values:r});i.setName("tcoords");const a=_s.newInstance({numberOfComponents:1,values:n});t.tris.getCABO().createVBO(a,"polys",Hm.SURFACE,{points:o,tcoords:i,cellOffset:0}),t.VBOBuildTime.modified()},e.createFramebuffer=e=>{const r=e.getSize(),n=e.getContext();t.framebuffer=Gm.newInstance(),t.framebuffer.setOpenGLRenderWindow(e),t.framebuffer.create(...r),t.framebuffer.saveCurrentBindingsAndBuffers(),t.framebuffer.bind(),t.translucentRGBATexture=Dd.newInstance(),t.translucentRGBATexture.setInternalFormat(n.RGBA16F),t.translucentRGBATexture.setFormat(n.RGBA),t.translucentRGBATexture.setOpenGLDataType(n.HALF_FLOAT),t.translucentRGBATexture.setOpenGLRenderWindow(e),t.translucentRGBATexture.create2DFromRaw({width:r[0],height:r[1],numComps:4,dataType:"Float32Array",data:null}),t.translucentRTexture=Dd.newInstance(),t.translucentRTexture.setInternalFormat(n.R16F),t.translucentRTexture.setFormat(n.RED),t.translucentRTexture.setOpenGLDataType(n.HALF_FLOAT),t.translucentRTexture.setOpenGLRenderWindow(e),t.translucentRTexture.create2DFromRaw({width:r[0],height:r[1],numComps:1,dataType:"Float32Array",data:null}),t.translucentZTexture=Dd.newInstance(),t.translucentZTexture.setOpenGLRenderWindow(e),t.translucentZTexture.createDepthFromRaw({width:r[0],height:r[1],dataType:"Float32Array",data:null}),t.framebuffer.setColorBuffer(t.translucentRGBATexture,0),t.framebuffer.setColorBuffer(t.translucentRTexture,1),t.framebuffer.setDepthBuffer(t.translucentZTexture)},e.createCopyShader=e=>{t.copyShader=e.getShaderCache().readyShaderProgramArray(["//VTK::System::Dec","attribute vec4 vertexDC;","attribute vec2 tcoordTC;","varying vec2 tcoord;","void main() { tcoord = tcoordTC; gl_Position = vertexDC; }"].join("\n"),"//VTK::System::Dec\n\nin vec2 tcoord;\n\nuniform sampler2D translucentRTexture;\nuniform sampler2D translucentRGBATexture;\n\n// the output of this shader\n//VTK::Output::Dec\n\nvoid main()\n{\n vec4 t1Color = texture(translucentRGBATexture, tcoord);\n float t2Color = texture(translucentRTexture, tcoord).r;\n gl_FragData[0] = vec4(t1Color.rgb/max(t2Color,0.01), 1.0 - t1Color.a);\n}\n","")},e.createVBO=r=>{const n=r.getContext();t.tris.setOpenGLRenderWindow(r),e.createVertexBuffer();const o=t.copyShader;t.tris.getCABO().bind(),t.copyVAO.addAttributeArray(o,t.tris.getCABO(),"vertexDC",t.tris.getCABO().getVertexOffset(),t.tris.getCABO().getStride(),n.FLOAT,3,n.FALSE)||Km("Error setting vertexDC in copy shader VAO."),t.copyVAO.addAttributeArray(o,t.tris.getCABO(),"tcoordTC",t.tris.getCABO().getTCoordOffset(),t.tris.getCABO().getStride(),n.FLOAT,2,n.FALSE)||Km("Error setting vertexDC in copy shader VAO.")},e.traverse=(r,n,o)=>{if(t.deleted)return;const i=r.getSize(),a=r.getContext();if(t._supported=!1,n.getSelector()||!a||!r.getWebgl2()||!a.getExtension("EXT_color_buffer_half_float")&&!a.getExtension("EXT_color_buffer_float"))return e.setCurrentOperation("translucentPass"),void n.traverse(e);if(t._supported=!0,null===t.framebuffer)e.createFramebuffer(r);else{const n=t.framebuffer.getSize();null===n||n[0]!==i[0]||n[1]!==i[1]?(t.framebuffer.releaseGraphicsResources(),t.translucentRGBATexture.releaseGraphicsResources(r),t.translucentRTexture.releaseGraphicsResources(r),t.translucentZTexture.releaseGraphicsResources(r),e.createFramebuffer(r)):(t.framebuffer.saveCurrentBindingsAndBuffers(),t.framebuffer.bind())}a.drawBuffers([a.COLOR_ATTACHMENT0]),a.clearBufferfv(a.COLOR,0,[0,0,0,0]),a.clearBufferfv(a.DEPTH,0,[1]),a.colorMask(!1,!1,!1,!1),o.getOpaqueActorCount()>0&&(o.setCurrentOperation("opaqueZBufferPass"),n.traverse(o)),a.colorMask(!0,!0,!0,!0),a.drawBuffers([a.COLOR_ATTACHMENT0,a.COLOR_ATTACHMENT1]),a.viewport(0,0,i[0],i[1]),a.scissor(0,0,i[0],i[1]),a.clearBufferfv(a.COLOR,0,[0,0,0,1]),a.clearBufferfv(a.COLOR,1,[0,0,0,0]),a.enable(a.DEPTH_TEST),a.enable(a.BLEND),a.blendFuncSeparate(a.ONE,a.ONE,a.ZERO,a.ONE_MINUS_SRC_ALPHA),e.setCurrentOperation("translucentPass"),n.traverse(e),a.drawBuffers([a.NONE]),t.framebuffer.restorePreviousBindingsAndBuffers(),null===t.copyShader?e.createCopyShader(r):r.getShaderCache().readyShaderProgram(t.copyShader),t.copyVAO||(t.copyVAO=id.newInstance(),t.copyVAO.setOpenGLRenderWindow(r)),t.copyVAO.bind(),t.VBOBuildTime.getMTime()<e.getMTime()&&e.createVBO(r),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA),a.depthMask(!1),a.depthFunc(a.ALWAYS),a.viewport(0,0,i[0],i[1]),a.scissor(0,0,i[0],i[1]),t.translucentRGBATexture.activate(),t.copyShader.setUniformi("translucentRGBATexture",t.translucentRGBATexture.getTextureUnit()),t.translucentRTexture.activate(),t.copyShader.setUniformi("translucentRTexture",t.translucentRTexture.getTextureUnit()),a.drawArrays(a.TRIANGLES,0,t.tris.getCABO().getElementCount()),a.depthMask(!0),a.depthFunc(a.LEQUAL),t.translucentRGBATexture.deactivate(),t.translucentRTexture.deactivate();const s=n.getTiledSizeAndOrigin();a.scissor(s.lowerLeftU,s.lowerLeftV,s.usize,s.vsize),a.viewport(s.lowerLeftU,s.lowerLeftV,s.usize,s.vsize)},e.getShaderReplacement=()=>t._supported?Xm:null,e.releaseGraphicsResources=r=>{t.framebuffer&&(t.framebuffer.releaseGraphicsResources(r),t.framebuffer=null),t.translucentRGBATexture&&(t.translucentRGBATexture.releaseGraphicsResources(r),t.translucentRGBATexture=null),t.translucentRTexture&&(t.translucentRTexture.releaseGraphicsResources(r),t.translucentRTexture=null),t.translucentZTexture&&(t.translucentZTexture.releaseGraphicsResources(r),t.translucentZTexture=null),t.copyVAO&&(t.copyVAO.releaseGraphicsResources(r),t.copyVAO=null),t.copyShader&&(t.copyShader.releaseGraphicsResources(r),t.copyShader=null),t.tris&&(t.tris.releaseGraphicsResources(r),t.tris=null),e.modified()}}(e,t)}var Ym={newInstance:zt.newInstance(qm,"vtkOpenGLOrderIndependentTranslucentPass"),extend:qm};const Jm={opaqueActorCount:0,translucentActorCount:0,volumeCount:0,overlayActorCount:0,framebuffer:null,depthRequested:!1};function Qm(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jm,r),Wm.extend(e,t,r),zt.get(e,t,["framebuffer","opaqueActorCount","translucentActorCount","volumeCount"]),function(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t.deleted)return;t._currentParent=n,e.setCurrentOperation("buildPass"),r.traverse(e);const o=r.getRenderable().getNumberOfLayers(),i=r.getRenderable().getRenderersByReference();for(let n=0;n<o;n++)for(let o=0;o<i.length;o++){const a=i[o],s=r.getViewNodeFor(a);if(a.getDraw()&&a.getLayer()===n){if(t.opaqueActorCount=0,t.translucentActorCount=0,t.volumeCount=0,t.overlayActorCount=0,e.setCurrentOperation("queryPass"),s.traverse(e),(t.opaqueActorCount>0||t.translucentActorCount>0)&&t.volumeCount>0||t.depthRequested){const n=r.getFramebufferSize();null===t.framebuffer&&(t.framebuffer=Gm.newInstance()),t.framebuffer.setOpenGLRenderWindow(r),t.framebuffer.saveCurrentBindingsAndBuffers();const o=t.framebuffer.getSize();null!==o&&o[0]===n[0]&&o[1]===n[1]||(t.framebuffer.create(n[0],n[1]),t.framebuffer.populateFramebuffer()),t.framebuffer.bind(),e.setCurrentOperation("zBufferPass"),s.traverse(e),t.framebuffer.restorePreviousBindingsAndBuffers(),t.depthRequested=!1}e.setCurrentOperation("cameraPass"),s.traverse(e),t.opaqueActorCount>0&&(e.setCurrentOperation("opaquePass"),s.traverse(e)),t.translucentActorCount>0&&(t.translucentPass||(t.translucentPass=Ym.newInstance()),t.translucentPass.traverse(r,s,e)),t.volumeCount>0&&(e.setCurrentOperation("volumePass"),s.traverse(e)),t.overlayActorCount>0&&(e.setCurrentOperation("overlayPass"),s.traverse(e))}}},e.getZBufferTexture=()=>t.framebuffer?t.framebuffer.getColorTexture():null,e.requestDepth=()=>{t.depthRequested=!0},e.incrementOpaqueActorCount=()=>t.opaqueActorCount++,e.incrementTranslucentActorCount=()=>t.translucentActorCount++,e.incrementVolumeCount=()=>t.volumeCount++,e.incrementOverlayActorCount=()=>t.overlayActorCount++}(e,t)}var Zm={newInstance:zt.newInstance(Qm,"vtkForwardPass"),extend:Qm};const{FieldAssociations:eg}=Gs,tg={fieldAssociation:eg.FIELD_ASSOCIATION_CELLS,captureZValues:!1};function rg(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,tg,r),zt.obj(e,t),zt.setGet(e,t,["fieldAssociation","captureZValues"]),function(e,t){t.classHierarchy.push("vtkHardwareSelector"),e.getSourceDataAsync=async(e,t,r,n,o)=>{},e.selectAsync=async(t,r,n,o,i)=>{const a=await e.getSourceDataAsync(t,r,n,o,i);return a?a.generateSelection(r,n,o,i):[]}}(e,t)}var ng={newInstance:zt.newInstance(rg,"vtkHardwareSelector"),extend:rg};const og={contentType:-1,fieldType:-1,properties:null,selectionList:[]};function ig(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,og,r),zt.obj(e,t),t.properties={},zt.setGet(e,t,["contentType","fieldType","properties","selectionList"]),function(e,t){t.classHierarchy.push("vtkSelectionNode"),e.getBounds=()=>t.points.getBounds()}(e,t)}var ag={newInstance:zt.newInstance(ig,"vtkSelectionNode"),extend:ig,SelectionContent:{GLOBALIDS:0,PEDIGREEIDS:1,VALUES:2,INDICES:3,FRUSTUM:4,LOCATIONS:5,THRESHOLDS:6,BLOCKS:7,QUERY:8},SelectionField:{CELL:0,POINT:1,FIELD:2,VERTEX:3,EDGE:4,ROW:5}};const{PassTypes:sg}=wl,{SelectionContent:lg,SelectionField:ug}=ag,{FieldAssociations:cg}=Gs,{vtkErrorMacro:dg}=zt;function pg(e){return`${e.propID} ${e.compositeID}`}function fg(e,t,r,n){return r?r[4*(t*(n[2]-n[0]+1)+e)+3]:0}function hg(e,t,r,n){if(!r)return 0;const o=4*(t*(n[2]-n[0]+1)+e),i=r[o],a=r[o+1];return 256*(256*r[o+2]+a)+i}function mg(e,t){let r=t;return r<<=24,r|=e,r}function gg(e,t,r,n){const o=r<0?0:r;if(0===o){if(n[0]=t[0],n[1]=t[1],t[0]<e.area[0]||t[0]>e.area[2]||t[1]<e.area[1]||t[1]>e.area[3])return null;const r=[t[0]-e.area[0],t[1]-e.area[1]],o=hg(r[0],r[1],e.pixBuffer[sg.ACTOR_PASS],e.area);if(o<=0||o-1>=e.props.length)return null;const i={valid:!0};i.propID=o-1,i.prop=e.props[i.propID];let a=hg(r[0],r[1],e.pixBuffer[sg.COMPOSITE_INDEX_PASS],e.area);if((a<0||a>16777215)&&(a=0),i.compositeID=a-1,e.captureZValues){const n=4*(r[1]*(e.area[2]-e.area[0]+1)+r[0]);i.zValue=(256*e.zBuffer[n]+e.zBuffer[n+1])/65535,i.displayPosition=t}if(e.pixBuffer[sg.ID_LOW24]&&0===fg(r[0],r[1],e.pixBuffer[sg.ID_LOW24],e.area))return i;const s=hg(r[0],r[1],e.pixBuffer[sg.ID_LOW24],e.area),l=hg(r[0],r[1],e.pixBuffer[sg.ID_HIGH24],e.area);return i.attributeID=mg(s,l),i}const i=[t[0],t[1]],a=[0,0];let s=gg(e,t,0,n);if(s&&s.valid)return s;for(let t=1;t<o;++t){for(let r=i[1]>t?i[1]-t:0;r<=i[1]+t;++r){if(a[1]=r,i[0]>=t&&(a[0]=i[0]-t,s=gg(e,a,0,n),s&&s.valid))return s;if(a[0]=i[0]+t,s=gg(e,a,0,n),s&&s.valid)return s}for(let r=i[0]>=t?i[0]-(t-1):0;r<=i[0]+(t-1);++r){if(a[0]=r,i[1]>=t&&(a[1]=i[1]-t,s=gg(e,a,0,n),s&&s.valid))return s;if(a[1]=i[1]+t,s=gg(e,a,0,n),s&&s.valid)return s}}return n[0]=t[0],n[1]=t[1],null}function yg(e,t,r,n,o){const i=[];let a=0;return t.forEach((t,s)=>{const l=ag.newInstance();switch(l.setContentType(lg.INDICES),e){case cg.FIELD_ASSOCIATION_CELLS:l.setFieldType(ug.CELL);break;case cg.FIELD_ASSOCIATION_POINTS:l.setFieldType(ug.POINT);break;default:dg("Unknown field association")}l.getProperties().propID=t.info.propID,l.getProperties().prop=t.info.prop,l.getProperties().compositeID=t.info.compositeID,l.getProperties().attributeID=t.info.attributeID,l.getProperties().pixelCount=t.pixelCount,r&&(l.getProperties().displayPosition=[t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue],l.getProperties().worldPosition=o.displayToWorld(t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue,n)),l.setSelectionList(t.attributeIDs),i[a]=l,a++}),i}const vg={area:void 0,currentPass:-1,propColorValue:null,props:null,maximumPointId:0,maximumCellId:0,idOffset:1};function bg(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,vg,r),ng.extend(e,t,r),t.propColorValue=[0,0,0],t.props=[],t.area||(t.area=[0,0,0,0]),zt.setGetArray(e,t,["area"],4),zt.setGet(e,t,["_renderer","currentPass","_openGLRenderWindow","maximumPointId","maximumCellId"]),zt.setGetArray(e,t,["propColorValue"],3),zt.moveToProtected(e,t,["renderer","openGLRenderWindow"]),zt.event(e,t,"event"),function(e,t){t.classHierarchy.push("vtkOpenGLHardwareSelector"),e.releasePixBuffers=()=>{t.rawPixBuffer=[],t.pixBuffer=[],t.zBuffer=null},e.beginSelection=()=>{t._openGLRenderer=t._openGLRenderWindow.getViewNodeFor(t._renderer,t._openGLRenderer),t.maxAttributeId=0;const r=t._openGLRenderWindow.getSize();if(t.framebuffer){t.framebuffer.setOpenGLRenderWindow(t._openGLRenderWindow),t.framebuffer.saveCurrentBindingsAndBuffers();const e=t.framebuffer.getSize();e&&e[0]===r[0]&&e[1]===r[1]?t.framebuffer.bind():(t.framebuffer.create(r[0],r[1]),t.framebuffer.populateFramebuffer())}else t.framebuffer=Gm.newInstance(),t.framebuffer.setOpenGLRenderWindow(t._openGLRenderWindow),t.framebuffer.saveCurrentBindingsAndBuffers(),t.framebuffer.create(r[0],r[1]),t.framebuffer.populateFramebuffer();if(t._openGLRenderer.clear(),t._openGLRenderer.setSelector(e),t.hitProps={},t.propPixels={},t.props=[],e.releasePixBuffers(),t.fieldAssociation===cg.FIELD_ASSOCIATION_POINTS){const e=t._openGLRenderWindow.getContext(),r=e.isEnabled(e.BLEND);e.disable(e.BLEND),t._openGLRenderWindow.traverseAllPasses(),r&&e.enable(e.BLEND)}},e.endSelection=()=>{t.hitProps={},t._openGLRenderer.setSelector(null),t.framebuffer.restorePreviousBindingsAndBuffers()},e.preCapturePass=()=>{const e=t._openGLRenderWindow.getContext();t.originalBlending=e.isEnabled(e.BLEND),e.disable(e.BLEND)},e.postCapturePass=()=>{const e=t._openGLRenderWindow.getContext();t.originalBlending&&e.enable(e.BLEND)},e.select=()=>{let r=null;return e.captureBuffers()&&(r=e.generateSelection(t.area[0],t.area[1],t.area[2],t.area[3]),e.releasePixBuffers()),r},e.getSourceDataAsync=async(r,n,o,i,a)=>{if(t._renderer=r,void 0===n){const r=t._openGLRenderWindow.getSize();e.setArea(0,0,r[0]-1,r[1]-1)}else e.setArea(n,o,i,a);if(!e.captureBuffers())return!1;const s={area:[...t.area],pixBuffer:[...t.pixBuffer],captureZValues:t.captureZValues,zBuffer:t.zBuffer,props:[...t.props],fieldAssociation:t.fieldAssociation,renderer:r,openGLRenderWindow:t._openGLRenderWindow,generateSelection:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e,t,r,n,o){const i=Math.floor(t),a=Math.floor(r),s=Math.floor(n),l=Math.floor(o),u=new Map,c=[0,0];for(let t=a;t<=l;t++)for(let r=i;r<=s;r++){const n=gg(e,[r,t],0,c);if(n&&n.valid){const t=pg(n);if(u.has(t)){const r=u.get(t);r.pixelCount++,e.captureZValues&&n.zValue<r.info.zValue&&(r.info=n),-1===r.attributeIDs.indexOf(n.attributeID)&&r.attributeIDs.push(n.attributeID)}else u.set(t,{info:n,pixelCount:1,attributeIDs:[n.attributeID]})}}return yg(e.fieldAssociation,u,e.captureZValues,e.renderer,e.openGLRenderWindow)}(s,...t)}};return s},e.captureBuffers=()=>{if(!t._renderer||!t._openGLRenderWindow)return dg("Renderer and view must be set before calling Select."),!1;t._openGLRenderer=t._openGLRenderWindow.getViewNodeFor(t._renderer,t._openGLRenderer),t._openGLRenderWindow.getRenderable().preRender(),e.invokeEvent({type:"StartEvent"}),t.originalBackground=t._renderer.getBackgroundByReference(),t._renderer.setBackground(0,0,0,0);const r=t._openGLRenderWindow.getRenderPasses();e.beginSelection();const n=[];for(t.currentPass=sg.MIN_KNOWN_PASS;t.currentPass<=sg.MAX_KNOWN_PASS;t.currentPass++)e.passRequired(t.currentPass)&&(e.preCapturePass(t.currentPass),t.captureZValues&&t.currentPass===sg.ACTOR_PASS&&"function"==typeof r[0].requestDepth&&"function"==typeof r[0].getFramebuffer?(r[0].requestDepth(),t._openGLRenderWindow.traverseAllPasses()):t._openGLRenderWindow.traverseAllPasses(),e.postCapturePass(t.currentPass),e.savePixelBuffer(t.currentPass),n.push(t.currentPass));return n.forEach(r=>{t.currentPass=r,e.processPixelBuffers()}),t.currentPass=sg.MAX_KNOWN_PASS,e.endSelection(),t._renderer.setBackground(t.originalBackground),e.invokeEvent({type:"EndEvent"}),!0},e.processPixelBuffers=()=>{t.props.forEach((r,n)=>{e.isPropHit(n)&&r.processSelectorPixelBuffers(e,t.propPixels[n])})},e.passRequired=e=>{if(e===sg.ID_HIGH24){if(t.fieldAssociation===cg.FIELD_ASSOCIATION_POINTS)return t.maximumPointId>16777215;if(t.fieldAssociation===cg.FIELD_ASSOCIATION_CELLS)return t.maximumCellId>16777215}return!0},e.savePixelBuffer=r=>{if(t.pixBuffer[r]=t._openGLRenderWindow.getPixelData(t.area[0],t.area[1],t.area[2],t.area[3]),!t.rawPixBuffer[r]){const e=(t.area[2]-t.area[0]+1)*(t.area[3]-t.area[1]+1)*4;t.rawPixBuffer[r]=new Uint8Array(e),t.rawPixBuffer[r].set(t.pixBuffer[r])}if(r===sg.ACTOR_PASS){if(t.captureZValues){const e=t._openGLRenderWindow.getRenderPasses();if("function"==typeof e[0].requestDepth&&"function"==typeof e[0].getFramebuffer){const r=e[0].getFramebuffer();r.saveCurrentBindingsAndBuffers(),r.bind(),t.zBuffer=t._openGLRenderWindow.getPixelData(t.area[0],t.area[1],t.area[2],t.area[3]),r.restorePreviousBindingsAndBuffers()}}e.buildPropHitList(t.rawPixBuffer[r])}},e.buildPropHitList=e=>{let r=0;for(let n=0;n<=t.area[3]-t.area[1];n++)for(let o=0;o<=t.area[2]-t.area[0];o++){let i=hg(o,n,e,t.area);i>0&&(i--,i in t.hitProps||(t.hitProps[i]=!0,t.propPixels[i]=[]),t.propPixels[i].push(4*r)),++r}},e.renderProp=r=>{t.currentPass===sg.ACTOR_PASS&&(e.setPropColorValueFromInt(t.props.length+1),t.props.push(r))},e.renderCompositeIndex=r=>{t.currentPass===sg.COMPOSITE_INDEX_PASS&&e.setPropColorValueFromInt(r+1)},e.renderAttributeId=e=>{e<0||(t.maxAttributeId=e>t.maxAttributeId?e:t.maxAttributeId)},e.passTypeToString=e=>zt.enumToString(sg,e),e.isPropHit=e=>Boolean(t.hitProps[e]),e.setPropColorValueFromInt=e=>{t.propColorValue[0]=e%256/255,t.propColorValue[1]=Math.floor(e/256)%256/255,t.propColorValue[2]=Math.floor(e/65536)%256/255},e.getPixelInformation=(r,n,o)=>{const i=n<0?0:n;if(console.log("getPixelInformation called",i),0===i){if(o[0]=r[0],o[1]=r[1],r[0]<t.area[0]||r[0]>t.area[2]||r[1]<t.area[1]||r[1]>t.area[3])return null;console.log(r),console.log(t.area);const e=[r[0]-t.area[0],r[1]-t.area[1]];console.log("adjusted displayPosition",e);const n=hg(e[0],e[1],t.pixBuffer[sg.ACTOR_PASS],t.area);if(console.log("actorid",n),n<=0||n-1>=t.props.length)return null;const i={valid:!0};i.propID=n-1,i.prop=t.props[i.propID];let a=hg(e[0],e[1],t.pixBuffer[sg.COMPOSITE_INDEX_PASS],t.area);if((a<0||a>16777215)&&(a=0),i.compositeID=a-1,t.captureZValues){const n=4*(e[1]*(t.area[2]-t.area[0]+1)+e[0]);i.zValue=(256*t.zBuffer[n]+t.zBuffer[n+1])/65535,i.displayPosition=r}if(t.pixBuffer[sg.ID_LOW24]&&0===fg(e[0],e[1],t.pixBuffer[sg.ID_LOW24],t.area))return i;const s=hg(e[0],e[1],t.pixBuffer[sg.ID_LOW24],t.area),l=hg(e[0],e[1],t.pixBuffer[sg.ID_HIGH24],t.area);return i.attributeID=mg(s,l),i}const a=[r[0],r[1]],s=[0,0];let l=e.getPixelInformation(r,0,o);if(l&&l.valid)return l;for(let t=1;t<i;++t){for(let r=a[1]>t?a[1]-t:0;r<=a[1]+t;++r){if(s[1]=r,a[0]>=t&&(s[0]=a[0]-t,l=e.getPixelInformation(s,0,o),l&&l.valid))return l;if(s[0]=a[0]+t,l=e.getPixelInformation(s,0,o),l&&l.valid)return l}for(let r=a[0]>=t?a[0]-(t-1):0;r<=a[0]+(t-1);++r){if(s[0]=r,a[1]>=t&&(s[1]=a[1]-t,l=e.getPixelInformation(s,0,o),l&&l.valid))return l;if(s[1]=a[1]+t,l=e.getPixelInformation(s,0,o),l&&l.valid)return l}}return o[0]=r[0],o[1]=r[1],null},e.generateSelection=(r,n,o,i)=>{const a=Math.floor(r),s=Math.floor(n),l=Math.floor(o),u=Math.floor(i),c=new Map,d=[0,0];for(let r=s;r<=u;r++)for(let n=a;n<=l;n++){const o=[n,r],i=e.getPixelInformation(o,0,d);if(i&&i.valid){const e=pg(i);if(c.has(e)){const r=c.get(e);r.pixelCount++,t.captureZValues&&i.zValue<r.info.zValue&&(r.info=i),-1===r.attributeIDs.indexOf(i.attributeID)&&r.attributeIDs.push(i.attributeID)}else c.set(e,{info:i,pixelCount:1,attributeIDs:[i.attributeID]})}}return yg(t.fieldAssociation,c,t.captureZValues,t._renderer,t._openGLRenderWindow)},e.getRawPixelBuffer=e=>t.rawPixBuffer[e],e.getPixelBuffer=e=>t.pixBuffer[e],e.attach=(e,r)=>{t._openGLRenderWindow=e,t._renderer=r};const r=e.setArea;e.setArea=function(){return!!r(...arguments)&&(t.area[0]=Math.floor(t.area[0]),t.area[1]=Math.floor(t.area[1]),t.area[2]=Math.floor(t.area[2]),t.area[3]=Math.floor(t.area[3]),!0)}}(e,t)}var xg={newInstance:zt.newInstance(bg,"vtkOpenGLHardwareSelector"),extend:bg,...wl},_g=r(735);const Sg=["lastShaderProgramBound","context","_openGLRenderWindow"],Cg={lastShaderProgramBound:null,shaderPrograms:null,context:null};function Tg(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cg,r),t.shaderPrograms={},zt.obj(e,t),zt.setGet(e,t,Sg),zt.moveToProtected(e,t,["openGLRenderWindow"]),function(e,t){t.classHierarchy.push("vtkShaderCache"),e.replaceShaderValues=(e,r,n)=>{let o=r;n.length>0&&(o=rd.substitute(o,"VSOut","GSOut").result);const i=t._openGLRenderWindow.getWebgl2();let a="\n",s="#version 100\n";i?s="#version 300 es\n#define attribute in\n#define textureCube texture\n#define texture2D texture\n#define textureCubeLod textureLod\n#define texture2DLod textureLod\n":(t.context.getExtension("OES_standard_derivatives"),t.context.getExtension("EXT_frag_depth")&&(a="#extension GL_EXT_frag_depth : enable\n"),t.context.getExtension("EXT_shader_texture_lod")&&(a+="#extension GL_EXT_shader_texture_lod : enable\n#define textureCubeLod textureCubeLodEXT\n#define texture2DLod texture2DLodEXT")),o=rd.substitute(o,"//VTK::System::Dec",[`${s}\n`,i?"":"#extension GL_OES_standard_derivatives : enable\n",a,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;let l=rd.substitute(e,"//VTK::System::Dec",[`${s}\n`,"#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","precision highp int;","#else","precision mediump float;","precision mediump int;","#endif"]).result;if(i){l=rd.substitute(l,"varying","out").result,o=rd.substitute(o,"varying","in").result;let e="",t=0;for(;o.includes(`gl_FragData[${t}]`);)o=rd.substitute(o,`gl_FragData\\[${t}\\]`,`fragOutput${t}`).result,e+=`layout(location = ${t}) out vec4 fragOutput${t};\n`,t++;o=rd.substitute(o,"//VTK::Output::Dec",e).result}return{VSSource:l,FSSource:o,GSSource:rd.substitute(n,"//VTK::System::Dec",s).result}},e.readyShaderProgramArray=(t,r,n)=>{const o=e.replaceShaderValues(t,r,n),i=e.getShaderProgram(o.VSSource,o.FSSource,o.GSSource);return e.readyShaderProgram(i)},e.readyShaderProgram=t=>t&&(t.getCompiled()||t.compileShader())&&e.bindShaderProgram(t)?t:null,e.getShaderProgram=(e,r,n)=>{const o=`${e}${r}${n}`,i=_g.hash(o);if(!(i in t.shaderPrograms)){const o=rd.newInstance();return o.setContext(t.context),o.getVertexShader().setSource(e),o.getFragmentShader().setSource(r),n&&o.getGeometryShader().setSource(n),o.setMd5Hash(i),t.shaderPrograms[i]=o,o}return t.shaderPrograms[i]},e.releaseGraphicsResources=r=>{e.releaseCurrentShaderProgram(),Object.keys(t.shaderPrograms).map(e=>t.shaderPrograms[e]).forEach(e=>e.cleanup()),t.shaderPrograms={}},e.releaseCurrentShaderProgram=()=>{t.lastShaderProgramBound&&(t.lastShaderProgramBound.cleanup(),t.lastShaderProgramBound=null)},e.bindShaderProgram=e=>(t.lastShaderProgramBound===e||(t.lastShaderProgramBound&&t.lastShaderProgramBound.release(),e.bind(),t.lastShaderProgramBound=e),1)}(e,t)}var wg={newInstance:zt.newInstance(Tg,"vtkShaderCache"),extend:Tg};const{vtkErrorMacro:Ag}=zt,Eg={context:null,numberOfTextureUnits:0,textureUnits:0};function Dg(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Eg,r),zt.obj(e,t),t.textureUnits=[],zt.get(e,t,["numberOfTextureUnits"]),zt.setGet(e,t,["context"]),function(e,t){t.classHierarchy.push("vtkOpenGLTextureUnitManager"),e.deleteTable=()=>{for(let e=0;e<t.numberOfTextureUnits;++e)!0===t.textureUnits[e]&&Ag("some texture units were not properly released");t.textureUnits=[],t.numberOfTextureUnits=0},e.setContext=r=>{if(t.context!==r){if(0!==t.context&&e.deleteTable(),t.context=r,t.context){t.numberOfTextureUnits=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS);for(let e=0;e<t.numberOfTextureUnits;++e)t.textureUnits[e]=!1}e.modified()}},e.allocate=()=>{for(let r=0;r<t.numberOfTextureUnits;r++)if(!e.isAllocated(r))return t.textureUnits[r]=!0,r;return-1},e.allocateUnit=r=>e.isAllocated(r)?-1:(t.textureUnits[r]=!0,r),e.isAllocated=e=>t.textureUnits[e],e.free=e=>{t.textureUnits[e]=!1},e.freeAll=()=>{for(let e=0;e<t.numberOfTextureUnits;++e)t.textureUnits[e]=!1}}(e,t)}var Pg={newInstance:zt.newInstance(Dg,"vtkOpenGLTextureUnitManager"),extend:Dg};const Ig={size:void 0,selector:void 0};function Og(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ig,r),t.size||(t.size=[300,300]),zt.getArray(e,t,["size"],2),zt.get(e,t,["selector"]),Xt.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkRenderWindowViewNode"),e.getViewNodeFactory=()=>null,e.getAspectRatio=()=>t.size[0]/t.size[1],e.getAspectRatioForRenderer=e=>{const r=e.getViewportByReference();return t.size[0]*(r[2]-r[0])/((r[3]-r[1])*t.size[1])},e.isInViewport=(t,r,n)=>{const o=n.getViewportByReference(),i=e.getFramebufferSize();return o[0]*i[0]<=t&&o[2]*i[0]>=t&&o[1]*i[1]<=r&&o[3]*i[1]>=r},e.getViewportSize=t=>{const r=t.getViewportByReference(),n=e.getFramebufferSize();return[(r[2]-r[0])*n[0],(r[3]-r[1])*n[1]]},e.getViewportCenter=t=>{const r=e.getViewportSize(t);return[.5*r[0],.5*r[1]]},e.displayToNormalizedDisplay=(t,r,n)=>{const o=e.getFramebufferSize();return[t/o[0],r/o[1],n]},e.normalizedDisplayToDisplay=(t,r,n)=>{const o=e.getFramebufferSize();return[t*o[0],r*o[1],n]},e.worldToView=(e,t,r,n)=>n.worldToView(e,t,r),e.viewToWorld=(e,t,r,n)=>n.viewToWorld(e,t,r),e.worldToDisplay=(t,r,n,o)=>{const i=o.worldToView(t,r,n),a=e.getViewportSize(o),s=o.viewToProjection(i[0],i[1],i[2],a[0]/a[1]),l=o.projectionToNormalizedDisplay(s[0],s[1],s[2]);return e.normalizedDisplayToDisplay(l[0],l[1],l[2])},e.displayToWorld=(t,r,n,o)=>{const i=e.displayToNormalizedDisplay(t,r,n),a=o.normalizedDisplayToProjection(i[0],i[1],i[2]),s=e.getViewportSize(o),l=o.projectionToView(a[0],a[1],a[2],s[0]/s[1]);return o.viewToWorld(l[0],l[1],l[2])},e.normalizedDisplayToViewport=(t,r,n,o)=>{let i=o.getViewportByReference();i=e.normalizedDisplayToDisplay(i[0],i[1],0);const a=e.normalizedDisplayToDisplay(t,r,n);return[a[0]-i[0]-.5,a[1]-i[1]-.5,n]},e.viewportToNormalizedViewport=(t,r,n,o)=>{const i=e.getViewportSize(o);return i&&0!==i[0]&&0!==i[1]?[t/(i[0]-1),r/(i[1]-1),n]:[t,r,n]},e.normalizedViewportToViewport=(t,r,n,o)=>{const i=e.getViewportSize(o);return[t*(i[0]-1),r*(i[1]-1),n]},e.displayToLocalDisplay=(t,r,n)=>[t,e.getFramebufferSize()[1]-r-1,n],e.viewportToNormalizedDisplay=(t,r,n,o)=>{let i=o.getViewportByReference();i=e.normalizedDisplayToDisplay(i[0],i[1],0);const a=t+i[0]+.5,s=r+i[1]+.5;return e.displayToNormalizedDisplay(a,s,n)},e.getComputedDevicePixelRatio=()=>t.size[0]/e.getContainerSize()[0],e.getContainerSize=()=>{zt.vtkErrorMacro("not implemented")},e.getPixelData=(e,t,r,n)=>{zt.vtkErrorMacro("not implemented")},e.createSelector=()=>{zt.vtkErrorMacro("not implemented")}}(e,t)}var Ng={newInstance:zt.newInstance(Og,"vtkRenderWindowViewNode"),extend:Og};const{vtkDebugMacro:Mg,vtkErrorMacro:Rg}=zt,Fg={position:"absolute",top:0,left:0,width:"100%",height:"100%"},Bg=["activateTexture","deactivateTexture","disableCullFace","enableCullFace","get3DContext","getActiveFramebuffer","getContext","getDefaultTextureByteSize","getDefaultTextureInternalFormat","getDefaultToWebgl2","getGLInformations","getGraphicsMemoryInfo","getGraphicsResourceForObject","getHardwareMaximumLineWidth","getPixelData","getShaderCache","getTextureUnitForTexture","getTextureUnitManager","getWebgl2","makeCurrent","releaseGraphicsResources","registerGraphicsResourceUser","unregisterGraphicsResourceUser","restoreContext","setActiveFramebuffer","setContext","setDefaultToWebgl2","setGraphicsResourceForObject"];function Lg(e,t,r){const n=e.createFramebuffer(),o=e.createTexture();e.bindTexture(e.TEXTURE_2D,o),e.texImage2D(e.TEXTURE_2D,0,t,2,2,0,t,r,null),e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,o,0);const i=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),i===e.FRAMEBUFFER_COMPLETE}let kg=0;const Ug=[];function Vg(e){e.preventDefault()}function Gg(e,t){let r;t.classHierarchy.push("vtkOpenGLRenderWindow"),e.getViewNodeFactory=()=>t.myFactory,t.canvas.addEventListener("webglcontextlost",Vg,!1),t.canvas.addEventListener("webglcontextrestored",e.restoreContext,!1);const n=[0,0];let o;e.onModified(function(){t.renderable&&(t.size[0]===n[0]&&t.size[1]===n[1]||(n[0]=t.size[0],n[1]=t.size[1],t.canvas.setAttribute("width",t.size[0]),t.canvas.setAttribute("height",t.size[1]))),t.viewStream&&t.viewStream.setSize(t.size[0],t.size[1]),t.canvas.style.display=t.useOffScreen?"none":"block",t.el&&(t.el.style.cursor=t.cursorVisibility?t.cursor:"none"),t.containerSize=null}),e.buildPass=r=>{if(r){if(!t.renderable)return;e.prepareNodes(),e.addMissingNodes(t.renderable.getRenderersByReference()),e.addMissingNodes(t.renderable.getChildRenderWindowsByReference()),e.removeUnusedNodes(),e.initialize(),t.children.forEach(t=>{t.setOpenGLRenderWindow?.(e)})}},e.initialize=()=>{if(!t.initialized){if(t.rootOpenGLRenderWindow=e.getLastAncestorOfType("vtkOpenGLRenderWindow"),t.rootOpenGLRenderWindow)t.context2D=e.get2DContext();else{t.context=e.get3DContext(),e.resizeFromChildRenderWindows(),t.context&&(kg++,Ug.forEach(e=>e(kg))),t.textureUnitManager=Pg.newInstance(),t.textureUnitManager.setContext(t.context),t.shaderCache.setContext(t.context);const r=t.context;r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA),r.depthFunc(r.LEQUAL),r.enable(r.BLEND)}t.initialized=!0}},e.makeCurrent=()=>{t.context.makeCurrent()},e.setContainer=r=>{t.el&&t.el!==r&&(t.canvas.parentNode!==t.el&&Rg("Error: canvas parent node does not match container"),t.el.removeChild(t.canvas),t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)),t.el!==r&&(t.el=r,t.el&&(t.el.appendChild(t.canvas),t.useBackgroundImage&&t.el.appendChild(t.bgImage)),e.modified())},e.getContainer=()=>t.el,e.getContainerSize=()=>{if(!t.containerSize&&t.el){const{width:e,height:r}=t.el.getBoundingClientRect();t.containerSize=[e,r]}return t.containerSize||t.size},e.getFramebufferSize=()=>{const e=t.activeFramebuffer?.getSize();return e||t.size},e.getPixelData=(e,r,n,o)=>{const i=new Uint8Array((n-e+1)*(o-r+1)*4);return t.context.readPixels(e,r,n-e+1,o-r+1,t.context.RGBA,t.context.UNSIGNED_BYTE,i),i},e.get3DContext=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{preserveDrawingBuffer:!1,depth:!0,alpha:!0,powerPreference:"high-performance"},n=null;const o="undefined"!=typeof WebGL2RenderingContext;return t.webgl2=!1,t.defaultToWebgl2&&o&&(n=t.canvas.getContext("webgl2",e),n&&(t.webgl2=!0,Mg("using webgl2"))),n||(Mg("using webgl1"),n=t.canvas.getContext("webgl",e)||t.canvas.getContext("experimental-webgl",e)),n||Rg("no webgl context"),new Proxy(n,(r||(r=function(){const e=new Map,t={apply:(t,r,n)=>e.has(n[0])?e.get(n[0]):t.apply(r,n)},r=Object.create(null);return r.getParameter=(e,r,n,o)=>new Proxy(o.bind(e),t),r.depthMask=(t,r,n,o)=>{return new Proxy(o.bind(t),(i=t.DEPTH_WRITEMASK,{apply:(t,r,n)=>(e.set(i,n[0]),t.apply(r,n))}));var i},{get(e,t,n){if("__getUnderlyingContext"===t)return()=>e;let o=Reflect.get(e,t,e);o instanceof Function&&(o=o.bind(e));const i=r[t];return i?i(e,t,n,o):o}}}()),r))},e.get2DContext=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.canvas.getContext("2d",e)},e.restoreContext=()=>{const t=Wm.newInstance();t.setCurrentOperation("Release"),t.traverse(e,null)},e.activateTexture=r=>{const n=t._textureResourceIds.get(r);if(void 0!==n)return void t.context.activeTexture(t.context.TEXTURE0+n);const o=e.getTextureUnitManager().allocate();o<0?Rg("Hardware does not support the number of textures defined."):(t._textureResourceIds.set(r,o),t.context.activeTexture(t.context.TEXTURE0+o))},e.deactivateTexture=r=>{const n=t._textureResourceIds.get(r);void 0!==n&&(e.getTextureUnitManager().free(n),t._textureResourceIds.delete(r))},e.getTextureUnitForTexture=e=>{const r=t._textureResourceIds.get(e);return void 0!==r?r:-1},e.getDefaultTextureByteSize=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.webgl2)switch(e){case us.CHAR:case us.SIGNED_CHAR:case us.UNSIGNED_CHAR:return 1;case r:case n:case us.UNSIGNED_SHORT:case us.SHORT:case us.VOID:return 2;default:return 4}return 1},e.getDefaultTextureInternalFormat=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.webgl2)switch(e){case us.UNSIGNED_CHAR:switch(r){case 1:return t.context.R8;case 2:return t.context.RG8;case 3:return t.context.RGB8;default:return t.context.RGBA8}case n&&!o&&us.UNSIGNED_SHORT:switch(r){case 1:return n.R16_EXT;case 2:return n.RG16_EXT;case 3:return n.RGB16_EXT;default:return n.RGBA16_EXT}case n&&!o&&us.SHORT:switch(r){case 1:return n.R16_SNORM_EXT;case 2:return n.RG16_SNORM_EXT;case 3:return n.RGB16_SNORM_EXT;default:return n.RGBA16_SNORM_EXT}default:switch(r){case 1:return o?t.context.R16F:t.context.R32F;case 2:return o?t.context.RG16F:t.context.RG32F;case 3:return o?t.context.RGB16F:t.context.RGB32F;default:return o?t.context.RGBA16F:t.context.RGBA32F}}switch(r){case 1:return t.context.LUMINANCE;case 2:return t.context.LUMINANCE_ALPHA;case 3:return t.context.RGB;default:return t.context.RGBA}},e.setBackgroundImage=e=>{t.bgImage.src=e.src},e.setUseBackgroundImage=e=>{t.useBackgroundImage=e,t.useBackgroundImage&&!t.el.contains(t.bgImage)?t.el.appendChild(t.bgImage):!t.useBackgroundImage&&t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)},e.captureNextImage=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",{resetCamera:n=!1,size:o=null,scale:i=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.deleted)return null;t.imageFormat=r;const a=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,t._screenshot={size:o||1!==i?o||t.size.map(e=>e*i):null},new Promise((r,o)=>{const i=e.onImageReady(o=>{if(null===t._screenshot.size)t.notifyStartCaptureImage=a,i.unsubscribe(),t._screenshot.placeHolder&&(t.size=t._screenshot.originalSize,e.modified(),t._screenshot.cameras&&t._screenshot.cameras.forEach(e=>{let{restoreParamsFn:t,arg:r}=e;return t(r)}),e.traverseAllPasses(),t.el.removeChild(t._screenshot.placeHolder),t._screenshot.placeHolder.remove(),t._screenshot=null),r(o);else{const r=document.createElement("img");if(r.style=Fg,r.src=o,t._screenshot.placeHolder=t.el.appendChild(r),t.canvas.style.display="none",t._screenshot.originalSize=t.size,t.size=t._screenshot.size,t.rootOpenGLRenderWindow?.resizeFromChildRenderWindows(),t._screenshot.size=null,e.modified(),n){const e=!0!==n;t._screenshot.cameras=t.renderable.getRenderers().map(t=>{const r=t.getActiveCamera(),o=r.get("focalPoint","position","parallelScale");return{resetCameraArgs:e?{renderer:t}:void 0,resetCameraFn:e?n:t.resetCamera,restoreParamsFn:r.set,arg:JSON.parse(JSON.stringify(o))}}),t._screenshot.cameras.forEach(e=>{let{resetCameraFn:t,resetCameraArgs:r}=e;return t(r)})}e.traverseAllPasses()}})})},e.getHardwareMaximumLineWidth=()=>{if(null!=o)return o;const t=e.get3DContext(),r=t.getParameter(t.ALIASED_LINE_WIDTH_RANGE);return o=r[1],r[1]},e.getGLInformations=()=>{if(t._glInformation)return t._glInformation;const r=e.get3DContext(),n=r.getExtension("OES_texture_float"),o=r.getExtension("OES_texture_half_float"),i=r.getExtension("WEBGL_debug_renderer_info"),a=r.getExtension("WEBGL_draw_buffers"),s=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),l=[["Max Vertex Attributes","MAX_VERTEX_ATTRIBS",r.getParameter(r.MAX_VERTEX_ATTRIBS)],["Max Varying Vectors","MAX_VARYING_VECTORS",r.getParameter(r.MAX_VARYING_VECTORS)],["Max Vertex Uniform Vectors","MAX_VERTEX_UNIFORM_VECTORS",r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS)],["Max Fragment Uniform Vectors","MAX_FRAGMENT_UNIFORM_VECTORS",r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS)],["Max Fragment Texture Image Units","MAX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS)],["Max Vertex Texture Image Units","MAX_VERTEX_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)],["Max Combined Texture Image Units","MAX_COMBINED_TEXTURE_IMAGE_UNITS",r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS)],["Max 2D Texture Size","MAX_TEXTURE_SIZE",r.getParameter(r.MAX_TEXTURE_SIZE)],["Max Cube Texture Size","MAX_CUBE_MAP_TEXTURE_SIZE",r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE)],["Max Texture Anisotropy","MAX_TEXTURE_MAX_ANISOTROPY_EXT",s&&r.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT)],["Point Size Range","ALIASED_POINT_SIZE_RANGE",r.getParameter(r.ALIASED_POINT_SIZE_RANGE).join(" - ")],["Line Width Range","ALIASED_LINE_WIDTH_RANGE",r.getParameter(r.ALIASED_LINE_WIDTH_RANGE).join(" - ")],["Max Viewport Dimensions","MAX_VIEWPORT_DIMS",r.getParameter(r.MAX_VIEWPORT_DIMS).join(" - ")],["Max Renderbuffer Size","MAX_RENDERBUFFER_SIZE",r.getParameter(r.MAX_RENDERBUFFER_SIZE)],["Framebuffer Red Bits","RED_BITS",r.getParameter(r.RED_BITS)],["Framebuffer Green Bits","GREEN_BITS",r.getParameter(r.GREEN_BITS)],["Framebuffer Blue Bits","BLUE_BITS",r.getParameter(r.BLUE_BITS)],["Framebuffer Alpha Bits","ALPHA_BITS",r.getParameter(r.ALPHA_BITS)],["Framebuffer Depth Bits","DEPTH_BITS",r.getParameter(r.DEPTH_BITS)],["Framebuffer Stencil Bits","STENCIL_BITS",r.getParameter(r.STENCIL_BITS)],["Framebuffer Subpixel Bits","SUBPIXEL_BITS",r.getParameter(r.SUBPIXEL_BITS)],["MSAA Samples","SAMPLES",r.getParameter(r.SAMPLES)],["MSAA Sample Buffers","SAMPLE_BUFFERS",r.getParameter(r.SAMPLE_BUFFERS)],["Supported Formats for UByte Render Targets ","UNSIGNED_BYTE RENDER TARGET FORMATS",[n&&Lg(r,r.RGBA,r.UNSIGNED_BYTE)?"RGBA":"",n&&Lg(r,r.RGB,r.UNSIGNED_BYTE)?"RGB":"",n&&Lg(r,r.LUMINANCE,r.UNSIGNED_BYTE)?"LUMINANCE":"",n&&Lg(r,r.ALPHA,r.UNSIGNED_BYTE)?"ALPHA":"",n&&Lg(r,r.LUMINANCE_ALPHA,r.UNSIGNED_BYTE)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Half Float Render Targets","HALF FLOAT RENDER TARGET FORMATS",[o&&Lg(r,r.RGBA,o.HALF_FLOAT_OES)?"RGBA":"",o&&Lg(r,r.RGB,o.HALF_FLOAT_OES)?"RGB":"",o&&Lg(r,r.LUMINANCE,o.HALF_FLOAT_OES)?"LUMINANCE":"",o&&Lg(r,r.ALPHA,o.HALF_FLOAT_OES)?"ALPHA":"",o&&Lg(r,r.LUMINANCE_ALPHA,o.HALF_FLOAT_OES)?"LUMINANCE_ALPHA":""].join(" ")],["Supported Formats for Full Float Render Targets","FLOAT RENDER TARGET FORMATS",[n&&Lg(r,r.RGBA,r.FLOAT)?"RGBA":"",n&&Lg(r,r.RGB,r.FLOAT)?"RGB":"",n&&Lg(r,r.LUMINANCE,r.FLOAT)?"LUMINANCE":"",n&&Lg(r,r.ALPHA,r.FLOAT)?"ALPHA":"",n&&Lg(r,r.LUMINANCE_ALPHA,r.FLOAT)?"LUMINANCE_ALPHA":""].join(" ")],["Max Multiple Render Targets Buffers","MAX_DRAW_BUFFERS_WEBGL",a?r.getParameter(a.MAX_DRAW_BUFFERS_WEBGL):0],["High Float Precision in Vertex Shader","HIGH_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).rangeMax,"</sup>)"].join("")],["Medium Float Precision in Vertex Shader","MEDIUM_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).rangeMax,"</sup>)"].join("")],["Low Float Precision in Vertex Shader","LOW_FLOAT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_FLOAT).rangeMax,"</sup>)"].join("")],["High Float Precision in Fragment Shader","HIGH_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).rangeMax,"</sup>)"].join("")],["Medium Float Precision in Fragment Shader","MEDIUM_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).rangeMax,"</sup>)"].join("")],["Low Float Precision in Fragment Shader","LOW_FLOAT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_FLOAT).rangeMax,"</sup>)"].join("")],["High Int Precision in Vertex Shader","HIGH_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_INT).rangeMax,"</sup>)"].join("")],["Medium Int Precision in Vertex Shader","MEDIUM_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_INT).rangeMax,"</sup>)"].join("")],["Low Int Precision in Vertex Shader","LOW_INT VERTEX_SHADER",[r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.LOW_INT).rangeMax,"</sup>)"].join("")],["High Int Precision in Fragment Shader","HIGH_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_INT).rangeMax,"</sup>)"].join("")],["Medium Int Precision in Fragment Shader","MEDIUM_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_INT).rangeMax,"</sup>)"].join("")],["Low Int Precision in Fragment Shader","LOW_INT FRAGMENT_SHADER",[r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).precision," (-2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMin,"</sup> - 2<sup>",r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.LOW_INT).rangeMax,"</sup>)"].join("")],["Supported Extensions","EXTENSIONS",r.getSupportedExtensions().join("<br/>\t\t\t\t\t ")],["WebGL Renderer","RENDERER",r.getParameter(r.RENDERER)],["WebGL Vendor","VENDOR",r.getParameter(r.VENDOR)],["WebGL Version","VERSION",r.getParameter(r.VERSION)],["Shading Language Version","SHADING_LANGUAGE_VERSION",r.getParameter(r.SHADING_LANGUAGE_VERSION)],["Unmasked Renderer","UNMASKED_RENDERER",i&&r.getParameter(i.UNMASKED_RENDERER_WEBGL)],["Unmasked Vendor","UNMASKED_VENDOR",i&&r.getParameter(i.UNMASKED_VENDOR_WEBGL)],["WebGL Version","WEBGL_VERSION",t.webgl2?2:1]],u={};for(;l.length;){const[e,t,r]=l.pop();t&&(u[t]={label:e,value:r})}return t._glInformation=u,u},e.traverseAllPasses=()=>{if(t.renderPasses)for(let r=0;r<t.renderPasses.length;++r)t.renderPasses[r].traverse(e,null);e.copyParentContent(),t.notifyStartCaptureImage&&function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.imageFormat;const n=document.createElement("canvas"),o=n.getContext("2d");n.width=t.canvas.width,n.height=t.canvas.height,o.drawImage(t.canvas,0,0);const i=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach(e=>{e.getViewProps().forEach(e=>{if(e.getContainer){const t=e.getContainer().getElementsByTagName("canvas");for(let e=0;e<t.length;e++){const r=t[e],n=r.getBoundingClientRect(),a=n.x-i.x,s=n.y-i.y;o.drawImage(r,a,s)}}})});const a=n.toDataURL(r);n.remove(),e.invokeImageReady(a)}();const r=t.renderable.getChildRenderWindowsByReference();for(let t=0;t<r.length;++t)e.getViewNodeFor(r[t])?.traverseAllPasses()},e.copyParentContent=()=>{const e=t.rootOpenGLRenderWindow;if(!e||!t.context2D||t.children.some(e=>!!e.getSelector?.()))return;const r=e.getCanvas(),n=t.canvas;t.context2D.drawImage(r,0,r.height-n.height,n.width,n.height,0,0,n.width,n.height)},e.resizeFromChildRenderWindows=()=>{const r=t.renderable.getChildRenderWindowsByReference();if(r.length>0){const t=[0,0];for(let n=0;n<r.length;++n){const o=e.getViewNodeFor(r[n])?.getSize();o&&(t[0]=o[0]>t[0]?o[0]:t[0],t[1]=o[1]>t[1]?o[1]:t[1])}e.setSize(...t)}},e.disableCullFace=()=>{t.cullFaceEnabled&&(t.context.disable(t.context.CULL_FACE),t.cullFaceEnabled=!1)},e.enableCullFace=()=>{t.cullFaceEnabled||(t.context.enable(t.context.CULL_FACE),t.cullFaceEnabled=!0)},e.setViewStream=r=>t.viewStream!==r&&(t.subscription&&(t.subscription.unsubscribe(),t.subscription=null),t.viewStream=r,t.viewStream&&(t.renderable.getRenderers()[0].getBackgroundByReference()[3]=0,e.setUseBackgroundImage(!0),t.subscription=t.viewStream.onImageReady(t=>e.setBackgroundImage(t.image)),t.viewStream.setSize(t.size[0],t.size[1]),t.viewStream.invalidateCache(),t.viewStream.render(),e.modified()),!0),e.createSelector=()=>{const t=xg.newInstance();return t.setOpenGLRenderWindow(e),t},e.delete=zt.chain(()=>{t.context&&(kg--,Ug.forEach(e=>e(kg))),e.setContainer(),e.setViewStream()},function(){t.canvas.removeEventListener("webglcontextlost",Vg),t.canvas.removeEventListener("webglcontextrestored",e.restoreContext)},e.delete),e.setActiveFramebuffer=e=>{t.activeFramebuffer=e};const i=e.setSize;e.setSize=(t,r)=>{const n=i(t,r);return n&&e.invokeWindowResizeEvent({width:t,height:r}),n},e.registerGraphicsResourceUser=(r,n)=>{t._graphicsResources.has(r)||e.setGraphicsResourceForObject(r,null,null);const o=t._graphicsResources.get(r);o?.users.add(n)},e.unregisterGraphicsResourceUser=(r,n)=>{const o=t._graphicsResources.get(r);o&&(o.users.delete(n),o.users.size||(o.oglObject?.releaseGraphicsResources(e),t._graphicsResources.delete(r)))},e.getGraphicsResourceForObject=e=>t._graphicsResources.get(e),e.setGraphicsResourceForObject=(r,n,o)=>{if(!r)return;const i=t._graphicsResources.get(r);i?.oglObject?.releaseGraphicsResources(e),t._graphicsResources.set(r,{coreObject:r,oglObject:n,hash:o,users:i?.users??new Set})},e.getGraphicsMemoryInfo=()=>{let e=0;return t._graphicsResources.forEach(t=>{let{oglObject:r}=t;e+=r.getAllocatedGPUMemoryInBytes()}),e},e.releaseGraphicsResources=()=>{null!==t.shaderCache&&t.shaderCache.releaseGraphicsResources(e),t._graphicsResources.forEach(t=>{let{oglObject:r}=t;r.releaseGraphicsResources(e)}),t._graphicsResources.clear(),null!==t.textureUnitManager&&t.textureUnitManager.freeAll(),t.renderable.getRenderersByReference().forEach(t=>{const r=e.getViewNodeFor(t);r?.releaseGraphicsResources()})};const a={...e};Bg.forEach(r=>{e[r]=function(){return t.rootOpenGLRenderWindow?t.rootOpenGLRenderWindow[r](...arguments):a[r](...arguments)}})}const zg={cullFaceEnabled:!1,shaderCache:null,initialized:!1,context:null,context2D:null,canvas:null,cursorVisibility:!0,cursor:"pointer",textureUnitManager:null,textureResourceIds:null,containerSize:null,renderPasses:[],notifyStartCaptureImage:!1,webgl2:!1,defaultToWebgl2:!0,activeFramebuffer:null,imageFormat:"image/png",useOffScreen:!1,useBackgroundImage:!1};function jg(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,zg,r),Ng.extend(e,t,r),t.canvas||(t.canvas=document.createElement("canvas"),t.canvas.style.width="100%"),t.selector||(t.selector=xg.newInstance(),t.selector.setOpenGLRenderWindow(e)),t.bgImage=new Image,t.bgImage.style.position="absolute",t.bgImage.style.left="0",t.bgImage.style.top="0",t.bgImage.style.width="100%",t.bgImage.style.height="100%",t.bgImage.style.zIndex="-1",t._textureResourceIds=new Map,t._graphicsResources=new Map,t._glInformation=null,t.myFactory=tr.newInstance(),t.shaderCache=wg.newInstance(),t.shaderCache.setOpenGLRenderWindow(e),t.renderPasses[0]=Zm.newInstance(),zt.get(e,t,["shaderCache","textureUnitManager","webgl2","useBackgroundImage","activeFramebuffer","rootOpenGLRenderWindow"]),zt.setGet(e,t,["initialized","context","context2D","canvas","renderPasses","notifyStartCaptureImage","defaultToWebgl2","cursor","useOffScreen"]),zt.setGetArray(e,t,["size"],2),zt.event(e,t,"imageReady"),zt.event(e,t,"windowResizeEvent"),Gg(e,t)}const Wg=zt.newInstance(jg,"vtkOpenGLRenderWindow");Zh("WebGL",Wg);var Hg={newInstance:Wg,extend:jg,pushMonitorGLContextCount:function(e){Ug.push(e)},popMonitorGLContextCount:function(e){return Ug.pop()}};Qt("vtkRenderWindow",Wg);const Kg=["setBindGroup","setIndexBuffer","setVertexBuffer","draw","drawIndexed"],Xg={description:null,handle:null,boundPipeline:null,pipelineHash:null,pipelineSettings:null,replaceShaderCodeFunction:null,depthTextureView:null,label:null};function $g(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Xg,r),mt(e,t),t.description={colorAttachments:[{view:void 0,loadOp:"load",storeOp:"store"}],depthStencilAttachment:{view:void 0,depthLoadOp:"clear",depthClearValue:0,depthStoreOp:"store"}},t.replaceShaderCodeFunction=e=>{const t=e.getShaderDescription("fragment");t.addOutput("vec4<f32>","outColor");let r=t.getCode();r=Np.substitute(r,"//VTK::RenderEncoder::Impl",["output.outColor = computedColor;"]).result,t.setCode(r)},t.pipelineSettings={primitive:{cullMode:"none"},depthStencil:{depthWriteEnabled:!0,depthCompare:"greater-equal",format:"depth32float"},fragment:{targets:[{format:"rgba16float",blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}}}]}},t.colorTextureViews=[],yt(e,t,["boundPipeline","colorTextureViews"]),_t(e,t,["depthTextureView","description","handle","label","pipelineHash","pipelineSettings","replaceShaderCodeFunction"]),function(e,t){t.classHierarchy.push("vtkWebGPURenderEncoder"),e.begin=e=>{t.drawCallbacks=[],t.handle=e.beginRenderPass(t.description),t.label&&t.handle.pushDebugGroup(t.label)},e.end=()=>{for(let r=0;r<t.drawCallbacks.length;r++){const n=t.drawCallbacks[r],o=n.pipeline;e.setPipeline(o);for(let t=0;t<n.callbacks.length;t++)n.callbacks[t](e)}t.label&&t.handle.popDebugGroup(),t.handle.end(),t.boundPipeline=null},e.setPipeline=e=>{if(t.boundPipeline===e)return;t.handle.setPipeline(e.getHandle());const r=e.getPipelineDescription();if(t.colorTextureViews.length!==r.fragment.targets.length)console.log(`mismatched attachment counts on pipeline ${r.fragment.targets.length} while encoder has ${t.colorTextureViews.length}`),console.trace();else for(let e=0;e<t.colorTextureViews.length;e++){const n=t.colorTextureViews[e].getTexture()?.getFormat();n&&n!==r.fragment.targets[e].format&&(console.log(`mismatched attachments for attachment ${e} on pipeline ${r.fragment.targets[e].format} while encoder has ${n}`),console.trace())}if(!t.depthTextureView!=!("depthStencil"in r))console.log("mismatched depth attachments"),console.trace();else if(t.depthTextureView){const e=t.depthTextureView.getTexture()?.getFormat();e&&e!==r.depthStencil.format&&(console.log(`mismatched depth attachments on pipeline ${r.depthStencil.format} while encoder has ${e}`),console.trace())}t.boundPipeline=e},e.replaceShaderCode=e=>{t.replaceShaderCodeFunction(e)},e.setColorTextureView=(e,r)=>{t.colorTextureViews[e]!==r&&(t.colorTextureViews[e]=r)},e.activateBindGroup=e=>{const r=t.boundPipeline.getDevice(),n=t.boundPipeline.getBindGroupLayoutCount(e.getLabel());t.handle.setBindGroup(n,e.getBindGroup(r));const o=r.getBindGroupLayoutDescription(e.getBindGroupLayout(r)),i=r.getBindGroupLayoutDescription(t.boundPipeline.getBindGroupLayout(n));o!==i&&(console.log(`renderEncoder ${t.pipelineHash} mismatched bind group layouts bind group has\n${o}\n versus pipeline\n${i}\n`),console.trace())},e.attachTextureViews=()=>{for(let e=0;e<t.colorTextureViews.length;e++)t.description.colorAttachments[e]?t.description.colorAttachments[e].view=t.colorTextureViews[e].getHandle():t.description.colorAttachments[e]={view:t.colorTextureViews[e].getHandle()};t.depthTextureView&&(t.description.depthStencilAttachment.view=t.depthTextureView.getHandle())},e.registerDrawCallback=(e,r)=>{for(let n=0;n<t.drawCallbacks.length;n++)if(t.drawCallbacks[n].pipeline===e)return void t.drawCallbacks[n].callbacks.push(r);t.drawCallbacks.push({pipeline:e,callbacks:[r]})};for(let r=0;r<Kg.length;r++)e[Kg[r]]=function(){return t.handle[Kg[r]](...arguments)}}(e,t)}var qg={newInstance:Pt($g,"vtkWebGPURenderEncoder"),extend:$g};const Yg={renderEncoder:null,colorTexture:null,depthTexture:null};function Jg(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Yg,r),Wm.extend(e,t,r),zt.get(e,t,["colorTexture","depthTexture"]),function(e,t){t.classHierarchy.push("vtkWebGPUOpaquePass"),e.traverse=(r,n)=>{if(t.deleted)return;t._currentParent=n;const o=n.getDevice();if(t.renderEncoder)t.colorTexture.resize(n.getCanvas().width,n.getCanvas().height),t.depthTexture.resize(n.getCanvas().width,n.getCanvas().height);else{e.createRenderEncoder(),t.colorTexture=Oh.newInstance({label:"opaquePassColor"}),t.colorTexture.create(o,{width:n.getCanvas().width,height:n.getCanvas().height,format:"rgba16float",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC});const r=t.colorTexture.createView("opaquePassColorTexture");t.renderEncoder.setColorTextureView(0,r),t.depthFormat="depth32float",t.depthTexture=Oh.newInstance({label:"opaquePassDepth"}),t.depthTexture.create(o,{width:n.getCanvas().width,height:n.getCanvas().height,format:t.depthFormat,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC});const i=t.depthTexture.createView("opaquePassDepthTexture");t.renderEncoder.setDepthTextureView(i)}t.renderEncoder.attachTextureViews(),e.setCurrentOperation("opaquePass"),r.setRenderEncoder(t.renderEncoder),r.traverse(e)},e.getColorTextureView=()=>t.renderEncoder.getColorTextureViews()[0],e.getDepthTextureView=()=>t.renderEncoder.getDepthTextureView(),e.createRenderEncoder=()=>{t.renderEncoder=qg.newInstance({label:"OpaquePass"}),t.renderEncoder.setPipelineHash("op")}}(e,t)}var Qg={newInstance:zt.newInstance(Jg,"vtkWebGPUOpaquePass"),extend:Jg};const Zg={colorTextureView:null,depthTextureView:null};function ey(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Zg,r),Wm.extend(e,t,r),zt.setGet(e,t,["colorTextureView","depthTextureView"]),function(e,t){t.classHierarchy.push("vtkWebGPUOrderIndependentTranslucentPass"),e.traverse=(r,n)=>{if(t.deleted)return;t._currentParent=n;const o=n.getDevice();if(t.translucentRenderEncoder)t.translucentColorTexture.resizeToMatch(t.colorTextureView.getTexture()),t.translucentAccumulateTexture.resizeToMatch(t.colorTextureView.getTexture());else{e.createRenderEncoder(),e.createFinalEncoder(),t.translucentColorTexture=Oh.newInstance({label:"translucentPassColor"}),t.translucentColorTexture.create(o,{width:n.getCanvas().width,height:n.getCanvas().height,format:"rgba16float",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING});const r=t.translucentColorTexture.createView("oitpColorTexture");t.translucentRenderEncoder.setColorTextureView(0,r),t.translucentAccumulateTexture=Oh.newInstance({label:"translucentPassAccumulate"}),t.translucentAccumulateTexture.create(o,{width:n.getCanvas().width,height:n.getCanvas().height,format:"r16float",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING});const i=t.translucentAccumulateTexture.createView("oitpAccumTexture");t.translucentRenderEncoder.setColorTextureView(1,i),t.fullScreenQuad=rf.newInstance(),t.fullScreenQuad.setDevice(n.getDevice()),t.fullScreenQuad.setPipelineHash("oitpfsq"),t.fullScreenQuad.setTextureViews(t.translucentRenderEncoder.getColorTextureViews()),t.fullScreenQuad.setFragmentShaderTemplate("\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var tcoord: vec2<i32> = vec2<i32>(i32(input.fragPos.x), i32(input.fragPos.y));\n var reveal: f32 = textureLoad(oitpAccumTexture, tcoord, 0).r;\n if (reveal == 1.0) { discard; }\n var tcolor: vec4<f32> = textureLoad(oitpColorTexture, tcoord, 0);\n var total: f32 = max(tcolor.a, 0.01);\n var computedColor: vec4<f32> = vec4<f32>(tcolor.r/total, tcolor.g/total, tcolor.b/total, 1.0 - reveal);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n")}t.translucentRenderEncoder.setDepthTextureView(t.depthTextureView),t.translucentRenderEncoder.attachTextureViews(),e.setCurrentOperation("translucentPass"),r.setRenderEncoder(t.translucentRenderEncoder),r.traverse(e),e.finalPass(n,r)},e.finalPass=(e,r)=>{t.translucentFinalEncoder.setColorTextureView(0,t.colorTextureView),t.translucentFinalEncoder.attachTextureViews(),t.translucentFinalEncoder.begin(e.getCommandEncoder()),r.scissorAndViewport(t.translucentFinalEncoder),t.fullScreenQuad.prepareAndDraw(t.translucentFinalEncoder),t.translucentFinalEncoder.end()},e.getTextures=()=>[t.translucentColorTexture,t.translucentAccumulateTexture],e.createRenderEncoder=()=>{t.translucentRenderEncoder=qg.newInstance({label:"translucentRender"});const e=t.translucentRenderEncoder.getDescription();e.colorAttachments=[{view:void 0,clearValue:[0,0,0,0],loadOp:"clear",storeOp:"store"},{view:void 0,clearValue:[1,0,0,0],loadOp:"clear",storeOp:"store"}],e.depthStencilAttachment={view:void 0,depthLoadOp:"load",depthStoreOp:"store"},t.translucentRenderEncoder.setReplaceShaderCodeFunction(e=>{const t=e.getShaderDescription("fragment");t.addOutput("vec4<f32>","outColor"),t.addOutput("f32","outAccum"),t.addBuiltinInput("vec4<f32>","@builtin(position) fragPos");let r=t.getCode();r=Np.substitute(r,"//VTK::RenderEncoder::Impl",["var w: f32 = computedColor.a * pow(0.1 + input.fragPos.z, 2.0);","output.outColor = vec4<f32>(computedColor.rgb*w, w);","output.outAccum = computedColor.a;"]).result,t.setCode(r)}),t.translucentRenderEncoder.setPipelineHash("oitpr"),t.translucentRenderEncoder.setPipelineSettings({primitive:{cullMode:"none"},depthStencil:{depthWriteEnabled:!1,depthCompare:"greater",format:"depth32float"},fragment:{targets:[{format:"rgba16float",blend:{color:{srcFactor:"one",dstFactor:"one"},alpha:{srcFactor:"one",dstFactor:"one"}}},{format:"r16float",blend:{color:{srcFactor:"zero",dstFactor:"one-minus-src"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}}}]}})},e.createFinalEncoder=()=>{t.translucentFinalEncoder=qg.newInstance({label:"translucentFinal"}),t.translucentFinalEncoder.setDescription({colorAttachments:[{view:null,loadOp:"load",storeOp:"store"}]}),t.translucentFinalEncoder.setReplaceShaderCodeFunction(e=>{const t=e.getShaderDescription("fragment");t.addOutput("vec4<f32>","outColor"),t.addBuiltinInput("vec4<f32>","@builtin(position) fragPos");let r=t.getCode();r=Np.substitute(r,"//VTK::RenderEncoder::Impl",["output.outColor = vec4<f32>(computedColor.rgb, computedColor.a);"]).result,t.setCode(r)}),t.translucentFinalEncoder.setPipelineHash("oitpf"),t.translucentFinalEncoder.setPipelineSettings({primitive:{cullMode:"none"},fragment:{targets:[{format:"rgba16float",blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}}}]}})}}(e,t)}var ty={newInstance:zt.newInstance(ey,"vtkWebGPUOrderIndependentTranslucentPass"),extend:ey};const ry=0,ny=1,oy=2,iy=3,ay=4,sy=new Float64Array(16),ly=new Float64Array(16),uy={volumes:null,rowLength:1024,lastVolumeLength:0};function cy(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,uy,r),rf.extend(e,t,r),t.fragmentShaderTemplate="\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Volume::TraverseDec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\nfn getTextureValue(vTex: texture_3d<f32>, tpos: vec4<f32>) -> f32\n{\n // todo multicomponent support\n return textureSampleLevel(vTex, clampSampler, tpos.xyz, 0.0).r;\n}\n\nfn getGradient(vTex: texture_3d<f32>, tpos: vec4<f32>, vNum: i32, scalar: f32) -> vec4<f32>\n{\n var result: vec4<f32>;\n\n var tstep: vec4<f32> = volumeSSBO.values[vNum].tstep;\n result.x = getTextureValue(vTex, tpos + vec4<f32>(tstep.x, 0.0, 0.0, 1.0)) - scalar;\n result.y = getTextureValue(vTex, tpos + vec4<f32>(0.0, tstep.y, 0.0, 1.0)) - scalar;\n result.z = getTextureValue(vTex, tpos + vec4<f32>(0.0, 0.0, tstep.z, 1.0)) - scalar;\n result.w = 0.0;\n\n // divide by spacing as that is our delta\n result = result / volumeSSBO.values[vNum].spacing;\n // now we have a gradient in unit tcoords\n\n var grad: f32 = length(result.xyz);\n if (grad > 0.0)\n {\n // rotate to View Coords, needed for lighting and shading\n var nMat: mat4x4<f32> = rendererUBO.SCVCMatrix * volumeSSBO.values[vNum].planeNormals;\n result = nMat * result;\n result = result / length(result);\n }\n\n // store gradient magnitude in .w\n result.w = grad;\n\n return result;\n}\n\nfn processVolume(vTex: texture_3d<f32>, vNum: i32, cNum: i32, posSC: vec4<f32>, tfunRows: f32) -> vec4<f32>\n{\n var outColor: vec4<f32> = vec4<f32>(0.0, 0.0, 0.0, 0.0);\n\n // convert to tcoords and reject if outside the volume\n var tpos: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*posSC;\n if (tpos.x < 0.0 || tpos.y < 0.0 || tpos.z < 0.0 ||\n tpos.x > 1.0 || tpos.y > 1.0 || tpos.z > 1.0) { return outColor; }\n\n var scalar: f32 = getTextureValue(vTex, tpos);\n\n var coord: vec2<f32> =\n vec2<f32>(scalar * componentSSBO.values[cNum].cScale + componentSSBO.values[cNum].cShift,\n (0.5 + 2.0 * f32(vNum)) / tfunRows);\n var color: vec4<f32> = textureSampleLevel(tfunTexture, clampSampler, coord, 0.0);\n\n var gofactor: f32 = 1.0;\n var normal: vec4<f32> = vec4<f32>(0.0,0.0,0.0,0.0);\n if (componentSSBO.values[cNum].gomin < 1.0 || volumeSSBO.values[vNum].shade[0] > 0.0)\n {\n normal = getGradient(vTex, tpos, vNum, scalar);\n if (componentSSBO.values[cNum].gomin < 1.0)\n {\n gofactor = clamp(normal.a*componentSSBO.values[cNum].goScale + componentSSBO.values[cNum].goShift,\n componentSSBO.values[cNum].gomin, componentSSBO.values[cNum].gomax);\n }\n }\n\n coord.x = (scalar * componentSSBO.values[cNum].oScale + componentSSBO.values[cNum].oShift);\n var opacity: f32 = textureSampleLevel(ofunTexture, clampSampler, coord, 0.0).r;\n\n if (volumeSSBO.values[vNum].shade[0] > 0.0)\n {\n color = color*abs(normal.z);\n }\n\n outColor = vec4<f32>(color.rgb, gofactor * opacity);\n\n return outColor;\n}\n\n// adjust the start and end point of a raycast such that it intersects the unit cube.\n// This function is used to take a raycast starting point and step vector\n// and numSteps and return the startijng and ending steps for intersecting the\n// unit cube. Recall for a 3D texture, the unit cube is the range of texture coordsinates\n// that have valid values. So this funtion can be used to take a ray in texture coordinates\n// and bound it to intersecting the texture.\n//\nfn adjustBounds(tpos: vec4<f32>, tstep: vec4<f32>, numSteps: f32) -> vec2<f32>\n{\n var result: vec2<f32> = vec2<f32>(0.0, numSteps);\n var tpos2: vec4<f32> = tpos + tstep*numSteps;\n\n // move tpos to the start of the volume\n var adjust: f32 =\n min(\n max(tpos.x/tstep.x, (tpos.x - 1.0)/tstep.x),\n min(\n max((tpos.y - 1.0)/tstep.y, tpos.y/tstep.y),\n max((tpos.z - 1.0)/tstep.z, tpos.z/tstep.z)));\n if (adjust < 0.0)\n {\n result.x = result.x - adjust;\n }\n\n // adjust length to the end\n adjust =\n max(\n min(tpos2.x/tstep.x, (tpos2.x - 1.0)/tstep.x),\n max(\n min((tpos2.y - 1.0)/tstep.y, tpos2.y/tstep.y),\n min((tpos2.z - 1.0)/tstep.z, tpos2.z/tstep.z)));\n if (adjust > 0.0)\n {\n result.y = result.y - adjust;\n }\n\n return result;\n}\n\nfn getSimpleColor(scalar: f32, vNum: i32, cNum: i32) -> vec4<f32>\n{\n // how many rows (tfuns) do we have in our tfunTexture\n var tfunRows: f32 = f32(textureDimensions(tfunTexture).y);\n\n var coord: vec2<f32> =\n vec2<f32>(scalar * componentSSBO.values[cNum].cScale + componentSSBO.values[cNum].cShift,\n (0.5 + 2.0 * f32(vNum)) / tfunRows);\n var color: vec4<f32> = textureSampleLevel(tfunTexture, clampSampler, coord, 0.0);\n coord.x = (scalar * componentSSBO.values[cNum].oScale + componentSSBO.values[cNum].oShift);\n var opacity: f32 = textureSampleLevel(ofunTexture, clampSampler, coord, 0.0).r;\n return vec4<f32>(color.rgb, opacity);\n}\n\nfn traverseMax(vTex: texture_3d<f32>, vNum: i32, cNum: i32, rayLengthSC: f32, minPosSC: vec4<f32>, rayStepSC: vec4<f32>)\n{\n // convert to tcoords and reject if outside the volume\n var numSteps: f32 = rayLengthSC/mapperUBO.SampleDistance;\n var tpos: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*minPosSC;\n var tpos2: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*(minPosSC + rayStepSC);\n var tstep: vec4<f32> = tpos2 - tpos;\n\n var rayBounds: vec2<f32> = adjustBounds(tpos, tstep, numSteps);\n\n // did we hit anything\n if (rayBounds.x >= rayBounds.y)\n {\n traverseVals[vNum] = vec4<f32>(0.0,0.0,0.0,0.0);\n return;\n }\n\n tpos = tpos + tstep*rayBounds.x;\n var curDist: f32 = rayBounds.x;\n var maxVal: f32 = -1.0e37;\n loop\n {\n var scalar: f32 = getTextureValue(vTex, tpos);\n if (scalar > maxVal)\n {\n maxVal = scalar;\n }\n\n // increment position\n curDist = curDist + 1.0;\n tpos = tpos + tstep;\n\n // check if we have reached a terminating condition\n if (curDist > rayBounds.y) { break; }\n }\n\n // process to get the color and opacity\n traverseVals[vNum] = getSimpleColor(maxVal, vNum, cNum);\n}\n\nfn traverseMin(vTex: texture_3d<f32>, vNum: i32, cNum: i32, rayLengthSC: f32, minPosSC: vec4<f32>, rayStepSC: vec4<f32>)\n{\n // convert to tcoords and reject if outside the volume\n var numSteps: f32 = rayLengthSC/mapperUBO.SampleDistance;\n var tpos: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*minPosSC;\n var tpos2: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*(minPosSC + rayStepSC);\n var tstep: vec4<f32> = tpos2 - tpos;\n\n var rayBounds: vec2<f32> = adjustBounds(tpos, tstep, numSteps);\n\n // did we hit anything\n if (rayBounds.x >= rayBounds.y)\n {\n traverseVals[vNum] = vec4<f32>(0.0,0.0,0.0,0.0);\n return;\n }\n\n tpos = tpos + tstep*rayBounds.x;\n var curDist: f32 = rayBounds.x;\n var minVal: f32 = 1.0e37;\n loop\n {\n var scalar: f32 = getTextureValue(vTex, tpos);\n if (scalar < minVal)\n {\n minVal = scalar;\n }\n\n // increment position\n curDist = curDist + 1.0;\n tpos = tpos + tstep;\n\n // check if we have reached a terminating condition\n if (curDist > rayBounds.y) { break; }\n }\n\n // process to get the color and opacity\n traverseVals[vNum] = getSimpleColor(minVal, vNum, cNum);\n}\n\nfn traverseAverage(vTex: texture_3d<f32>, vNum: i32, cNum: i32, rayLengthSC: f32, minPosSC: vec4<f32>, rayStepSC: vec4<f32>)\n{\n // convert to tcoords and reject if outside the volume\n var numSteps: f32 = rayLengthSC/mapperUBO.SampleDistance;\n var tpos: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*minPosSC;\n var tpos2: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*(minPosSC + rayStepSC);\n var tstep: vec4<f32> = tpos2 - tpos;\n\n var rayBounds: vec2<f32> = adjustBounds(tpos, tstep, numSteps);\n\n // did we hit anything\n if (rayBounds.x >= rayBounds.y)\n {\n traverseVals[vNum] = vec4<f32>(0.0,0.0,0.0,0.0);\n return;\n }\n\n let ipRange: vec4<f32> = volumeSSBO.values[vNum].ipScalarRange;\n tpos = tpos + tstep*rayBounds.x;\n var curDist: f32 = rayBounds.x;\n var avgVal: f32 = 0.0;\n var sampleCount: f32 = 0.0;\n loop\n {\n var sample: f32 = getTextureValue(vTex, tpos);\n // right now leave filtering off until WebGL changes get merged\n // if (ipRange.z == 0.0 || sample >= ipRange.x && sample <= ipRange.y)\n // {\n avgVal = avgVal + sample;\n sampleCount = sampleCount + 1.0;\n // }\n\n // increment position\n curDist = curDist + 1.0;\n tpos = tpos + tstep;\n\n // check if we have reached a terminating condition\n if (curDist > rayBounds.y) { break; }\n }\n\n if (sampleCount <= 0.0)\n {\n traverseVals[vNum] = vec4<f32>(0.0,0.0,0.0,0.0);\n }\n\n // process to get the color and opacity\n traverseVals[vNum] = getSimpleColor(avgVal/sampleCount, vNum, cNum);\n}\n\nfn traverseAdditive(vTex: texture_3d<f32>, vNum: i32, cNum: i32, rayLengthSC: f32, minPosSC: vec4<f32>, rayStepSC: vec4<f32>)\n{\n // convert to tcoords and reject if outside the volume\n var numSteps: f32 = rayLengthSC/mapperUBO.SampleDistance;\n var tpos: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*minPosSC;\n var tpos2: vec4<f32> = volumeSSBO.values[vNum].SCTCMatrix*(minPosSC + rayStepSC);\n var tstep: vec4<f32> = tpos2 - tpos;\n\n var rayBounds: vec2<f32> = adjustBounds(tpos, tstep, numSteps);\n\n // did we hit anything\n if (rayBounds.x >= rayBounds.y)\n {\n traverseVals[vNum] = vec4<f32>(0.0,0.0,0.0,0.0);\n return;\n }\n\n let ipRange: vec4<f32> = volumeSSBO.values[vNum].ipScalarRange;\n tpos = tpos + tstep*rayBounds.x;\n var curDist: f32 = rayBounds.x;\n var sumVal: f32 = 0.0;\n loop\n {\n var sample: f32 = getTextureValue(vTex, tpos);\n // right now leave filtering off until WebGL changes get merged\n // if (ipRange.z == 0.0 || sample >= ipRange.x && sample <= ipRange.y)\n // {\n sumVal = sumVal + sample;\n // }\n\n // increment position\n curDist = curDist + 1.0;\n tpos = tpos + tstep;\n\n // check if we have reached a terminating condition\n if (curDist > rayBounds.y) { break; }\n }\n\n // process to get the color and opacity\n traverseVals[vNum] = getSimpleColor(sumVal, vNum, cNum);\n}\n\nfn composite(rayLengthSC: f32, minPosSC: vec4<f32>, rayStepSC: vec4<f32>) -> vec4<f32>\n{\n // initial ray position is at the beginning\n var rayPosSC: vec4<f32> = minPosSC;\n\n // how many rows (tfuns) do we have in our tfunTexture\n var tfunRows: f32 = f32(textureDimensions(tfunTexture).y);\n\n var curDist: f32 = 0.0;\n var computedColor: vec4<f32> = vec4<f32>(0.0, 0.0, 0.0, 0.0);\n var sampleColor: vec4<f32>;\n//VTK::Volume::TraverseCalls\n\n loop\n {\n // for each volume, sample and accumulate color\n//VTK::Volume::CompositeCalls\n\n // increment position\n curDist = curDist + mapperUBO.SampleDistance;\n rayPosSC = rayPosSC + rayStepSC;\n\n // check if we have reached a terminating condition\n if (curDist > rayLengthSC) { break; }\n if (computedColor.a > 0.98) { break; }\n }\n return computedColor;\n}\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var rayMax: f32 = textureSampleLevel(maxTexture, clampSampler, input.tcoordVS, 0.0).r;\n var rayMin: f32 = textureSampleLevel(minTexture, clampSampler, input.tcoordVS, 0.0).r;\n\n // discard empty rays\n if (rayMax <= rayMin) { discard; }\n else\n {\n // compute start and end ray positions in view coordinates\n var minPosSC: vec4<f32> = rendererUBO.PCSCMatrix*vec4<f32>(2.0 * input.tcoordVS.x - 1.0, 1.0 - 2.0 * input.tcoordVS.y, rayMax, 1.0);\n minPosSC = minPosSC * (1.0 / minPosSC.w);\n var maxPosSC: vec4<f32> = rendererUBO.PCSCMatrix*vec4<f32>(2.0 * input.tcoordVS.x - 1.0, 1.0 - 2.0 * input.tcoordVS.y, rayMin, 1.0);\n maxPosSC = maxPosSC * (1.0 / maxPosSC.w);\n\n var rayLengthSC: f32 = distance(minPosSC.xyz, maxPosSC.xyz);\n var rayStepSC: vec4<f32> = (maxPosSC - minPosSC)*(mapperUBO.SampleDistance/rayLengthSC);\n rayStepSC.w = 0.0;\n\n var computedColor: vec4<f32>;\n\n//VTK::Volume::Loop\n\n//VTK::RenderEncoder::Impl\n }\n\n return output;\n}\n",t.UBO=Vf.newInstance({label:"mapperUBO"}),t.UBO.addEntry("SampleDistance","f32"),t.SSBO=Ff.newInstance({label:"volumeSSBO"}),t.componentSSBO=Ff.newInstance({label:"componentSSBO"}),t.lutBuildTime={},zt.obj(t.lutBuildTime,{mtime:0}),function(e,t){t.classHierarchy.push("vtkWebGPUVolumePassFSQ"),e.replaceShaderPosition=(e,t,r)=>{const n=t.getShaderDescription("vertex");n.addBuiltinOutput("vec4<f32>","@builtin(position) Position");let o=n.getCode();o=Np.substitute(o,"//VTK::Position::Impl",["output.tcoordVS = vec2<f32>(vertexBC.x * 0.5 + 0.5, 1.0 - vertexBC.y * 0.5 - 0.5);","output.Position = vec4<f32>(vertexBC, 1.0);"]).result,n.setCode(o),t.getShaderDescription("fragment").addBuiltinInput("vec4<f32>","@builtin(position) fragPos")},t.shaderReplacements.set("replaceShaderPosition",e.replaceShaderPosition),e.replaceShaderVolume=(e,r,n)=>{const o=r.getShaderDescription("fragment");let i=o.getCode();const a=[],s=[];for(let e=0;e<t.volumes.length;e++)t.volumes[e].getRenderable().getMapper().getBlendMode()===ry?(a.push(` sampleColor = processVolume(volTexture${e}, ${e}, ${t.rowStarts[e]}, rayPosSC, tfunRows);`),a.push(" computedColor = vec4<f32>(\n sampleColor.a * sampleColor.rgb * (1.0 - computedColor.a) + computedColor.rgb,\n (1.0 - computedColor.a)*sampleColor.a + computedColor.a);")):(s.push(` sampleColor = traverseVals[${e}];`),s.push(" computedColor = vec4<f32>(\n sampleColor.a * sampleColor.rgb * (1.0 - computedColor.a) + computedColor.rgb,\n (1.0 - computedColor.a)*sampleColor.a + computedColor.a);"));i=Np.substitute(i,"//VTK::Volume::CompositeCalls",a).result,i=Np.substitute(i,"//VTK::Volume::TraverseCalls",s).result,i=Np.substitute(i,"//VTK::Volume::TraverseDec",[`var<private> traverseVals: array<vec4<f32>,${t.volumes.length}>;`]).result;let l=!1;for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable().getMapper().getBlendMode();r===ry?l=!0:r===ny?i=Np.substitute(i,"//VTK::Volume::Loop",[` traverseMax(volTexture${e}, ${e}, ${e}, rayLengthSC, minPosSC, rayStepSC);`,` computedColor = traverseVals[${e}];`,"//VTK::Volume::Loop"]).result:r===oy?i=Np.substitute(i,"//VTK::Volume::Loop",[` traverseMin(volTexture${e}, ${e}, ${e}, rayLengthSC, minPosSC, rayStepSC);`,` computedColor = traverseVals[${e}];`,"//VTK::Volume::Loop"]).result:r===iy?i=Np.substitute(i,"//VTK::Volume::Loop",[` traverseAverage(volTexture${e}, ${e}, ${e}, rayLengthSC, minPosSC, rayStepSC);`,` computedColor = traverseVals[${e}];`,"//VTK::Volume::Loop"]).result:r===ay&&(i=Np.substitute(i,"//VTK::Volume::Loop",[` traverseAdditive(volTexture${e}, ${e}, ${e}, rayLengthSC, minPosSC, rayStepSC);`,` computedColor = traverseVals[${e}];`,"//VTK::Volume::Loop"]).result)}l&&(i=Np.substitute(i,"//VTK::Volume::Loop",[" computedColor = composite(rayLengthSC, minPosSC, rayStepSC);"]).result),o.setCode(i)},t.shaderReplacements.set("replaceShaderVolume",e.replaceShaderVolume),e.updateLUTImage=r=>{let n=e.getMTime();for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable(),o=r.getMapper().getInputData();n=Math.max(n,r.getMTime(),o.getMTime())}if(n<t.lutBuildTime.getMTime())return;t.numRows=0,t.rowStarts=[];for(let e=0;e<t.volumes.length;e++){t.rowStarts.push(t.numRows);const r=t.volumes[e].getRenderable(),n=r.getMapper(),o=r.getProperty(),i=n.getInputData(),a=(i.getPointData()&&i.getPointData().getScalars()).getNumberOfComponents(),s=o.getIndependentComponents()?a:1;t.numRows+=s}const o=new Uint8ClampedArray(2*t.numRows*t.rowLength*4),i=new Float32Array(2*t.numRows*t.rowLength);let a=0;const s=new Float32Array(3*t.rowLength),l=t.rowLength;for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable(),n=r.getMapper(),u=r.getProperty(),c=n.getInputData(),d=(c.getPointData()&&c.getPointData().getScalars()).getNumberOfComponents(),p=u.getIndependentComponents()?d:1;for(let e=0;e<p;++e){const r=u.getRGBTransferFunction(e),n=r.getRange();r.getTable(n[0],n[1],l,s,1);let c=a*l*4;for(let e=0;e<l;++e){o[c+4*e]=255*s[3*e],o[c+4*e+1]=255*s[3*e+1],o[c+4*e+2]=255*s[3*e+2],o[c+4*e+3]=255;for(let t=0;t<4;t++)o[c+4*(l+e)+t]=o[c+4*e+t]}const d=u.getScalarOpacity(e),p=t.sampleDist/u.getScalarOpacityUnitDistance(e),f=d.getRange();d.getTable(f[0],f[1],l,s,1),c=a*l;for(let e=0;e<l;++e)i[c+e]=1-(1-s[e])**p,i[c+e+l]=i[c+e];a+=2}}{const e={nativeArray:o,width:t.rowLength,height:2*t.numRows,depth:1,format:"rgba8unorm"},n=r.getTextureManager().getTexture(e).createView("tfunTexture");t.textureViews[2]=n}{const e={nativeArray:i,width:t.rowLength,height:2*t.numRows,depth:1,format:"r16float"},n=r.getTextureManager().getTexture(e).createView("ofunTexture");t.textureViews[3]=n}t.lutBuildTime.modified()},e.updateSSBO=r=>{let n=Math.max(e.getMTime(),t.WebGPURenderer.getStabilizedTime());for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable(),o=r.getMapper(),i=o.getInputData();n=Math.max(n,r.getMTime(),i.getMTime(),o.getMTime())}if(n<t.SSBO.getSendTime())return;const o=t.WebGPURenderer.getStabilizedCenterByReference();t.SSBO.clearData(),t.SSBO.setNumberOfInstances(t.volumes.length);const i=new Float64Array(16*t.volumes.length),a=new Float64Array(16*t.volumes.length),s=new Float64Array(4*t.volumes.length),l=new Float64Array(4*t.volumes.length),u=new Float64Array(4*t.volumes.length),c=new Float64Array(4*t.volumes.length);for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable(),n=r.getMapper().getInputData();h(sy),x(sy,sy,o);const d=r.getMatrix();m(ly,d),g(ly,ly),b(sy,ly,sy);const p=n.getWorldToIndex();b(sy,p,sy);const f=n.getDimensions();h(ly),_(ly,ly,[1/f[0],1/f[1],1/f[2]]),b(sy,ly,sy);for(let t=0;t<16;t++)i[16*e+t]=sy[t];g(sy,sy);for(let t=0;t<4;t++)a[16*e+4*t]=sy[4*t],a[16*e+4*t+1]=sy[4*t+1],a[16*e+4*t+2]=sy[4*t+2],a[16*e+4*t+3]=0;s[4*e]=1/f[0],s[4*e+1]=1/f[1],s[4*e+2]=1/f[2],s[4*e+3]=1,l[4*e]=r.getProperty().getShade()?1:0;const y=n.getSpacing();u[4*e]=y[0],u[4*e+1]=y[1],u[4*e+2]=y[2],u[4*e+3]=1;const v=t.textureViews[e+4].getTexture().getScale(),S=r.getProperty().getIpScalarRange();c[4*e]=S[0]/v,c[4*e+1]=S[1]/v,c[4*e+2]=r.getProperty().getFilterMode()}t.SSBO.addEntry("SCTCMatrix","mat4x4<f32>"),t.SSBO.addEntry("planeNormals","mat4x4<f32>"),t.SSBO.addEntry("shade","vec4<f32>"),t.SSBO.addEntry("tstep","vec4<f32>"),t.SSBO.addEntry("spacing","vec4<f32>"),t.SSBO.addEntry("ipScalarRange","vec4<f32>"),t.SSBO.setAllInstancesFromArray("SCTCMatrix",i),t.SSBO.setAllInstancesFromArray("planeNormals",a),t.SSBO.setAllInstancesFromArray("shade",l),t.SSBO.setAllInstancesFromArray("tstep",s),t.SSBO.setAllInstancesFromArray("spacing",u),t.SSBO.setAllInstancesFromArray("ipScalarRange",c),t.SSBO.send(r),t.componentSSBO.clearData(),t.componentSSBO.setNumberOfInstances(t.numRows);const d=new Float64Array(t.numRows),p=new Float64Array(t.numRows),f=new Float64Array(t.numRows),y=new Float64Array(t.numRows),v=new Float64Array(t.numRows),S=new Float64Array(t.numRows),C=new Float64Array(t.numRows),T=new Float64Array(t.numRows);let w=0;for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable(),n=r.getMapper(),o=r.getProperty(),i=n.getInputData(),a=(i.getPointData()&&i.getPointData().getScalars()).getNumberOfComponents(),s=o.getIndependentComponents(),l=t.textureViews[e+4].getTexture().getFormat(),u=Vp(l),c={scale:[255],offset:[0]};2===u.elementSize&&"float"===u.sampleType&&(c.scale[0]=1);for(let e=0;e<a;e++){const t=s?e:0,r=c.scale[e],n=o.getScalarOpacity(t).getRange(),i=r/(n[1]-n[0]),a=(c.offset[e]-n[0])/(n[1]-n[0]);y[w]=a,f[w]=i;const l=o.getRGBTransferFunction(t).getRange();if(p[w]=(c.offset[e]-l[0])/(l[1]-l[0]),d[w]=r/(l[1]-l[0]),o.getUseGradientOpacity(t)){const e=o.getGradientOpacityMinimumOpacity(t),n=o.getGradientOpacityMaximumOpacity(t);v[w]=e,S[w]=n;const i=[o.getGradientOpacityMinimumValue(t),o.getGradientOpacityMaximumValue(t)];T[w]=r*(n-e)/(i[1]-i[0]),C[w]=-i[0]*(n-e)/(i[1]-i[0])+e}else v[w]=1,S[w]=1,T[w]=0,C[w]=1;w++}}t.componentSSBO.addEntry("cScale","f32"),t.componentSSBO.addEntry("cShift","f32"),t.componentSSBO.addEntry("oScale","f32"),t.componentSSBO.addEntry("oShift","f32"),t.componentSSBO.addEntry("goShift","f32"),t.componentSSBO.addEntry("goScale","f32"),t.componentSSBO.addEntry("gomin","f32"),t.componentSSBO.addEntry("gomax","f32"),t.componentSSBO.setAllInstancesFromArray("cScale",d),t.componentSSBO.setAllInstancesFromArray("cShift",p),t.componentSSBO.setAllInstancesFromArray("oScale",f),t.componentSSBO.setAllInstancesFromArray("oShift",y),t.componentSSBO.setAllInstancesFromArray("goScale",T),t.componentSSBO.setAllInstancesFromArray("goShift",C),t.componentSSBO.setAllInstancesFromArray("gomin",v),t.componentSSBO.setAllInstancesFromArray("gomax",S),t.componentSSBO.send(r)};const r=e.updateBuffers;e.updateBuffers=()=>{r();let n=t.volumes[0].getRenderable().getMapper().getSampleDistance();for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable().getMapper().getSampleDistance();r<n&&(n=r)}t.sampleDist!==n&&(t.sampleDist=n,t.UBO.setValue("SampleDistance",n),t.UBO.sendIfNeeded(t.device));for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable().getMapper().getInputData(),n=t.device.getTextureManager().getTextureForImageData(r);if(!t.textureViews[e+4]||t.textureViews[e+4].getTexture()!==n){const r=n.createView(`volTexture${e}`);t.textureViews[e+4]=r}}if(t.volumes.length<t.lastVolumeLength)for(let e=t.volumes.length;e<t.lastVolumeLength;e++)t.textureViews.pop();t.lastVolumeLength=t.volumes.length,e.updateLUTImage(t.device),e.updateSSBO(t.device),t.clampSampler||(t.clampSampler=wh.newInstance({label:"clampSampler"}),t.clampSampler.create(t.device,{minFilter:"linear",magFilter:"linear"}))},e.computePipelineHash=()=>{t.pipelineHash="volfsq";for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable().getMapper().getBlendMode();t.pipelineHash+=`${r}`}},e.setVolumes=r=>{if(!t.volumes||t.volumes.length!==r.length)return t.volumes=[...r],void e.modified();for(let n=0;n<r.length;n++)if(r[n]!==t.volumes[n])return t.volumes=[...r],void e.modified()};const n=e.getBindables;e.getBindables=()=>{const e=n();return e.push(t.componentSSBO),e.push(t.clampSampler),e}}(e,t)}var dy={newInstance:zt.newInstance(cy,"vtkWebGPUVolumePassFSQ"),extend:cy};const{Representation:py}=os,{BufferUsage:fy,PrimitiveTypes:hy}=If,my=[[0,4,6],[0,6,2],[1,3,7],[1,7,5],[0,5,4],[0,1,5],[2,6,7],[2,7,3],[0,3,1],[0,2,3],[4,5,7],[4,7,6]],gy={colorTextureView:null,depthTextureView:null,volumes:null};function yy(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gy,r),Wm.extend(e,t,r),t._mapper=Zp.newInstance(),t._mapper.setFragmentShaderTemplate("\n//VTK::Renderer::Dec\n\n//VTK::Select::Dec\n\n//VTK::VolumePass::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Select::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::VolumePass::Impl\n\n // use the maximum (closest) of the current value and the zbuffer\n // the blend func will then take the min to find the farthest stop value\n var stopval: f32 = max(input.fragPos.z, textureLoad(opaquePassDepthTexture, vec2<i32>(i32(input.fragPos.x), i32(input.fragPos.y)), 0));\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n"),t._mapper.getShaderReplacements().set("replaceShaderVolumePass",(e,t,r)=>{t.getShaderDescription("fragment").addBuiltinInput("vec4<f32>","@builtin(position) fragPos")}),t._boundsPoly=mc.newInstance(),t._lastMTimes=[],zt.setGet(e,t,["colorTextureView","depthTextureView"]),function(e,t){t.classHierarchy.push("vtkWebGPUVolumePass"),e.initialize=r=>{t._clearEncoder||e.createClearEncoder(r),t._mergeEncoder||e.createMergeEncoder(r),t._copyEncoder||e.createCopyEncoder(r),t._depthRangeEncoder||e.createDepthRangeEncoder(r),t.fullScreenQuad||(t.fullScreenQuad=dy.newInstance(),t.fullScreenQuad.setDevice(r.getDevice()),t.fullScreenQuad.setTextureViews([...t._depthRangeEncoder.getColorTextureViews()])),t._volumeCopyQuad||(t._volumeCopyQuad=rf.newInstance(),t._volumeCopyQuad.setPipelineHash("volpassfsq"),t._volumeCopyQuad.setDevice(r.getDevice()),t._volumeCopyQuad.setFragmentShaderTemplate("\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4<f32> = textureSample(volumePassColorTexture,\n volumePassColorTextureSampler, mapperUBO.tscale*input.tcoordVS);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n"),t._copyUBO=Vf.newInstance({label:"mapperUBO"}),t._copyUBO.addEntry("tscale","vec2<f32>"),t._volumeCopyQuad.setUBO(t._copyUBO),t._volumeCopyQuad.setTextureViews([t._colorTextureView]))},e.traverse=(r,n)=>{if(t.deleted)return;t._currentParent=n,e.initialize(n),e.computeTiming(n),e.renderDepthBounds(r,n),t._firstGroup=!0;const o=n.getDevice(),i=o.getHandle().limits.maxSampledTexturesPerShaderStage-4;if(t.volumes.length>i){const o=r.getRenderable().getActiveCamera().getPosition(),a=[];for(let e=0;e<t.volumes.length;e++){const r=t.volumes[e].getRenderable().getBounds(),n=[.5*(r[1]+r[0]),.5*(r[3]+r[2]),.5*(r[5]+r[4])];a[e]=Vo(n,o)}const s=[...Array(t.volumes.length).keys()];s.sort((e,t)=>a[t]-a[e]);let l=[],u=s.length%i;for(let o=0;o<s.length;o++)l.push(t.volumes[s[o]]),l.length>=u&&(e.rayCastPass(n,r,l),l=[],u=i,t._firstGroup=!1)}else e.rayCastPass(n,r,t.volumes);if(t._volumeCopyQuad.setWebGPURenderer(r),t._useSmallViewport){const e=t._colorTextureView.getTexture().getWidth(),r=t._colorTextureView.getTexture().getHeight();t._copyUBO.setArray("tscale",[t._smallViewportWidth/e,t._smallViewportHeight/r])}else t._copyUBO.setArray("tscale",[1,1]);t._copyUBO.sendIfNeeded(o),t._copyEncoder.setColorTextureView(0,t.colorTextureView),t._copyEncoder.attachTextureViews(),t._copyEncoder.begin(n.getCommandEncoder()),r.scissorAndViewport(t._copyEncoder),t._volumeCopyQuad.prepareAndDraw(t._copyEncoder),t._copyEncoder.end()},e.delete=zt.chain(()=>{t._animationRateSubscription&&(t._animationRateSubscription.unsubscribe(),t._animationRateSubscription=null)},e.delete),e.computeTiming=e=>{const r=e.getRenderable().getInteractor();if(null==t._lastScale){const e=t.volumes[0].getRenderable().getMapper();t._lastScale=e.getInitialInteractionScale()||1}t._useSmallViewport=!1,r.isAnimating()&&t._lastScale>1.5&&(t._useSmallViewport=!0),t._colorTexture.resize(e.getCanvas().width,e.getCanvas().height),t._animationRateSubscription||(t._animationRateSubscription=r.onAnimationFrameRateUpdate(()=>{const e=t.volumes[0].getRenderable().getMapper();if(e.getAutoAdjustSampleDistances()){const e=r.getRecentAnimationFrameRate(),n=t._lastScale*r.getDesiredUpdateRate()/e;t._lastScale=n,t._lastScale>400&&(t._lastScale=400)}else t._lastScale=e.getImageSampleDistance()*e.getImageSampleDistance();t._lastScale<1.5&&(t._lastScale=1.5)}))},e.rayCastPass=(e,r,n)=>{const o=t._firstGroup?t._clearEncoder:t._mergeEncoder;o.attachTextureViews(),o.begin(e.getCommandEncoder());let i=t._colorTextureView.getTexture().getWidth(),a=t._colorTextureView.getTexture().getHeight();if(t._useSmallViewport){const r=e.getCanvas(),n=1/Math.sqrt(t._lastScale);t._smallViewportWidth=Math.ceil(n*r.width),t._smallViewportHeight=Math.ceil(n*r.height),i=t._smallViewportWidth,a=t._smallViewportHeight}o.getHandle().setViewport(0,0,i,a,0,1),o.getHandle().setScissorRect(0,0,i,a),t.fullScreenQuad.setWebGPURenderer(r),t.fullScreenQuad.setVolumes(n),t.fullScreenQuad.prepareAndDraw(o),o.end()},e.renderDepthBounds=(r,n)=>{e.updateDepthPolyData(r);const o=t._boundsPoly,i=o.getPoints(),a=o.getPolys();let s={hash:`vp${a.getMTime()}`,usage:fy.Index,cells:a,numberOfPoints:i.getNumberOfPoints(),primitiveType:hy.Triangles,representation:py.SURFACE};const l=n.getDevice().getBufferManager().getBuffer(s);t._mapper.getVertexInput().setIndexBuffer(l),s={usage:fy.PointArray,format:"float32x4",hash:`vp${i.getMTime()}${a.getMTime()}`,dataArray:i,indexBuffer:l,packExtra:!0};const u=n.getDevice().getBufferManager().getBuffer(s);t._mapper.getVertexInput().addBuffer(u,["vertexBC"]),t._mapper.setNumberOfVertices(u.getSizeInBytes()/u.getStrideInBytes()),e.drawDepthRange(r,n)},e.updateDepthPolyData=e=>{let r=!1;for(let e=0;e<t.volumes.length;e++){const n=t.volumes[e].getMTime();t._lastMTimes[e]&&n===t._lastMTimes[e]||(r=!0,t._lastMTimes[e]=n)}const n=e.getStabilizedTime();if((t._lastMTimes.length<=t.volumes.length||n!==t._lastMTimes[t.volumes.length])&&(r=!0,t._lastMTimes[t.volumes.length]=n),!r)return;const o=e.getStabilizedCenterByReference(),i=8*t.volumes.length,a=new Float64Array(3*i),s=12*t.volumes.length,l=new Uint16Array(4*s);for(let e=0;e<t.volumes.length;e++){t.volumes[e].getBoundingCubePoints(a,24*e);let r=12*e*4;const n=8*e;for(let e=0;e<12;e++)l[r++]=3,l[r++]=n+my[e][0],l[r++]=n+my[e][1],l[r++]=n+my[e][2]}for(let e=0;e<a.length;e+=3)a[e]-=o[0],a[e+1]-=o[1],a[e+2]-=o[2];t._boundsPoly.getPoints().setData(a,3),t._boundsPoly.getPoints().modified(),t._boundsPoly.getPolys().setData(l,1),t._boundsPoly.getPolys().modified(),t._boundsPoly.modified()},e.drawDepthRange=(r,n)=>{t._depthRangeTexture.resizeToMatch(t.colorTextureView.getTexture()),t._depthRangeTexture2.resizeToMatch(t.colorTextureView.getTexture()),t._depthRangeEncoder.attachTextureViews(),e.setCurrentOperation("volumeDepthRangePass"),r.setRenderEncoder(t._depthRangeEncoder),r.volumeDepthRangePass(!0),t._mapper.setWebGPURenderer(r),t._mapper.prepareToDraw(t._depthRangeEncoder),t._mapper.registerDrawCallback(t._depthRangeEncoder),r.volumeDepthRangePass(!1)},e.createDepthRangeEncoder=e=>{const r=e.getDevice();t._depthRangeEncoder=qg.newInstance({label:"VolumePass DepthRange"}),t._depthRangeEncoder.setPipelineHash("volr"),t._depthRangeEncoder.setReplaceShaderCodeFunction(e=>{const t=e.getShaderDescription("fragment");t.addOutput("vec4<f32>","outColor1"),t.addOutput("vec4<f32>","outColor2");let r=t.getCode();r=Np.substitute(r,"//VTK::RenderEncoder::Impl",["output.outColor1 = vec4<f32>(input.fragPos.z, 0.0, 0.0, 0.0);","output.outColor2 = vec4<f32>(stopval, 0.0, 0.0, 0.0);"]).result,t.setCode(r)}),t._depthRangeEncoder.setDescription({colorAttachments:[{view:null,clearValue:[0,0,0,0],loadOp:"clear",storeOp:"store"},{view:null,clearValue:[1,1,1,1],loadOp:"clear",storeOp:"store"}]}),t._depthRangeEncoder.setPipelineSettings({primitive:{cullMode:"none"},fragment:{targets:[{format:"r16float",blend:{color:{srcFactor:"one",dstFactor:"one",operation:"max"},alpha:{srcFactor:"one",dstFactor:"one",operation:"max"}}},{format:"r16float",blend:{color:{srcFactor:"one",dstFactor:"one",operation:"min"},alpha:{srcFactor:"one",dstFactor:"one",operation:"min"}}}]}}),t._depthRangeTexture=Oh.newInstance({label:"volumePassMaxDepth"}),t._depthRangeTexture.create(r,{width:e.getCanvas().width,height:e.getCanvas().height,format:"r16float",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING});const n=t._depthRangeTexture.createView("maxTexture");t._depthRangeEncoder.setColorTextureView(0,n),t._depthRangeTexture2=Oh.newInstance({label:"volumePassDepthMin"}),t._depthRangeTexture2.create(r,{width:e.getCanvas().width,height:e.getCanvas().height,format:"r16float",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING});const o=t._depthRangeTexture2.createView("minTexture");t._depthRangeEncoder.setColorTextureView(1,o),t._mapper.setDevice(e.getDevice()),t._mapper.setTextureViews([t.depthTextureView])},e.createClearEncoder=e=>{t._colorTexture=Oh.newInstance({label:"volumePassColor"}),t._colorTexture.create(e.getDevice(),{width:e.getCanvas().width,height:e.getCanvas().height,format:"bgra8unorm",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC}),t._colorTextureView=t._colorTexture.createView("volumePassColorTexture"),t._colorTextureView.addSampler(e.getDevice(),{minFilter:"linear",magFilter:"linear"}),t._clearEncoder=qg.newInstance({label:"VolumePass Clear"}),t._clearEncoder.setColorTextureView(0,t._colorTextureView),t._clearEncoder.setDescription({colorAttachments:[{view:null,clearValue:[0,0,0,0],loadOp:"clear",storeOp:"store"}]}),t._clearEncoder.setPipelineHash("volpf"),t._clearEncoder.setPipelineSettings({primitive:{cullMode:"none"},fragment:{targets:[{format:"bgra8unorm",blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}}}]}})},e.createCopyEncoder=e=>{t._copyEncoder=qg.newInstance({label:"volumePassCopy"}),t._copyEncoder.setDescription({colorAttachments:[{view:null,loadOp:"load",storeOp:"store"}]}),t._copyEncoder.setPipelineHash("volcopypf"),t._copyEncoder.setPipelineSettings({primitive:{cullMode:"none"},fragment:{targets:[{format:"rgba16float",blend:{color:{srcFactor:"one",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}}}]}})},e.createMergeEncoder=e=>{t._mergeEncoder=qg.newInstance({label:"volumePassMerge"}),t._mergeEncoder.setColorTextureView(0,t._colorTextureView),t._mergeEncoder.setDescription({colorAttachments:[{view:null,loadOp:"load",storeOp:"store"}]}),t._mergeEncoder.setReplaceShaderCodeFunction(e=>{const t=e.getShaderDescription("fragment");t.addOutput("vec4<f32>","outColor");let r=t.getCode();r=Np.substitute(r,"//VTK::RenderEncoder::Impl",["output.outColor = vec4<f32>(computedColor.rgb, computedColor.a);"]).result,t.setCode(r)}),t._mergeEncoder.setPipelineHash("volpf"),t._mergeEncoder.setPipelineSettings({primitive:{cullMode:"none"},fragment:{targets:[{format:"bgra8unorm",blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}}}]}})},e.setVolumes=r=>{if(!t.volumes||t.volumes.length!==r.length)return t.volumes=[...r],void e.modified();for(let n=0;n<r.length;n++)if(r[n]!==t.volumes[n])return t.volumes=[...r],void e.modified()}}(e,t)}var vy={newInstance:zt.newInstance(yy,"vtkWebGPUVolumePass"),extend:yy};const by={opaqueActorCount:0,translucentActorCount:0,volumes:null,opaqueRenderEncoder:null,translucentPass:null,volumePass:null};function xy(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,by,r),Wm.extend(e,t,r),zt.setGet(e,t,["opaquePass","translucentPass","volumePass"]),function(e,t){t.classHierarchy.push("vtkForwardPass"),e.traverse=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t.deleted)return;t._currentParent=n,e.setCurrentOperation("buildPass"),r.traverse(e),t.opaquePass||(t.opaquePass=Qg.newInstance());const o=r.getRenderable().getNumberOfLayers(),i=r.getChildren();for(let n=0;n<o;n++)for(let o=0;o<i.length;o++){const a=i[o],s=r.getRenderable().getRenderers()[o];s.getDraw()&&s.getLayer()===n&&(t.opaqueActorCount=0,t.translucentActorCount=0,t.volumes=[],e.setCurrentOperation("queryPass"),a.traverse(e),e.setCurrentOperation("cameraPass"),a.traverse(e),t.opaquePass.traverse(a,r),t.translucentActorCount>0&&(t.translucentPass||(t.translucentPass=ty.newInstance()),t.translucentPass.setColorTextureView(t.opaquePass.getColorTextureView()),t.translucentPass.setDepthTextureView(t.opaquePass.getDepthTextureView()),t.translucentPass.traverse(a,r)),t.volumes.length>0&&(t.volumePass||(t.volumePass=vy.newInstance()),t.volumePass.setColorTextureView(t.opaquePass.getColorTextureView()),t.volumePass.setDepthTextureView(t.opaquePass.getDepthTextureView()),t.volumePass.setVolumes(t.volumes),t.volumePass.traverse(a,r)),e.finalPass(r,a))}},e.finalPass=(r,n)=>{t._finalBlitEncoder||e.createFinalBlitEncoder(r),t._finalBlitOutputTextureView.createFromTextureHandle(r.getCurrentTexture(),{depth:1,format:r.getPresentationFormat()}),t._finalBlitEncoder.attachTextureViews(),t._finalBlitEncoder.begin(r.getCommandEncoder()),n.scissorAndViewport(t._finalBlitEncoder),t._fullScreenQuad.prepareAndDraw(t._finalBlitEncoder),t._finalBlitEncoder.end()},e.createFinalBlitEncoder=e=>{t._finalBlitEncoder=qg.newInstance({label:"forwardPassBlit"}),t._finalBlitEncoder.setDescription({colorAttachments:[{view:null,loadOp:"load",storeOp:"store"}]}),t._finalBlitEncoder.setPipelineHash("fpf"),t._finalBlitEncoder.setPipelineSettings({primitive:{cullMode:"none"},fragment:{targets:[{format:e.getPresentationFormat(),blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha"}}}]}}),t._fsqSampler=wh.newInstance({label:"finalPassSampler"}),t._fsqSampler.create(e.getDevice(),{minFilter:"linear",magFilter:"linear"}),t._fullScreenQuad=rf.newInstance(),t._fullScreenQuad.setDevice(e.getDevice()),t._fullScreenQuad.setPipelineHash("fpfsq"),t._fullScreenQuad.setTextureViews([t.opaquePass.getColorTextureView()]),t._fullScreenQuad.setAdditionalBindables([t._fsqSampler]),t._fullScreenQuad.setFragmentShaderTemplate("\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n@fragment\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4<f32> = clamp(textureSampleLevel(opaquePassColorTexture, finalPassSampler, input.tcoordVS, 0.0),vec4<f32>(0.0),vec4<f32>(1.0));\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n"),t._finalBlitOutputTextureView=Dh.newInstance(),t._finalBlitEncoder.setColorTextureView(0,t._finalBlitOutputTextureView)},e.incrementOpaqueActorCount=()=>t.opaqueActorCount++,e.incrementTranslucentActorCount=()=>t.translucentActorCount++,e.addVolume=e=>{t.volumes.push(e)}}(e,t)}var _y={newInstance:zt.newInstance(xy,"vtkForwardPass"),extend:xy};const{VtkDataTypes:Sy}=_s,Cy={handle:null,device:null};function Ty(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Cy,r),zt.obj(e,t),zt.setGet(e,t,["device"]),function(e,t){function r(e){if(e.imageData){e.dataArray=e.imageData.getPointData().getScalars(),e.time=e.dataArray.getMTime(),e.nativeArray=e.dataArray.getData();const t=e.imageData.getDimensions();switch(e.width=t[0],e.height=t[1],e.depth=t[2],e.dataArray.getNumberOfComponents()){case 1:e.format="r";break;case 2:e.format="rg";break;default:e.format="rgba"}switch(e.dataArray.getDataType()){case Sy.UNSIGNED_CHAR:e.format+="8unorm";break;case Sy.FLOAT:case Sy.UNSIGNED_INT:case Sy.INT:case Sy.DOUBLE:case Sy.UNSIGNED_SHORT:case Sy.SHORT:default:e.format+="16float"}}e.image&&(e.width=e.image.width,e.height=e.image.height,e.depth=1,e.format="rgba8unorm",e.flip=!0,e.usage=GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.RENDER_ATTACHMENT),e.jsImageData&&(e.width=e.jsImageData.width,e.height=e.jsImageData.height,e.depth=1,e.format="rgba8unorm",e.flip=!0,e.nativeArray=e.jsImageData.data,e.usage=GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.RENDER_ATTACHMENT),e.imageBitmap&&(e.width=e.imageBitmap.width,e.height=e.imageBitmap.height,e.depth=1,e.format="rgba8unorm",e.flip=!0,e.usage=GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.RENDER_ATTACHMENT),e.canvas&&(e.width=e.canvas.width,e.height=e.canvas.height,e.depth=1,e.format="rgba8unorm",e.flip=!0,e.usage=GPUTextureUsage.STORAGE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.RENDER_ATTACHMENT)}function n(e){const r=Oh.newInstance({label:e.label});return r.create(t.device,{width:e.width,height:e.height,depth:e.depth,format:e.format,usage:e.usage,mipLevel:e.mipLevel}),(e.nativeArray||e.image||e.canvas||e.imageBitmap)&&r.writeImageData(e),r}t.classHierarchy.push("vtkWebGPUTextureManager"),e.getTexture=e=>e.hash?t.device.getCachedObject(e.hash,n,e):n(e),e.getTextureForImageData=e=>{const n={time:e.getMTime()};return n.imageData=e,r(n),n.hash=n.time+n.format+n.mipLevel,t.device.getTextureManager().getTexture(n)},e.getTextureForVTKTexture=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;const o={time:e.getMTime(),label:n};return e.getInputData()?o.imageData=e.getInputData():e.getImage()?o.image=e.getImage():e.getJsImageData()?o.jsImageData=e.getJsImageData():e.getImageBitmap()?o.imageBitmap=e.getImageBitmap():e.getCanvas()&&(o.canvas=e.getCanvas()),r(o),o.mipLevel=e.getMipLevel(),o.hash=o.time+o.format+o.mipLevel,t.device.getTextureManager().getTexture(o)}}(e,t)}var wy={newInstance:zt.newInstance(Ty),extend:Ty};class Ay extends Map{constructor(){super(),this.registry=new FinalizationRegistry(e=>{const t=super.get(e);t&&t.deref&&void 0===t.deref()&&super.delete(e)})}getValue(e){const t=super.get(e);if(t){const r=t.deref();if(void 0!==r)return r;super.delete(e)}}setValue(e,t){let r;return t&&"object"==typeof t&&(r=new WeakRef(t),this.registry.register(t,e),super.set(e,r)),r}}const Ey={handle:null,pipelines:null,shaderCache:null,bindGroupLayouts:null,bufferManager:null,textureManager:null};function Dy(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ey,r),mt(e,t),_t(e,t,["handle"]),yt(e,t,["bufferManager","shaderCache","textureManager"]),t.objectCache=new Ay,t.shaderCache=Np.newInstance(),t.shaderCache.setDevice(e),t.bindGroupLayouts=[],t.bufferManager=If.newInstance(),t.bufferManager.setDevice(e),t.textureManager=wy.newInstance(),t.textureManager.setDevice(e),t.pipelines={},function(e,t){t.classHierarchy.push("vtkWebGPUDevice"),e.initialize=e=>{t.handle=e},e.createCommandEncoder=()=>t.handle.createCommandEncoder(),e.submitCommandEncoder=e=>{t.handle.queue.submit([e.finish()])},e.getShaderModule=e=>t.shaderCache.getShaderModule(e),e.getBindGroupLayout=e=>{if(!e.entries)return null;for(let t=0;t<e.entries.length;t++){const r=e.entries[t];r.binding=r.binding||0,r.visibility=r.visibility||GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT}const r=JSON.stringify(e);for(let e=0;e<t.bindGroupLayouts.length;e++)if(t.bindGroupLayouts[e].sval===r)return t.bindGroupLayouts[e].layout;const n=t.handle.createBindGroupLayout(e);return t.bindGroupLayouts.push({sval:r,layout:n}),n},e.getBindGroupLayoutDescription=e=>{for(let r=0;r<t.bindGroupLayouts.length;r++)if(t.bindGroupLayouts[r].layout===e)return t.bindGroupLayouts[r].sval;return vtkErrorMacro("layout not found"),console.trace(),null},e.getPipeline=e=>e in t.pipelines?t.pipelines[e]:null,e.createPipeline=(r,n)=>{n.initialize(e,r),t.pipelines[r]=n},e.onSubmittedWorkDone=()=>t.handle.queue.onSubmittedWorkDone(),e.hasCachedObject=e=>t.objectCache.getValue(e),e.getCachedObject=function(e,r){if(!e)return vtkErrorMacro("attempt to cache an object without a hash"),null;const n=t.objectCache.getValue(e);if(n)return n;for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];const s=r(...i);return t.objectCache.setValue(e,s),s}}(e,t)}var Py={newInstance:Pt(Dy,"vtkWebGPUDevice"),extend:Dy};const Iy={selectionRenderEncoder:null,colorTexture:null,depthTexture:null};function Oy(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Iy,r),Wm.extend(e,t,r),zt.get(e,t,["colorTexture","depthTexture"]),function(e,t){t.classHierarchy.push("vtkWebGPUHardwareSelectionPass"),e.traverse=(r,n)=>{if(t.deleted)return;t._currentParent=null,e.setCurrentOperation("buildPass"),r.traverse(e);const o=r.getDevice();if(t.selectionRenderEncoder)t.colorTexture.resize(r.getCanvas().width,r.getCanvas().height),t.depthTexture.resizeToMatch(t.colorTexture);else{e.createRenderEncoder(),t.colorTexture=Oh.newInstance({label:"hardwareSelectorColor"}),t.colorTexture.create(o,{width:r.getCanvas().width,height:r.getCanvas().height,format:"rgba32uint",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC});const n=t.colorTexture.createView("hardwareSelectColorTexture");t.selectionRenderEncoder.setColorTextureView(0,n),t.depthTexture=Oh.newInstance({label:"hardwareSelectorDepth"}),t.depthTexture.create(o,{width:r.getCanvas().width,height:r.getCanvas().height,format:"depth32float",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC});const i=t.depthTexture.createView("hardwareSelectDepthTexture");t.selectionRenderEncoder.setDepthTextureView(i)}t.selectionRenderEncoder.attachTextureViews(),n.setRenderEncoder(t.selectionRenderEncoder),e.setCurrentOperation("cameraPass"),n.traverse(e),e.setCurrentOperation("opaquePass"),n.traverse(e)},e.createRenderEncoder=()=>{t.selectionRenderEncoder=qg.newInstance({label:"HardwareSelectionPass"}),t.selectionRenderEncoder.setPipelineHash("sel"),t.selectionRenderEncoder.setReplaceShaderCodeFunction(e=>{const t=e.getShaderDescription("fragment");t.addOutput("vec4<u32>","outColor");let r=t.getCode();r=Np.substitute(r,"//VTK::RenderEncoder::Impl",["output.outColor = vec4<u32>(mapperUBO.PropID, compositeID, 0u, 0u);"]).result,t.setCode(r)}),t.selectionRenderEncoder.getDescription().colorAttachments[0].clearValue=[0,0,0,0],t.selectionRenderEncoder.setPipelineSettings({primitive:{cullMode:"none"},depthStencil:{depthWriteEnabled:!0,depthCompare:"greater",format:"depth32float"},fragment:{targets:[{format:"rgba32uint",blend:void 0}]}})}}(e,t)}var Ny={newInstance:zt.newInstance(Oy,"vtkWebGPUHardwareSelectionPass"),extend:Oy};const{SelectionContent:My,SelectionField:Ry}=ag,{FieldAssociations:Fy}=Gs,{vtkErrorMacro:By}=zt;function Ly(e){return`${e.propID} ${e.compositeID}`}function ky(e,t,r,n){const o=4*((r.height-t-1)*r.colorBufferWidth+e)+n;return r.colorValues[o]}function Uy(e,t,r,n){const o=r<0?0:r;if(0===o){if(n[0]=t[0],n[1]=t[1],t[0]<0||t[0]>=e.width||t[1]<0||t[1]>=e.height)return null;const r=ky(t[0],t[1],e,0);if(r<=0)return null;const o={};o.propID=r;let i=ky(t[0],t[1],e,1);if((i<0||i>16777215)&&(i=0),o.compositeID=i,e.captureZValues){const r=(e.height-t[1]-1)*e.zbufferBufferWidth+t[0];o.zValue=e.depthValues[r],o.zValue=e.webGPURenderer.convertToOpenGLDepth(o.zValue),o.displayPosition=t}return o}const i=[t[0],t[1]],a=[0,0];let s=Uy(e,t,0,n);if(s)return s;for(let t=1;t<o;++t){for(let r=i[1]>t?i[1]-t:0;r<=i[1]+t;++r){if(a[1]=r,i[0]>=t&&(a[0]=i[0]-t,s=Uy(e,a,0,n),s))return s;if(a[0]=i[0]+t,s=Uy(e,a,0,n),s)return s}for(let r=i[0]>=t?i[0]-(t-1):0;r<=i[0]+(t-1);++r){if(a[0]=r,i[1]>=t&&(a[1]=i[1]-t,s=Uy(e,a,0,n),s))return s;if(a[1]=i[1]+t,s=Uy(e,a,0,n),s)return s}}return n[0]=t[0],n[1]=t[1],null}const Vy={};function Gy(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Vy,r),ng.extend(e,t,r),t._selectionPass=Ny.newInstance(),zt.setGet(e,t,["_WebGPURenderWindow"]),zt.moveToProtected(e,t,["WebGPURenderWindow"]),function(e,t){t.classHierarchy.push("vtkWebGPUHardwareSelector"),e.endSelection=()=>{t.WebGPURenderer.setSelector(null)},e.getSourceDataAsync=async e=>{if(!e||!t._WebGPURenderWindow)return By("Renderer and view must be set before calling Select."),!1;t._WebGPURenderWindow.getRenderable().preRender(),t._WebGPURenderWindow.getInitialized()||(t._WebGPURenderWindow.initialize(),await new Promise(e=>{t._WebGPURenderWindow.onInitialized(e)}));const r=t._WebGPURenderWindow.getViewNodeFor(e);if(!r)return!1;const n=r.getSuppressClear();r.setSuppressClear(!0),t._selectionPass.traverse(t._WebGPURenderWindow,r),r.setSuppressClear(n);const o=t._WebGPURenderWindow.getDevice(),i=t._selectionPass.getColorTexture(),a=t._selectionPass.getDepthTexture(),s={area:[0,0,i.getWidth()-1,i.getHeight()-1],captureZValues:t.captureZValues,fieldAssociation:t.fieldAssociation,renderer:e,webGPURenderer:r,webGPURenderWindow:t._WebGPURenderWindow,width:i.getWidth(),height:i.getHeight()};s.colorBufferWidth=16*Math.floor((s.width+15)/16),s.colorBufferSizeInBytes=s.colorBufferWidth*s.height*4*4;const l=lf.newInstance({label:"hardwareSelectColorBuffer"});l.setDevice(o),l.create(s.colorBufferSizeInBytes,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);const u=t._WebGPURenderWindow.getCommandEncoder();let c;u.copyTextureToBuffer({texture:i.getHandle()},{buffer:l.getHandle(),bytesPerRow:16*s.colorBufferWidth,rowsPerImage:s.height},{width:s.width,height:s.height,depthOrArrayLayers:1}),t.captureZValues&&(s.zbufferBufferWidth=64*Math.floor((s.width+63)/64),c=lf.newInstance({label:"hardwareSelectDepthBuffer"}),c.setDevice(o),s.zbufferSizeInBytes=s.height*s.zbufferBufferWidth*4,c.create(s.zbufferSizeInBytes,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST),u.copyTextureToBuffer({texture:a.getHandle(),aspect:"depth-only"},{buffer:c.getHandle(),bytesPerRow:4*s.zbufferBufferWidth,rowsPerImage:s.height},{width:s.width,height:s.height,depthOrArrayLayers:1})),o.submitCommandEncoder(u);const d=l.mapAsync(GPUMapMode.READ);if(t.captureZValues){const e=c.mapAsync(GPUMapMode.READ);await Promise.all([d,e]),s.depthValues=new Float32Array(c.getMappedRange().slice()),c.unmap()}else await d;return s.colorValues=new Uint32Array(l.getMappedRange().slice()),l.unmap(),s.generateSelection=(e,t,r,n)=>function(e,t,r,n,o){const i=Math.floor(t),a=Math.floor(r),s=Math.floor(n),l=Math.floor(o),u=new Map,c=[0,0];for(let t=a;t<=l;t++)for(let r=i;r<=s;r++){const n=Uy(e,[r,t],0,c);if(n){const t=Ly(n);if(u.has(t)){const r=u.get(t);r.pixelCount++,e.captureZValues&&n.zValue<r.info.zValue&&(r.info=n),-1===r.attributeIDs.indexOf(n.attributeID)&&r.attributeIDs.push(n.attributeID)}else u.set(t,{info:n,pixelCount:1,attributeIDs:[n.attributeID]})}}return function(e,t,r){const n=[];let o=0;return t.forEach((t,i)=>{const a=ag.newInstance();switch(a.setContentType(My.INDICES),e){case Fy.FIELD_ASSOCIATION_CELLS:a.setFieldType(Ry.CELL);break;case Fy.FIELD_ASSOCIATION_POINTS:a.setFieldType(Ry.POINT);break;default:By("Unknown field association")}a.getProperties().propID=t.info.propID;const s=r.webGPURenderer.getPropFromID(t.info.propID);a.getProperties().prop=s.getRenderable(),a.getProperties().compositeID=t.info.compositeID,a.getProperties().pixelCount=t.pixelCount,r.captureZValues&&(a.getProperties().displayPosition=[t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue],a.getProperties().worldPosition=r.webGPURenderWindow.displayToWorld(t.info.displayPosition[0],t.info.displayPosition[1],t.info.zValue,r.renderer)),a.setSelectionList(t.attributeIDs),n[o]=a,o++}),n}(e.fieldAssociation,u,e)}(s,e,t,r,n),s}}(e,t)}var zy={newInstance:zt.newInstance(Gy,"vtkWebGPUHardwareSelector"),extend:Gy};const{vtkErrorMacro:jy}=zt,Wy={position:"absolute",top:0,left:0,width:"100%",height:"100%"};const Hy={initialized:!1,context:null,adapter:null,device:null,canvas:null,cursorVisibility:!0,cursor:"pointer",containerSize:null,renderPasses:[],notifyStartCaptureImage:!1,imageFormat:"image/png",useOffScreen:!1,useBackgroundImage:!1,nextPropID:1,xrSupported:!1,presentationFormat:null};const Ky=zt.newInstance(function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Hy,r),t.canvas=document.createElement("canvas"),t.canvas.style.width="100%",t.bgImage=new Image,t.bgImage.style.position="absolute",t.bgImage.style.left="0",t.bgImage.style.top="0",t.bgImage.style.width="100%",t.bgImage.style.height="100%",t.bgImage.style.zIndex="-1",Ng.extend(e,t,r),t.myFactory=_p.newInstance(),t.renderPasses[0]=_y.newInstance(),t.selector||(t.selector=zy.newInstance(),t.selector.setWebGPURenderWindow(e)),zt.event(e,t,"imageReady"),zt.event(e,t,"initialized"),zt.get(e,t,["commandEncoder","device","presentationFormat","useBackgroundImage","xrSupported"]),zt.setGet(e,t,["initialized","context","canvas","device","renderPasses","notifyStartCaptureImage","cursor","useOffScreen"]),zt.setGetArray(e,t,["size"],2),zt.event(e,t,"windowResizeEvent"),function(e,t){t.classHierarchy.push("vtkWebGPURenderWindow"),e.getViewNodeFactory=()=>t.myFactory;const r=[0,0];e.onModified(function(){t.renderable&&(t.size[0]===r[0]&&t.size[1]===r[1]||(r[0]=t.size[0],r[1]=t.size[1],t.canvas.setAttribute("width",t.size[0]),t.canvas.setAttribute("height",t.size[1]),e.recreateSwapChain())),t.viewStream&&t.viewStream.setSize(t.size[0],t.size[1]),t.canvas.style.display=t.useOffScreen?"none":"block",t.el&&(t.el.style.cursor=t.cursorVisibility?t.cursor:"none"),t.containerSize=null}),e.recreateSwapChain=()=>{t.context&&(t.context.unconfigure(),t.presentationFormat=navigator.gpu.getPreferredCanvasFormat(t.adapter),t.context.configure({device:t.device.getHandle(),format:t.presentationFormat,alphaMode:"premultiplied",usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_DST,width:t.size[0],height:t.size[1]}),t._configured=!0)},e.getCurrentTexture=()=>t.context.getCurrentTexture(),e.buildPass=r=>{if(r){if(!t.renderable)return;e.prepareNodes(),e.addMissingNodes(t.renderable.getRenderersByReference()),e.removeUnusedNodes(),e.initialize()}else t.initialized&&(t._configured||e.recreateSwapChain(),t.commandEncoder=t.device.createCommandEncoder())},e.initialize=()=>{if(!t.initializing){if(t.initializing=!0,!navigator.gpu)return void jy("WebGPU is not enabled.");e.create3DContextAsync().then(()=>{t.initialized=!0,t.deleted||e.invokeInitialized()})}},e.setContainer=r=>{t.el&&t.el!==r&&(t.canvas.parentNode!==t.el&&jy("Error: canvas parent node does not match container"),t.el.removeChild(t.canvas),t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)),t.el!==r&&(t.el=r,t.el&&(t.el.appendChild(t.canvas),t.useBackgroundImage&&t.el.appendChild(t.bgImage)),e.modified())},e.getContainer=()=>t.el,e.getContainerSize=()=>{if(!t.containerSize&&t.el){const{width:e,height:r}=t.el.getBoundingClientRect();t.containerSize=[e,r]}return t.containerSize||t.size},e.getFramebufferSize=()=>t.size,e.create3DContextAsync=async()=>{t.adapter=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),t.deleted||(t.device=Py.newInstance(),t.device.initialize(await t.adapter.requestDevice()),t.deleted?t.device=null:t.context=t.canvas.getContext("webgpu"))},e.releaseGraphicsResources=()=>{const r=Wm.newInstance();r.setCurrentOperation("Release"),r.traverse(e,null),t.adapter=null,t.device=null,t.context=null,t.initialized=!1,t.initializing=!1},e.setBackgroundImage=e=>{t.bgImage.src=e.src},e.setUseBackgroundImage=e=>{t.useBackgroundImage=e,t.useBackgroundImage&&!t.el.contains(t.bgImage)?t.el.appendChild(t.bgImage):!t.useBackgroundImage&&t.el.contains(t.bgImage)&&t.el.removeChild(t.bgImage)},e.captureNextImage=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",{resetCamera:n=!1,size:o=null,scale:i=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.deleted)return null;t.imageFormat=r;const a=t.notifyStartCaptureImage;return t.notifyStartCaptureImage=!0,t._screenshot={size:o||1!==i?o||t.size.map(e=>e*i):null},new Promise((r,o)=>{const i=e.onImageReady(o=>{if(null===t._screenshot.size)t.notifyStartCaptureImage=a,i.unsubscribe(),t._screenshot.placeHolder&&(t.size=t._screenshot.originalSize,e.modified(),t._screenshot.cameras&&t._screenshot.cameras.forEach(e=>{let{restoreParamsFn:t,arg:r}=e;return t(r)}),e.traverseAllPasses(),t.el.removeChild(t._screenshot.placeHolder),t._screenshot.placeHolder.remove(),t._screenshot=null),r(o);else{const r=document.createElement("img");if(r.style=Wy,r.src=o,t._screenshot.placeHolder=t.el.appendChild(r),t.canvas.style.display="none",t._screenshot.originalSize=t.size,t.size=t._screenshot.size,t._screenshot.size=null,e.modified(),n){const e=!0!==n;t._screenshot.cameras=t.renderable.getRenderers().map(t=>{const r=t.getActiveCamera(),o=r.get("focalPoint","position","parallelScale");return{resetCameraArgs:e?{renderer:t}:void 0,resetCameraFn:e?n:t.resetCamera,restoreParamsFn:r.set,arg:JSON.parse(JSON.stringify(o))}}),t._screenshot.cameras.forEach(e=>{let{resetCameraFn:t,resetCameraArgs:r}=e;return t(r)})}e.traverseAllPasses()}})})},e.traverseAllPasses=()=>{if(!t.deleted)if(t.initialized){if(t.renderPasses)for(let r=0;r<t.renderPasses.length;++r)t.renderPasses[r].traverse(e,null);t.commandEncoder&&(t.device.submitCommandEncoder(t.commandEncoder),t.commandEncoder=null,t.notifyStartCaptureImage&&t.device.onSubmittedWorkDone().then(()=>{!async function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.imageFormat;const n=document.createElement("canvas"),o=n.getContext("2d");n.width=t.canvas.width,n.height=t.canvas.height;const i=await e.getPixelsAsync(),a=new ImageData(i.colorValues,i.width,i.height);o.putImageData(a,0,0);const s=t.canvas.getBoundingClientRect();t.renderable.getRenderers().forEach(e=>{e.getViewProps().forEach(e=>{if(e.getContainer){const t=e.getContainer().getElementsByTagName("canvas");for(let e=0;e<t.length;e++){const r=t[e],n=r.getBoundingClientRect(),i=n.x-s.x,a=n.y-s.y;o.drawImage(r,i,a)}}})});const l=n.toDataURL(r);n.remove(),e.invokeImageReady(l)}()}))}else{e.initialize();const t=e.onInitialized(()=>{t.unsubscribe(),e.traverseAllPasses()})}},e.setViewStream=r=>t.viewStream!==r&&(t.subscription&&(t.subscription.unsubscribe(),t.subscription=null),t.viewStream=r,t.viewStream&&(t.renderable.getRenderers()[0].getBackgroundByReference()[3]=0,e.setUseBackgroundImage(!0),t.subscription=t.viewStream.onImageReady(t=>e.setBackgroundImage(t.image)),t.viewStream.setSize(t.size[0],t.size[1]),t.viewStream.invalidateCache(),t.viewStream.render(),e.modified()),!0),e.getUniquePropID=()=>t.nextPropID++,e.getPropFromID=e=>{for(let r=0;r<t.children.length;r++){const n=t.children[r].getPropFromID(e);if(null!==n)return n}return null},e.getPixelsAsync=async()=>{const e=t.device,r=t.renderPasses[0].getOpaquePass().getColorTexture(),n={width:r.getWidth(),height:r.getHeight()};n.colorBufferWidth=32*Math.floor((n.width+31)/32),n.colorBufferSizeInBytes=n.colorBufferWidth*n.height*8;const o=lf.newInstance();o.setDevice(e),o.create(n.colorBufferSizeInBytes,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);const i=t.device.createCommandEncoder();i.copyTextureToBuffer({texture:r.getHandle()},{buffer:o.getHandle(),bytesPerRow:8*n.colorBufferWidth,rowsPerImage:n.height},{width:n.width,height:n.height,depthOrArrayLayers:1}),e.submitCommandEncoder(i);const a=o.mapAsync(GPUMapMode.READ);await a,n.colorValues=new Uint16Array(o.getMappedRange().slice()),o.unmap();const s=new Uint8ClampedArray(n.height*n.width*4);for(let e=0;e<n.height;e++)for(let t=0;t<n.width;t++){const r=4*(e*n.width+t),o=4*(e*n.colorBufferWidth+t);s[r]=255*hd.fromHalf(n.colorValues[o]),s[r+1]=255*hd.fromHalf(n.colorValues[o+1]),s[r+2]=255*hd.fromHalf(n.colorValues[o+2]),s[r+3]=255*hd.fromHalf(n.colorValues[o+3])}return n.colorValues=s,n},e.createSelector=()=>{const t=zy.newInstance();return t.setWebGPURenderWindow(e),t};const n=e.setSize;e.setSize=(t,r)=>{const o=n(t,r);return o&&e.invokeWindowResizeEvent({width:t,height:r}),o},e.delete=zt.chain(e.delete,e.setViewStream)}(e,t)},"vtkWebGPURenderWindow");Zh("WebGPU",Ky),vp("vtkRenderWindow",Ky);const Xy=km(),$y={margin:"0",padding:"0",position:"absolute",top:"0",left:"0",width:"100%",height:"100%",overflow:"hidden"},qy={position:"absolute",left:"25px",top:"25px",backgroundColor:"white",borderRadius:"5px",listStyle:"none",padding:"5px 10px",margin:"0",display:"block",border:"solid 1px black",maxWidth:"calc(100% - 70px)",maxHeight:"calc(100% - 60px)",overflow:"auto"};function Yy(e,t){Object.keys(t).forEach(r=>{e.style[r]=t[r]})}const Jy={background:[.32,.34,.43],containerStyle:null,controlPanelStyle:null,listenWindowResize:!0,resizeCallback:null,controllerVisibility:!0};function Qy(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Jy,r),zt.obj(e,t),zt.get(e,t,["renderWindow","renderer","apiSpecificRenderWindow","interactor","rootContainer","container","controlContainer"]),function(e,t){t.classHierarchy.push("vtkFullScreenRenderWindow");const r=document.querySelector("body");function n(t){"c"===String.fromCharCode(t.charCode)&&e.toggleControllerVisibility()}t.rootContainer||(t.rootContainer=r),t.container||(t.container=document.createElement("div"),Yy(t.container,t.containerStyle||$y),t.rootContainer.appendChild(t.container)),t.rootContainer===r&&(document.documentElement.style.height="100%",r.style.height="100%",r.style.padding="0",r.style.margin="0"),t.renderWindow=nm.newInstance(),t.renderer=Jh.newInstance(),t.renderWindow.addRenderer(t.renderer),t.apiSpecificRenderWindow=t.renderWindow.newAPISpecificView(Xy.viewAPI??t.defaultViewAPI),t.apiSpecificRenderWindow.setContainer(t.container),t.renderWindow.addView(t.apiSpecificRenderWindow),t.interactor=xm.newInstance(),t.interactor.setInteractorStyle(Fm.newInstance()),t.interactor.setView(t.apiSpecificRenderWindow),t.interactor.initialize(),t.interactor.bindEvents(t.container),e.setBackground=t.renderer.setBackground,e.removeController=()=>{const e=t.controlContainer;e&&e.parentNode.removeChild(e)},e.setControllerVisibility=e=>{t.controllerVisibility=e,t.controlContainer&&(t.controlContainer.style.display=e?"block":"none")},e.toggleControllerVisibility=()=>{e.setControllerVisibility(!t.controllerVisibility)},e.addController=r=>{t.controlContainer=document.createElement("div"),Yy(t.controlContainer,t.controlPanelStyle||qy),t.rootContainer.appendChild(t.controlContainer),t.controlContainer.innerHTML=r,e.setControllerVisibility(t.controllerVisibility),t.rootContainer.addEventListener("keypress",n)},e.setBackground(...t.background),e.addRepresentation=e=>{e.getActors().forEach(e=>{t.renderer.addActor(e)})},e.removeRepresentation=e=>{e.getActors().forEach(e=>t.renderer.removeActor(e))},e.delete=zt.chain(e.setContainer,t.apiSpecificRenderWindow.delete,()=>{t.rootContainer?.removeEventListener("keypress",n),window.removeEventListener("resize",e.resize)},e.delete),e.resize=()=>{const e=t.container.getBoundingClientRect(),r=window.devicePixelRatio||1;t.apiSpecificRenderWindow.setSize(Math.floor(e.width*r),Math.floor(e.height*r)),t.resizeCallback&&t.resizeCallback(e),t.renderWindow.render()},e.setResizeCallback=r=>{t.resizeCallback=r,e.resize()},t.listenWindowResize&&window.addEventListener("resize",e.resize),e.resize()}(e,t)}var Zy={newInstance:zt.newInstance(Qy),extend:Qy};const ev=e=>e,tv=1e-6;class rv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.matrix=h(new Float64Array(16)),this.tmp=new Float64Array(3),this.angleConv=e?l:ev}rotateFromDirections(e,t){const r=new Float64Array(3),n=new Float64Array(3),o=new Float64Array(16);mr(r,e[0],e[1],e[2]),mr(n,t[0],t[1],t[2]),br(r,r),br(n,n);const i=xr(r,n);return i>=1||(_r(this.tmp,r,n),pr(this.tmp)<tv&&(_r(this.tmp,[1,0,0],e),pr(this.tmp)<tv&&_r(this.tmp,[0,1,0],e)),D(o,Math.acos(i),this.tmp),b(this.matrix,this.matrix,o)),this}rotate(e,t){return mr(this.tmp,...t),br(this.tmp,this.tmp),S(this.matrix,this.matrix,this.angleConv(e),this.tmp),this}rotateX(e){return C(this.matrix,this.matrix,this.angleConv(e)),this}rotateY(e){return T(this.matrix,this.matrix,this.angleConv(e)),this}rotateZ(e){return w(this.matrix,this.matrix,this.angleConv(e)),this}translate(e,t,r){return mr(this.tmp,e,t,r),x(this.matrix,this.matrix,this.tmp),this}scale(e,t,r){return mr(this.tmp,e,t,r),_(this.matrix,this.matrix,this.tmp),this}multiply(e){return b(this.matrix,this.matrix,e),this}multiply3x3(e){return b(this.matrix,this.matrix,[e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1]),this}invert(){return g(this.matrix,this.matrix),this}identity(){return h(this.matrix),this}apply(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if($o(io,this.matrix))return this;const n=-1===r?e.length:t+3*r;for(let r=t;r<n;r+=3)mr(this.tmp,e[r],e[r+1],e[r+2]),Sr(this.tmp,this.tmp,this.matrix),e[r]=this.tmp[0],e[r+1]=this.tmp[1],e[r+2]=this.tmp[2];return this}getMatrix(){return this.matrix}setMatrix(e){return e&&16===e.length&&d(this.matrix,e),this}}var nv=function(){return new rv(!0)},ov=function(){return new rv(!1)};const iv=[2,0,1,2,2,3,2,4,5,2,6,7,2,0,2,2,1,3,2,4,6,2,5,7,2,0,4,2,1,5,2,2,6,2,3,7],av=[4,0,1,3,2,4,4,6,7,5,4,8,10,11,9,4,12,13,15,14,4,16,18,19,17,4,20,21,23,22],sv={xLength:1,yLength:1,zLength:1,pointType:"Float64Array",generate3DTextureCoordinates:!1,generateFaces:!0,generateLines:!1};function lv(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,sv,r),zt.obj(e,t),zt.setGet(e,t,["xLength","yLength","zLength","generate3DTextureCoordinates","generateFaces","generateLines"]),zt.setGetArray(e,t,["center","rotations"],3),zt.setGetArray(e,t,["matrix"],16),t._polys=Xl.newInstance({values:Uint16Array.from(av)}),t._lineCells=Xl.newInstance({values:Uint16Array.from(iv)}),zt.moveToProtected(e,t,["polys","lineCells"]),zt.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkCubeSource"),e.requestData=(e,r)=>{const n=r[0]?.initialize()||mc.newInstance();r[0]=n;const o=zt.newTypedArray(t.pointType,72);n.getPoints().setData(o,3);const i=zt.newTypedArray(t.pointType,72),a=_s.newInstance({name:"Normals",values:i,numberOfComponents:3});n.getPointData().setNormals(a);let s=2;!0===t.generate3DTextureCoordinates&&(s=3);const l=zt.newTypedArray(t.pointType,24*s),u=_s.newInstance({name:"TextureCoordinates",values:l,numberOfComponents:s});n.getPointData().setTCoords(u);const c=[0,0,0],d=[0,0,0],p=[0,0];let f=0;c[0]=-t.xLength/2,d[0]=-1,d[1]=0,d[2]=0;for(let e=0;e<2;e++){c[1]=-t.yLength/2;for(let r=0;r<2;r++){p[1]=c[1]+.5,c[2]=-t.zLength/2;for(let n=0;n<2;n++)p[0]=(c[2]+.5)*(1-2*e),o[3*f]=c[0],o[3*f+1]=c[1],o[3*f+2]=c[2],i[3*f]=d[0],i[3*f+1]=d[1],i[3*f+2]=d[2],2===s?(l[f*s]=p[0],l[f*s+1]=p[1]):(l[f*s]=2*e-1,l[f*s+1]=2*r-1,l[f*s+2]=2*n-1),f++,c[2]+=t.zLength;c[1]+=t.yLength}c[0]+=t.xLength,d[0]+=2}c[1]=-t.yLength/2,d[1]=-1,d[0]=0,d[2]=0;for(let e=0;e<2;e++){c[0]=-t.xLength/2;for(let r=0;r<2;r++){p[0]=(c[0]+.5)*(2*e-1),c[2]=-t.zLength/2;for(let n=0;n<2;n++)p[1]=-1*(c[2]+.5),o[3*f]=c[0],o[3*f+1]=c[1],o[3*f+2]=c[2],i[3*f]=d[0],i[3*f+1]=d[1],i[3*f+2]=d[2],2===s?(l[f*s]=p[0],l[f*s+1]=p[1]):(l[f*s]=2*r-1,l[f*s+1]=2*e-1,l[f*s+2]=2*n-1),f++,c[2]+=t.zLength;c[0]+=t.xLength}c[1]+=t.yLength,d[1]+=2}c[2]=-t.zLength/2,d[2]=-1,d[0]=0,d[1]=0;for(let e=0;e<2;e++){c[1]=-t.yLength/2;for(let r=0;r<2;r++){p[1]=c[1]+.5,c[0]=-t.xLength/2;for(let n=0;n<2;n++)p[0]=(c[0]+.5)*(2*e-1),o[3*f]=c[0],o[3*f+1]=c[1],o[3*f+2]=c[2],i[3*f]=d[0],i[3*f+1]=d[1],i[3*f+2]=d[2],2===s?(l[f*s]=p[0],l[f*s+1]=p[1]):(l[f*s]=2*n-1,l[f*s+1]=2*r-1,l[f*s+2]=2*e-1),f++,c[0]+=t.xLength;c[1]+=t.yLength}c[2]+=t.zLength,d[2]+=2}if(t.rotations&&nv().rotateX(t.rotations[0]).rotateY(t.rotations[1]).rotateZ(t.rotations[2]).apply(o).apply(i),t.center&&ov().translate(...t.center).apply(o),t.matrix){ov().setMatrix(t.matrix).apply(o);const e=[t.matrix[0],t.matrix[1],t.matrix[2],0,t.matrix[4],t.matrix[5],t.matrix[6],0,t.matrix[8],t.matrix[9],t.matrix[10],0,0,0,0,1];ov().setMatrix(e).apply(i)}t.generateFaces?n.getPolys().deepCopy(t._polys):n.getPolys().initialize(),t.generateLines?(n.getLines().deepCopy(t._lineCells),n.getPointData().setNormals(null)):n.getLines().initialize(),n.modified()},e.setBounds=function(){let t=[];if(Array.isArray(arguments.length<=0?void 0:arguments[0]))t=arguments.length<=0?void 0:arguments[0];else for(let e=0;e<arguments.length;e++)t.push(e<0||arguments.length<=e?void 0:arguments[e]);6===t.length&&(e.setXLength(t[1]-t[0]),e.setYLength(t[3]-t[2]),e.setZLength(t[5]-t[4]),e.setCenter([(t[0]+t[1])/2,(t[2]+t[3])/2,(t[4]+t[5])/2]))}}(e,t)}var uv={newInstance:zt.newInstance(lv,"vtkCubeSource"),extend:lv};function cv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];const[r,n,o,i]=t,a=e.getContext("2d").getImageData(r,n,o||e.width,i||e.height),s=qs.newInstance({type:"vtkImageData"});s.setOrigin(0,0,0),s.setSpacing(1,1,1),s.setExtent(0,(o||e.width)-1,0,(i||e.height)-1,0,0);const l=_s.newInstance({numberOfComponents:4,values:new Uint8Array(a.data.buffer)});return l.setName("scalars"),s.getPointData().setScalars(l),s}var dv={canvasToImageData:cv,imageToImageData:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{flipX:!1,flipY:!1,rotate:0};const r=document.createElement("canvas");r.width=e.width,r.height=e.height;const n=r.getContext("2d"),{flipX:o,flipY:i,rotate:a}=t;return n.translate(r.width/2,r.height/2),n.scale(o?-1:1,i?-1:1),n.rotate(a*Math.PI/180),n.drawImage(e,-e.width/2,-e.height/2),cv(r)}};const pv={default:{defaultStyle:{fontStyle:"bold",fontFamily:"Arial",fontColor:"black",fontSizeScale:e=>e/2,faceColor:"white",edgeThickness:.1,edgeColor:"black",resolution:400},xMinusFaceProperty:{text:"X-",faceColor:"yellow"},xPlusFaceProperty:{text:"X+",faceColor:"yellow"},yMinusFaceProperty:{text:"Y-",faceColor:"red"},yPlusFaceProperty:{text:"Y+",faceColor:"red"},zMinusFaceProperty:{text:"Z-",faceColor:"#008000"},zPlusFaceProperty:{text:"Z+",faceColor:"#008000"}},lps:{xMinusFaceProperty:{text:"R",faceRotation:-90},xPlusFaceProperty:{text:"L",faceRotation:90},yMinusFaceProperty:{text:"A",faceRotation:0},yPlusFaceProperty:{text:"P",faceRotation:180},zMinusFaceProperty:{text:"I",faceRotation:180},zPlusFaceProperty:{text:"S",faceRotation:0}}};function fv(e,t){t.set(e)}var hv={applyDefinitions:fv,applyPreset:function(e,t){return fv(pv[e],t)},registerStylePreset:function(e,t){pv[e]=t}};const mv={xPlus:0,xMinus:1,yPlus:2,yMinus:3,zPlus:4,zMinus:5},gv={defaultStyle:{text:"",faceColor:"white",faceRotation:0,fontFamily:"Arial",fontColor:"black",fontStyle:"normal",fontSizeScale:e=>e/1.8,edgeThickness:.1,edgeColor:"black",resolution:200}};function yv(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,gv,r),ss.extend(e,t,r),zt.get(e,t,["defaultStyle","xPlusFaceProperty","xMinusFaceProperty","yPlusFaceProperty","yMinusFaceProperty","zPlusFaceProperty","zMinusFaceProperty"]),function(e,t){t.classHierarchy.push("vtkAnnotatedCubeActor"),t.xPlusFaceProperty={...t.xPlusFaceProperty},t.xMinusFaceProperty={...t.xMinusFaceProperty},t.yPlusFaceProperty={...t.yPlusFaceProperty},t.yMinusFaceProperty={...t.yMinusFaceProperty},t.zPlusFaceProperty={...t.zPlusFaceProperty},t.zMinusFaceProperty={...t.zMinusFaceProperty};let r=null;const n=document.createElement("canvas"),o=Gl.newInstance(),i=vc.newInstance();function a(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;o&&Object.assign(t[`${r}FaceProperty`],o);const a={...t.defaultStyle,...t[`${r}FaceProperty`]};n.width=a.resolution,n.height=a.resolution;const s=n.getContext("2d");s.fillStyle=a.faceColor,s.fillRect(0,0,n.width,n.height),a.edgeThickness>0&&(s.strokeStyle=a.edgeColor,s.lineWidth=a.edgeThickness*n.width,s.strokeRect(0,0,n.width,n.height)),s.save(),s.translate(0,n.height),s.scale(1,-1),s.translate(n.width/2,n.height/2),s.rotate(-Math.PI*(a.faceRotation/180));const l=a.fontSizeScale(a.resolution);s.fillStyle=a.fontColor,s.textAlign="center",s.textBaseline="middle",s.font=`${a.fontStyle} ${l}px "${a.fontFamily}"`,s.fillText(a.text,0,0),s.restore();const u=dv.canvasToImageData(n);i.setInputData(u,mv[r]),e.modified()}function s(){r=uv.newInstance({generate3DTextureCoordinates:!0}),o.setInputConnection(r.getOutputPort()),a("xPlus"),a("xMinus"),a("yPlus"),a("yMinus"),a("zPlus"),a("zMinus")}i.setInterpolate(!0),e.setDefaultStyle=e=>{t.defaultStyle={...t.defaultStyle,...e},s()},e.setXPlusFaceProperty=e=>a("xPlus",e),e.setXMinusFaceProperty=e=>a("xMinus",e),e.setYPlusFaceProperty=e=>a("yPlus",e),e.setYMinusFaceProperty=e=>a("yMinus",e),e.setZPlusFaceProperty=e=>a("zPlus",e),e.setZMinusFaceProperty=e=>a("zMinus",e),s(),o.setInputConnection(r.getOutputPort()),e.setMapper(o),e.addTexture(i)}(e,t)}var vv={newInstance:zt.newInstance(yv,"vtkAnnotatedCubeActor"),extend:yv,Presets:hv},bv={Corners:{TOP_LEFT:"TOP_LEFT",TOP_RIGHT:"TOP_RIGHT",BOTTOM_LEFT:"BOTTOM_LEFT",BOTTOM_RIGHT:"BOTTOM_RIGHT"}};const{vtkErrorMacro:xv}=zt,{Corners:_v}=bv,Sv={viewportCorner:bv.Corners.BOTTOM_LEFT,viewportSize:.2,minPixelSize:50,maxPixelSize:200,parentRenderer:null,interactiveRenderer:!1};function Cv(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sv,r),zt.obj(e,t),zt.get(e,t,["enabled","viewportCorner","viewportSize","interactiveRenderer"]),zt.setGet(e,t,["_interactor","minPixelSize","maxPixelSize","parentRenderer"]),zt.get(e,t,["actor"]),zt.moveToProtected(e,t,["interactor"]),function(e,t){t.classHierarchy.push("vtkOrientationMarkerWidget");const r={...e},n=[],o=Jh.newInstance(),i=new ResizeObserver(t=>{e.updateViewport()});let a=null,s=null,l=null,u=null,c=null;function d(){t._interactor.isAnimating()||e.updateMarkerOrientation()}t._onParentRendererChanged=()=>e.updateViewport(),e.computeViewport=()=>{const e=t.parentRenderer||t._interactor.getCurrentRenderer(),[r,n,o,i]=e.getViewport(),a=t._interactor.getView(),s=a.getSize(),[l,u]=a.getViewportSize(e),c=Math.min(l,u);let d=t.viewportSize*c;d=Math.max(Math.min(t.minPixelSize,c),Math.min(t.maxPixelSize,d));const p=d/s[0],f=d/s[1];switch(t.viewportCorner){case _v.TOP_LEFT:return[r,i-f,r+p,i];case _v.TOP_RIGHT:return[o-p,i-f,o,i];case _v.BOTTOM_LEFT:return[r,n,r+p,n+f];case _v.BOTTOM_RIGHT:return[o-p,n,o,n+f];default:return xv("Invalid widget corner"),null}},e.updateViewport=()=>{t.enabled&&(o.setViewport(...e.computeViewport()),t._interactor.render())},e.updateMarkerOrientation=()=>{const e=(t.parentRenderer||t._interactor.getCurrentRenderer()).getActiveCamera();if(!e)return;const r=e.getReferenceByName("position"),i=e.getReferenceByName("focalPoint"),a=e.getReferenceByName("viewUp");if(n[0]!==r[0]||n[1]!==r[1]||n[2]!==r[2]||n[3]!==i[0]||n[4]!==i[1]||n[5]!==i[2]||n[6]!==a[0]||n[7]!==a[1]||n[8]!==a[2]){n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=i[0],n[4]=i[1],n[5]=i[2],n[6]=a[0],n[7]=a[1],n[8]=a[2];const e=o.getActiveCamera();e.setPosition(r[0],r[1],r[2]),e.setFocalPoint(i[0],i[1],i[2]),e.setViewUp(a[0],a[1],a[2]),o.resetCamera()}},e.setEnabled=r=>{if(r){if(t.enabled)return;if(!t.actor)return void xv("Must set actor before enabling orientation marker.");if(!t._interactor)return void xv("Must set interactor before enabling orientation marker.");const r=t.parentRenderer||t._interactor.getCurrentRenderer(),n=r.getRenderWindow();n.addRenderer(o),n.getNumberOfLayers()<2&&n.setNumberOfLayers(2),o.setLayer(n.getNumberOfLayers()-1),o.setInteractive(t.interactiveRenderer),o.addViewProp(t.actor),t.actor.setVisibility(!0),a=r.onEvent(e=>{"ActiveCameraEvent"===e.type&&(s&&s.unsubscribe(),s=e.camera.onModified(d))}),s=r.getActiveCamera().onModified(d),l=t._interactor.onAnimation(e.updateMarkerOrientation),u=t._interactor.onEndAnimation(e.updateMarkerOrientation),i.observe(t._interactor.getView().getCanvas()),e.updateViewport(),e.updateMarkerOrientation(),t.enabled=!0}else{if(!t.enabled)return;t.enabled=!1,i.disconnect(),a.unsubscribe(),a=null,s.unsubscribe(),s=null,l.unsubscribe(),l=null,u.unsubscribe(),u=null,t.actor.setVisibility(!1),o.removeViewProp(t.actor);const e=t._interactor?.findPokedRenderer()?.getRenderWindow();e&&e.removeRenderer(o)}e.modified()},e.setViewportCorner=r=>{r!==t.viewportCorner&&(t.viewportCorner=r,e.updateViewport())},e.setViewportSize=r=>{const n=Math.min(1,Math.max(0,r));n!==t.viewportSize&&(t.viewportSize=n,e.updateViewport())},e.setActor=r=>{const n=t.enabled;e.setEnabled(!1),t.actor=r,e.setEnabled(n)},e.getRenderer=()=>o,e.delete=()=>{r.delete(),c&&(c.unsubscribe(),c=null),a&&(a.unsubscribe(),a=null),s&&(s.unsubscribe(),s=null),l&&(l.unsubscribe(),l=null),u&&(u.unsubscribe(),u=null),i.disconnect()},c=e.onModified(e.updateViewport)}(e,t)}var Tv={newInstance:zt.newInstance(Cv,"vtkOrientationMarkerWidget"),extend:Cv,...bv};function wv(e){return new TextDecoder("latin1").decode(e)}var Av={arrayBufferToString:wv,extractBinary:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=wv(e),o=t.exec(n);if(!o)return{text:n};const i=o.index+o[0].length,a=n.substring(0,i);let s=null;const l=r?r.exec(n):null;return s=l?{text:a+n.substr(l.index),binaryBuffer:e.slice(i,l.index)}:{text:a,binaryBuffer:e.slice(i)},s}};const Ev={};function Dv(e){return!!Ev[e]}function Pv(e,t){Ev[e]=t}var Iv=function(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ev[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"http"](e)};function Ov(){const e=new ArrayBuffer(4),t=new Uint8Array(e),r=new Uint32Array(e);return t[0]=161,t[1]=178,t[2]=195,t[3]=212,3569595041===r[0]?"LittleEndian":2712847316===r[0]?"BigEndian":null}var Nv=Ov(),Mv=function(e,t){if(t<2)return;const r=new Int8Array(e),n=r.length,o=[];for(let e=0;e<n;e+=t){for(let n=0;n<t;n++)o.push(r[e+n]);for(let n=0;n<t;n++)r[e+n]=o.pop()}};const{vtkErrorMacro:Rv,vtkDebugMacro:Fv}=zt,Bv=()=>(Rv("LiteHttpDataAccessHelper does not support compression. Need to register HttpDataAccessHelper instead."),Promise.reject(new Error("LiteHttpDataAccessHelper does not support compression. Need to register HttpDataAccessHelper instead.")));let Lv=0;function kv(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new XMLHttpRequest;return n.open(e,t,!0),r.headers&&Object.entries(r.headers).forEach(e=>{let[t,r]=e;return n.setRequestHeader(t,r)}),r.progressCallback&&n.addEventListener("progress",r.progressCallback),n}const Uv={fetchArray:function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return n&&n.compression?Bv():r.ref&&!r.ref.pending?new Promise((o,i)=>{const a=kv("GET",[t,r.ref.basepath,r.ref.id].join("/"),n);a.onreadystatechange=t=>{1===a.readyState&&(r.ref.pending=!0,1===++Lv&&e?.invokeBusy&&e.invokeBusy(!0)),4===a.readyState&&(r.ref.pending=!1,200===a.status||0===a.status?(r.buffer=a.response,"JSON"===r.ref.encode?r.values=JSON.parse(r.buffer):(Nv!==r.ref.encode&&Nv&&(Fv(`Swap bytes of ${r.name}`),Mv(r.buffer,ls[r.dataType])),r.values=zt.newTypedArray(r.dataType,r.buffer)),r.values.length!==r.size&&Rv(`Error in FetchArray: ${r.name}, does not have the proper array size. Got ${r.values.length}, instead of ${r.size}`),delete r.ref,0===--Lv&&e?.invokeBusy&&e.invokeBusy(!1),e?.modified&&e.modified(),o(r)):i({xhr:a,e:t}))},a.responseType="string"!==r.dataType?"arraybuffer":"text",a.send()}):Promise.resolve(r)},fetchJSON:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r&&r.compression?Bv():new Promise((n,o)=>{const i=kv("GET",t,r);i.onreadystatechange=t=>{1===i.readyState&&1===++Lv&&e?.invokeBusy&&e.invokeBusy(!0),4===i.readyState&&(0===--Lv&&e?.invokeBusy&&e.invokeBusy(!1),200===i.status||0===i.status?n(JSON.parse(i.responseText)):o({xhr:i,e:t}))},i.responseType="text",i.send()})},fetchText:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r&&r.compression?Bv():new Promise((n,o)=>{const i=kv("GET",t,r);i.onreadystatechange=t=>{1===i.readyState&&1===++Lv&&e?.invokeBusy&&e.invokeBusy(!0),4===i.readyState&&(0===--Lv&&e?.invokeBusy&&e.invokeBusy(!1),200===i.status||0===i.status?n(i.responseText):o({xhr:i,e:t}))},i.responseType="text",i.send()})},fetchBinary:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((r,n)=>{const o=kv("GET",e,t);o.onreadystatechange=e=>{4===o.readyState&&(200===o.status||0===o.status?r(o.response):n({xhr:o,e}))},o.responseType="arraybuffer",o.send()})},fetchImage:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((e,n)=>{const o=new Image;r.crossOrigin&&(o.crossOrigin=r.crossOrigin),o.onload=()=>e(o),o.onerror=n,o.src=t})}};Dv("http")||Pv("http",e=>Uv);const{vtkErrorMacro:Vv}=zt;function Gv(e,t){for(let r=0;r<e.length;r++)t.push(e[r])}function zv(e,t,r,n,o){const i=e[t];if(void 0===i)return-1;if(-1!==i.indexOf("endfacet"))return t+1;if(-1===i.indexOf("facet"))return t+1;let a=0,s=2;const l=r.length/3,u=i.split(/[ \t]+/).filter(e=>e).slice(-3).map(Number);for(Gv(u,o);-1!==e[t+s].indexOf("vertex");){const n=e[t+s].split(/[ \t]+/).filter(e=>e).slice(-3).map(Number);Gv(n,r),a++,s++}n.push(a);for(let e=0;e<a;e++)n.push(l+e);for(;e[t+s]&&-1!==e[t+s].indexOf("endfacet");)s++;return t+s+2}const jv={removeDuplicateVertices:-1};function Wv(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,jv,r),zt.obj(e,t),zt.get(e,t,["url","baseURL"]),zt.setGet(e,t,["dataAccessHelper","removeDuplicateVertices"]),zt.algo(e,t,0,1),function(e,t){function r(e){const r=t.output[0],n=r.getPoints().getData(),o=r.getPolys().getData();if(!n||!o)return void console.warn("No valid polydata.");const i=new Map,a=new Map;let s=0,l=!1;for(let t=0;t<n.length;t+=3){const r=`${(n[t]*10**e).toFixed(0)},${(n[t+1]*10**e).toFixed(0)},${(n[t+2]*10**e).toFixed(0)}`;void 0!==i.get(r)?(a.set(t/3,i.get(r)),l=!0):(a.set(t/3,s),i.set(r,s),s++)}if(l){const t=new Float32Array(3*i.size),n=Array.from(i.keys());for(let r=0;r<n.length;r++){const o=n[r],a=3*i.get(o),s=o.split(",").map(t=>+t*10**-e);t[a]=s[0],t[a+1]=s[1],t[a+2]=s[2]}const s=new Int32Array(o.length);for(let e=0;e<o.length;e+=4)s[e]=3,s[e+1]=a.get(o[e+1]),s[e+2]=a.get(o[e+2]),s[e+3]=a.get(o[e+3]);r.getPoints().setData(t),r.getPolys().setData(s),r.modified()}}t.classHierarchy.push("vtkSTLReader"),t.dataAccessHelper||(t.dataAccessHelper=Iv("http")),e.setUrl=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{binary:!0};t.url=r;const o=r.split("/");return o.pop(),t.baseURL=o.join("/"),e.loadData(n)},e.loadData=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=void 0!==n.compression?n.compression:t.compression,i=void 0!==n.progressCallback?n.progressCallback:t.progressCallback;return n.binary?t.dataAccessHelper.fetchBinary(r,{compression:o,progressCallback:i}):t.dataAccessHelper.fetchText(e,r,{compression:o,progressCallback:i})}(t.url,r);return n.then(e.parse),n},e.parse=t=>{"string"==typeof t?e.parseAsText(t):e.parseAsArrayBuffer(t)},e.parseAsArrayBuffer=n=>{if(!n)return;if(n===t.parseData)return;e.modified(),t.parseData=n;let o=!1;if(o=84+50*new DataView(n,0,84).getUint32(80,!0)===n.byteLength,!o)return void e.parseAsText(Av.arrayBufferToString(n));const i=n.slice(0,80),a=function(e){const t=e.split(" ").filter(e=>e.indexOf("=")>-1),r={};for(let e=0;e<t.length;++e){const n=t[e].split("=");2===n.length&&(r[n[0]]=n[1])}return r}(Av.arrayBufferToString(i)),s=new DataView(n,84),l=(n.byteLength-84)/50,u=new Float32Array(9*l),c=new Float32Array(3*l),d=new Uint32Array(4*l),p=new Uint16Array(l);let f=0;for(let e=0;e<l;e++){const t=50*e;c[3*e+0]=s.getFloat32(t+0,!0),c[3*e+1]=s.getFloat32(t+4,!0),c[3*e+2]=s.getFloat32(t+8,!0),u[9*e+0]=s.getFloat32(t+12,!0),u[9*e+1]=s.getFloat32(t+16,!0),u[9*e+2]=s.getFloat32(t+20,!0),u[9*e+3]=s.getFloat32(t+24,!0),u[9*e+4]=s.getFloat32(t+28,!0),u[9*e+5]=s.getFloat32(t+32,!0),u[9*e+6]=s.getFloat32(t+36,!0),u[9*e+7]=s.getFloat32(t+40,!0),u[9*e+8]=s.getFloat32(t+44,!0),d[f++]=3,d[f++]=3*e+0,d[f++]=3*e+1,d[f++]=3*e+2,p[e]=s.getUint16(t+48,!0)}const h="SPACE";if(h in a&&"LPS"!==a[h]){const e=a[h],t=new Float32Array(16);switch(t[15]=1,e[0]){case"L":t[0]=1;break;case"R":t[0]=-1;break;default:return void Vv(`Can not convert STL file from ${e} to LPS space: permutations not supported. Use itk.js STL reader instead.`)}switch(e[1]){case"P":t[5]=1;break;case"A":t[5]=-1;break;default:return void Vv(`Can not convert STL file from ${e} to LPS space: permutations not supported. Use itk.js STL reader instead.`)}switch(e[2]){case"S":t[10]=1;break;case"I":t[10]=-1;break;default:return void Vv(`Can not convert STL file from ${e} to LPS space: permutations not supported. Use itk.js STL reader instead.`)}nv().setMatrix(t).apply(u).apply(c)}const m=mc.newInstance();m.getPoints().setData(u,3),m.getPolys().setData(d),m.getCellData().setScalars(_s.newInstance({name:"Attribute",values:p})),m.getCellData().setNormals(_s.newInstance({name:"Normals",values:c,numberOfComponents:3})),t.output[0]=m,t.removeDuplicateVertices>=0&&r(t.removeDuplicateVertices)},e.parseAsText=n=>{if(!n)return;if(n===t.parseData)return;e.modified(),t.parseData=n;const o=n.split("\n");let i=1;const a=[],s=[],l=[];for(;-1!==i;)i=zv(o,i,a,s,l);const u=mc.newInstance();u.getPoints().setData(Float32Array.from(a),3),u.getPolys().setData(Uint32Array.from(s)),u.getCellData().setNormals(_s.newInstance({name:"Normals",values:Float32Array.from(l),numberOfComponents:3})),t.output[0]=u,t.removeDuplicateVertices>=0&&r(t.removeDuplicateVertices)},e.requestData=(r,n)=>{e.parse(t.parseData)}}(e,t),t.compression||(t.compression=null),t.progressCallback||(t.progressCallback=null)}var Hv={extend:Wv,newInstance:zt.newInstance(Wv,"vtkSTLReader")};const Kv="ascii",Xv={diffuse_red:"red",diffuse_green:"green",diffuse_blue:"blue"},$v={patternHeader:/ply([\s\S]*)end_header\r?\n/,patternBody:/end_header\s([\s\S]*)$/};function qv(e){let t="",r=0;const n=$v.patternHeader.exec(e);null!==n&&(t=n[1],r=n[0].length);const o={comments:[],elements:[],headerLength:r},i=t.split("\n");let a,s,l;for(let e=0;e<i.length;e++){let t=i[e];if(t=t.trim(),""!==t){let e;switch(l=t.split(/\s+/),s=l.shift(),t=l.join(" "),s){case"format":o.format=l[0],o.version=l[1];break;case"comment":o.comments.push(t);break;case"element":void 0!==a&&o.elements.push(a),a={},a.name=l[0],a.count=parseInt(l[1],10),a.properties=[];break;case"property":e={type:l[0]},"list"===e.type?(e.name=l[3],e.countType=l[1],e.itemType=l[2]):e.name=l[1],e.name in Xv&&(e.name=Xv[e.name]),a.properties.push(e);break;case"obj_info":o.objInfo=t;break;default:console.warn("unhandled",s,l)}}}return void 0!==a&&o.elements.push(a),o}function Yv(e,t,r,n){const o=t.find(e=>"vertex"===e.name),i=t.find(e=>"face"===e.name);let a=0,s=0;o&&(a=o.count),i&&(s=i.count);let l=new Float32Array(3*a),u=new Uint8Array(3*a),c=new Float32Array(2*a),d=new Float32Array(3*a);const p=e.colors.length>0,f=e.uvs.length>0,h=e.normals.length>0,m=e.faceVertexUvs.length>0,g=new Map;let y=a;for(let t=0;t<a;t++){let r=3*t+0,n=3*t+1;const o=3*t+2;l[r]=e.vertices[r],l[n]=e.vertices[n],l[o]=e.vertices[o],p&&(u[r]=e.colors[r],u[n]=e.colors[n],u[o]=e.colors[o]),f?(r=2*t+0,n=2*t+1,c[r]=e.uvs[r],c[n]=e.uvs[n]):(c[2*t]=-1,c[2*t+1]=-1),h&&(d[r]=e.normals[r],d[n]=e.normals[n],d[o]=e.normals[o])}if(m&&!f&&s>0){let t=0,o=0;if(n){const n=[],i=[],f=[],m=[];for(let a=0;a<s;++a){const a=e.indices[t++],s=e.faceVertexUvs[o++];if(s&&2*a===s.length)for(let o=0;o<a;++o){const a=e.indices[t+o],v=[s[2*o],s[2*o+1]],b=[c[2*a],c[2*a+1]];if(-1===b[0]){c[2*a]=v[0],c[2*a+1]=v[1];const e=`${v[0]},${v[1]}`;g.has(e)||g.set(e,[]),g.get(e).push(a)}else if(Math.abs(b[0]-v[0])>r||Math.abs(b[1]-v[1])>r){const s=`${v[0]},${v[1]}`;let c=-1;if(g.has(s)){const e=g.get(s);for(let t=0,n=e.length;t<n;t++){const n=e[t];if(Math.abs(l[3*n]-l[3*a])<=r&&Math.abs(l[3*n+1]-l[3*a+1])<=r&&Math.abs(l[3*n+2]-l[3*a+2])<=r){c=n;break}}}-1===c?(n.push(l[3*a],l[3*a+1],l[3*a+2]),p&&i.push(u[3*a],u[3*a+1],u[3*a+2]),h&&f.push(d[3*a],d[3*a+1],d[3*a+2]),m.push(v[0],v[1]),g.has(s)||g.set(s,[]),g.get(s).push(y),e.indices[t+o]=y,y++):e.indices[t+o]=c}}t+=a}if(n.length>0){const e=a+n.length/3,t=new Float32Array(3*e),r=new Float32Array(2*e),o=p?new Uint8Array(3*e):null,s=h?new Float32Array(3*e):null;t.set(l),r.set(c),p&&o&&o.set(u),h&&s&&s.set(d),t.set(n,3*a),r.set(m,2*a),p&&o&&o.set(i,3*a),h&&s&&s.set(f,3*a),l=t,c=r,p&&(u=o),h&&(d=s)}}else for(let r=0;r<s;++r){const r=e.indices[t++],n=e.faceVertexUvs[o++];if(n&&2*r===n.length)for(let o=0;o<r;++o){const r=e.indices[t++];c[2*r]=n[2*o],c[2*r+1]=n[2*o+1]}else t+=r}}const v=mc.newInstance();if(v.getPoints().setData(l,3),s>0)v.getPolys().setData(Uint32Array.from(e.indices));else{const e=new Uint32Array(2*a);for(let t=0;t<a;t++)e[2*t]=1,e[2*t+1]=t;v.getVerts().setData(e)}if(p&&v.getPointData().setScalars(_s.newInstance({numberOfComponents:3,values:u,name:"RGB"})),f||m){const e=_s.newInstance({numberOfComponents:2,values:c,name:"TextureCoordinates"}),t=v.getPointData();t.addArray(e),t.setActiveTCoords(e.getName())}return h&&v.getPointData().setNormals(_s.newInstance({numberOfComponents:3,name:"Normals",values:d})),v}function Jv(e,t){let r;switch(t){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":r=parseInt(e,10);break;case"float":case"double":case"float32":case"float64":r=parseFloat(e);break;default:console.log("Unsupported type")}return r}function Qv(e,t){const r=t.split(/\s+/),n={};for(let t=0;t<e.length;t++)if("list"===e[t].type){const o=[],i=Jv(r.shift(),e[t].countType);for(let n=0;n<i;n++)o.push(Jv(r.shift(),e[t].itemType));n[e[t].name]=o}else n[e[t].name]=Jv(r.shift(),e[t].type);return n}function Zv(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r?e.uvs.push(r.s,r.t):"u"in r&&"v"in r?e.uvs.push(r.u,r.v):"texture_u"in r&&"texture_v"in r&&e.uvs.push(r.texture_u,r.texture_v),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red,r.green,r.blue);else if("face"===t){const t=r.vertex_indices||r.vertex_index,n=r.texcoord;t&&t.length>0&&(e.indices.push(t.length),t.forEach((t,r)=>{e.indices.push(t)})),e.faceVertexUvs.push(n)}}function eb(e,t,r,n){let o;switch(r){case"int8":case"char":o=[e.getInt8(t),1];break;case"uint8":case"uchar":o=[e.getUint8(t),1];break;case"int16":case"short":o=[e.getInt16(t,n),2];break;case"uint16":case"ushort":o=[e.getUint16(t,n),2];break;case"int32":case"int":o=[e.getInt32(t,n),4];break;case"uint32":case"uint":o=[e.getUint32(t,n),4];break;case"float32":case"float":o=[e.getFloat32(t,n),4];break;case"float64":case"double":o=[e.getFloat64(t,n),8];break;default:console.log("Unsupported type")}return o}function tb(e,t,r,n){const o={};let i,a=0;for(let s=0;s<r.length;s++)if("list"===r[s].type){const l=[];i=eb(e,t+a,r[s].countType,n);const u=i[0];a+=i[1];for(let o=0;o<u;o++)i=eb(e,t+a,r[s].itemType,n),l.push(i[0]),a+=i[1];o[r[s].name]=l}else i=eb(e,t+a,r[s].type,n),o[r[s].name]=i[0],a+=i[1];return[o,a]}const rb={faceTextureTolerance:1e-6,duplicatePointsForFaceTexture:!0};function nb(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,rb,r),zt.obj(e,t),zt.get(e,t,["url","baseURL","duplicatePointsForFaceTexture","faceTextureTolerance"]),zt.setGet(e,t,["dataAccessHelper"]),zt.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkPLYReader"),t.dataAccessHelper||(t.dataAccessHelper=Iv("http")),e.setUrl=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{binary:!0};t.url=r;const o=r.split("/");return o.pop(),t.baseURL=o.join("/"),t.compression=n.compression,e.loadData({progressCallback:n.progressCallback,binary:!!n.binary})},e.loadData=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{compression:o,progressCallback:i}=t;return n.binary?t.dataAccessHelper.fetchBinary(r,{compression:o,progressCallback:i}):t.dataAccessHelper.fetchText(e,r,{compression:o,progressCallback:i})}(t.url,r);return n.then(e.parse),n},e.parse=t=>{"string"==typeof t?e.parseAsText(t):e.parseAsArrayBuffer(t)},e.parseAsArrayBuffer=r=>{if(!r)return;if(r===t.parseData)return;e.modified();let n=r;r instanceof ArrayBuffer&&(n=Av.arrayBufferToString(r));const o=qv(n);if(o.format===Kv)return void e.parseAsText(n);t.parseData=r;const i={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},a="binary_little_endian"===o.format,s=r instanceof ArrayBuffer?r:r.buffer,l=new DataView(s,o.headerLength);let u,c=0;for(let e=0;e<o.elements.length;e++)for(let t=0;t<o.elements[e].count;t++){u=tb(l,c,o.elements[e].properties,a),c+=u[1];const t=u[0];Zv(i,o.elements[e].name,t)}const d=Yv(i,o.elements,t.faceTextureTolerance,t.duplicatePointsForFaceTexture);t.output[0]=d},e.parseAsText=r=>{if(!r)return;if(r===t.parseData)return;e.modified(),t.parseData=r;let n=r;r instanceof ArrayBuffer&&(n=Av.arrayBufferToString(r));const o=qv(n);if(o.format!==Kv)return void e.parseAsArrayBuffer(r);const i={indices:[],vertices:[],normals:[],uvs:[],faceVertexUvs:[],colors:[]},a=$v.patternBody.exec(n);let s="";null!==a&&(s=a[1]);const l=s.split("\n");let u=0,c=0;for(let e=0;e<l.length;e++){let t=l[e];if(t=t.trim(),""!==t){c>=o.elements[u].count&&(u++,c=0);const e=Qv(o.elements[u].properties,t);Zv(i,o.elements[u].name,e),c++}}const d=Yv(i,o.elements,t.faceTextureTolerance,t.duplicatePointsForFaceTexture);t.output[0]=d},e.requestData=(r,n)=>{e.parse(t.parseData)}}(e,t),t.compression||(t.compression=null),t.progressCallback||(t.progressCallback=null)}var ob={extend:nb,newInstance:zt.newInstance(nb,"vtkPLYReader")};const ib={};function ab(e,t,r,n,o){for(let i=0;i<o;i++)r[n+i]=e[t+i]}function sb(e){const t=e.split("/").map(e=>Number(e));let r=t[0]-1;r=r<0?r+1+ib.v.length/3:r;let n=t[1]?t[1]-1:r;n=n<0?n+1+ib.vt.length/2:n;let o=t[2]?t[2]-1:r;return o=o<0?o+1+ib.vn.length/3:o,[r,n,o]}function lb(e){if("#"===e[0])return;const t=e.split(/[ \t]+/);if(t[0]===ib.splitOn)t.shift(),ib.pieces.push(t.join(" ").trim()),ib.f.push([]),ib.size++;else if("v"===t[0])ib.v.push(Number(t[1])),ib.v.push(Number(t[2])),ib.v.push(Number(t[3]));else if("vt"===t[0])ib.vt.push(Number(t[1])),ib.vt.push(Number(t[2]));else if("vn"===t[0])ib.vn.push(Number(t[1])),ib.vn.push(Number(t[2])),ib.vn.push(Number(t[3]));else if("f"===t[0]){0===ib.size&&ib.size++;const e=ib.f[ib.size-1];t.shift();const r=t.filter(e=>e.length>0&&"\r"!==e),n=r.length;e.push(n);for(let t=0;t<n;t++)e.push(sb(r[t]))}}const ub={getPointDuplicateIds:function(e,t){const r=[],n=e.getPointData().getArrayByName("Duplicates");if(null==n)return r;const o=n.getData(),i=Math.min(t,o[t]);r.push(i);let a=o[i];if(a!==i)for(;a<o.length&&o[a]===i;)r.push(a++);return r}};const cb={numberOfOutputs:1,requestCount:0,splitMode:null,trackDuplicates:!1};function db(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cb,r),zt.obj(e,t),zt.get(e,t,["url","baseURL"]),zt.setGet(e,t,["dataAccessHelper","splitMode","trackDuplicates"]),zt.algo(e,t,0,1),zt.event(e,t,"busy"),function(e,t){t.classHierarchy.push("vtkOBJReader"),t.dataAccessHelper||(t.dataAccessHelper=Iv("http")),e.setUrl=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(-1!==r.indexOf(".obj")||n.fullpath){t.url=r;const e=r.split("/");e.pop(),t.baseURL=e.join("/")}else t.baseURL=r,t.url=`${r}/index.obj`;return e.loadData(n)},e.loadData=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.dataAccessHelper.fetchText(e,r,n)}(t.url,r).then(t=>!e.isDeleted()&&e.parseAsText(t))},e.parseAsText=r=>{return!r||(r!==t.parseData&&e.modified(),t.parseData=r,t.numberOfOutputs=0,n=t.splitMode,ib.splitOn=n,ib.pieces=[],ib.v=[],ib.vt=[],ib.vn=[],ib.f=[[]],ib.size=0,r.split("\n").forEach(lb),function(e){const t=!!ib.vt.length,r=!!ib.vn.length;if(e.splitMode){e.numberOfOutputs=ib.size;for(let n=0;n<ib.size;n++){const o=ib.f[n],i=o.length,a=ib.v.length/3,s={};let l;if(e.trackDuplicates){const e=[];let t=0;for(let r=0;r<i;){const n=o[r++];for(let i=0;i<n;i++){const[n,i,a]=o[r++],l=`${n}/${i}/${a}`;void 0===s[l]&&(void 0===e[n]?e[n]=[l]:(e[n].push(l),++t),s[l]=n)}}l=new Uint16Array(a+t);let r=0;for(let t=0;t<e.length;++t){const n=e[t]?e[t].length:0;l[t]=n>1?a+r:t;for(let o=1;o<n;++o){const n=a+r++;l[n]=t,s[e[t][o]]=n}}}const u={},c=mc.newInstance({name:ib.pieces[n]}),d=[],p=[],f=[],h=[];let m=0;for(;m<i;){const n=o[m];h.push(n);for(let i=0;i<n;i++){const[n,a,l]=o[m+i+1],c=`${n}/${a}/${l}`;if(void 0===u[c]){const o=e.trackDuplicates?s[c]:d.length/3;u[c]=o,ab(ib.v,3*n,d,3*o,3),t&&ab(ib.vt,2*a,p,2*o,2),r&&ab(ib.vn,3*l,f,3*o,3)}h.push(u[c])}m+=n+1}if(c.getPoints().setData(Float32Array.from(d),3),e.trackDuplicates){const e=_s.newInstance({name:"Duplicates",values:l});c.getPointData().addArray(e)}if(c.getPolys().setData(Uint32Array.from(h)),t){const e=_s.newInstance({numberOfComponents:2,values:Float32Array.from(p),name:"TextureCoordinates"});c.getPointData().setTCoords(e)}if(r){const e=_s.newInstance({numberOfComponents:3,values:Float32Array.from(f),name:"Normals"});c.getPointData().setNormals(e)}e.output[n]=c}}else{e.numberOfOutputs=1;const n=mc.newInstance();if(n.getPoints().setData(Float32Array.from(ib.v),3),t&&ib.v.length/3==ib.vt.length/2){const e=_s.newInstance({numberOfComponents:2,values:Float32Array.from(ib.vt),name:"TextureCoordinates"});n.getPointData().setTCoords(e)}if(r&&ib.v.length===ib.vn.length){const e=_s.newInstance({numberOfComponents:3,values:Float32Array.from(ib.vn),name:"Normals"});n.getPointData().setNormals(e)}const o=[],i=ib.f[0],a=i.length;let s=0;for(;s<a;){const e=i[s];o.push(e);for(let t=0;t<e;t++){const[e]=i[s+t+1];o.push(e)}s+=e+1}n.getPolys().setData(Uint32Array.from(o)),e.output[0]=n}}(t),!0);var n},e.requestData=(r,n)=>{e.parseAsText(t.parseData)},e.isBusy=()=>!!t.requestCount,e.getNumberOfOutputPorts=()=>t.numberOfOutputs}(e,t)}var pb={newInstance:zt.newInstance(db,"vtkOBJReader"),extend:db,...ub},fb=r(570),hb=Uint8Array,mb=Uint16Array,gb=Uint32Array,yb=new hb([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,0,0,0]),vb=new hb([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,0,0]),bb=new hb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xb=function(e,t){for(var r=new mb(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];var o=new gb(r[30]);for(n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return[r,o]},_b=xb(yb,2),Sb=_b[0],Cb=_b[1];Sb[28]=258,Cb[258]=28;for(var Tb=xb(vb,0),wb=Tb[0],Ab=(Tb[1],new mb(32768)),Eb=0;Eb<32768;++Eb){var Db=(43690&Eb)>>>1|(21845&Eb)<<1;Db=(61680&(Db=(52428&Db)>>>2|(13107&Db)<<2))>>>4|(3855&Db)<<4,Ab[Eb]=((65280&Db)>>>8|(255&Db)<<8)>>>1}var Pb=function(e,t,r){for(var n=e.length,o=0,i=new mb(t);o<n;++o)e[o]&&++i[e[o]-1];var a,s=new mb(t);for(o=0;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;if(r){a=new mb(1<<t);var l=15-t;for(o=0;o<n;++o)if(e[o])for(var u=o<<4|e[o],c=t-e[o],d=s[e[o]-1]++<<c,p=d|(1<<c)-1;d<=p;++d)a[Ab[d]>>>l]=u}else for(a=new mb(n),o=0;o<n;++o)e[o]&&(a[o]=Ab[s[e[o]-1]++]>>>15-e[o]);return a},Ib=new hb(288);for(Eb=0;Eb<144;++Eb)Ib[Eb]=8;for(Eb=144;Eb<256;++Eb)Ib[Eb]=9;for(Eb=256;Eb<280;++Eb)Ib[Eb]=7;for(Eb=280;Eb<288;++Eb)Ib[Eb]=8;var Ob=new hb(32);for(Eb=0;Eb<32;++Eb)Ob[Eb]=5;var Nb=Pb(Ib,9,1),Mb=Pb(Ob,5,1),Rb=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},Fb=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},Bb=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},Lb=function(e){return(e+7)/8|0},kb=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ub=function(e,t,r){var n=new Error(t||kb[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Ub),!r)throw n;return n},Vb=function(e,t,r){var n=e.length;if(!n||r&&r.f&&!r.l)return t||new hb(0);var o=!t||r,i=!r||r.i;r||(r={}),t||(t=new hb(3*n));var a=function(e){var r=t.length;if(e>r){var n=new hb(Math.max(2*r,e));n.set(t),t=n}},s=r.f||0,l=r.p||0,u=r.b||0,c=r.l,d=r.d,p=r.m,f=r.n,h=8*n;do{if(!c){s=Fb(e,l,1);var m=Fb(e,l+1,3);if(l+=3,!m){var g=e[(E=Lb(l)+4)-4]|e[E-3]<<8,y=E+g;if(y>n){i&&Ub(0);break}o&&a(u+g),t.set(e.subarray(E,y),u),r.b=u+=g,r.p=l=8*y,r.f=s;continue}if(1==m)c=Nb,d=Mb,p=9,f=5;else if(2==m){var v=Fb(e,l,31)+257,b=Fb(e,l+10,15)+4,x=v+Fb(e,l+5,31)+1;l+=14;for(var _=new hb(x),S=new hb(19),C=0;C<b;++C)S[bb[C]]=Fb(e,l+3*C,7);l+=3*b;var T=Rb(S),w=(1<<T)-1,A=Pb(S,T,1);for(C=0;C<x;){var E,D=A[Fb(e,l,w)];if(l+=15&D,(E=D>>>4)<16)_[C++]=E;else{var P=0,I=0;for(16==E?(I=3+Fb(e,l,3),l+=2,P=_[C-1]):17==E?(I=3+Fb(e,l,7),l+=3):18==E&&(I=11+Fb(e,l,127),l+=7);I--;)_[C++]=P}}var O=_.subarray(0,v),N=_.subarray(v);p=Rb(O),f=Rb(N),c=Pb(O,p,1),d=Pb(N,f,1)}else Ub(1);if(l>h){i&&Ub(0);break}}o&&a(u+131072);for(var M=(1<<p)-1,R=(1<<f)-1,F=l;;F=l){var B=(P=c[Bb(e,l)&M])>>>4;if((l+=15&P)>h){i&&Ub(0);break}if(P||Ub(2),B<256)t[u++]=B;else{if(256==B){F=l,c=null;break}var L=B-254;if(B>264){var k=yb[C=B-257];L=Fb(e,l,(1<<k)-1)+Sb[C],l+=k}var U=d[Bb(e,l)&R],V=U>>>4;if(U||Ub(3),l+=15&U,N=wb[V],V>3&&(k=vb[V],N+=Bb(e,l)&(1<<k)-1,l+=k),l>h){i&&Ub(0);break}o&&a(u+131072);for(var G=u+L;u<G;u+=4)t[u]=t[u-N],t[u+1]=t[u+1-N],t[u+2]=t[u+2-N],t[u+3]=t[u+3-N];u=G}}r.l=c,r.p=F,r.b=u,r.f=s,c&&(s=1,r.m=p,r.d=d,r.n=f)}while(!s);return u==t.length?t:function(e,t,r){(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);var n=new(2==e.BYTES_PER_ELEMENT?mb:4==e.BYTES_PER_ELEMENT?gb:hb)(r-t);return n.set(e.subarray(t,r)),n}(t,0,u)},Gb=new hb(0);function zb(e,t){return Vb(e.subarray(function(e){31==e[0]&&139==e[1]&&8==e[2]||Ub(6,"invalid gzip data");var t=e[3],r=10;4&t&&(r+=e[10]|2+(e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[r++]);return r+(2&t)}(e),-8),t||new hb((n=(r=e).length,(r[n-4]|r[n-3]<<8|r[n-2]<<16|r[n-1]<<24)>>>0)));var r,n}function jb(e,t){return Vb(((8!=(15&(r=e)[0])||r[0]>>>4>7||(r[0]<<8|r[1])%31)&&Ub(6,"invalid zlib data"),32&r[1]&&Ub(6,"invalid zlib data: preset dictionaries not supported"),e.subarray(2,-4)),t);var r}var Wb="undefined"!=typeof TextDecoder&&new TextDecoder;try{Wb.decode(Gb,{stream:!0})}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;const Hb=[];Hb["-".charCodeAt(0)]=62,Hb["_".charCodeAt(0)]=63;const Kb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let e=0;e<64;e++)Hb[Kb.charCodeAt(e)]=e;function Xb(e){return void 0!==Hb[e.charCodeAt(0)]}function $b(e,t,r,n){const{start:o,count:i}=t,a=i%4,s=Math.floor(i/4);let l=o,u=null,c=r;for(let t=0;t<s;t++){for(;!Xb(e[l]);)l++;for(u=Hb[e.charCodeAt(l++)]<<18;!Xb(e[l]);)l++;for(u|=Hb[e.charCodeAt(l++)]<<12;!Xb(e[l]);)l++;for(u|=Hb[e.charCodeAt(l++)]<<6;!Xb(e[l]);)l++;u|=Hb[e.charCodeAt(l++)],n[c++]=u>>16&255,n[c++]=u>>8&255,n[c++]=255&u}switch(a){case 3:for(;!Xb(e[l]);)l++;for(u=Hb[e.charCodeAt(l++)]<<10;!Xb(e[l]);)l++;for(u|=Hb[e.charCodeAt(l++)]<<4;!Xb(e[l]);)l++;u|=Hb[e.charCodeAt(l++)]>>2,n[c++]=u>>8&255,n[c++]=255&u;break;case 2:for(;!Xb(e[l]);)l++;for(u=Hb[e.charCodeAt(l++)]<<2;!Xb(e[l]);)l++;u|=Hb[e.charCodeAt(l++)]>>4,n[c++]=255&u;break;case 1:throw new Error("BASE64: remain 1 should not happen")}return c}var qb=function(e){const t=function(e){const t=e.length,r=[];let n=null;for(let o=0;o<t;o++)Xb(e[o])?(n||(n={start:o,count:0}),n.count++,n.end=o):"="===e[o]&&n&&(r.push(n),n=null);return n&&r.push(n),r}(e),r=t[t.length-1].end+1,n=(4-r%4)%4,o=new ArrayBuffer(3*(r+n)/4-n),i=new Uint8Array(o);let a=0;for(let r=0;r<t.length;r++)a+=$b(e,t[r],a,i),a+=(4-t[r].count%4)%4;return o};const Yb={name:"",numberOfComponents:1,size:0,dataType:"string"};function Jb(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object.assign(t,Yb,r),!t.empty&&!t.values&&!t.size)throw new TypeError("Cannot create vtkStringArray object without: size > 0, values");t.values?Array.isArray(t.values)&&(t.values=[...t.values]):t.values=[],t.values&&(t.size=t.values.length),zt.obj(e,t),zt.set(e,t,["name"]),function(e,t){t.classHierarchy.push("vtkStringArray"),e.getComponent=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.values[e*t.numberOfComponents+r]},e.setComponent=(r,n,o)=>{o!==t.values[r*t.numberOfComponents+n]&&(t.values[r*t.numberOfComponents+n]=o,e.modified())},e.getData=()=>t.values,e.getTuple=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=t.numberOfComponents||1;r.length&&(r.length=n);const o=e*n;for(let e=0;e<n;e++)r[e]=t.values[o+e];return r},e.getTupleLocation=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)*t.numberOfComponents},e.getNumberOfComponents=()=>t.numberOfComponents,e.getNumberOfValues=()=>t.values.length,e.getNumberOfTuples=()=>t.values.length/t.numberOfComponents,e.getDataType=()=>t.dataType,e.newClone=()=>Qb({name:t.name,numberOfComponents:t.numberOfComponents,empty:!0}),e.getName=()=>(t.name||e.setName(`vtkStringArray${e.getMTime()}`),t.name),e.setData=(r,n)=>{t.values=r,t.size=r.length,n&&(t.numberOfComponents=n),t.size%t.numberOfComponents!==0&&(t.numberOfComponents=1),e.modified()}}(e,t)}const Qb=zt.newInstance(Jb,"vtkStringArray");var Zb={newInstance:Qb,extend:Jb};function ex(e,t){return function(e,t){return[...e.getElementsByTagName(t)]}(e,t)[0]}const tx={Int8:Int8Array,UInt8:Uint8Array,Int16:Int16Array,UInt16:Uint16Array,Int32:Int32Array,UInt32:Uint32Array,Int64:Int32Array,UInt64:Uint32Array,Float32:Float32Array,Float64:Float64Array},rx={Int8:1,UInt8:1,Int16:2,UInt16:2,Int32:4,UInt32:4,Int64:8,UInt64:8,Float32:4,Float64:8};function nx(e){const t=e.length-1;return e.filter((e,r)=>r<t&&r%2==0)}function ox(e,t,r){if(!["UInt64","UInt32"].includes(r))throw new Error(`Cannot handle a header type of ${r}`);let n=tx[r],o=tx[t],i=!1;"UInt64"===r&&(n=tx.UInt32),/^U?Int64$/.test(t)&&(i=!0,o=tx[t.replace("64","32")]);const{byteOffset:a}=e,s=rx[t],l=rx[r];let u;u=a%l===0?new n(e.buffer,a,1):new n(e.buffer.slice(a,a+l));const c=Number(u[0]);let d,p=c/s;i&&(p*=2);const f=a+l;return d=f%s===0?new o(e.buffer,f,p):new o(e.buffer.slice(f,f+c)),i&&(d=nx(d)),d}function ix(e,t){const r=function(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?zb(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?function(e,t){return Vb(e,t)}(e,t):jb(e,t)}(e);t.uint8.set(r,t.offset),t.offset+=r.length}function ax(e,t){const r=function(e,t){if("UInt64"===t){const t=8;let r=new Uint32Array(e.buffer,0,6);const n=r[0],o=[t,n,r[2],r[4]];r=new Uint32Array(e.buffer,24,2*n);for(let e=0;e<n;e++)o.push(r[2*e]);return o}let r=new Uint32Array(e.buffer,0,3);const n=r[0],o=[4,n,r[1],r[2]];r=new Uint32Array(e.buffer,12,n);for(let e=0;e<n;e++)o.push(r[e]);return o}(e,t),n=r[1],o=r[2],i=r[3];let a=0;n>0&&(a=0===i?n*o:(n-1)*o+i);const s=new ArrayBuffer(a),l={offset:0,uint8:new Uint8Array(s)};let u=function(e){const[t]=e;return(e.length-1)*t}(r);for(;u<e.length&&120!==e[u];)u++;for(let t=0;t<n;t++){const n=r[4+t];ix(new Uint8Array(e.buffer,u,n),l),u+=n}return l.uint8}function sx(e,t,r,n,o,i){const a=t.getAttribute("type"),s=t.getAttribute("Name"),l=t.getAttribute("format"),u=Number(t.getAttribute("NumberOfComponents")||"1");let c=null;if("ascii"===l){c=new tx[a](e*u);let r=0;t.firstChild.nodeValue.split(/[\\t \\n]+/).forEach(e=>{e.trim().length&&(c[r++]=Number(e))})}else if("binary"===l){const e=new Uint8Array(qb(t.firstChild.nodeValue.trim()));if("vtkZLibDataCompressor"===r){const t=ax(e,o);c=new tx[a](t.buffer),/^U?Int64$/.test(a)&&(c=nx(c))}else c=new tx[a](e.buffer,rx[o]),-1!==a.indexOf("Int64")&&(c=nx(c))}else if("appended"===l){const e=Number(t.getAttribute("offset"));c=ox(new Uint8Array(i,e),a,o)}else console.error("Format not supported",l);return{name:s,values:c,numberOfComponents:u}}function lx(e){return(new TextDecoder).decode(e).split("\0").slice(0,-1)}function ux(e,t){t.classHierarchy.push("vtkXMLReader"),t.dataAccessHelper||(t.dataAccessHelper=Iv("http")),e.setUrl=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.url=r;const o=r.split("/");return o.pop(),t.baseURL=o.join("/"),e.loadData(n)},e.loadData=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.dataAccessHelper.fetchBinary(e,r)}(t.url,r).then(e.parseAsArrayBuffer)},e.parseAsArrayBuffer=r=>{if(!r)return!1;if(r===t.rawDataBuffer)return!0;e.modified();const{text:n,binaryBuffer:o}=(i=r,Av.extractBinary(i,/^\s*<AppendedData\s+encoding="raw">\s*_/m,/\n\s*<\/AppendedData>/m));var i,a;t.rawDataBuffer=r,t.binaryBuffer=o;const s=(a=n,(0,fb.create)(a)).root(),l=s.node,u=l.getAttribute("type"),c=l.getAttribute("compressor"),d=l.getAttribute("byte_order"),p=l.getAttribute("header_type")||"UInt32";if(c&&"vtkZLibDataCompressor"!==c)return console.error("Invalid compressor",c),!1;if(d&&"LittleEndian"!==d)return console.error("Only LittleEndian encoding is supported"),!1;if(u!==t.dataType)return console.error("Invalid data type",u,"expecting",t.dataType),!1;if(ex(l,"AppendedData")){const e=ex(l,"AppendedData"),r=e.getAttribute("encoding"),n=s.filter(e=>{const{node:t}=e;return t.nodeType===Node.ELEMENT_NODE&&"appended"===t.getAttribute("format")&&t.hasAttribute("offset")},!1,!0).map(e=>({node:e.node,offset:Number(e.node.getAttribute("offset"))}));n.sort((e,t)=>e.offset-t.offset);let o=t.binaryBuffer;"base64"===r&&(o=e.textContent.trim().substr(1));const i=[];for(let e=0;e<n.length;++e){const t=n[e].offset;let a=0;a=e===n.length-1?o.length||o.byteLength:n[e+1].offset,"base64"===r?i.push(new Uint8Array(qb(o.substring(t,a)))):i.push(new Uint8Array(o.slice(t,a)))}if("vtkZLibDataCompressor"===c)for(let e=0;e<i.length;++e){const t=ax(i[e],p),r=new Uint8Array(t.length+rx[p]);new tx[p](r.buffer,0,1)[0]=t.length,r.set(t,rx[p]),i[e]=r}const a=i.reduce((e,t)=>e+t.length,0),u=new ArrayBuffer(a),d=new Uint8Array(u);for(let e=0,t=0;e<i.length;++e)n[e].node.setAttribute("offset",t),d.set(i[e],t),t+=i[e].length;if(t.binaryBuffer=u,!t.binaryBuffer)return console.error("Processing appended data format: requires binaryBuffer to parse"),!1}e.parseXML(l,u,c,d,p);const f=l.getElementsByTagName(u)[0].getElementsByTagName("FieldData")[0];if(f){const e=function(e,t,r,n,o){const i=[...e.getElementsByTagName("DataArray")].map(e=>_s.newInstance(sx(Number(e.getAttribute("NumberOfTuples")),e,t,0,n,o))),a=[...e.getElementsByTagName("Array")].filter(e=>"String"===e.getAttribute("type")).map(e=>{const r=Zb.newInstance(function(e,t,r,n,o){const i=e.getAttribute("Name"),a=e.getAttribute("format"),s=Number(e.getAttribute("NumberOfComponents")||"1"),l=Number(e.getAttribute("NumberOfTuples")||"1")*s,u=[];if("ascii"===a){const t=e.firstChild.nodeValue.trim().split(/\s+/);let r=0;const n=[];for(;u.length<l;){const e=Number(t[r++]);0===e?(u.push(n.join("")),n.length=0):n.push(String.fromCharCode(e))}}else if("binary"===a){const r=new Uint8Array(qb(e.firstChild.nodeValue.trim()));if("vtkZLibDataCompressor"===t){const e=ax(r,n);u.push(...lx(e))}else{const e=ox(r,"UInt8",n);u.push(...lx(e))}}else if("appended"===a){const t=Number(e.getAttribute("offset")),r=ox(new Uint8Array(o,t),"UInt8",n);u.push(...lx(r))}else zt.vtkErrorMacro(`Format not supported: ${a}`);return{name:i,values:u,numberOfComponents:s}}(e,t,0,n,o));return r});return[...i,...a]}(f,c,0,p,t.binaryBuffer);for(let r=0;r<t.output.length;r++){const n=t.output[r].getFieldData();for(let t=0;t<e.length;t++)n.addArray(e[t])}}return!0},e.requestData=(r,n)=>{e.parseAsArrayBuffer(t.rawDataBuffer)}}const cx={};var dx={extend:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,cx,r),zt.obj(e,t),zt.get(e,t,["url","baseURL"]),zt.setGet(e,t,["dataAccessHelper"]),zt.algo(e,t,0,1),ux(e,t)},processDataArray:sx,processFieldData:function(e,t,r,n,o,i,a){if(t){const o={};["Scalars","Vectors","Normals","Tensors","TCoords"].forEach(e=>{const n=t.getAttribute(e);n&&(o[n]=r[`set${e}`])});const s=t.getElementsByTagName("DataArray"),l=s.length;for(let t=0;t<l;t++){const l=s[t],u=_s.newInstance(sx(e,l,n,0,i,a)),c=u.getName();(o[c]||r.addArray)(u)}}},processCells:function(e,t,r,n,o,i){const a={},s=t.getElementsByTagName("DataArray");for(let e=0;e<s.length;e++){const t=s[e];a[t.getAttribute("Name")]=t}const l=sx(e,a.offsets,r,0,o,i).values,u=l[l.length-1],c=sx(u,a.connectivity,r,0,o,i).values,d=new Uint32Array(e+u);let p=0,f=0;return l.forEach(e=>{const t=e-f;d[p++]=t;for(let e=0;e<t;e++)d[p++]=c[f+e];f=e}),d}};function px(e,t,r,n,o,i,a){const s=Number(r.getAttribute(`NumberOf${t}`));if(s>0){const l=r.getElementsByTagName(t)[0].getElementsByTagName("DataArray")[0],{values:u,numberOfComponents:c}=dx.processDataArray(s,l,n,o,i,a);e[`get${t}`]().setData(u,c)}return s}function fx(e,t,r,n,o,i,a){const s=Number(r.getAttribute(`NumberOf${t}`));if(s>0){const l=dx.processCells(s,r.getElementsByTagName(t)[0],n,o,i,a);e[`get${t}`]().setData(l)}return s}const hx={dataType:"PolyData"};function mx(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,hx,r),dx.extend(e,t,r),function(e,t){t.classHierarchy.push("vtkXMLPolyDataReader"),e.parseXML=(e,r,n,o,i)=>{const a=e.getElementsByTagName(t.dataType)[0].getElementsByTagName("Piece"),s=a.length;for(let e=0;e<s;e++){const r=mc.newInstance(),s=a[e],l=px(r,"Points",s,n,o,i,t.binaryBuffer);let u=0;["Verts","Lines","Strips","Polys"].forEach(e=>{u+=fx(r,e,s,n,o,i,t.binaryBuffer)}),dx.processFieldData(l,s.getElementsByTagName("PointData")[0],r.getPointData(),n,o,i,t.binaryBuffer),dx.processFieldData(u,s.getElementsByTagName("CellData")[0],r.getCellData(),n,o,i,t.binaryBuffer),t.output[e]=r}}}(e,t)}var gx={newInstance:zt.newInstance(mx,"vtkXMLPolyDataReader"),extend:mx};function yx(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,function(e){return{computeCellNormals:!1,computePointNormals:!0,...e}}(r)),zt.obj(e,t),zt.algo(e,t,1,1),zt.setGet(e,t,["computeCellNormals","computePointNormals"]),function(e,t){t.classHierarchy.push("vtkPolyDataNormals"),e.vtkPolyDataNormalsExecute=(e,r,n)=>{if(!n)return null;const o=new Float32Array(n.length),i=new Float32Array(3*e);let a=0,s=0;const l=r.length,u=[0,0,0],c=[0,0,0];for(let e=0;e<l;e+=s+1)if(s=r[e],!(s<3)){for(let t=1;t<=3;++t)u[t-1]=3*r[e+t];if(ec.computeNormal(n.slice(u[0],u[0]+3),n.slice(u[1],u[1]+3),n.slice(u[2],u[2]+3),c),i[a++]=c[0],i[a++]=c[1],i[a++]=c[2],t.computePointNormals)for(let t=1;t<=s;++t){let n=3*r[e+t];o[n]+=c[0],o[++n]+=c[1],o[++n]+=c[2]}}if(t.computePointNormals){const e=[0,0,0];for(let t=0;t<n.length;)e[0]=o[t],e[1]=o[t+1],e[2]=o[t+2],Oi.normalize(e),o[t++]=e[0],o[t++]=e[1],o[t++]=e[2]}return[i,o]},e.requestData=(r,n)=>{if(!e.getNumberOfInputPorts())return;const o=r[0];if(!o)return;const i=n[0]?.initialize()||mc.newInstance();i.setPoints(o.getPoints()),i.setVerts(o.getVerts()),i.setLines(o.getLines()),i.setPolys(o.getPolys()),i.setStrips(o.getStrips()),i.getPointData().passData(o.getPointData()),i.getCellData().passData(o.getCellData()),i.getFieldData().passData(o.getFieldData());const[a,s]=e.vtkPolyDataNormalsExecute(o.getNumberOfPolys(),o.getPolys().getData(),o.getPoints().getData());if(t.computePointNormals){const e=_s.newInstance({numberOfComponents:3,name:"Normals",values:s});i.getPointData().setNormals(e)}if(t.computeCellNormals){const e=_s.newInstance({numberOfComponents:3,name:"Normals",values:a});i.getCellData().setNormals(e)}n[0]=i}}(e,t)}var vx={newInstance:zt.newInstance(yx,"vtkPolyDataNormals"),extend:yx};const{vtkErrorMacro:bx}=zt;let xx=null;function _x(e,t){const r=function(e,t){const r=3*t.num_faces(),n=4*r,o=xx._malloc(n);e.GetTrianglesUInt32Array(t,n,o);const i=new Uint32Array(xx.HEAPF32.buffer,o,r).slice();return xx._free(o),i}(e,t),n=r.length-2,o=Xl.newInstance();o.allocate(4*r.length/3);for(let e=0;e<n;e+=3){const t=r.slice(e,e+3);o.insertNextCell(t)}const i=mc.newInstance({polys:o}),a={points:"POSITION",normals:"NORMAL",scalars:"COLOR",tcoords:"TEX_COORD"};if(Object.keys(a).forEach(r=>{const n=Float32Array,o=e.GetAttributeId(t,xx[a[r]]);if(-1===o)return;const s=e.GetAttribute(t,o),l=function(e,t,r,n,o){const i=o.num_components(),a=t.num_points()*i,s=a*n.BYTES_PER_ELEMENT,l=function(e){switch(e){case Float32Array:return xx.DT_FLOAT32;case Int8Array:return xx.DT_INT8;case Int16Array:return xx.DT_INT16;case Int32Array:return xx.DT_INT32;case Uint8Array:return xx.DT_UINT8;case Uint16Array:return xx.DT_UINT16;case Uint32Array:return xx.DT_UINT32;default:return xx.DT_FLOAT32}}(n),u=xx._malloc(s);e.GetAttributeDataArrayForAllPoints(t,o,l,s,u);const c=new n(xx.HEAPF32.buffer,u,a).slice();return xx._free(u),{name:r,array:c,itemSize:i}}(e,t,r,n,s),u=i.getPointData();switch(r){case"points":i.getPoints().setData(l.array,l.itemSize);break;case"normals":u.setNormals(_s.newInstance({numberOfComponents:l.itemSize,values:l.array,name:"Normals"}));break;case"scalars":u.setScalars(_s.newInstance({numberOfComponents:l.itemSize,values:l.array,name:"Scalars"}));break;case"tcoords":u.setTCoords(_s.newInstance({numberOfComponents:l.itemSize,values:l.array,name:"TCoords"}))}}),!i.getPointData().getNormals()){const e=vx.newInstance();return e.setInputData(i),e.setComputePointNormals(!0),e.getOutputData()}return i}const Sx={};function Cx(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Sx,r),zt.obj(e,t),zt.get(e,t,["url","baseURL"]),zt.setGet(e,t,["dataAccessHelper"]),zt.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkDracoReader"),t.dataAccessHelper||(t.dataAccessHelper=Iv("http")),e.setUrl=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{binary:!0};t.url=r;const o=r.split("/");return o.pop(),t.baseURL=o.join("/"),t.compression=n.compression,e.loadData({progressCallback:n.progressCallback,binary:!!n.binary})},e.loadData=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{compression:o,progressCallback:i}=t;return n.binary?t.dataAccessHelper.fetchBinary(r,{compression:o,progressCallback:i}):t.dataAccessHelper.fetchText(e,r,{compression:o,progressCallback:i})}(t.url,r);return n.then(e.parse),n},e.parse=t=>{e.parseAsArrayBuffer(t)},e.parseAsArrayBuffer=r=>{if(!r)return;if(r===t.parseData)return;e.modified(),t.parseData=r;const n=new Int8Array(r),o=new xx.Decoder,i=new xx.DecoderBuffer;let a;if(i.Init(n,n.length),o.GetEncodedGeometryType(i)!==xx.TRIANGULAR_MESH)return void bx("Wrong geometry type, expected mesh, got point cloud.");{a=new xx.Mesh;const e=o.DecodeBufferToMesh(i,a);if(!e.ok())return void bx(`Could not decode Draco file: ${e.error_msg()}`)}const s=_x(o,a);xx.destroy(a),xx.destroy(i),xx.destroy(o),t.output[0]=s},e.requestData=()=>{e.parse(t.parseData)}}(e,t),t.compression||(t.compression=null),t.progressCallback||(t.progressCallback=null)}var Tx={extend:Cx,newInstance:zt.newInstance(Cx,"vtkDracoReader"),setDracoDecoder:async function(e){xx=await e({})},setWasmBinary:function(e,t){const r={};return new Promise((n,o)=>{r.wasmBinaryFile=t;const i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{200===i.status?(r.wasmBinary=i.response,Promise.resolve(window.DracoDecoderModule(r)).then(e=>{xx=e,n(!0)},o)):o(Error(`WASM binary could not be loaded: ${i.statusText}`))},i.send(null)})},getDracoDecoder:function(){return xx}};const{vtkWarningMacro:wx}=zt;let Ax;const Ex={preMultiplyFlag:!1,matrix:[...io]};function Dx(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,Ex,r),zt.obj(e,t),zt.setGet(e,t,["preMultiplyFlag"]),zt.setGetArray(e,t,["matrix"],16),function(e,t){t.classHierarchy.push("vtkAbstractTransform","vtkHomogeneousTransform","vtkTransform"),e.transformPoint=(e,r)=>(Sr(r,e,t.matrix),r),e.transformPoints=(e,r)=>{const n=new Float64Array(3),o=new Float64Array(3);for(let i=0;i<e.length;i+=3)n[0]=e[i],n[1]=e[i+1],n[2]=e[i+2],Sr(o,n,t.matrix),r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2];return r},e.preMultiply=()=>{e.setPreMultiplyFlag(!0)},e.postMultiply=()=>{e.setPreMultiplyFlag(!1)},e.transformMatrix=(e,r)=>(t.preMultiplyFlag?b(r,t.matrix,e):b(r,e,t.matrix),r),e.transformMatrices=(e,r)=>{const n=new Float64Array(16),o=new Float64Array(16),i=t.preMultiplyFlag?()=>b(o,t.matrix,n):()=>b(o,n,t.matrix);for(let t=0;t<e.length;t+=16){for(let r=0;r<16;++r)n[r]=e[t+r];i();for(let e=0;e<16;++e)r[t+e]=o[e]}return r},e.getInverse=()=>Ax({matrix:Oi.invertMatrix(Array.from(t.matrix),[],4),preMultiplyFlag:t.preMultiplyFlag}),e.translate=(r,n,o)=>{if(0===r&&0===n&&0===o)return;const i=u();A(i,[r,n,o]),t.preMultiplyFlag?b(t.matrix,t.matrix,i):b(t.matrix,i,t.matrix),e.modified()},e.rotateWXYZ=(r,n,o,i)=>{if(0===n&&0===o&&0===i)return void wx("No rotation applied, axis is zero vector.");if(0===r)return;const a=Oi.radiansFromDegrees(r),s=Mi();Ri(s,[n,o,i],a);const l=new Float64Array(16);U(l,s),t.preMultiplyFlag?b(t.matrix,t.matrix,l):b(t.matrix,l,t.matrix),e.modified()},e.rotateX=t=>{e.rotateWXYZ(t,1,0,0)},e.rotateY=t=>{e.rotateWXYZ(t,0,1,0)},e.rotateZ=t=>{e.rotateWXYZ(t,0,0,1)},e.scale=(r,n,o)=>{if(1===r&&1===n&&1===o)return;const i=u();E(i,[r,n,o]),t.preMultiplyFlag?b(t.matrix,t.matrix,i):b(t.matrix,i,t.matrix),e.modified()},e.transformNormal=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const o=se(ae(),t.matrix),i=ae();he(i,o);const a=ae();return fe(a,i),e.transformVector(r,n,a),Oi.normalize(n),n},e.transformNormals=(r,n)=>{const o=r.getData(),i=n.getData(),a=[0,0,0],s=se(ae(),t.matrix),l=ae();he(l,s);const u=ae();fe(u,l);for(let t=0;t<o.length;t+=3)a[0]=o[t],a[1]=o[t+1],a[2]=o[t+2],e.transformVector(a,a,u),Oi.normalize(a),i[t]=a[0],i[t+1]=a[1],i[t+2]=a[2]},e.transformVector=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(e,t,r){var n=t[0],o=t[1],i=t[2];e[0]=n*r[0]+o*r[3]+i*r[6],e[1]=n*r[1]+o*r[4]+i*r[7],e[2]=n*r[2]+o*r[5]+i*r[8]}(r,e,(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||se(ae(),t.matrix)),r},e.transformVectors=(t,r)=>{const n=t.getData(),o=r.getData(),i=[0,0,0];for(let t=0;t<n.length;t+=3)i[0]=n[t],i[1]=n[t+1],i[2]=n[t+2],e.transformVector(i,i),Oi.normalize(i),o[t]=i[0],o[t+1]=i[1],o[t+2]=i[2]},e.transformPointsNormalsVectors=function(t,r,n,o,i,a){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;const u=t.getNumberOfPoints(),c=s?.length??0,d=new Float64Array(3),p=new Float64Array(3),f=new Float64Array(3),h=new Float64Array(3);let m=!1,g=!1,y=!1;const v=[];for(let b=0;b<u;b++){if(t.getPoint(b,d),p.set(d),e.transformPoint(d,d),r.setPoint(b,...d),Oi.areEquals(p,d)||(m=!0),i){const t=i.getData(),r=a.getData();d[0]=t[3*b],d[1]=t[3*b+1],d[2]=t[3*b+2],f.set(d),e.transformVector(d,d),r[3*b]=d[0],r[3*b+1]=d[1],r[3*b+2]=d[2],Oi.areEquals(f,d)||(g=!0)}if(n){const t=n.getData(),r=o.getData();d[0]=t[3*b],d[1]=t[3*b+1],d[2]=t[3*b+2],h.set(d),e.transformNormal(d,d),r[3*b]=d[0],r[3*b+1]=d[1],r[3*b+2]=d[2],Oi.areEquals(h,d)||(y=!0)}if(s)for(let t=0;t<c;t++){const r=s[t].getData(),n=l[t].getData();d[0]=r[3*b],d[1]=r[3*b+1],d[2]=r[3*b+2],f.set(d),e.transformVector(d,d),n[3*b]=d[0],n[3*b+1]=d[1],n[3*b+2]=d[2],Oi.arrayEqual(f,d)||v.includes(t)||v.push(t)}}m&&r.modified(),g&&a.modified(),y&&o.modified(),v.forEach(e=>l[e].modified())}}(e,t)}Ax=zt.newInstance(Dx,"vtkTransform");var Px={newInstance:Ax,extend:Dx};const Ix="glTF",Ox={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nx={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Mx={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Rx=9987,Fx=10497,Bx={magFilter:9728,minFilter:Rx,wrapS:Fx,wrapT:Fx},Lx={NORMAL:"normal",POSITION:"position",TEXCOORD_0:"texcoord0",TEXCOORD_1:"texcoord1",WEIGHTS_0:"weight",JOINTS_0:"joint",COLOR_0:"color",TANGENT:"tangent"},kx="OPAQUE",{vtkWarningMacro:Ux,vtkErrorMacro:Vx}=zt;function Gx(e){return{magFilter:10240,minFilter:10241,wrapS:10242,wrapT:10243}[e]}function zx(e,t){if("string"!=typeof e||""===e)return"";try{if(e.startsWith("data:"))return e;if(e.startsWith("blob:"))return e;const r=new URL(t);return r.pathname.includes(".")||r.pathname.endsWith("/")||(r.pathname+="/"),e.startsWith("http:")||e.startsWith("https:")||e.startsWith("//")||e.startsWith("/"),new URL(e,r).href}catch(e){return Vx("Error resolving URL:",e),""}}async function jx(e){if(e.bufferView){const t=new Blob([e.bufferView.data],{type:e.mimeType});return await createImageBitmap(t,{colorSpaceConversion:"none",imageOrientation:"flipY"})}return e.uri?(Ux("Falling back to image uri",e.uri),new Promise((t,r)=>{const n=new Image;n.crossOrigin="Anonymous",n.onload=()=>{t(n)},n.onerror=r,n.src=e.uri})):null}function Wx(e,t,r){const n=vc.newInstance();if(t)if("wrapS"in t&&"wrapT"in t||"minFilter"in t&&"magFilter"in t){33071===t.wrapS||33071===t.wrapT?(n.setRepeat(!1),n.setEdgeClamp(!0)):t.wrapS===Fx||t.wrapT===Fx?(n.setRepeat(!0),n.setEdgeClamp(!1)):Ux("Mirrored texture wrapping is not supported!");const e=[9729,9985,9986,Rx];(e.includes(t.minFilter)||e.includes(t.magFilter))&&n.setInterpolate(!0)}else n.setMipLevel(8),n.setInterpolate(!0),n.setEdgeClamp(!0);return n.setImageBitmap(e),n}const{vtkDebugMacro:Hx,vtkWarningMacro:Kx}=zt;class Xx{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:r,baseUri:n=""}=e;this.glTF=e,this.options=t,this.baseUri=n,this.json=r,this.extensions=r.extensions||{},this.extensionsUsed=r.extensionsUsed||[]}async parse(){const e=this.json.buffers||[];this.buffers=new Array(e.length).fill(null);const t=this.json.images||[];return this.images=new Array(t.length).fill({}),await this.loadBuffers(),await this.loadImages(),this.resolveTree(),this.glTF.json}resolveTree(){this.json.scenes=this.json.scenes?.map((e,t)=>this.resolveScene(e,t)),this.json.cameras=this.json.cameras?.map((e,t)=>this.resolveCamera(e,t)),this.json.bufferViews=this.json.bufferViews?.map((e,t)=>this.resolveBufferView(e,t)),this.json.images=this.json.images?.map((e,t)=>this.resolveImage(e,t)),this.json.samplers=this.json.samplers?.map((e,t)=>this.resolveSampler(e,t)),this.json.textures=this.json.textures?.map((e,t)=>this.resolveTexture(e,t)),this.json.accessors=this.json.accessors?.map((e,t)=>this.resolveAccessor(e,t)),this.json.materials=this.json.materials?.map((e,t)=>this.resolveMaterial(e,t)),this.json.meshes=this.json.meshes?.map((e,t)=>this.resolveMesh(e,t)),this.json.nodes=this.json.nodes?.map((e,t)=>this.resolveNode(e,t)),this.json.skins=this.json.skins?.map((e,t)=>this.resolveSkin(e,t)),this.json.animations=this.json.animations?.map((e,t)=>this.resolveAnimation(e,t))}get(e,t){if("object"==typeof t)return t;const r=this.json[e]&&this.json[e][t];return r||Kx(`glTF file error: Could not find ${e}[${t}]`),r}resolveScene(e,t){return e.id=e.id||`scene-${t}`,e.nodes=(e.nodes||[]).map(e=>this.get("nodes",e)),e}resolveNode(e,t){return e.id=e.id||`node-${t}`,e.children&&(e.children=e.children.map(e=>this.get("nodes",e))),void 0!==e.mesh?e.mesh=this.get("meshes",e.mesh):void 0!==e.meshes&&e.meshes.length&&(e.mesh=e.meshes.reduce((e,t)=>{const r=this.get("meshes",t);return e.id=r.id,e.primitives=e.primitives.concat(r.primitives),e},{primitives:[]})),void 0!==e.camera&&(e.camera=this.get("cameras",e.camera)),void 0!==e.skin&&(e.skin=this.get("skins",e.skin)),e.extensions?.KHR_lights_punctual&&(e.extensions.KHR_lights_punctual.light=this.extensions?.KHR_lights_punctual.lights[e.extensions.KHR_lights_punctual.light]),e}resolveSkin(e,t){return e.id=e.id||`skin-${t}`,e.inverseBindMatrices=this.get("accessors",e.inverseBindMatrices),e}resolveMesh(e,t){return e.id=e.id||`mesh-${t}`,e.primitives&&(e.primitives=e.primitives.map((e,t)=>{const r=e.attributes;e.name=`primitive-${t}`,e.attributes={};for(const t in r){const n=Lx[t];e.attributes[n]=this.get("accessors",r[t])}if(void 0!==e.indices&&(e.indices=this.get("accessors",e.indices)),void 0!==e.material&&(e.material=this.get("materials",e.material)),void 0===e.mode&&(e.mode=4),e.extensions?.KHR_draco_mesh_compression){Hx("Using Draco mesh compression");const t=this.get("bufferViews",e.extensions.KHR_draco_mesh_compression.bufferView);e.extensions.KHR_draco_mesh_compression.bufferView=t.data}return e})),e}resolveMaterial(e,t){if(e.id=e.id||`material-${t}`,void 0===e.alphaMode&&(e.alphaMode=kx),void 0===e.doubleSided&&(e.doubleSided=!1),void 0===e.alphaCutoff&&(e.alphaCutoff=.5),e.normalTexture&&(e.normalTexture={...e.normalTexture},e.normalTexture.texture=this.get("textures",e.normalTexture.index)),e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture},e.occlusionTexture.texture=this.get("textures",e.occlusionTexture.index)),e.emissiveTexture&&(e.emissiveTexture={...e.emissiveTexture},e.emissiveTexture.texture=this.get("textures",e.emissiveTexture.index)),e.emissiveFactor?e.emissiveFactor=e.emissiveFactor[0]:e.emissiveFactor=e.emissiveTexture?1:0,e.pbrMetallicRoughness){e.pbrMetallicRoughness={...e.pbrMetallicRoughness};const t=e.pbrMetallicRoughness;t.baseColorTexture&&(t.baseColorTexture={...t.baseColorTexture},t.baseColorTexture.texture=this.get("textures",t.baseColorTexture.index)),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture={...t.metallicRoughnessTexture},t.metallicRoughnessTexture.texture=this.get("textures",t.metallicRoughnessTexture.index))}else e.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};return e}getValueFromInterleavedBuffer(e,t,r,n,o){const i=new Uint8Array(o*n);for(let a=0;a<o;a++){const o=t+a*r;i.set(new Uint8Array(e.arrayBuffer.slice(o,o+n)),a*n)}return i.buffer}resolveAccessor(e,t){if(e.id=e.id||`accessor-${t}`,void 0!==e.bufferView&&(e.bufferView=this.get("bufferViews",e.bufferView)),e.bytesPerComponent=Nx[e.componentType],e.components=Ox[e.type],e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){const t=e.bufferView.buffer,{ArrayType:r}=function(e){const t=Mx[e.componentType],r=Ox[e.type],n=Nx[e.componentType];return{ArrayType:t,length:e.count*r,byteLength:e.count*r*n}}(e,e.bufferView),n=(e.bufferView.byteOffset||0)+t.byteOffset+(e.byteOffset||0);let o;o=e.bufferView.byteStride?e.bufferView.byteStride===e.bytesPerElement?new r(t.arrayBuffer,n,e.count*e.components):new r(this.getValueFromInterleavedBuffer(t,n,e.bufferView.byteStride,e.bytesPerElement,e.count)):new r(t.arrayBuffer,n,e.count*e.components),e.value=o}return e}resolveTexture(e,t){return e.id=e.id||`texture-${t}`,e.sampler="sampler"in e?this.get("samplers",e.sampler):Bx,e.source=this.get("images",e.source),void 0!==e.extensions&&Object.keys(e.extensions).forEach(t=>{const r=e.extensions[t];switch(t){case"KHR_texture_basisu":case"EXT_texture_webp":case"EXT_texture_avif":e.source=this.get("images",r.source);break;default:Kx(`Unhandled extension: ${t}`)}}),e}resolveSampler(e,t){e.id=e.id||`sampler-${t}`,Object.hasOwn(e,"wrapS")||(e.wrapS=Fx),Object.hasOwn(e,"wrapT")||(e.wrapT=Fx),Object.hasOwn(e,"minFilter")||(e.minFilter=Rx),Object.hasOwn(e,"magFilter")||(e.magFilter=9728),e.parameters={};for(const t in e){const r=Gx(t);void 0!==r&&(e.parameters[r]=e[t])}return e}resolveImage(e,t){return e.id=e.id||`image-${t}`,void 0!==e.bufferView&&(e.bufferView=this.get("bufferViews",e.bufferView)),e}resolveBufferView(e,t){e.id=e.id||`bufferView-${t}`;const r=e.buffer;e.buffer=this.buffers[r];const n=this.buffers[r].arrayBuffer;let o=this.buffers[r].byteOffset||0;return"byteOffset"in e&&(o+=e.byteOffset),e.data=new Uint8Array(n,o,e.byteLength),e}resolveCamera(e,t){return e.id=e.id||`camera-${t}`,e}resolveAnimation(e,t){return e.id=e.id||`animation-${t}`,e.samplers.map(e=>(e.input=this.get("accessors",e.input).value,e.output=this.get("accessors",e.output).value,e)),e}loadBuffers(){const e=this.json.buffers.map((e,t)=>this.loadBuffer(e,t).then(()=>{delete e.uri}));return Promise.all(e)}async loadBuffer(e,t){let r=e;if(e.uri){Hx("Loading uri",e.uri);const t=zx(e.uri,this.options.baseUri),n=await fetch(t);r=await n.arrayBuffer()}else this.glTF.glbBuffers&&(r=this.glTF.glbBuffers[t]);this.buffers[t]={arrayBuffer:r,byteOffset:0,byteLength:r.byteLength}}loadImages(){const e=this.json.images||[],t=[];return new Promise((r,n)=>{for(let r=0;r<e.length;++r)t.push(Promise.resolve(this.loadImage(e[r],r).then(()=>{Hx("Texture loaded ",e[r])})));Promise.all(t).then(()=>r(this.images))})}async loadImage(e,t){let r,n;if(e.uri){Hx("Loading texture",e.uri);const t=zx(e.uri,this.options.baseUri),n=await fetch(t);r=await n.arrayBuffer(),e.uri=t,e.bufferView={data:r}}else if(e.bufferView){const t=this.get("bufferViews",e.bufferView);n=this.get("buffers",t.buffer),this.glTF.glbBuffers&&(n=this.glTF.glbBuffers[t.buffer],r=n.slice(t.byteOffset,t.byteOffset+t.byteLength)),e.bufferView={data:r}}}}const{vtkWarningMacro:$x}=zt,{vtkWarningMacro:qx,vtkDebugMacro:Yx}=zt;async function Jx(e,t,r){let n=1,o=1;const i=t.emissiveFactor,a=r.getProperty(),s=t.pbrMetallicRoughness;if(null!=s){!s?.metallicFactor||s?.metallicFactor<=0||s?.metallicFactor>=1?Yx("Invalid material.pbrMetallicRoughness.metallicFactor value. Using default value instead."):n=s.metallicFactor,!s?.roughnessFactor||s?.roughnessFactor<=0||s?.roughnessFactor>=1?Yx("Invalid material.pbrMetallicRoughness.roughnessFactor value. Using default value instead."):o=s.roughnessFactor;const e=s.baseColorFactor;if(null!=e&&(a.setDiffuseColor(e[0],e[1],e[2]),a.setOpacity(e[3])),a.setMetallic(n),a.setRoughness(o),a.setEmission(i),s.baseColorTexture){s.baseColorTexture.extensions;const e=s.baseColorTexture.texture;null!=e.extensions&&Object.keys(e.extensions).forEach(e=>{qx(`Unhandled extension: ${e}`)});const t=e.sampler,r=Wx(await jx(e.source),t);a.setDiffuseTexture(r)}if(s.metallicRoughnessTexture){s.metallicRoughnessTexture.extensions;const e=s.metallicRoughnessTexture.texture,t=e.sampler,r=Wx(await jx(e.source),t);a.setRMTexture(r)}if(t.occlusionTexture){t.occlusionTexture.extensions;const e=t.occlusionTexture.texture,r=e.sampler,n=Wx(await jx(e.source),r);a.setAmbientOcclusionTexture(n)}if(t.emissiveTexture){t.emissiveTexture.extensions;const e=t.emissiveTexture.texture,n=e.sampler,o=Wx(await jx(e.source),n);a.setEmissionTexture(o),null!=t.emissiveTexture.texCoord&&r.getMapper().getInputData().getPointData().setActiveTCoords(`TEXCOORD_${t.emissiveTexture.texCoord}`)}if(t.normalTexture){t.normalTexture.extensions;const e=t.normalTexture.texture,r=e.sampler,n=Wx(await jx(e.source),r);a.setNormalTexture(n),null!=t.normalTexture.scale&&a.setNormalStrength(t.normalTexture.scale)}}null!=t.extensions&&Object.keys(t.extensions).forEach(e=>{const r=t.extensions[e];switch(e){case"KHR_materials_unlit":!function(e,t){t.setLighting(!0)}(0,a);break;case"KHR_materials_ior":!function(e,t){t.setBaseIOR(e.ior)}(r,a);break;case"KHR_materials_specular":!function(e,t){t.setSpecular(e.specularFactor),t.setSpecularColor(e.specularColorFactor)}(r,a);break;default:qx(`Unhandled extension: ${e}`)}}),t.alphaMode!==kx&&r.setForceTranslucent(!0),a.setBackfaceCulling(!t.doubleSided)}async function Qx(e,t,r){const n=ss.newInstance(),o=Gl.newInstance();o.setColorModeToDirectScalars(),o.setInterpolateScalarsBeforeMapping(!0),n.setMapper(o),n.setUserMatrix(r);const i=await async function(e){if(!e||!e.attributes)return qx("Primitive has no position data, skipping"),null;if(e.extensions?.KHR_draco_mesh_compression)return function(e){const t=Tx.newInstance();return t.parse(e.bufferView),t.getOutputData()}(e.extensions.KHR_draco_mesh_compression);const t=mc.newInstance(),r=Xl.newInstance(),n=t.getPointData();if(Object.entries(e.attributes).forEach(async r=>{let[o,i]=r;switch(o){case Lx.POSITION:{const r=e.attributes.position.value;t.getPoints().setData(r,e.attributes.position.component);break}case Lx.NORMAL:{const t=e.attributes.normal.value;n.setNormals(_s.newInstance({name:"Normals",values:t,numberOfComponents:e.attributes.normal.components}));break}case Lx.COLOR_0:{const t=e.attributes.color.value;n.setScalars(_s.newInstance({name:"Scalars",values:t,numberOfComponents:e.attributes.color.components}));break}case Lx.TEXCOORD_0:{const t=e.attributes.texcoord0.value,r=_s.newInstance({name:"TEXCOORD_0",values:t,numberOfComponents:e.attributes.texcoord0.components});n.addArray(r),n.setActiveTCoords(r.getName());break}case Lx.TEXCOORD_1:{const t=e.attributes.texcoord1.value,r=_s.newInstance({name:"TEXCOORD_1",values:t,numberOfComponents:e.attributes.texcoord1.components});n.addArray(r);break}case Lx.TANGENT:{const t=e.attributes.tangent.value,r=_s.newInstance({name:"Tangents",values:t,numberOfComponents:e.attributes.tangent.components});n.addArray(r);break}default:qx(`Unhandled attribute: ${o}`)}}),null!=e.indices){const t=e.indices.value,n=t.length-2;switch(e.mode){case 3:case 5:case 2:qx("GL_LINE_LOOP not implemented");break;default:r.allocate(4*t.length/3);for(let e=0;e<n;e+=3){const n=t.slice(e,e+3);r.insertNextCell(n)}}}switch(e.mode){case 4:case 6:t.setPolys(r);break;case 1:case 3:case 2:t.setLines(r);break;case 0:t.setVerts(r);break;case 5:t.setStrips(r);break;default:r.delete(),qx("Invalid primitive draw mode. Ignoring connectivity.")}return t}(t);return o.setInputData(i),null!=t.material&&await Jx(0,t.material,n),null!=t.extensions&&function(e,t,r){Object.keys(t).forEach(n=>{const o=t[n];switch(n){case"KHR_materials_variants":r.variantMappings.set(e,o.mappings);break;case"KHR_draco_mesh_compression":break;default:qx(`Unhandled extension: ${n}`)}})}(`${t.name}`,t.extensions,e),n}function Zx(e){return Yx("Creating animation:",e),{name:e.name,channels:e.channels,samplers:e.samplers,getChannelByTargetNode(e){return this.channels.filter(t=>t.target.node===e)}}}async function e_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u();e.transform=function(e){const t=e.translation??dr(),r=e.rotation??Mi(),n=e.scale??fr(1,1,1);return null!=e.matrix?c(e.matrix):L(u(),r,t,n)}(e);const o=b(u(),n,e.transform);if(null!=e.mesh){const n=await async function(e){const t=ss.newInstance(),r=Gl.newInstance();r.setColorModeToDirectScalars(),r.setInterpolateScalarsBeforeMapping(!0),t.setMapper(r),t.setUserMatrix(e);const n=mc.newInstance();return r.setInputData(n),t}(o);r&&n.setParentProp(r),t.actors.set(`${e.id}`,n),await Promise.all(e.mesh.primitives.map(async(r,i)=>{const a=await Qx(t,r,o);a.setParentProp(n),t.actors.set(`${e.id}_${r.name}`,a)}))}e.extensions?.KHR_lights_punctual&&function(e,t,r){const{light:n}=e,{color:o,intensity:i,range:a,spot:s,type:l}=n,u=Vh.newInstance({color:o||[1,1,1],intensity:i||1});switch(u.setTransformMatrix(t),a>0&&u.setAttenuationValues(1,0,1/(a*a*.01)),l){case"directional":u.setPositional(!1);break;case"point":u.setPositional(!0),u.setConeAngle(90);break;case"spot":u.setPositional(!0),u.setConeAngle(yo(s.outerConeAngle));break;default:$x(`Unsupported light type: ${l}`)}r.lights.set(n.name,u)}(e.extensions.KHR_lights_punctual,e.transform,t),e.children&&Array.isArray(e.children)&&e.children.length>0&&await Promise.all(e.children.map(async r=>{const n=t.actors.get(e.id);await e_(r,t,n,o)}))}function t_(e,t){const r=new Uint32Array(t,e,2);return{start:e+8,length:r[0],type:r[1]}}function r_(e,t){const r=new Uint8Array(t,20,e.length),n=new TextDecoder("utf-8").decode(r);return JSON.parse(n)}function n_(e,t){return t.slice(e.start,e.start+e.length)}const{vtkDebugMacro:o_,vtkWarningMacro:i_}=zt;function a_(e,t){const r=e.target.path,n=e.target.node;return{...e,animate:function(o){!function(e){let t,o,i;switch(r){case"translation":n.setPosition(e[0],e[1],e[2]);break;case"rotation":i=function(e,t){var r=t[0],n=t[1],o=t[2],i=t[3],a=r*r+n*n+o*o+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=r*a,e[1]=n*a,e[2]=o*a,e[3]=i*a,e}(Mi(),e),t=new Float64Array(3),o=Fi(t,i),n.rotateWXYZ(vo(o),t[0],t[1],t[2]);break;case"scale":n.setScale(e[0],e[1],e[2]);break;default:i_(`Unsupported animation path: ${r}`)}}(t[e.sampler].evaluate(o,r))}}}function s_(e,t){const r=new Map,n=new Map;return{addAnimation:function(t){const n=function(e,t){return e.samplers=e.samplers.map(e=>function(e){let t=0;return{...e,evaluate:function(r,n){const[o,i,a,s]=function(r){let n=t;for(;n<e.input.length-1&&e.input[n]<=r;)n++;const o=Math.max(0,n-1);return t=o,[e.input[o],e.input[n],o,n]}(r);let l;switch(e.interpolation){case"STEP":l=function(t,r){const n=3*r,o=new Array(3);for(let t=0;t<3;++t)o[t]=e.output[n+t];return o}(0,a);break;case"LINEAR":l=function(t,r,n,o,i,a){const s=(a-r)/(n-r),l=4*o,u=4*i,c=new Array(4),d=new Array(4);for(let t=0;t<4;++t)c[t]=e.output[l+t],d[t]=e.output[u+t];switch(t){case"translation":case"scale":return function(e,t,r,n){var o=t[0],i=t[1],a=t[2];return e[0]=o+n*(r[0]-o),e[1]=i+n*(r[1]-i),e[2]=a+n*(r[2]-a),e}(dr(),c,d,s);case"rotation":return Li(Mi(),c,d,s);default:return i_(`Unsupported animation path: ${t}`),null}}(n,o,i,a,s,r);break;case"CUBICSPLINE":l=function(t,r,n,o,i,a){const s=n-r,l=(a-r)/s,u=l*l,c=u*l,d=e.output[3*o+1],p=s*e.output[3*o+2],f=e.output[3*i+1],h=s*e.output[3*i];return Array.isArray(d)?d.map((e,t)=>{const r=c-u;return(2*c-3*u+1)*e+(c-2*u+l)*p[t]+(-2*c+3*u)*f[t]+r*h[t]}):(2*c-3*u+1)*d+(c-2*u+l)*p+(-2*c+3*u)*f+(c-u)*h}(0,o,i,a,s,r);break;default:i_(`Unknown interpolation method: ${e.interpolation}`)}return l}}}(e)),e.channels=e.channels.map(r=>(r.target.node=t.get(`node-${r.target.node}`),a_(r,e.samplers))),{...e,update:function(t){e.channels.forEach(e=>e.animate(t))}}}(t,e);r.set(t.id,n),o_(`Animation "${t.id}" added to mixer`)},play:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r.has(e)?(n.set(e,{animation:r.get(e),weight:t,time:0}),o_(`Playing animation "${e}" with weight ${t}`)):i_(`Animation "${e}" not found in mixer`)},stop:function(e){n.delete(e)?i_(`Stopped animation "${e}"`):i_(`Animation "${e}" was not playing`)},stopAll:function(){n.clear(),i_("Stopped all animations")},update:function(e){const t=Array.from(n.values()).reduce((e,t)=>{let{weight:r}=t;return e+r},0);n.forEach((r,o)=>{let{animation:i,weight:a,time:s}=r;const l=t>0?a/t:0,u=s+e;n.set(o,{animation:i,weight:a,time:u}),o_(`Updating animation "${o}" at time ${u.toFixed(3)} with normalized weight ${l.toFixed(3)}`),i.update(u,l)})}}}const{vtkDebugMacro:l_,vtkErrorMacro:u_}=zt;function c_(e,t){t.classHierarchy.push("vtkGLTFImporter"),t.dataAccessHelper||(t.dataAccessHelper=Iv("http")),e.setUrl=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{binary:!0};t.url=r;const o=r.split("/");return o.pop(),t.baseURL=o.join("/"),t.compression=n.compression,t.sceneId=n.sceneId?n.sceneId:0,e.loadData({progressCallback:n.progressCallback,binary:!!n.binary})},e.loadData=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{compression:o,progressCallback:i}=t;return n.binary?t.dataAccessHelper.fetchBinary(r,{compression:o,progressCallback:i}):t.dataAccessHelper.fetchText(e,r,{compression:o,progressCallback:i})}(t.url,r);return n.then(e.parse),n},e.parse=t=>{"string"==typeof t?e.parseAsText(t):e.parseAsBinary(t)},e.parseAsBinary=async r=>{if(!r)return;if(r===t.parseData)return;e.modified();const n={},o={baseUri:t.baseURL};if(Av.arrayBufferToString(new Uint8Array(r,0,4))===Ix){const{json:e,buffers:t}=function(e){if(e.byteLength<12)throw new Error("Invalid GLB: File too small");const t=new DataView(e,0,12),r=new Uint8Array(e,0,4),n=Av.arrayBufferToString(r),o=t.getUint32(4,!0),i=t.getUint32(8,!0);if(n!==Ix)throw new Error("Unsupported glTF-Binary header.");if(o<2)throw new Error("Unsupported legacy binary file detected.");if(i>e.byteLength)throw new Error("Invalid GLB: Declared length exceeds file size");const a=function(e){const t=Math.floor((e.byteLength-12)/8),r=new Array(t);let n=12,o=0;for(;n<e.byteLength;){const t=t_(n,e);r[o++]=t,n+=t.length+8}return r.slice(0,o)}(e);let s=null;const l=[];for(let t=0;t<a.length;t++){const r=a[t];1313821514!==r.type||s?5130562===r.type&&l.push(n_(r,e)):s=r_(r,e)}if(!s)throw new Error("glTF-Binary: JSON content not found.");return{json:s,buffers:l}}(r);l_("Loaded GLB",e,t),n.glbBuffers=t,n.json=e}else n.json=JSON.parse(Av.arrayBufferToString(r));void 0===n.json.asset||n.json.asset.version[0]<2?u_("Unsupported asset. glTF versions >=2.0 are supported."):(t.glTFTree=await async function(e,t){const r=new Xx(e,t);return await r.parse()}(n,o),t.actors=new Map,t.cameras=new Map,t.lights=new Map,t.animations=[],t.variants=[],t.variantMappings=new Map,await async function(e){e.animations=e.glTFTree.animations?.map(Zx),Object.keys(e.glTFTree?.extensions||[]).forEach(t=>{const r=e.glTFTree.extensions[t];switch(t){case"KHR_materials_variants":!function(e,t){t.variants=e.variants.map(e=>e.name)}(r,e);break;case"KHR_draco_mesh_compression":break;default:qx(`Unhandled extension: ${t}`)}});const t=e.sceneId??e.glTFTree.scene;e.glTFTree.scenes?.length&&e.glTFTree.scenes[t]?.nodes?await Promise.all(e.glTFTree.scenes[t].nodes.map(async t=>{t?await e_(t,e):qx("Node not found in glTF.nodes")})):qx("No valid scenes found in the glTF data")}(t),t.scenes=t.glTFTree.scenes,e.invokeReady())},e.parseAsText=r=>{r&&r!==t.parseData&&(e.modified(),t.parseData=r)},e.requestData=(r,n)=>{e.parse(t.parseData)},e.setDracoDecoder=async e=>{await Tx.setDracoDecoder(e)},e.importActors=()=>{t.actors.forEach(e=>t.renderer.addActor(e))},e.importCameras=()=>{t.glTFTree.cameras?.forEach(e=>{const r=function(e){const t=Lh.newInstance();if("perspective"===e.type){const{yfov:r,znear:n,zfar:o}=e.perspective;t.setClippingRange(n,o),t.setParallelProjection(!1),t.setViewAngle(vo(r))}else{if("orthographic"!==e.type)throw new Error("Unsupported camera type");{const{ymag:r,znear:n,zfar:o}=e.orthographic;t.setClippingRange(n,o),t.setParallelProjection(!0),t.setParallelScale(r)}}return t}(e);t.cameras.set(e.id,r)}),t.scenes.forEach(e=>{e.nodes.forEach(e=>{const r=t.cameras.get(e.camera?.id);r&&function(e,t){if(!e||!t)return;const r=[0,0,0],n=[0,1,0],o=[0,0,-1],i=Px.newInstance();i.setMatrix(t),i.transformPoint(r,r),i.transformPoints(n,n),i.transformPoints(o,o),o[0]+=r[0],o[1]+=r[1],o[2]+=r[2],e.setPosition(r),e.setFocalPoint(o),e.setViewUp(n)}(r,e.transform)})})},e.importAnimations=()=>{t.glTFTree.animations?.length>0&&(t.animationMixer=s_(t.actors,t.glTFTree.accessors),t.glTFTree.animations.forEach(e=>{t.animationMixer.addAnimation(e)})),t.animations=t.glTFTree.animations||[]},e.importLights=()=>{t.lights?.forEach(e=>{l_("Adding light",e),t.renderer.addLight(e)})},e.setCamera=e=>{const r=t.cameras.get(e);r?(l_("Setting camera",r),t.renderer.setActiveCamera(r)):u_(`Camera ${e} not found`)},e.switchToVariant=async e=>{const r=Array.from(t.actors).map(async r=>{let[n,o]=r;l_("Switching to variant",e,"for node",n);const i=t.variantMappings.get(n);if(i){const r=i.find(t=>t.variants.includes(e));if(r){const e=t.glTFTree.materials[r.material];await Jx(0,e,o)}}});await Promise.all(r)}}const d_={};function p_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,d_,r),zt.obj(e,t),zt.get(e,t,["url","baseURL","actors","scenes","cameras","animations","animationMixer","variants","variantMappings"]),zt.set(e,t,["renderer","dracoDecoder"]),zt.event(e,t,"ready"),c_(e,t),t.compression||(t.compression=null),t.progressCallback||(t.progressCallback=null)}var f_={extend:p_,newInstance:zt.newInstance(p_,"vtkGLTFImporter")};const{vtkErrorMacro:h_}=jt;function m_(e,t){t.classHierarchy.push("vtkCutter");const r={...e};e.getMTime=()=>{let e=r.getMTime();return t.cutFunction?(e=Math.max(e,t.cutFunction.getMTime()),e):e},e.requestData=(e,r)=>{const n=e[0];if(!n)return void h_("Invalid or missing input");if(!t.cutFunction)return void h_("Missing cut function");const o=r[0]?.initialize()||mc.newInstance();(function(e,r){const n=e.getPoints(),o=n.getData(),i=e.getPointData(),a=n.getNumberOfPoints(),s=[],l=[],u=[],c={},d=i.getNumberOfArrays();for(let e=0;e<d;e++)c[i.getArrayName(e)]=[];(!t.cutScalars||t.cutScalars.length<a)&&(t.cutScalars=new Float32Array(a));let p=0,f=0;for(;p<o.length;)t.cutScalars[f++]=t.cutFunction.evaluateFunction(o[p++],o[p++],o[p++]);const h=[],m=new Array(3),g=new Array(3),y=[];for(const r=function(e){const t=e.getPolys().getData(),r=e.getStrips().getData(),n={cellSize:0,cell:[],done:!1,polyIdx:0,stripIdx:0,remainingStripLength:0,next(){if(n.polyIdx<t.length){n.cellSize=t[n.polyIdx];const e=n.polyIdx+1,r=e+n.cellSize;n.polyIdx=r;let o=0;for(let i=e;i<r;++i)n.cell[o++]=t[i]}else if(n.stripIdx<r.length){n.cellSize=3,0===n.remainingStripLength&&(n.remainingStripLength=r[n.stripIdx]-2,n.stripIdx+=3);const e=n.stripIdx-2,t=n.stripIdx+1;n.stripIdx++,n.remainingStripLength--;let o=0;for(let i=e;i<t;++i)n.cell[o++]=r[i]}else{if(n.done)throw new Error("Iterator is done");n.done=!0}}};return n.next(),n}(e);!r.done;r.next()){if(r.cellSize<=2)continue;for(let e=0;e<r.cellSize;)y[e]=t.cutScalars[r.cell[e++]];const e=y[0]>0;let n=!0;for(let t=1;t<r.cell.length;t++)if(y[t]>0!==e){n=!1;break}if(n)continue;const a=[];for(let e=0;e<r.cellSize;e++){const n=e+1===r.cellSize?0:e+1,s=y[e]>0;if(y[n]>0===s)continue;let l=e,u=n,c=y[u]-y[l];c<=0&&(l=n,u=e,c*=-1);let p=0;0!==c&&(p=(t.cutValue-y[l])/c);const f=r.cell[l],h=r.cell[u];m[0]=o[3*f],m[1]=o[3*f+1],m[2]=o[3*f+2],g[0]=o[3*h],g[1]=o[3*h+1],g[2]=o[3*h+2];const v=[m[0]+p*(g[0]-m[0]),m[1]+p*(g[1]-m[1]),m[2]+p*(g[2]-m[2])],b={};for(let e=0;e<d;e++){const t=i.getArrayByIndex(e),r=i.getArrayName(e),n=t.getData(),o=t.getNumberOfComponents(),a=new Array(o);for(let e=0;e<o;e++){const t=n[o*f+e],r=n[o*h+e];a.push(t+p*(r-t))}b[r]=a}a.push({pointEdge1:f,pointEdge2:h,intersectedPoint:v,intersectedArrays:b,newPointID:-1})}for(let e=0;e<a.length;e++){const t=a[e];let r=!1;for(let n=0;n<h.length;n++){const o=h[n],i=t.pointEdge1===o.pointEdge1&&t.pointEdge2===o.pointEdge2,s=t.intersectedPoint[0]===o.intersectedPoint[0]&&t.intersectedPoint[1]===o.intersectedPoint[1]&&t.intersectedPoint[2]===o.intersectedPoint[2];if(i||s){r=!0,a[e].newPointID=h[n].newPointID;break}}r||(s.push(t.intersectedPoint[0]),s.push(t.intersectedPoint[1]),s.push(t.intersectedPoint[2]),Object.keys(t.intersectedArrays).forEach(e=>{c[e].push(...t.intersectedArrays[e])}),a[e].newPointID=s.length/3-1,h.push(a[e]))}const p=a.length;2===p?l.push(p,a[0].newPointID,a[1].newPointID):p>2&&(u.push(p),a.forEach(e=>{u.push(e.newPointID)}))}r.getPoints().setData(it(n.getDataType(),s),3);const v=r.getPointData();for(let e=0;e<d;e++){const t=i.getArrayName(e),r=_s.newInstance({name:t,dataType:i.getArrayByIndex(e).getDataType(),values:c[t],numberOfComponents:i.getArrayByIndex(e).getNumberOfComponents()});v.addArray(r)}0!==l.length&&r.getLines().setData(Uint16Array.from(l)),0!==u.length&&r.getPolys().setData(Uint16Array.from(u))})(n,o),r[0]=o}}const g_={cutFunction:null,cutScalars:null,cutValue:0};function y_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,g_,r),mt(e,t),At(e,t,1,1),_t(e,t,["cutFunction","cutValue"]),m_(e,t)}var v_={newInstance:Pt(y_,"vtkCutter"),extend:y_};const b_={numberOfIterations:20,passBand:.1,featureAngle:45,edgeAngle:15,featureEdgeSmoothing:0,boundarySmoothing:1,nonManifoldSmoothing:0,generateErrorScalars:0,generateErrorVectors:0,normalizeCoordinates:0};function x_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,b_,r),zt.obj(e,t),zt.algo(e,t,1,1),zt.setGet(e,t,["numberOfIterations","passBand","featureAngle","edgeAngle","featureEdgeSmoothing","boundarySmoothing","nonManifoldSmoothing","generateErrorScalars","generateErrorVectors","normalizeCoordinates"]),function(e,t){t.classHierarchy.push("vtkWindowedSincPolyDataFilter"),e.vtkWindowedSincPolyDataFilterExecute=(e,r,n)=>{if(!e||t.numberOfIterations<=0)return e;const o=e.getData(),i=r.getVerts().getData(),a=r.getLines().getData(),s=r.getPolys().getData(),l=r.getStrips().getData(),u=Math.cos(Oi.radiansFromDegrees(t.featureAngle)),c=Math.cos(Oi.radiansFromDegrees(t.edgeAngle)),d=e.getNumberOfPoints(),p=new Array(d);for(let e=0;e<d;++e)p[e]={type:0,edges:null};let f=0;for(let e=0;e<i.length;e+=f+1){f=i[e];const t=i.slice(e+1,e+1+f);for(let e=0;e<t.length;++e)p[t[e]].type=1}for(let e=0;e<a.length;e+=f+1){f=a[e];const t=a.slice(e+1,e+1+f),r=t[0]===t[f-1]&&f>3;for(let e=0;e<f;++e)0===p[t[e]].type?0===e?r?(p[t[0]].type=2,p[t[0]].edges=[t[f-2],t[1]]):p[t[0]].type=1:e!==f-1||r?(p[t[e]].type=2,p[t[e]].edges=[t[e-1],t[r&&e===f-2?0:e+1]]):p[t[e]].type=1:2!==p[t[e]].type||r&&e===f-1||(p[t[e]].type=1,p[t[e]].edges=null)}const h=s.length,m=l.length;if(h>0||m>0){const n=mc.newInstance();n.setPoints(r.getPoints()),n.setPolys(r.getPolys());const o=n;let i=[],a=0;const s=[],l=[];o.buildLinks();const c=o.getPolys().getData();let d=0;for(let r=0;r<c.length;r+=f+1,++d){f=c[r];const n=c.slice(r+1,r+1+f);for(let r=0;r<f;++r){const c=n[r],h=n[(r+1)%f];null===p[c].edges&&(p[c].edges=[]),null==p[h].edges&&(p[h].edges=[]),i=o.getCellEdgeNeighbors(d,c,h);const m=i.length;let g=0;if(0===m)g=3;else if(m>=2){if(!t.nonManifoldSmoothing){let e=0;for(;e<m&&!(i[e]<d);++e);e>=m&&(g=2)}}else{if(!(1===m&&(a=i[0])>d))continue;if(t.featureEdgeSmoothing){ec.computeNormal(e.getPoint(n[0]),e.getPoint(n[1]),e.getPoint(n[2]),s);const{cellPointIds:t}=o.getCellPoints(a);ec.computeNormal(e.getPoint(t[0]),e.getPoint(t[1]),e.getPoint(t[2]),l),Oi.dot(s,l)<=u&&(g=2)}}g&&0===p[c].type?(p[c].edges=[h],p[c].type=g):(g&&3===p[c].type||g&&2===p[c].type||!g&&0===p[c].type)&&(p[c].edges.push(h),p[c].type&&3===g&&(p[c].type=3)),g&&0===p[h].type?(p[h].edges=[c],p[h].type=g):(g&&3===p[h].type||g&&2===p[h].type||!g&&0===p[h].type)&&(p[h].edges.push(c),p[h].type&&3===g&&(p[h].type=3))}}}for(let r=0;r<d;++r)if(0===p[r].type);else if(1===p[r].type);else if(2===p[r].type||3===p[r].type)if(t.boundarySmoothing||3!==p[r].type)if(2!==(f=p[r].edges.length))p[r].type=1;else{const t=e.getPoint(p[r].edges[0]),n=e.getPoint(r),o=e.getPoint(p[r].edges[1]),i=[0,0,0],a=[0,0,0];for(let e=0;e<3;++e)i[e]=n[e]-t[e],a[e]=o[e]-n[e];Oi.normalize(i)>=0&&Oi.normalize(a)>=0&&Oi.dot(i,a)<c?p[r].type=1:p[r].type}else p[r].type=1;let g=0,y=1,v=2;const b=[];b.push(Jl.newInstance()),b[g].setNumberOfPoints(d),b.push(Jl.newInstance()),b[y].setNumberOfPoints(d),b.push(Jl.newInstance()),b[v].setNumberOfPoints(d),b.push(Jl.newInstance()),b[3].setNumberOfPoints(d);const x=Va.getCenter(r.getBounds()),_=Va.getDiagonalLength(r.getBounds());if(t.normalizeCoordinates){const t=[0,0,0];for(let r=0;r<d;++r)e.getPoint(r,t),t[0]=(t[0]-x[0])/_,t[1]=(t[1]-x[1])/_,t[2]=(t[2]-x[2])/_,b[g].setPoint(r,...t)}else{const e=zt.newTypedArray(b[g].getDataType(),o);b[g].setData(e,3)}const S=t.passBand,C=Math.acos(1-.5*S),T=new Array(t.numberOfIterations+1),w=new Array(t.numberOfIterations+1),A=new Array(t.numberOfIterations+1),E=[0,0,0];for(let e=0;e<=t.numberOfIterations;++e)T[e]=.54+.46*Math.cos(e*Math.PI/(t.numberOfIterations+1));let D=0,P=0,I=!1,O=0;for(let e=0;!I&&e<500;++e){w[0]=T[0]*(C+O)/Math.PI;for(let e=1;e<=t.numberOfIterations;++e)w[e]=2*T[e]*Math.sin(e*(C+O))/(e*Math.PI);A[t.numberOfIterations]=0,A[t.numberOfIterations-1]=0,t.numberOfIterations>1&&(A[t.numberOfIterations-2]=2*(t.numberOfIterations-1)*w[t.numberOfIterations-1]);for(let e=t.numberOfIterations-3;e>=0;--e)A[e]=A[e+2]+2*(e+1)*w[e+1];D=0,P=0,D+=w[0],P+=A[0];for(let e=1;e<=t.numberOfIterations;++e)1===e?(D+=w[e]*(1-.5*S),P+=A[e]*(1-.5*S)):(D+=w[e]*Math.cos(e*Math.acos(1-.5*S)),P+=A[e]*Math.cos(e*Math.acos(1-.5*S)));t.numberOfIterations>1?Math.abs(D-1)>=.001?O-=(D-1)/P:I=!0:(I=!0,O=0)}Math.abs(D-1)>=.001&&console.log("An optimal offset for the smoothing filter could not be found. Unpredictable smoothing/shrinkage may result.");const N=[0,0,0],M=[0,0,0],R=[0,0,0],F=[0,0,0],B=[0,0,0],L=[0,0,0];for(let e=0;e<d;++e)if(null!=p[e].edges&&(f=p[e].edges.length)>0){b[g].getPoint(e,N),R[0]=0,R[1]=0,R[2]=0;for(let t=0;t<f;++t){b[g].getPoint(p[e].edges[t],M);for(let e=0;e<3;++e)R[e]+=(N[e]-M[e])/f}for(let e=0;e<3;++e)R[e]=N[e]-.5*R[e];if(b[y].setPoint(e,...R),1===p[e].type)b[g].getPoint(e,R);else for(let e=0;e<3;++e)R[e]=w[0]*N[e]+w[1]*R[e];b[3].setPoint(e,...R)}else b[y].setPoint(e,...E),b[g].getPoint(e,R),b[3].setPoint(e,...R);const k=[0,0,0],U=[0,0,0],V=[0,0,0];let G=2;for(;G<=t.numberOfIterations;G++){for(let e=0;e<d;++e)if(f=null!=p[e].edges?p[e].edges.length:0,f>0){b[g].getPoint(e,k),b[y].getPoint(e,U),R[0]=0,R[1]=0,R[2]=0;for(let t=0;t<f;++t){b[y].getPoint(p[e].edges[t],M);for(let e=0;e<3;++e)R[e]+=(U[e]-M[e])/f}for(let e=0;e<3;++e)R[e]=U[e]-k[e]+U[e]-R[e];b[v].setPoint(e,...R),b[3].getPoint(e,V);for(let e=0;e<3;++e)F[e]=V[e]+w[G]*R[e];1!==p[e].type&&b[3].setPoint(e,...F)}else b[y].setPoint(e,...E),b[v].setPoint(e,...E);g=(1+g)%3,y=(1+y)%3,v=(1+v)%3}if(--G,g=3,t.normalizeCoordinates){const e=[0,0,0];for(let t=0;t<d;++t){b[g].getPoint(t,e);for(let t=0;t<3;++t)e[t]=e[t]*_+x[t];b[g].setPoint(t,...e)}}if(t.generateErrorScalars){const t=new Float32Array(d);for(let r=0;r<d;++r)e.getPoint(r,B),b[g].getPoint(r,L),t[r]=Math.sqrt(Math.distance2BetweenPoints(B,L));const r=_s.newInstance({numberOfComponents:1,values:t}),o=n.getPointData().addArray(r);n.getPointData().setActiveAttribute(o,Is.SCALARS)}if(t.generateErrorVectors){const t=new Float32Array(3*d);for(let r=0;r<d;++r){e.getPoint(r,B),b[g].getPoint(r,L);for(let e=0;e<3;++e)t[3*r+e]=L[e]-B[e]}const r=_s.newInstance({numberOfComponents:3,values:t});n.getPointData().setVectors(r)}return b[g]},e.requestData=(t,r)=>{if(!e.getNumberOfInputPorts())return;const n=t[0];if(!n)return;const o=r[0]?.initialize()||mc.newInstance(),i=e.vtkWindowedSincPolyDataFilterExecute(n.getPoints(),n,o);o.setPointData(n.getPointData()),o.setCellData(n.getCellData()),o.setFieldData(n.getFieldData()),o.setPoints(i),o.setVerts(n.getVerts()),o.setLines(n.getLines()),o.setPolys(n.getPolys()),o.setStrips(n.getStrips()),r[0]=o}}(e,t)}var __={newInstance:zt.newInstance(x_,"vtkWindowedSincPolyDataFilter"),extend:x_};const{vtkErrorMacro:S_}=zt,C_=[0,2,4,1,2,4,0,3,4,1,3,4,0,2,5,1,2,5,0,3,5,1,3,5],T_=[2,0,1,2,2,3,2,4,5,2,6,7,2,0,2,2,1,3,2,4,6,2,5,7,2,0,4,2,1,5,2,2,6,2,3,7],w_={};function A_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,w_,r),zt.obj(e,t),zt.algo(e,t,1,1),function(e,t){t.classHierarchy.push("vtkOutlineFilter"),e.requestData=(e,t)=>{const r=e[0];if(!r)return void S_("Invalid or missing input");const n=r.getBounds(),o=t[0]?.initialize()||mc.newInstance();o.getPoints().setData(Float32Array.from(C_.map(e=>n[e])),3),o.getLines().setData(Uint16Array.from(T_)),t[0]=o}}(e,t)}var E_={newInstance:zt.newInstance(A_,"vtkOutlineFilter"),extend:A_,BOUNDS_MAP:C_,LINE_ARRAY:T_};const D_={height:1,radius:.5,resolution:6,center:[0,0,0],direction:[1,0,0],capping:!0,pointType:"Float64Array"};function P_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,D_,r),zt.obj(e,t),zt.setGet(e,t,["height","radius","resolution","capping"]),zt.setGetArray(e,t,["center","direction"],3),zt.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkConeSource"),e.requestData=(e,r)=>{const n=2*Math.PI/t.resolution,o=-t.height/2,i=t.resolution+1,a=4*t.resolution+1+t.resolution;let s=0;const l=zt.newTypedArray(t.pointType,3*i);let u=0;const c=new Uint32Array(a);l[0]=t.height/2,l[1]=0,l[2]=0,t.capping&&(c[u++]=t.resolution);for(let e=0;e<t.resolution;e++)s++,l[3*s+0]=o,l[3*s+1]=t.radius*Math.cos(e*n),l[3*s+2]=t.radius*Math.sin(e*n),t.capping&&(c[t.resolution-u+++1]=s);for(let e=0;e<t.resolution;e++)c[u++]=3,c[u++]=0,c[u++]=e+1,c[u++]=e+2>t.resolution?1:e+2;ov().translate(...t.center).rotateFromDirections([1,0,0],t.direction).apply(l);const d=r[0]?.initialize()||mc.newInstance();d.getPoints().setData(l,3),d.getPolys().setData(c,1),r[0]=d}}(e,t)}var I_={newInstance:zt.newInstance(P_,"vtkConeSource"),extend:P_};const O_={radius:.5,latLongTessellation:!1,thetaResolution:8,startTheta:0,endTheta:360,phiResolution:8,startPhi:0,endPhi:180,center:[0,0,0],pointType:"Float64Array"};function N_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,O_,r),zt.obj(e,t),zt.setGet(e,t,["radius","latLongTessellation","thetaResolution","startTheta","endTheta","phiResolution","startPhi","endPhi"]),zt.setGetArray(e,t,["center"],3),zt.algo(e,t,0,1),function(e,t){t.classHierarchy.push("vtkSphereSource"),e.requestData=(e,r)=>{let n=r[0];const o=n?n.getPoints().getDataType():t.pointType;n=n?.initialize()||mc.newInstance();let i=0,{thetaResolution:a}=t,s=t.startTheta<t.endTheta?t.startTheta:t.endTheta;s*=Math.PI/180;let l=t.endTheta>t.startTheta?t.endTheta:t.startTheta;l*=Math.PI/180;let u=t.startPhi<t.endPhi?t.startPhi:t.endPhi;u*=Math.PI/180;let c=t.endPhi>t.startPhi?t.endPhi:t.startPhi;c*=Math.PI/180,Math.abs(s-l)<2*Math.PI&&++a;const d=(l-s)/t.thetaResolution,p=t.startPhi<=0?1:0,f=t.phiResolution+(t.endPhi>=180?-1:0),h=t.phiResolution*a+2,m=2*t.phiResolution*t.thetaResolution;let g=0,y=zt.newTypedArray(o,3*h),v=new Float32Array(3*h),b=0,x=new Uint32Array(5*m);t.startPhi<=0&&(y[3*g+0]=t.center[0],y[3*g+1]=t.center[1],y[3*g+2]=t.center[2]+t.radius,v[3*g+0]=0,v[3*g+1]=0,v[3*g+2]=1,g++,i++),t.endPhi>=180&&(y[3*g+0]=t.center[0],y[3*g+1]=t.center[1],y[3*g+2]=t.center[2]-t.radius,v[3*g+0]=0,v[3*g+1]=0,v[3*g+2]=-1,g++,i++);const _=t.phiResolution-i,S=(c-u)/(t.phiResolution-1);for(let e=0;e<a;e++){const r=s+e*d;for(let e=p;e<f;e++){const n=u+e*S,o=t.radius*Math.sin(n);v[3*g+0]=o*Math.cos(r),v[3*g+1]=o*Math.sin(r),v[3*g+2]=t.radius*Math.cos(n),y[3*g+0]=v[3*g+0]+t.center[0],y[3*g+1]=v[3*g+1]+t.center[1],y[3*g+2]=v[3*g+2]+t.center[2];let i=Math.sqrt(v[3*g+0]*v[3*g+0]+v[3*g+1]*v[3*g+1]+v[3*g+2]*v[3*g+2]);i=0===i?1:i,v[3*g+0]/=i,v[3*g+1]/=i,v[3*g+2]/=i,g++}}const C=_*a;if(Math.abs(s-l)<2*Math.PI&&--a,t.startPhi<=0)for(let e=0;e<a;e++)x[b++]=3,x[b++]=_*e+i,x[b++]=_*(e+1)%C+i,x[b++]=0;if(t.endPhi>=180){const e=_-1+i;for(let t=0;t<a;t++)x[b++]=3,x[b++]=_*t+e,x[b++]=i-1,x[b++]=_*(t+1)%C+e}for(let e=0;e<a;e++)for(let r=0;r<_-1;r++){const n=_*e+r+i,o=n+1,a=(_*(e+1)+r)%C+i+1;t.latLongTessellation?(x[b++]=4,x[b++]=n,x[b++]=o,x[b++]=a,x[b++]=a-1):(x[b++]=3,x[b++]=n,x[b++]=o,x[b++]=a,x[b++]=3,x[b++]=n,x[b++]=a,x[b++]=a-1)}y=y.subarray(0,3*g),n.getPoints().setData(y,3),v=v.subarray(0,3*g);const T=_s.newInstance({name:"Normals",values:v,numberOfComponents:3});n.getPointData().setNormals(T),x=x.subarray(0,b),n.getPolys().setData(x,1),r[0]=n}}(e,t)}var M_={newInstance:zt.newInstance(N_,"vtkSphereSource"),extend:N_},R_={ColorSpace:{RGB:0,HSV:1,LAB:2,DIVERGING:3},Scale:{LINEAR:0,LOG10:1}};const{ColorSpace:F_,Scale:B_}=R_,{ScalarMappingTarget:L_}=ul,{vtkDebugMacro:k_,vtkErrorMacro:U_,vtkWarningMacro:V_}=zt;function G_(e,t){const r=e[0],n=e[1],o=e[2],i=Math.sqrt(r*r+n*n+o*o),a=i>.001?Math.acos(r/i):0,s=a>.001?Math.atan2(o,n):0;t[0]=i,t[1]=a,t[2]=s}function z_(e,t){if(e[0]>=t-.1)return e[2];const r=e[1]*Math.sqrt(t*t-e[0]*e[0])/(e[0]*Math.sin(e[1]));return e[2]>-.3*Math.PI?e[2]+r:e[2]-r}function j_(e,t,r,n){const o=[],i=[];mi(t,o),mi(r,i);const a=[],s=[];G_(o,a),G_(i,s);let l=e;if(a[1]>.05&&s[1]>.05&&function(e,t){let r=e-t;for(r<0&&(r=-r);r>=2*Math.PI;)r-=2*Math.PI;return r>Math.PI&&(r=2*Math.PI-r),r}(a[2],s[2])>.33*Math.PI){let t=Math.max(a[0],s[0]);t=Math.max(88,t),e<.5?(s[0]=t,s[1]=0,s[2]=0,l*=2):(a[0]=t,a[1]=0,a[2]=0,l=2*l-1)}a[1]<.05&&s[1]>.05?a[2]=z_(s,a[0]):s[1]<.05&&a[1]>.05&&(s[2]=z_(a,s[0]));const u=[];u[0]=(1-l)*a[0]+l*s[0],u[1]=(1-l)*a[1]+l*s[1],u[2]=(1-l)*a[2]+l*s[2];const c=[];!function(e,t){const r=e[0],n=e[1],o=e[2];t[0]=r*Math.cos(n),t[1]=r*Math.sin(n)*Math.cos(o),t[2]=r*Math.sin(n)*Math.sin(o)}(u,c),gi(c,n)}const W_={clamping:!0,colorSpace:F_.RGB,hSVWrap:!0,scale:B_.LINEAR,nanColor:null,belowRangeColor:null,aboveRangeColor:null,useAboveRangeColor:!1,useBelowRangeColor:!1,allowDuplicateScalars:!1,table:null,tableSize:0,buildTime:null,nodes:null,discretize:!1,numberOfValues:256};function H_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.assign(t,W_,r),ul.extend(e,t,r),t.table=[],t.nodes=[],t.nanColor=[.5,0,0,1],t.belowRangeColor=[0,0,0,1],t.aboveRangeColor=[1,1,1,1],t.buildTime={},zt.obj(t.buildTime),zt.get(e,t,["buildTime","mappingRange"]),zt.setGet(e,t,["useAboveRangeColor","useBelowRangeColor","discretize","numberOfValues",{type:"enum",name:"colorSpace",enum:F_},{type:"enum",name:"scale",enum:B_}]),zt.setArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"],4),zt.getArray(e,t,["nanColor","belowRangeColor","aboveRangeColor"]),function(e,t){t.classHierarchy.push("vtkColorTransferFunction"),e.getSize=()=>t.nodes.length,e.addRGBPoint=(t,r,n,o)=>e.addRGBPointLong(t,r,n,o,.5,0),e.addRGBPointLong=function(r,n,o,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(a<0||a>1)return U_("Midpoint outside range [0.0, 1.0]"),-1;if(s<0||s>1)return U_("Sharpness outside range [0.0, 1.0]"),-1;t.allowDuplicateScalars||e.removePoint(r);const l={x:r,r:n,g:o,b:i,midpoint:a,sharpness:s};t.nodes.push(l),e.sortAndUpdateRange();let u=0;for(;u<t.nodes.length&&t.nodes[u].x!==r;u++);return u<t.nodes.length?u:-1},e.addHSVPoint=(t,r,n,o)=>e.addHSVPointLong(t,r,n,o,.5,0),e.addHSVPointLong=function(t,r,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;const s=[];return ci([r,n,o],s),e.addRGBPoint(t,s[0],s[1],s[2],i,a)},e.setNodes=r=>{if(t.nodes!==r){const n=JSON.stringify(t.nodes);t.nodes=r;const o=JSON.stringify(t.nodes);if(e.sortAndUpdateRange()||n!==o)return e.modified(),!0}return!1},e.sortAndUpdateRange=()=>{const r=JSON.stringify(t.nodes);t.nodes.sort((e,t)=>e.x-t.x);const n=JSON.stringify(t.nodes),o=e.updateRange();return o||r===n?o:(e.modified(),!0)},e.updateRange=()=>{const r=[2];r[0]=t.mappingRange[0],r[1]=t.mappingRange[1];const n=t.nodes.length;return n?(t.mappingRange[0]=t.nodes[0].x,t.mappingRange[1]=t.nodes[n-1].x):(t.mappingRange[0]=0,t.mappingRange[1]=0),(r[0]!==t.mappingRange[0]||r[1]!==t.mappingRange[1])&&(e.modified(),!0)},e.removePoint=r=>{let n=0;for(;n<t.nodes.length&&t.nodes[n].x!==r;n++);const o=n;if(n>=t.nodes.length)return-1;let i=!1;return t.nodes.splice(n,1),0!==n&&n!==t.nodes.length||(i=e.updateRange()),i||e.modified(),o},e.movePoint=(r,n)=>{if(r!==n){e.removePoint(n);for(let o=0;o<t.nodes.length;o++)if(t.nodes[o].x===r){t.nodes[o].x=n,e.sortAndUpdateRange();break}}},e.removeAllPoints=()=>{t.nodes=[],e.sortAndUpdateRange()},e.addRGBSegment=(r,n,o,i,a,s,l,u)=>{e.sortAndUpdateRange();for(let e=0;e<t.nodes.length;)t.nodes[e].x>=r&&t.nodes[e].x<=a?t.nodes.splice(e,1):e++;e.addRGBPointLong(r,n,o,i,.5,0),e.addRGBPointLong(a,s,l,u,.5,0),e.modified()},e.addHSVSegment=(t,r,n,o,i,a,s,l)=>{const u=[a,s,l],c=[],d=[];ci([r,n,o],c),ci(u,d),e.addRGBSegment(t,c[0],c[1],c[2],i,d[0],d[1],d[2])},e.mapValue=t=>{const r=[];return e.getColor(t,r),[Math.floor(255*r[0]+.5),Math.floor(255*r[1]+.5),Math.floor(255*r[2]+.5),255]},e.getColor=(r,n)=>{if(t.indexedLookup){const t=e.getSize(),o=e.getAnnotatedValueIndexInternal(r);if(o<0||0===t){const t=e.getNanColorByReference();n[0]=t[0],n[1]=t[1],n[2]=t[2]}else{const r=[];e.getNodeValue(o%t,r),n[0]=r[1],n[1]=r[2],n[2]=r[3]}return}e.getTable(r,r,1,n)},e.getRedValue=t=>{const r=[];return e.getColor(t,r),r[0]},e.getGreenValue=t=>{const r=[];return e.getColor(t,r),r[1]},e.getBlueValue=t=>{const r=[];return e.getColor(t,r),r[2]},e.logScaleEnabled=()=>t.scale===B_.LOG10,e.usingLogScale=()=>e.logScaleEnabled()&&t.mappingRange[0]>0,e.getTable=(r,n,o,i)=>{const a=e.usingLogScale(),s=a?Math.log10(Number(r)):Number(r),l=a?Math.log10(Number(n)):Number(n);if(Ai(s)||Ai(l)){for(let e=0;e<o;e++)i[3*e+0]=t.nanColor[0],i[3*e+1]=t.nanColor[1],i[3*e+2]=t.nanColor[2];return}let u=0;const c=t.nodes.length;let d=0,p=0,f=0;0!==c&&(d=t.nodes[c-1].r,p=t.nodes[c-1].g,f=t.nodes[c-1].b);let h=0,m=0,g=0;const y=[0,0,0],v=[0,0,0];let b=0,x=0;const _=[];let S=t.mappingRange;a&&(S=[Math.log10(t.mappingRange[0]),Math.log10(t.mappingRange[1])]);for(let r=0;r<o;r++){const n=3*r;if(h=o>1?s+r/(o-1)*(l-s):.5*(s+l),t.discretize){const e=S;if(h>=e[0]&&h<=e[1]){const r=t.numberOfValues,n=e[1]-e[0];if(r<=1)h=e[0]+n/2;else{const t=(h-e[0])/n,o=xo(r*t);h=e[0]+o/(r-1)*n}}}for(;u<c&&h>t.nodes[u].x;)u++,u<c&&(m=t.nodes[u-1].x,g=t.nodes[u].x,y[0]=t.nodes[u-1].r,v[0]=t.nodes[u].r,y[1]=t.nodes[u-1].g,v[1]=t.nodes[u].g,y[2]=t.nodes[u-1].b,v[2]=t.nodes[u].b,b=t.nodes[u-1].midpoint,x=t.nodes[u-1].sharpness,b<1e-5&&(b=1e-5),b>.99999&&(b=.99999));if(h>S[1])i[n]=0,i[n+1]=0,i[n+2]=0,t.clamping&&(e.getUseAboveRangeColor()?(i[n]=t.aboveRangeColor[0],i[n+1]=t.aboveRangeColor[1],i[n+2]=t.aboveRangeColor[2]):(i[n]=d,i[n+1]=p,i[n+2]=f));else if(h<S[0]||Ci(h)&&h<0)i[n]=0,i[n+1]=0,i[n+2]=0,t.clamping&&(e.getUseBelowRangeColor()?(i[n]=t.belowRangeColor[0],i[n+1]=t.belowRangeColor[1],i[n+2]=t.belowRangeColor[2]):c>0&&(i[n]=t.nodes[0].r,i[n+1]=t.nodes[0].g,i[n+2]=t.nodes[0].b));else if(0===u&&(Math.abs(h-s)<1e-6||t.discretize))c>0?(i[n]=t.nodes[0].r,i[n+1]=t.nodes[0].g,i[n+2]=t.nodes[0].b):(i[n]=0,i[n+1]=0,i[n+2]=0);else{let e=0;if(e=(h-m)/(g-m),e=e<b?.5*e/b:.5+.5*(e-b)/(1-b),x>.99){if(e<.5){i[n]=y[0],i[n+1]=y[1],i[n+2]=y[2];continue}i[n]=v[0],i[n+1]=v[1],i[n+2]=v[2];continue}if(x<.01){if(t.colorSpace===F_.RGB)i[n]=(1-e)*y[0]+e*v[0],i[n+1]=(1-e)*y[1]+e*v[1],i[n+2]=(1-e)*y[2]+e*v[2];else if(t.colorSpace===F_.HSV){const r=[],o=[];ui(y,r),ui(v,o),t.hSVWrap&&(r[0]-o[0]>.5||o[0]-r[0]>.5)&&(r[0]>o[0]?r[0]-=1:o[0]-=1);const a=[];a[0]=(1-e)*r[0]+e*o[0],a[0]<0&&(a[0]+=1),a[1]=(1-e)*r[1]+e*o[1],a[2]=(1-e)*r[2]+e*o[2],ci(a,_),i[n]=_[0],i[n+1]=_[1],i[n+2]=_[2]}else if(t.colorSpace===F_.LAB){const t=[],r=[];mi(y,t),mi(v,r);const o=[];o[0]=(1-e)*t[0]+e*r[0],o[1]=(1-e)*t[1]+e*r[1],o[2]=(1-e)*t[2]+e*r[2],gi(o,_),i[n]=_[0],i[n+1]=_[1],i[n+2]=_[2]}else t.colorSpace===F_.DIVERGING?(j_(e,y,v,_),i[n]=_[0],i[n+1]=_[1],i[n+2]=_[2]):U_("ColorSpace set to invalid value.",t.colorSpace);continue}e<.5?e=.5*(2*e)**(1+10*x):e>.5&&(e=1-.5*(2*(1-e))**(1+10*x));const r=e*e,o=r*e,a=2*o-3*r+1,s=-2*o+3*r,l=o-2*r+e,u=o-r;let c,d;if(t.colorSpace===F_.RGB)for(let e=0;e<3;e++)c=v[e]-y[e],d=(1-x)*c,i[n+e]=a*y[e]+s*v[e]+l*d+u*d;else if(t.colorSpace===F_.HSV){const e=[],r=[];ui(y,e),ui(v,r),t.hSVWrap&&(e[0]-r[0]>.5||r[0]-e[0]>.5)&&(e[0]>r[0]?e[0]-=1:r[0]-=1);const o=[];for(let t=0;t<3;t++)c=r[t]-e[t],d=(1-x)*c,o[t]=a*e[t]+s*r[t]+l*d+u*d,0===t&&o[t]<0&&(o[t]+=1);ci(o,_),i[n]=_[0],i[n+1]=_[1],i[n+2]=_[2]}else if(t.colorSpace===F_.LAB){const e=[],t=[];mi(y,e),mi(v,t);const r=[];for(let n=0;n<3;n++)c=t[n]-e[n],d=(1-x)*c,r[n]=a*e[n]+s*t[n]+l*d+u*d;gi(r,_),i[n]=_[0],i[n+1]=_[1],i[n+2]=_[2]}else t.colorSpace===F_.DIVERGING?(j_(e,y,v,_),i[n]=_[0],i[n+1]=_[1],i[n+2]=_[2]):U_("ColorSpace set to invalid value.");for(let e=0;e<3;e++)i[n+e]=i[n+e]<0?0:i[n+e],i[n+e]=i[n+e]>1?1:i[n+e]}}},e.getUint8Table=function(r,n,o){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.getMTime()<=t.buildTime&&t.tableSize===o&&t.tableWithAlpha!==i)return t.table;if(0===t.nodes.length)return U_("Attempting to lookup a value with no points in the function"),t.table;const a=i?4:3;t.tableSize===o&&t.tableWithAlpha===i||(t.table=new Uint8Array(o*a),t.tableSize=o,t.tableWithAlpha=i);const s=[];e.getTable(r,n,o,s);for(let e=0;e<o;e++)t.table[e*a+0]=Math.floor(255*s[3*e+0]+.5),t.table[e*a+1]=Math.floor(255*s[3*e+1]+.5),t.table[e*a+2]=Math.floor(255*s[3*e+2]+.5),i&&(t.table[e*a+3]=255);return t.buildTime.modified(),t.table},e.buildFunctionFromArray=r=>{e.removeAllPoints();const n=r.getNumberOfComponents();for(let e=0;e<r.getNumberOfTuples();e++)switch(n){case 3:t.nodes.push({x:e,r:r.getComponent(e,0),g:r.getComponent(e,1),b:r.getComponent(e,2),midpoint:.5,sharpness:0});break;case 4:t.nodes.push({x:r.getComponent(e,0),r:r.getComponent(e,1),g:r.getComponent(e,2),b:r.getComponent(e,3),midpoint:.5,sharpness:0});break;case 5:t.nodes.push({x:e,r:r.getComponent(e,0),g:r.getComponent(e,1),b:r.getComponent(e,2),midpoint:r.getComponent(e,4),sharpness:r.getComponent(e,5)});break;case 6:t.nodes.push({x:r.getComponent(e,0),r:r.getComponent(e,1),g:r.getComponent(e,2),b:r.getComponent(e,3),midpoint:r.getComponent(e,4),sharpness:r.getComponent(e,5)})}e.sortAndUpdateRange()},e.buildFunctionFromTable=(r,n,o,i)=>{let a=0;e.removeAllPoints(),o>1&&(a=(n-r)/(o-1));for(let e=0;e<o;e++){const n={x:r+a*e,r:i[3*e],g:i[3*e+1],b:i[3*e+2],sharpness:0,midpoint:.5};t.nodes.push(n)}e.sortAndUpdateRange()},e.getNodeValue=(e,r)=>e<0||e>=t.nodes.length?(U_("Index out of range!"),-1):(r[0]=t.nodes[e].x,r[1]=t.nodes[e].r,r[2]=t.nodes[e].g,r[3]=t.nodes[e].b,r[4]=t.nodes[e].midpoint,r[5]=t.nodes[e].sharpness,1),e.setNodeValue=(r,n)=>{if(r<0||r>=t.nodes.length)return U_("Index out of range!"),-1;const o=t.nodes[r].x;return t.nodes[r].x=n[0],t.nodes[r].r=n[1],t.nodes[r].g=n[2],t.nodes[r].b=n[3],t.nodes[r].midpoint=n[4],t.nodes[r].sharpness=n[5],o!==n[0]?e.sortAndUpdateRange():e.modified(),1},e.getNumberOfAvailableColors=()=>{if(t.indexedLookup&&e.getSize())return e.getSize();if(t.tableSize)return t.tableSize;const r=t.nodes?.length??0;return Math.max(4094,r)},e.getIndexedColor=(t,r)=>{const n=e.getSize();if(n>0&&t>=0){const o=[];e.getNodeValue(t%n,o);for(let e=0;e<3;++e)r[e]=o[e+1];return void(r[3]=1)}const o=e.getNanColorByReference();r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=1},e.fillFromDataPointer=(t,r)=>{if(!(t<=0)&&r){e.removeAllPoints();for(let n=0;n<t;n++)e.addRGBPoint(r[4*n],r[4*n+1],r[4*n+2],r[4*n+3])}},e.setMappingRange=(r,n)=>{const o=[r,n],i=[r,n],a=e.getRange(),s=e.logScaleEnabled();if(a[1]===o[1]&&a[0]===o[0])return;if(o[1]===o[0])return void U_("attempt to set zero width color range");s&&(o[0]<=0?console.warn("attempt to set log scale color range with non-positive minimum"):(i[0]=Math.log10(o[0]),i[1]=Math.log10(o[1])));const l=(i[1]-i[0])/(a[1]-a[0]),u=i[0]-a[0]*l;for(let e=0;e<t.nodes.length;++e)t.nodes[e].x=t.nodes[e].x*l+u;t.mappingRange[0]=o[0],t.mappingRange[1]=o[1],e.modified()},e.adjustRange=r=>{const n=e.getRange(),o=[];n[0]<r[0]?(e.getColor(r[0],o),e.addRGBPoint(r[0],o[0],o[1],o[2])):(e.getColor(n[0],o),e.addRGBPoint(r[0],o[0],o[1],o[2])),n[1]>r[1]?(e.getColor(r[1],o),e.addRGBPoint(r[1],o[0],o[1],o[2])):(e.getColor(n[1],o),e.addRGBPoint(r[1],o[0],o[1],o[2])),e.sortAndUpdateRange();for(let e=0;e<t.nodes.length;)t.nodes[e].x>=r[0]&&t.nodes[e].x<=r[1]?t.nodes.splice(e,1):++e;return 1},e.estimateMinNumberOfSamples=(t,r)=>{const n=e.findMinimumXDistance();return Math.ceil((r-t)/n)},e.findMinimumXDistance=()=>{if(t.nodes.length<2)return-1;let e=Number.MAX_VALUE;for(let r=0;r<t.nodes.length-1;r++){const n=t.nodes[r+1].x-t.nodes[r].x;n<e&&(e=n)}return e},e.mapScalarsThroughTable=(r,n,o,i)=>{0!==e.getSize()?t.indexedLookup?e.mapDataIndexed(r,n,o,i):e.mapData(r,n,o,i):k_("Transfer Function Has No Points!")},e.mapData=(t,r,n,o)=>{if(0===e.getSize())return void V_("Transfer Function Has No Points!");const i=Math.floor(255*e.getAlpha()+.5),a=t.getNumberOfTuples(),s=t.getNumberOfComponents(),l=r.getData(),u=t.getData(),c=[];if(n===L_.RGBA)for(let t=0;t<a;t++){const r=u[t*s+o];e.getColor(r,c),l[4*t]=Math.floor(255*c[0]+.5),l[4*t+1]=Math.floor(255*c[1]+.5),l[4*t+2]=Math.floor(255*c[2]+.5),l[4*t+3]=i}if(n===L_.RGB)for(let t=0;t<a;t++){const r=u[t*s+o];e.getColor(r,c),l[3*t]=Math.floor(255*c[0]+.5),l[3*t+1]=Math.floor(255*c[1]+.5),l[3*t+2]=Math.floor(255*c[2]+.5)}if(n===L_.LUMINANCE)for(let t=0;t<a;t++){const r=u[t*s+o];e.getColor(r,c),l[t]=Math.floor(76.5*c[0]+150.45*c[1]+28.05*c[2]+.5)}if(n===L_.LUMINANCE_ALPHA)for(let t=0;t<a;t++){const r=u[t*s+o];e.getColor(r,c),l[2*t]=Math.floor(76.5*c[0]+150.45*c[1]+28.05*c[2]+.5),l[2*t+1]=i}},e.applyColorMap=r=>{const n=JSON.stringify(t.colorSpace);r.ColorSpace&&(t.colorSpace=F_[r.ColorSpace.toUpperCase()],void 0===t.colorSpace&&(U_(`ColorSpace ${r.ColorSpace} not supported, using RGB instead`),t.colorSpace=F_.RGB));let o=n!==JSON.stringify(t.colorSpace);const i=o||JSON.stringify(t.nanColor);if(r.NanColor)for(t.nanColor=[].concat(r.NanColor);t.nanColor.length<4;)t.nanColor.push(1);o=o||i!==JSON.stringify(t.nanColor);const a=o||JSON.stringify(t.nodes);if(r.RGBPoints){const e=r.RGBPoints.length;t.nodes=[];const n=.5,o=0;for(let i=0;i<e;i+=4)t.nodes.push({x:r.RGBPoints[i],r:r.RGBPoints[i+1],g:r.RGBPoints[i+2],b:r.RGBPoints[i+3],midpoint:n,sharpness:o})}const s=e.sortAndUpdateRange(),l=!s&&(o||a!==JSON.stringify(t.nodes));return l&&e.modified(),s||l}}(e,t)}var K_={newInstance:zt.newInstance(H_,"vtkColorTransferFunction"),extend:H_,...R_};const X_=Object.create(null);[{Name:"KAAMS",IndexedColors:[1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,1,0,1,0,1,1,.63,.63,1,.67,.5,.33,1,.5,.75,.53,.35,.7,1,.75,.5],Annotations:[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11]},{ColorSpace:"Diverging",Name:"Cool to Warm",NanColor:[1,1,0],RGBPoints:[0,.23137254902,.298039215686,.752941176471,.5,.865,.865,.865,1,.705882352941,.0156862745098,.149019607843]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Cool to Warm (Extended)",NanColor:[.25,0,0],RGBPoints:[0,0,0,.34902,.03125,.039216,.062745,.380392,.0625,.062745,.117647,.411765,.09375,.090196,.184314,.45098,.125,.12549,.262745,.501961,.15625,.160784,.337255,.541176,.1875,.2,.396078,.568627,.21875,.239216,.454902,.6,.25,.286275,.521569,.65098,.28125,.337255,.592157,.701961,.3125,.388235,.654902,.74902,.34375,.466667,.737255,.819608,.375,.572549,.819608,.878431,.40625,.654902,.866667,.909804,.4375,.752941,.917647,.941176,.46875,.823529,.956863,.968627,.5,.988235,.960784,.901961,.5,.941176,.984314,.988235,.52,.988235,.945098,.85098,.54,.980392,.898039,.784314,.5625,.968627,.835294,.698039,.59375,.94902,.733333,.588235,.625,.929412,.65098,.509804,.65625,.909804,.564706,.435294,.6875,.878431,.458824,.352941,.71875,.839216,.388235,.286275,.75,.760784,.294118,.211765,.78125,.701961,.211765,.168627,.8125,.65098,.156863,.129412,.84375,.6,.094118,.094118,.875,.54902,.066667,.098039,.90625,.501961,.05098,.12549,.9375,.45098,.054902,.172549,.96875,.4,.054902,.192157,1,.34902,.070588,.211765]},{ColorSpace:"Diverging",Name:"Warm to Cool",NanColor:[1,1,0],RGBPoints:[0,.705882352941,.0156862745098,.149019607843,.5,.865,.865,.865,1,.23137254902,.298039215686,.752941176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Warm to Cool (Extended)",NanColor:[.250004,0,0],RGBPoints:[0,.34902,0,.129412,.025,.4,.00392157,.101961,.05,.470588,.0156863,.0901961,.075,.54902,.027451,.0705882,.1,.619608,.0627451,.0431373,.125,.690196,.12549,.0627451,.15,.741176,.184314,.0745098,.175,.788235,.266667,.0941176,.2,.811765,.345098,.113725,.225,.831373,.411765,.133333,.25,.85098,.47451,.145098,.275,.870588,.54902,.156863,.3,.878431,.619608,.168627,.325,.890196,.658824,.196078,.35,.909804,.717647,.235294,.375,.929412,.776471,.278431,.395522,.94902,.823529,.321569,.418905,.968627,.87451,.407843,.444278,.980392,.917647,.509804,.470149,.988235,.956863,.643137,.483582,.992157,.964706,.713725,.499,.988235,.980392,.870588,.5,1,1,1,.501,.913725,.988235,.937255,.516418,.827451,.980392,.886275,.531343,.764706,.980392,.866667,.546766,.658824,.980392,.843137,.564179,.572549,.964706,.835294,.587562,.423529,.941176,.87451,.60597,.262745,.901961,.862745,.629851,.0705882,.854902,.870588,.651741,.0509804,.8,.85098,.681592,.0235294,.709804,.831373,.712935,.0313725,.615686,.811765,.75,.0313725,.537255,.788235,.775,.0392157,.466667,.768627,.8,.0509804,.396078,.741176,.825,.054902,.317647,.709804,.85,.054902,.243137,.678431,.875,.0431373,.164706,.639216,.9,.0313725,.0980392,.6,.925,.0392157,.0392157,.560784,.95,.105882,.0509804,.509804,.975,.113725,.0235294,.45098,1,.12549,0,.380392]},{ColorSpace:"RGB",Name:"Rainbow Desaturated",NanColor:[1,1,0],RGBPoints:[0,.278431372549,.278431372549,.858823529412,.143,0,0,.360784313725,.285,0,1,1,.429,0,.501960784314,0,.571,1,1,0,.714,1,.380392156863,0,.857,.419607843137,0,0,1,.878431372549,.301960784314,.301960784314]},{ColorSpace:"RGB",Name:"Cold and Hot",NanColor:[1,1,0],RGBPoints:[0,0,1,1,.45,0,0,1,.5,0,0,.501960784314,.55,1,0,0,1,1,1,0]},{ColorSpace:"RGB",Name:"Black-Body Radiation",NanColor:[0,.498039215686,1],RGBPoints:[0,0,0,0,.4,.901960784314,0,0,.8,.901960784314,.901960784314,0,1,1,1,1]},{ColorSpace:"RGB",Name:"X Ray",NanColor:[1,0,0],RGBPoints:[0,1,1,1,1,0,0,0]},{ColorSpace:"RGB",Name:"Grayscale",NanColor:[1,0,0],RGBPoints:[0,0,0,0,1,1,1,1]},{ColorSpace:"RGB",Name:"Grayscale-DICOM-sigmoid",Notes:"This is a 16 point sample of a sigmoid grayscale colormap described in the DICOM standard. See equation C.11-1 in section C.11.2",NanColor:[1,0,0],BelowRangeColor:[0,0,0],AboveRangeColor:[1,1,1],RGBPoints:[-1,.01798620996209156,.01798620996209156,.01798620996209156,-.8666666666666667,.030275691986950463,.030275691986950463,.030275691986950463,-.7333333333333334,.05053016223541345,.05053016223541345,.05053016223541345,-.6,.08317269649392238,.08317269649392238,.08317269649392238,-.4666666666666667,.13392788832407365,.13392788832407365,.13392788832407365,-.33333333333333337,.2086085273260449,.2086085273260449,.2086085273260449,-.19999999999999996,.31002551887238755,.31002551887238755,.31002551887238755,-.06666666666666665,.4337256058045608,.4337256058045608,.4337256058045608,.06666666666666665,.5662743941954392,.5662743941954392,.5662743941954392,.19999999999999996,.6899744811276125,.6899744811276125,.6899744811276125,.33333333333333326,.791391472673955,.791391472673955,.791391472673955,.46666666666666656,.8660721116759263,.8660721116759263,.8660721116759263,.6000000000000001,.9168273035060777,.9168273035060777,.9168273035060777,.7333333333333334,.9494698377645865,.9494698377645865,.9494698377645865,.8666666666666667,.9697243080130495,.9697243080130495,.9697243080130495,1,.9820137900379085,.9820137900379085,.9820137900379085]},{ColorSpace:"RGB",Name:"Inverted-Grayscale",NanColor:[1,0,0],RGBPoints:[0,1,1,1,1,0,0,0]},{ColorSpace:"RGB",Name:"Inverted-Grayscale-DICOM-sigmoid",Notes:"This is a 16 point sample of a sigmoid inverted-grayscale colormap described in the DICOM standard. See equation C.11-1 in section C.11.2",BelowRangeColor:[1,1,1],AboveRangeColor:[0,0,0],NanColor:[1,0,0],RGBPoints:[-1,.9820137900379085,.9820137900379085,.9820137900379085,-.8666666666666667,.9697243080130495,.9697243080130495,.9697243080130495,-.7333333333333334,.9494698377645866,.9494698377645866,.9494698377645866,-.6,.9168273035060777,.9168273035060777,.9168273035060777,-.4666666666666667,.8660721116759263,.8660721116759263,.8660721116759263,-.33333333333333337,.791391472673955,.791391472673955,.791391472673955,-.19999999999999996,.6899744811276125,.6899744811276125,.6899744811276125,-.06666666666666665,.5662743941954391,.5662743941954391,.5662743941954391,.06666666666666665,.43372560580456077,.43372560580456077,.43372560580456077,.19999999999999996,.3100255188723875,.3100255188723875,.3100255188723875,.33333333333333326,.20860852732604496,.20860852732604496,.20860852732604496,.46666666666666656,.13392788832407365,.13392788832407365,.13392788832407365,.6000000000000001,.08317269649392234,.08317269649392234,.08317269649392234,.7333333333333334,.05053016223541351,.05053016223541351,.05053016223541351,.8666666666666667,.03027569198695046,.03027569198695046,.03027569198695046,1,.01798620996209155,.01798620996209155,.01798620996209155]},{ColorSpace:"RGB",Name:"BkRd",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,1,0,0]},{ColorSpace:"RGB",Name:"BkGn",NanColor:[1,0,1],RGBPoints:[0,0,0,0,1,0,1,0]},{ColorSpace:"RGB",Name:"BkBu",NanColor:[1,1,0],RGBPoints:[0,0,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"BkMa",NanColor:[0,1,0],RGBPoints:[0,0,0,0,1,1,0,1]},{ColorSpace:"RGB",Name:"BkCy",NanColor:[0,1,1],RGBPoints:[0,0,0,0,1,0,1,1]},{ColorSpace:"RGB",Name:"Black, Blue and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,0,0,.501960784314,.666,0,.501960784314,1,1,1,1,1]},{ColorSpace:"RGB",Name:"Black, Orange and White",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.333,.501960784314,0,0,.666,1,.501960784314,0,1,1,1,1]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear YGB 1211g",NanColor:[.25,0,0],RGBPoints:[0,1,.988235,.968627,.02,1,.952941,.878431,.05,.968627,.905882,.776471,.1,.94902,.898039,.647059,.15,.901961,.878431,.556863,.2,.847059,.858824,.482353,.25,.690196,.819608,.435294,.3,.513725,.768627,.384314,.35,.337255,.721569,.337255,.4,.278431,.658824,.392157,.45,.231373,.639216,.435294,.5,.203922,.6,.486275,.55,.172549,.568627,.537255,.6,.141176,.517647,.54902,.65,.133333,.458824,.541176,.7,.12549,.396078,.529412,.75,.117647,.321569,.521569,.8,.121569,.258824,.509804,.85,.133333,.227451,.501961,.9,.145098,.192157,.490196,.95,.188235,.164706,.470588,1,.258824,.196078,.439216]},{ColorSpace:"CIELAB",Creator:"Francesca Samsel",Name:"Linear Green (Gr4L)",NanColor:[.25,0,0],RGBPoints:[0,.054902,.109804,.121569,.05,.07451,.172549,.180392,.1,.086275,.231373,.219608,.15,.094118,.278431,.25098,.2,.109804,.34902,.278431,.25,.113725,.4,.278431,.3,.117647,.45098,.270588,.35,.117647,.490196,.243137,.4,.113725,.521569,.203922,.45,.109804,.54902,.152941,.5,.082353,.588235,.082353,.55,.109804,.631373,.05098,.6,.211765,.678431,.082353,.65,.317647,.721569,.113725,.7,.431373,.760784,.160784,.75,.556863,.8,.239216,.8,.666667,.839216,.294118,.85,.784314,.878431,.396078,.9,.886275,.921569,.533333,.95,.960784,.94902,.670588,1,1,.984314,.901961]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Linear Blue (8_31f)",NanColor:[.25,0,0],RGBPoints:[0,.960784,1,.980392,.05,.815686,.960784,.913725,.1,.670588,.929412,.870588,.15,.556863,.901961,.843137,.2,.478431,.870588,.823529,.25,.439216,.831373,.803922,.3,.4,.8,.788235,.35,.376471,.768627,.768627,.4,.34902,.709804,.729412,.45,.32549,.654902,.690196,.5,.301961,.607843,.658824,.55,.247059,.545098,.619608,.6,.239216,.494118,.580392,.65,.227451,.439216,.541176,.7,.227451,.403922,.521569,.75,.231373,.368627,.501961,.8,.227451,.321569,.470588,.85,.219608,.282353,.439216,.9,.192157,.235294,.4,.95,.160784,.184314,.34902,1,.133333,.12549,.301961]},{ColorSpace:"HSV",Name:"Blue to Red Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,0,0,1,1,1,0,0]},{ColorSpace:"HSV",Name:"Red to Blue Rainbow",NanColor:[.498039215686,.498039215686,.498039215686],RGBPoints:[0,1,0,0,1,0,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended White",NanColor:[1,1,0],RGBPoints:[0,1,1,1,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Grey",NanColor:[1,1,0],RGBPoints:[0,.317647058824,.341176470588,.43137254902,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Rainbow Blended Black",NanColor:[1,1,0],RGBPoints:[0,0,0,0,.17,0,0,1,.34,0,1,1,.5,0,1,0,.67,1,1,0,.84,1,0,0,1,.878431372549,0,1]},{ColorSpace:"RGB",Name:"Blue to Yellow",NanColor:[1,0,0],RGBPoints:[0,.0392156862745,.0392156862745,.949019607843,1,.949019607843,.949019607843,.0392156862745]},{ColorSpace:"HSV",Name:"blot",RGBPoints:[0,0,0,1,.166,0,0,1,.167,1,0,1,.332,1,0,1,.333,0,1,1,.5,0,1,1,.501,0,1,0,.666,0,1,0,.667,1,1,0,.832,1,1,0,.833,1,0,0,1,1,0,0]},{ColorSpace:"Lab",Name:"CIELab Blue to Red",NanColor:[1,1,0],RGBPoints:[0,0,.6,.749019607843,1,.76862745098,.466666666667,.341176470588]},{ColorSpace:"RGB",Name:"jet",RGBPoints:[-1,0,0,.5625,-.777778,0,0,1,-.269841,0,1,1,-.015873,.5,1,.5,.238095,1,1,0,.746032,1,0,0,1,.5,0,0]},{ColorSpace:"RGB",Name:"rainbow",RGBPoints:[-1,0,0,1,-.5,0,1,1,0,0,1,0,.5,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"erdc_rainbow_bright",RGBPoints:[-1,.32549,.14902,.960784,-.866221,.297047,.375586,.963836,-.732441,.180302,.536818,.964627,-.598662,.1302,.649207,.929647,-.464883,.0445143,.749654,.855998,-.331104,.0271325,.830713,.721527,-.197324,.259504,.866145,.543555,-.0635452,.428364,.890725,.329819,.0702341,.568503,.898508,.187623,.204013,.738259,.890317,.0825461,.337793,.84546,.86136,.0147555,.471572,.912191,.808018,0,.605351,.962848,.710445,0,.73913,.999469,.600258,.0176284,.87291,.994156,.445975,.193912,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"erdc_rainbow_dark",RGBPoints:[-1,0,0,.423499,-.866221,0,.119346,.529237,-.732441,0,.238691,.634976,-.598662,0,.346852,.68788,-.464883,0,.45022,.718141,-.331104,0,.553554,.664839,-.197324,0,.651082,.519303,-.0635452,.115841,.72479,.352857,.0702341,.326771,.781195,.140187,.204013,.522765,.798524,.0284624,.337793,.703162,.788685,.00885756,.471572,.845118,.751133,0,.605351,.955734,.690825,0,.73913,.995402,.567916,.0618524,.87291,.987712,.403398,.164851,1,.980407,.247105,.262699]},{ColorSpace:"Lab",Name:"nic_CubicL",RGBPoints:[-1,.479965,.0118108,.5307,-.87451,.522213,.0551282,.706919,-.74902,.50839,.237278,.867764,-.623529,.451617,.373834,.987255,-.498039,.39365,.497255,.97506,-.372549,.328631,.599639,.891843,-.247059,.250043,.690286,.778553,-.121569,.249656,.764905,.645857,.00392157,.297954,.821466,.50449,.129412,.337509,.872595,.358447,.254902,.430011,.913789,.297079,.380392,.587191,.931381,.333353,.505882,.727937,.93591,.353742,.631373,.826403,.921081,.365066,.756863,.893201,.846317,.372662,.882353,.965347,.73884,.378506,1,.983235,.597451,.366856]},{ColorSpace:"Lab",Name:"nic_CubicYF",RGBPoints:[-1,.5151,.0482,.6697,-.87451,.520711,.168955,.800574,-.74902,.493694,.278596,.911824,-.623529,.440026,.369475,.984978,-.498039,.398932,.457593,.987053,-.372549,.350651,.540644,.929608,-.247059,.298827,.615625,.857729,-.121569,.239928,.685061,.769531,.00392157,.228832,.739349,.673287,.129412,.263297,.78608,.569988,.254902,.298107,.828337,.460214,.380392,.33092,.864071,.352674,.505882,.38306,.898169,.287309,.631373,.49023,.917481,.307961,.756863,.62372,.926026,.332309,.882353,.717458,.92527,.342476,1,.8,.9255,.3529]},{ColorSpace:"Lab",Name:"gist_earth",RGBPoints:[-1,0,0,0,-.87451,.239216,.027451,.415686,-.74902,.0901961,.254902,.556863,-.623529,.0941176,.352941,.54902,-.498039,.105882,.435294,.533333,-.372549,.12549,.52549,.501961,-.247059,.156863,.596078,.443137,-.121569,.196078,.65098,.380392,.00392157,.282353,.717647,.301961,.129412,.466667,.772549,.27451,.254902,.678431,.784314,.309804,.380392,.901961,.756863,.376471,.505882,.992157,.705882,.521569,.631373,1,.721569,.701961,.756863,1,.784314,.784314,.882353,1,.866667,.866667,1,1,1,1]},{ColorSpace:"Lab",Name:"2hot",RGBPoints:[-1,.0416667,0,0,-.873016,.208333,0,0,-.746032,.375,0,0,-.619048,.541667,0,0,-.492063,.708333,0,0,-.365079,.854137,0,0,-.238095,.937488,.039062,0,-.111111,1,.208333,0,.015873,1,.375,0,.142857,1,.541667,0,.269841,1,.708333,0,.396825,1,.858805,.03125,.52381,1,.947392,.15625,.650794,1,1,.3125,.777778,1,1,.5625,.904762,1,1,.8125,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_red2yellow_BW",RGBPoints:[-1,7.54296e-7,0,109827e-10,-.87451,.18285,.0264094,0,-.74902,.3066,0,0,-.623529,.422841,0,0,-.498039,.522945,0,0,-.372549,.605721,0,0,-.247059,.672502,.14168,0,-.121569,.728167,.244025,0,.00392157,.781215,.333454,0,.129412,.825,.423586,0,.254902,.855893,.516793,0,.380392,.880491,.608846,0,.505882,.910305,.695505,0,.631373,.94109,.779067,.223528,.756863,.967873,.858572,.473521,.882353,.986815,.933211,.751583,1,1,1,.999997]},{ColorSpace:"Lab",Name:"erdc_marine2gold_BW",RGBPoints:[-1,1.11641e-7,0,162551e-11,-.87451,.0413146,.0619808,.209857,-.74902,.0185557,.101341,.350684,-.623529,.00486405,.149847,.461054,-.498039,.0836345,.210845,.517906,-.372549,.173222,.276134,.541793,-.247059,.259857,.343877,.535869,-.121569,.362299,.408124,.504293,.00392157,.468266,.468276,.468257,.129412,.582781,.527545,.374914,.254902,.691591,.585251,.274266,.380392,.784454,.645091,.247332,.505882,.862299,.710383,.27518,.631373,.920863,.782923,.351563,.756863,.955792,.859699,.533541,.882353,.976162,.93433,.780671,1,1,1,.999983]},{ColorSpace:"Lab",Name:"erdc_blue2gold_BW",RGBPoints:[-1,0,0,0,-.87451,.0742735,.0440331,.230013,-.74902,.125276,.0258685,.415826,-.623529,.143879,.0163031,.591346,-.498039,.212261,.0627855,.705239,-.372549,.306048,.141178,.763636,-.247059,.391537,.232286,.773263,-.121569,.461734,.336633,.708321,.00392157,.54209,.427581,.590007,.129412,.61704,.508623,.460978,.254902,.702703,.579586,.309117,.380392,.790336,.644811,.170397,.505882,.870173,.710733,.117134,.631373,.93656,.781991,.157144,.756863,.965672,.862068,.409836,.882353,.985751,.936296,.714162,1,1,1,.999999]},{ColorSpace:"Lab",Name:"erdc_sapphire2gold_BW",RGBPoints:[-1,.107704,.107708,.107694,-.87451,.1851,.112354,.308554,-.74902,.236782,.114233,.48788,-.623529,.28296,.126187,.639464,-.498039,.344787,.171643,.739713,-.372549,.413325,.242371,.76913,-.247059,.481863,.3131,.719841,-.121569,.550402,.383829,.612222,.00392157,.61894,.454558,.51126,.129412,.687478,.525287,.39993,.254902,.756017,.596016,.289923,.380392,.824555,.666745,.255498,.505882,.892979,.736822,.27696,.631373,.938851,.804966,.351734,.756863,.966491,.874853,.53572,.882353,.982105,.94153,.782579,1,1,1,.999986]},{ColorSpace:"Lab",Name:"erdc_red2purple_BW",RGBPoints:[-1,0,0,0,-.87451,.167793,.0166271,.0431278,-.74902,.262608,.0107595,.0791181,-.623529,.351902,.0101858,.100926,-.498039,.441257,.0160835,.131919,-.372549,.5221,.0555972,.195625,-.247059,.593852,.104294,.310234,-.121569,.654628,.158115,.448486,.00392157,.707443,.220914,.570253,.129412,.749504,.293268,.67897,.254902,.781587,.370517,.779269,.380392,.809951,.451099,.855831,.505882,.84424,.531462,.900451,.631373,.865174,.620901,.91606,.756863,.875041,.714054,.910284,.882353,.880764,.80554,.896276,1,.887572,.887591,.887556]},{ColorSpace:"Lab",Name:"erdc_purple2pink_BW",RGBPoints:[-1,0,0,0,-.87451,.117562,.0291202,.175876,-.74902,.178368,.0458476,.285454,-.623529,.237731,.0680173,.387717,-.498039,.300877,.0956291,.484802,-.372549,.370929,.136858,.554985,-.247059,.449033,.189273,.58863,-.121569,.529971,.245796,.598587,.00392157,.609914,.300643,.610244,.129412,.697079,.351286,.616371,.254902,.785858,.401991,.617376,.380392,.862517,.45745,.64463,.505882,.91359,.525462,.705336,.631373,.932583,.61064,.767412,.756863,.922478,.706966,.817522,.882353,.901302,.803071,.856311,1,.887571,.887591,.887549]},{ColorSpace:"Lab",Name:"erdc_pbj_lin",RGBPoints:[-1,0,0,0,-.87451,.091821,.0611476,.10617,-.74902,.160311,.0900022,.192713,-.623529,.22484,.12126,.272128,-.498039,.291263,.157469,.340828,-.372549,.360015,.200388,.388903,-.247059,.437497,.250058,.387201,-.121569,.512636,.304969,.355955,.00392157,.582603,.360874,.33488,.129412,.655126,.416374,.306351,.254902,.725889,.473329,.279051,.380392,.778125,.537928,.302697,.505882,.815894,.606931,.382431,.631373,.839159,.679308,.497608,.756863,.854748,.751666,.631792,.882353,.869483,.822508,.768592,1,.887572,.887589,.887565]},{ColorSpace:"Lab",Name:"erdc_blue2green_muted",RGBPoints:[-1,.107704,.107708,.107695,-.87451,.141522,.13066,.270741,-.74902,.180123,.146119,.42308,-.623529,.210161,.169674,.551795,-.498039,.239701,.212939,.634969,-.372549,.253916,.282947,.653641,-.247059,.242791,.366933,.608521,-.121569,.226302,.446776,.52693,.00392157,.236237,.514689,.458798,.129412,.274641,.577589,.376069,.254902,.349625,.633993,.288131,.380392,.4437,.683677,.260497,.505882,.536247,.731214,.285424,.631373,.628472,.777128,.349151,.756863,.718259,.819287,.496825,.882353,.804768,.856164,.703299,1,.887571,.887591,.887548]},{ColorSpace:"Lab",Name:"erdc_blue2green_BW",RGBPoints:[-1,3.63578e-7,0,529374e-11,-.87451,.0539915,.0577948,.212806,-.74902,.0620393,.0758942,.388959,-.623529,.0697499,.102032,.54177,-.498039,.113295,.156156,.64334,-.372549,.152047,.243196,.670283,-.247059,.158096,.344084,.622864,-.121569,.151142,.43922,.532767,.00392157,.17155,.521588,.457719,.129412,.225861,.599141,.363997,.254902,.32328,.67007,.259083,.380392,.442344,.733697,.223754,.505882,.558409,.794941,.257411,.631373,.673875,.854344,.340822,.756863,.787244,.909326,.524717,.882353,.896483,.958063,.775914,1,1,1,.999982]},{ColorSpace:"Lab",Name:"GREEN-WHITE_LINEAR",RGBPoints:[-1,0,0,0,-.87451,0,.062745,0,-.74902,0,.12549,0,-.623529,0,.188235,0,-.498039,0,.25098,0,-.372549,0,.313725,0,-.247059,0,.376471,0,-.121569,.094118,.439216,0,.00392157,.196078,.501961,0,.129412,.294118,.564706,0,.254902,.396078,.627451,0,.380392,.498039,.690196,0,.505882,.6,.752941,.145098,.631373,.701961,.815686,.364706,.756863,.8,.878431,.580392,.882353,.901961,.941176,.796078,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_green2yellow_BW",RGBPoints:[-1,0,0,0,-.87451,0,.105542,.0603919,-.74902,0,.159454,.104148,-.623529,0,.219502,.15542,-.498039,0,.282276,.203811,-.372549,0,.346331,.235652,-.247059,0,.411765,.235428,-.121569,0,.477177,.217977,.00392157,.0593644,.541635,.21361,.129412,.233081,.604722,.210591,.254902,.369803,.664942,.226536,.380392,.498446,.722367,.288237,.505882,.601929,.782244,.380815,.631373,.703207,.840497,.512134,.756863,.803186,.896433,.674462,.882353,.903834,.950266,.846715,1,1,1,.999981]},{ColorSpace:"Lab",Name:"blue2cyan",RGBPoints:[-1,0,0,0,-.87451,0,.152941,.364706,-.74902,0,.254902,.470588,-.623529,0,.34902,.572549,-.498039,0,.443137,.670588,-.372549,0,.537255,.772549,-.247059,0,.627451,.870588,-.121569,0,.717647,.964706,.00392157,.0784314,.772549,1,.129412,.207843,.858824,1,.254902,.32549,.941176,1,.380392,.45098,1,1,.505882,.560784,1,1,.631373,.662745,1,1,.756863,.760784,1,1,.882353,.870588,1,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_blue2cyan_BW",RGBPoints:[-1,4.05298e-7,0,59012e-10,-.87451,.0207526,.0740933,.18093,-.74902,0,.121033,.30343,-.623529,0,.166892,.416095,-.498039,0,.216768,.524796,-.372549,.0164769,.275471,.608585,-.247059,.0544527,.344824,.659267,-.121569,.0880643,.419118,.688675,.00392157,.127938,.492556,.720256,.129412,.149476,.566946,.756918,.254902,.188961,.641333,.792122,.380392,.245482,.715336,.827609,.505882,.329216,.786235,.874761,.631373,.453558,.852803,.918466,.756863,.626281,.910493,.954,.882353,.82257,.958709,.980146,1,1,1,.999989]},{ColorSpace:"Lab",Name:"erdc_blue_BW",RGBPoints:[-1,0,0,0,-.87451,.0425591,.0763529,.150682,-.74902,.0569472,.119154,.275403,-.623529,.0635978,.164772,.395427,-.498039,.0774342,.213851,.510014,-.372549,.106815,.267034,.615102,-.247059,.122093,.324649,.720068,-.121569,.160851,.387068,.806956,.00392157,.213754,.453516,.878012,.129412,.26722,.524656,.932436,.254902,.326844,.599279,.968038,.380392,.403403,.674712,.984784,.505882,.499703,.745519,1,.631373,.615055,.813983,1,.756863,.74405,.879228,1,.882353,.877909,.941913,1,1,1,1,.999996]},{ColorSpace:"Lab",Name:"BLUE-WHITE",RGBPoints:[-1,0,0,0,-.87451,0,0,.082353,-.74902,0,0,.168627,-.623529,0,0,.254902,-.498039,0,0,.337255,-.372549,0,0,.423529,-.247059,0,0,.509804,-.121569,0,.101961,.592157,.00392157,0,.203922,.678431,.129412,0,.301961,.764706,.254902,0,.403922,.85098,.380392,0,.505882,.933333,.505882,0,.603922,1,.631373,.254902,.705882,1,.756863,.509804,.807843,1,.882353,.764706,.905882,1,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_purple_BW",RGBPoints:[-1,4.264e-8,0,6.20844e-7,-.87451,.100579,.0593111,.145666,-.74902,.167794,.0889224,.254953,-.623529,.231446,.123339,.360511,-.498039,.296699,.163027,.461278,-.372549,.363211,.209286,.55306,-.247059,.431136,.260776,.637195,-.121569,.498202,.320012,.705799,.00392157,.567456,.380459,.778091,.129412,.629381,.445284,.8448,.254902,.688373,.517374,.895694,.380392,.74891,.590906,.93976,.505882,.805017,.667956,.977626,.631373,.850914,.752618,.992396,.756863,.89724,.838454,.994093,.882353,.948461,.922603,.994449,1,1,1,.999967]},{ColorSpace:"Lab",Name:"erdc_magenta_BW",RGBPoints:[-1,0,0,254023e-10,-.87451,.128696,.0456782,.11635,-.74902,.228133,.0476299,.201452,-.623529,.327273,.0374065,.282107,-.498039,.420953,.0408166,.35709,-.372549,.511562,.0642203,.430511,-.247059,.599552,.102686,.504257,-.121569,.684646,.150536,.579429,.00392157,.765817,.205978,.656062,.129412,.839176,.27229,.731807,.254902,.89536,.357594,.797309,.380392,.930238,.457825,.846984,.505882,.945921,.564536,.880571,.631373,.948995,.670753,.902279,.756863,.947124,.772819,.918171,.882353,.947265,.869424,.934352,1,.954719,.95475,.954726]},{ColorSpace:"Lab",Name:"magenta",RGBPoints:[-1,0,0,0,-.87451,.364706,0,.152941,-.74902,.470588,0,.254902,-.623529,.572549,0,.34902,-.498039,.670588,0,.443137,-.372549,.772549,0,.537255,-.247059,.870588,0,.627451,-.121569,.964706,0,.717647,.00392157,1,.0784314,.772549,.129412,1,.207843,.858824,.254902,1,.32549,.941176,.380392,1,.45098,1,.505882,1,.560784,1,.631373,1,.662745,1,.756863,1,.760784,1,.882353,1,.870588,1,1,1,1,1]},{ColorSpace:"Lab",Name:"RED-PURPLE",RGBPoints:[-1,0,0,0,-.87451,.188235,0,.007843,-.74902,.345098,0,.035294,-.623529,.439216,0,.098039,-.498039,.533333,0,.152941,-.372549,.627451,.015686,.211765,-.247059,.721569,.031373,.266667,-.121569,.8,.047059,.329412,.00392157,.862745,.047059,.403922,.129412,.941176,.062745,.466667,.254902,.988235,.078431,.54902,.380392,.988235,.141176,.643137,.505882,.988235,.25098,.729412,.631373,.988235,.376471,.811765,.756863,.988235,.54902,.886275,.882353,.988235,.752941,.952941,1,.996078,.996078,.996078]},{ColorSpace:"Lab",Name:"erdc_red_BW",RGBPoints:[-1,0,0,0,-.87451,.147204,.0480135,.0401815,-.74902,.253411,.0617478,.0301333,-.623529,.356059,.0746331,.0446897,-.498039,.457731,.0934935,.0636931,-.372549,.557199,.122714,.0860013,-.247059,.665179,.144238,.105585,-.121569,.763833,.187056,.138326,.00392157,.847035,.254558,.189407,.129412,.905663,.345937,.258215,.254902,.941431,.447111,.346277,.380392,.962608,.546927,.457571,.505882,.987833,.637276,.569944,.631373,.994202,.732176,.687958,.756863,.993304,.826268,.800567,.882353,.994413,.917205,.906393,1,1,1,.999979]},{ColorSpace:"Lab",Name:"RED_TEMPERATURE",RGBPoints:[-1,0,0,0,-.87451,.090196,0,0,-.74902,.180392,0,0,-.623529,.270588,0,0,-.498039,.360784,0,0,-.372549,.45098,0,0,-.247059,.545098,0,0,-.121569,.635294,0,0,.00392157,.72549,.058824,0,.129412,.815686,.176471,0,.254902,.905882,.294118,0,.380392,1,.411765,0,.505882,1,.533333,.027451,.631373,1,.65098,.27451,.756863,1,.768627,.521569,.882353,1,.886275,.768627,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_orange_BW",RGBPoints:[-1,0,0,253806e-10,-.87451,.135871,.0593824,0,-.74902,.224328,.0907216,0,-.623529,.318083,.119647,0,-.498039,.414443,.150246,0,-.372549,.511077,.184884,0,-.247059,.605501,.226033,0,-.121569,.695274,.275491,0,.00392157,.777826,.334445,0,.129412,.851498,.402441,0,.254902,.915899,.47759,602975e-9,.380392,.971984,.557882,.0361443,.505882,1,.641287,.135967,.631373,1,.725198,.27997,.756863,1,.808205,.438135,.882353,1,.89306,.587036,1,1,.977928,.721599]},{ColorSpace:"Lab",Name:"heated_object",RGBPoints:[-1,0,0,0,-.87451,.34902,.0862745,0,-.74902,.45098,.172549,0,-.623529,.52549,.231373,0,-.498039,.580392,.278431,0,-.372549,.623529,.313725,0,-.247059,.670588,.352941,0,-.121569,.717647,.392157,0,.00392157,.772549,.439216,0,.129412,.839216,.494118,0,.254902,.901961,.541176,0,.380392,.968627,.6,0,.505882,1,.658824,0,.631373,1,.721569,0,.756863,1,.827451,.298039,.882353,1,.976471,.72549,1,1,1,1]},{ColorSpace:"Lab",Name:"erdc_gold_BW",RGBPoints:[-1,0,0,190933e-10,-.87451,.128363,.0636265,0,-.74902,.193795,.111057,0,-.623529,.25976,.15987,0,-.498039,.328546,.210589,0,-.372549,.399726,.26332,0,-.247059,.472969,.318261,0,-.121569,.546245,.375827,0,.00392157,.61745,.436719,0,.129412,.685545,.501113,0,.254902,.749578,.568799,0,.380392,.80962,.6394,0,.505882,.865572,.712699,.10257,.631373,.917709,.787569,.233665,.756863,.966914,.863138,.369608,.882353,1,.939405,.496104,1,.999225,1,.612275]},{ColorSpace:"Lab",Name:"erdc_brown_BW",RGBPoints:[-1,3.3216e-7,0,483629e-11,-.87451,.14693,.0518172,0,-.74902,.225806,.0814996,0,-.623529,.301681,.111452,0,-.498039,.370487,.150664,0,-.372549,.43108,.199477,0,-.247059,.4849,.255107,0,-.121569,.536798,.313486,0,.00392157,.59286,.371167,0,.129412,.653119,.428135,0,.254902,.714589,.485917,.0379541,.380392,.774667,.54565,.116634,.505882,.831222,.608047,.183895,.631373,.880305,.674199,.260298,.756863,.922314,.742472,.367086,.882353,.959408,.811222,.497258,1,.993548,.875183,.622093]},{ColorSpace:"Lab",Name:"copper_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0784314,.0501961,.0313725,-.74902,.156863,.100392,.0627451,-.623529,.235294,.150588,.0941176,-.498039,.313725,.200784,.12549,-.372549,.392157,.25098,.156863,-.247059,.470588,.301176,.188235,-.121569,.54902,.351373,.219608,.00392157,.627451,.401569,.25098,.129412,.705882,.451765,.282353,.254902,.784314,.501961,.313725,.380392,.862745,.552157,.345098,.505882,.941176,.602353,.376471,.631373,1,.652549,.407843,.756863,1,.702745,.439216,.882353,1,.752941,.470588,1,1,.8,.5]},{ColorSpace:"Lab",Name:"pink_Matlab",RGBPoints:[-1,0,0,0,-.87451,.312416,.204524,.204524,-.74902,.441822,.289241,.289241,-.623529,.54112,.354246,.354246,-.498039,.624831,.409048,.409048,-.372549,.698582,.45733,.45733,-.247059,.764404,.502282,.500979,-.121569,.791292,.591516,.54112,.00392157,.817297,.66895,.578481,.129412,.842499,.738308,.613572,.254902,.866968,.801687,.646762,.380392,.890766,.86041,.678329,.505882,.913944,.913944,.711254,.631373,.936549,.936549,.79459,.756863,.958621,.958621,.869979,.882353,.980196,.980196,.939336,1,1,1,1]},{ColorSpace:"Lab",Name:"bone_Matlab",RGBPoints:[-1,0,0,0,-.87451,.054902,.054902,.075817,-.74902,.109804,.109804,.151634,-.623529,.164706,.164706,.227451,-.498039,.219608,.219608,.303268,-.372549,.27451,.27451,.379085,-.247059,.329412,.329902,.454412,-.121569,.384314,.405719,.509314,.00392157,.439216,.481536,.564216,.129412,.494118,.557353,.619118,.254902,.54902,.63317,.67402,.380392,.603922,.708987,.728922,.505882,.660294,.783824,.783824,.631373,.746569,.838725,.838725,.756863,.832843,.893627,.893627,.882353,.919118,.948529,.948529,1,1,1,1]},{ColorSpace:"Lab",Name:"gray_Matlab",RGBPoints:[-1,0,0,0,-.87451,.0627451,.0627451,.0627451,-.74902,.12549,.12549,.12549,-.623529,.188235,.188235,.188235,-.498039,.25098,.25098,.25098,-.372549,.313725,.313725,.313725,-.247059,.376471,.376471,.376471,-.121569,.439216,.439216,.439216,.00392157,.501961,.501961,.501961,.129412,.564706,.564706,.564706,.254902,.627451,.627451,.627451,.380392,.690196,.690196,.690196,.505882,.752941,.752941,.752941,.631373,.815686,.815686,.815686,.756863,.878431,.878431,.878431,.882353,.941176,.941176,.941176,1,1,1,1]},{ColorSpace:"Lab",Name:"Purples",RGBPoints:[-1,.247059,0,.490196,-.87451,.288397,.07677,.525629,-.74902,.32975,.153587,.561092,-.623529,.373057,.236263,.600461,-.498039,.416363,.319,.639923,-.372549,.459669,.405613,.685198,-.247059,.503345,.491534,.730058,-.121569,.562399,.54862,.757616,.00392157,.621453,.606075,.785544,.129412,.680508,.674971,.824914,.254902,.739562,.743406,.863899,.380392,.798616,.800492,.893426,.505882,.85684,.856655,.922491,.631373,.898178,.894056,.942176,.756863,.938654,.930919,.961646,.882353,.964245,.958478,.977393,1,.988235,.984314,.992157]},{ColorSpace:"Lab",Name:"Blues",RGBPoints:[-1,.031373,.188235,.419608,-.87451,.031373,.253195,.516063,-.74902,.031757,.318139,.612149,-.623529,.080969,.38113,.661361,-.498039,.130427,.444152,.710327,-.372549,.195386,.509112,.743791,-.247059,.260715,.573841,.777209,-.121569,.341423,.628958,.808704,.00392157,.422745,.684075,.839892,.129412,.523137,.739193,.861546,.254902,.622684,.793464,.883429,.380392,.701423,.826928,.910988,.505882,.778685,.8603,.937993,.631373,.825928,.891795,.953741,.756863,.87328,.923291,.969489,.882353,.922491,.954787,.985236,1,.968627,.984314,1]},{ColorSpace:"Lab",Name:"Greens",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546082,.271326,-.372549,.197232,.609073,.31857,-.247059,.257255,.671742,.365859,-.121569,.357647,.720953,.415071,.00392157,.45767,.769919,.465021,.129412,.546251,.811257,.537855,.254902,.634295,.852211,.610688,.380392,.709097,.883706,.683522,.505882,.78316,.914833,.755894,.631373,.842215,.938454,.818885,.756863,.899977,.961538,.880692,.882353,.935409,.975317,.92203,1,.968627,.988235,.960784]},{ColorSpace:"Lab",Name:"PuBu",RGBPoints:[-1,.301961,0,.294118,-.87451,.404321,.029527,.390573,-.74902,.50599,.059592,.486782,-.623529,.519769,.158016,.551742,-.498039,.533456,.256194,.616301,-.372549,.54133,.33887,.655671,-.247059,.54902,.421592,.695087,-.121569,.54902,.506236,.736424,.00392157,.550127,.590573,.777701,.129412,.585559,.665375,.81707,.254902,.622145,.739023,.855825,.380392,.687105,.784298,.879446,.505882,.752065,.829758,.903253,.631373,.817024,.87897,.930811,.756863,.880907,.927213,.957832,.882353,.926182,.958708,.975548,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"BuPu",RGBPoints:[-1,.007843,.219608,.345098,-.87451,.01178,.286536,.449427,-.74902,.015702,.35328,.553479,-.623529,.01767,.396586,.622376,-.498039,.021115,.4402,.690688,-.372549,.11757,.503191,.722184,-.247059,.214625,.565859,.753633,-.121569,.336671,.615071,.78316,.00392157,.457978,.663975,.812503,.129412,.556401,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821638,.903068,.631373,.873387,.864944,.92669,.756863,.927536,.907605,.949988,.882353,.964937,.9391,.967705,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGn",RGBPoints:[-1,.031373,.25098,.505882,-.87451,.031373,.329719,.590527,-.74902,.031911,.408397,.674787,-.623529,.100807,.479262,.710219,-.498039,.169704,.550219,.745744,-.372549,.238601,.62699,.787082,-.247059,.307958,.703114,.826759,-.121569,.39654,.752326,.797232,.00392157,.485121,.801046,.767705,.129412,.573702,.83451,.738178,.254902,.661592,.867743,.711034,.380392,.732457,.895302,.74253,.505882,.801845,.922307,.774579,.631373,.841215,.938055,.817885,.756863,.880907,.95391,.861084,.882353,.926182,.971626,.902422,1,.968627,.988235,.941176]},{ColorSpace:"Lab",Name:"GnBu",RGBPoints:[-1,0,.266667,.105882,-.87451,0,.347374,.139346,-.74902,538e-6,.427912,.172933,-.623529,.069435,.486967,.222145,-.498039,.138178,.546175,.272095,-.372549,.197232,.615071,.368551,-.247059,.256609,.683276,.464867,-.121569,.329443,.722645,.555417,.00392157,.403137,.762138,.645413,.129412,.503529,.805444,.718247,.254902,.603922,.848597,.790465,.380392,.704314,.887966,.847551,.505882,.802307,.926321,.903714,.631373,.851519,.944037,.941115,.756863,.899977,.961538,.976901,.882353,.935409,.975317,.984775,1,.968627,.988235,.992157]},{ColorSpace:"Lab",Name:"GnBuPu",RGBPoints:[-1,.003922,.27451,.211765,-.87451,.003922,.349312,.280661,-.74902,.003937,.423852,.349773,-.623529,.005905,.46519,.446228,-.498039,.009443,.506344,.542837,-.372549,.111803,.535871,.649135,-.247059,.214025,.565859,.753633,-.121569,.310481,.615071,.78316,.00392157,.407797,.663975,.812503,.129412,.531811,.703345,.836125,.254902,.65421,.742714,.859669,.380392,.736886,.782084,.881323,.505882,.81827,.821176,.902884,.631373,.873387,.854641,.922568,.756863,.927536,.888535,.942361,.882353,.964937,.929873,.964014,1,1,.968627,.984314]},{ColorSpace:"Lab",Name:"BuGnYl",RGBPoints:[-1,.031373,.113725,.345098,-.87451,.088458,.159,.463206,-.74902,.145052,.204567,.5807,-.623529,.139146,.287243,.620069,-.498039,.13318,.370196,.659562,-.372549,.123337,.470588,.706805,-.247059,.115386,.570335,.753126,-.121569,.186251,.643168,.761,.00392157,.258716,.71514,.768074,.129412,.380761,.760415,.750358,.254902,.503576,.806075,.732795,.380392,.645306,.861192,.719016,.505882,.783899,.91511,.705606,.631373,.858701,.944637,.6997,.756863,.931349,.973303,.698424,.882353,.966782,.987082,.777163,1,1,1,.85098]},{ColorSpace:"Lab",Name:"PuRd",RGBPoints:[-1,.286275,0,.415686,-.87451,.38273,.001968,.441276,-.74902,.479231,.003922,.466774,-.623529,.581592,.003922,.480554,-.498039,.683799,.00549,.494887,-.372549,.776317,.105882,.544098,-.247059,.867866,.206321,.592618,-.121569,.919047,.308681,.612303,.00392157,.968812,.411226,.632603,.129412,.974717,.519493,.671972,.254902,.980546,.626451,.71065,.380392,.984483,.701253,.732303,.505882,.988328,.77504,.755617,.631373,.990296,.828189,.812703,.756863,.992372,.880907,.869035,.882353,.996309,.926182,.912341,1,1,.968627,.952941]},{ColorSpace:"Lab",Name:"RdPu",RGBPoints:[-1,.403922,0,.121569,-.87451,.500377,0,.192434,-.74902,.596909,277e-6,.263037,-.623529,.703206,.035709,.300438,-.498039,.808612,.071296,.338854,-.372549,.857824,.116571,.441215,-.247059,.905513,.163552,.54293,-.121569,.889765,.281661,.617732,.00392157,.873156,.39897,.691611,.129412,.82985,.491488,.736886,.254902,.789081,.583237,.781853,.380392,.810734,.656071,.819254,.505882,.833126,.729181,.85684,.631373,.870527,.80792,.898178,.756863,.907605,.884398,.938331,.882353,.9391,.921799,.958016,1,.968627,.956863,.976471]},{ColorSpace:"Lab",Name:"Oranges",RGBPoints:[-1,.498039,.152941,.015686,-.87451,.57481,.182468,.013718,-.74902,.651765,.212042,.011734,-.623529,.752157,.247474,.007797,-.498039,.851719,.283368,.004475,-.372549,.898962,.348328,.039908,-.247059,.945652,.413426,.076401,-.121569,.969273,.484291,.157109,.00392157,.992157,.554971,.238185,.129412,.992157,.619931,.330704,.254902,.992157,.684967,.423837,.380392,.992157,.751895,.532103,.505882,.992249,.817716,.639354,.631373,.994218,.861023,.725967,.756863,.996186,.903576,.810965,.882353,.998155,.933103,.868051,1,1,.960784,.921569]},{ColorSpace:"Lab",Name:"Reds",RGBPoints:[-1,.403922,0,.05098,-.87451,.525967,.029527,.066728,-.74902,.647643,.058962,.082476,-.623529,.722445,.076678,.098224,-.498039,.797186,.095194,.114187,-.372549,.868051,.164091,.143714,-.247059,.937809,.233541,.173933,-.121569,.96143,.326059,.232987,.00392157,.984375,.418147,.292657,.129412,.986344,.496886,.371396,.254902,.988235,.575702,.450673,.380392,.988235,.656409,.543191,.505882,.98842,.736747,.635894,.631373,.992357,.809581,.732349,.756863,.996186,.880692,.826759,.882353,.998155,.92203,.885813,1,1,.960784,.941176]},{ColorSpace:"Lab",Name:"RdOr",RGBPoints:[-1,.498039,0,0,-.87451,.6004,0,0,-.74902,.702514,738e-6,477e-6,-.623529,.773379,.095225,.061499,-.498039,.843875,.189865,.12283,-.372549,.891119,.294195,.203537,-.247059,.937855,.397924,.283137,-.121569,.963445,.476663,.316601,.00392157,.988297,.555771,.351665,.129412,.990265,.646321,.436309,.254902,.992157,.735256,.519646,.380392,.992157,.784468,.570827,.505882,.992249,.833218,.623483,.631373,.994218,.872587,.706159,.756863,.996186,.911419,.788189,.882353,.998155,.940946,.859054,1,1,.968627,.92549]},{ColorSpace:"Lab",Name:"BrOrYl",RGBPoints:[-1,.4,.145098,.023529,-.87451,.500392,.174625,.019592,-.74902,.600784,.204291,.015656,-.623529,.701176,.251534,.011719,-.498039,.800984,.299146,.008397,-.372549,.863975,.370012,.043829,-.247059,.926321,.441107,.0794,-.121569,.961753,.521815,.120738,.00392157,.996078,.602645,.163122,.129412,.996078,.68729,.237924,.254902,.996078,.771011,.314879,.380392,.996078,.832034,.444798,.505882,.996171,.892042,.572595,.631373,.998139,.931411,.65724,.756863,1,.969489,.741669,.882353,1,.985236,.822376,1,1,1,.898039]},{ColorSpace:"Lab",Name:"RdOrYl",RGBPoints:[-1,.501961,0,.14902,-.87451,.622038,0,.14902,-.74902,.741761,4e-4,.148866,-.623529,.816563,.05158,.129181,-.498039,.890965,.10356,.110235,-.372549,.940177,.205921,.137793,-.247059,.988281,.308789,.165536,-.121569,.99025,.432803,.200969,.00392157,.992218,.555217,.236278,.129412,.994187,.628051,.267774,.254902,.996078,.701038,.301269,.380392,.996078,.777809,.383945,.505882,.996171,.852826,.466621,.631373,.998139,.892195,.549296,.756863,1,.931349,.632188,.882353,1,.966782,.7188,1,1,1,.8]},{ColorSpace:"Lab",Name:"CIELab_blue2red",RGBPoints:[-1,0,.6,.74902,1,.76863,.46667,.34118]},{ColorSpace:"Lab",Name:"blue2yellow",RGBPoints:[-1,0,0,1,0,.5,.5,.5,1,1,1,0]},{ColorSpace:"Lab",Name:"erdc_blue2gold",RGBPoints:[-1,.175119,.0438468,1,-.874016,.22383,.159771,.94557,-.748031,.27254,.233611,.891216,-.622047,.321251,.296526,.836857,-.496063,.369962,.354296,.782359,-.370079,.418672,.409139,.72754,-.244094,.467383,.462152,.672148,-.11811,.51609,.51396,.615825,.00787402,.572863,.55452,.559172,.133858,.630269,.593822,.517729,.259843,.689588,.624668,.47446,.385827,.745394,.656113,.428638,.511811,.798624,.688104,.379105,.637795,.849926,.720593,.323834,.76378,.899765,.753543,.258657,.889764,.948487,.78692,.171778,1,.990413,.816451,.00729848]},{ColorSpace:"Lab",Name:"erdc_blue2yellow",RGBPoints:[-1,.0830122,0,.495617,-.87451,.141973,.0551288,.57363,-.74902,.193048,.110258,.604561,-.623529,.234231,.165386,.57643,-.498039,.275413,.220515,.548299,-.372549,.316596,.275644,.520169,-.247059,.357778,.330773,.492038,-.121569,.398961,.385901,.463908,.00392157,.449929,.438487,.426815,.129412,.511572,.488299,.379944,.254902,.581222,.53603,.325741,.380392,.650871,.583761,.271538,.505882,.720521,.631493,.217335,.631373,.79017,.679224,.163132,.756863,.85982,.726955,.108929,.882353,.910254,.774159,.14112,1,.927513,.81759,.306289]},{ColorSpace:"Lab",Name:"erdc_cyan2orange",RGBPoints:[-1,.0471513,.213874,.414329,-.87451,.0674702,.256648,.439027,-.74902,.0959957,.299331,.462089,-.623529,.132428,.341872,.483212,-.498039,.188743,.38277,.500597,-.372549,.268511,.420229,.512179,-.247059,.352945,.455602,.519101,-.121569,.43893,.489368,.521538,.00392157,.522445,.522495,.522436,.129412,.600089,.555682,.53205,.254902,.67988,.587981,.539163,.380392,.761011,.619586,.544439,.505882,.84278,.650741,.548567,.631373,.910713,.687347,.557822,.756863,.952232,.734972,.577775,.882353,.975642,.789858,.604868,1,.990752,.843643,.632857]},{ColorSpace:"Lab",Name:"erdc_purple2green",RGBPoints:[-1,.235006,.0483128,.530899,-.87451,.302968,.108419,.552391,-.74902,.360241,.166059,.569502,-.623529,.406746,.226782,.579373,-.498039,.444073,.28964,.582094,-.372549,.473648,.353774,.577947,-.247059,.497636,.418154,.567911,-.121569,.519086,.481741,.553968,.00392157,.542884,.542914,.542875,.129412,.566303,.603989,.527499,.254902,.595218,.662965,.516857,.380392,.628641,.720701,.510673,.505882,.665373,.777849,.508165,.631373,.704182,.834921,.508303,.756863,.743846,.892328,.50999,.882353,.783158,.950422,.512181,1,.818617,1,.513888]},{ColorSpace:"Lab",Name:"erdc_purple2green_dark",RGBPoints:[-1,.107656,0,.428682,-.87451,.1924,0,.449799,-.74902,.255118,.0648939,.466726,-.623529,.304256,.133066,.476703,-.498039,.343202,.19716,.479793,-.372549,.373876,.260353,.476241,-.247059,.398497,.322872,.466953,-.121569,.420016,.384252,.453785,.00392157,.44319,.443216,.443186,.129412,.465553,.502139,.428233,.254902,.492959,.559151,.417591,.380392,.524654,.615092,.411016,.505882,.55959,.670583,.40779,.631373,.596614,.726102,.406948,.756863,.634544,.782032,.407439,.882353,.672183,.838703,.408237,1,.706131,.892759,.408452]},{ColorSpace:"Lab",Name:"coolwarm",RGBPoints:[-1,.229806,.298718,.753683,-.875,.303869,.406535,.844959,-.75,.383013,.509419,.917388,-.625,.466667,.604563,.968155,-.5,.552953,.688929,.995376,-.375,.639176,.7596,.998151,-.25,.722193,.813953,.976575,-.125,.798692,.849786,.931689,0,.865395,.86541,.865396,.125,.924128,.827385,.774508,.25,.958853,.769768,.678008,.375,.969954,.694267,.579375,.5,.958003,.602842,.481776,.625,.923945,.497309,.38797,.75,.869187,.378313,.300267,.875,.795632,.241284,.220526,1,.705673,.0155562,.150233]},{ColorSpace:"Lab",Name:"BuRd",RGBPoints:[-1,.019608,.188235,.380392,-.87451,.088504,.321107,.564937,-.74902,.163399,.444983,.697501,-.623529,.247059,.555709,.754095,-.498039,.420684,.676432,.818685,-.372549,.606459,.789773,.880277,-.247059,.761476,.868512,.924567,-.121569,.878047,.925721,.951942,.00392157,.969089,.966474,.964937,.129412,.983852,.897578,.846828,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"Spectral_lowBlue",RGBPoints:[-1,.368627,.309804,.635294,-.87451,.260361,.450058,.70173,-.74902,.248058,.591311,.717186,-.623529,.376009,.734025,.658132,-.498039,.537947,.814764,.64506,-.372549,.702345,.879585,.636678,-.247059,.84752,.938639,.607151,-.121569,.940408,.976163,.656055,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.937793,.398539,.270127,.756863,.861515,.282891,.299654,.882353,.746482,.144637,.288812,1,.619608,.003922,.258824]},{ColorSpace:"Lab",Name:"GnRP",RGBPoints:[-1,0,.266667,.105882,-.87451,.066436,.394617,.174779,-.74902,.168858,.524567,.25767,-.623529,.323875,.657439,.361015,-.498039,.504883,.772318,.506344,-.372549,.678431,.870127,.654902,-.247059,.803922,.921799,.780392,-.121569,.897116,.951942,.882814,.00392157,.967397,.965936,.967474,.129412,.928028,.879815,.930565,.254902,.866052,.780777,.882891,.380392,.77501,.665129,.821376,.505882,.675663,.537024,.737024,.631373,.57847,.396155,.645982,.756863,.492349,.223914,.547559,.882353,.375548,.096886,.423299,1,.25098,0,.294118]},{ColorSpace:"Lab",Name:"GYPi",RGBPoints:[-1,.152941,.392157,.098039,-.87451,.246444,.505344,.117724,-.74902,.351942,.614533,.161399,-.623529,.474971,.717878,.240138,-.498039,.611995,.811226,.392849,-.372549,.746328,.893118,.565321,-.247059,.859516,.94233,.747405,-.121569,.928105,.96386,.875663,.00392157,.969089,.966859,.968012,.129412,.983852,.910265,.948328,.254902,.979239,.833218,.914648,.380392,.949712,.729873,.862976,.505882,.905652,.58293,.763552,.631373,.85521,.410073,.652211,.756863,.793695,.183699,.531642,.882353,.683737,.063899,.420761,1,.556863,.003922,.321569]},{ColorSpace:"Lab",Name:"GnYlRd",RGBPoints:[-1,0,.407843,.215686,-.87451,.063975,.525952,.277201,-.74902,.177932,.633064,.332718,-.623529,.364937,.724106,.379469,-.498039,.527951,.797155,.40223,-.372549,.678431,.862822,.433449,-.247059,.803922,.916955,.514648,-.121569,.909419,.961861,.625067,.00392157,.999923,.997616,.745021,.129412,.997463,.921338,.61707,.254902,.995002,.824606,.499885,.380392,.992541,.701576,.39654,.505882,.973472,.547405,.318108,.631373,.939023,.389927,.245521,.756863,.867666,.239831,.176624,.882353,.762399,.110727,.151326,1,.647059,0,.14902]},{ColorSpace:"Lab",Name:"GBBr",RGBPoints:[-1,0,.235294,.188235,-.87451,.002461,.338639,.301423,-.74902,.055902,.448981,.417609,-.623529,.183852,.56955,.538178,-.498039,.357785,.700115,.660746,-.372549,.540177,.819531,.77624,-.247059,.714879,.890888,.864821,-.121569,.851134,.934564,.922645,.00392157,.960861,.959785,.95694,.129412,.963322,.927797,.83391,.254902,.939946,.868897,.68935,.380392,.883353,.775394,.517109,.505882,.808074,.625836,.324106,.631373,.717647,.476355,.15494,.756863,.592157,.358247,.06882,.882353,.458593,.26436,.031142,1,.329412,.188235,.019608]},{ColorSpace:"Lab",Name:"PuOr",RGBPoints:[-1,.498039,.231373,.031373,-.87451,.62599,.30273,.026451,-.74902,.746943,.387082,.037524,-.623529,.85767,.490427,.071972,-.498039,.936409,.617762,.236371,-.372549,.992695,.743099,.43291,-.247059,.995156,.841523,.63714,-.121569,.985313,.913802,.813687,.00392157,.966244,.966398,.967705,.129412,.889965,.89504,.938178,.254902,.806151,.804306,.894656,.380392,.712649,.688658,.833141,.505882,.594233,.554325,.744637,.631373,.474894,.404229,.652364,.756863,.366628,.217224,.563783,.882353,.266436,.089965,.434833,1,.176471,0,.294118]},{ColorSpace:"Lab",Name:"PRGn",RGBPoints:[-1,.25098,0,.294118,-.87451,.383852,.103345,.431911,-.74902,.497732,.234679,.55371,-.623529,.583852,.40692,.652134,-.498039,.681968,.545175,.742561,-.372549,.7807,.672357,.825221,-.247059,.871742,.788005,.886736,-.121569,.930488,.885198,.932872,.00392157,.966321,.968089,.965859,.129412,.892503,.950865,.877278,.254902,.796078,.91857,.772549,.380392,.670588,.866897,.647059,.505882,.493195,.765398,.496655,.631373,.314187,.649135,.354556,.756863,.15917,.516263,.251211,.882353,.062284,.386621,.170473,1,0,.266667,.105882]},{ColorSpace:"Lab",Name:"PiYG",RGBPoints:[-1,.556863,.003922,.321569,-.87451,.692195,.067897,.427374,-.74902,.797539,.197847,.539177,-.623529,.859054,.424221,.659746,-.498039,.908574,.592618,.770319,-.372549,.951557,.736332,.866205,-.247059,.981084,.839677,.917878,-.121569,.98293,.913802,.949558,.00392157,.96732,.968474,.965629,.129412,.92549,.963552,.869666,.254902,.852441,.939254,.736025,.380392,.739254,.890042,.553941,.505882,.60323,.805536,.382238,.631373,.467282,.711419,.235217,.756863,.344252,.608074,.156478,.882353,.2406,.49827,.116494,1,.152941,.392157,.098039]},{ColorSpace:"Lab",Name:"OrPu",RGBPoints:[-1,.176471,0,.294118,-.87451,.272434,.095963,.444214,-.74902,.373395,.228912,.56932,-.623529,.481661,.415917,.657901,-.498039,.601922,.562937,.750481,-.372549,.718493,.695886,.836986,-.247059,.811995,.811534,.898501,-.121569,.894733,.8995,.940023,.00392157,.969166,.966859,.963629,.129412,.98639,.910265,.803691,.254902,.995002,.835371,.624375,.380392,.992541,.736947,.420146,.505882,.931949,.609458,.224221,.631373,.85075,.483968,.069819,.756863,.740023,.380623,.035371,.882353,.617993,.29827,.026759,1,.498039,.231373,.031373]},{ColorSpace:"Lab",Name:"BrBG",RGBPoints:[-1,.329412,.188235,.019608,-.87451,.467205,.269435,.031911,-.74902,.6,.365629,.074202,-.623529,.72549,.483737,.160323,-.498039,.812995,.635832,.336409,-.372549,.88689,.781238,.527874,-.247059,.943483,.87474,.700115,-.121569,.963168,.929796,.841599,.00392157,.957247,.959938,.959554,.129412,.84406,.932872,.920185,.254902,.70396,.886428,.859285,.380392,.529258,.815071,.770704,.505882,.346251,.691811,.653057,.631373,.175855,.562015,.530642,.756863,.047905,.441446,.410073,.882353,.002307,.33218,.294348,1,0,.235294,.188235]},{ColorSpace:"Lab",Name:"GyRd",RGBPoints:[-1,.101961,.101961,.101961,-.87451,.227451,.227451,.227451,-.74902,.359939,.359939,.359939,-.623529,.502653,.502653,.502653,-.498039,.631373,.631373,.631373,-.372549,.749865,.749865,.749865,-.247059,.843368,.843368,.843368,-.121569,.926105,.926105,.926105,.00392157,.999846,.997232,.995694,.129412,.994925,.908651,.857901,.254902,.982468,.800692,.706113,.380392,.960323,.66782,.536332,.505882,.894579,.503806,.399769,.631373,.81707,.33218,.281046,.756863,.728489,.155017,.197386,.882353,.576932,.055363,.14925,1,.403922,0,.121569]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen",RGBPoints:[-1,.297553,0,.489074,-.87451,.40259,.151146,.567754,-.74902,.516038,.284843,.658231,-.623529,.629783,.423646,.750938,-.498039,.735198,.563697,.835956,-.372549,.82408,.695541,.903582,-.247059,.889091,.807454,.944862,-.121569,.92334,.886917,.951839,.00392157,.921045,.921084,.921003,.129412,.877324,.907455,.845381,.254902,.797649,.849713,.734695,.380392,.691646,.75964,.600532,.505882,.568981,.649159,.453807,.631373,.438945,.529756,.304259,.756863,.30973,.412001,.158303,.882353,.187078,.305111,.00251458,1,.101655,.220836,0]},{ColorSpace:"Lab",Name:"erdc_divHi_purpleGreen_dim",RGBPoints:[-1,.404088,.131038,.592767,-.87451,.486469,.230957,.651243,-.74902,.575165,.339335,.717723,-.623529,.662741,.454332,.784263,-.498039,.742071,.570213,.842918,-.372549,.806935,.678992,.886227,-.247059,.852219,.771315,.90763,-.121569,.873345,.837327,.901572,.00392157,.866783,.86682,.866745,.129412,.82839,.858225,.796812,.254902,.762578,.814287,.700202,.380392,.676429,.744229,.585735,.505882,.577033,.65732,.461526,.631373,.47128,.562476,.33476,.756863,.365461,.467957,.21076,.882353,.264758,.381138,.0878313,1,.182591,.312249,0]},{ColorSpace:"Lab",Name:"erdc_divLow_icePeach",RGBPoints:[-1,.480048,.817441,.998056,-.87451,.425898,.726921,.883187,-.74902,.366682,.629445,.761936,-.623529,.308756,.531002,.640217,-.498039,.258021,.43705,.523433,-.372549,.219244,.352381,.416348,-.247059,.195127,.281032,.322979,-.121569,.186286,.22627,.246525,.00392157,.192352,.19236,.192364,.129412,.255927,.214469,.191756,.254902,.340459,.254426,.206666,.380392,.444655,.309315,.234029,.505882,.565353,.376004,.270969,.631373,.697917,.450748,.314293,.756863,.836657,.529064,.360227,.882353,.972695,.614884,.413123,1,1,.705904,.472699]},{ColorSpace:"Lab",Name:"erdc_divLow_purpleGreen",RGBPoints:[-1,.956034,.666487,.952663,-.87451,.874457,.572698,.936352,-.74902,.753465,.488253,.909063,-.623529,.63309,.413507,.763833,-.498039,.514491,.345878,.620015,-.372549,.405008,.288141,.484376,-.247059,.311388,.241986,.363556,-.121569,.238722,.209044,.263449,.00392157,.192352,.192366,.192362,.129412,.200379,.233201,.168618,.254902,.230151,.291737,.165227,.380392,.279481,.366076,.178607,.505882,.344927,.453267,.205703,.631373,.421554,.549449,.242643,.756863,.503334,.649999,.284377,.882353,.583497,.749672,.324969,1,.650705,.837228,.356264]},{ColorSpace:"Lab",Name:"Haze_green",RGBPoints:[-1,1,.835294,.886275,-.87451,.937255,.756863,.870443,-.74902,.875817,.666376,.857807,-.623529,.778359,.583007,.808134,-.498039,.676253,.494118,.745098,-.372549,.561365,.390123,.682353,-.247059,.438344,.262745,.621496,-.121569,.321133,.141031,.558751,.00392157,.203922,.0217865,.495861,.129412,.265505,.129412,.433261,.254902,.311692,.255338,.37008,.380392,.356282,.377342,.310821,.505882,.39971,.488889,.258243,.631373,.442556,.604357,.205519,.756863,.48671,.71968,.152941,.882353,.529847,.830356,.100944,1,.572549,.933333,.054902]},{ColorSpace:"Lab",Name:"Haze_lime",RGBPoints:[-1,.704034,.784196,1,-.87451,.633111,.691418,.956078,-.74902,.564021,.600606,.912157,-.623529,.496827,.51189,.868235,-.498039,.43157,.425416,.824314,-.372549,.368248,.341347,.780392,-.247059,.306767,.259855,.736471,-.121569,.246862,.181069,.692549,.00392157,.191619,.109542,.648627,.129412,.257404,.194031,.604706,.254902,.321794,.278775,.560784,.380392,.387909,.364617,.516863,.505882,.456569,.451881,.472941,.631373,.527424,.540773,.42902,.756863,.599759,.631427,.385098,.882353,.673065,.723898,.341176,1,.742751,.812252,.3]},{ColorSpace:"RGB",Name:"Haze",RGBPoints:[-1,1,.835294,.996078,-.00392157,.023529,.141176,.498039,.00392157,.015686,.137255,.494118,1,.984314,.764706,0]},{ColorSpace:"Lab",Name:"Haze_cyan",RGBPoints:[-1,.956863,1,.835294,-.87451,.933188,.921714,.760784,-.74902,.870588,.803486,.671605,-.623529,.807843,.684096,.583297,-.498039,.745098,.569208,.494118,-.372549,.682353,.437763,.390123,-.247059,.621496,.288163,.262745,-.121569,.558751,.144517,.141031,.00392157,.495861,.0217865,.0413943,.129412,.433261,.137255,.129412,.254902,.37008,.263181,.255338,.380392,.306318,.381845,.372694,.505882,.243137,.503994,.494263,.631373,.180392,.629484,.619753,.756863,.117647,.754975,.747131,.882353,.054902,.876398,.866812,1,0,.988235,.976471]},{ColorSpace:"Lab",Name:"nic_Edge",RGBPoints:[-1,.191208,.191208,.191208,-.87451,.239484,.00545035,.614821,-.74902,.220593,.0617459,.863547,-.623529,.17509,.278988,.97794,-.498039,.143526,.576069,.998553,-.372549,.166456,.871883,.96594,-.247059,.376202,.993555,.981833,-.121569,.681996,.991297,.999239,.00392157,.954172,.952734,.94374,.129412,.999735,.99301,.662896,.254902,.979399,.991466,.357973,.380392,.968771,.854967,.162659,.505882,.999245,.556697,.144323,.631373,.973959,.26223,.177946,.756863,.852358,.0526707,.222974,.882353,.593889,.00912724,.238855,1,.191208,.191208,.191208]},{ColorSpace:"Lab",Name:"erdc_iceFire_H",RGBPoints:[-1,4.05432e-7,0,590122e-11,-.87451,0,.120401,.302675,-.74902,0,.216583,.524574,-.623529,.0552475,.345025,.6595,-.498039,.128047,.492588,.720288,-.372549,.188955,.641309,.792092,-.247059,.327673,.784935,.873434,-.121569,.60824,.892164,.935547,.00392157,.881371,.912178,.818099,.129412,.951407,.835621,.449279,.254902,.904481,.690489,0,.380392,.85407,.510864,0,.505882,.777093,.33018,88199e-8,.631373,.672862,.139087,.00269398,.756863,.508815,0,0,.882353,.299417,366289e-9,547829e-9,1,.0157519,.00332021,4.55569e-8]},{ColorSpace:"Lab",Name:"erdc_iceFire_L",RGBPoints:[-1,.870485,.913768,.832905,-.87451,.586919,.887865,.934003,-.74902,.31583,.776442,.867858,-.623529,.18302,.632034,.787722,-.498039,.117909,.484134,.713825,-.372549,.0507239,.335979,.654741,-.247059,0,.209874,.511832,-.121569,0,.114689,.28935,.00392157,.0157519,.00332021,4.55569e-8,.129412,.312914,0,0,.254902,.520865,0,0,.380392,.680105,.15255,.0025996,.505882,.785109,.339479,797922e-9,.631373,.857354,.522494,0,.756863,.910974,.699774,0,.882353,.951921,.842817,.478545,1,.881371,.912178,.818099]},{ColorSpace:"RGB",Name:"hsv",RGBPoints:[-1,1,0,0,-.666666,1,0,1,-.333333,0,0,1,0,0,1,1,.33333,0,1,0,.66666,1,1,0,1,1,0,0]},{ColorSpace:"Lab",Name:"hue_L60",RGBPoints:[-1,.964784,.400592,.349549,-.87451,.964915,.372498,.53785,-.74902,.892353,.401039,.759569,-.623529,.79263,.446956,.903017,-.498039,.682208,.49954,.966673,-.372549,.56392,.553082,.968836,-.247059,.442031,.606396,.901601,-.121569,.305499,.65701,.765784,.00392157,.197251,.687914,.620914,.129412,.193882,.701887,.472654,.254902,.249866,.706123,.320005,.380392,.35132,.697417,.202919,.505882,.498097,.669467,.125232,.631373,.637477,.626239,.107431,.756863,.762115,.56872,.155812,.882353,.889434,.481116,.240445,1,.964784,.400592,.349549]},{IndexedColors:[0,0,0,.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,.6509803921568628,.3372549019607843,.1568627450980392],Name:"Spectrum",NanColor:[.6509803921568628,.3372549019607843,.1568627450980392]},{IndexedColors:[.4745098039215686,.09019607843137255,.09019607843137255,.7098039215686275,.00392156862745098,.00392156862745098,.9372549019607843,.2784313725490196,.09803921568627451,.9764705882352941,.5137254901960784,.1411764705882353,1,.7058823529411765,0,1,.8980392156862745,.02352941176470588],Name:"Warm",NanColor:[1,.8980392156862745,.02352941176470588]},{IndexedColors:[.4588235294117647,.6941176470588235,.00392156862745098,.3450980392156863,.5019607843137255,.1607843137254902,.3137254901960784,.8431372549019608,.7490196078431373,.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.6039215686274509,.407843137254902,1,.3725490196078431,.2,.5019607843137255],Name:"Cool",NanColor:[.3725490196078431,.2,.5019607843137255]},{IndexedColors:[.2313725490196079,.407843137254902,.6705882352941176,.1098039215686274,.5843137254901961,.803921568627451,.3058823529411765,.8509803921568627,.9176470588235294,.4509803921568628,.6039215686274509,.8352941176470589,.2588235294117647,.2392156862745098,.6627450980392157,.3137254901960784,.3294117647058823,.5294117647058824,.06274509803921569,.1647058823529412,.3215686274509804],Name:"Blues",NanColor:[.06274509803921569,.1647058823529412,.3215686274509804]},{IndexedColors:[.1098039215686274,.5843137254901961,.803921568627451,.2313725490196079,.407843137254902,.6705882352941176,.4,.2431372549019608,.7176470588235294,.6352941176470588,.3294117647058823,.8117647058823529,.8705882352941177,.3803921568627451,.807843137254902,.8627450980392157,.3803921568627451,.5843137254901961,.2392156862745098,.06274509803921569,.3215686274509804],Name:"Wild Flower",NanColor:[.2392156862745098,.06274509803921569,.3215686274509804]},{IndexedColors:[.396078431372549,.4862745098039216,.2156862745098039,.4588235294117647,.6941176470588235,.00392156862745098,.6980392156862745,.7294117647058823,.1882352941176471,1,.8980392156862745,.02352941176470588,1,.7058823529411765,0,.9764705882352941,.5137254901960784,.1411764705882353],Name:"Citrus",NanColor:[.9764705882352941,.5137254901960784,.1411764705882353]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (11)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.4980392156862745,.2313725490196079,.03137254901960784,.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333,.1764705882352941,0,.2941176470588235],Name:"Brewer Diverging Purple-Orange (10)",NanColor:[.1764705882352941,0,.2941176470588235]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (9)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.8784313725490196,.5098039215686274,.0784313725490196,.9921568627450981,.7215686274509804,.3882352941176471,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6980392156862745,.6705882352941176,.8235294117647058,.5019607843137255,.4509803921568628,.6745098039215687,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (8)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.9686274509803922,.9686274509803922,.9686274509803922,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (7)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.7019607843137254,.3450980392156863,.02352941176470588,.9450980392156862,.6392156862745098,.2509803921568627,.996078431372549,.8784313725490196,.7137254901960784,.8470588235294118,.8549019607843137,.9215686274509803,.6,.5568627450980392,.7647058823529411,.3294117647058823,.1529411764705882,.5333333333333333],Name:"Brewer Diverging Purple-Orange (6)",NanColor:[.3294117647058823,.1529411764705882,.5333333333333333]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.9686274509803922,.9686274509803922,.9686274509803922,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (5)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9019607843137255,.3803921568627451,.00392156862745098,.9921568627450981,.7215686274509804,.3882352941176471,.6980392156862745,.6705882352941176,.8235294117647058,.3686274509803922,.2352941176470588,.6],Name:"Brewer Diverging Purple-Orange (4)",NanColor:[.3686274509803922,.2352941176470588,.6]},{IndexedColors:[.9450980392156862,.6392156862745098,.2509803921568627,.9686274509803922,.9686274509803922,.9686274509803922,.6,.5568627450980392,.7647058823529411],Name:"Brewer Diverging Purple-Orange (3)",NanColor:[.6,.5568627450980392,.7647058823529411]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (11)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.6196078431372549,.00392156862745098,.2588235294117647,.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353,.3686274509803922,.3098039215686275,.6352941176470588],Name:"Brewer Diverging Spectral (10)",NanColor:[.3686274509803922,.3098039215686275,.6352941176470588]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (9)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9568627450980393,.4274509803921568,.2627450980392157,.9921568627450981,.6823529411764706,.3803921568627451,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6705882352941176,.8666666666666667,.6431372549019608,.4,.7607843137254902,.6470588235294118,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (8)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,1,1,.7490196078431373,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (7)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8352941176470589,.2431372549019608,.3098039215686275,.9882352941176471,.5529411764705883,.3490196078431372,.996078431372549,.8784313725490196,.5450980392156862,.9019607843137255,.9607843137254902,.596078431372549,.6,.8352941176470589,.5803921568627451,.196078431372549,.5333333333333333,.7411764705882353],Name:"Brewer Diverging Spectral (6)",NanColor:[.196078431372549,.5333333333333333,.7411764705882353]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,1,1,.7490196078431373,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (5)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.8431372549019608,.09803921568627451,.1098039215686274,.9921568627450981,.6823529411764706,.3803921568627451,.6705882352941176,.8666666666666667,.6431372549019608,.1686274509803922,.5137254901960784,.7294117647058823],Name:"Brewer Diverging Spectral (4)",NanColor:[.1686274509803922,.5137254901960784,.7294117647058823]},{IndexedColors:[.9882352941176471,.5529411764705883,.3490196078431372,1,1,.7490196078431373,.6,.8352941176470589,.5803921568627451],Name:"Brewer Diverging Spectral (3)",NanColor:[.6,.8352941176470589,.5803921568627451]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (11)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.3294117647058823,.1882352941176471,.0196078431372549,.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922,0,.2352941176470588,.1882352941176471],Name:"Brewer Diverging Brown-Blue-Green (10)",NanColor:[0,.2352941176470588,.1882352941176471]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (9)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.7490196078431373,.5058823529411764,.1764705882352941,.8745098039215686,.7607843137254902,.4901960784313725,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.5019607843137255,.803921568627451,.7568627450980392,.207843137254902,.592156862745098,.5607843137254902,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (8)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.9607843137254902,.9607843137254902,.9607843137254902,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (7)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.5490196078431373,.3176470588235294,.0392156862745098,.8470588235294118,.7019607843137254,.396078431372549,.9647058823529412,.9098039215686274,.7647058823529411,.7803921568627451,.9176470588235294,.8980392156862745,.3529411764705883,.7058823529411765,.6745098039215687,.00392156862745098,.4,.3686274509803922],Name:"Brewer Diverging Brown-Blue-Green (6)",NanColor:[.00392156862745098,.4,.3686274509803922]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.9607843137254902,.9607843137254902,.9607843137254902,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (5)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.6509803921568628,.3803921568627451,.1019607843137255,.8745098039215686,.7607843137254902,.4901960784313725,.5019607843137255,.803921568627451,.7568627450980392,.00392156862745098,.5215686274509804,.4431372549019608],Name:"Brewer Diverging Brown-Blue-Green (4)",NanColor:[.00392156862745098,.5215686274509804,.4431372549019608]},{IndexedColors:[.8470588235294118,.7019607843137254,.396078431372549,.9607843137254902,.9607843137254902,.9607843137254902,.3529411764705883,.7058823529411765,.6745098039215687],Name:"Brewer Diverging Brown-Blue-Green (3)",NanColor:[.3529411764705883,.7058823529411765,.6745098039215687]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.4274509803921568,.1725490196078431,0,.2666666666666667,.1058823529411765],Name:"Brewer Sequential Blue-Green (9)",NanColor:[0,.2666666666666667,.1058823529411765]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8980392156862745,.9607843137254902,.9764705882352941,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (8)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.8,.9254901960784314,.9019607843137255,.4,.7607843137254902,.6431372549019608,.2549019607843137,.6823529411764706,.4627450980392157,.1372549019607843,.5450980392156862,.2705882352941176,0,.3450980392156863,.1411764705882353],Name:"Brewer Sequential Blue-Green (7)",NanColor:[0,.3450980392156863,.1411764705882353]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.8,.9254901960784314,.9019607843137255,.6,.8470588235294118,.788235294117647,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (6)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1725490196078431,.6352941176470588,.3725490196078431,0,.4274509803921568,.1725490196078431],Name:"Brewer Sequential Blue-Green (5)",NanColor:[0,.4274509803921568,.1725490196078431]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.6980392156862745,.8862745098039215,.8862745098039215,.4,.7607843137254902,.6431372549019608,.1372549019607843,.5450980392156862,.2705882352941176],Name:"Brewer Sequential Blue-Green (4)",NanColor:[.1372549019607843,.5450980392156862,.2705882352941176]},{IndexedColors:[.8980392156862745,.9607843137254902,.9764705882352941,.6,.8470588235294118,.788235294117647,.1725490196078431,.6352941176470588,.3725490196078431],Name:"Brewer Sequential Blue-Green (3)",NanColor:[.1725490196078431,.6352941176470588,.3725490196078431]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.6,.203921568627451,.01568627450980392,.4,.1450980392156863,.02352941176470588],Name:"Brewer Sequential Yellow-Orange-Brown (9)",NanColor:[.4,.1450980392156863,.02352941176470588]},{IndexedColors:[1,1,.8980392156862745,1,.9686274509803922,.7372549019607844,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (8)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.9254901960784314,.4392156862745098,.0784313725490196,.8,.2980392156862745,.00784313725490196,.5490196078431373,.1764705882352941,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (7)",NanColor:[.5490196078431373,.1764705882352941,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8901960784313725,.5686274509803921,.996078431372549,.7686274509803922,.3098039215686275,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (6)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8509803921568627,.3725490196078431,.05490196078431372,.6,.203921568627451,.01568627450980392],Name:"Brewer Sequential Yellow-Orange-Brown (5)",NanColor:[.6,.203921568627451,.01568627450980392]},{IndexedColors:[1,1,.8313725490196079,.996078431372549,.8509803921568627,.5568627450980392,.996078431372549,.6,.1607843137254902,.8,.2980392156862745,.00784313725490196],Name:"Brewer Sequential Yellow-Orange-Brown (4)",NanColor:[.8,.2980392156862745,.00784313725490196]},{IndexedColors:[1,.9686274509803922,.7372549019607844,.996078431372549,.7686274509803922,.3098039215686275,.8509803921568627,.3725490196078431,.05490196078431372],Name:"Brewer Sequential Yellow-Orange-Brown (3)",NanColor:[.8509803921568627,.3725490196078431,.05490196078431372]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.5058823529411764,.05882352941176471,.4862745098039216,.3019607843137255,0,.2941176470588235],Name:"Brewer Sequential Blue-Purple (9)",NanColor:[.3019607843137255,0,.2941176470588235]},{IndexedColors:[.9686274509803922,.9882352941176471,.9921568627450981,.8784313725490196,.9254901960784314,.9568627450980393,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (8)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5490196078431373,.4196078431372549,.6941176470588235,.5333333333333333,.2549019607843137,.615686274509804,.4313725490196079,.00392156862745098,.4196078431372549],Name:"Brewer Sequential Blue-Purple (7)",NanColor:[.4313725490196079,.00392156862745098,.4196078431372549]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7490196078431373,.8274509803921568,.9019607843137255,.6196078431372549,.7372549019607844,.8549019607843137,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (6)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.3372549019607843,.6549019607843137,.5058823529411764,.05882352941176471,.4862745098039216],Name:"Brewer Sequential Blue-Purple (5)",NanColor:[.5058823529411764,.05882352941176471,.4862745098039216]},{IndexedColors:[.9294117647058824,.9725490196078431,.984313725490196,.7019607843137254,.803921568627451,.8901960784313725,.5490196078431373,.5882352941176471,.7764705882352941,.5333333333333333,.2549019607843137,.615686274509804],Name:"Brewer Sequential Blue-Purple (4)",NanColor:[.5333333333333333,.2549019607843137,.615686274509804]},{IndexedColors:[.8784313725490196,.9254901960784314,.9568627450980393,.6196078431372549,.7372549019607844,.8549019607843137,.5333333333333333,.3372549019607843,.6549019607843137],Name:"Brewer Sequential Blue-Purple (3)",NanColor:[.5333333333333333,.3372549019607843,.6549019607843137]},{IndexedColors:[.4980392156862745,.788235294117647,.4980392156862745,.7450980392156863,.6823529411764706,.8313725490196079,.9921568627450981,.7529411764705882,.5254901960784314,1,1,.6,.2196078431372549,.4235294117647059,.6901960784313725,.9411764705882353,.00784313725490196,.4980392156862745,.7490196078431373,.3568627450980392,.09019607843137255,.4,.4,.4],Name:"Brewer Qualitative Accent",NanColor:[.4,.4,.4]},{IndexedColors:[.1058823529411765,.6196078431372549,.4666666666666667,.8509803921568627,.3725490196078431,.00784313725490196,.4588235294117647,.4392156862745098,.7019607843137254,.9058823529411765,.1607843137254902,.5411764705882353,.4,.6509803921568628,.1176470588235294,.9019607843137255,.6705882352941176,.00784313725490196,.6509803921568628,.4627450980392157,.1137254901960784,.4,.4,.4],Name:"Brewer Qualitative Dark2",NanColor:[.4,.4,.4]},{IndexedColors:[.4,.7607843137254902,.6470588235294118,.9882352941176471,.5529411764705883,.3843137254901961,.5529411764705883,.6274509803921569,.796078431372549,.9058823529411765,.5411764705882353,.7647058823529411,.6509803921568628,.8470588235294118,.3294117647058823,1,.8509803921568627,.1843137254901961,.8980392156862745,.7686274509803922,.5803921568627451,.7019607843137254,.7019607843137254,.7019607843137254],Name:"Brewer Qualitative Set2",NanColor:[.7019607843137254,.7019607843137254,.7019607843137254]},{IndexedColors:[.7019607843137254,.8862745098039215,.803921568627451,.9921568627450981,.803921568627451,.6745098039215687,.796078431372549,.8352941176470589,.9098039215686274,.9568627450980393,.792156862745098,.8941176470588236,.9019607843137255,.9607843137254902,.788235294117647,1,.9490196078431372,.6823529411764706,.9450980392156862,.8862745098039215,.8,.8,.8,.8],Name:"Brewer Qualitative Pastel2",NanColor:[.8,.8,.8]},{IndexedColors:[.984313725490196,.7058823529411765,.6823529411764706,.7019607843137254,.803921568627451,.8901960784313725,.8,.9215686274509803,.7725490196078432,.8705882352941177,.796078431372549,.8941176470588236,.996078431372549,.8509803921568627,.6509803921568628,1,1,.8,.8980392156862745,.8470588235294118,.7411764705882353,.9921568627450981,.8549019607843137,.9254901960784314,.9490196078431372,.9490196078431372,.9490196078431372],Name:"Brewer Qualitative Pastel1",NanColor:[.9490196078431372,.9490196078431372,.9490196078431372]},{IndexedColors:[.8941176470588236,.1019607843137255,.1098039215686274,.2156862745098039,.4941176470588236,.7215686274509804,.3019607843137255,.6862745098039216,.2901960784313726,.596078431372549,.3058823529411765,.6392156862745098,1,.4980392156862745,0,1,1,.2,.6509803921568628,.3372549019607843,.1568627450980392,.9686274509803922,.5058823529411764,.7490196078431373,.6,.6,.6],Name:"Brewer Qualitative Set1",NanColor:[.6,.6,.6]},{IndexedColors:[.6509803921568628,.807843137254902,.8901960784313725,.1215686274509804,.4705882352941176,.7058823529411765,.6980392156862745,.8745098039215686,.5411764705882353,.2,.6274509803921569,.1725490196078431,.984313725490196,.6039215686274509,.6,.8901960784313725,.1019607843137255,.1098039215686274,.9921568627450981,.7490196078431373,.4352941176470588,1,.4980392156862745,0,.792156862745098,.6980392156862745,.8392156862745098,.4156862745098039,.2392156862745098,.6039215686274509,1,1,.6],Name:"Brewer Qualitative Paired",NanColor:[1,1,.6]},{IndexedColors:[.5529411764705883,.8274509803921568,.7803921568627451,1,1,.7019607843137254,.7450980392156863,.7294117647058823,.8549019607843137,.984313725490196,.5019607843137255,.4470588235294118,.5019607843137255,.6941176470588235,.8274509803921568,.9921568627450981,.7058823529411765,.3843137254901961,.7019607843137254,.8705882352941177,.4117647058823529,.9882352941176471,.803921568627451,.8980392156862745,.8509803921568627,.8509803921568627,.8509803921568627,.7372549019607844,.5019607843137255,.7411764705882353,.8,.9215686274509803,.7725490196078432,1,.9294117647058824,.4352941176470588],Name:"Brewer Qualitative Set3",NanColor:[1,.9294117647058824,.4352941176470588]},{IndexedColors:[1,0,0,1,.862745,0,0,.695201,0],Name:"Traffic Lights",NanColor:[.803922,0,.803922]},{IndexedColors:[.908659,.604013,.581857,1,.862745,0,0,.695201,0],Name:"Traffic Lights For Deuteranopes",NanColor:[.803922,0,.803922]},{IndexedColors:[.4196078431372549,0,.07058823529411765,.9019607843137255,.9411764705882353,.0196078431372549,.01568627450980392,.6196078431372549,.00784313725490196],Name:"Traffic Lights For Deuteranopes 2",NanColor:[.803922,0,.803922]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Muted Blue-Green",NanColor:[.25,0,0],RGBPoints:[0,.109804,.27451,.301961,.02,.129412,.309804,.341176,.05,.14902,.341176,.380392,.1,.188235,.403922,.458824,.15,.227451,.447059,.521569,.2,.290196,.494118,.588235,.25,.368627,.552941,.670588,.3,.458824,.619608,.74902,.35,.588235,.713725,.85098,.4,.72549,.815686,.941176,.45,.831373,.882353,.980392,.475,.909804,.933333,1,.5,.980392,.984314,1,.5,.996078,1,.94902,.5,1,1,.980392,.5,.980392,.984314,1,.525,.972549,.988235,.890196,.55,.917647,.960784,.835294,.6,.835294,.921569,.772549,.65,.768627,.901961,.737255,.7,.670588,.831373,.654902,.75,.576471,.760784,.584314,.8,.498039,.678431,.521569,.85,.392157,.560784,.427451,.9,.294118,.45098,.333333,.95,.211765,.34902,.254902,1,.152941,.278431,.196078]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Green-Blue Asymmetric Divergent (62Blbc)",NanColor:[.25,0,0],RGBPoints:[0,.121569,.2,.145098,.05,.196078,.301961,.223529,.1,.258824,.4,.278431,.2,.341176,.54902,.341176,.25,.419608,.619608,.376471,.3,.545098,.701961,.392157,.35,.643137,.780392,.403922,.4,.729412,.819608,.45098,.45,.811765,.870588,.521569,.5,.898039,.909804,.564706,.55,.941176,.92549,.686275,.6,.960784,.94902,.776471,.64,1,1,1,.65,.890196,.988235,.972549,.7,.721569,.894118,.901961,.75,.631373,.823529,.839216,.8,.517647,.662745,.701961,.85,.384314,.494118,.54902,.9,.298039,.360784,.45098,.95,.223529,.25098,.34902,.99,.156863,.172549,.25098,1,.137255,.137255,.188235]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Asymmtrical Earth Tones (6_21b)",NanColor:[.25,0,0],RGBPoints:[0,.141176,.14902,.2,.05,.215686,.258824,.321569,.1,.243137,.368627,.380392,.15,.27451,.439216,.4,.2,.32549,.501961,.384314,.25,.403922,.6,.419608,.3,.486275,.701961,.454902,.35,.556863,.74902,.494118,.4,.670588,.8,.545098,.5,.854902,.901961,.631373,.55,.92549,.941176,.694118,.6,.960784,.94902,.776471,.65,.988235,.968627,.909804,.7,.839216,.815686,.772549,.75,.701961,.662745,.615686,.8,.6,.529412,.478431,.85,.501961,.403922,.360784,.9,.439216,.313725,.290196,1,.301961,.164706,.176471]},{ColorSpace:"Lab",Creator:"Francesca Samsel",Name:"Yellow 15",NanColor:[.25,0,0],RGBPoints:[0,1,1,.988235,.002,1,1,.988235,.05,.984314,.988235,.843137,.1,.988235,.988235,.741176,.15,.980392,.968627,.654902,.2,.980392,.945098,.576471,.25,.968627,.905882,.486275,.3,.968627,.862745,.388235,.35,.960784,.803922,.286275,.4,.94902,.741176,.219608,.45,.941176,.678431,.14902,.5,.929412,.607843,.094118,.55,.921569,.545098,.054902,.6,.909804,.486275,.035294,.65,.890196,.411765,.019608,.7,.8,.305882,0,.75,.760784,.239216,0,.8,.678431,.180392,.011765,.85,.6,.121569,.023529,.9,.501961,.054902,.031373,.95,.4,.039216,.058824,1,.301961,.047059,.090196]},{ColorSpace:"Diverging",Name:"Magma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002258,.001295,.018331,.007843,.003279,.002305,.023708,.011765,.004512,.00349,.029965,.015686,.00595,.004843,.03713,.019608,.007588,.006356,.044973,.023529,.009426,.008022,.052844,.027451,.011465,.009828,.06075,.031373,.013708,.011771,.068667,.035294,.016156,.01384,.076603,.039216,.018815,.016026,.084584,.043137,.021692,.01832,.09261,.047059,.024792,.020715,.100676,.05098,.028123,.023201,.108787,.054902,.031696,.025765,.116965,.058824,.03552,.028397,.125209,.062745,.039608,.03109,.133515,.066667,.04383,.03383,.141886,.070588,.048062,.036607,.150327,.07451,.05232,.039407,.158841,.078431,.056615,.04216,.167446,.082353,.060949,.044794,.176129,.086275,.06533,.047318,.184892,.090196,.069764,.049726,.193735,.094118,.074257,.052017,.20266,.098039,.078815,.054184,.211667,.101961,.083446,.056225,.220755,.105882,.088155,.058133,.229922,.109804,.092949,.059904,.239164,.113725,.097833,.061531,.248477,.117647,.102815,.06301,.257854,.121569,.107899,.064335,.267289,.12549,.113094,.065492,.276784,.129412,.118405,.066479,.286321,.133333,.123833,.067295,.295879,.137255,.12938,.067935,.305443,.141176,.135053,.068391,.315,.145098,.140858,.068654,.324538,.14902,.146785,.068738,.334011,.152941,.152839,.068637,.343404,.156863,.159018,.068354,.352688,.160784,.165308,.067911,.361816,.164706,.171713,.067305,.370771,.168627,.178212,.066576,.379497,.172549,.184801,.065732,.387973,.176471,.19146,.064818,.396152,.180392,.198177,.063862,.404009,.184314,.204935,.062907,.411514,.188235,.211718,.061992,.418647,.192157,.218512,.061158,.425392,.196078,.225302,.060445,.431742,.2,.232077,.059889,.437695,.203922,.238826,.059517,.443256,.207843,.245543,.059352,.448436,.211765,.25222,.059415,.453248,.215686,.258857,.059706,.45771,.219608,.265447,.060237,.46184,.223529,.271994,.060994,.46566,.227451,.278493,.061978,.46919,.231373,.284951,.063168,.472451,.235294,.291366,.064553,.475462,.239216,.29774,.066117,.478243,.243137,.304081,.067835,.480812,.247059,.310382,.069702,.483186,.25098,.316654,.07169,.48538,.254902,.322899,.073782,.487408,.258824,.329114,.075972,.489287,.262745,.335308,.078236,.491024,.266667,.341482,.080564,.492631,.270588,.347636,.082946,.494121,.27451,.353773,.085373,.495501,.278431,.359898,.087831,.496778,.282353,.366012,.090314,.49796,.286275,.372116,.092816,.499053,.290196,.378211,.095332,.500067,.294118,.384299,.097855,.501002,.298039,.390384,.100379,.501864,.301961,.396467,.102902,.502658,.305882,.402548,.10542,.503386,.309804,.408629,.10793,.504052,.313725,.414709,.110431,.504662,.317647,.420791,.11292,.505215,.321569,.426877,.115395,.505714,.32549,.432967,.117855,.50616,.329412,.439062,.120298,.506555,.333333,.445163,.122724,.506901,.337255,.451271,.125132,.507198,.341176,.457386,.127522,.507448,.345098,.463508,.129893,.507652,.34902,.46964,.132245,.507809,.352941,.47578,.134577,.507921,.356863,.481929,.136891,.507989,.360784,.488088,.139186,.508011,.364706,.494258,.141462,.507988,.368627,.500438,.143719,.50792,.372549,.506629,.145958,.507806,.376471,.512831,.148179,.507648,.380392,.519045,.150383,.507443,.384314,.52527,.152569,.507192,.388235,.531507,.154739,.506895,.392157,.537755,.156894,.506551,.396078,.544015,.159033,.506159,.4,.550287,.161158,.505719,.403922,.556571,.163269,.50523,.407843,.562866,.165368,.504692,.411765,.569172,.167454,.504105,.415686,.57549,.16953,.503466,.419608,.581819,.171596,.502777,.423529,.588158,.173652,.502035,.427451,.594508,.175701,.501241,.431373,.600868,.177743,.500394,.435294,.607238,.179779,.499492,.439216,.613617,.181811,.498536,.443137,.620005,.18384,.497524,.447059,.626401,.185867,.496456,.45098,.632805,.187893,.495332,.454902,.639216,.189921,.49415,.458824,.645633,.191952,.49291,.462745,.652056,.193986,.491611,.466667,.658483,.196027,.490253,.470588,.664915,.198075,.488836,.47451,.671349,.200133,.487358,.478431,.677786,.202203,.485819,.482353,.684224,.204286,.484219,.486275,.690661,.206384,.482558,.490196,.697098,.208501,.480835,.494118,.703532,.210638,.479049,.498039,.709962,.212797,.477201,.501961,.716387,.214982,.47529,.505882,.722805,.217194,.473316,.509804,.729216,.219437,.471279,.513725,.735616,.221713,.46918,.517647,.742004,.224025,.467018,.521569,.748378,.226377,.464794,.52549,.754737,.228772,.462509,.529412,.761077,.231214,.460162,.533333,.767398,.233705,.457755,.537255,.773695,.236249,.455289,.541176,.779968,.238851,.452765,.545098,.786212,.241514,.450184,.54902,.792427,.244242,.447543,.552941,.798608,.24704,.444848,.556863,.804752,.249911,.442102,.560784,.810855,.252861,.439305,.564706,.816914,.255895,.436461,.568627,.822926,.259016,.433573,.572549,.828886,.262229,.430644,.576471,.834791,.26554,.427671,.580392,.840636,.268953,.424666,.584314,.846416,.272473,.421631,.588235,.852126,.276106,.418573,.592157,.857763,.279857,.415496,.596078,.86332,.283729,.412403,.6,.868793,.287728,.409303,.603922,.874176,.291859,.406205,.607843,.879464,.296125,.403118,.611765,.884651,.30053,.400047,.615686,.889731,.305079,.397002,.619608,.8947,.309773,.393995,.623529,.899552,.314616,.391037,.627451,.904281,.31961,.388137,.631373,.908884,.324755,.385308,.635294,.913354,.330052,.382563,.639216,.917689,.3355,.379915,.643137,.921884,.341098,.377376,.647059,.925937,.346844,.374959,.65098,.929845,.352734,.372677,.654902,.933606,.358764,.370541,.658824,.937221,.364929,.368567,.662745,.940687,.371224,.366762,.666667,.944006,.377643,.365136,.670588,.94718,.384178,.363701,.67451,.95021,.39082,.362468,.678431,.953099,.397563,.361438,.682353,.955849,.4044,.360619,.686275,.958464,.411324,.360014,.690196,.960949,.418323,.35963,.694118,.96331,.42539,.359469,.698039,.965549,.432519,.359529,.701961,.967671,.439703,.35981,.705882,.96968,.446936,.360311,.709804,.971582,.45421,.36103,.713725,.973381,.46152,.361965,.717647,.975082,.468861,.363111,.721569,.97669,.476226,.364466,.72549,.97821,.483612,.366025,.729412,.979645,.491014,.367783,.733333,.981,.498428,.369734,.737255,.982279,.505851,.371874,.741176,.983485,.51328,.374198,.745098,.984622,.520713,.376698,.74902,.985693,.528148,.379371,.752941,.9867,.535582,.38221,.756863,.987646,.543015,.38521,.760784,.988533,.550446,.388365,.764706,.989363,.557873,.391671,.768627,.990138,.565296,.395122,.772549,.990871,.572706,.398714,.776471,.991558,.580107,.402441,.780392,.992196,.587502,.406299,.784314,.992785,.594891,.410283,.788235,.993326,.602275,.41439,.792157,.993834,.609644,.418613,.796078,.994309,.616999,.42295,.8,.994738,.62435,.427397,.803922,.995122,.631696,.431951,.807843,.99548,.639027,.436607,.811765,.99581,.646344,.441361,.815686,.996096,.653659,.446213,.819608,.996341,.660969,.45116,.823529,.99658,.668256,.456192,.827451,.996775,.675541,.461314,.831373,.996925,.682828,.466526,.835294,.997077,.690088,.471811,.839216,.997186,.697349,.477182,.843137,.997254,.704611,.482635,.847059,.997325,.711848,.488154,.85098,.997351,.719089,.493755,.854902,.997351,.726324,.499428,.858824,.997341,.733545,.505167,.862745,.997285,.740772,.510983,.866667,.997228,.747981,.516859,.870588,.997138,.75519,.522806,.87451,.997019,.762398,.528821,.878431,.996898,.769591,.534892,.882353,.996727,.776795,.541039,.886275,.996571,.783977,.547233,.890196,.996369,.791167,.553499,.894118,.996162,.798348,.55982,.898039,.995932,.805527,.566202,.901961,.99568,.812706,.572645,.905882,.995424,.819875,.57914,.909804,.995131,.827052,.585701,.913725,.994851,.834213,.592307,.917647,.994524,.841387,.598983,.921569,.994222,.84854,.605696,.92549,.993866,.855711,.612482,.929412,.993545,.862859,.619299,.933333,.99317,.870024,.626189,.937255,.992831,.877168,.633109,.941176,.99244,.88433,.640099,.945098,.992089,.89147,.647116,.94902,.991688,.898627,.654202,.952941,.991332,.905763,.661309,.956863,.99093,.912915,.668481,.960784,.99057,.920049,.675675,.964706,.990175,.927196,.682926,.968627,.989815,.934329,.690198,.972549,.989434,.94147,.697519,.976471,.989077,.948604,.704863,.980392,.988717,.955742,.712242,.984314,.988367,.962878,.719649,.988235,.988033,.970012,.727077,.992157,.987691,.977154,.734536,.996078,.987387,.984288,.742002,1,.987053,.991438,.749504]},{ColorSpace:"Diverging",Name:"Inferno (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.001462,466e-6,.013866,.003922,.002267,.00127,.01857,.007843,.003299,.002249,.024239,.011765,.004547,.003392,.030909,.015686,.006006,.004692,.038558,.019608,.007676,.006136,.046836,.023529,.009561,.007713,.055143,.027451,.011663,.009417,.06346,.031373,.013995,.011225,.071862,.035294,.016561,.013136,.080282,.039216,.019373,.015133,.088767,.043137,.022447,.017199,.097327,.047059,.025793,.019331,.10593,.05098,.029432,.021503,.114621,.054902,.033385,.023702,.123397,.058824,.037668,.025921,.132232,.062745,.042253,.028139,.141141,.066667,.046915,.030324,.150164,.070588,.051644,.032474,.159254,.07451,.056449,.034569,.168414,.078431,.06134,.03659,.177642,.082353,.066331,.038504,.186962,.086275,.071429,.040294,.196354,.090196,.076637,.041905,.205799,.094118,.081962,.043328,.215289,.098039,.087411,.044556,.224813,.101961,.09299,.045583,.234358,.105882,.098702,.046402,.243904,.109804,.104551,.047008,.25343,.113725,.110536,.047399,.262912,.117647,.116656,.047574,.272321,.121569,.122908,.047536,.281624,.12549,.129285,.047293,.290788,.129412,.135778,.046856,.299776,.133333,.142378,.046242,.308553,.137255,.149073,.045468,.317085,.141176,.15585,.044559,.325338,.145098,.162689,.043554,.333277,.14902,.169575,.042489,.340874,.152941,.176493,.041402,.348111,.156863,.183429,.040329,.354971,.160784,.190367,.039309,.361447,.164706,.197297,.0384,.367535,.168627,.204209,.037632,.373238,.172549,.211095,.03703,.378563,.176471,.217949,.036615,.383522,.180392,.224763,.036405,.388129,.184314,.231538,.036405,.3924,.188235,.238273,.036621,.396353,.192157,.244967,.037055,.400007,.196078,.25162,.037705,.403378,.2,.258234,.038571,.406485,.203922,.26481,.039647,.409345,.207843,.271347,.040922,.411976,.211765,.27785,.042353,.414392,.215686,.284321,.043933,.416608,.219608,.290763,.045644,.418637,.223529,.297178,.04747,.420491,.227451,.303568,.049396,.422182,.231373,.309935,.051407,.423721,.235294,.316282,.05349,.425116,.239216,.32261,.055634,.426377,.243137,.328921,.057827,.427511,.247059,.335217,.06006,.428524,.25098,.3415,.062325,.429425,.254902,.347771,.064616,.430217,.258824,.354032,.066925,.430906,.262745,.360284,.069247,.431497,.266667,.366529,.071579,.431994,.270588,.372768,.073915,.4324,.27451,.379001,.076253,.432719,.278431,.385228,.078591,.432955,.282353,.391453,.080927,.433109,.286275,.397674,.083257,.433183,.290196,.403894,.08558,.433179,.294118,.410113,.087896,.433098,.298039,.416331,.090203,.432943,.301961,.422549,.092501,.432714,.305882,.428768,.09479,.432412,.309804,.434987,.097069,.432039,.313725,.441207,.099338,.431594,.317647,.447428,.101597,.43108,.321569,.453651,.103848,.430498,.32549,.459875,.106089,.429846,.329412,.4661,.108322,.429125,.333333,.472328,.110547,.428334,.337255,.478558,.112764,.427475,.341176,.484789,.114974,.426548,.345098,.491022,.117179,.425552,.34902,.497257,.119379,.424488,.352941,.503493,.121575,.423356,.356863,.50973,.123769,.422156,.360784,.515967,.12596,.420887,.364706,.522206,.12815,.419549,.368627,.528444,.130341,.418142,.372549,.534683,.132534,.416667,.376471,.54092,.134729,.415123,.380392,.547157,.136929,.413511,.384314,.553392,.139134,.411829,.388235,.559624,.141346,.410078,.392157,.565854,.143567,.408258,.396078,.572081,.145797,.406369,.4,.578304,.148039,.404411,.403922,.584521,.150294,.402385,.407843,.590734,.152563,.40029,.411765,.59694,.154848,.398125,.415686,.603139,.157151,.395891,.419608,.60933,.159474,.393589,.423529,.615513,.161817,.391219,.427451,.621685,.164184,.388781,.431373,.627847,.166575,.386276,.435294,.633998,.168992,.383704,.439216,.640135,.171438,.381065,.443137,.64626,.173914,.378359,.447059,.652369,.176421,.375586,.45098,.658463,.178962,.372748,.454902,.66454,.181539,.369846,.458824,.670599,.184153,.366879,.462745,.676638,.186807,.363849,.466667,.682656,.189501,.360757,.470588,.688653,.192239,.357603,.47451,.694627,.195021,.354388,.478431,.700576,.197851,.351113,.482353,.7065,.200728,.347777,.486275,.712396,.203656,.344383,.490196,.718264,.206636,.340931,.494118,.724103,.20967,.337424,.498039,.729909,.212759,.333861,.501961,.735683,.215906,.330245,.505882,.741423,.219112,.326576,.509804,.747127,.222378,.322856,.513725,.752794,.225706,.319085,.517647,.758422,.229097,.315266,.521569,.76401,.232554,.311399,.52549,.769556,.236077,.307485,.529412,.775059,.239667,.303526,.533333,.780517,.243327,.299523,.537255,.785929,.247056,.295477,.541176,.791293,.250856,.29139,.545098,.796607,.254728,.287264,.54902,.801871,.258674,.283099,.552941,.807082,.262692,.278898,.556863,.812239,.266786,.274661,.560784,.817341,.270954,.27039,.564706,.822386,.275197,.266085,.568627,.827372,.279517,.26175,.572549,.832299,.283913,.257383,.576471,.837165,.288385,.252988,.580392,.841969,.292933,.248564,.584314,.846709,.297559,.244113,.588235,.851384,.30226,.239636,.592157,.855992,.307038,.235133,.596078,.860533,.311892,.230606,.6,.865006,.316822,.226055,.603922,.869409,.321827,.221482,.607843,.873741,.326906,.216886,.611765,.878001,.33206,.212268,.615686,.882188,.337287,.207628,.619608,.886302,.342586,.202968,.623529,.890341,.347957,.198286,.627451,.894305,.353399,.193584,.631373,.898192,.358911,.18886,.635294,.902003,.364492,.184116,.639216,.905735,.37014,.17935,.643137,.90939,.375856,.174563,.647059,.912966,.381636,.169755,.65098,.916462,.387481,.164924,.654902,.919879,.393389,.16007,.658824,.923215,.399359,.155193,.662745,.92647,.405389,.150292,.666667,.929644,.411479,.145367,.670588,.932737,.417627,.140417,.67451,.935747,.423831,.13544,.678431,.938675,.430091,.130438,.682353,.941521,.436405,.125409,.686275,.944285,.442772,.120354,.690196,.946965,.449191,.115272,.694118,.949562,.45566,.110164,.698039,.952075,.462178,.105031,.701961,.954506,.468744,.099874,.705882,.956852,.475356,.094695,.709804,.959114,.482014,.089499,.713725,.961293,.488716,.084289,.717647,.963387,.495462,.079073,.721569,.965397,.502249,.073859,.72549,.967322,.509078,.068659,.729412,.969163,.515946,.063488,.733333,.970919,.522853,.058367,.737255,.97259,.529798,.053324,.741176,.974176,.53678,.048392,.745098,.975677,.543798,.043618,.74902,.977092,.55085,.03905,.752941,.978422,.557937,.034931,.756863,.979666,.565057,.031409,.760784,.980824,.572209,.028508,.764706,.981895,.579392,.02625,.768627,.982881,.586606,.024661,.772549,.983779,.593849,.02377,.776471,.984591,.601122,.023606,.780392,.985315,.608422,.024202,.784314,.985952,.61575,.025592,.788235,.986502,.623105,.027814,.792157,.986964,.630485,.030908,.796078,.987337,.63789,.034916,.8,.987622,.64532,.039886,.803922,.987819,.652773,.045581,.807843,.987926,.66025,.05175,.811765,.987945,.667748,.058329,.815686,.987874,.675267,.065257,.819608,.987714,.682807,.072489,.823529,.987464,.690366,.07999,.827451,.987124,.697944,.087731,.831373,.986694,.70554,.095694,.835294,.986175,.713153,.103863,.839216,.985566,.720782,.112229,.843137,.984865,.728427,.120785,.847059,.984075,.736087,.129527,.85098,.983196,.743758,.138453,.854902,.982228,.751442,.147565,.858824,.981173,.759135,.156863,.862745,.980032,.766837,.166353,.866667,.978806,.774545,.176037,.870588,.977497,.782258,.185923,.87451,.976108,.789974,.196018,.878431,.974638,.797692,.206332,.882353,.973088,.805409,.216877,.886275,.971468,.813122,.227658,.890196,.969783,.820825,.238686,.894118,.968041,.828515,.249972,.898039,.966243,.836191,.261534,.901961,.964394,.843848,.273391,.905882,.962517,.851476,.285546,.909804,.960626,.859069,.29801,.913725,.95872,.866624,.31082,.917647,.956834,.874129,.323974,.921569,.954997,.881569,.337475,.92549,.953215,.888942,.351369,.929412,.951546,.896226,.365627,.933333,.950018,.903409,.380271,.937255,.948683,.910473,.395289,.941176,.947594,.917399,.410665,.945098,.946809,.924168,.426373,.94902,.946392,.930761,.442367,.952941,.946403,.937159,.458592,.956863,.946903,.943348,.47497,.960784,.947937,.949318,.491426,.964706,.949545,.955063,.50786,.968627,.95174,.960587,.524203,.972549,.954529,.965896,.540361,.976471,.957896,.971003,.556275,.980392,.961812,.975924,.571925,.984314,.966249,.980678,.587206,.988235,.971162,.985282,.602154,.992157,.976511,.989753,.61676,.996078,.982257,.994109,.631017,1,.988362,.998364,.644924]},{ColorSpace:"Diverging",Name:"Plasma (matplotlib)",NanColor:[0,1,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Nathaniel J. Smith & Stefan van der Walt",RGBPoints:[0,.050383,.029803,.527975,.003922,.063536,.028426,.533124,.007843,.075353,.027206,.538007,.011765,.086222,.026125,.542658,.015686,.096379,.025165,.547103,.019608,.10598,.024309,.551368,.023529,.115124,.023556,.555468,.027451,.123903,.022878,.559423,.031373,.132381,.022258,.56325,.035294,.140603,.021687,.566959,.039216,.148607,.021154,.570562,.043137,.156421,.020651,.574065,.047059,.16407,.020171,.577478,.05098,.171574,.019706,.580806,.054902,.17895,.019252,.584054,.058824,.186213,.018803,.587228,.062745,.193374,.018354,.59033,.066667,.200445,.017902,.593364,.070588,.207435,.017442,.596333,.07451,.21435,.016973,.599239,.078431,.221197,.016497,.602083,.082353,.227983,.016007,.604867,.086275,.234715,.015502,.607592,.090196,.241396,.014979,.610259,.094118,.248032,.014439,.612868,.098039,.254627,.013882,.615419,.101961,.261183,.013308,.617911,.105882,.267703,.012716,.620346,.109804,.274191,.012109,.622722,.113725,.280648,.011488,.625038,.117647,.287076,.010855,.627295,.121569,.293478,.010213,.62949,.12549,.299855,.009561,.631624,.129412,.30621,.008902,.633694,.133333,.312543,.008239,.6357,.137255,.318856,.007576,.63764,.141176,.32515,.006915,.639512,.145098,.331426,.006261,.641316,.14902,.337683,.005618,.643049,.152941,.343925,.004991,.64471,.156863,.35015,.004382,.646298,.160784,.356359,.003798,.64781,.164706,.362553,.003243,.649245,.168627,.368733,.002724,.650601,.172549,.374897,.002245,.651876,.176471,.381047,.001814,.653068,.180392,.387183,.001434,.654177,.184314,.393304,.001114,.655199,.188235,.399411,859e-6,.656133,.192157,.405503,678e-6,.656977,.196078,.41158,577e-6,.65773,.2,.417642,564e-6,.65839,.203922,.423689,646e-6,.658956,.207843,.429719,831e-6,.659425,.211765,.435734,.001127,.659797,.215686,.441732,.00154,.660069,.219608,.447714,.00208,.66024,.223529,.453677,.002755,.66031,.227451,.459623,.003574,.660277,.231373,.46555,.004545,.660139,.235294,.471457,.005678,.659897,.239216,.477344,.00698,.659549,.243137,.48321,.00846,.659095,.247059,.489055,.010127,.658534,.25098,.494877,.01199,.657865,.254902,.500678,.014055,.657088,.258824,.506454,.016333,.656202,.262745,.512206,.018833,.655209,.266667,.517933,.021563,.654109,.270588,.523633,.024532,.652901,.27451,.529306,.027747,.651586,.278431,.534952,.031217,.650165,.282353,.54057,.03495,.64864,.286275,.546157,.038954,.64701,.290196,.551715,.043136,.645277,.294118,.557243,.047331,.643443,.298039,.562738,.051545,.641509,.301961,.568201,.055778,.639477,.305882,.573632,.060028,.637349,.309804,.579029,.064296,.635126,.313725,.584391,.068579,.632812,.317647,.589719,.072878,.630408,.321569,.595011,.07719,.627917,.32549,.600266,.081516,.625342,.329412,.605485,.085854,.622686,.333333,.610667,.090204,.619951,.337255,.615812,.094564,.61714,.341176,.620919,.098934,.614257,.345098,.625987,.103312,.611305,.34902,.631017,.107699,.608287,.352941,.636008,.112092,.605205,.356863,.640959,.116492,.602065,.360784,.645872,.120898,.598867,.364706,.650746,.125309,.595617,.368627,.65558,.129725,.592317,.372549,.660374,.134144,.588971,.376471,.665129,.138566,.585582,.380392,.669845,.142992,.582154,.384314,.674522,.147419,.578688,.388235,.67916,.151848,.575189,.392157,.683758,.156278,.57166,.396078,.688318,.160709,.568103,.4,.69284,.165141,.564522,.403922,.697324,.169573,.560919,.407843,.701769,.174005,.557296,.411765,.706178,.178437,.553657,.415686,.710549,.182868,.550004,.419608,.714883,.187299,.546338,.423529,.719181,.191729,.542663,.427451,.723444,.196158,.538981,.431373,.72767,.200586,.535293,.435294,.731862,.205013,.531601,.439216,.736019,.209439,.527908,.443137,.740143,.213864,.524216,.447059,.744232,.218288,.520524,.45098,.748289,.222711,.516834,.454902,.752312,.227133,.513149,.458824,.756304,.231555,.509468,.462745,.760264,.235976,.505794,.466667,.764193,.240396,.502126,.470588,.76809,.244817,.498465,.47451,.771958,.249237,.494813,.478431,.775796,.253658,.491171,.482353,.779604,.258078,.487539,.486275,.783383,.2625,.483918,.490196,.787133,.266922,.480307,.494118,.790855,.271345,.476706,.498039,.794549,.27577,.473117,.501961,.798216,.280197,.469538,.505882,.801855,.284626,.465971,.509804,.805467,.289057,.462415,.513725,.809052,.293491,.45887,.517647,.812612,.297928,.455338,.521569,.816144,.302368,.451816,.52549,.819651,.306812,.448306,.529412,.823132,.311261,.444806,.533333,.826588,.315714,.441316,.537255,.830018,.320172,.437836,.541176,.833422,.324635,.434366,.545098,.836801,.329105,.430905,.54902,.840155,.33358,.427455,.552941,.843484,.338062,.424013,.556863,.846788,.342551,.420579,.560784,.850066,.347048,.417153,.564706,.853319,.351553,.413734,.568627,.856547,.356066,.410322,.572549,.85975,.360588,.406917,.576471,.862927,.365119,.403519,.580392,.866078,.36966,.400126,.584314,.869203,.374212,.396738,.588235,.872303,.378774,.393355,.592157,.875376,.383347,.389976,.596078,.878423,.387932,.3866,.6,.881443,.392529,.383229,.603922,.884436,.397139,.37986,.607843,.887402,.401762,.376494,.611765,.89034,.406398,.37313,.615686,.89325,.411048,.369768,.619608,.896131,.415712,.366407,.623529,.898984,.420392,.363047,.627451,.901807,.425087,.359688,.631373,.904601,.429797,.356329,.635294,.907365,.434524,.35297,.639216,.910098,.439268,.34961,.643137,.9128,.444029,.346251,.647059,.915471,.448807,.34289,.65098,.918109,.453603,.339529,.654902,.920714,.458417,.336166,.658824,.923287,.463251,.332801,.662745,.925825,.468103,.329435,.666667,.928329,.472975,.326067,.670588,.930798,.477867,.322697,.67451,.933232,.48278,.319325,.678431,.93563,.487712,.315952,.682353,.93799,.492667,.312575,.686275,.940313,.497642,.309197,.690196,.942598,.502639,.305816,.694118,.944844,.507658,.302433,.698039,.947051,.512699,.299049,.701961,.949217,.517763,.295662,.705882,.951344,.52285,.292275,.709804,.953428,.52796,.288883,.713725,.95547,.533093,.28549,.717647,.957469,.53825,.282096,.721569,.959424,.543431,.278701,.72549,.961336,.548636,.275305,.729412,.963203,.553865,.271909,.733333,.965024,.559118,.268513,.737255,.966798,.564396,.265118,.741176,.968526,.5697,.261721,.745098,.970205,.575028,.258325,.74902,.971835,.580382,.254931,.752941,.973416,.585761,.25154,.756863,.974947,.591165,.248151,.760784,.976428,.596595,.244767,.764706,.977856,.602051,.241387,.768627,.979233,.607532,.238013,.772549,.980556,.613039,.234646,.776471,.981826,.618572,.231287,.780392,.983041,.624131,.227937,.784314,.984199,.629718,.224595,.788235,.985301,.63533,.221265,.792157,.986345,.640969,.217948,.796078,.987332,.646633,.214648,.8,.98826,.652325,.211364,.803922,.989128,.658043,.2081,.807843,.989935,.663787,.204859,.811765,.990681,.669558,.201642,.815686,.991365,.675355,.198453,.819608,.991985,.681179,.195295,.823529,.992541,.68703,.19217,.827451,.993032,.692907,.189084,.831373,.993456,.69881,.186041,.835294,.993814,.704741,.183043,.839216,.994103,.710698,.180097,.843137,.994324,.716681,.177208,.847059,.994474,.722691,.174381,.85098,.994553,.728728,.171622,.854902,.994561,.734791,.168938,.858824,.994495,.74088,.166335,.862745,.994355,.746995,.163821,.866667,.994141,.753137,.161404,.870588,.993851,.759304,.159092,.87451,.993482,.765499,.156891,.878431,.993033,.77172,.154808,.882353,.992505,.777967,.152855,.886275,.991897,.784239,.151042,.890196,.991209,.790537,.149377,.894118,.990439,.796859,.14787,.898039,.989587,.803205,.146529,.901961,.988648,.809579,.145357,.905882,.987621,.815978,.144363,.909804,.986509,.822401,.143557,.913725,.985314,.828846,.142945,.917647,.984031,.835315,.142528,.921569,.982653,.841812,.142303,.92549,.98119,.848329,.142279,.929412,.979644,.854866,.142453,.933333,.977995,.861432,.142808,.937255,.976265,.868016,.143351,.941176,.974443,.874622,.144061,.945098,.97253,.88125,.144923,.94902,.970533,.887896,.145919,.952941,.968443,.894564,.147014,.956863,.966271,.901249,.14818,.960784,.964021,.90795,.14937,.964706,.961681,.914672,.15052,.968627,.959276,.921407,.151566,.972549,.956808,.928152,.152409,.976471,.954287,.934908,.152921,.980392,.951726,.941671,.152925,.984314,.949151,.948435,.152178,.988235,.946602,.95519,.150328,.992157,.944152,.961916,.146861,.996078,.941896,.96859,.140956,1,.940015,.975158,.131326]},{ColorSpace:"Diverging",Name:"Viridis (matplotlib)",NanColor:[1,0,0],Source:"https://github.com/BIDS/colormap/blob/master/colormaps.py",License:"CC0",Creator:"Eric Firing",RGBPoints:[0,.267004,.004874,.329415,.003922,.26851,.009605,.335427,.007843,.269944,.014625,.341379,.011765,.271305,.019942,.347269,.015686,.272594,.025563,.353093,.019608,.273809,.031497,.358853,.023529,.274952,.037752,.364543,.027451,.276022,.044167,.370164,.031373,.277018,.050344,.375715,.035294,.277941,.056324,.381191,.039216,.278791,.062145,.386592,.043137,.279566,.067836,.391917,.047059,.280267,.073417,.397163,.05098,.280894,.078907,.402329,.054902,.281446,.08432,.407414,.058824,.281924,.089666,.412415,.062745,.282327,.094955,.417331,.066667,.282656,.100196,.42216,.070588,.28291,.105393,.426902,.07451,.283091,.110553,.431554,.078431,.283197,.11568,.436115,.082353,.283229,.120777,.440584,.086275,.283187,.125848,.44496,.090196,.283072,.130895,.449241,.094118,.282884,.13592,.453427,.098039,.282623,.140926,.457517,.101961,.28229,.145912,.46151,.105882,.281887,.150881,.465405,.109804,.281412,.155834,.469201,.113725,.280868,.160771,.472899,.117647,.280255,.165693,.476498,.121569,.279574,.170599,.479997,.12549,.278826,.17549,.483397,.129412,.278012,.180367,.486697,.133333,.277134,.185228,.489898,.137255,.276194,.190074,.493001,.141176,.275191,.194905,.496005,.145098,.274128,.199721,.498911,.14902,.273006,.20452,.501721,.152941,.271828,.209303,.504434,.156863,.270595,.214069,.507052,.160784,.269308,.218818,.509577,.164706,.267968,.223549,.512008,.168627,.26658,.228262,.514349,.172549,.265145,.232956,.516599,.176471,.263663,.237631,.518762,.180392,.262138,.242286,.520837,.184314,.260571,.246922,.522828,.188235,.258965,.251537,.524736,.192157,.257322,.25613,.526563,.196078,.255645,.260703,.528312,.2,.253935,.265254,.529983,.203922,.252194,.269783,.531579,.207843,.250425,.27429,.533103,.211765,.248629,.278775,.534556,.215686,.246811,.283237,.535941,.219608,.244972,.287675,.53726,.223529,.243113,.292092,.538516,.227451,.241237,.296485,.539709,.231373,.239346,.300855,.540844,.235294,.237441,.305202,.541921,.239216,.235526,.309527,.542944,.243137,.233603,.313828,.543914,.247059,.231674,.318106,.544834,.25098,.229739,.322361,.545706,.254902,.227802,.326594,.546532,.258824,.225863,.330805,.547314,.262745,.223925,.334994,.548053,.266667,.221989,.339161,.548752,.270588,.220057,.343307,.549413,.27451,.21813,.347432,.550038,.278431,.21621,.351535,.550627,.282353,.214298,.355619,.551184,.286275,.212395,.359683,.55171,.290196,.210503,.363727,.552206,.294118,.208623,.367752,.552675,.298039,.206756,.371758,.553117,.301961,.204903,.375746,.553533,.305882,.203063,.379716,.553925,.309804,.201239,.38367,.554294,.313725,.19943,.387607,.554642,.317647,.197636,.391528,.554969,.321569,.19586,.395433,.555276,.32549,.1941,.399323,.555565,.329412,.192357,.403199,.555836,.333333,.190631,.407061,.556089,.337255,.188923,.41091,.556326,.341176,.187231,.414746,.556547,.345098,.185556,.41857,.556753,.34902,.183898,.422383,.556944,.352941,.182256,.426184,.55712,.356863,.180629,.429975,.557282,.360784,.179019,.433756,.55743,.364706,.177423,.437527,.557565,.368627,.175841,.44129,.557685,.372549,.174274,.445044,.557792,.376471,.172719,.448791,.557885,.380392,.171176,.45253,.557965,.384314,.169646,.456262,.55803,.388235,.168126,.459988,.558082,.392157,.166617,.463708,.558119,.396078,.165117,.467423,.558141,.4,.163625,.471133,.558148,.403922,.162142,.474838,.55814,.407843,.160665,.47854,.558115,.411765,.159194,.482237,.558073,.415686,.157729,.485932,.558013,.419608,.15627,.489624,.557936,.423529,.154815,.493313,.55784,.427451,.153364,.497,.557724,.431373,.151918,.500685,.557587,.435294,.150476,.504369,.55743,.439216,.149039,.508051,.55725,.443137,.147607,.511733,.557049,.447059,.14618,.515413,.556823,.45098,.144759,.519093,.556572,.454902,.143343,.522773,.556295,.458824,.141935,.526453,.555991,.462745,.140536,.530132,.555659,.466667,.139147,.533812,.555298,.470588,.13777,.537492,.554906,.47451,.136408,.541173,.554483,.478431,.135066,.544853,.554029,.482353,.133743,.548535,.553541,.486275,.132444,.552216,.553018,.490196,.131172,.555899,.552459,.494118,.129933,.559582,.551864,.498039,.128729,.563265,.551229,.501961,.127568,.566949,.550556,.505882,.126453,.570633,.549841,.509804,.125394,.574318,.549086,.513725,.124395,.578002,.548287,.517647,.123463,.581687,.547445,.521569,.122606,.585371,.546557,.52549,.121831,.589055,.545623,.529412,.121148,.592739,.544641,.533333,.120565,.596422,.543611,.537255,.120092,.600104,.54253,.541176,.119738,.603785,.5414,.545098,.119512,.607464,.540218,.54902,.119423,.611141,.538982,.552941,.119483,.614817,.537692,.556863,.119699,.61849,.536347,.560784,.120081,.622161,.534946,.564706,.120638,.625828,.533488,.568627,.12138,.629492,.531973,.572549,.122312,.633153,.530398,.576471,.123444,.636809,.528763,.580392,.12478,.640461,.527068,.584314,.126326,.644107,.525311,.588235,.128087,.647749,.523491,.592157,.130067,.651384,.521608,.596078,.132268,.655014,.519661,.6,.134692,.658636,.517649,.603922,.137339,.662252,.515571,.607843,.14021,.665859,.513427,.611765,.143303,.669459,.511215,.615686,.146616,.67305,.508936,.619608,.150148,.676631,.506589,.623529,.153894,.680203,.504172,.627451,.157851,.683765,.501686,.631373,.162016,.687316,.499129,.635294,.166383,.690856,.496502,.639216,.170948,.694384,.493803,.643137,.175707,.6979,.491033,.647059,.180653,.701402,.488189,.65098,.185783,.704891,.485273,.654902,.19109,.708366,.482284,.658824,.196571,.711827,.479221,.662745,.202219,.715272,.476084,.666667,.20803,.718701,.472873,.670588,.214,.722114,.469588,.67451,.220124,.725509,.466226,.678431,.226397,.728888,.462789,.682353,.232815,.732247,.459277,.686275,.239374,.735588,.455688,.690196,.24607,.73891,.452024,.694118,.252899,.742211,.448284,.698039,.259857,.745492,.444467,.701961,.266941,.748751,.440573,.705882,.274149,.751988,.436601,.709804,.281477,.755203,.432552,.713725,.288921,.758394,.428426,.717647,.296479,.761561,.424223,.721569,.304148,.764704,.419943,.72549,.311925,.767822,.415586,.729412,.319809,.770914,.411152,.733333,.327796,.77398,.40664,.737255,.335885,.777018,.402049,.741176,.344074,.780029,.397381,.745098,.35236,.783011,.392636,.74902,.360741,.785964,.387814,.752941,.369214,.788888,.382914,.756863,.377779,.791781,.377939,.760784,.386433,.794644,.372886,.764706,.395174,.797475,.367757,.768627,.404001,.800275,.362552,.772549,.412913,.803041,.357269,.776471,.421908,.805774,.35191,.780392,.430983,.808473,.346476,.784314,.440137,.811138,.340967,.788235,.449368,.813768,.335384,.792157,.458674,.816363,.329727,.796078,.468053,.818921,.323998,.8,.477504,.821444,.318195,.803922,.487026,.823929,.312321,.807843,.496615,.826376,.306377,.811765,.506271,.828786,.300362,.815686,.515992,.831158,.294279,.819608,.525776,.833491,.288127,.823529,.535621,.835785,.281908,.827451,.545524,.838039,.275626,.831373,.555484,.840254,.269281,.835294,.565498,.84243,.262877,.839216,.575563,.844566,.256415,.843137,.585678,.846661,.249897,.847059,.595839,.848717,.243329,.85098,.606045,.850733,.236712,.854902,.616293,.852709,.230052,.858824,.626579,.854645,.223353,.862745,.636902,.856542,.21662,.866667,.647257,.8584,.209861,.870588,.657642,.860219,.203082,.87451,.668054,.861999,.196293,.878431,.678489,.863742,.189503,.882353,.688944,.865448,.182725,.886275,.699415,.867117,.175971,.890196,.709898,.868751,.169257,.894118,.720391,.87035,.162603,.898039,.730889,.871916,.156029,.901961,.741388,.873449,.149561,.905882,.751884,.874951,.143228,.909804,.762373,.876424,.137064,.913725,.772852,.877868,.131109,.917647,.783315,.879285,.125405,.921569,.79376,.880678,.120005,.92549,.804182,.882046,.114965,.929412,.814576,.883393,.110347,.933333,.82494,.88472,.106217,.937255,.83527,.886029,.102646,.941176,.845561,.887322,.099702,.945098,.85581,.888601,.097452,.94902,.866013,.889868,.095953,.952941,.876168,.891125,.09525,.956863,.886271,.892374,.095374,.960784,.89632,.893616,.096335,.964706,.906311,.894855,.098125,.968627,.916242,.896091,.100717,.972549,.926106,.89733,.104071,.976471,.935904,.89857,.108131,.980392,.945636,.899815,.112838,.984314,.9553,.901065,.118128,.988235,.964894,.902323,.123941,.992157,.974417,.90359,.130215,.996078,.983868,.904867,.136897,1,.993248,.906157,.143936]},{ShowIndexedColorActiveValues:1,IndexedColors:[.07,.5,.7,1,1,1,.85,1,1,.8,.5,1,.76,1,0,1,.71,.71,.5,.5,.5,.05,.05,1,1,.05,.05,.7,1,1,.7,.89,.96,.67,.36,.95,.54,1,0,.75,.65,.65,.5,.6,.6,1,.5,0,1,1,.19,.12,.94,.12,.5,.82,.89,.56,.25,.83,.24,1,0,.9,.9,.9,.75,.76,.78,.65,.65,.67,.54,.6,.78,.61,.48,.78,.5,.48,.78,.44,.48,.78,.36,.48,.76,1,.48,.38,.49,.5,.69,.76,.56,.56,.4,.56,.56,.74,.5,.89,1,.63,0,.65,.16,.16,.36,.72,.82,.44,.18,.69,0,1,0,.58,1,1,.58,.88,.88,.45,.76,.79,.33,.71,.71,.23,.62,.62,.14,.56,.56,.04,.49,.55,0,.41,.52,.88,.88,1,1,.85,.56,.65,.46,.45,.4,.5,.5,.62,.39,.71,.83,.48,0,.58,0,.58,.26,.62,.69,.34,.09,.56,0,.79,0,.44,.83,1,1,1,.78,.85,1,.78,.78,1,.78,.64,1,.78,.56,1,.78,.38,1,.78,.27,1,.78,.19,1,.78,.12,1,.78,0,1,.61,0,.9,.46,0,.83,.32,0,.75,.22,0,.67,.14,.3,.76,1,.3,.65,1,.13,.58,.84,.15,.49,.67,.15,.4,.59,.09,.33,.53,.96,.93,.82,.8,.82,.12,.71,.71,.76,.65,.33,.3,.34,.35,.38,.62,.31,.71,.67,.36,0,.46,.31,.27,.26,.51,.59,.26,0,.4,0,.49,0,.44,.67,.98,0,.73,1,0,.63,1,0,.56,1,0,.5,1,0,.42,1,.33,.36,.95,.47,.36,.89,.54,.31,.89,.63,.21,.83,.7,.12,.83,.7,.12,.73,.7,.05,.65,.74,.05,.53,.78,0,.4,.8,0,.35,.82,0,.31,.85,0,.27,.88,0,.22,.9,0,.18,.91,0,.15,.92,0,.14,.93,0,.13,.94,0,.12,.95,0,.11,.96,0,.1,.97,0,.09,.98,0,.08,.99,0,.07,1,0,.06],Annotations:[0,"Xx",1,"H",2,"He",3,"Li",4,"Be",5,"B",6,"C",7,"N",8,"O",9,"F",10,"Ne",11,"Na",12,"Mg",13,"Al",14,"Si",15,"P",16,"S",17,"Cl",18,"Ar",19,"K",20,"Ca",21,"Sc",22,"Ti",23,"V",24,"Cr",25,"Mn",26,"Fe",27,"Co",28,"Ni",29,"Cu",30,"Zn",31,"Ga",32,"Ge",33,"As",34,"Se",35,"Br",36,"Kr",37,"Rb",38,"Sr",39,"Y",40,"Zr",41,"Nb",42,"Mo",43,"Tc",44,"Ru",45,"Rh",46,"Pd",47,"Ag",48,"Cd",49,"In",50,"Sn",51,"Sb",52,"Te",53,"I",54,"Xe",55,"Cs",56,"Ba",57,"La",58,"Ce",59,"Pr",60,"Nd",61,"Pm",62,"Sm",63,"Eu",64,"Gd",65,"Tb",66,"Dy",67,"Ho",68,"Er",69,"Tm",70,"Yb",71,"Lu",72,"Hf",73,"Ta",74,"W",75,"Re",76,"Os",77,"Ir",78,"Pt",79,"Au",80,"Hg",81,"Tl",82,"Pb",83,"Bi",84,"Po",85,"At",86,"Rn",87,"Fr",88,"Ra",89,"Ac",90,"Th",91,"Pa",92,"U",93,"Np",94,"Pu",95,"Am",96,"Cm",97,"Bk",98,"Cf",99,"Es",100,"Fm",101,"Md",102,"No",103,"Lr",104,"Rf",105,"Db",106,"Sg",107,"Bh",108,"Hs",109,"Mt",110,"Ds",111,"Rg",112,"Cn",113,"Uut",114,"Uuq",115,"Uup",116,"Uuh",117,"Uus",118,"Uuo"],Name:"BlueObeliskElements"}].filter(e=>e.RGBPoints).filter(e=>"CIELAB"!==e.ColorSpace).forEach(e=>{X_[e.Name]=e});const $_=Object.keys(X_);$_.sort();var q_={addPreset:function(e){e.RGBPoints&&"CIELAB"!==e.ColorSpace&&(X_[e.Name]||($_.push(e.Name),$_.sort()),X_[e.Name]=e)},removePresetByName:function(e){const t=$_.indexOf(e);t>-1&&$_.splice(t,1),delete X_[e]},getPresetByName:function(e){return X_[e]},rgbPresetNames:$_};e=r.hmd(e),console.log("[VTK Bundle] GLTFImporter included in bundle");var Y_={Rendering:{Core:{vtkActor:ss,vtkMapper:Gl,vtkTexture:vc,vtkProperty:os,vtkAnnotatedCubeActor:vv,vtkCamera:Lh,vtkRenderWindow:nm,vtkRenderWindowInteractor:xm,vtkRenderer:Jh,vtkColorTransferFunction:K_},Misc:{vtkFullScreenRenderWindow:Zy},OpenGL:{vtkRenderWindow:Hg}},Interaction:{Style:{vtkInteractorStyleTrackballCamera:Fm},Widgets:{vtkOrientationMarkerWidget:Tv}},IO:{Geometry:{vtkSTLReader:Hv,vtkPLYReader:ob,vtkGLTFImporter:f_},Misc:{vtkOBJReader:pb},XML:{vtkXMLPolyDataReader:gx}},Filters:{Core:{vtkPolyDataNormals:vx,vtkCutter:v_},General:{vtkWindowedSincPolyDataFilter:__,vtkOutlineFilter:E_},Sources:{vtkConeSource:I_,vtkSphereSource:M_,vtkCubeSource:uv}},Common:{Core:{vtkDataArray:_s},DataModel:{vtkPlane:ea}},_gltfAvailable:!0};K_.vtkColorMaps=q_,e.exports&&(e.exports=Y_),"undefined"!=typeof window&&(window.vtk=Y_),void 0!==r.g&&(r.g.vtk=Y_);const J_=Y_},41(e,t,r){"use strict";var n=r(655),o=r(68),i=r(675),a=r(795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],d=!!a&&a(e,t);if(n)n(e,t,{configurable:null===u&&d?d.configurable:!u,enumerable:null===s&&d?d.enumerable:!s,value:r,writable:null===l&&d?d.writable:!l});else{if(!c&&(s||l||u))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},452(e,t,r){"use strict";var n=r(189),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(41),l=r(592)(),u=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;l?s(e,t,r,!0):s(e,t,r)},c=function(e,t){var r=arguments.length>2?arguments[2]:{},i=n(t);o&&(i=a.call(i,Object.getOwnPropertySymbols(t)));for(var s=0;s<i.length;s+=1)u(e,i[s],t[i[s]],r[i[s]])};c.supportsDescriptors=!!l,e.exports=c},655(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},68(e){"use strict";e.exports=SyntaxError},675(e){"use strict";e.exports=TypeError},17(e){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!==o--;){var a=i[o];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},820(e){"use strict";"undefined"!=typeof self?e.exports=self:"undefined"!=typeof window?e.exports=window:e.exports=Function("return this")()},170(e,t,r){"use strict";var n=r(452),o=r(820),i=r(323),a=r(61),s=i(),l=function(){return s};n(l,{getPolyfill:i,implementation:o,shim:a}),e.exports=l},323(e,t,r){"use strict";var n=r(820);e.exports=function(){return"object"==typeof r.g&&r.g&&r.g.Math===Math&&r.g.Array===Array?r.g:n}},61(e,t,r){"use strict";var n=r(452),o=r(323);e.exports=function(){var e=o();if(n.supportsDescriptors){var t=Object.getOwnPropertyDescriptor(e,"globalThis");t&&(!t.configurable||!t.enumerable&&t.writable&&globalThis===e)||Object.defineProperty(e,"globalThis",{configurable:!0,enumerable:!1,value:e,writable:!0})}else"object"==typeof globalThis&&globalThis===e||(e.globalThis=e);return e}},549(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},795(e,t,r){"use strict";var n=r(549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},592(e,t,r){"use strict";var n=r(655),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},875(e,t,r){"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(93),s=Object.prototype.propertyIsEnumerable,l=!s.call({toString:null},"toString"),u=s.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!p["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),n=a(e),s=t&&"[object String]"===i.call(e),p=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var h=u&&r;if(s&&e.length>0&&!o.call(e,0))for(var m=0;m<e.length;++m)p.push(String(m));if(n&&e.length>0)for(var g=0;g<e.length;++g)p.push(String(g));else for(var y in e)h&&"prototype"===y||!o.call(e,y)||p.push(String(y));if(l)for(var v=function(e){if("undefined"==typeof window||!f)return d(e);try{return d(e)}catch(e){return!1}}(e),b=0;b<c.length;++b)v&&"constructor"===c[b]||!o.call(e,c[b])||p.push(c[b]);return p}}e.exports=n},189(e,t,r){"use strict";var n=Array.prototype.slice,o=r(93),i=Object.keys,a=i?function(e){return i(e)}:r(875),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return o(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},93(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},391(e,t,r){var n=r(180),o=r(181),i=r(31),a=r(67),s=r(833),l=r(717),u=r(801);u.alea=n,u.xor128=o,u.xorwow=i,u.xorshift7=a,u.xor4096=s,u.tychei=l,e.exports=u},180(e,t,r){var n;!function(e,o){function i(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function s(e,t){var r=new i(e),n=t&&t.state,o=r.next;return o.int32=function(){return 4294967296*r.next()|0},o.double=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.quick=o,n&&("object"==typeof n&&a(n,r),o.state=function(){return a(r,{})}),o}o&&o.exports?o.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,o))||(o.exports=n):this.alea=s}(0,e=r.nmd(e),r.amdD)},717(e,t,r){var n;!function(e,o){function i(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,o=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=0|r.charCodeAt(n),t.next()}function a(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function s(e,t){var r=new i(e),n=t&&t.state,o=function(){return(r.next()>>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,n&&("object"==typeof n&&a(n,r),o.state=function(){return a(r,{})}),o}o&&o.exports?o.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,o))||(o.exports=n):this.tychei=s}(0,e=r.nmd(e),r.amdD)},181(e,t,r){var n;!function(e,o){function i(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function s(e,t){var r=new i(e),n=t&&t.state,o=function(){return(r.next()>>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,n&&("object"==typeof n&&a(n,r),o.state=function(){return a(r,{})}),o}o&&o.exports?o.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,o))||(o.exports=n):this.xor128=s}(0,e=r.nmd(e),r.amdD)},833(e,t,r){var n;!function(e,o){function i(e){var t=this;t.next=function(){var e,r,n=t.w,o=t.X,i=t.i;return t.w=n=n+1640531527|0,r=o[i+34&127],e=o[i=i+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=o[i]=r^e,t.i=i,r+(n^n>>>16)|0},function(e,t){var r,n,o,i,a,s=[],l=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,l=Math.max(l,t.length)),o=0,i=-32;i<l;++i)t&&(n^=t.charCodeAt((i+32)%t.length)),0===i&&(a=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,i>=0&&(a=a+1640531527|0,o=0==(r=s[127&i]^=n+a)?o+1:0);for(o>=128&&(s[127&(t&&t.length||0)]=-1),o=127,i=512;i>0;--i)n=s[o+34&127],r=s[o=o+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,s[o]=n^r;e.w=a,e.X=s,e.i=o}(t,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,o=function(){return(r.next()>>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,n&&(n.X&&a(n,r),o.state=function(){return a(r,{})}),o}o&&o.exports?o.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,o))||(o.exports=n):this.xor4096=s}(0,e=r.nmd(e),r.amdD)},67(e,t,r){var n;!function(e,o){function i(e){var t=this;t.next=function(){var e,r,n=t.x,o=t.i;return e=n[o],r=(e^=e>>>7)^e<<24,r^=(e=n[o+1&7])^e>>>10,r^=(e=n[o+3&7])^e>>>3,r^=(e=n[o+4&7])^e<<7,e=n[o+7&7],r^=(e^=e<<13)^e<<9,n[o]=r,t.i=o+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r<t.length;++r)n[7&r]=n[7&r]<<15^t.charCodeAt(r)+n[r+1&7]<<13;for(;n.length<8;)n.push(0);for(r=0;r<8&&0===n[r];++r);for(8==r?n[7]=-1:n[r],e.x=n,e.i=0,r=256;r>0;--r)e.next()}(t,e)}function a(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var r=new i(e),n=t&&t.state,o=function(){return(r.next()>>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,n&&(n.x&&a(n,r),o.state=function(){return a(r,{})}),o}o&&o.exports?o.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,o))||(o.exports=n):this.xorshift7=s}(0,e=r.nmd(e),r.amdD)},31(e,t,r){var n;!function(e,o){function i(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var r=new i(e),n=t&&t.state,o=function(){return(r.next()>>>0)/4294967296};return o.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=r.next,o.quick=o,n&&("object"==typeof n&&a(n,r),o.state=function(){return a(r,{})}),o}o&&o.exports?o.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,o))||(o.exports=n):this.xorwow=s}(0,e=r.nmd(e),r.amdD)},801(e,t,r){var n;!function(o,i,a){var s,l=256,u=a.pow(l,6),c=a.pow(2,52),d=2*c,p=255;function f(e,t,r){var n=[],p=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,v(i)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(o.crypto||o.msCrypto).getRandomValues(e)),v(e)}catch(e){var t=o.navigator,r=t&&t.plugins;return[+new Date,o,r,o.screen,v(i)]}}():e,3),n),f=new h(n),b=function(){for(var e=f.g(6),t=u,r=0;e<c;)e=(e+r)*l,t*=l,r=f.g(1);for(;e>=d;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|f.g(4)},b.quick=function(){return f.g(4)/4294967296},b.double=b,y(v(f.S),i),(t.pass||r||function(e,t,r,n){return n&&(n.S&&m(n,f),e.state=function(){return m(f,{})}),r?(a.random=e,t):e})(b,p,"global"in t?t.global:this==a,t.state)}function h(e){var t,r=e.length,n=this,o=0,i=n.i=n.j=0,a=n.S=[];for(r||(e=[r++]);o<l;)a[o]=o++;for(o=0;o<l;o++)a[o]=a[i=p&i+e[o%r]+(t=a[o])],a[i]=t;(n.g=function(e){for(var t,r=0,o=n.i,i=n.j,a=n.S;e--;)t=a[o=p&o+1],r=r*l+a[p&(a[o]=a[i=p&i+t])+(a[i]=t)];return n.i=o,n.j=i,r})(l)}function m(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var r,n=[],o=typeof e;if(t&&"object"==o)for(r in e)try{n.push(g(e[r],t-1))}catch(e){}return n.length?n:"string"==o?e:e+"\0"}function y(e,t){for(var r,n=e+"",o=0;o<n.length;)t[p&o]=p&(r^=19*t[p&o])+n.charCodeAt(o++);return v(t)}function v(e){return String.fromCharCode.apply(0,e)}if(y(a.random(),i),e.exports){e.exports=f;try{s=r(234)}catch(e){}}else void 0===(n=function(){return f}.call(t,r,t,e))||(e.exports=n)}("undefined"!=typeof self?self:this,[],Math)},735(e){e.exports=function(){"use strict";var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function t(e,t){var r=e[0],n=e[1],o=e[2],i=e[3];n=((n+=((o=((o+=((i=((i+=((r=((r+=(n&o|~n&i)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&o)+t[1]-389564586|0)<<12|i>>>20)+r|0)&r|~i&n)+t[2]+606105819|0)<<17|o>>>15)+i|0)&i|~o&r)+t[3]-1044525330|0)<<22|n>>>10)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n&o|~n&i)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&o)+t[5]+1200080426|0)<<12|i>>>20)+r|0)&r|~i&n)+t[6]-1473231341|0)<<17|o>>>15)+i|0)&i|~o&r)+t[7]-45705983|0)<<22|n>>>10)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n&o|~n&i)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&o)+t[9]-1958414417|0)<<12|i>>>20)+r|0)&r|~i&n)+t[10]-42063|0)<<17|o>>>15)+i|0)&i|~o&r)+t[11]-1990404162|0)<<22|n>>>10)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n&o|~n&i)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&o)+t[13]-40341101|0)<<12|i>>>20)+r|0)&r|~i&n)+t[14]-1502002290|0)<<17|o>>>15)+i|0)&i|~o&r)+t[15]+1236535329|0)<<22|n>>>10)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n&i|o&~i)+t[1]-165796510|0)<<5|r>>>27)+n|0)&o|n&~o)+t[6]-1069501632|0)<<9|i>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|o>>>18)+i|0)&r|i&~r)+t[0]-373897302|0)<<20|n>>>12)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n&i|o&~i)+t[5]-701558691|0)<<5|r>>>27)+n|0)&o|n&~o)+t[10]+38016083|0)<<9|i>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|o>>>18)+i|0)&r|i&~r)+t[4]-405537848|0)<<20|n>>>12)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n&i|o&~i)+t[9]+568446438|0)<<5|r>>>27)+n|0)&o|n&~o)+t[14]-1019803690|0)<<9|i>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|o>>>18)+i|0)&r|i&~r)+t[8]+1163531501|0)<<20|n>>>12)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n&i|o&~i)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&o|n&~o)+t[2]-51403784|0)<<9|i>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|o>>>18)+i|0)&r|i&~r)+t[12]-1926607734|0)<<20|n>>>12)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n^o^i)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^o)+t[8]-2022574463|0)<<11|i>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|o>>>16)+i|0)^i^r)+t[14]-35309556|0)<<23|n>>>9)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n^o^i)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^o)+t[4]+1272893353|0)<<11|i>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|o>>>16)+i|0)^i^r)+t[10]-1094730640|0)<<23|n>>>9)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n^o^i)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^o)+t[0]-358537222|0)<<11|i>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|o>>>16)+i|0)^i^r)+t[6]+76029189|0)<<23|n>>>9)+o|0,n=((n+=((o=((o+=((i=((i+=((r=((r+=(n^o^i)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^o)+t[12]-421815835|0)<<11|i>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|o>>>16)+i|0)^i^r)+t[2]-995338651|0)<<23|n>>>9)+o|0,n=((n+=((i=((i+=(n^((r=((r+=(o^(n|~i))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~o))+t[7]+1126891415|0)<<10|i>>>22)+r|0)^((o=((o+=(r^(i|~n))+t[14]-1416354905|0)<<15|o>>>17)+i|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+o|0,n=((n+=((i=((i+=(n^((r=((r+=(o^(n|~i))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~o))+t[3]-1894986606|0)<<10|i>>>22)+r|0)^((o=((o+=(r^(i|~n))+t[10]-1051523|0)<<15|o>>>17)+i|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+o|0,n=((n+=((i=((i+=(n^((r=((r+=(o^(n|~i))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~o))+t[15]-30611744|0)<<10|i>>>22)+r|0)^((o=((o+=(r^(i|~n))+t[6]-1560198380|0)<<15|o>>>17)+i|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+o|0,n=((n+=((i=((i+=(n^((r=((r+=(o^(n|~i))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~o))+t[11]-1120210379|0)<<10|i>>>22)+r|0)^((o=((o+=(r^(i|~n))+t[2]+718787259|0)<<15|o>>>17)+i|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+o|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=o+e[2]|0,e[3]=i+e[3]|0}function r(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function o(e){var n,o,i,a,s,l,u=e.length,c=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=u;n+=64)t(c,r(e.substring(n-64,n)));for(o=(e=e.substring(n-64)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<o;n+=1)i[n>>2]|=e.charCodeAt(n)<<(n%4<<3);if(i[n>>2]|=128<<(n%4<<3),n>55)for(t(c,i),n=0;n<16;n+=1)i[n]=0;return a=(a=8*u).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),l=parseInt(a[1],16)||0,i[14]=s,i[15]=l,t(c,i),c}function i(t){var r,n="";for(r=0;r<4;r+=1)n+=e[t>>8*r+4&15]+e[t>>8*r&15];return n}function a(e){var t;for(t=0;t<e.length;t+=1)e[t]=i(e[t]);return e.join("")}function s(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function l(e){var t,r=[],n=e.length;for(t=0;t<n-1;t+=2)r.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,r)}function u(){this.reset()}return a(o("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(t,r){var n,o,i,a,s=this.byteLength,l=e(t,s),u=s;return void 0!==r&&(u=e(r,s)),l>u?new ArrayBuffer(0):(n=u-l,o=new ArrayBuffer(n),i=new Uint8Array(o),a=new Uint8Array(this,l,n),i.set(a),o)}}(),u.prototype.append=function(e){return this.appendBinary(s(e)),this},u.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var n,o=this._buff.length;for(n=64;n<=o;n+=64)t(this._hash,r(this._buff.substring(n-64,n)));return this._buff=this._buff.substring(n-64),this},u.prototype.end=function(e){var t,r,n=this._buff,o=n.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<o;t+=1)i[t>>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(i,o),r=a(this._hash),e&&(r=l(r)),this.reset(),r},u.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},u.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},u.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},u.prototype._finish=function(e,r){var n,o,i,a=r;if(e[a>>2]|=128<<(a%4<<3),a>55)for(t(this._hash,e),a=0;a<16;a+=1)e[a]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(n[2],16),i=parseInt(n[1],16)||0,e[14]=o,e[15]=i,t(this._hash,e)},u.hash=function(e,t){return u.hashBinary(s(e),t)},u.hashBinary=function(e,t){var r=a(o(e));return t?l(r):r},u.ArrayBuffer=function(){this.reset()},u.ArrayBuffer.prototype.append=function(e){var r,o,i,a,s,l=(o=this._buff.buffer,i=e,a=!0,(s=new Uint8Array(o.byteLength+i.byteLength)).set(new Uint8Array(o)),s.set(new Uint8Array(i),o.byteLength),a?s:s.buffer),u=l.length;for(this._length+=e.byteLength,r=64;r<=u;r+=64)t(this._hash,n(l.subarray(r-64,r)));return this._buff=r-64<u?new Uint8Array(l.buffer.slice(r-64)):new Uint8Array(0),this},u.ArrayBuffer.prototype.end=function(e){var t,r,n=this._buff,o=n.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<o;t+=1)i[t>>2]|=n[t]<<(t%4<<3);return this._finish(i,o),r=a(this._hash),e&&(r=l(r)),this.reset(),r},u.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.ArrayBuffer.prototype.getState=function(){var e,t=u.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},u.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var r,n=e.length,o=new ArrayBuffer(n),i=new Uint8Array(o);for(r=0;r<n;r+=1)i[r]=e.charCodeAt(r);return t?i:o}(e.buff,!0),u.prototype.setState.call(this,e)},u.ArrayBuffer.prototype.destroy=u.prototype.destroy,u.ArrayBuffer.prototype._finish=u.prototype._finish,u.ArrayBuffer.hash=function(e,r){var o=a(function(e){var r,o,i,a,s,l,u=e.length,c=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=u;r+=64)t(c,n(e.subarray(r-64,r)));for(o=(e=r-64<u?e.subarray(r-64):new Uint8Array(0)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<o;r+=1)i[r>>2]|=e[r]<<(r%4<<3);if(i[r>>2]|=128<<(r%4<<3),r>55)for(t(c,i),r=0;r<16;r+=1)i[r]=0;return a=(a=8*u).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),l=parseInt(a[1],16)||0,i[14]=s,i[15]=l,t(c,i),c}(new Uint8Array(e)));return r?l(o):o},u}()},570(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=184)}([function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(240)),n(r(251)),n(r(175)),n(r(107)),n(r(29)),n(r(73)),n(r(106)),n(r(30)),n(r(252)),n(r(52)),n(r(97)),n(r(253)),n(r(37)),n(r(51)),n(r(173)),n(r(176)),n(r(172)),n(r(108)),n(r(254)),n(r(255)),n(r(256)),n(r(72)),n(r(177)),n(r(105)),n(r(17)),n(r(257)),n(r(12)),n(r(174))},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(212);t.FixedSizeSet=o.FixedSizeSet;var i=r(213);t.ObjectCache=i.ObjectCache;var a=r(214);t.CompareCache=a.CompareCache;var s=r(215);t.Lazy=s.Lazy;var l=r(216);function u(e,t,r){if(m(e))e.forEach(function(e,n){return t.call(r,n,e)});else for(var n in e)e.hasOwnProperty(n)&&t.call(r,n,e[n])}function c(e){var t,r;if(d(e))return e;if(f(e)){var o=[];try{for(var i=n(e),a=i.next();!a.done;a=i.next()){var s=a.value;o.push(c(s))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o}if(p(e)){for(var l in o={},e)if(e.hasOwnProperty(l)){var u=e[l];o[l]=c(u)}return o}return e}function d(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e)}function p(e){var t=typeof e;return!!e&&("function"===t||"object"===t)}function f(e){return Array.isArray(e)}function h(e){return e instanceof Set}function m(e){return e instanceof Map}function g(e){if(p(e)){var t=Object.getPrototypeOf(e),r=t.constructor;return t&&r&&"function"==typeof r&&r instanceof r&&Function.prototype.toString.call(r)===Function.prototype.toString.call(Object)}return!1}t.StringWalker=l.StringWalker,t.applyMixin=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];Object.getOwnPropertyNames(t.prototype).forEach(function(n){if("constructor"!==n){if(-1!==r.indexOf(n)){var o=Object.getOwnPropertyDescriptor(e.prototype,n);o&&Object.defineProperty(e.prototype,"_"+n,o)}var i=Object.getOwnPropertyDescriptor(t.prototype,n);i&&Object.defineProperty(e.prototype,n,i)}})},t.applyDefaults=function e(t,r,n){void 0===n&&(n=!1);var o=c(t||{});return u(r,function(t,r){g(r)?o[t]=e(o[t],r,n):(n||void 0===o[t])&&(o[t]=r)}),o},t.forEachArray=function(e,t,r){e.forEach(t,r)},t.forEachObject=u,t.arrayLength=function(e){return h(e)?e.size:e.length},t.objectLength=function(e){return m(e)?e.size:Object.keys(e).length},t.getObjectValue=function(e,t){return m(e)?e.get(t):e[t]},t.removeObjectValue=function(e,t){m(e)?e.delete(t):delete e[t]},t.clone=c,t.isBoolean=function(e){return"boolean"==typeof e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isFunction=d,t.isObject=p,t.isArray=f,t.isSet=h,t.isMap=m,t.isEmpty=function(e){if(f(e))return!e.length;if(h(e))return!e.size;if(m(e))return!e.size;if(p(e)){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},t.isPlainObject=g,t.isIterable=function(e){return e&&"function"==typeof e[Symbol.iterator]},t.getValue=function(e){return d(e.valueOf)?e.valueOf():e},t.utf8Encode=function(e){for(var t=new Uint8Array(4*e.length),r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);if(o<128)t[r++]=o;else{if(o<2048)t[r++]=o>>6|192;else{if(o>55295&&o<56320){if(++n>=e.length)throw new Error("Incomplete surrogate pair.");var i=e.charCodeAt(n);if(i<56320||i>57343)throw new Error("Invalid surrogate character.");o=65536+((1023&o)<<10)+(1023&i),t[r++]=o>>18|240,t[r++]=o>>12&63|128}else t[r++]=o>>12|224;t[r++]=o>>6&63|128}t[r++]=63&o|128}}return t.subarray(0,r)},t.utf8Decode=function(e){for(var t="",r=0;r<e.length;){var n=e[r++];if(n>127)if(n>191&&n<224){if(r>=e.length)throw new Error("Incomplete 2-byte sequence.");n=(31&n)<<6|63&e[r++]}else if(n>223&&n<240){if(r+1>=e.length)throw new Error("Incomplete 3-byte sequence.");n=(15&n)<<12|(63&e[r++])<<6|63&e[r++]}else{if(!(n>239&&n<248))throw new Error("Unknown multi-byte start.");if(r+2>=e.length)throw new Error("Incomplete 4-byte sequence.");n=(7&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]}if(n<=65535)t+=String.fromCharCode(n);else{if(!(n<=1114111))throw new Error("Code point exceeds UTF-16 limit.");n-=65536,t+=String.fromCharCode(n>>10|55296),t+=String.fromCharCode(1023&n|56320)}}return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Before=0]="Before",e[e.Equal=1]="Equal",e[e.After=2]="After"}(t.BoundaryPosition||(t.BoundaryPosition={})),function(e){e[e.None=0]="None",e[e.Capturing=1]="Capturing",e[e.AtTarget=2]="AtTarget",e[e.Bubbling=3]="Bubbling"}(t.EventPhase||(t.EventPhase={})),function(e){e[e.Element=1]="Element",e[e.Attribute=2]="Attribute",e[e.Text=3]="Text",e[e.CData=4]="CData",e[e.EntityReference=5]="EntityReference",e[e.Entity=6]="Entity",e[e.ProcessingInstruction=7]="ProcessingInstruction",e[e.Comment=8]="Comment",e[e.Document=9]="Document",e[e.DocumentType=10]="DocumentType",e[e.DocumentFragment=11]="DocumentFragment",e[e.Notation=12]="Notation"}(t.NodeType||(t.NodeType={})),function(e){e[e.Disconnected=1]="Disconnected",e[e.Preceding=2]="Preceding",e[e.Following=4]="Following",e[e.Contains=8]="Contains",e[e.ContainedBy=16]="ContainedBy",e[e.ImplementationSpecific=32]="ImplementationSpecific"}(t.Position||(t.Position={})),function(e){e[e.Accept=1]="Accept",e[e.Reject=2]="Reject",e[e.Skip=3]="Skip"}(t.FilterResult||(t.FilterResult={})),function(e){e[e.All=4294967295]="All",e[e.Element=1]="Element",e[e.Attribute=2]="Attribute",e[e.Text=4]="Text",e[e.CDataSection=8]="CDataSection",e[e.EntityReference=16]="EntityReference",e[e.Entity=32]="Entity",e[e.ProcessingInstruction=64]="ProcessingInstruction",e[e.Comment=128]="Comment",e[e.Document=256]="Document",e[e.DocumentType=512]="DocumentType",e[e.DocumentFragment=1024]="DocumentFragment",e[e.Notation=2048]="Notation"}(t.WhatToShow||(t.WhatToShow={})),function(e){e[e.StartToStart=0]="StartToStart",e[e.StartToEnd=1]="StartToEnd",e[e.EndToEnd=2]="EndToEnd",e[e.EndToStart=3]="EndToStart"}(t.HowToCompare||(t.HowToCompare={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(241);t.Cast=n.Cast;var o=r(150);t.Guard=o.Guard;var i=r(242);t.EmptySet=i.EmptySet},function(e,t,r){var n=r(11),o=r(55).f,i=r(21),a=r(25),s=r(80),l=r(119),u=r(123);e.exports=function(e,t){var r,c,d,p,f,h=e.target,m=e.global,g=e.stat;if(r=m?n:g?n[h]||s(h,{}):(n[h]||{}).prototype)for(c in t){if(p=t[c],d=e.noTargetGet?(f=o(r,c))&&f.value:r[c],!u(m?c:h+(g?".":"#")+c,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;l(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(r,c,p,e)}}},function(e,t,r){var n=r(11),o=r(81),i=r(14),a=r(58),s=r(86),l=r(124),u=o("wks"),c=n.Symbol,d=l?c:c&&c.withoutSetter||a;e.exports=function(e){return i(u,e)||(s&&i(c,e)?u[e]=c[e]:u[e]=d("Symbol."+e)),u[e]}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(29),i=function(){function e(){this._features={mutationObservers:!0,customElements:!0,slots:!0,steps:!0},this._window=null,this._compareCache=new n.CompareCache,this._rangeList=new n.FixedSizeSet}return e.prototype.setFeatures=function(e){if(void 0===e&&(e=!0),n.isObject(e))for(var t in e)this._features[t]=e[t]||!1;else for(var t in this._features)this._features[t]=e},Object.defineProperty(e.prototype,"features",{get:function(){return this._features},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return null===this._window&&(this._window=o.create_window()),this._window},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"compareCache",{get:function(){return this._compareCache},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rangeList",{get:function(){return this._rangeList},enumerable:!0,configurable:!0}),Object.defineProperty(e,"instance",{get:function(){return e._instance||(e._instance=new e),e._instance},enumerable:!0,configurable:!0}),e}();t.dom=i.instance},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(228));t.base64=o;var i=n(r(146));t.byte=i;var a=n(r(147));t.byteSequence=a;var s=n(r(96));t.codePoint=s;var l=n(r(232));t.json=l;var u=n(r(233));t.list=u;var c=n(r(234));t.map=c;var d=n(r(235));t.namespace=d;var p=n(r(236));t.queue=p;var f=n(r(237));t.set=f;var h=n(r(238));t.stack=h;var m=n(r(239));t.string=m},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t,r){void 0===r&&(r="");var n=e.call(this,r)||this;return n.name=t,n}return o(t,e),t}(Error);t.DOMException=i;var a=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"DOMStringSizeError",t)||this}return o(t,e),t}(i);t.DOMStringSizeError=a;var s=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"WrongDocumentError","The object is in the wrong document. "+t)||this}return o(t,e),t}(i);t.WrongDocumentError=s;var l=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NoDataAllowedError",t)||this}return o(t,e),t}(i);t.NoDataAllowedError=l;var u=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NoModificationAllowedError","The object can not be modified. "+t)||this}return o(t,e),t}(i);t.NoModificationAllowedError=u;var c=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NotSupportedError","The operation is not supported. "+t)||this}return o(t,e),t}(i);t.NotSupportedError=c;var d=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InUseAttributeError",t)||this}return o(t,e),t}(i);t.InUseAttributeError=d;var p=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidStateError","The object is in an invalid state. "+t)||this}return o(t,e),t}(i);t.InvalidStateError=p;var f=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidModificationError","The object can not be modified in this way. "+t)||this}return o(t,e),t}(i);t.InvalidModificationError=f;var h=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NamespaceError","The operation is not allowed by Namespaces in XML. [XMLNS] "+t)||this}return o(t,e),t}(i);t.NamespaceError=h;var m=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidAccessError","The object does not support the operation or argument. "+t)||this}return o(t,e),t}(i);t.InvalidAccessError=m;var g=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"ValidationError",t)||this}return o(t,e),t}(i);t.ValidationError=g;var y=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"TypeMismatchError",t)||this}return o(t,e),t}(i);t.TypeMismatchError=y;var v=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"SecurityError","The operation is insecure. "+t)||this}return o(t,e),t}(i);t.SecurityError=v;var b=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NetworkError","A network error occurred. "+t)||this}return o(t,e),t}(i);t.NetworkError=b;var x=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"AbortError","The operation was aborted. "+t)||this}return o(t,e),t}(i);t.AbortError=x;var _=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"URLMismatchError","The given URL does not match another URL. "+t)||this}return o(t,e),t}(i);t.URLMismatchError=_;var S=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"QuotaExceededError","The quota has been exceeded. "+t)||this}return o(t,e),t}(i);t.QuotaExceededError=S;var C=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"TimeoutError","The operation timed out. "+t)||this}return o(t,e),t}(i);t.TimeoutError=C;var T=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidNodeTypeError","The supplied node is incorrect or has an incorrect ancestor for this operation. "+t)||this}return o(t,e),t}(i);t.InvalidNodeTypeError=T;var w=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"DataCloneError","The object can not be cloned. "+t)||this}return o(t,e),t}(i);t.DataCloneError=w;var A=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NotImplementedError","The DOM method is not implemented by this module. "+t)||this}return o(t,e),t}(i);t.NotImplementedError=A;var E=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"HierarchyRequestError","The operation would yield an incorrect node tree. "+t)||this}return o(t,e),t}(i);t.HierarchyRequestError=E;var D=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"NotFoundError","The object can not be found here. "+t)||this}return o(t,e),t}(i);t.NotFoundError=D;var P=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"IndexSizeError","The index is not in the allowed range. "+t)||this}return o(t,e),t}(i);t.IndexSizeError=P;var I=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"SyntaxError","The string did not match the expected pattern. "+t)||this}return o(t,e),t}(i);t.SyntaxError=I;var O=function(e){function t(t){return void 0===t&&(t=""),e.call(this,"InvalidCharacterError","The string contains invalid characters. "+t)||this}return o(t,e),t}(i);t.InvalidCharacterError=O},function(e,t,r){"use strict";var n=r(53),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];e.exports=function(e,t){var r,a;if(t=t||{},Object.keys(t).forEach(function(t){if(-1===o.indexOf(t))throw new n('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(r=t.styleAliases||null,a={},null!==r&&Object.keys(r).forEach(function(e){r[e].forEach(function(t){a[String(t)]=e})}),a),-1===i.indexOf(this.kind))throw new n('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},function(e,t,r){(function(t){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||Function("return this")()}).call(this,r(78))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.idl_defineConst=function(e,t,r){Object.defineProperty(e,t,{writable:!1,enumerable:!0,configurable:!1,value:r})}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(16),o=r(115),i=r(18),a=r(56),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(i(e),t=a(t,!0),i(r),o)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){var n=r(8);e.exports=!n(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(3),i=r(2);function a(e,t,r){if(void 0===r&&(r=!1),r&&o.Guard.isElementNode(t)&&o.Guard.isShadowRoot(t.shadowRoot)&&t.shadowRoot._firstChild)return t.shadowRoot._firstChild;if(t._firstChild)return t._firstChild;if(t===e)return null;if(t._nextSibling)return t._nextSibling;for(var n=t._parent;n&&n!==e;){if(n._nextSibling)return n._nextSibling;n=n._parent}return null}function s(){var e;return(e={})[Symbol.iterator]=function(){return{next:function(){return{done:!0,value:null}}}},e}function l(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);for(var o=t?e:a(e,e,r);o&&n&&!n(o);)o=a(e,o,r);return o}function u(e,t,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var i=a(e,t,n);i&&o&&!o(i);)i=a(e,i,n);return i}function c(e,t,r,n){var o;return void 0===t&&(t=!1),void 0===r&&(r=!1),t||0!==e._children.size?((o={})[Symbol.iterator]=function(){var o=t?e:a(e,e,r);return{next:function(){for(;o&&n&&!n(o);)o=a(e,o,r);if(null===o)return{done:!0,value:null};var t={done:!1,value:o};return o=a(e,o,r),t}}},o):s()}function d(e,t,r){void 0===t&&(t=!1);for(var n=t?e:e._parent;n&&r&&!r(n);)n=n._parent;return n}function p(e,t,r,n){void 0===r&&(r=!1);for(var o=t._parent;o&&n&&!n(o);)o=o._parent;return o}function f(e){return o.Guard.isDocumentTypeNode(e)?0:o.Guard.isCharacterDataNode(e)?e._data.length:e._children.size}function h(e,t){if(void 0===t&&(t=!1),t){var r=h(e,!1);return o.Guard.isShadowRoot(r)?h(r._host,!0):r}return e._parent?h(e._parent):e}function m(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var i=r?e:n&&o.Guard.isShadowRoot(e)?e._host:e._parent;null!==i;){if(i===t)return!0;i=n&&o.Guard.isShadowRoot(i)?i._host:i._parent}return!1}function g(e){for(var t=h(e),r=0,n=l(t);null!==n;){if(r++,n===e)return r;n=u(t,n)}return-1}t.tree_getFirstDescendantNode=l,t.tree_getNextDescendantNode=u,t.tree_getDescendantNodes=c,t.tree_getDescendantElements=function(e,t,r,n){var i;return void 0===t&&(t=!1),void 0===r&&(r=!1),t||0!==e._children.size?((i={})[Symbol.iterator]=function(){var i=c(e,t,r,function(e){return o.Guard.isElementNode(e)})[Symbol.iterator](),a=i.next().value;return{next:function(){for(;a&&n&&!n(a);)a=i.next().value;if(null===a)return{done:!0,value:null};var e={done:!1,value:a};return a=i.next().value,e}}},i):s()},t.tree_getSiblingNodes=function(e,t,r){var n;return void 0===t&&(t=!1),e._parent&&0!==e._parent._children.size?((n={})[Symbol.iterator]=function(){var n=e._parent?e._parent._firstChild:null;return{next:function(){for(;n&&(r&&!r(n)||!t&&n===e);)n=n._nextSibling;if(null===n)return{done:!0,value:null};var o={done:!1,value:n};return n=n._nextSibling,o}}},n):s()},t.tree_getFirstAncestorNode=d,t.tree_getNextAncestorNode=p,t.tree_getAncestorNodes=function(e,t,r){var n;return void 0===t&&(t=!1),t||e._parent?((n={})[Symbol.iterator]=function(){var n=d(e,t,r);return{next:function(){if(null===n)return{done:!0,value:null};var e={done:!1,value:n};return n=p(0,n,t,r),e}}},n):s()},t.tree_getCommonAncestor=function(e,t){if(e===t)return e._parent;for(var r=[],n=[],o=d(e,!0);null!==o;)r.push(o),o=p(0,o,!0);for(var i=d(t,!0);null!==i;)n.push(i),i=p(0,i,!0);for(var a=r.length,s=n.length,l=null,u=Math.min(a,s);u>0;u--){var c=r[--a];if(c!==n[--s])break;l=c}return l},t.tree_getFollowingNode=function(e,t){if(t._firstChild)return t._firstChild;if(t._nextSibling)return t._nextSibling;for(;;){var r=t._parent;if(null===r||r===e)return null;if(r._nextSibling)return r._nextSibling;t=r}},t.tree_getPrecedingNode=function(e,t){return t===e?null:t._previousSibling?(t=t._previousSibling)._lastChild?t._lastChild:t:t._parent},t.tree_isConstrained=function e(t){var r,o,a,s,l,u;switch(t._nodeType){case i.NodeType.Document:var c=!1,d=!1;try{for(var p=n(t._children),f=p.next();!f.done;f=p.next())switch(f.value._nodeType){case i.NodeType.ProcessingInstruction:case i.NodeType.Comment:break;case i.NodeType.DocumentType:if(c||d)return!1;c=!0;break;case i.NodeType.Element:if(d)return!1;d=!0;break;default:return!1}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}break;case i.NodeType.DocumentFragment:case i.NodeType.Element:try{for(var h=n(t._children),m=h.next();!m.done;m=h.next())switch(m.value._nodeType){case i.NodeType.Element:case i.NodeType.Text:case i.NodeType.ProcessingInstruction:case i.NodeType.CData:case i.NodeType.Comment:break;default:return!1}}catch(e){a={error:e}}finally{try{m&&!m.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}break;case i.NodeType.DocumentType:case i.NodeType.Text:case i.NodeType.ProcessingInstruction:case i.NodeType.CData:case i.NodeType.Comment:return!t.hasChildNodes()}try{for(var g=n(t._children),y=g.next();!y.done;y=g.next())if(!e(y.value))return!1}catch(e){l={error:e}}finally{try{y&&!y.done&&(u=g.return)&&u.call(g)}finally{if(l)throw l.error}}return!0},t.tree_nodeLength=f,t.tree_isEmpty=function(e){return 0===f(e)},t.tree_rootNode=h,t.tree_isDescendantOf=function(e,t,r,n){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var o=l(e,r,n);null!==o;){if(o===t)return!0;o=u(e,o,r,n)}return!1},t.tree_isAncestorOf=m,t.tree_isHostIncludingAncestorOf=function e(t,r,n){if(void 0===n&&(n=!1),m(t,r,n))return!0;var i=h(t);return!(!o.Guard.isDocumentFragmentNode(i)||null===i._host||!e(i._host,r,n))},t.tree_isSiblingOf=function(e,t,r){return void 0===r&&(r=!1),e!==t?null!==e._parent&&e._parent===t._parent:!!r},t.tree_isPreceding=function(e,t){var r=g(e),n=g(t);return-1!==r&&-1!==n&&h(e)===h(t)&&n<r},t.tree_isFollowing=function(e,t){var r=g(e),n=g(t);return-1!==r&&-1!==n&&h(e)===h(t)&&n>r},t.tree_isParentOf=function(e,t){return e._parent===t},t.tree_isChildOf=function(e,t){return t._parent===e},t.tree_previousSibling=function(e){return e._previousSibling},t.tree_nextSibling=function(e){return e._nextSibling},t.tree_firstChild=function(e){return e._firstChild},t.tree_lastChild=function(e){return e._lastChild},t.tree_treePosition=g,t.tree_index=function(e){for(var t=0;null!==e._previousSibling;)t++,e=e._previousSibling;return t},t.tree_retarget=function(e,t){for(;;){if(!e||!o.Guard.isNode(e))return e;var r=h(e);if(!o.Guard.isShadowRoot(r))return e;if(t&&o.Guard.isNode(t)&&m(r,t,!0,!0))return e;e=r.host}}},function(e,t,r){var n=r(13);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){"use strict";var n=r(24),o=r(130),i=r(49),a=r(43),s=r(88),l=a.set,u=a.getterFor("Array Iterator");e.exports=s(Array,"Array",function(e,t){l(this,{type:"Array Iterator",target:n(e),index:0,kind:t})},function(){var e=u(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t,r){var n=r(90),o=r(25),i=r(202);n||o(Object.prototype,"toString",i,{unsafe:!0})},function(e,t,r){var n=r(16),o=r(15),i=r(40);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";var n=r(137).charAt,o=r(43),i=r(88),a=o.set,s=o.getterFor("String Iterator");i(String,"String",function(e){a(this,{type:"String Iterator",string:String(e),index:0})},function(){var e,t=s(this),r=t.string,o=t.index;return o>=r.length?{value:void 0,done:!0}:(e=n(r,o),t.index+=e.length,{value:e,done:!1})})},function(e,t,r){var n=r(11),o=r(203),i=r(19),a=r(21),s=r(5),l=s("iterator"),u=s("toStringTag"),c=i.values;for(var d in o){var p=n[d],f=p&&p.prototype;if(f){if(f[l]!==c)try{a(f,l,c)}catch(e){f[l]=c}if(f[u]||a(f,u,d),o[d])for(var h in i)if(f[h]!==i[h])try{a(f,h,i[h])}catch(e){f[h]=i[h]}}}},function(e,t,r){var n=r(41),o=r(35);e.exports=function(e){return n(o(e))}},function(e,t,r){var n=r(11),o=r(21),i=r(14),a=r(80),s=r(117),l=r(43),u=l.get,c=l.enforce,d=String(String).split("String");(e.exports=function(e,t,r,s){var l=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof r&&("string"!=typeof t||i(r,"name")||o(r,"name",t),c(r).source=d.join("string"==typeof t?t:"")),e!==n?(l?!p&&e[t]&&(u=!0):delete e[t],u?e[t]=r:o(e,t,r)):u?e[t]=r:a(t,r)})(Function.prototype,"toString",function(){return"function"==typeof this&&u(this).source||s(this)})},function(e,t,r){var n=r(47),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t,r){var n=r(35);e.exports=function(e){return Object(n(e))}},function(e,t,r){var n=r(16),o=r(8),i=r(14),a=Object.defineProperty,s={},l=function(e){throw e};e.exports=function(e,t){if(i(s,e))return s[e];t||(t={});var r=[][e],u=!!i(t,"ACCESSORS")&&t.ACCESSORS,c=i(t,0)?t[0]:l,d=i(t,1)?t[1]:void 0;return s[e]=!!r&&!o(function(){if(u&&!n)return!0;var e={length:-1};u?a(e,1,{enumerable:!0,get:l}):e[1]=1,r.call(e,c,d)})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(148),o=r(149),i=r(151),a=r(98),s=r(153),l=r(154),u=r(155),c=r(99),d=r(100),p=r(156),f=r(157),h=r(101),m=r(158),g=r(159),y=r(160),v=r(161),b=r(162),x=r(163),_=r(164),S=r(165),C=r(166),T=r(167),w=r(168),A=r(169),E=r(170);t.create_domImplementation=function(e){return n.DOMImplementationImpl._create(e)},t.create_window=function(){return o.WindowImpl._create()},t.create_xmlDocument=function(){return new i.XMLDocumentImpl},t.create_document=function(){return new a.DocumentImpl},t.create_abortController=function(){return new s.AbortControllerImpl},t.create_abortSignal=function(){return l.AbortSignalImpl._create()},t.create_documentType=function(e,t,r,n){return u.DocumentTypeImpl._create(e,t,r,n)},t.create_element=function(e,t,r,n){return c.ElementImpl._create(e,t,r,n)},t.create_htmlElement=function(e,t,r,n){return c.ElementImpl._create(e,t,r,n)},t.create_htmlUnknownElement=function(e,t,r,n){return c.ElementImpl._create(e,t,r,n)},t.create_documentFragment=function(e){return d.DocumentFragmentImpl._create(e)},t.create_shadowRoot=function(e,t){return p.ShadowRootImpl._create(e,t)},t.create_attr=function(e,t){return f.AttrImpl._create(e,t)},t.create_text=function(e,t){return h.TextImpl._create(e,t)},t.create_cdataSection=function(e,t){return m.CDATASectionImpl._create(e,t)},t.create_comment=function(e,t){return g.CommentImpl._create(e,t)},t.create_processingInstruction=function(e,t,r){return y.ProcessingInstructionImpl._create(e,t,r)},t.create_htmlCollection=function(e,t){return void 0===t&&(t=function(){return!0}),v.HTMLCollectionImpl._create(e,t)},t.create_nodeList=function(e){return b.NodeListImpl._create(e)},t.create_nodeListStatic=function(e,t){return x.NodeListStaticImpl._create(e,t)},t.create_namedNodeMap=function(e){return _.NamedNodeMapImpl._create(e)},t.create_range=function(e,t){return S.RangeImpl._create(e,t)},t.create_nodeIterator=function(e,t,r){return C.NodeIteratorImpl._create(e,t,r)},t.create_treeWalker=function(e,t){return T.TreeWalkerImpl._create(e,t)},t.create_nodeFilter=function(){return w.NodeFilterImpl._create()},t.create_mutationRecord=function(e,t,r,n,o,i,a,s,l){return A.MutationRecordImpl._create(e,t,r,n,o,i,a,s,l)},t.create_domTokenList=function(e,t){return E.DOMTokenListImpl._create(e,t)}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),i=r(17),a=r(3),s=r(72),l=new Map;function u(e,t){if(t!==e._root&&i.tree_isAncestorOf(e._reference,t,!0)){if(e._pointerBeforeReference)for(;;){var r=i.tree_getFollowingNode(e._root,t);if(null!==r&&i.tree_isDescendantOf(e._root,r,!0)&&!i.tree_isDescendantOf(t,r,!0))return void(e._reference=r);if(null===r)return void(e._pointerBeforeReference=!1)}if(null===t._previousSibling)null!==t._parent&&(e._reference=t._parent);else{for(var n=t._previousSibling,o=i.tree_getFirstDescendantNode(t._previousSibling,!0,!1);null!==o;)null!==o&&(n=o),o=i.tree_getNextDescendantNode(t._previousSibling,o,!0,!1);e._reference=n}}}function c(e,t,r,n,o){if(a.Guard.isSlot(e)&&"name"===t&&null===o){if(n===r)return;if(null===n&&""===r)return;if(""===n&&null===r)return;e._name=null===n||""===n?"":n,s.shadowTree_assignSlotablesForATree(i.tree_rootNode(e))}}function d(e,t,r,n,o){if(a.Guard.isSlotable(e)&&"slot"===t&&null===o){if(n===r)return;if(null===n&&""===r)return;if(""===n&&null===r)return;e._name=null===n||""===n?"":n,s.shadowTree_isAssigned(e)&&s.shadowTree_assignSlotables(e._assignedSlot),s.shadowTree_assignASlot(e)}}function p(e,t,r,n){"id"===t&&null===n&&(e._uniqueIdentifier=r||void 0)}t.dom_runRemovingSteps=function(e,t){},t.dom_runCloningSteps=function(e,t,r,n){},t.dom_runAdoptingSteps=function(e,t){},t.dom_runAttributeChangeSteps=function(e,t,r,i,a){var s,l;o.dom.features.slots&&(d.call(e,e,t,r,i,a),c.call(e,e,t,r,i,a)),p.call(e,e,t,i,a);try{for(var u=n(e._attributeChangeSteps),f=u.next();!f.done;f=u.next())f.value.call(e,e,t,r,i,a)}catch(e){s={error:e}}finally{try{f&&!f.done&&(l=u.return)&&l.call(u)}finally{if(s)throw s.error}}},t.dom_runInsertionSteps=function(e){},t.dom_runNodeIteratorPreRemovingSteps=function(e,t){u.call(e,e,t)},t.dom_hasSupportedTokens=function(e){return l.has(e)},t.dom_getSupportedTokens=function(e){return l.get(e)||new Set},t.dom_runEventConstructingSteps=function(e){},t.dom_runChildTextContentChangeSteps=function(e){}},function(e,t,r){"use strict";var n=r(4),o=r(11),i=r(46),a=r(44),s=r(16),l=r(86),u=r(124),c=r(8),d=r(14),p=r(59),f=r(13),h=r(18),m=r(27),g=r(24),y=r(56),v=r(40),b=r(60),x=r(61),_=r(82),S=r(190),C=r(85),T=r(55),w=r(15),A=r(79),E=r(21),D=r(25),P=r(81),I=r(57),O=r(45),N=r(58),M=r(5),R=r(125),F=r(126),B=r(62),L=r(43),k=r(36).forEach,U=I("hidden"),V=M("toPrimitive"),G=L.set,z=L.getterFor("Symbol"),j=Object.prototype,W=o.Symbol,H=i("JSON","stringify"),K=T.f,X=w.f,$=S.f,q=A.f,Y=P("symbols"),J=P("op-symbols"),Q=P("string-to-symbol-registry"),Z=P("symbol-to-string-registry"),ee=P("wks"),te=o.QObject,re=!te||!te.prototype||!te.prototype.findChild,ne=s&&c(function(){return 7!=b(X({},"a",{get:function(){return X(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=K(j,t);n&&delete j[t],X(e,t,r),n&&e!==j&&X(j,t,n)}:X,oe=function(e,t){var r=Y[e]=b(W.prototype);return G(r,{type:"Symbol",tag:e,description:t}),s||(r.description=t),r},ie=u?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof W},ae=function(e,t,r){e===j&&ae(J,t,r),h(e);var n=y(t,!0);return h(r),d(Y,n)?(r.enumerable?(d(e,U)&&e[U][n]&&(e[U][n]=!1),r=b(r,{enumerable:v(0,!1)})):(d(e,U)||X(e,U,v(1,{})),e[U][n]=!0),ne(e,n,r)):X(e,n,r)},se=function(e,t){h(e);var r=g(t),n=x(r).concat(de(r));return k(n,function(t){s&&!le.call(r,t)||ae(e,t,r[t])}),e},le=function(e){var t=y(e,!0),r=q.call(this,t);return!(this===j&&d(Y,t)&&!d(J,t))&&(!(r||!d(this,t)||!d(Y,t)||d(this,U)&&this[U][t])||r)},ue=function(e,t){var r=g(e),n=y(t,!0);if(r!==j||!d(Y,n)||d(J,n)){var o=K(r,n);return!o||!d(Y,n)||d(r,U)&&r[U][n]||(o.enumerable=!0),o}},ce=function(e){var t=$(g(e)),r=[];return k(t,function(e){d(Y,e)||d(O,e)||r.push(e)}),r},de=function(e){var t=e===j,r=$(t?J:g(e)),n=[];return k(r,function(e){!d(Y,e)||t&&!d(j,e)||n.push(Y[e])}),n};l||(D((W=function(){if(this instanceof W)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=N(e),r=function(e){this===j&&r.call(J,e),d(this,U)&&d(this[U],t)&&(this[U][t]=!1),ne(this,t,v(1,e))};return s&&re&&ne(j,t,{configurable:!0,set:r}),oe(t,e)}).prototype,"toString",function(){return z(this).tag}),D(W,"withoutSetter",function(e){return oe(N(e),e)}),A.f=le,w.f=ae,T.f=ue,_.f=S.f=ce,C.f=de,R.f=function(e){return oe(M(e),e)},s&&(X(W.prototype,"description",{configurable:!0,get:function(){return z(this).description}}),a||D(j,"propertyIsEnumerable",le,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:W}),k(x(ee),function(e){F(e)}),n({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=String(e);if(d(Q,t))return Q[t];var r=W(t);return Q[t]=r,Z[r]=t,r},keyFor:function(e){if(!ie(e))throw TypeError(e+" is not a symbol");if(d(Z,e))return Z[e]},useSetter:function(){re=!0},useSimple:function(){re=!1}}),n({target:"Object",stat:!0,forced:!l,sham:!s},{create:function(e,t){return void 0===t?b(e):se(b(e),t)},defineProperty:ae,defineProperties:se,getOwnPropertyDescriptor:ue}),n({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:ce,getOwnPropertySymbols:de}),n({target:"Object",stat:!0,forced:c(function(){C.f(1)})},{getOwnPropertySymbols:function(e){return C.f(m(e))}}),H&&n({target:"JSON",stat:!0,forced:!l||c(function(){var e=W();return"[null]"!=H([e])||"{}"!=H({a:e})||"{}"!=H(Object(e))})},{stringify:function(e,t,r){for(var n,o=[e],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=t,(f(t)||void 0!==e)&&!ie(e))return p(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!ie(t))return t}),o[1]=t,H.apply(null,o)}}),W.prototype[V]||E(W.prototype,V,W.prototype.valueOf),B(W,"Symbol"),O[U]=!0},function(e,t,r){"use strict";var n=r(4),o=r(16),i=r(11),a=r(14),s=r(13),l=r(15).f,u=r(119),c=i.Symbol;if(o&&"function"==typeof c&&(!("description"in c.prototype)||void 0!==c().description)){var d={},p=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof p?new c(e):void 0===e?c():c(e);return""===e&&(d[t]=!0),t};u(p,c);var f=p.prototype=c.prototype;f.constructor=p;var h=f.toString,m="Symbol(test)"==String(c("test")),g=/^Symbol\((.*)\)[^)]+$/;l(f,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=h.call(e);if(a(d,e))return"";var r=m?t.slice(7,-1):t.replace(g,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:p})}},function(e,t,r){r(126)("iterator")},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=r(6),s=r(2),l=r(70),u=r(3),c=r(9),d=r(0),p=r(152),f=r(12),h=function(e){function t(){var t=e.call(this)||this;return t._parent=null,t._firstChild=null,t._lastChild=null,t._previousSibling=null,t._nextSibling=null,t}return o(t,e),Object.defineProperty(t.prototype,"_childNodes",{get:function(){return this.__childNodes||(this.__childNodes=d.create_nodeList(this))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_nodeDocument",{get:function(){return this._nodeDocumentOverride||a.dom.window._associatedDocument},set:function(e){this._nodeDocumentOverride=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_registeredObserverList",{get:function(){return this.__registeredObserverList||(this.__registeredObserverList=[])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodeType",{get:function(){return this._nodeType},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodeName",{get:function(){return u.Guard.isElementNode(this)?this._htmlUppercasedQualifiedName:u.Guard.isAttrNode(this)?this._qualifiedName:u.Guard.isExclusiveTextNode(this)?"#text":u.Guard.isCDATASectionNode(this)?"#cdata-section":u.Guard.isProcessingInstructionNode(this)?this._target:u.Guard.isCommentNode(this)?"#comment":u.Guard.isDocumentNode(this)?"#document":u.Guard.isDocumentTypeNode(this)?this._name:u.Guard.isDocumentFragmentNode(this)?"#document-fragment":""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"baseURI",{get:function(){return p.urlSerializer(this._nodeDocument._URL)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isConnected",{get:function(){return u.Guard.isElementNode(this)&&d.shadowTree_isConnected(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ownerDocument",{get:function(){return this._nodeType===s.NodeType.Document?null:this._nodeDocument},enumerable:!0,configurable:!0}),t.prototype.getRootNode=function(e){return d.tree_rootNode(this,!!e&&e.composed)},Object.defineProperty(t.prototype,"parentNode",{get:function(){return this._nodeType===s.NodeType.Attribute?null:this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return this._parent&&u.Guard.isElementNode(this._parent)?this._parent:null},enumerable:!0,configurable:!0}),t.prototype.hasChildNodes=function(){return null!==this._firstChild},Object.defineProperty(t.prototype,"childNodes",{get:function(){return this._childNodes},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._firstChild},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this._lastChild},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){return this._previousSibling},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){return this._nextSibling},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return u.Guard.isAttrNode(this)?this._value:u.Guard.isCharacterDataNode(this)?this._data:null},set:function(e){null===e&&(e=""),u.Guard.isAttrNode(this)?d.attr_setAnExistingAttributeValue(this,e):u.Guard.isCharacterDataNode(this)&&d.characterData_replaceData(this,0,this._data.length,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textContent",{get:function(){return u.Guard.isDocumentFragmentNode(this)||u.Guard.isElementNode(this)?d.text_descendantTextContent(this):u.Guard.isAttrNode(this)?this._value:u.Guard.isCharacterDataNode(this)?this._data:null},set:function(e){null===e&&(e=""),u.Guard.isDocumentFragmentNode(this)||u.Guard.isElementNode(this)?d.node_stringReplaceAll(e,this):u.Guard.isAttrNode(this)?d.attr_setAnExistingAttributeValue(this,e):u.Guard.isCharacterDataNode(this)&&d.characterData_replaceData(this,0,d.tree_nodeLength(this),e)},enumerable:!0,configurable:!0}),t.prototype.normalize=function(){for(var e,t,r,n,o=[],s=d.tree_getFirstDescendantNode(this,!1,!1,function(e){return u.Guard.isExclusiveTextNode(e)});null!==s;)o.push(s),s=d.tree_getNextDescendantNode(this,s,!1,!1,function(e){return u.Guard.isExclusiveTextNode(e)});for(var l=0;l<o.length;l++){var c=o[l];if(null!==c._parent){var p=d.tree_nodeLength(c);if(0!==p){var f=[],h="";try{for(var m=(e=void 0,i(d.text_contiguousExclusiveTextNodes(c))),g=m.next();!g.done;g=m.next()){var y=g.value;f.push(y),h+=y._data}}catch(t){e={error:t}}finally{try{g&&!g.done&&(t=m.return)&&t.call(m)}finally{if(e)throw e.error}}if(d.characterData_replaceData(c,p,0,h),0!==a.dom.rangeList.size)for(var v=c._nextSibling;null!==v&&u.Guard.isExclusiveTextNode(v);){var b=v,x=d.tree_index(b);try{for(var _=(r=void 0,i(a.dom.rangeList)),S=_.next();!S.done;S=_.next()){var C=S.value;C._start[0]===b&&(C._start[0]=c,C._start[1]+=p),C._end[0]===b&&(C._end[0]=c,C._end[1]+=p),C._start[0]===b._parent&&C._start[1]===x&&(C._start[0]=c,C._start[1]=p),C._end[0]===b._parent&&C._end[1]===x&&(C._end[0]=c,C._end[1]=p)}}catch(e){r={error:e}}finally{try{S&&!S.done&&(n=_.return)&&n.call(_)}finally{if(r)throw r.error}}p+=d.tree_nodeLength(v),v=v._nextSibling}for(var T=0;T<f.length;T++)null!==(y=f[T])._parent&&d.mutation_remove(y,y._parent)}else d.mutation_remove(c,c._parent)}}},t.prototype.cloneNode=function(e){if(void 0===e&&(e=!1),u.Guard.isShadowRoot(this))throw new c.NotSupportedError;return d.node_clone(this,null,e)},t.prototype.isEqualNode=function(e){return void 0===e&&(e=null),null!==e&&d.node_equals(this,e)},t.prototype.isSameNode=function(e){return void 0===e&&(e=null),this===e},t.prototype.compareDocumentPosition=function(e){if(e===this)return 0;var t=e,r=this,n=null,o=null;if(u.Guard.isAttrNode(t)&&(t=(n=t)._element),u.Guard.isAttrNode(r)&&(r=(o=r)._element,n&&t&&t===r))for(var i=0;i<r._attributeList.length;i++){var l=r._attributeList[i];if(d.node_equals(l,n))return s.Position.ImplementationSpecific|s.Position.Preceding;if(d.node_equals(l,o))return s.Position.ImplementationSpecific|s.Position.Following}return null===t||null===r||d.tree_rootNode(t)!==d.tree_rootNode(r)?s.Position.Disconnected|s.Position.ImplementationSpecific|(a.dom.compareCache.check(this,e)?s.Position.Preceding:s.Position.Following):!n&&d.tree_isAncestorOf(r,t)||o&&t===r?s.Position.Contains|s.Position.Preceding:!o&&d.tree_isDescendantOf(r,t)||n&&t===r?s.Position.ContainedBy|s.Position.Following:d.tree_isPreceding(r,t)?s.Position.Preceding:s.Position.Following},t.prototype.contains=function(e){return null!==e&&d.tree_isDescendantOf(this,e,!0)},t.prototype.lookupPrefix=function(e){return e?u.Guard.isElementNode(this)?d.node_locateANamespacePrefix(this,e):u.Guard.isDocumentNode(this)?null===this.documentElement?null:d.node_locateANamespacePrefix(this.documentElement,e):u.Guard.isDocumentTypeNode(this)||u.Guard.isDocumentFragmentNode(this)?null:u.Guard.isAttrNode(this)?null===this._element?null:d.node_locateANamespacePrefix(this._element,e):null!==this._parent&&u.Guard.isElementNode(this._parent)?d.node_locateANamespacePrefix(this._parent,e):null:null},t.prototype.lookupNamespaceURI=function(e){return d.node_locateANamespace(this,e||null)},t.prototype.isDefaultNamespace=function(e){return e||(e=null),d.node_locateANamespace(this,null)===e},t.prototype.insertBefore=function(e,t){return d.mutation_preInsert(e,this,t)},t.prototype.appendChild=function(e){return d.mutation_append(e,this)},t.prototype.replaceChild=function(e,t){return d.mutation_replace(t,e,this)},t.prototype.removeChild=function(e){return d.mutation_preRemove(e,this)},t.prototype._getTheParent=function(e){return u.Guard.isSlotable(this)&&d.shadowTree_isAssigned(this)?this._assignedSlot:this._parent},t.ELEMENT_NODE=1,t.ATTRIBUTE_NODE=2,t.TEXT_NODE=3,t.CDATA_SECTION_NODE=4,t.ENTITY_REFERENCE_NODE=5,t.ENTITY_NODE=6,t.PROCESSING_INSTRUCTION_NODE=7,t.COMMENT_NODE=8,t.DOCUMENT_NODE=9,t.DOCUMENT_TYPE_NODE=10,t.DOCUMENT_FRAGMENT_NODE=11,t.NOTATION_NODE=12,t.DOCUMENT_POSITION_DISCONNECTED=1,t.DOCUMENT_POSITION_PRECEDING=2,t.DOCUMENT_POSITION_FOLLOWING=4,t.DOCUMENT_POSITION_CONTAINS=8,t.DOCUMENT_POSITION_CONTAINED_BY=16,t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,t}(l.EventTargetImpl);t.NodeImpl=h,h.prototype._children=new u.EmptySet,f.idl_defineConst(h.prototype,"ELEMENT_NODE",1),f.idl_defineConst(h.prototype,"ATTRIBUTE_NODE",2),f.idl_defineConst(h.prototype,"TEXT_NODE",3),f.idl_defineConst(h.prototype,"CDATA_SECTION_NODE",4),f.idl_defineConst(h.prototype,"ENTITY_REFERENCE_NODE",5),f.idl_defineConst(h.prototype,"ENTITY_NODE",6),f.idl_defineConst(h.prototype,"PROCESSING_INSTRUCTION_NODE",7),f.idl_defineConst(h.prototype,"COMMENT_NODE",8),f.idl_defineConst(h.prototype,"DOCUMENT_NODE",9),f.idl_defineConst(h.prototype,"DOCUMENT_TYPE_NODE",10),f.idl_defineConst(h.prototype,"DOCUMENT_FRAGMENT_NODE",11),f.idl_defineConst(h.prototype,"NOTATION_NODE",12),f.idl_defineConst(h.prototype,"DOCUMENT_POSITION_DISCONNECTED",1),f.idl_defineConst(h.prototype,"DOCUMENT_POSITION_PRECEDING",2),f.idl_defineConst(h.prototype,"DOCUMENT_POSITION_FOLLOWING",4),f.idl_defineConst(h.prototype,"DOCUMENT_POSITION_CONTAINS",8),f.idl_defineConst(h.prototype,"DOCUMENT_POSITION_CONTAINED_BY",16),f.idl_defineConst(h.prototype,"DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC",32)},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(87),o=r(41),i=r(27),a=r(26),s=r(128),l=[].push,u=function(e){var t=1==e,r=2==e,u=3==e,c=4==e,d=6==e,p=5==e||d;return function(f,h,m,g){for(var y,v,b=i(f),x=o(b),_=n(h,m,3),S=a(x.length),C=0,T=g||s,w=t?T(f,S):r?T(f,0):void 0;S>C;C++)if((p||C in x)&&(v=_(y=x[C],C,b),e))if(t)w[C]=v;else if(v)switch(e){case 3:return!0;case 5:return y;case 6:return C;case 2:l.call(w,y)}else if(c)return!1;return d?-1:u||c?c:w}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6)}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0});var a=r(6),s=r(9),l=r(2),u=r(3),c=r(1),d=r(7),p=r(73),f=r(17),h=r(172),m=r(72),g=r(51),y=r(30),v=r(106);function b(e,t,r){var o,i,a,u,c,d,p,h,m=t._nodeType,g=e._nodeType,y=r?r._nodeType:null;if(m!==l.NodeType.Document&&m!==l.NodeType.DocumentFragment&&m!==l.NodeType.Element)throw new s.HierarchyRequestError("Only document, document fragment and element nodes can contain child nodes. Parent node is "+t.nodeName+".");if(f.tree_isHostIncludingAncestorOf(t,e,!0))throw new s.HierarchyRequestError("The node to be inserted cannot be an inclusive ancestor of parent node. Node is "+e.nodeName+", parent node is "+t.nodeName+".");if(null!==r&&r._parent!==t)throw new s.NotFoundError("The reference child node cannot be found under parent node. Child node is "+r.nodeName+", parent node is "+t.nodeName+".");if(g!==l.NodeType.DocumentFragment&&g!==l.NodeType.DocumentType&&g!==l.NodeType.Element&&g!==l.NodeType.Text&&g!==l.NodeType.ProcessingInstruction&&g!==l.NodeType.CData&&g!==l.NodeType.Comment)throw new s.HierarchyRequestError("Only document fragment, document type, element, text, processing instruction, cdata section or comment nodes can be inserted. Node is "+e.nodeName+".");if(g===l.NodeType.Text&&m===l.NodeType.Document)throw new s.HierarchyRequestError("Cannot insert a text node as a child of a document node. Node is "+e.nodeName+".");if(g===l.NodeType.DocumentType&&m!==l.NodeType.Document)throw new s.HierarchyRequestError("A document type node can only be inserted under a document node. Parent node is "+t.nodeName+".");if(m===l.NodeType.Document)if(g===l.NodeType.DocumentFragment){var v=0;try{for(var b=n(e._children),x=b.next();!x.done;x=b.next()){var _=x.value;if(_._nodeType===l.NodeType.Element)v++;else if(_._nodeType===l.NodeType.Text)throw new s.HierarchyRequestError("Cannot insert text a node as a child of a document node. Node is "+_.nodeName+".")}}catch(e){o={error:e}}finally{try{x&&!x.done&&(i=b.return)&&i.call(b)}finally{if(o)throw o.error}}if(v>1)throw new s.HierarchyRequestError("A document node can only have one document element node. Document fragment to be inserted has "+v+" element nodes.");if(1===v){try{for(var S=n(t._children),C=S.next();!C.done;C=S.next())if(C.value._nodeType===l.NodeType.Element)throw new s.HierarchyRequestError("The document node already has a document element node.")}catch(e){a={error:e}}finally{try{C&&!C.done&&(u=S.return)&&u.call(S)}finally{if(a)throw a.error}}if(r){if(y===l.NodeType.DocumentType)throw new s.HierarchyRequestError("Cannot insert an element node before a document type node.");for(var T=r._nextSibling;T;){if(T._nodeType===l.NodeType.DocumentType)throw new s.HierarchyRequestError("Cannot insert an element node before a document type node.");T=T._nextSibling}}}}else if(g===l.NodeType.Element){try{for(var w=n(t._children),A=w.next();!A.done;A=w.next())if(A.value._nodeType===l.NodeType.Element)throw new s.HierarchyRequestError("Document already has a document element node. Node is "+e.nodeName+".")}catch(e){c={error:e}}finally{try{A&&!A.done&&(d=w.return)&&d.call(w)}finally{if(c)throw c.error}}if(r){if(y===l.NodeType.DocumentType)throw new s.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+e.nodeName+".");for(T=r._nextSibling;T;){if(T._nodeType===l.NodeType.DocumentType)throw new s.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+e.nodeName+".");T=T._nextSibling}}}else if(g===l.NodeType.DocumentType){try{for(var E=n(t._children),D=E.next();!D.done;D=E.next())if(D.value._nodeType===l.NodeType.DocumentType)throw new s.HierarchyRequestError("Document already has a document type node. Node is "+e.nodeName+".")}catch(e){p={error:e}}finally{try{D&&!D.done&&(h=E.return)&&h.call(E)}finally{if(p)throw p.error}}if(r)for(var P=r._previousSibling;P;){if(P._nodeType===l.NodeType.Element)throw new s.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+e.nodeName+".");P=P._previousSibling}else for(P=t._firstChild;P;){if(P._nodeType===l.NodeType.Element)throw new s.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+e.nodeName+".");P=P._nextSibling}}}function x(e,t,r){b(e,t,r);var n=r;return n===e&&(n=e._nextSibling),v.document_adopt(e,t._nodeDocument),_(e,t,n),e}function _(e,t,r,o){var s,h;if(null!==r||e._nodeType===l.NodeType.DocumentFragment){var v=e._nodeType===l.NodeType.DocumentFragment?e._children.size:1;if(null!==r&&0!==a.dom.rangeList.size){var b=f.tree_index(r);try{for(var x=n(a.dom.rangeList),_=x.next();!_.done;_=x.next()){var C=_.value;C._start[0]===t&&C._start[1]>b&&(C._start[1]+=v),C._end[0]===t&&C._end[1]>b&&(C._end[1]+=v)}}catch(e){s={error:e}}finally{try{_&&!_.done&&(h=x.return)&&h.call(x)}finally{if(s)throw s.error}}}var T=e._nodeType===l.NodeType.DocumentFragment?new(Array.bind.apply(Array,i([void 0],e._children))):[e];if(e._nodeType===l.NodeType.DocumentFragment)for(;e._firstChild;)S(e._firstChild,e,!0);a.dom.features.mutationObservers&&e._nodeType===l.NodeType.DocumentFragment&&g.observer_queueTreeMutationRecord(e,[],T,null,null);for(var w=r?r._previousSibling:t._lastChild,A=null===r?-1:f.tree_index(r),E=0;E<T.length;E++){var D=T[E];if(u.Guard.isElementNode(D)&&(u.Guard.isDocumentNode(t)&&(t._documentElement=D),D._nodeDocument._hasNamespaces||null===D._namespace&&null===D._namespacePrefix||(D._nodeDocument._hasNamespaces=!0)),D._parent=t,null===r?d.set.append(t._children,D):(d.set.insert(t._children,D,A),A++),null===t._firstChild)D._previousSibling=null,D._nextSibling=null,t._firstChild=D,t._lastChild=D;else{var P=r?r._previousSibling:t._lastChild,I=r||null;D._previousSibling=P,D._nextSibling=I,P&&(P._nextSibling=D),I&&(I._previousSibling=D),P||(t._firstChild=D),I||(t._lastChild=D)}a.dom.features.slots&&null!==t._shadowRoot&&u.Guard.isSlotable(D)&&m.shadowTree_assignASlot(D),a.dom.features.steps&&u.Guard.isTextNode(D)&&y.dom_runChildTextContentChangeSteps(t),a.dom.features.slots&&u.Guard.isShadowRoot(f.tree_rootNode(t))&&u.Guard.isSlot(t)&&c.isEmpty(t._assignedNodes)&&m.shadowTree_signalASlotChange(t),a.dom.features.slots&&m.shadowTree_assignSlotablesForATree(f.tree_rootNode(D));for(var O=f.tree_getFirstDescendantNode(D,!0,!0);null!==O;)a.dom.features.steps&&y.dom_runInsertionSteps(O),a.dom.features.customElements&&u.Guard.isElementNode(O)&&m.shadowTree_isConnected(O)&&(u.Guard.isCustomElementNode(O)?p.customElement_enqueueACustomElementCallbackReaction(O,"connectedCallback",[]):p.customElement_tryToUpgrade(O)),O=f.tree_getNextDescendantNode(D,O,!0,!0)}a.dom.features.mutationObservers&&(o||g.observer_queueTreeMutationRecord(t,T,[],w,r))}else!function(e,t,r){var n=t._lastChild;if(u.Guard.isElementNode(e)&&(u.Guard.isDocumentNode(t)&&(t._documentElement=e),e._nodeDocument._hasNamespaces||null===e._namespace&&null===e._namespacePrefix||(e._nodeDocument._hasNamespaces=!0)),e._parent=t,t._children.add(e),null===t._firstChild)e._previousSibling=null,e._nextSibling=null,t._firstChild=e,t._lastChild=e;else{var o=t._lastChild;e._previousSibling=o,e._nextSibling=null,o&&(o._nextSibling=e),o||(t._firstChild=e),t._lastChild=e}a.dom.features.slots&&null!==t._shadowRoot&&u.Guard.isSlotable(e)&&m.shadowTree_assignASlot(e),a.dom.features.steps&&u.Guard.isTextNode(e)&&y.dom_runChildTextContentChangeSteps(t),a.dom.features.slots&&u.Guard.isShadowRoot(f.tree_rootNode(t))&&u.Guard.isSlot(t)&&c.isEmpty(t._assignedNodes)&&m.shadowTree_signalASlotChange(t),a.dom.features.slots&&m.shadowTree_assignSlotablesForATree(f.tree_rootNode(e)),a.dom.features.steps&&y.dom_runInsertionSteps(e),a.dom.features.customElements&&u.Guard.isElementNode(e)&&m.shadowTree_isConnected(e)&&(u.Guard.isCustomElementNode(e)?p.customElement_enqueueACustomElementCallbackReaction(e,"connectedCallback",[]):p.customElement_tryToUpgrade(e)),a.dom.features.mutationObservers&&(r||g.observer_queueTreeMutationRecord(t,[e],[],n,null))}(e,t,o)}function S(e,t,r){var o,i,s,l,d,v,b,x;if(0!==a.dom.rangeList.size){var _=f.tree_index(e);try{for(var S=n(a.dom.rangeList),C=S.next();!C.done;C=S.next()){var T=C.value;f.tree_isDescendantOf(e,T._start[0],!0)&&(T._start=[t,_]),f.tree_isDescendantOf(e,T._end[0],!0)&&(T._end=[t,_]),T._start[0]===t&&T._start[1]>_&&T._start[1]--,T._end[0]===t&&T._end[1]>_&&T._end[1]--}}catch(e){o={error:e}}finally{try{C&&!C.done&&(i=S.return)&&i.call(S)}finally{if(o)throw o.error}}try{for(var w=n(a.dom.rangeList),A=w.next();!A.done;A=w.next())(T=A.value)._start[0]===t&&T._start[1]>_&&(T._start[1]-=1),T._end[0]===t&&T._end[1]>_&&(T._end[1]-=1)}catch(e){s={error:e}}finally{try{A&&!A.done&&(l=w.return)&&l.call(w)}finally{if(s)throw s.error}}}if(a.dom.features.steps)try{for(var E=n(h.nodeIterator_iteratorList()),D=E.next();!D.done;D=E.next()){var P=D.value;P._root._nodeDocument===e._nodeDocument&&y.dom_runNodeIteratorPreRemovingSteps(P,e)}}catch(e){d={error:e}}finally{try{D&&!D.done&&(v=E.return)&&v.call(E)}finally{if(d)throw d.error}}var I=e._previousSibling,O=e._nextSibling;u.Guard.isDocumentNode(t)&&u.Guard.isElementNode(e)&&(t._documentElement=null),e._parent=null,t._children.delete(e);var N=e._previousSibling,M=e._nextSibling;e._previousSibling=null,e._nextSibling=null,N&&(N._nextSibling=M),M&&(M._previousSibling=N),N||(t._firstChild=M),M||(t._lastChild=N),a.dom.features.slots&&u.Guard.isSlotable(e)&&null!==e._assignedSlot&&m.shadowTree_isAssigned(e)&&m.shadowTree_assignSlotables(e._assignedSlot),a.dom.features.slots&&u.Guard.isShadowRoot(f.tree_rootNode(t))&&u.Guard.isSlot(t)&&c.isEmpty(t._assignedNodes)&&m.shadowTree_signalASlotChange(t),a.dom.features.slots&&null!==f.tree_getFirstDescendantNode(e,!0,!1,function(e){return u.Guard.isSlot(e)})&&(m.shadowTree_assignSlotablesForATree(f.tree_rootNode(t)),m.shadowTree_assignSlotablesForATree(e)),a.dom.features.steps&&y.dom_runRemovingSteps(e,t),a.dom.features.customElements&&u.Guard.isCustomElementNode(e)&&p.customElement_enqueueACustomElementCallbackReaction(e,"disconnectedCallback",[]);for(var R=f.tree_getFirstDescendantNode(e,!1,!0);null!==R;)a.dom.features.steps&&y.dom_runRemovingSteps(R,e),a.dom.features.customElements&&u.Guard.isCustomElementNode(R)&&p.customElement_enqueueACustomElementCallbackReaction(R,"disconnectedCallback",[]),R=f.tree_getNextDescendantNode(e,R,!1,!0);if(a.dom.features.mutationObservers)for(var F=f.tree_getFirstAncestorNode(t,!0);null!==F;){try{for(var B=(b=void 0,n(F._registeredObserverList)),L=B.next();!L.done;L=B.next()){var k=L.value;k.options.subtree&&e._registeredObserverList.push({observer:k.observer,options:k.options,source:k})}}catch(e){b={error:e}}finally{try{L&&!L.done&&(x=B.return)&&x.call(B)}finally{if(b)throw b.error}}F=f.tree_getNextAncestorNode(t,F,!0)}a.dom.features.mutationObservers&&(r||g.observer_queueTreeMutationRecord(t,[],[e],I,O)),a.dom.features.steps&&u.Guard.isTextNode(e)&&y.dom_runChildTextContentChangeSteps(t)}t.mutation_ensurePreInsertionValidity=b,t.mutation_preInsert=x,t.mutation_insert=_,t.mutation_append=function(e,t){return x(e,t,null)},t.mutation_replace=function(e,t,r){var o,i,u,c,d,p,h,m;if(r._nodeType!==l.NodeType.Document&&r._nodeType!==l.NodeType.DocumentFragment&&r._nodeType!==l.NodeType.Element)throw new s.HierarchyRequestError("Only document, document fragment and element nodes can contain child nodes. Parent node is "+r.nodeName+".");if(f.tree_isHostIncludingAncestorOf(r,t,!0))throw new s.HierarchyRequestError("The node to be inserted cannot be an ancestor of parent node. Node is "+t.nodeName+", parent node is "+r.nodeName+".");if(e._parent!==r)throw new s.NotFoundError("The reference child node cannot be found under parent node. Child node is "+e.nodeName+", parent node is "+r.nodeName+".");if(t._nodeType!==l.NodeType.DocumentFragment&&t._nodeType!==l.NodeType.DocumentType&&t._nodeType!==l.NodeType.Element&&t._nodeType!==l.NodeType.Text&&t._nodeType!==l.NodeType.ProcessingInstruction&&t._nodeType!==l.NodeType.CData&&t._nodeType!==l.NodeType.Comment)throw new s.HierarchyRequestError("Only document fragment, document type, element, text, processing instruction, cdata section or comment nodes can be inserted. Node is "+t.nodeName+".");if(t._nodeType===l.NodeType.Text&&r._nodeType===l.NodeType.Document)throw new s.HierarchyRequestError("Cannot insert a text node as a child of a document node. Node is "+t.nodeName+".");if(t._nodeType===l.NodeType.DocumentType&&r._nodeType!==l.NodeType.Document)throw new s.HierarchyRequestError("A document type node can only be inserted under a document node. Parent node is "+r.nodeName+".");if(r._nodeType===l.NodeType.Document)if(t._nodeType===l.NodeType.DocumentFragment){var y=0;try{for(var b=n(t._children),x=b.next();!x.done;x=b.next()){var C=x.value;if(C._nodeType===l.NodeType.Element)y++;else if(C._nodeType===l.NodeType.Text)throw new s.HierarchyRequestError("Cannot insert text a node as a child of a document node. Node is "+C.nodeName+".")}}catch(e){o={error:e}}finally{try{x&&!x.done&&(i=b.return)&&i.call(b)}finally{if(o)throw o.error}}if(y>1)throw new s.HierarchyRequestError("A document node can only have one document element node. Document fragment to be inserted has "+y+" element nodes.");if(1===y){try{for(var T=n(r._children),w=T.next();!w.done;w=T.next())if((O=w.value)._nodeType===l.NodeType.Element&&O!==e)throw new s.HierarchyRequestError("The document node already has a document element node.")}catch(e){u={error:e}}finally{try{w&&!w.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}for(var A=e._nextSibling;A;){if(A._nodeType===l.NodeType.DocumentType)throw new s.HierarchyRequestError("Cannot insert an element node before a document type node.");A=A._nextSibling}}}else if(t._nodeType===l.NodeType.Element){try{for(var E=n(r._children),D=E.next();!D.done;D=E.next())if((O=D.value)._nodeType===l.NodeType.Element&&O!==e)throw new s.HierarchyRequestError("Document already has a document element node. Node is "+t.nodeName+".")}catch(e){d={error:e}}finally{try{D&&!D.done&&(p=E.return)&&p.call(E)}finally{if(d)throw d.error}}for(A=e._nextSibling;A;){if(A._nodeType===l.NodeType.DocumentType)throw new s.HierarchyRequestError("Cannot insert an element node before a document type node. Node is "+t.nodeName+".");A=A._nextSibling}}else if(t._nodeType===l.NodeType.DocumentType){try{for(var P=n(r._children),I=P.next();!I.done;I=P.next()){var O;if((O=I.value)._nodeType===l.NodeType.DocumentType&&O!==e)throw new s.HierarchyRequestError("Document already has a document type node. Node is "+t.nodeName+".")}}catch(e){h={error:e}}finally{try{I&&!I.done&&(m=P.return)&&m.call(P)}finally{if(h)throw h.error}}for(var N=e._previousSibling;N;){if(N._nodeType===l.NodeType.Element)throw new s.HierarchyRequestError("Cannot insert a document type node before an element node. Node is "+t.nodeName+".");N=N._previousSibling}}var M=e._nextSibling;M===t&&(M=t._nextSibling);var R=e._previousSibling;v.document_adopt(t,r._nodeDocument);var F=[];null!==e._parent&&(F.push(e),S(e,e._parent,!0));var B=[];return t._nodeType===l.NodeType.DocumentFragment?B=Array.from(t._children):B.push(t),_(t,r,M,!0),a.dom.features.mutationObservers&&g.observer_queueTreeMutationRecord(r,B,F,R,M),e},t.mutation_replaceAll=function(e,t){var r,o;null!==e&&v.document_adopt(e,t._nodeDocument);var i=Array.from(t._children),s=[];e&&e._nodeType===l.NodeType.DocumentFragment?s=Array.from(e._children):null!==e&&s.push(e);try{for(var u=n(i),c=u.next();!c.done;c=u.next())S(c.value,t,!0)}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}null!==e&&_(e,t,null,!0),a.dom.features.mutationObservers&&g.observer_queueTreeMutationRecord(t,s,i,null,null)},t.mutation_preRemove=function(e,t){if(e._parent!==t)throw new s.NotFoundError("The child node cannot be found under parent node. Child node is "+e.nodeName+", parent node is "+t.nodeName+".");return S(e,t),e},t.mutation_remove=S},function(e,t,r){"use strict";function n(e){return null==e}e.exports.isNothing=n,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:n(e)?[]:[e]},e.exports.repeat=function(e,t){var r,n="";for(r=0;r<t;r+=1)n+=e;return n},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var r,n,o,i;if(t)for(r=0,n=(i=Object.keys(t)).length;r<n;r+=1)e[o=i[r]]=t[o];return e}},function(e,t,r){"use strict";var n=r(38),o=r(53),i=r(10);function a(e,t,r){var n=[];return e.include.forEach(function(e){r=a(e,t,r)}),e[t].forEach(function(e){r.forEach(function(t,r){t.tag===e.tag&&t.kind===e.kind&&n.push(r)}),r.push(e)}),r.filter(function(e,t){return-1===n.indexOf(t)})}function s(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,r={scalar:{},sequence:{},mapping:{},fallback:{}};function n(e){r[e.kind][e.tag]=r.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(n);return r}(this.compiledImplicit,this.compiledExplicit)}s.DEFAULT=null,s.create=function(){var e,t;switch(arguments.length){case 1:e=s.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new o("Wrong number of arguments for Schema.create function")}if(e=n.toArray(e),t=n.toArray(t),!e.every(function(e){return e instanceof s}))throw new o("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof i}))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new s({include:e,explicit:t})},e.exports=s},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(8),o=r(42),i="".split;e.exports=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var n,o,i,a=r(186),s=r(11),l=r(13),u=r(21),c=r(14),d=r(57),p=r(45),f=s.WeakMap;if(a){var h=new f,m=h.get,g=h.has,y=h.set;n=function(e,t){return y.call(h,e,t),t},o=function(e){return m.call(h,e)||{}},i=function(e){return g.call(h,e)}}else{var v=d("state");p[v]=!0,n=function(e,t){return u(e,v,t),t},o=function(e){return c(e,v)?e[v]:{}},i=function(e){return c(e,v)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}}},function(e,t){e.exports=!1},function(e,t){e.exports={}},function(e,t,r){var n=r(120),o=r(11),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(n[e])||i(o[e]):n[e]&&n[e][t]||o[e]&&o[e][t]}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){"use strict";var n=r(8);e.exports=function(e,t){var r=[][e];return!!r&&n(function(){r.call(null,t||function(){throw 1},1)})}},function(e,t){e.exports={}},function(e,t,r){"use strict";r(31),r(32),r(33),r(220),r(64),r(19),r(65),r(20),r(68),r(66),r(92),r(144),r(22),r(94),r(23);var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),s=r(69),l=r(95),u=r(7),c=r(0),d=function(){function e(e){this.level=0,this._builderOptions=e}return e.prototype.declaration=function(e,t,r){},e.prototype.docType=function(e,t,r){},e.prototype.comment=function(e){},e.prototype.text=function(e){},e.prototype.instruction=function(e,t){},e.prototype.cdata=function(e){},e.prototype.openTagBegin=function(e){},e.prototype.openTagEnd=function(e,t,r){},e.prototype.closeTag=function(e){},e.prototype.attributes=function(e){var t,r;try{for(var o=n(e),i=o.next();!i.done;i=o.next()){var a=i.value;this.attribute(null===a[1]?a[2]:a[1]+":"+a[2],a[3])}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},e.prototype.attribute=function(e,t){},e.prototype.beginElement=function(e){},e.prototype.endElement=function(e){},e.prototype.serializeNode=function(e,t){var r=void 0!==e._nodeDocument&&e._nodeDocument._hasNamespaces;if(this.level=0,this.currentNode=e,r){var n=new l.NamespacePrefixMap;n.set("xml",u.namespace.XML),this._serializeNodeNS(e,null,n,{value:1},t)}else this._serializeNode(e,t)},e.prototype._serializeNodeNS=function(e,t,r,n,o){switch(this.currentNode=e,e.nodeType){case a.NodeType.Element:this._serializeElementNS(e,t,r,n,o);break;case a.NodeType.Document:this._serializeDocumentNS(e,t,r,n,o);break;case a.NodeType.Comment:this._serializeComment(e,o);break;case a.NodeType.Text:this._serializeText(e,o);break;case a.NodeType.DocumentFragment:this._serializeDocumentFragmentNS(e,t,r,n,o);break;case a.NodeType.DocumentType:this._serializeDocumentType(e,o);break;case a.NodeType.ProcessingInstruction:this._serializeProcessingInstruction(e,o);break;case a.NodeType.CData:this._serializeCData(e,o);break;default:throw new Error("Unknown node type: "+e.nodeType)}},e.prototype._serializeNode=function(e,t){switch(this.currentNode=e,e.nodeType){case a.NodeType.Element:this._serializeElement(e,t);break;case a.NodeType.Document:this._serializeDocument(e,t);break;case a.NodeType.Comment:this._serializeComment(e,t);break;case a.NodeType.Text:this._serializeText(e,t);break;case a.NodeType.DocumentFragment:this._serializeDocumentFragment(e,t);break;case a.NodeType.DocumentType:this._serializeDocumentType(e,t);break;case a.NodeType.ProcessingInstruction:this._serializeProcessingInstruction(e,t);break;case a.NodeType.CData:this._serializeCData(e,t);break;default:throw new Error("Unknown node type: "+e.nodeType)}},e.prototype._serializeElementNS=function(t,r,o,a,s){var l,d,p=[];if(s&&(-1!==t.localName.indexOf(":")||!c.xml_isName(t.localName)))throw new Error("Node local name contains invalid characters (well-formed required).");var f="",h=!1,m=!1,g=o.copy(),y={},v=this._recordNamespaceInformation(t,g,y),b=r,x=t.namespaceURI;if(b===x)null!==v&&(m=!0),f=x===u.namespace.XML?"xml:"+t.localName:t.localName,this.beginElement(f),this.openTagBegin(f);else{var _=t.prefix,S=null;if(null===_&&x===v||(S=g.get(_,x)),"xmlns"===_){if(s)throw new Error("An element cannot have the 'xmlns' prefix (well-formed required).");S=_}null!==S?(f=S+":"+t.localName,null!==v&&v!==u.namespace.XML&&(b=v||null),this.beginElement(f),this.openTagBegin(f)):null!==_?(_ in y&&(_=this._generatePrefix(x,g,a)),g.set(_,x),f+=_+":"+t.localName,this.beginElement(f),this.openTagBegin(f),p.push([null,"xmlns",_,this._serializeAttributeValue(x,s)]),null!==v&&(b=v||null)):null===v||null!==v&&v!==x?(m=!0,f+=t.localName,b=x,this.beginElement(f),this.openTagBegin(f),p.push([null,null,"xmlns",this._serializeAttributeValue(x,s)])):(f+=t.localName,b=x,this.beginElement(f),this.openTagBegin(f))}p.push.apply(p,i(this._serializeAttributesNS(t,g,a,y,m,s))),this.attributes(p);var C=x===u.namespace.HTML;if(C&&0===t.childNodes.length&&e._VoidElementNames.has(t.localName)?(this.openTagEnd(f,!0,!0),this.endElement(f),h=!0):C||0!==t.childNodes.length?this.openTagEnd(f,!1,!1):(this.openTagEnd(f,!0,!1),this.endElement(f),h=!0),!h){if(C&&"template"===t.localName);else try{for(var T=n(t.childNodes),w=T.next();!w.done;w=T.next()){var A=w.value;this.level++,this._serializeNodeNS(A,b,g,a,s),this.level--}}catch(e){l={error:e}}finally{try{w&&!w.done&&(d=T.return)&&d.call(T)}finally{if(l)throw l.error}}this.closeTag(f),this.endElement(f)}},e.prototype._serializeElement=function(e,t){var r,o;if(t&&(-1!==e.localName.indexOf(":")||!c.xml_isName(e.localName)))throw new Error("Node local name contains invalid characters (well-formed required).");var i=!1,a=e.localName;this.beginElement(a),this.openTagBegin(a);var s=this._serializeAttributes(e,t);if(this.attributes(s),e.hasChildNodes()?this.openTagEnd(a,!1,!1):(this.openTagEnd(a,!0,!1),this.endElement(a),i=!0),!i){try{for(var l=n(e._children),u=l.next();!u.done;u=l.next()){var d=u.value;this.level++,this._serializeNode(d,t),this.level--}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}this.closeTag(a),this.endElement(a)}},e.prototype._serializeDocumentNS=function(e,t,r,o,i){var a,s;if(i&&null===e.documentElement)throw new Error("Missing document element (well-formed required).");try{for(var l=n(e.childNodes),u=l.next();!u.done;u=l.next()){var c=u.value;this._serializeNodeNS(c,t,r,o,i)}}catch(e){a={error:e}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}},e.prototype._serializeDocument=function(e,t){var r,o;if(t&&null===e.documentElement)throw new Error("Missing document element (well-formed required).");try{for(var i=n(e._children),a=i.next();!a.done;a=i.next()){var s=a.value;this._serializeNode(s,t)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}},e.prototype._serializeComment=function(e,t){if(t&&(!c.xml_isLegalChar(e.data)||-1!==e.data.indexOf("--")||e.data.endsWith("-")))throw new Error("Comment data contains invalid characters (well-formed required).");this.comment(e.data)},e.prototype._serializeText=function(e,t){if(t&&!c.xml_isLegalChar(e.data))throw new Error("Text data contains invalid characters (well-formed required).");var r=e.data.replace(/(?!&([^&;]*);)&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");this.text(r)},e.prototype._serializeDocumentFragmentNS=function(e,t,r,o,i){var a,s;try{for(var l=n(e.childNodes),u=l.next();!u.done;u=l.next()){var c=u.value;this._serializeNodeNS(c,t,r,o,i)}}catch(e){a={error:e}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}},e.prototype._serializeDocumentFragment=function(e,t){var r,o;try{for(var i=n(e._children),a=i.next();!a.done;a=i.next()){var s=a.value;this._serializeNode(s,t)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}},e.prototype._serializeDocumentType=function(e,t){if(t&&!c.xml_isPubidChar(e.publicId))throw new Error("DocType public identifier does not match PubidChar construct (well-formed required).");if(t&&(!c.xml_isLegalChar(e.systemId)||-1!==e.systemId.indexOf('"')&&-1!==e.systemId.indexOf("'")))throw new Error("DocType system identifier contains invalid characters (well-formed required).");this.docType(e.name,e.publicId,e.systemId)},e.prototype._serializeProcessingInstruction=function(e,t){if(t&&(-1!==e.target.indexOf(":")||/^xml$/i.test(e.target)))throw new Error("Processing instruction target contains invalid characters (well-formed required).");if(t&&(!c.xml_isLegalChar(e.data)||-1!==e.data.indexOf("?>")))throw new Error("Processing instruction data contains invalid characters (well-formed required).");this.instruction(e.target,e.data)},e.prototype._serializeCData=function(e,t){if(t&&-1!==e.data.indexOf("]]>"))throw new Error("CDATA contains invalid characters (well-formed required).");this.cdata(e.data)},e.prototype._serializeAttributesNS=function(e,t,r,o,i,a){var l,d,p=[],f=a?new s.LocalNameSet:void 0;try{for(var h=n(e.attributes),m=h.next();!m.done;m=h.next()){var g=m.value;if(a||i||null!==g.namespaceURI){if(a&&f&&f.has(g.namespaceURI,g.localName))throw new Error("Element contains duplicate attributes (well-formed required).");a&&f&&f.set(g.namespaceURI,g.localName);var y=g.namespaceURI,v=null;if(null!==y)if(v=t.get(g.prefix,y),y===u.namespace.XMLNS){if(g.value===u.namespace.XML||null===g.prefix&&i||null!==g.prefix&&(!(g.localName in o)||o[g.localName]!==g.value)&&t.has(g.localName,g.value))continue;if(a&&g.value===u.namespace.XMLNS)throw new Error("XMLNS namespace is reserved (well-formed required).");if(a&&""===g.value)throw new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required).");"xmlns"===g.prefix&&(v="xmlns")}else null===v&&(v=null===g.prefix||t.hasPrefix(g.prefix)&&!t.has(g.prefix,y)?this._generatePrefix(y,t,r):g.prefix,p.push([null,"xmlns",v,this._serializeAttributeValue(y,a)]));if(a&&(-1!==g.localName.indexOf(":")||!c.xml_isName(g.localName)||"xmlns"===g.localName&&null===y))throw new Error("Attribute local name contains invalid characters (well-formed required).");p.push([y,v,g.localName,this._serializeAttributeValue(g.value,a)])}else p.push([null,null,g.localName,this._serializeAttributeValue(g.value,a)])}}catch(e){l={error:e}}finally{try{m&&!m.done&&(d=h.return)&&d.call(h)}finally{if(l)throw l.error}}return p},e.prototype._serializeAttributes=function(e,t){var r,o,i=[],a=t?{}:void 0;try{for(var s=n(e.attributes),l=s.next();!l.done;l=s.next()){var u=l.value;if(t){if(t&&a&&u.localName in a)throw new Error("Element contains duplicate attributes (well-formed required).");if(t&&a&&(a[u.localName]=!0),t&&(-1!==u.localName.indexOf(":")||!c.xml_isName(u.localName)))throw new Error("Attribute local name contains invalid characters (well-formed required).");i.push([null,null,u.localName,this._serializeAttributeValue(u.value,t)])}else i.push([null,null,u.localName,this._serializeAttributeValue(u.value,t)])}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i},e.prototype._recordNamespaceInformation=function(e,t,r){var o,i,a=null;try{for(var s=n(e.attributes),l=s.next();!l.done;l=s.next()){var c=l.value,d=c.namespaceURI,p=c.prefix;if(d===u.namespace.XMLNS){if(null===p){a=c.value;continue}var f=c.localName,h=c.value;if(h===u.namespace.XML)continue;if(""===h&&(h=null),t.has(f,h))continue;t.set(f,h),r[f]=h||""}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return a},e.prototype._generatePrefix=function(e,t,r){var n="ns"+r.value.toString();return r.value++,t.set(n,e),n},e.prototype._serializeAttributeValue=function(e,t){if(t&&null!==e&&!c.xml_isLegalChar(e))throw new Error("Invalid characters in attribute value.");return null===e?"":e.replace(/(?!&([^&;]*);)&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},e._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),e}();t.BaseWriter=d},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),a=r(3),s=r(7),l=r(29),u=r(17),c=r(97);function d(){var e=i.dom.window;e._mutationObserverMicrotaskQueued||(e._mutationObserverMicrotaskQueued=!0,Promise.resolve().then(function(){p()}))}function p(){var e,t,r,o,l=i.dom.window;l._mutationObserverMicrotaskQueued=!1;var u=s.set.clone(l._mutationObservers),d=s.set.clone(l._signalSlots);s.set.empty(l._signalSlots);var p=function(e){var t=s.list.clone(e._recordQueue);s.list.empty(e._recordQueue);for(var r=0;r<e._nodeList.length;r++){var n=e._nodeList[r];s.list.remove(n._registeredObserverList,function(t){return a.Guard.isTransientRegisteredObserver(t)&&t.observer===e})}if(!s.list.isEmpty(t))try{e._callback.call(e,t,e)}catch(e){}};try{for(var f=n(u),h=f.next();!h.done;h=f.next())p(h.value)}catch(t){e={error:t}}finally{try{h&&!h.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}if(i.dom.features.slots)try{for(var m=n(d),g=m.next();!g.done;g=m.next()){var y=g.value;c.event_fireAnEvent("slotchange",y,void 0,{bubbles:!0})}}catch(e){r={error:e}}finally{try{g&&!g.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}}function f(e,t,r,i,a,s,c,p,f){for(var h,m,g=new Map,y=u.tree_getFirstAncestorNode(t,!0);null!==y;){for(var v=0;v<y._registeredObserverList.length;v++){var b=y._registeredObserverList[v],x=b.options;if((y===t||x.subtree)&&("attributes"!==e||x.attributes)&&("attributes"!==e||!x.attributeFilter||x.attributeFilter.indexOf(r||"")&&null===i)&&("characterData"!==e||x.characterData)&&("childList"!==e||x.childList)){var _=b.observer;g.has(_)||g.set(_,null),("attributes"===e&&x.attributeOldValue||"characterData"===e&&x.characterDataOldValue)&&g.set(_,a)}}y=u.tree_getNextAncestorNode(t,y,!0)}try{for(var S=n(g),C=S.next();!C.done;C=S.next()){var T=o(C.value,2),w=T[0],A=T[1],E=l.create_mutationRecord(e,t,l.create_nodeListStatic(t,s),l.create_nodeListStatic(t,c),p,f,r,i,A);w._recordQueue.push(E)}}catch(e){h={error:e}}finally{try{C&&!C.done&&(m=S.return)&&m.call(S)}finally{if(h)throw h.error}}d()}t.observer_queueAMutationObserverMicrotask=d,t.observer_notifyMutationObservers=p,t.observer_queueMutationRecord=f,t.observer_queueTreeMutationRecord=function(e,t,r,n,o){f("childList",e,null,null,null,t,r,n,o)},t.observer_queueAttributeMutationRecord=function(e,t,r,n){f("attributes",e,t,r,n,[],[],null,null)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),o=r(7),i=r(3),a=r(9),s=r(29),l=r(73),u=r(51),c=r(30),d=r(37),p=r(106);function f(e,t,r){n.dom.features.mutationObservers&&u.observer_queueAttributeMutationRecord(t,e._localName,e._namespace,e._value),n.dom.features.customElements&&i.Guard.isCustomElementNode(t)&&l.customElement_enqueueACustomElementCallbackReaction(t,"attributeChangedCallback",[e._localName,e._value,r,e._namespace]),n.dom.features.steps&&c.dom_runAttributeChangeSteps(t,e._localName,e._value,r,e._namespace),e._value=r}function h(e,t){n.dom.features.mutationObservers&&u.observer_queueAttributeMutationRecord(t,e._localName,e._namespace,null),n.dom.features.customElements&&i.Guard.isCustomElementNode(t)&&l.customElement_enqueueACustomElementCallbackReaction(t,"attributeChangedCallback",[e._localName,null,e._value,e._namespace]),n.dom.features.steps&&c.dom_runAttributeChangeSteps(t,e._localName,null,e._value,e._namespace),t._attributeList._asArray().push(e),e._element=t,t._nodeDocument._hasNamespaces||null===e._namespace&&null===e._namespacePrefix&&"xmlns"!==e._localName||(t._nodeDocument._hasNamespaces=!0)}function m(e,t){n.dom.features.mutationObservers&&u.observer_queueAttributeMutationRecord(t,e._localName,e._namespace,e._value),n.dom.features.customElements&&i.Guard.isCustomElementNode(t)&&l.customElement_enqueueACustomElementCallbackReaction(t,"attributeChangedCallback",[e._localName,e._value,null,e._namespace]),n.dom.features.steps&&c.dom_runAttributeChangeSteps(t,e._localName,e._value,null,e._namespace);var r=t._attributeList._asArray().indexOf(e);t._attributeList._asArray().splice(r,1),e._element=null}function g(e,t,r){n.dom.features.mutationObservers&&u.observer_queueAttributeMutationRecord(r,e._localName,e._namespace,e._value),n.dom.features.customElements&&i.Guard.isCustomElementNode(r)&&l.customElement_enqueueACustomElementCallbackReaction(r,"attributeChangedCallback",[e._localName,e._value,t._value,e._namespace]),n.dom.features.steps&&c.dom_runAttributeChangeSteps(r,e._localName,e._value,t._value,e._namespace);var o=r._attributeList._asArray().indexOf(e);-1!==o&&(r._attributeList._asArray()[o]=t),e._element=null,t._element=r,r._nodeDocument._hasNamespaces||null===t._namespace&&null===t._namespacePrefix&&"xmlns"!==t._localName||(r._nodeDocument._hasNamespaces=!0)}function y(e,t){return t._namespace===o.namespace.HTML&&"html"===t._nodeDocument._type&&(e=e.toLowerCase()),t._attributeList._asArray().find(function(t){return t._qualifiedName===e})||null}function v(e,t,r){var n=e||null;return r._attributeList._asArray().find(function(e){return e._namespace===n&&e._localName===t})||null}t.element_has=function(e,t){return-1!==t._attributeList._asArray().indexOf(e)},t.element_change=f,t.element_append=h,t.element_remove=m,t.element_replace=g,t.element_getAnAttributeByName=y,t.element_getAnAttributeByNamespaceAndLocalName=v,t.element_getAnAttributeValue=function(e,t,r){void 0===r&&(r="");var n=v(r,t,e);return null===n?"":n._value},t.element_setAnAttribute=function(e,t){if(null!==e._element&&e._element!==t)throw new a.InUseAttributeError("This attribute already exists in the document: "+e._qualifiedName+" as a child of "+e._element._qualifiedName+".");var r=v(e._namespace||"",e._localName,t);return r===e?e:(null!==r?g(r,e,t):h(e,t),r)},t.element_setAnAttributeValue=function(e,t,r,n,o){void 0===n&&(n=null),void 0===o&&(o=null);var i=v(o||"",t,e);if(null===i){var a=s.create_attr(e._nodeDocument,t);return a._namespace=o,a._namespacePrefix=n,a._value=r,void h(a,e)}f(i,e,r)},t.element_removeAnAttributeByName=function(e,t){var r=y(e,t);return null!==r&&m(r,t),r},t.element_removeAnAttributeByNamespaceAndLocalName=function(e,t,r){var n=v(e,t,r);return null!==n&&m(n,r),n},t.element_createAnElement=function(e,t,r,i,u,c){void 0===i&&(i=null),void 0===u&&(u=null),void 0===c&&(c=!1);var d=null;if(!n.dom.features.customElements)return(d=s.create_element(e,t,r,i))._customElementState="uncustomized",d._customElementDefinition=null,d._is=u,d;var f=l.customElement_lookUpACustomElementDefinition(e,r,t,u);if(null!==f&&f.name!==f.localName)(d=new(p.document_elementInterface(t,o.namespace.HTML)))._localName=t,d._namespace=o.namespace.HTML,d._namespacePrefix=i,d._customElementState="undefined",d._customElementDefinition=null,d._is=u,d._nodeDocument=e,c?l.customElement_upgrade(f,d):l.customElement_enqueueACustomElementUpgradeReaction(d,f);else if(null!==f)if(c)try{var h=new(0,f.constructor);if(console.assert(void 0!==h._customElementState),console.assert(void 0!==h._customElementDefinition),console.assert(h._namespace===o.namespace.HTML),0!==h._attributeList.length)throw new a.NotSupportedError("Custom element already has attributes.");if(0!==h._children.size)throw new a.NotSupportedError("Custom element already has child nodes.");if(null!==h._parent)throw new a.NotSupportedError("Custom element already has a parent node.");if(h._nodeDocument!==e)throw new a.NotSupportedError("Custom element is already in a document.");if(h._localName!==t)throw new a.NotSupportedError("Custom element has a different local name.");h._namespacePrefix=i,h._is=null}catch(r){(d=s.create_htmlUnknownElement(e,t,o.namespace.HTML,i))._customElementState="failed",d._customElementDefinition=null,d._is=null}else(d=s.create_htmlElement(e,t,o.namespace.HTML,i))._customElementState="undefined",d._customElementDefinition=null,d._is=null,l.customElement_enqueueACustomElementUpgradeReaction(d,f);else(d=new(p.document_elementInterface(t,r)))._localName=t,d._namespace=r,d._namespacePrefix=i,d._customElementState="uncustomized",d._customElementDefinition=null,d._is=u,d._nodeDocument=e,r!==o.namespace.HTML||null===u&&!l.customElement_isValidCustomElementName(t)||(d._customElementState="undefined");if(null===d)throw new Error("Unable to create element.");return d},t.element_insertAdjacent=function(e,t,r){switch(t.toLowerCase()){case"beforebegin":return null===e._parent?null:d.mutation_preInsert(r,e._parent,e);case"afterbegin":return d.mutation_preInsert(r,e,e._firstChild);case"beforeend":return d.mutation_preInsert(r,e,null);case"afterend":return null===e._parent?null:d.mutation_preInsert(r,e._parent,e._nextSibling);default:throw new a.SyntaxError('Invalid \'where\' argument. "beforebegin", "afterbegin", "beforeend" or "afterend" expected')}}},function(e,t,r){"use strict";function n(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=n},function(e,t,r){"use strict";var n=r(39);e.exports=new n({include:[r(181)],implicit:[r(293),r(294)],explicit:[r(295),r(296),r(297),r(298)]})},function(e,t,r){var n=r(16),o=r(79),i=r(40),a=r(24),s=r(56),l=r(14),u=r(115),c=Object.getOwnPropertyDescriptor;t.f=n?c:function(e,t){if(e=a(e),t=s(t,!0),u)try{return c(e,t)}catch(e){}if(l(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t,r){var n=r(13);e.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;if("function"==typeof(r=e.valueOf)&&!n(o=r.call(e)))return o;if(!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){var n=r(81),o=r(58),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+n).toString(36)}},function(e,t,r){var n=r(42);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){var n,o=r(18),i=r(188),a=r(84),s=r(45),l=r(189),u=r(116),c=r(57)("IE_PROTO"),d=function(){},p=function(e){return"<script>"+e+"<\/script>"},f=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;f=n?function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t}(n):((t=u("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F);for(var r=a.length;r--;)delete f.prototype[a[r]];return f()};s[c]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(d.prototype=o(e),r=new d,d.prototype=null,r[c]=e):r=f(),void 0===t?r:i(r,t)}},function(e,t,r){var n=r(121),o=r(84);e.exports=Object.keys||function(e){return n(e,o)}},function(e,t,r){var n=r(15).f,o=r(14),i=r(5)("toStringTag");e.exports=function(e,t,r){e&&!o(e=r?e:e.prototype,i)&&n(e,i,{configurable:!0,value:t})}},function(e,t,r){var n=r(8),o=r(5),i=r(129),a=o("species");e.exports=function(e){return i>=51||!n(function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},function(e,t,r){"use strict";var n=r(4),o=r(122).indexOf,i=r(48),a=r(28),s=[].indexOf,l=!!s&&1/[1].indexOf(1,-0)<0,u=i("indexOf"),c=a("indexOf",{ACCESSORS:!0,1:0});n({target:"Array",proto:!0,forced:l||!u||!c},{indexOf:function(e){return l?s.apply(this,arguments)||0:o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(16),o=r(15).f,i=Function.prototype,a=i.toString,s=/^\s*function ([^ (]*)/;n&&!("name"in i)&&o(i,"name",{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(e){return""}}})},function(e,t,r){"use strict";var n=r(25),o=r(18),i=r(8),a=r(136),s=RegExp.prototype,l=s.toString,u=i(function(){return"/a/b"!=l.call({source:"a",flags:"b"})}),c="toString"!=l.name;(u||c)&&n(RegExp.prototype,"toString",function(){var e=o(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in s)?a.call(e):r)},{unsafe:!0})},function(e,t,r){"use strict";r(31),r(32),r(33),r(19),r(138),r(20),r(66),r(22),r(23);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=r(1),s=r(2),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n._writerOptions=a.applyDefaults(r,{format:"object",wellFormed:!1,group:!1,verbose:!1}),n}return o(t,e),t.prototype.serialize=function(e){return this._currentList=[],this._currentIndex=0,this._listRegister=[this._currentList],this.serializeNode(e,this._writerOptions.wellFormed),this._process(this._currentList,this._writerOptions)},t.prototype._process=function(e,t){var r,n,o,i,l,u,c;if(0===e.length)return{};for(var d={},p=!1,f=0,h=0,m=0,g=0,y=0;y<e.length;y++){var v=e[y];switch(R=Object.keys(v)[0]){case"@":continue;case"#":f++;break;case"!":h++;break;case"?":m++;break;case"$":g++;break;default:d[R]?p=!0:d[R]=!0}}var b=this._getAttrKey(),x=this._getNodeKey(s.NodeType.Text),_=this._getNodeKey(s.NodeType.Comment),S=this._getNodeKey(s.NodeType.ProcessingInstruction),C=this._getNodeKey(s.NodeType.CData);if(1===f&&1===e.length&&a.isString(e[0]["#"]))return e[0]["#"];if(p){var T={};for(y=0;y<e.length;y++)if(v=e[y],"@"===(R=Object.keys(v)[0])){var w=v["@"];1===(F=Object.keys(w)).length?T[b+F[0]]=w[F[0]]:T[b]=v["@"]}var A=[];for(y=0;y<e.length;y++)switch(v=e[y],R=Object.keys(v)[0]){case"@":break;case"#":A.push(((r={})[x]=v["#"],r));break;case"!":A.push(((n={})[_]=v["!"],n));break;case"?":A.push(((o={})[S]=v["?"],o));break;case"$":A.push(((i={})[C]=v.$,i));break;default:if(0!==(L=v)[R].length&&a.isArray(L[R][0])){for(var E=[],D=L[R],P=0;P<D.length;P++)E.push(this._process(D[P],t));A.push(((l={})[R]=E,l))}else t.verbose?A.push(((u={})[R]=[this._process(L[R],t)],u)):A.push(((c={})[R]=this._process(L[R],t),c))}return T[x]=A,T}var I=1,O=1,N=1,M=1;for(T={},y=0;y<e.length;y++){var R;switch(v=e[y],R=Object.keys(v)[0]){case"@":w=v["@"];var F=Object.keys(w);if(t.group&&1!==F.length)T[b]=w;else for(var B in w)T[b+B]=w[B];break;case"#":I=this._processSpecItem(v["#"],T,t.group,x,f,I);break;case"!":O=this._processSpecItem(v["!"],T,t.group,_,h,O);break;case"?":N=this._processSpecItem(v["?"],T,t.group,S,m,N);break;case"$":M=this._processSpecItem(v.$,T,t.group,C,g,M);break;default:var L;if(0!==(L=v)[R].length&&a.isArray(L[R][0])){E=[],D=L[R];for(var k=0;k<D.length;k++)E.push(this._process(D[k],t));T[R]=E}else t.verbose?T[R]=[this._process(L[R],t)]:T[R]=this._process(L[R],t)}}return T},t.prototype._processSpecItem=function(e,t,r,n,o,s){var l,u;if(!r&&a.isArray(e)&&o+e.length>2)try{for(var c=i(e),d=c.next();!d.done;d=c.next()){var p=d.value;t[n+(s++).toString()]=p}}catch(e){l={error:e}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(l)throw l.error}}else t[o>1?n+(s++).toString():n]=e;return s},t.prototype.beginElement=function(e){var t,r,n=[];if(0===this._currentList.length)this._currentList.push(((t={})[e]=n,t));else{var o=this._currentList[this._currentList.length-1];this._isElementNode(o,e)?0!==o[e].length&&a.isArray(o[e][0])?o[e].push(n):o[e]=[o[e],n]:this._currentList.push(((r={})[e]=n,r))}this._currentIndex++,this._listRegister.length>this._currentIndex?this._listRegister[this._currentIndex]=n:this._listRegister.push(n),this._currentList=n},t.prototype.endElement=function(){this._currentList=this._listRegister[--this._currentIndex]},t.prototype.attribute=function(e,t){var r,n;if(0===this._currentList.length)this._currentList.push({"@":(r={},r[e]=t,r)});else{var o=this._currentList[this._currentList.length-1];this._isAttrNode(o)?o["@"][e]=t:this._currentList.push({"@":(n={},n[e]=t,n)})}},t.prototype.comment=function(e){if(0===this._currentList.length)this._currentList.push({"!":e});else{var t=this._currentList[this._currentList.length-1];this._isCommentNode(t)?a.isArray(t["!"])?t["!"].push(e):t["!"]=[t["!"],e]:this._currentList.push({"!":e})}},t.prototype.text=function(e){if(0===this._currentList.length)this._currentList.push({"#":e});else{var t=this._currentList[this._currentList.length-1];this._isTextNode(t)?a.isArray(t["#"])?t["#"].push(e):t["#"]=[t["#"],e]:this._currentList.push({"#":e})}},t.prototype.instruction=function(e,t){var r=""===t?e:e+" "+t;if(0===this._currentList.length)this._currentList.push({"?":r});else{var n=this._currentList[this._currentList.length-1];this._isInstructionNode(n)?a.isArray(n["?"])?n["?"].push(r):n["?"]=[n["?"],r]:this._currentList.push({"?":r})}},t.prototype.cdata=function(e){if(0===this._currentList.length)this._currentList.push({$:e});else{var t=this._currentList[this._currentList.length-1];this._isCDATANode(t)?a.isArray(t.$)?t.$.push(e):t.$=[t.$,e]:this._currentList.push({$:e})}},t.prototype._isAttrNode=function(e){return"@"in e},t.prototype._isTextNode=function(e){return"#"in e},t.prototype._isCommentNode=function(e){return"!"in e},t.prototype._isInstructionNode=function(e){return"?"in e},t.prototype._isCDATANode=function(e){return"$"in e},t.prototype._isElementNode=function(e,t){return t in e},t.prototype._getAttrKey=function(){return this._builderOptions.convert.att},t.prototype._getNodeKey=function(e){switch(e){case s.NodeType.Comment:return this._builderOptions.convert.comment;case s.NodeType.Text:return this._builderOptions.convert.text;case s.NodeType.ProcessingInstruction:return this._builderOptions.convert.ins;case s.NodeType.CData:return this._builderOptions.convert.cdata;default:throw new Error("Invalid node type.")}},t}(r(50).BaseWriter);t.ObjectWriter=l},function(e,t,r){"use strict";var n=r(4),o=r(93);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._items={},this._nullItems={}}return e.prototype.set=function(e,t){null===e?this._nullItems[t]=!0:(this._items[e]||(this._items[e]={}),this._items[e][t]=!0)},e.prototype.has=function(e,t){return null===e?!0===this._nullItems[t]:!!this._items[e]&&!0===this._items[e][t]},e}();t.LocalNameSet=n},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var o=r(9),i=r(3),a=r(0),s=function(){function e(){}return Object.defineProperty(e.prototype,"_eventListenerList",{get:function(){return this.__eventListenerList||(this.__eventListenerList=[])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_eventHandlerMap",{get:function(){return this.__eventHandlerMap||(this.__eventHandlerMap={})},enumerable:!0,configurable:!0}),e.prototype.addEventListener=function(e,t,r){void 0===r&&(r={passive:!1,once:!1,capture:!1});var o,s=n(a.eventTarget_flattenMore(r),3),l=s[0],u=s[1],c=s[2];t&&(o=i.Guard.isEventListener(t)?t:{handleEvent:t},a.eventTarget_addEventListener(this,{type:e,callback:o,capture:l,passive:u,once:c,removed:!1}))},e.prototype.removeEventListener=function(e,t,r){void 0===r&&(r={capture:!1});var n=a.eventTarget_flatten(r);if(t)for(var o=0;o<this._eventListenerList.length;o++){var s=this._eventListenerList[o];if(s.type===e&&s.capture===n){if(i.Guard.isEventListener(t)&&s.callback===t){a.eventTarget_removeEventListener(this,s,o);break}if(t&&s.callback.handleEvent===t){a.eventTarget_removeEventListener(this,s,o);break}}}},e.prototype.dispatchEvent=function(e){if(e._dispatchFlag||!e._initializedFlag)throw new o.InvalidStateError;return e._isTrusted=!1,a.event_dispatch(e,this)},e.prototype._getTheParent=function(e){return null},e}();t.EventTargetImpl=s},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(34),a=r(0),s=function(e){function t(t){var r=e.call(this)||this;return r._data=t,r}return o(t,e),Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(e){a.characterData_replaceData(this,0,this._data.length,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._data.length},enumerable:!0,configurable:!0}),t.prototype.substringData=function(e,t){return a.characterData_substringData(this,e,t)},t.prototype.appendData=function(e){return a.characterData_replaceData(this,this._data.length,0,e)},t.prototype.insertData=function(e,t){a.characterData_replaceData(this,e,0,t)},t.prototype.deleteData=function(e,t){a.characterData_replaceData(this,e,t,"")},t.prototype.replaceData=function(e,t,r){a.characterData_replaceData(this,e,t,r)},Object.defineProperty(t.prototype,"previousElementSibling",{get:function(){throw new Error("Mixin: NonDocumentTypeChildNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextElementSibling",{get:function(){throw new Error("Mixin: NonDocumentTypeChildNode not implemented.")},enumerable:!0,configurable:!0}),t.prototype.before=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.after=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.replaceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.remove=function(){throw new Error("Mixin: ChildNode not implemented.")},t}(i.NodeImpl);t.CharacterDataImpl=s},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0});var a=r(6),s=r(3),l=r(1),u=r(17),c=r(51);function d(e){a.dom.window._signalSlots.add(e),c.observer_queueAMutationObserverMicrotask()}function p(e,t){void 0===t&&(t=!1);var r=s.Cast.asNode(e)._parent;if(null===r)return null;var n=r._shadowRoot||null;if(null===n)return null;if(t&&"open"!==n._mode)return null;for(var o=u.tree_getFirstDescendantNode(n,!1,!0,function(e){return s.Guard.isSlot(e)});null!==o;){if(o._name===e._name)return o;o=u.tree_getNextDescendantNode(n,o,!1,!0,function(e){return s.Guard.isSlot(e)})}return null}function f(e){var t,r,o=[],i=u.tree_rootNode(e);if(!s.Guard.isShadowRoot(i))return o;var a=i._host;try{for(var l=n(a._children),c=l.next();!c.done;c=l.next()){var d=c.value;s.Guard.isSlotable(d)&&p(d)===e&&o.push(d)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return o}function h(e){var t,r,o=f(e);if(o.length===e._assignedNodes.length){for(var i=!0,a=0;a<o.length;a++)if(o[a]!==e._assignedNodes[a]){i=!1;break}i||d(e)}e._assignedNodes=o;try{for(var s=n(o),l=s.next();!l.done;l=s.next())l.value._assignedSlot=e}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}t.shadowTree_signalASlotChange=d,t.shadowTree_isConnected=function(e){return s.Guard.isDocumentNode(u.tree_rootNode(e,!0))},t.shadowTree_isAssigned=function(e){return null!==e._assignedSlot},t.shadowTree_findASlot=p,t.shadowTree_findSlotables=f,t.shadowTree_findFlattenedSlotables=function e(t){var r,o,a,c,d=[],p=u.tree_rootNode(t);if(!s.Guard.isShadowRoot(p))return d;var h=f(t);if(l.isEmpty(h))try{for(var m=n(t._children),g=m.next();!g.done;g=m.next()){var y=g.value;s.Guard.isSlotable(y)&&h.push(y)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(o=m.return)&&o.call(m)}finally{if(r)throw r.error}}try{for(var v=n(h),b=v.next();!b.done;b=v.next()){var x=b.value;if(s.Guard.isSlot(x)&&s.Guard.isShadowRoot(u.tree_rootNode(x))){var _=e(x);d.push.apply(d,i(_))}else d.push(x)}}catch(e){a={error:e}}finally{try{b&&!b.done&&(c=v.return)&&c.call(v)}finally{if(a)throw a.error}}return d},t.shadowTree_assignSlotables=h,t.shadowTree_assignSlotablesForATree=function(e){for(var t=u.tree_getFirstDescendantNode(e,!0,!1,function(e){return s.Guard.isSlot(e)});null!==t;)h(t),t=u.tree_getNextDescendantNode(e,t,!0,!1,function(e){return s.Guard.isSlot(e)})},t.shadowTree_assignASlot=function(e){var t=p(e);null!==t&&h(t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=/[a-z]([\0-\t\x2D\._a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*-([\0-\t\x2D\._a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*/,o=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),i=new Set(["article","aside","blockquote","body","div","footer","h1","h2","h3","h4","h5","h6","header","main","nav","p","section","span"]),a=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),s=new Set(["article","aside","blockquote","body","div","footer","h1","h2","h3","h4","h5","h6","header","main","nav","p","section","span"]);t.customElement_isValidCustomElementName=function(e){return!!n.test(e)&&!o.has(e)},t.customElement_isValidElementName=function(e){return i.has(e)},t.customElement_isVoidElementName=function(e){return a.has(e)},t.customElement_isValidShadowHostName=function(e){return s.has(e)},t.customElement_enqueueACustomElementUpgradeReaction=function(e,t){},t.customElement_enqueueACustomElementCallbackReaction=function(e,t,r){},t.customElement_upgrade=function(e,t){},t.customElement_tryToUpgrade=function(e){},t.customElement_lookUpACustomElementDefinition=function(e,t,r,n){return null}},function(e,t,r){r(4)({target:"String",proto:!0},{repeat:r(259)})},function(e,t,r){"use strict";r(278),r(68),r(179),r(94),Object.defineProperty(t,"__esModule",{value:!0});var n=r(109),o=function(){function e(e){this._builderOptions=e,e.parser&&Object.assign(this,e.parser)}return e.prototype._docType=function(e,t,r,n){return e.dtd({name:t,pubID:r,sysID:n})},e.prototype._comment=function(e,t){return e.com(t)},e.prototype._text=function(e,t){return e.txt(t)},e.prototype._instruction=function(e,t,r){return e.ins(t,r)},e.prototype._cdata=function(e,t){return e.dat(t)},e.prototype._element=function(e,t,r){return void 0===t?e.ele(r):e.ele(t,r)},e.prototype._attribute=function(e,t,r,n){return void 0===t?e.att(r,n):e.att(t,r,n)},e.prototype._sanitize=function(e){return n.sanitizeInput(e,this._builderOptions.invalidCharReplacement)},e.prototype._decodeText=function(t){return null==t?t:t.replace(/&(quot|amp|apos|lt|gt);/g,function(t,r){return e._entityTable[r]}).replace(/&#(?:x([a-fA-F0-9]+)|([0-9]+));/g,function(e,t,r){return String.fromCodePoint(parseInt(t||r,t?16:10))})},e.prototype._decodeAttributeValue=function(e){return this._decodeText(e)},e.prototype.parse=function(e,t){return this._parse(e,t)},e.prototype.docType=function(e,t,r,n){return this._docType(e,t,r,n)},e.prototype.comment=function(e,t){return this._comment(e,t)},e.prototype.text=function(e,t){return this._text(e,t)},e.prototype.instruction=function(e,t,r){return this._instruction(e,t,r)},e.prototype.cdata=function(e,t){return this._cdata(e,t)},e.prototype.element=function(e,t,r){return this._element(e,t,r)},e.prototype.attribute=function(e,t,r,n){return this._attribute(e,t,r,n)},e.prototype.sanitize=function(e){return this._sanitize(e)},e._entityTable={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"},e}();t.BaseReader=o},function(e,t,r){"use strict";var n=r(39);e.exports=n.DEFAULT=new n({include:[r(54)],explicit:[r(299),r(300),r(301)]})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(185);t.XMLBuilderImpl=n.XMLBuilderImpl;var o=r(304);t.XMLBuilderCBImpl=o.XMLBuilderCBImpl;var i=r(183);t.builder=i.builder,t.create=i.create,t.fragment=i.fragment,t.convert=i.convert;var a=r(309);t.createCB=a.createCB,t.fragmentCB=a.fragmentCB},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);t.f=i?function(e){var t=o(this,e);return!!t&&t.enumerable}:n},function(e,t,r){var n=r(11),o=r(21);e.exports=function(e,t){try{o(n,e,t)}catch(r){n[e]=t}return t}},function(e,t,r){var n=r(44),o=r(118);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:n?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var n=r(121),o=r(84).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},function(e,t,r){var n=r(47),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(8);e.exports=!!Object.getOwnPropertySymbols&&!n(function(){return!String(Symbol())})},function(e,t,r){var n=r(127);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,r){"use strict";var n=r(4),o=r(195),i=r(132),a=r(133),s=r(62),l=r(21),u=r(25),c=r(5),d=r(44),p=r(49),f=r(131),h=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,g=c("iterator"),y=function(){return this};e.exports=function(e,t,r,c,f,v,b){o(r,t,c);var x,_,S,C=function(e){if(e===f&&D)return D;if(!m&&e in A)return A[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},T=t+" Iterator",w=!1,A=e.prototype,E=A[g]||A["@@iterator"]||f&&A[f],D=!m&&E||C(f),P="Array"==t&&A.entries||E;if(P&&(x=i(P.call(new e)),h!==Object.prototype&&x.next&&(d||i(x)===h||(a?a(x,h):"function"!=typeof x[g]&&l(x,g,y)),s(x,T,!0,!0),d&&(p[T]=y))),"values"==f&&E&&"values"!==E.name&&(w=!0,D=function(){return E.call(this)}),d&&!b||A[g]===D||l(A,g,D),p[t]=D,f)if(_={values:C("values"),keys:v?D:C("keys"),entries:C("entries")},b)for(S in _)(m||w||!(S in A))&&u(A,S,_[S]);else n({target:t,proto:!0,forced:m||w},_);return _}},function(e,t,r){"use strict";var n=r(4),o=r(13),i=r(59),a=r(83),s=r(26),l=r(24),u=r(134),c=r(5),d=r(63),p=r(28),f=d("slice"),h=p("slice",{ACCESSORS:!0,0:0,1:2}),m=c("species"),g=[].slice,y=Math.max;n({target:"Array",proto:!0,forced:!f||!h},{slice:function(e,t){var r,n,c,d=l(this),p=s(d.length),f=a(e,p),h=a(void 0===t?p:t,p);if(i(d)&&("function"!=typeof(r=d.constructor)||r!==Array&&!i(r.prototype)?o(r)&&null===(r=r[m])&&(r=void 0):r=void 0,r===Array||void 0===r))return g.call(d,f,h);for(n=new(void 0===r?Array:r)(y(h-f,0)),c=0;f<h;f++,c++)f in d&&u(n,c,d[f]);return n.length=c,n}})},function(e,t,r){var n={};n[r(5)("toStringTag")]="z",e.exports="[object z]"===String(n)},function(e,t,r){"use strict";r(19),r(138),r(20),r(92),r(22),r(23),Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultBuilderOptions={version:"1.0",encoding:void 0,standalone:void 0,keepNullNodes:!1,keepNullAttributes:!1,ignoreConverters:!1,convert:{att:"@",ins:"?",text:"#",cdata:"$",comment:"!"},defaultNamespace:{ele:void 0,att:void 0},namespaceAlias:{html:"http://www.w3.org/1999/xhtml",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"},invalidCharReplacement:void 0,parser:void 0},t.XMLBuilderOptionKeys=new Set(Object.keys(t.DefaultBuilderOptions)),t.DefaultXMLBuilderCBOptions={format:"xml",wellFormed:!1,prettyPrint:!1,indent:" ",newline:"\n",offset:0,width:0,allowEmptyTags:!1,spaceBeforeSlash:!1,keepNullNodes:!1,keepNullAttributes:!1,ignoreConverters:!1,convert:{att:"@",ins:"?",text:"#",cdata:"$",comment:"!"},defaultNamespace:{ele:void 0,att:void 0},namespaceAlias:{html:"http://www.w3.org/1999/xhtml",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink"}}},function(e,t,r){"use strict";var n=r(139),o=r(143);e.exports=n("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},o)},function(e,t,r){"use strict";var n,o,i=r(136),a=r(221),s=RegExp.prototype.exec,l=String.prototype.replace,u=s,c=(n=/a/,o=/b*/g,s.call(n,"a"),s.call(o,"a"),0!==n.lastIndex||0!==o.lastIndex),d=a.UNSUPPORTED_Y||a.BROKEN_CARET,p=void 0!==/()??/.exec("")[1];(c||p||d)&&(u=function(e){var t,r,n,o,a=this,u=d&&a.sticky,f=i.call(a),h=a.source,m=0,g=e;return u&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),g=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(h="(?: "+h+")",g=" "+g,m++),r=new RegExp("^(?:"+h+")",f)),p&&(r=new RegExp("^"+h+"$(?!\\s)",f)),c&&(t=a.lastIndex),n=s.call(u?r:a,g),u?n?(n.input=n.input.slice(m),n[0]=n[0].slice(m),n.index=a.lastIndex,a.lastIndex+=n[0].length):a.lastIndex=0:c&&n&&(a.lastIndex=a.global?n.index+n[0].length:t),p&&n&&n.length>1&&l.call(n[0],r,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)}),n}),e.exports=u},function(e,t,r){"use strict";var n=r(225),o=r(18),i=r(27),a=r(26),s=r(47),l=r(35),u=r(226),c=r(227),d=Math.max,p=Math.min,f=Math.floor,h=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g;n("replace",2,function(e,t,r,n){var g=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,y=n.REPLACE_KEEPS_$0,v=g?"$":"$0";return[function(r,n){var o=l(this),i=null==r?void 0:r[e];return void 0!==i?i.call(r,o,n):t.call(String(o),r,n)},function(e,n){if(!g&&y||"string"==typeof n&&-1===n.indexOf(v)){var i=r(t,e,this,n);if(i.done)return i.value}var l=o(e),f=String(this),h="function"==typeof n;h||(n=String(n));var m=l.global;if(m){var x=l.unicode;l.lastIndex=0}for(var _=[];;){var S=c(l,f);if(null===S)break;if(_.push(S),!m)break;""===String(S[0])&&(l.lastIndex=u(f,a(l.lastIndex),x))}for(var C,T="",w=0,A=0;A<_.length;A++){S=_[A];for(var E=String(S[0]),D=d(p(s(S.index),f.length),0),P=[],I=1;I<S.length;I++)P.push(void 0===(C=S[I])?C:String(C));var O=S.groups;if(h){var N=[E].concat(P,D,f);void 0!==O&&N.push(O);var M=String(n.apply(void 0,N))}else M=b(E,f,D,P,O,n);D>=w&&(T+=f.slice(w,D)+M,w=D+E.length)}return T+f.slice(w)}];function b(e,r,n,o,a,s){var l=n+e.length,u=o.length,c=m;return void 0!==a&&(a=i(a),c=h),t.call(s,c,function(t,i){var s;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,n);case"'":return r.slice(l);case"<":s=a[i.slice(1,-1)];break;default:var c=+i;if(0===c)return t;if(c>u){var d=f(c/10);return 0===d?t:d<=u?void 0===o[d-1]?i.charAt(1):o[d-1]+i.charAt(1):t}s=o[c-1]}return void 0===s?"":s})}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this._items={},this._nullItems=[]}return e.prototype.copy=function(){var t=new e;for(var r in this._items)t._items[r]=this._items[r].slice(0);return t._nullItems=this._nullItems.slice(0),t},e.prototype.get=function(e,t){var r=null===t?this._nullItems:this._items[t]||null;if(null===r)return null;for(var n=null,o=0;o<r.length;o++)if((n=r[o])===e)return n;return n},e.prototype.has=function(e,t){var r=null===t?this._nullItems:this._items[t]||null;return null!==r&&-1!==r.indexOf(e)},e.prototype.hasPrefix=function(e){if(-1!==this._nullItems.indexOf(e))return!0;for(var t in this._items)if(-1!==this._items[t].indexOf(e))return!0;return!1},e.prototype.set=function(e,t){var r=null===t?this._nullItems:this._items[t]||null;null!==t&&null===r?this._items[t]=[e]:r.push(e)},e}();t.NamespacePrefixMap=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Surrogate=/[\uD800-\uDFFF]/,t.ScalarValue=/[\uD800-\uDFFF]/,t.NonCharacter=/[\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]/,t.ASCIICodePoint=/[\u0000-\u007F]/,t.ASCIITabOrNewLine=/[\t\n\r]/,t.ASCIIWhiteSpace=/[\t\n\f\r ]/,t.C0Control=/[\u0000-\u001F]/,t.C0ControlOrSpace=/[\u0000-\u001F ]/,t.Control=/[\u0000-\u001F\u007F-\u009F]/,t.ASCIIDigit=/[0-9]/,t.ASCIIUpperHexDigit=/[0-9A-F]/,t.ASCIILowerHexDigit=/[0-9a-f]/,t.ASCIIHexDigit=/[0-9A-Fa-f]/,t.ASCIIUpperAlpha=/[A-Z]/,t.ASCIILowerAlpha=/[a-z]/,t.ASCIIAlpha=/[A-Za-z]/,t.ASCIIAlphanumeric=/[0-9A-Za-z]/},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0});var a=r(6),s=r(2),l=r(3),u=r(171),c=r(104),d=r(9),p=r(17),f=r(72),h=r(30);function m(e,t){void 0===t&&(t=void 0),void 0===t&&(t=null);var r=g(e,0,new Date,{});return r._isTrusted=!0,r}function g(e,t,r,n){var o=new e("");return o._initializedFlag=!0,o._timeStamp=r.getTime(),Object.assign(o,n),a.dom.features.steps&&h.dom_runEventConstructingSteps(o),o}function y(e,t,r,o){var i,a,u,c;void 0===r&&(r=!1),void 0===o&&(o={value:!1});var d=!1;e._dispatchFlag=!0;var h=t;if(r){var m=t._associatedDocument;l.Guard.isDocumentNode(m)&&(h=m)}var g=null,y=p.tree_retarget(e._relatedTarget,t);if(t!==y||t===e._relatedTarget){var x=[];try{for(var _=n(e._touchTargetList),S=_.next();!S.done;S=_.next()){var C=S.value;x.push(p.tree_retarget(C,t))}}catch(e){i={error:e}}finally{try{S&&!S.done&&(a=_.return)&&a.call(_)}finally{if(i)throw i.error}}v(e,t,h,y,x,!1);var T=l.Guard.isMouseEvent(e)&&"click"===e._type;T&&void 0!==t._activationBehavior&&(g=t);for(var w=l.Guard.isSlotable(t)&&f.shadowTree_isAssigned(t)?t:null,A=!1,E=t._getTheParent(e);null!==E&&l.Guard.isNode(E);){if(null!==w){if(!l.Guard.isSlot(E))throw new Error("Parent node of a slotable should be a slot.");w=null;var D=p.tree_rootNode(E,!0);l.Guard.isShadowRoot(D)&&"closed"===D._mode&&(A=!0)}l.Guard.isSlotable(E)&&f.shadowTree_isAssigned(E)&&(w=E),y=p.tree_retarget(e._relatedTarget,E),x=[];try{for(var P=(u=void 0,n(e._touchTargetList)),I=P.next();!I.done;I=P.next())C=I.value,x.push(p.tree_retarget(C,E))}catch(e){u={error:e}}finally{try{I&&!I.done&&(c=P.return)&&c.call(P)}finally{if(u)throw u.error}}l.Guard.isWindow(E)||l.Guard.isNode(E)&&l.Guard.isNode(t)&&p.tree_isAncestorOf(p.tree_rootNode(t,!0),E,!0,!0)?(T&&e._bubbles&&null===g&&E._activationBehavior&&(g=E),v(e,E,null,y,x,A)):E===y?E=null:(t=E,T&&null===g&&t._activationBehavior&&(g=t),v(e,E,t,y,x,A)),null!==E&&(E=E._getTheParent(e)),A=!1}for(var O=null,N=e._path,M=N.length-1;M>=0;M--)if(null!==(F=N[M]).shadowAdjustedTarget){O=F;break}if(null!==O)if(l.Guard.isNode(O.shadowAdjustedTarget)&&l.Guard.isShadowRoot(p.tree_rootNode(O.shadowAdjustedTarget,!0)))d=!0;else if(l.Guard.isNode(O.relatedTarget)&&l.Guard.isShadowRoot(p.tree_rootNode(O.relatedTarget,!0)))d=!0;else for(var R=0;R<O.touchTargetList.length;R++){var F=O.touchTargetList[R];if(l.Guard.isNode(F)&&l.Guard.isShadowRoot(p.tree_rootNode(F,!0))){d=!0;break}}for(null!==g&&void 0!==g._legacyPreActivationBehavior&&g._legacyPreActivationBehavior(e),M=N.length-1;M>=0;M--)null!==(F=N[M]).shadowAdjustedTarget?e._eventPhase=s.EventPhase.AtTarget:e._eventPhase=s.EventPhase.Capturing,b(F,e,"capturing",o);for(M=0;M<N.length;M++){if(null!==(F=N[M]).shadowAdjustedTarget)e._eventPhase=s.EventPhase.AtTarget;else{if(!e._bubbles)continue;e._eventPhase=s.EventPhase.Bubbling}b(F,e,"bubbling",o)}}return e._eventPhase=s.EventPhase.None,e._currentTarget=null,e._path=[],e._dispatchFlag=!1,e._stopPropagationFlag=!1,e._stopImmediatePropagationFlag=!1,d&&(e._target=null,e._relatedTarget=null,e._touchTargetList=[]),null!==g&&(e._canceledFlag||void 0===g._activationBehavior?void 0!==g._legacyCanceledActivationBehavior&&g._legacyCanceledActivationBehavior(e):g._activationBehavior(e)),!e._canceledFlag}function v(e,t,r,n,o,i){var a=!1;l.Guard.isNode(t)&&l.Guard.isShadowRoot(p.tree_rootNode(t))&&(a=!0);var s=!1;l.Guard.isShadowRoot(t)&&"closed"===t._mode&&(s=!0),e._path.push({invocationTarget:t,invocationTargetInShadowTree:a,shadowAdjustedTarget:r,relatedTarget:n,touchTargetList:o,rootOfClosedTree:s,slotInClosedTree:i})}function b(e,t,r,n){void 0===n&&(n={value:!1});for(var o=t._path,a=-1,s=0;s<o.length;s++)if(o[s]===e){a=s;break}if(-1!==a){var l=o[a];(null!==l.shadowAdjustedTarget||a>0&&null!==(l=o[a-1]).shadowAdjustedTarget)&&(t._target=l.shadowAdjustedTarget)}if(t._relatedTarget=e.relatedTarget,t._touchTargetList=e.touchTargetList,!t._stopPropagationFlag){t._currentTarget=e.invocationTarget;var u=t._currentTarget._eventListenerList,c=new(Array.bind.apply(Array,i([void 0],u)));if(!x(t,c,r,e,n)&&t._isTrusted){var d=t._type;"animationend"===d?t._type="webkitAnimationEnd":"animationiteration"===d?t._type="webkitAnimationIteration":"animationstart"===d?t._type="webkitAnimationStart":"transitionend"===d&&(t._type="webkitTransitionEnd"),x(t,c,r,e,n),t._type=d}}}function x(e,t,r,n,o){void 0===o&&(o={value:!1});for(var i=!1,a=0;a<t.length;a++){var s=t[a];if(!s.removed){if(e._type!==s.type)continue;if(i=!0,"capturing"===r&&!s.capture)continue;if("bubbling"===r&&s.capture)continue;if(s.once&&null!==e._currentTarget){for(var u=e._currentTarget,c=-1,d=0;d<u._eventListenerList.length;d++)if(u._eventListenerList[d]===s){c=d;break}-1!==c&&u._eventListenerList.splice(c,1)}var p=void 0,f=void 0;l.Guard.isWindow(p)&&(f=p._currentEvent,!1===n.invocationTargetInShadowTree&&(p._currentEvent=e)),s.passive&&(e._inPassiveListenerFlag=!0);try{s.callback.handleEvent.call(e._currentTarget,e)}catch(e){o.value=!0}if(s.passive&&(e._inPassiveListenerFlag=!1),l.Guard.isWindow(p)&&(p._currentEvent=f),e._stopImmediatePropagationFlag)return i}}return i}t.event_setTheCanceledFlag=function(e){e._cancelable&&!e._inPassiveListenerFlag&&(e._canceledFlag=!0)},t.event_initialize=function(e,t,r,n){e._initializedFlag=!0,e._stopPropagationFlag=!1,e._stopImmediatePropagationFlag=!1,e._canceledFlag=!1,e._isTrusted=!1,e._target=null,e._type=t,e._bubbles=r,e._cancelable=n},t.event_createAnEvent=m,t.event_innerEventCreationSteps=g,t.event_dispatch=y,t.event_appendToAnEventPath=v,t.event_invoke=b,t.event_innerInvoke=x,t.event_fireAnEvent=function(e,t,r,n,o){void 0===r&&(r=c.EventImpl);var i=m(r);if(i._type=e,n)for(var a in n)i[a]=n[a];return y(i,t,o)},t.event_createLegacyEvent=function(e){var t=null;switch(e.toLowerCase()){case"beforeunloadevent":case"compositionevent":case"devicemotionevent":case"deviceorientationevent":case"dragevent":break;case"customevent":t=u.CustomEventImpl;break;case"event":case"events":t=c.EventImpl}if(null===t)throw new d.NotSupportedError("Event constructor not found for interface "+e+".");var r=new t("");return r._type="",r._timeStamp=(new Date).getTime(),r._isTrusted=!1,r._initializedFlag=!1,r},t.event_getterEventHandlerIDLAttribute=function(e,t){return null},t.event_setterEventHandlerIDLAttribute=function(e,t,r){},t.event_determineTheTargetOfAnEventHandler=function(e,t){return null},t.event_getTheCurrentValueOfAnEventHandler=function(e,t){return null},t.event_activateAnEventHandler=function(e,t){},t.event_deactivateAnEventHandler=function(e,t){}},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var s=r(6),l=r(2),u=r(9),c=r(34),d=r(3),p=r(1),f=r(7),h=r(152),m=r(0),g=r(12),y=function(e){function t(){var t=e.call(this)||this;return t._children=new Set,t._encoding={name:"UTF-8",labels:["unicode-1-1-utf-8","utf-8","utf8"]},t._contentType="application/xml",t._URL={scheme:"about",username:"",password:"",host:null,port:null,path:["blank"],query:null,fragment:null,_cannotBeABaseURLFlag:!0,_blobURLEntry:null},t._origin=null,t._type="xml",t._mode="no-quirks",t._documentElement=null,t._hasNamespaces=!1,t._nodeDocumentOverwrite=null,t}return o(t,e),Object.defineProperty(t.prototype,"_nodeDocument",{get:function(){return this._nodeDocumentOverwrite||this},set:function(e){this._nodeDocumentOverwrite=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"implementation",{get:function(){return this._implementation||(this._implementation=m.create_domImplementation(this))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"URL",{get:function(){return h.urlSerializer(this._URL)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"documentURI",{get:function(){return this.URL},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{get:function(){return"null"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"compatMode",{get:function(){return"quirks"===this._mode?"BackCompat":"CSS1Compat"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"characterSet",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"charset",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inputEncoding",{get:function(){return this._encoding.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentType",{get:function(){return this._contentType},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"doctype",{get:function(){var e,t;try{for(var r=i(this._children),n=r.next();!n.done;n=r.next()){var o=n.value;if(d.Guard.isDocumentTypeNode(o))return o}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"documentElement",{get:function(){return this._documentElement},enumerable:!0,configurable:!0}),t.prototype.getElementsByTagName=function(e){return m.node_listOfElementsWithQualifiedName(e,this)},t.prototype.getElementsByTagNameNS=function(e,t){return m.node_listOfElementsWithNamespace(e,t,this)},t.prototype.getElementsByClassName=function(e){return m.node_listOfElementsWithClassNames(e,this)},t.prototype.createElement=function(e,t){if(!m.xml_isName(e))throw new u.InvalidCharacterError;"html"===this._type&&(e=e.toLowerCase());var r=null;void 0!==t&&(r=p.isString(t)?t:t.is);var n="html"===this._type||"application/xhtml+xml"===this._contentType?f.namespace.HTML:null;return m.element_createAnElement(this,e,n,null,r,!0)},t.prototype.createElementNS=function(e,t,r){return m.document_internalCreateElementNS(this,e,t,r)},t.prototype.createDocumentFragment=function(){return m.create_documentFragment(this)},t.prototype.createTextNode=function(e){return m.create_text(this,e)},t.prototype.createCDATASection=function(e){if("html"===this._type)throw new u.NotSupportedError;if(-1!==e.indexOf("]]>"))throw new u.InvalidCharacterError;return m.create_cdataSection(this,e)},t.prototype.createComment=function(e){return m.create_comment(this,e)},t.prototype.createProcessingInstruction=function(e,t){if(!m.xml_isName(e))throw new u.InvalidCharacterError;if(-1!==t.indexOf("?>"))throw new u.InvalidCharacterError;return m.create_processingInstruction(this,e,t)},t.prototype.importNode=function(e,t){if(void 0===t&&(t=!1),d.Guard.isDocumentNode(e)||d.Guard.isShadowRoot(e))throw new u.NotSupportedError;return m.node_clone(e,this,t)},t.prototype.adoptNode=function(e){if(d.Guard.isDocumentNode(e))throw new u.NotSupportedError;if(d.Guard.isShadowRoot(e))throw new u.HierarchyRequestError;return m.document_adopt(e,this),e},t.prototype.createAttribute=function(e){if(!m.xml_isName(e))throw new u.InvalidCharacterError;return"html"===this._type&&(e=e.toLowerCase()),m.create_attr(this,e)},t.prototype.createAttributeNS=function(e,t){var r=a(m.namespace_validateAndExtract(e,t),3),n=r[0],o=r[1],i=r[2],s=m.create_attr(this,i);return s._namespace=n,s._namespacePrefix=o,s},t.prototype.createEvent=function(e){return m.event_createLegacyEvent(e)},t.prototype.createRange=function(){var e=m.create_range();return e._start=[this,0],e._end=[this,0],e},t.prototype.createNodeIterator=function(e,t,r){void 0===t&&(t=l.WhatToShow.All),void 0===r&&(r=null);var n=m.create_nodeIterator(e,e,!0);return n._whatToShow=t,n._iteratorCollection=m.create_nodeList(e),p.isFunction(r)?(n._filter=m.create_nodeFilter(),n._filter.acceptNode=r):n._filter=r,n},t.prototype.createTreeWalker=function(e,t,r){void 0===t&&(t=l.WhatToShow.All),void 0===r&&(r=null);var n=m.create_treeWalker(e,e);return n._whatToShow=t,p.isFunction(r)?(n._filter=m.create_nodeFilter(),n._filter.acceptNode=r):n._filter=r,n},t.prototype._getTheParent=function(e){return"load"===e._type?null:s.dom.window},t.prototype.getElementById=function(e){throw new Error("Mixin: NonElementParentNode not implemented.")},Object.defineProperty(t.prototype,"children",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),t.prototype.prepend=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ParentNode not implemented.")},t.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ParentNode not implemented.")},t.prototype.querySelector=function(e){throw new Error("Mixin: ParentNode not implemented.")},t.prototype.querySelectorAll=function(e){throw new Error("Mixin: ParentNode not implemented.")},t}(c.NodeImpl);t.DocumentImpl=y,g.idl_defineConst(y.prototype,"_nodeType",l.NodeType.Document)},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var s=r(2),l=r(34),u=r(9),c=r(7),d=r(0),p=r(12),f=function(e){function t(){var t=e.call(this)||this;return t._children=new Set,t._namespace=null,t._namespacePrefix=null,t._localName="",t._customElementState="undefined",t._customElementDefinition=null,t._is=null,t._shadowRoot=null,t._attributeList=d.create_namedNodeMap(t),t._attributeChangeSteps=[],t._name="",t._assignedSlot=null,t}return o(t,e),Object.defineProperty(t.prototype,"namespaceURI",{get:function(){return this._namespace},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"prefix",{get:function(){return this._namespacePrefix},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localName",{get:function(){return this._localName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this._htmlUppercasedQualifiedName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return d.element_getAnAttributeValue(this,"id")},set:function(e){d.element_setAnAttributeValue(this,"id",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"className",{get:function(){return d.element_getAnAttributeValue(this,"class")},set:function(e){d.element_setAnAttributeValue(this,"class",e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"classList",{get:function(){var e=d.element_getAnAttributeByName("class",this);return null===e&&(e=d.create_attr(this._nodeDocument,"class")),d.create_domTokenList(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"slot",{get:function(){return d.element_getAnAttributeValue(this,"slot")},set:function(e){d.element_setAnAttributeValue(this,"slot",e)},enumerable:!0,configurable:!0}),t.prototype.hasAttributes=function(){return 0!==this._attributeList.length},Object.defineProperty(t.prototype,"attributes",{get:function(){return this._attributeList},enumerable:!0,configurable:!0}),t.prototype.getAttributeNames=function(){var e,t,r=[];try{for(var n=i(this._attributeList),o=n.next();!o.done;o=n.next()){var a=o.value;r.push(a._qualifiedName)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},t.prototype.getAttribute=function(e){var t=d.element_getAnAttributeByName(e,this);return t?t._value:null},t.prototype.getAttributeNS=function(e,t){var r=d.element_getAnAttributeByNamespaceAndLocalName(e,t,this);return r?r._value:null},t.prototype.setAttribute=function(e,t){if(!d.xml_isName(e))throw new u.InvalidCharacterError;this._namespace===c.namespace.HTML&&"html"===this._nodeDocument._type&&(e=e.toLowerCase());for(var r=null,n=0;n<this._attributeList.length;n++){var o=this._attributeList[n];if(o._qualifiedName===e){r=o;break}}if(null===r)return(r=d.create_attr(this._nodeDocument,e))._value=t,void d.element_append(r,this);d.element_change(r,this,t)},t.prototype.setAttributeNS=function(e,t,r){var n=a(d.namespace_validateAndExtract(e,t),3),o=n[0],i=n[1],s=n[2];d.element_setAnAttributeValue(this,s,r,i,o)},t.prototype.removeAttribute=function(e){d.element_removeAnAttributeByName(e,this)},t.prototype.removeAttributeNS=function(e,t){d.element_removeAnAttributeByNamespaceAndLocalName(e,t,this)},t.prototype.hasAttribute=function(e){this._namespace===c.namespace.HTML&&"html"===this._nodeDocument._type&&(e=e.toLowerCase());for(var t=0;t<this._attributeList.length;t++)if(this._attributeList[t]._qualifiedName===e)return!0;return!1},t.prototype.toggleAttribute=function(e,t){if(!d.xml_isName(e))throw new u.InvalidCharacterError;this._namespace===c.namespace.HTML&&"html"===this._nodeDocument._type&&(e=e.toLowerCase());for(var r=null,n=0;n<this._attributeList.length;n++){var o=this._attributeList[n];if(o._qualifiedName===e){r=o;break}}return null===r?(void 0===t||!0===t)&&((r=d.create_attr(this._nodeDocument,e))._value="",d.element_append(r,this),!0):void 0!==t&&!1!==t||(d.element_removeAnAttributeByName(e,this),!1)},t.prototype.hasAttributeNS=function(e,t){for(var r=e||null,n=0;n<this._attributeList.length;n++){var o=this._attributeList[n];if(o._namespace===r&&o._localName===t)return!0}return!1},t.prototype.getAttributeNode=function(e){return d.element_getAnAttributeByName(e,this)},t.prototype.getAttributeNodeNS=function(e,t){return d.element_getAnAttributeByNamespaceAndLocalName(e,t,this)},t.prototype.setAttributeNode=function(e){return d.element_setAnAttribute(e,this)},t.prototype.setAttributeNodeNS=function(e){return d.element_setAnAttribute(e,this)},t.prototype.removeAttributeNode=function(e){for(var t=!1,r=0;r<this._attributeList.length;r++)if(this._attributeList[r]===e){t=!0;break}if(!t)throw new u.NotFoundError;return d.element_remove(e,this),e},t.prototype.attachShadow=function(e){if(this._namespace!==c.namespace.HTML)throw new u.NotSupportedError;if(!d.customElement_isValidCustomElementName(this._localName)&&!d.customElement_isValidShadowHostName(this._localName))throw new u.NotSupportedError;if(d.customElement_isValidCustomElementName(this._localName)||null!==this._is){var t=d.customElement_lookUpACustomElementDefinition(this._nodeDocument,this._namespace,this._localName,this._is);if(null!==t&&!0===t.disableShadow)throw new u.NotSupportedError}if(null!==this._shadowRoot)throw new u.NotSupportedError;var r=d.create_shadowRoot(this._nodeDocument,this);return r._mode=e.mode,this._shadowRoot=r,r},Object.defineProperty(t.prototype,"shadowRoot",{get:function(){var e=this._shadowRoot;return null===e||"closed"===e.mode?null:e},enumerable:!0,configurable:!0}),t.prototype.closest=function(e){throw new u.NotImplementedError},t.prototype.matches=function(e){throw new u.NotImplementedError},t.prototype.webkitMatchesSelector=function(e){return this.matches(e)},t.prototype.getElementsByTagName=function(e){return d.node_listOfElementsWithQualifiedName(e,this)},t.prototype.getElementsByTagNameNS=function(e,t){return d.node_listOfElementsWithNamespace(e,t,this)},t.prototype.getElementsByClassName=function(e){return d.node_listOfElementsWithClassNames(e,this)},t.prototype.insertAdjacentElement=function(e,t){return d.element_insertAdjacent(this,e,t)},t.prototype.insertAdjacentText=function(e,t){var r=d.create_text(this._nodeDocument,t);d.element_insertAdjacent(this,e,r)},Object.defineProperty(t.prototype,"_qualifiedName",{get:function(){return this._namespacePrefix?this._namespacePrefix+":"+this._localName:this._localName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_htmlUppercasedQualifiedName",{get:function(){var e=this._qualifiedName;return this._namespace===c.namespace.HTML&&"html"===this._nodeDocument._type&&(e=e.toUpperCase()),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),t.prototype.prepend=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ParentNode not implemented.")},t.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ParentNode not implemented.")},t.prototype.querySelector=function(e){throw new Error("Mixin: ParentNode not implemented.")},t.prototype.querySelectorAll=function(e){throw new Error("Mixin: ParentNode not implemented.")},Object.defineProperty(t.prototype,"previousElementSibling",{get:function(){throw new Error("Mixin: NonDocumentTypeChildNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nextElementSibling",{get:function(){throw new Error("Mixin: NonDocumentTypeChildNode not implemented.")},enumerable:!0,configurable:!0}),t.prototype.before=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.after=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.replaceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.remove=function(){throw new Error("Mixin: ChildNode not implemented.")},Object.defineProperty(t.prototype,"assignedSlot",{get:function(){throw new Error("Mixin: Slotable not implemented.")},enumerable:!0,configurable:!0}),t._create=function(e,r,n,o){void 0===n&&(n=null),void 0===o&&(o=null);var i=new t;return i._localName=r,i._namespace=n,i._namespacePrefix=o,i._nodeDocument=e,i},t}(l.NodeImpl);t.ElementImpl=f,p.idl_defineConst(f.prototype,"_nodeType",s.NodeType.Element)},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),a=r(34),s=r(12),l=function(e){function t(t){void 0===t&&(t=null);var r=e.call(this)||this;return r._children=new Set,r._host=t,r}return o(t,e),t.prototype.getElementById=function(e){throw new Error("Mixin: NonElementParentNode not implemented.")},Object.defineProperty(t.prototype,"children",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){throw new Error("Mixin: ParentNode not implemented.")},enumerable:!0,configurable:!0}),t.prototype.prepend=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ParentNode not implemented.")},t.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ParentNode not implemented.")},t.prototype.querySelector=function(e){throw new Error("Mixin: ParentNode not implemented.")},t.prototype.querySelectorAll=function(e){throw new Error("Mixin: ParentNode not implemented.")},t._create=function(e,r){void 0===r&&(r=null);var n=new t(r);return n._nodeDocument=e,n},t}(a.NodeImpl);t.DocumentFragmentImpl=l,s.idl_defineConst(l.prototype,"_nodeType",i.NodeType.DocumentFragment)},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),s=r(71),l=r(0),u=r(12),c=function(e){function t(t){void 0===t&&(t="");var r=e.call(this,t)||this;return r._name="",r._assignedSlot=null,r}return o(t,e),Object.defineProperty(t.prototype,"wholeText",{get:function(){var e,t,r="";try{for(var n=i(l.text_contiguousTextNodes(this,!0)),o=n.next();!o.done;o=n.next())r+=o.value._data}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},enumerable:!0,configurable:!0}),t.prototype.splitText=function(e){return l.text_split(this,e)},Object.defineProperty(t.prototype,"assignedSlot",{get:function(){throw new Error("Mixin: Slotable not implemented.")},enumerable:!0,configurable:!0}),t._create=function(e,r){void 0===r&&(r="");var n=new t(r);return n._nodeDocument=e,n},t}(s.CharacterDataImpl);t.TextImpl=c,u.idl_defineConst(c.prototype,"_nodeType",a.NodeType.Text)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return Object.defineProperty(e.prototype,"_startNode",{get:function(){return this._start[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_startOffset",{get:function(){return this._start[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_endNode",{get:function(){return this._end[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_endOffset",{get:function(){return this._end[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_collapsed",{get:function(){return this._start[0]===this._end[0]&&this._start[1]===this._end[1]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startContainer",{get:function(){return this._startNode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startOffset",{get:function(){return this._startOffset},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endContainer",{get:function(){return this._endNode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endOffset",{get:function(){return this._endOffset},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collapsed",{get:function(){return this._collapsed},enumerable:!0,configurable:!0}),e}();t.AbstractRangeImpl=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=function(){function e(e){this._activeFlag=!1,this._root=e,this._whatToShow=n.WhatToShow.All,this._filter=null}return Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"whatToShow",{get:function(){return this._whatToShow},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filter",{get:function(){return this._filter},enumerable:!0,configurable:!0}),e}();t.TraverserImpl=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(0),i=r(12),a=function(){function e(e,t){this._target=null,this._relatedTarget=null,this._touchTargetList=[],this._path=[],this._currentTarget=null,this._eventPhase=n.EventPhase.None,this._stopPropagationFlag=!1,this._stopImmediatePropagationFlag=!1,this._canceledFlag=!1,this._inPassiveListenerFlag=!1,this._composedFlag=!1,this._initializedFlag=!1,this._dispatchFlag=!1,this._isTrusted=!1,this._bubbles=!1,this._cancelable=!1,this._type=e,t&&(this._bubbles=t.bubbles||!1,this._cancelable=t.cancelable||!1,this._composedFlag=t.composed||!1),this._initializedFlag=!0,this._timeStamp=(new Date).getTime()}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"srcElement",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTarget",{get:function(){return this._currentTarget},enumerable:!0,configurable:!0}),e.prototype.composedPath=function(){var e=[],t=this._path;if(0===t.length)return e;var r=this._currentTarget;if(null===r)throw new Error("Event currentTarget is null.");e.push(r);for(var n=0,o=0,i=t.length-1;i>=0;){if(t[i].rootOfClosedTree&&o++,t[i].invocationTarget===r){n=i;break}t[i].slotInClosedTree&&o--,i--}var a=o,s=o;for(i=n-1;i>=0;)t[i].rootOfClosedTree&&a++,a<=s&&e.unshift(t[i].invocationTarget),t[i].slotInClosedTree&&--a<s&&(s=a),i--;for(a=o,s=o,i=n+1;i<t.length;)t[i].slotInClosedTree&&a++,a<=s&&e.push(t[i].invocationTarget),t[i].rootOfClosedTree&&--a<s&&(s=a),i++;return e},Object.defineProperty(e.prototype,"eventPhase",{get:function(){return this._eventPhase},enumerable:!0,configurable:!0}),e.prototype.stopPropagation=function(){this._stopPropagationFlag=!0},Object.defineProperty(e.prototype,"cancelBubble",{get:function(){return this._stopPropagationFlag},set:function(e){e&&this.stopPropagation()},enumerable:!0,configurable:!0}),e.prototype.stopImmediatePropagation=function(){this._stopPropagationFlag=!0,this._stopImmediatePropagationFlag=!0},Object.defineProperty(e.prototype,"bubbles",{get:function(){return this._bubbles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cancelable",{get:function(){return this._cancelable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"returnValue",{get:function(){return!this._canceledFlag},set:function(e){e||o.event_setTheCanceledFlag(this)},enumerable:!0,configurable:!0}),e.prototype.preventDefault=function(){o.event_setTheCanceledFlag(this)},Object.defineProperty(e.prototype,"defaultPrevented",{get:function(){return this._canceledFlag},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"composed",{get:function(){return this._composedFlag},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTrusted",{get:function(){return this._isTrusted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"timeStamp",{get:function(){return this._timeStamp},enumerable:!0,configurable:!0}),e.prototype.initEvent=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1),this._dispatchFlag||o.event_initialize(this,e,t,r)},e.NONE=0,e.CAPTURING_PHASE=1,e.AT_TARGET=2,e.BUBBLING_PHASE=3,e}();t.EventImpl=a,i.idl_defineConst(a.prototype,"NONE",0),i.idl_defineConst(a.prototype,"CAPTURING_PHASE",1),i.idl_defineConst(a.prototype,"AT_TARGET",2),i.idl_defineConst(a.prototype,"BUBBLING_PHASE",3)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(9);t.traversal_filter=function(e,t){if(e._activeFlag)throw new o.InvalidStateError;var r=1<<t._nodeType-1;if(0==(e.whatToShow&r))return n.FilterResult.Skip;if(!e.filter)return n.FilterResult.Accept;e._activeFlag=!0;var i=n.FilterResult.Reject;try{i=e.filter.acceptNode(t)}catch(t){throw e._activeFlag=!1,t}return e._activeFlag=!1,i}},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),a=r(3),s=r(1),l=r(99),u=r(73),c=r(17),d=r(173),p=r(30),f=r(52),h=r(37);t.document_elementInterface=function(e,t){return l.ElementImpl},t.document_internalCreateElementNS=function(e,t,r,o){var i=n(d.namespace_validateAndExtract(t,r),3),a=i[0],l=i[1],u=i[2],c=null;return void 0!==o&&(c=s.isString(o)?o:o.is),f.element_createAnElement(e,u,a,l,c,!0)},t.document_adopt=function(e,t){var r,n;if(e._nodeDocument!==t||null!==e._parent){var s=e._nodeDocument;if(e._parent&&h.mutation_remove(e,e._parent),t!==s)for(var l=c.tree_getFirstDescendantNode(e,!0,!0);null!==l;){if(l._nodeDocument=t,a.Guard.isElementNode(l))try{for(var d=(r=void 0,o(l._attributeList._asArray())),f=d.next();!f.done;f=d.next())f.value._nodeDocument=t}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}i.dom.features.customElements&&a.Guard.isElementNode(l)&&"custom"===l._customElementState&&u.customElement_enqueueACustomElementCallbackReaction(l,"adoptedCallback",[s,t]),i.dom.features.steps&&p.dom_runAdoptingSteps(l,s),l=c.tree_getNextDescendantNode(e,l,!0,!0)}}}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),i=r(3),a=r(9),s=r(17),l=r(51),u=r(30);t.characterData_replaceData=function(e,t,r,c){var d,p,f=s.tree_nodeLength(e);if(t>f)throw new a.IndexSizeError("Offset exceeds character data length. Offset: "+t+", Length: "+f+", Node is "+e.nodeName+".");t+r>f&&(r=f-t),o.dom.features.mutationObservers&&l.observer_queueMutationRecord("characterData",e,null,null,e._data,[],[],null,null);var h=e._data.substring(0,t)+c+e._data.substring(t+r);e._data=h;try{for(var m=n(o.dom.rangeList),g=m.next();!g.done;g=m.next()){var y=g.value;y._start[0]===e&&y._start[1]>t&&y._start[1]<=t+r&&(y._start[1]=t),y._end[0]===e&&y._end[1]>t&&y._end[1]<=t+r&&(y._end[1]=t),y._start[0]===e&&y._start[1]>t+r&&(y._start[1]+=c.length-r),y._end[0]===e&&y._end[1]>t+r&&(y._end[1]+=c.length-r)}}catch(e){d={error:e}}finally{try{g&&!g.done&&(p=m.return)&&p.call(m)}finally{if(d)throw d.error}}o.dom.features.steps&&i.Guard.isTextNode(e)&&null!==e._parent&&u.dom_runChildTextContentChangeSteps(e._parent)},t.characterData_substringData=function(e,t,r){var n=s.tree_nodeLength(e);if(t>n)throw new a.IndexSizeError("Offset exceeds character data length. Offset: "+t+", Length: "+n+", Node is "+e.nodeName+".");return t+r>n?e._data.substr(t):e._data.substr(t,r)}},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=r(7);function s(e){var t=a.string.splitAStringOnASCIIWhitespace(e);return new Set(t)}function l(e){return o(e).join(" ")}t.orderedSet_parse=s,t.orderedSet_serialize=l,t.orderedSet_sanitize=function(e){return l(s(e))},t.orderedSet_contains=function(e,t,r){var n,o,a,s;try{for(var l=i(t),u=l.next();!u.done;u=l.next()){var c=u.value,d=!1;try{for(var p=(a=void 0,i(e)),f=p.next();!f.done;f=p.next()){var h=f.value;if(r){if(h===c){d=!0;break}}else if(h.toUpperCase()===c.toUpperCase()){d=!0;break}}}catch(e){a={error:e}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(!d)return!1}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}return!0}},function(e,t,r){"use strict";r(179),Object.defineProperty(t,"__esModule",{value:!0});var n=r(262),o=r(110),i=r(1);o.dom.setFeatures(!1),t.createDocument=function(){var e=(new n.DOMImplementation).createDocument(null,"root",null);return e.documentElement&&e.removeChild(e.documentElement),e},t.sanitizeInput=function(e,t){if(null==e)return e;if(void 0===t)return e+"";var r="";e+="";for(var n=0;n<e.length;n++){var o=e.charCodeAt(n);if(9===o||10===o||13===o||o>=32&&o<=55295||o>=57344&&o<=65533)r+=e.charAt(n);else if(o>=55296&&o<=56319&&n<e.length-1){var a=e.charCodeAt(n+1);a>=56320&&a<=57343?(o=1024*(o-55296)+a-56320+65536,r+=String.fromCodePoint(o),n++):r+=i.isString(t)?t:t(e.charAt(n),n,e)}else r+=i.isString(t)?t:t(e.charAt(n),n,e)}return r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(153);t.AbortController=o.AbortControllerImpl;var i=r(154);t.AbortSignal=i.AbortSignalImpl;var a=r(102);t.AbstractRange=a.AbstractRangeImpl;var s=r(157);t.Attr=s.AttrImpl;var l=r(158);t.CDATASection=l.CDATASectionImpl;var u=r(71);t.CharacterData=u.CharacterDataImpl;var c=r(263),d=r(159);t.Comment=d.CommentImpl;var p=r(171);t.CustomEvent=p.CustomEventImpl;var f=r(100);t.DocumentFragment=f.DocumentFragmentImpl;var h=r(98);t.Document=h.DocumentImpl;var m=r(264),g=r(155);t.DocumentType=g.DocumentTypeImpl;var y=r(6);t.dom=y.dom;var v=r(148);t.DOMImplementation=v.DOMImplementationImpl;var b=r(170);t.DOMTokenList=b.DOMTokenListImpl;var x=r(99);t.Element=x.ElementImpl;var _=r(104);t.Event=_.EventImpl;var S=r(70);t.EventTarget=S.EventTargetImpl;var C=r(161);t.HTMLCollection=C.HTMLCollectionImpl;var T=r(265);t.MutationObserver=T.MutationObserverImpl;var w=r(169);t.MutationRecord=w.MutationRecordImpl;var A=r(164);t.NamedNodeMap=A.NamedNodeMapImpl;var E=r(168);t.NodeFilter=E.NodeFilterImpl;var D=r(34);t.Node=D.NodeImpl;var P=r(166);t.NodeIterator=P.NodeIteratorImpl;var I=r(162);t.NodeList=I.NodeListImpl;var O=r(163);t.NodeListStatic=O.NodeListStaticImpl;var N=r(266),M=r(267),R=r(268),F=r(160);t.ProcessingInstruction=F.ProcessingInstructionImpl;var B=r(165);t.Range=B.RangeImpl;var L=r(156);t.ShadowRoot=L.ShadowRootImpl;var k=r(269),U=r(270);t.StaticRange=U.StaticRangeImpl;var V=r(101);t.Text=V.TextImpl;var G=r(103);t.Traverser=G.TraverserImpl;var z=r(167);t.TreeWalker=z.TreeWalkerImpl;var j=r(149);t.Window=j.WindowImpl;var W=r(151);t.XMLDocument=W.XMLDocumentImpl,n.applyMixin(x.ElementImpl,c.ChildNodeImpl),n.applyMixin(u.CharacterDataImpl,c.ChildNodeImpl),n.applyMixin(g.DocumentTypeImpl,c.ChildNodeImpl),n.applyMixin(h.DocumentImpl,m.DocumentOrShadowRootImpl),n.applyMixin(L.ShadowRootImpl,m.DocumentOrShadowRootImpl),n.applyMixin(x.ElementImpl,N.NonDocumentTypeChildNodeImpl),n.applyMixin(u.CharacterDataImpl,N.NonDocumentTypeChildNodeImpl),n.applyMixin(h.DocumentImpl,M.NonElementParentNodeImpl),n.applyMixin(f.DocumentFragmentImpl,M.NonElementParentNodeImpl),n.applyMixin(h.DocumentImpl,R.ParentNodeImpl),n.applyMixin(f.DocumentFragmentImpl,R.ParentNodeImpl),n.applyMixin(x.ElementImpl,R.ParentNodeImpl),n.applyMixin(V.TextImpl,k.SlotableImpl),n.applyMixin(x.ElementImpl,k.SlotableImpl)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.EOF=0]="EOF",e[e.Declaration=1]="Declaration",e[e.DocType=2]="DocType",e[e.Element=3]="Element",e[e.Text=4]="Text",e[e.CDATA=5]="CDATA",e[e.PI=6]="PI",e[e.Comment=7]="Comment",e[e.ClosingTag=8]="ClosingTag"}(t.TokenType||(t.TokenType={}))},function(e,t,r){"use strict";r(64),r(20),r(66);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._parse=function(e,t){var r=this,n=this._builderOptions,o=null;return i.isFunction(t)?o=this.parse(e,t.apply(this)):i.isArray(t)||i.isSet(t)?i.forEachArray(t,function(t){return o=r.parse(e,t)},this):i.isMap(t)||i.isObject(t)?i.forEachObject(t,function(t,a){if(i.isFunction(a)&&(a=a.apply(r)),n.ignoreConverters||0!==t.indexOf(n.convert.att))if(n.ignoreConverters||0!==t.indexOf(n.convert.text))if(n.ignoreConverters||0!==t.indexOf(n.convert.cdata))if(n.ignoreConverters||0!==t.indexOf(n.convert.comment))if(n.ignoreConverters||0!==t.indexOf(n.convert.ins)){if((i.isArray(a)||i.isSet(a))&&i.isEmpty(a));else if((i.isMap(a)||i.isObject(a))&&i.isEmpty(a))o=r.element(e,void 0,r.sanitize(t))||o;else if(n.keepNullNodes||null!=a)if(i.isArray(a)||i.isSet(a))i.forEachArray(a,function(n){var i={};i[t]=n,o=r.parse(e,i)},r);else if(i.isMap(a)||i.isObject(a))(s=r.element(e,void 0,r.sanitize(t)))&&(o=s,r.parse(s,a));else if(null!=a&&""!==a){var s;(s=r.element(e,void 0,r.sanitize(t)))&&(o=s,r.text(s,r._decodeText(r.sanitize(a))))}else o=r.element(e,void 0,r.sanitize(t))||o}else if(i.isString(a)){var l=a.indexOf(" "),u=-1===l?a:a.substr(0,l),c=-1===l?"":a.substr(l+1);o=r.instruction(e,r.sanitize(u),r.sanitize(c))||o}else i.isArray(a)||i.isSet(a)?i.forEachArray(a,function(t){var n=t.indexOf(" "),i=-1===n?t:t.substr(0,n),a=-1===n?"":t.substr(n+1);o=r.instruction(e,r.sanitize(i),r.sanitize(a))||o},r):i.forEachObject(a,function(t,n){return o=r.instruction(e,r.sanitize(t),r.sanitize(n))||o},r);else i.isArray(a)||i.isSet(a)?i.forEachArray(a,function(t){return o=r.comment(e,r.sanitize(t))||o},r):o=r.comment(e,r.sanitize(a))||o;else i.isArray(a)||i.isSet(a)?i.forEachArray(a,function(t){return o=r.cdata(e,r.sanitize(t))||o},r):o=r.cdata(e,r.sanitize(a))||o;else o=i.isMap(a)||i.isObject(a)?r.parse(e,a):r.text(e,r._decodeText(r.sanitize(a)))||o;else if(t===n.convert.att){if(i.isArray(a)||i.isSet(a))throw new Error("Invalid attribute: "+a.toString()+". "+e._debugInfo());i.forEachObject(a,function(t,n){o=r.attribute(e,void 0,r.sanitize(t),r._decodeAttributeValue(r.sanitize(n)))||o})}else o=r.attribute(e,void 0,r.sanitize(t.substr(n.convert.att.length)),r._decodeAttributeValue(r.sanitize(a)))||o},this):(n.keepNullNodes||null!=t)&&(o=this.text(e,this._decodeText(this.sanitize(t)))||o),o||e},t}(r(75).BaseReader);t.ObjectReader=a},function(e,t,r){"use strict";var n=r(39);e.exports=new n({explicit:[r(286),r(287),r(288)]})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BaseCBWriter=function(e){this.level=0,this._builderOptions=e,this._writerOptions=e}},function(e,t,r){var n=r(16),o=r(8),i=r(116);e.exports=!n&&!o(function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var n=r(11),o=r(13),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},function(e,t,r){var n=r(118),o=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(e){return o.call(e)}),e.exports=n.inspectSource},function(e,t,r){var n=r(11),o=r(80),i=n["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},function(e,t,r){var n=r(14),o=r(187),i=r(55),a=r(15);e.exports=function(e,t){for(var r=o(t),s=a.f,l=i.f,u=0;u<r.length;u++){var c=r[u];n(e,c)||s(e,c,l(t,c))}}},function(e,t,r){var n=r(11);e.exports=n},function(e,t,r){var n=r(14),o=r(24),i=r(122).indexOf,a=r(45);e.exports=function(e,t){var r,s=o(e),l=0,u=[];for(r in s)!n(a,r)&&n(s,r)&&u.push(r);for(;t.length>l;)n(s,r=t[l++])&&(~i(u,r)||u.push(r));return u}},function(e,t,r){var n=r(24),o=r(26),i=r(83),a=function(e){return function(t,r,a){var s,l=n(t),u=o(l.length),c=i(a,u);if(e&&r!=r){for(;u>c;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t,r){var n=r(8),o=/#|\.prototype\./,i=function(e,t){var r=s[a(e)];return r==u||r!=l&&("function"==typeof t?n(t):!!t)},a=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},s=i.data={},l=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},function(e,t,r){var n=r(86);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,r){var n=r(5);t.f=n},function(e,t,r){var n=r(120),o=r(14),i=r(125),a=r(15).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,r){var n=r(13),o=r(59),i=r(5)("species");e.exports=function(e,t){var r;return o(e)&&("function"!=typeof(r=e.constructor)||r!==Array&&!o(r.prototype)?n(r)&&null===(r=r[i])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===t?0:t)}},function(e,t,r){var n,o,i=r(11),a=r(193),s=i.process,l=s&&s.versions,u=l&&l.v8;u?o=(n=u.split("."))[0]+n[1]:a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=n[1]),e.exports=o&&+o},function(e,t,r){var n=r(5),o=r(60),i=r(15),a=n("unscopables"),s=Array.prototype;null==s[a]&&i.f(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},function(e,t,r){"use strict";var n,o,i,a=r(132),s=r(21),l=r(14),u=r(5),c=r(44),d=u("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=a(a(i)))!==Object.prototype&&(n=o):p=!0),null==n&&(n={}),c||l(n,d)||s(n,d,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},function(e,t,r){var n=r(14),o=r(27),i=r(57),a=r(196),s=i("IE_PROTO"),l=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=o(e),n(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},function(e,t,r){var n=r(18),o=r(197);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,i){return n(r),o(i),t?e.call(r,i):r.__proto__=i,r}}():void 0)},function(e,t,r){"use strict";var n=r(56),o=r(15),i=r(40);e.exports=function(e,t,r){var a=n(t);a in e?o.f(e,a,i(0,r)):e[a]=r}},function(e,t,r){var n=r(90),o=r(42),i=r(5)("toStringTag"),a="Arguments"==o(function(){return arguments}());e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?r:a?o(t):"Object"==(n=o(t))&&"function"==typeof t.callee?"Arguments":n}},function(e,t,r){"use strict";var n=r(18);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,r){var n=r(47),o=r(35),i=function(e){return function(t,r){var i,a,s=String(o(t)),l=n(r),u=s.length;return l<0||l>=u?e?"":void 0:(i=s.charCodeAt(l))<55296||i>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536}};e.exports={codeAt:i(!1),charAt:i(!0)}},function(e,t,r){var n=r(4),o=r(27),i=r(61);n({target:"Object",stat:!0,forced:r(8)(function(){i(1)})},{keys:function(e){return i(o(e))}})},function(e,t,r){"use strict";var n=r(4),o=r(11),i=r(123),a=r(25),s=r(140),l=r(141),u=r(142),c=r(13),d=r(8),p=r(208),f=r(62),h=r(209);e.exports=function(e,t,r){var m=-1!==e.indexOf("Map"),g=-1!==e.indexOf("Weak"),y=m?"set":"add",v=o[e],b=v&&v.prototype,x=v,_={},S=function(e){var t=b[e];a(b,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(g&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!c(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!c(e))&&t.call(this,0===e?0:e)}:function(e,r){return t.call(this,0===e?0:e,r),this})};if(i(e,"function"!=typeof v||!(g||b.forEach&&!d(function(){(new v).entries().next()}))))x=r.getConstructor(t,e,m,y),s.REQUIRED=!0;else if(i(e,!0)){var C=new x,T=C[y](g?{}:-0,1)!=C,w=d(function(){C.has(1)}),A=p(function(e){new v(e)}),E=!g&&d(function(){for(var e=new v,t=5;t--;)e[y](t,t);return!e.has(-0)});A||((x=t(function(t,r){u(t,x,e);var n=h(new v,t,x);return null!=r&&l(r,n[y],n,m),n})).prototype=b,b.constructor=x),(w||E)&&(S("delete"),S("has"),m&&S("get")),(E||T)&&S(y),g&&b.clear&&delete b.clear}return _[e]=x,n({global:!0,forced:x!=v},_),f(x,e),g||r.setStrong(x,e,m),x}},function(e,t,r){var n=r(45),o=r(13),i=r(14),a=r(15).f,s=r(58),l=r(204),u=s("meta"),c=0,d=Object.isExtensible||function(){return!0},p=function(e){a(e,u,{value:{objectID:"O"+ ++c,weakData:{}}})},f=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,u)){if(!d(e))return"F";if(!t)return"E";p(e)}return e[u].objectID},getWeakData:function(e,t){if(!i(e,u)){if(!d(e))return!0;if(!t)return!1;p(e)}return e[u].weakData},onFreeze:function(e){return l&&f.REQUIRED&&d(e)&&!i(e,u)&&p(e),e}};n[u]=!0},function(e,t,r){var n=r(18),o=r(205),i=r(26),a=r(87),s=r(206),l=r(207),u=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,t,r,c,d){var p,f,h,m,g,y,v,b=a(t,r,c?2:1);if(d)p=e;else{if("function"!=typeof(f=s(e)))throw TypeError("Target is not iterable");if(o(f)){for(h=0,m=i(e.length);m>h;h++)if((g=c?b(n(v=e[h])[0],v[1]):b(e[h]))&&g instanceof u)return g;return new u(!1)}p=f.call(e)}for(y=p.next;!(v=y.call(p)).done;)if("object"==typeof(g=l(p,b,v.value,c))&&g&&g instanceof u)return g;return new u(!1)}).stop=function(e){return new u(!0,e)}},function(e,t){e.exports=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e}},function(e,t,r){"use strict";var n=r(15).f,o=r(60),i=r(210),a=r(87),s=r(142),l=r(141),u=r(88),c=r(211),d=r(16),p=r(140).fastKey,f=r(43),h=f.set,m=f.getterFor;e.exports={getConstructor:function(e,t,r,u){var c=e(function(e,n){s(e,c,t),h(e,{type:t,index:o(null),first:void 0,last:void 0,size:0}),d||(e.size=0),null!=n&&l(n,e[u],e,r)}),f=m(t),g=function(e,t,r){var n,o,i=f(e),a=y(e,t);return a?a.value=r:(i.last=a={index:o=p(t,!0),key:t,value:r,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=a),n&&(n.next=a),d?i.size++:e.size++,"F"!==o&&(i.index[o]=a)),e},y=function(e,t){var r,n=f(e),o=p(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==t)return r};return i(c.prototype,{clear:function(){for(var e=f(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,d?e.size=0:this.size=0},delete:function(e){var t=f(this),r=y(this,e);if(r){var n=r.next,o=r.previous;delete t.index[r.index],r.removed=!0,o&&(o.next=n),n&&(n.previous=o),t.first==r&&(t.first=n),t.last==r&&(t.last=o),d?t.size--:this.size--}return!!r},forEach:function(e){for(var t,r=f(this),n=a(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!y(this,e)}}),i(c.prototype,r?{get:function(e){var t=y(this,e);return t&&t.value},set:function(e,t){return g(this,0===e?0:e,t)}}:{add:function(e){return g(this,e=0===e?0:e,e)}}),d&&n(c.prototype,"size",{get:function(){return f(this).size}}),c},setStrong:function(e,t,r){var n=t+" Iterator",o=m(t),i=m(n);u(e,t,function(e,t){h(this,{type:n,target:e,state:o(e),kind:t,last:void 0})},function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})},r?"entries":"values",!r,!0),c(t)}}},function(e,t,r){"use strict";var n,o=r(4),i=r(55).f,a=r(26),s=r(222),l=r(35),u=r(224),c=r(44),d="".endsWith,p=Math.min,f=u("endsWith");o({target:"String",proto:!0,forced:!(!c&&!f&&(n=i(String.prototype,"endsWith"),n&&!n.writable)||f)},{endsWith:function(e){var t=String(l(this));s(e);var r=arguments.length>1?arguments[1]:void 0,n=a(t.length),o=void 0===r?n:p(a(r),n),i=String(e);return d?d.call(t,i,o):t.slice(o-i.length,o)===i}})},function(e,t,r){"use strict";(function(e){var n=r(229),o=r(230),i=r(231);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,r){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=p(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(t,r),o=(e=s(e,n)).write(t,r);return o!==n&&(e=e.slice(0,o)),e}(e,t,r):function(e,t){if(l.isBuffer(t)){var r=0|f(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(c(t),e=s(e,t<0?0:0|f(t)),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function p(e,t){var r=t.length<0?0:0|f(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function f(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(n)return V(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return w(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){var i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=r;i<s;i++)if(u(e,i)===u(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===l)return c*a}else-1!==c&&(i-=i-c),c=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var d=!0,p=0;p<l;p++)if(u(e,i+p)!==u(t,p)){d=!1;break}if(d)return i}return-1}function b(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function x(e,t,r,n){return z(V(t,e.length-r),e,r,n)}function _(e,t,r,n){return z(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return _(e,t,r,n)}function C(e,t,r,n){return z(G(t),e,r,n)}function T(e,t,r,n){return z(function(e,t){for(var r,n,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function w(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,a,s,l,u=e[o],c=null,d=u>239?4:u>223?3:u>191?2:1;if(o+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&u)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function E(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function P(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=U(e[i]);return o}function I(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);o<i;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function R(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);o<i;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function F(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,i){return i||F(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,i){return i||F(e,0,r,8),o.write(e,t,r,n,52,8),r+8}t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,r){return u(null,e,t,r)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},l.allocUnsafe=function(e){return d(null,e)},l.allocUnsafeSlow=function(e){return d(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).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}},l.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=l.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var a=e[r];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},l.byteLength=h,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):m.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,r,n,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(i,a),u=this.slice(n,o),c=e.slice(t,r),d=0;d<s;++d)if(u[d]!==c[d]){i=u[d],a=c[d];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=l.prototype;else{var o=t-e;r=new l(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+e]}return r},l.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},l.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},l.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);N(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,i=n-r;if(this===e&&r<t&&t<n)for(o=i-1;o>=0;--o)e[o+t]=this[o+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=l.isBuffer(e)?e:V(new l(e,n).toString()),s=a.length;for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var k=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}}).call(this,r(78))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isASCIIByte=function(e){return e>=0&&e<=127}},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0}),t.length=function(e){return e.length},t.byteLowercase=function(e){for(var t=0;t<e.length;t++){var r=e[t];r>=65&&r<=90&&(e[t]=r+32)}},t.byteUppercase=function(e){for(var t=0;t<e.length;t++){var r=e[t];r>=97&&r<=122&&(e[t]=r-32)}},t.byteCaseInsensitiveMatch=function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++){var n=e[r],o=t[r];if(n>=65&&n<=90&&(n+=32),o>=65&&o<=90&&(o+=32),n!==o)return!1}return!0},t.startsWith=function(e,t){for(var r=0;;){if(r>=e.length)return!1;if(r>=t.length)return!0;if(e[r]!==t[r])return!1;r++}},t.byteLessThan=function(e,t){for(var r=0;;){if(r>=e.length)return!1;if(r>=t.length)return!0;var n=e[r],o=t[r];if(n<o)return!0;if(n>o)return!1;r++}},t.isomorphicDecode=function(e){return String.fromCodePoint.apply(String,o(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),o=r(7),i=r(0),a=r(12),s=function(){function e(e){this._associatedDocument=e||n.dom.window.document}return e.prototype.createDocumentType=function(e,t,r){return i.namespace_validate(e),i.create_documentType(this._associatedDocument,e,t,r)},e.prototype.createDocument=function(e,t,r){void 0===r&&(r=null);var n=i.create_xmlDocument(),a=null;return t&&(a=i.document_internalCreateElementNS(n,e,t)),r&&n.appendChild(r),a&&n.appendChild(a),n._origin=this._associatedDocument._origin,e===o.namespace.HTML?n._contentType="application/xhtml+xml":e===o.namespace.SVG?n._contentType="image/svg+xml":n._contentType="application/xml",n},e.prototype.createHTMLDocument=function(e){var t=i.create_document();t._type="html",t._contentType="text/html",t.appendChild(i.create_documentType(t,"html","",""));var r=i.element_createAnElement(t,"html",o.namespace.HTML);t.appendChild(r);var n=i.element_createAnElement(t,"head",o.namespace.HTML);if(r.appendChild(n),void 0!==e){var a=i.element_createAnElement(t,"title",o.namespace.HTML);n.appendChild(a);var s=i.create_text(t,e);a.appendChild(s)}var l=i.element_createAnElement(t,"body",o.namespace.HTML);return r.appendChild(l),t._origin=this._associatedDocument._origin,t},e.prototype.hasFeature=function(){return!0},e._create=function(t){return new e(t)},e}();t.DOMImplementationImpl=s,a.idl_defineConst(s.prototype,"_ID","@oozcitak/dom")},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(70),a=r(1),s=r(0),l=function(e){function t(){var t=e.call(this)||this;return t._signalSlots=new Set,t._mutationObserverMicrotaskQueued=!1,t._mutationObservers=new Set,t._iteratorList=new a.FixedSizeSet,t._associatedDocument=s.create_document(),t}return o(t,e),Object.defineProperty(t.prototype,"document",{get:function(){return this._associatedDocument},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"event",{get:function(){return this._currentEvent},enumerable:!0,configurable:!0}),t._create=function(){return new t},t}(i.EventTargetImpl);t.WindowImpl=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=function(){function e(){}return e.isNode=function(e){return!!e&&void 0!==e._nodeType},e.isDocumentNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.Document},e.isDocumentTypeNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.DocumentType},e.isDocumentFragmentNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.DocumentFragment},e.isAttrNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.Attribute},e.isCharacterDataNode=function(t){if(!e.isNode(t))return!1;var r=t._nodeType;return r===n.NodeType.Text||r===n.NodeType.ProcessingInstruction||r===n.NodeType.Comment||r===n.NodeType.CData},e.isTextNode=function(t){return e.isNode(t)&&(t._nodeType===n.NodeType.Text||t._nodeType===n.NodeType.CData)},e.isExclusiveTextNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.Text},e.isCDATASectionNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.CData},e.isCommentNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.Comment},e.isProcessingInstructionNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.ProcessingInstruction},e.isElementNode=function(t){return e.isNode(t)&&t._nodeType===n.NodeType.Element},e.isCustomElementNode=function(t){return e.isElementNode(t)&&"custom"===t._customElementState},e.isShadowRoot=function(e){return!!e&&void 0!==e.host},e.isMouseEvent=function(e){return!!e&&void 0!==e.screenX&&null!=e.screenY},e.isSlotable=function(t){return!!t&&void 0!==t._name&&void 0!==t._assignedSlot&&(e.isTextNode(t)||e.isElementNode(t))},e.isSlot=function(t){return!!t&&void 0!==t._name&&void 0!==t._assignedNodes&&e.isElementNode(t)},e.isWindow=function(e){return!!e&&void 0!==e.navigator},e.isEventListener=function(e){return!!e&&void 0!==e.handleEvent},e.isRegisteredObserver=function(e){return!!e&&void 0!==e.observer&&void 0!==e.options},e.isTransientRegisteredObserver=function(t){return!!t&&void 0!==t.source&&e.isRegisteredObserver(t)},e}();t.Guard=o},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return e.call(this)||this}return o(t,e),t}(r(98).DocumentImpl);t.XMLDocumentImpl=i},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var i,a=r(1),s=r(243),l=r(7),u=r(244),c={ftp:21,file:null,http:80,https:443,ws:80,wss:443},d=/[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,p=/[ "<>`]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,f=/[ "<>`#?{}]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,h=/[ "<>`#?{}/:;=@\[\]\\\^\|]|[\0-\x1F\x7F-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m=/[0-9A-Za-z!\$&-\/:;=\?@_~\xA0-\uD7FF\uE000-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uD83E\uD840-\uD87E\uD880-\uD8BE\uD8C0-\uD8FE\uD900-\uD93E\uD940-\uD97E\uD980-\uD9BE\uD9C0-\uD9FE\uDA00-\uDA3E\uDA40-\uDA7E\uDA80-\uDABE\uDAC0-\uDAFE\uDB00-\uDB3E\uDB40-\uDB7E\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDC00-\uDFFD]/,g=/[\0\t\f\r #%/:?@\[\\\]]/;function y(e){void 0!==i&&i.call(null,"Validation Error: "+e)}function v(e){return e in c}function b(e){return v(e.scheme)}function x(e){return c[e]||null}function _(e){return""!==e.username||""!==e.password}function S(e,t){var r,o;void 0===t&&(t=!1);var i=e.scheme+":";if(null!==e.host?(i+="//",_(e)&&(i+=e.username,""!==e.password&&(i+=":"+e.password),i+="@"),i+=C(e.host),null!==e.port&&(i+=":"+e.port)):null===e.host&&"file"===e.scheme&&(i+="//"),e._cannotBeABaseURLFlag)i+=e.path[0];else try{for(var a=n(e.path),s=a.next();!s.done;s=a.next())i+="/"+s.value}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return null!==e.query&&(i+="?"+e.query),t||null===e.fragment||(i+="#"+e.fragment),i}function C(e){return a.isNumber(e)?T(e):a.isArray(e)?"["+w(e)+"]":e}function T(e){for(var t="",r=e,n=1;n<=4;n++)t=(r%256).toString()+t,4!==n&&(t="."+t),r=Math.floor(r/256);return t}function w(e){for(var t="",r=null,n=-1,o=0,i=0,a=0;a<8;a++)if(0===e[a]){o=1;for(var s=a+1;s<8&&0===e[s];s++)o++;o>i&&(i=o,n=a)}i>1&&(r=n);for(var l=!1,u=0;u<8;u++)l&&0===e[u]||(l&&(l=!1),r!==u?(t+=e[u].toString(16),7!==u&&(t+=":")):(t+=0===u?"::":":",l=!0));return t}function A(e,t,r,o,i){var u,c,g,S;if(void 0===o){o={scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,_cannotBeABaseURLFlag:!1,_blobURLEntry:null};var C=/^[\u0000-\u001F\u0020]+/,T=/[\u0000-\u001F\u0020]+$/;(C.test(e)||T.test(e))&&y("Input string contains leading or trailing control characters or space."),e=(e=e.replace(C,"")).replace(T,"")}var w=/[\u0009\u000A\u000D]/g;w.test(e)&&y("Input string contains tab or newline characters."),e=e.replace(w,"");var A=void 0===i?s.ParserState.SchemeStart:i;void 0===t&&(t=null);for(var R=void 0===r||"replacement"===r||"UTF-16BE"===r||"UTF-16LE"===r?"UTF-8":r,F="",B=!1,L=!1,U=!1,V=new a.StringWalker(e);;){switch(A){case s.ParserState.SchemeStart:if(l.codePoint.ASCIIAlpha.test(V.c()))F+=V.c().toLowerCase(),A=s.ParserState.Scheme;else{if(void 0!==i)return y("Invalid scheme start character."),null;A=s.ParserState.NoScheme,V.pointer--}break;case s.ParserState.Scheme:if(l.codePoint.ASCIIAlphanumeric.test(V.c())||"+"===V.c()||"-"===V.c()||"."===V.c())F+=V.c().toLowerCase();else{if(":"!==V.c()){if(void 0===i){F="",A=s.ParserState.NoScheme,V.pointer=0;continue}return y("Invalid input string."),null}if(void 0!==i){if(v(o.scheme)&&!v(F))return o;if(!v(o.scheme)&&v(F))return o;if((_(o)||null!==o.port)&&"file"===F)return o;if("file"===o.scheme&&(""===o.host||null===o.host))return o}if(o.scheme=F,void 0!==i)return o.port===x(o.scheme)&&(o.port=null),o;F="","file"===o.scheme?(V.remaining().startsWith("//")||y("Invalid file URL scheme, '//' expected."),A=s.ParserState.File):b(o)&&null!==t&&t.scheme===o.scheme?A=s.ParserState.SpecialRelativeOrAuthority:b(o)?A=s.ParserState.SpecialAuthoritySlashes:V.remaining().startsWith("/")?(A=s.ParserState.PathOrAuthority,V.pointer++):(o._cannotBeABaseURLFlag=!0,o.path.push(""),A=s.ParserState.CannotBeABaseURLPath)}break;case s.ParserState.NoScheme:if(null===t||t._cannotBeABaseURLFlag&&"#"!==V.c())return y("Invalid input string."),null;t._cannotBeABaseURLFlag&&"#"===V.c()?(o.scheme=t.scheme,o.path=l.list.clone(t.path),o.query=t.query,o.fragment="",o._cannotBeABaseURLFlag=!0,A=s.ParserState.Fragment):"file"!==t.scheme?(A=s.ParserState.Relative,V.pointer--):(A=s.ParserState.File,V.pointer--);break;case s.ParserState.SpecialRelativeOrAuthority:"/"===V.c()&&V.remaining().startsWith("/")?(A=s.ParserState.SpecialAuthorityIgnoreSlashes,V.pointer++):(y("Invalid input string."),A=s.ParserState.Relative,V.pointer--);break;case s.ParserState.PathOrAuthority:"/"===V.c()?A=s.ParserState.Authority:(A=s.ParserState.Path,V.pointer--);break;case s.ParserState.Relative:if(null===t)throw new Error("Invalid parser state. Base URL is null.");switch(o.scheme=t.scheme,V.c()){case"":o.username=t.username,o.password=t.password,o.host=t.host,o.port=t.port,o.path=l.list.clone(t.path),o.query=t.query;break;case"/":A=s.ParserState.RelativeSlash;break;case"?":o.username=t.username,o.password=t.password,o.host=t.host,o.port=t.port,o.path=l.list.clone(t.path),o.query="",A=s.ParserState.Query;break;case"#":o.username=t.username,o.password=t.password,o.host=t.host,o.port=t.port,o.path=l.list.clone(t.path),o.query=t.query,o.fragment="",A=s.ParserState.Fragment;break;default:b(o)&&"\\"===V.c()?(y("Invalid input string."),A=s.ParserState.RelativeSlash):(o.username=t.username,o.password=t.password,o.host=t.host,o.port=t.port,o.path=l.list.clone(t.path),0!==o.path.length&&o.path.splice(o.path.length-1,1),A=s.ParserState.Path,V.pointer--)}break;case s.ParserState.RelativeSlash:if(!b(o)||"/"!==V.c()&&"\\"!==V.c())if("/"===V.c())A=s.ParserState.Authority;else{if(null===t)throw new Error("Invalid parser state. Base URL is null.");o.username=t.username,o.password=t.password,o.host=t.host,o.port=t.port,A=s.ParserState.Path,V.pointer--}else"\\"===V.c()&&y("Invalid input string."),A=s.ParserState.SpecialAuthorityIgnoreSlashes;break;case s.ParserState.SpecialAuthoritySlashes:"/"===V.c()&&V.remaining().startsWith("/")?(A=s.ParserState.SpecialAuthorityIgnoreSlashes,V.pointer++):(y("Expected '//'."),A=s.ParserState.SpecialAuthorityIgnoreSlashes,V.pointer--);break;case s.ParserState.SpecialAuthorityIgnoreSlashes:"/"!==V.c()&&"\\"!==V.c()?(A=s.ParserState.Authority,V.pointer--):y("Unexpected '/' or '\\'.");break;case s.ParserState.Authority:if("@"===V.c()){y("Unexpected '@'."),B&&(F="%40"+F),B=!0;try{for(var z=(u=void 0,n(F)),j=z.next();!j.done;j=z.next()){var W=j.value;if(":"!==W||U){var H=G(W,h);U?o.password+=H:o.username+=H}else U=!0}}catch(e){u={error:e}}finally{try{j&&!j.done&&(c=z.return)&&c.call(z)}finally{if(u)throw u.error}}F=""}else if(""===V.c()||"/"===V.c()||"?"===V.c()||"#"===V.c()||b(o)&&"\\"===V.c()){if(B&&""===F)return y("Invalid input string."),null;V.pointer-=F.length+1,F="",A=s.ParserState.Host}else F+=V.c();break;case s.ParserState.Host:case s.ParserState.Hostname:if(void 0!==i&&"file"===o.scheme)V.pointer--,A=s.ParserState.FileHost;else if(":"!==V.c()||L)if(""===V.c()||"/"===V.c()||"?"===V.c()||"#"===V.c()||b(o)&&"\\"===V.c()){if(V.pointer--,b(o)&&""===F)return y("Invalid input string."),null;if(void 0!==i&&""===F&&(_(o)||null!==o.port))return y("Invalid input string."),o;if(null===(X=M(F,!b(o))))return null;if(o.host=X,F="",A=s.ParserState.PathStart,void 0!==i)return o}else"["===V.c()&&(L=!0),"]"===V.c()&&(L=!1),F+=V.c();else{if(""===F)return y("Invalid input string."),null;if(null===(X=M(F,!b(o))))return null;if(o.host=X,F="",A=s.ParserState.Port,i===s.ParserState.Hostname)return o}break;case s.ParserState.Port:if(l.codePoint.ASCIIDigit.test(V.c()))F+=V.c();else{if(!(""===V.c()||"/"===V.c()||"?"===V.c()||"#"===V.c()||b(o)&&"\\"===V.c()||i))return y("Invalid input string."),null;if(""!==F&&""!==F){var K=parseInt(F,10);if(K>Math.pow(2,16)-1)return y("Invalid port number."),null;o.port=K===x(o.scheme)?null:K,F=""}if(void 0!==i)return o;A=s.ParserState.PathStart,V.pointer--}break;case s.ParserState.File:if(o.scheme="file","/"===V.c()||"\\"===V.c())"\\"===V.c()&&y("Invalid input string."),A=s.ParserState.FileSlash;else if(null!==t&&"file"===t.scheme)switch(V.c()){case"":o.host=t.host,o.path=l.list.clone(t.path),o.query=t.query;break;case"?":o.host=t.host,o.path=l.list.clone(t.path),o.query="",A=s.ParserState.Query;break;case"#":o.host=t.host,o.path=l.list.clone(t.path),o.query=t.query,o.fragment="",A=s.ParserState.Fragment;break;default:N(V.substring())?y("Unexpected windows drive letter in input string."):(o.host=t.host,o.path=l.list.clone(t.path),P(o)),A=s.ParserState.Path,V.pointer--}else A=s.ParserState.Path,V.pointer--;break;case s.ParserState.FileSlash:"/"===V.c()||"\\"===V.c()?("\\"===V.c()&&y("Invalid input string."),A=s.ParserState.FileHost):(null===t||"file"!==t.scheme||N(V.substring())||(I(t.path[0])?o.path.push(t.path[0]):o.host=t.host),A=s.ParserState.Path,V.pointer--);break;case s.ParserState.FileHost:if(""===V.c()||"/"===V.c()||"\\"===V.c()||"?"===V.c()||"#"===V.c())if(V.pointer--,void 0===i&&O(F))y("Unexpected windows drive letter in input string."),A=s.ParserState.Path;else if(""===F){if(o.host="",void 0!==i)return o;A=s.ParserState.PathStart}else{var X;if(null===(X=M(F,!b(o))))return null;if("localhost"===X&&(X=""),o.host=X,void 0!==i)return o;F="",A=s.ParserState.PathStart}else F+=V.c();break;case s.ParserState.PathStart:b(o)?("\\"===V.c()&&y("Invalid input string."),A=s.ParserState.Path,"/"!==V.c()&&"\\"!==V.c()&&V.pointer--):void 0===i&&"?"===V.c()?(o.query="",A=s.ParserState.Query):void 0===i&&"#"===V.c()?(o.fragment="",A=s.ParserState.Fragment):""!==V.c()&&(A=s.ParserState.Path,"/"!==V.c()&&V.pointer--);break;case s.ParserState.Path:if(""===V.c()||"/"===V.c()||b(o)&&"\\"===V.c()||void 0===i&&("?"===V.c()||"#"===V.c())){if(b(o)&&"\\"===V.c()&&y("Invalid input string."),D(F))P(o),"/"===V.c()||b(o)&&"\\"===V.c()||o.path.push("");else if(!E(F)||"/"===V.c()||b(o)&&"\\"===V.c()){if(!E(F)){if("file"===o.scheme&&0===o.path.length&&O(F)){null!==o.host&&""!==o.host&&(y("Invalid input string."),o.host="");var $=Array.from(F);F=$.slice(0,1)+":"+$.slice(2)}o.path.push(F)}}else o.path.push("");if(F="","file"===o.scheme&&(""===V.c()||"?"===V.c()||"#"===V.c()))for(;o.path.length>1&&""===o.path[0];)y("Invalid input string."),o.path.splice(0,1);"?"===V.c()&&(o.query="",A=s.ParserState.Query),"#"===V.c()&&(o.fragment="",A=s.ParserState.Fragment)}else m.test(V.c())||"%"===V.c()||y("Character is not a URL code point or a percent encoded character."),"%"!==V.c()||/^[0-9a-fA-F][0-9a-fA-F]/.test(V.remaining())||y("Percent encoded character must be followed by two hex digits."),F+=G(V.c(),f);break;case s.ParserState.CannotBeABaseURLPath:"?"===V.c()?(o.query="",A=s.ParserState.Query):"#"===V.c()?(o.fragment="",A=s.ParserState.Fragment):(""===V.c()||m.test(V.c())||"%"===V.c()||y("Character is not a URL code point or a percent encoded character."),"%"!==V.c()||/^[0-9a-fA-F][0-9a-fA-F]/.test(V.remaining())||y("Percent encoded character must be followed by two hex digits."),""!==V.c()&&(o.path[0]+=G(V.c(),d)));break;case s.ParserState.Query:if("UTF-8"===R||b(o)&&"ws"!==o.scheme&&"wss"!==o.scheme||(R="UTF-8"),void 0===i&&"#"===V.c())o.fragment="",A=s.ParserState.Fragment;else if(""!==V.c()){if(m.test(V.c())||"%"===V.c()||y("Character is not a URL code point or a percent encoded character."),"%"!==V.c()||/^[0-9a-fA-F][0-9a-fA-F]/.test(V.remaining())||y("Percent encoded character must be followed by two hex digits."),"UTF-8"!==R.toUpperCase())throw new Error("Only UTF-8 encoding is supported.");var q=a.utf8Encode(V.c());if(q.length>=3&&38===q[0]&&35===q[1]&&59===q[q.length-1])q=q.subarray(2,q.length-1),o.query+="%26%23"+l.byteSequence.isomorphicDecode(q)+"%3B";else try{for(var Y=(g=void 0,n(q)),J=Y.next();!J.done;J=Y.next()){var Q=J.value;Q<33||Q>126||34===Q||35===Q||60===Q||62===Q||39===Q&&b(o)?o.query+=k(Q):o.query+=String.fromCharCode(Q)}}catch(e){g={error:e}}finally{try{J&&!J.done&&(S=Y.return)&&S.call(Y)}finally{if(g)throw g.error}}}break;case s.ParserState.Fragment:""===V.c()||("\0"===V.c()?y("NULL character in input string."):(m.test(V.c())||"%"===V.c()||y("Unexpected character in fragment string."),"%"!==V.c()||/^[A-Za-z0-9][A-Za-z0-9]/.test(V.remaining())||y("Unexpected character in fragment string."),o.fragment+=G(V.c(),p)))}if(V.eof)break;V.pointer++}return o}function E(e){return"."===e||"%2e"===e.toLowerCase()}function D(e){var t=e.toLowerCase();return".."===t||".%2e"===t||"%2e."===t||"%2e%2e"===t}function P(e){var t=e.path;0!==t.length&&("file"===e.scheme&&1===t.length&&I(t[0])||e.path.splice(e.path.length-1,1))}function I(e){return e.length>=2&&l.codePoint.ASCIIAlpha.test(e[0])&&":"===e[1]}function O(e){return e.length>=2&&l.codePoint.ASCIIAlpha.test(e[0])&&(":"===e[1]||"|"===e[1])}function N(e){return e.length>=2&&O(e)&&(2===e.length||"/"===e[2]||"\\"===e[2]||"?"===e[2]||"#"===e[2])}function M(e,t){if(void 0===t&&(t=!1),e.startsWith("["))return e.endsWith("]")?B(e.substring(1,e.length-1)):(y("Expected ']' after '['."),null);if(t)return L(e);var r=W(a.utf8Decode(V(e)));if(null===r)return y("Invalid domain."),null;if(g.test(r))return y("Invalid domain."),null;var n=F(r);return null===n||a.isNumber(n)?n:r}function R(e,t){void 0===t&&(t={value:!1});var r=10;return e.startsWith("0x")||e.startsWith("0X")?(t.value=!0,e=e.substr(2),r=16):e.length>=2&&"0"===e[0]&&(t.value=!0,e=e.substr(1),r=8),""===e?0:(10===r?/^[0-9]+$/:16===r?/^[0-9A-Fa-f]+$/:/^[0-7]+$/).test(e)?parseInt(e,r):null}function F(e){var t,r,o,i,a={value:!1},s=e.split(".");if(""===s[s.length-1]&&(a.value=!0,s.length>1&&s.pop()),s.length>4)return e;var l=[];try{for(var u=n(s),c=u.next();!c.done;c=u.next()){var d=c.value;if(""===d)return e;if(null===(v=R(d,a)))return e;l.push(v)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}a.value&&y("Invalid IP v4 address.");for(var p=0;p<l.length;p++)if(l[p]>255&&(y("Invalid IP v4 address."),p<l.length-1))return null;if(l[l.length-1]>=Math.pow(256,5-l.length))return y("Invalid IP v4 address."),null;var f=l[l.length-1];l.pop();var h=0;try{for(var m=n(l),g=m.next();!g.done;g=m.next()){var v;f+=(v=g.value)*Math.pow(256,3-h),h++}}catch(e){o={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}return f}function B(e){var t,r=[0,0,0,0,0,0,0,0],n=0,i=null,s=new a.StringWalker(e);if(":"===s.c()){if(!s.remaining().startsWith(":"))return y("Invalid IP v6 address."),null;s.pointer+=2,i=n+=1}for(;""!==s.c();){if(8===n)return y("Invalid IP v6 address."),null;if(":"!==s.c()){for(var u=0,c=0;c<4&&l.codePoint.ASCIIHexDigit.test(s.c());)u=16*u+parseInt(s.c(),16),s.pointer++,c++;if("."===s.c()){if(0===c)return y("Invalid IP v6 address."),null;if(s.pointer-=c,n>6)return y("Invalid IP v6 address."),null;for(var d=0;""!==s.c();){var p=null;if(d>0){if(!("."===s.c()&&d<4))return y("Invalid IP v6 address."),null;s.pointer++}if(!l.codePoint.ASCIIDigit.test(s.c()))return y("Invalid IP v6 address."),null;for(;l.codePoint.ASCIIDigit.test(s.c());){var f=parseInt(s.c(),10);if(null===p)p=f;else{if(0===p)return y("Invalid IP v6 address."),null;p=10*p+f}if(p>255)return y("Invalid IP v6 address."),null;s.pointer++}if(null===p)return y("Invalid IP v6 address."),null;r[n]=256*r[n]+p,2!==++d&&4!==d||n++}if(4!==d)return y("Invalid IP v6 address."),null;break}if(":"===s.c()){if(s.pointer++,""===s.c())return y("Invalid IP v6 address."),null}else if(""!==s.c())return y("Invalid IP v6 address."),null;r[n]=u,n++}else{if(null!==i)return y("Invalid IP v6 address."),null;s.pointer++,i=++n}}if(null!==i){var h=n-i;for(n=7;0!==n&&h>0;)t=o([r[i+h-1],r[n]],2),r[n]=t[0],r[i+h-1]=t[1],n--,h--}else if(null===i&&8!==n)return y("Invalid IP v6 address."),null;return r}function L(e){var t,r;if(/[\x00\t\f\r #/:?@\[\\\]]/.test(e))return y("Invalid host string."),null;var o="";try{for(var i=n(e),a=i.next();!a.done;a=i.next())o+=G(a.value,d)}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o}function k(e){return"%"+("00"+e.toString(16).toUpperCase()).slice(-2)}function U(e){for(var t=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},r=new Uint8Array(e.length),n=0,o=0;o<e.length;o++){var i=e[o];if(37!==i)r[n]=i,n++;else if(37===i&&o>=e.length-2)r[n]=i,n++;else if(37!==i||t(e[o+1])&&t(e[o+2])){var s=parseInt(a.utf8Decode(Uint8Array.of(e[o+1],e[o+2])),16);r[n]=s,n++,o+=2}else r[n]=i,n++}return r.subarray(0,n)}function V(e){return U(a.utf8Encode(e))}function G(e,t){var r,o;if(!t.test(e))return e;var i=a.utf8Encode(e),s="";try{for(var l=n(i),u=l.next();!u.done;u=l.next())s+=k(u.value)}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}return s}function z(e){var t,r,o,i,s=[],l=[];try{for(var u=n(e),c=u.next();!c.done;c=u.next()){var d=c.value;38===d?(s.push(Uint8Array.from(l)),l=[]):l.push(d)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}0!==l.length&&s.push(Uint8Array.from(l));var p=[];try{for(var f=n(s),h=f.next();!h.done;h=f.next()){var m=h.value;if(0!==m.length){for(var g=m.indexOf(61),y=-1!==g?m.slice(0,g):m,v=-1!==g?m.slice(g+1):new Uint8Array,b=0;b<y.length;b++)43===y[b]&&(y[b]=32);for(b=0;b<v.length;b++)43===v[b]&&(v[b]=32);var x=a.utf8Decode(y),_=a.utf8Decode(v);p.push([x,_])}}}catch(e){o={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}return p}function j(e){var t,r,o="";try{for(var i=n(e),a=i.next();!a.done;a=i.next()){var s=a.value;o+=32===s?"+":42===s||45===s||46===s||s>=48&&s<=57||s>=65&&s<=90||95===s||s>=97&&s<=122?String.fromCodePoint(s):k(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o}function W(e,t){void 0===t&&(t=!1);var r=u.domainToASCII(e);return""===r?(y("Invalid domain name."),null):r}t.setValidationErrorCallback=function(e){i=e},t.newURL=function(){return{scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,_cannotBeABaseURLFlag:!1,_blobURLEntry:null}},t.isSpecialScheme=v,t.isSpecial=b,t.defaultPort=x,t.includesCredentials=_,t.cannotHaveAUsernamePasswordPort=function(e){return null===e.host||""===e.host||e._cannotBeABaseURLFlag||"file"===e.scheme},t.urlSerializer=S,t.hostSerializer=C,t.iPv4Serializer=T,t.iPv6Serializer=w,t.urlParser=function(e,t,r){var n=A(e,t,r);return null===n?null:("blob"!==n.scheme||(n._blobURLEntry=null),n)},t.basicURLParser=A,t.setTheUsername=function(e,t){var r,o,i="";try{for(var a=n(t),s=a.next();!s.done;s=a.next())i+=G(s.value,h)}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}e.username=i},t.setThePassword=function(e,t){var r,o,i="";try{for(var a=n(t),s=a.next();!s.done;s=a.next())i+=G(s.value,h)}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}e.password=i},t.isSingleDotPathSegment=E,t.isDoubleDotPathSegment=D,t.shorten=P,t.isNormalizedWindowsDriveLetter=I,t.isWindowsDriveLetter=O,t.startsWithAWindowsDriveLetter=N,t.hostParser=M,t.iPv4NumberParser=R,t.iPv4Parser=F,t.iPv6Parser=B,t.opaqueHostParser=L,t.resolveABlobURL=function(e){return null},t.percentEncode=k,t.percentDecode=U,t.stringPercentDecode=V,t.utf8PercentEncode=G,t.hostEquals=function(e,t){return e===t},t.urlEquals=function(e,t,r){return void 0===r&&(r=!1),S(e,r)===S(t,r)},t.urlEncodedStringParser=function(e){return z(a.utf8Encode(e))},t.urlEncodedParser=z,t.urlEncodedByteSerializer=j,t.urlEncodedSerializer=function(e,t){var r,o;if("UTF-8"!==(void 0===t||"replacement"===t||"UTF-16BE"===t||"UTF-16LE"===t?"UTF-8":t).toUpperCase())throw new Error("Only UTF-8 encoding is supported.");var i="";try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var u=l.value,c=j(a.utf8Encode(u[0])),d=u[1];d=j(a.utf8Encode(d)),""!==i&&(i+="&"),i+=c+"="+d}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i},t.origin=function e(t){switch(t.scheme){case"blob":t._blobURLEntry;var r=A(t.path[0]);return null===r?s.OpaqueOrigin:e(r);case"ftp":case"http":case"https":case"ws":case"wss":return[t.scheme,null===t.host?"":t.host,t.port,null];default:return s.OpaqueOrigin}},t.domainToASCII=W,t.domainToUnicode=function(e,t){void 0===t&&(t=!1);var r=u.domainToUnicode(e);return""===r&&y("Invalid domain name."),r},t.asciiSerializationOfAnOrigin=function(e){if(""===e[0]&&""===e[1]&&null===e[2]&&null===e[3])return"null";var t=e[0]+"://"+C(e[1]);return null!==e[2]&&(t+=":"+e[2].toString()),t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=function(){function e(){this._signal=n.create_abortSignal()}return Object.defineProperty(e.prototype,"signal",{get:function(){return this._signal},enumerable:!0,configurable:!0}),e.prototype.abort=function(){n.abort_signalAbort(this._signal)},e}();t.AbortControllerImpl=o},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(70),a=r(0),s=function(e){function t(){var t=e.call(this)||this;return t._abortedFlag=!1,t._abortAlgorithms=new Set,t}return o(t,e),Object.defineProperty(t.prototype,"aborted",{get:function(){return this._abortedFlag},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onabort",{get:function(){return a.event_getterEventHandlerIDLAttribute(this,"onabort")},set:function(e){a.event_setterEventHandlerIDLAttribute(this,"onabort",e)},enumerable:!0,configurable:!0}),t._create=function(){return new t},t}(i.EventTargetImpl);t.AbortSignalImpl=s},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),a=r(34),s=r(12),l=function(e){function t(t,r,n){var o=e.call(this)||this;return o._name="",o._publicId="",o._systemId="",o._name=t,o._publicId=r,o._systemId=n,o}return o(t,e),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"publicId",{get:function(){return this._publicId},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"systemId",{get:function(){return this._systemId},enumerable:!0,configurable:!0}),t.prototype.before=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.after=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.replaceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];throw new Error("Mixin: ChildNode not implemented.")},t.prototype.remove=function(){throw new Error("Mixin: ChildNode not implemented.")},t._create=function(e,r,n,o){void 0===n&&(n=""),void 0===o&&(o="");var i=new t(r,n,o);return i._nodeDocument=e,i},t}(a.NodeImpl);t.DocumentTypeImpl=l,s.idl_defineConst(l.prototype,"_nodeType",i.NodeType.DocumentType)},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(100),a=r(1),s=r(0),l=function(e){function t(t,r){var n=e.call(this)||this;return n._host=t,n._mode=r,n}return o(t,e),Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"host",{get:function(){return this._host},enumerable:!0,configurable:!0}),t.prototype._getTheParent=function(e){return e._composedFlag||a.isEmpty(e._path)||s.tree_rootNode(e._path[0].invocationTarget)!==this?this._host:null},t._create=function(e,r){return new t(r,"closed")},t}(i.DocumentFragmentImpl);t.ShadowRootImpl=l},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),a=r(34),s=r(0),l=r(12),u=function(e){function t(t){var r=e.call(this)||this;return r._namespace=null,r._namespacePrefix=null,r._element=null,r._value="",r._localName=t,r}return o(t,e),Object.defineProperty(t.prototype,"ownerElement",{get:function(){return this._element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"namespaceURI",{get:function(){return this._namespace},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"prefix",{get:function(){return this._namespacePrefix},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"localName",{get:function(){return this._localName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._qualifiedName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(e){s.attr_setAnExistingAttributeValue(this,e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_qualifiedName",{get:function(){return null!==this._namespacePrefix?this._namespacePrefix+":"+this._localName:this._localName},enumerable:!0,configurable:!0}),t._create=function(e,r){var n=new t(r);return n._nodeDocument=e,n},t}(a.NodeImpl);t.AttrImpl=u,l.idl_defineConst(u.prototype,"_nodeType",i.NodeType.Attribute),l.idl_defineConst(u.prototype,"specified",!0)},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(101),a=r(2),s=r(12),l=function(e){function t(t){return e.call(this,t)||this}return o(t,e),t._create=function(e,r){void 0===r&&(r="");var n=new t(r);return n._nodeDocument=e,n},t}(i.TextImpl);t.CDATASectionImpl=l,s.idl_defineConst(l.prototype,"_nodeType",a.NodeType.CData)},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),a=r(71),s=r(12),l=function(e){function t(t){return void 0===t&&(t=""),e.call(this,t)||this}return o(t,e),t._create=function(e,r){void 0===r&&(r="");var n=new t(r);return n._nodeDocument=e,n},t}(a.CharacterDataImpl);t.CommentImpl=l,s.idl_defineConst(l.prototype,"_nodeType",i.NodeType.Comment)},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),a=r(71),s=r(12),l=function(e){function t(t,r){var n=e.call(this,r)||this;return n._target=t,n}return o(t,e),Object.defineProperty(t.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),t._create=function(e,r,n){var o=new t(r,n);return o._nodeDocument=e,o},t}(a.CharacterDataImpl);t.ProcessingInstructionImpl=l,s.idl_defineConst(l.prototype,"_nodeType",i.NodeType.ProcessingInstruction)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7),o=r(0),i=r(3),a=r(1),s=function(){function e(e,t){return this._live=!0,this._root=e,this._filter=t,new Proxy(this,this)}return Object.defineProperty(e.prototype,"length",{get:function(){for(var e=this,t=0,r=o.tree_getFirstDescendantNode(this._root,!1,!1,function(t){return i.Guard.isElementNode(t)&&e._filter(t)});null!==r;)t++,r=o.tree_getNextDescendantNode(this._root,r,!1,!1,function(t){return i.Guard.isElementNode(t)&&e._filter(t)});return t},enumerable:!0,configurable:!0}),e.prototype.item=function(e){for(var t=this,r=0,n=o.tree_getFirstDescendantNode(this._root,!1,!1,function(e){return i.Guard.isElementNode(e)&&t._filter(e)});null!==n;){if(r===e)return n;r++,n=o.tree_getNextDescendantNode(this._root,n,!1,!1,function(e){return i.Guard.isElementNode(e)&&t._filter(e)})}return null},e.prototype.namedItem=function(e){var t=this;if(""===e)return null;for(var r=o.tree_getFirstDescendantNode(this._root,!1,!1,function(e){return i.Guard.isElementNode(e)&&t._filter(e)});null!=r;){if(r._uniqueIdentifier===e)return r;if(r._namespace===n.namespace.HTML)for(var a=0;a<r._attributeList.length;a++){var s=r._attributeList[a];if("name"===s._localName&&null===s._namespace&&null===s._namespacePrefix&&s._value===e)return r}r=o.tree_getNextDescendantNode(this._root,r,!1,!1,function(e){return i.Guard.isElementNode(e)&&t._filter(e)})}return null},e.prototype[Symbol.iterator]=function(){var e=this._root,t=this._filter,r=o.tree_getFirstDescendantNode(e,!1,!1,function(e){return i.Guard.isElementNode(e)&&t(e)});return{next:function(){if(null===r)return{done:!0,value:null};var n={done:!1,value:r};return r=o.tree_getNextDescendantNode(e,r,!1,!1,function(e){return i.Guard.isElementNode(e)&&t(e)}),n}}},e.prototype.get=function(t,r,n){if(!a.isString(r)||-1!==e.reservedNames.indexOf(r))return Reflect.get(t,r,n);var o=Number(r);return isNaN(o)?t.namedItem(r)||void 0:t.item(o)||void 0},e.prototype.set=function(t,r,n,i){if(!a.isString(r)||-1!==e.reservedNames.indexOf(r))return Reflect.set(t,r,n,i);var s=Number(r),l=isNaN(s)?t.namedItem(r)||void 0:t.item(s)||void 0;return!(!l||!l._parent||(o.mutation_replace(l,n,l._parent),0))},e._create=function(t,r){return void 0===r&&(r=function(){return!0}),new e(t,r)},e.reservedNames=["_root","_live","_filter","length","item","namedItem","get","set"],e}();t.HTMLCollectionImpl=s},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),i=r(1),a=r(0),s=function(){function e(e){return this._live=!0,this._filter=null,this._length=0,this._root=e,new Proxy(this,this)}return Object.defineProperty(e.prototype,"length",{get:function(){return this._root._children.size},enumerable:!0,configurable:!0}),e.prototype.item=function(e){if(e<0||e>this.length-1)return null;if(e<this.length/2){for(var t=0,r=this._root._firstChild;null!==r&&t!==e;)r=r._nextSibling,t++;return r}for(t=this.length-1,r=this._root._lastChild;null!==r&&t!==e;)r=r._previousSibling,t--;return r},e.prototype.keys=function(){var e;return(e={})[Symbol.iterator]=function(){var e=0;return{next:function(){return e===this.length?{done:!0,value:null}:{done:!1,value:e++}}.bind(this)}}.bind(this),e},e.prototype.values=function(){var e;return(e={})[Symbol.iterator]=function(){var e=this[Symbol.iterator]();return{next:function(){return e.next()}}}.bind(this),e},e.prototype.entries=function(){var e;return(e={})[Symbol.iterator]=function(){var e=this[Symbol.iterator](),t=0;return{next:function(){var r=e.next();return r.done?{done:!0,value:null}:{done:!1,value:[t++,r.value]}}}}.bind(this),e},e.prototype[Symbol.iterator]=function(){return this._root._children[Symbol.iterator]()},e.prototype.forEach=function(e,t){var r,i;void 0===t&&(t=o.dom.window);var a=0;try{for(var s=n(this._root._children),l=s.next();!l.done;l=s.next()){var u=l.value;e.call(t,u,a++,this)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}},e.prototype.get=function(e,t,r){if(!i.isString(t))return Reflect.get(e,t,r);var n=Number(t);return isNaN(n)?Reflect.get(e,t,r):e.item(n)||void 0},e.prototype.set=function(e,t,r,n){if(!i.isString(t))return Reflect.set(e,t,r,n);var o=Number(t);if(isNaN(o))return Reflect.set(e,t,r,n);var s=e.item(o)||void 0;return!!s&&!!s._parent&&(a.mutation_replace(s,r,s._parent),!0)},e._create=function(t){return new e(t)},e}();t.NodeListImpl=s},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),i=r(1),a=function(){function e(e){return this._live=!1,this._items=[],this._length=0,this._root=e,this._items=[],this._filter=function(e){return!0},new Proxy(this,this)}return Object.defineProperty(e.prototype,"length",{get:function(){return this._items.length},enumerable:!0,configurable:!0}),e.prototype.item=function(e){return e<0||e>this.length-1?null:this._items[e]},e.prototype.keys=function(){var e;return(e={})[Symbol.iterator]=function(){var e=0;return{next:function(){return e===this.length?{done:!0,value:null}:{done:!1,value:e++}}.bind(this)}}.bind(this),e},e.prototype.values=function(){var e;return(e={})[Symbol.iterator]=function(){var e=this[Symbol.iterator]();return{next:function(){return e.next()}}}.bind(this),e},e.prototype.entries=function(){var e;return(e={})[Symbol.iterator]=function(){var e=this[Symbol.iterator](),t=0;return{next:function(){var r=e.next();return r.done?{done:!0,value:null}:{done:!1,value:[t++,r.value]}}}}.bind(this),e},e.prototype[Symbol.iterator]=function(){var e=this._items[Symbol.iterator]();return{next:function(){return e.next()}}},e.prototype.forEach=function(e,t){var r,i;void 0===t&&(t=o.dom.window);var a=0;try{for(var s=n(this._items),l=s.next();!l.done;l=s.next()){var u=l.value;e.call(t,u,a++,this)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}},e.prototype.get=function(e,t,r){if(!i.isString(t))return Reflect.get(e,t,r);var n=Number(t);return isNaN(n)?Reflect.get(e,t,r):e._items[n]||void 0},e.prototype.set=function(e,t,r,n){if(!i.isString(t))return Reflect.set(e,t,r,n);var o=Number(t);return isNaN(o)?Reflect.set(e,t,r,n):o>=0&&o<e._items.length&&(e._items[o]=r,!0)},e._create=function(t,r){var n=new e(t);return n._items=r,n},e}();t.NodeListStaticImpl=a},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),a=r(0),s=function(e){function t(r){var n=e.call(this)||this;return n._element=r,Object.setPrototypeOf(n,t.prototype),n}return o(t,e),t.prototype._asArray=function(){return this},t.prototype.item=function(e){return this[e]||null},t.prototype.getNamedItem=function(e){return a.element_getAnAttributeByName(e,this._element)},t.prototype.getNamedItemNS=function(e,t){return a.element_getAnAttributeByNamespaceAndLocalName(e||"",t,this._element)},t.prototype.setNamedItem=function(e){return a.element_setAnAttribute(e,this._element)},t.prototype.setNamedItemNS=function(e){return a.element_setAnAttribute(e,this._element)},t.prototype.removeNamedItem=function(e){var t=a.element_removeAnAttributeByName(e,this._element);if(null===t)throw new i.NotFoundError;return t},t.prototype.removeNamedItemNS=function(e,t){var r=a.element_removeAnAttributeByNamespaceAndLocalName(e||"",t,this._element);if(null===r)throw new i.NotFoundError;return r},t._create=function(e){return new t(e)},t}(Array);t.NamedNodeMapImpl=s},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=r(6),s=r(2),l=r(102),u=r(9),c=r(0),d=r(12),p=r(3),f=function(e){function t(){var t=e.call(this)||this,r=a.dom.window._associatedDocument;return t._start=[r,0],t._end=[r,0],a.dom.rangeList.add(t),t}return o(t,e),Object.defineProperty(t.prototype,"commonAncestorContainer",{get:function(){for(var e=this._start[0];!c.tree_isAncestorOf(this._end[0],e,!0);){if(null===e._parent)throw new Error("Parent node is null.");e=e._parent}return e},enumerable:!0,configurable:!0}),t.prototype.setStart=function(e,t){c.range_setTheStart(this,e,t)},t.prototype.setEnd=function(e,t){c.range_setTheEnd(this,e,t)},t.prototype.setStartBefore=function(e){var t=e._parent;if(null===t)throw new u.InvalidNodeTypeError;c.range_setTheStart(this,t,c.tree_index(e))},t.prototype.setStartAfter=function(e){var t=e._parent;if(null===t)throw new u.InvalidNodeTypeError;c.range_setTheStart(this,t,c.tree_index(e)+1)},t.prototype.setEndBefore=function(e){var t=e._parent;if(null===t)throw new u.InvalidNodeTypeError;c.range_setTheEnd(this,t,c.tree_index(e))},t.prototype.setEndAfter=function(e){var t=e._parent;if(null===t)throw new u.InvalidNodeTypeError;c.range_setTheEnd(this,t,c.tree_index(e)+1)},t.prototype.collapse=function(e){e?this._end=this._start:this._start=this._end},t.prototype.selectNode=function(e){c.range_select(e,this)},t.prototype.selectNodeContents=function(e){if(p.Guard.isDocumentTypeNode(e))throw new u.InvalidNodeTypeError;var t=c.tree_nodeLength(e);this._start=[e,0],this._end=[e,t]},t.prototype.compareBoundaryPoints=function(e,t){if(e!==s.HowToCompare.StartToStart&&e!==s.HowToCompare.StartToEnd&&e!==s.HowToCompare.EndToEnd&&e!==s.HowToCompare.EndToStart)throw new u.NotSupportedError;if(c.range_root(this)!==c.range_root(t))throw new u.WrongDocumentError;var r,n;switch(e){case s.HowToCompare.StartToStart:r=this._start,n=t._start;break;case s.HowToCompare.StartToEnd:r=this._end,n=t._start;break;case s.HowToCompare.EndToEnd:r=this._end,n=t._end;break;case s.HowToCompare.EndToStart:r=this._start,n=t._end;break;default:throw new u.NotSupportedError}var o=c.boundaryPoint_position(r,n);return o===s.BoundaryPosition.Before?-1:o===s.BoundaryPosition.After?1:0},t.prototype.deleteContents=function(){var e,t,r,n;if(!c.range_collapsed(this)){var o=this._startNode,a=this._startOffset,s=this._endNode,l=this._endOffset;if(o===s&&p.Guard.isCharacterDataNode(o))c.characterData_replaceData(o,a,l-a,"");else{var u,d,f=[];try{for(var h=i(c.range_getContainedNodes(this)),m=h.next();!m.done;m=h.next()){var g=(x=m.value)._parent;null!==g&&c.range_isContained(g,this)||f.push(x)}}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}if(c.tree_isAncestorOf(s,o,!0))u=o,d=a;else{for(var y=o;null!==y._parent&&!c.tree_isAncestorOf(s,y._parent,!0);)y=y._parent;if(null===y._parent)throw new Error("Parent node is null.");u=y._parent,d=c.tree_index(y)+1}p.Guard.isCharacterDataNode(o)&&c.characterData_replaceData(o,a,c.tree_nodeLength(o)-a,"");try{for(var v=i(f),b=v.next();!b.done;b=v.next()){var x;(x=b.value)._parent&&c.mutation_remove(x,x._parent)}}catch(e){r={error:e}}finally{try{b&&!b.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}p.Guard.isCharacterDataNode(s)&&c.characterData_replaceData(s,0,l,""),this._start=[u,d],this._end=[u,d]}}},t.prototype.extractContents=function(){return c.range_extract(this)},t.prototype.cloneContents=function(){return c.range_cloneTheContents(this)},t.prototype.insertNode=function(e){return c.range_insert(e,this)},t.prototype.surroundContents=function(e){var t,r;try{for(var n=i(c.range_getPartiallyContainedNodes(this)),o=n.next();!o.done;o=n.next()){var a=o.value;if(!p.Guard.isTextNode(a))throw new u.InvalidStateError}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(p.Guard.isDocumentNode(e)||p.Guard.isDocumentTypeNode(e)||p.Guard.isDocumentFragmentNode(e))throw new u.InvalidNodeTypeError;var s=c.range_extract(this);0!==e._children.size&&c.mutation_replaceAll(null,e),c.range_insert(e,this),c.mutation_append(s,e),c.range_select(e,this)},t.prototype.cloneRange=function(){return c.create_range(this._start,this._end)},t.prototype.detach=function(){a.dom.rangeList.delete(this)},t.prototype.isPointInRange=function(e,t){if(c.tree_rootNode(e)!==c.range_root(this))return!1;if(p.Guard.isDocumentTypeNode(e))throw new u.InvalidNodeTypeError;if(t>c.tree_nodeLength(e))throw new u.IndexSizeError;var r=[e,t];return c.boundaryPoint_position(r,this._start)!==s.BoundaryPosition.Before&&c.boundaryPoint_position(r,this._end)!==s.BoundaryPosition.After},t.prototype.comparePoint=function(e,t){if(c.tree_rootNode(e)!==c.range_root(this))throw new u.WrongDocumentError;if(p.Guard.isDocumentTypeNode(e))throw new u.InvalidNodeTypeError;if(t>c.tree_nodeLength(e))throw new u.IndexSizeError;var r=[e,t];return c.boundaryPoint_position(r,this._start)===s.BoundaryPosition.Before?-1:c.boundaryPoint_position(r,this._end)===s.BoundaryPosition.After?1:0},t.prototype.intersectsNode=function(e){if(c.tree_rootNode(e)!==c.range_root(this))return!1;var t=e._parent;if(null===t)return!0;var r=c.tree_index(e);return c.boundaryPoint_position([t,r],this._end)===s.BoundaryPosition.Before&&c.boundaryPoint_position([t,r+1],this._start)===s.BoundaryPosition.After},t.prototype.toString=function(){var e,t,r="";if(this._startNode===this._endNode&&p.Guard.isTextNode(this._startNode))return this._startNode._data.substring(this._startOffset,this._endOffset);p.Guard.isTextNode(this._startNode)&&(r+=this._startNode._data.substring(this._startOffset));try{for(var n=i(c.range_getContainedNodes(this)),o=n.next();!o.done;o=n.next()){var a=o.value;p.Guard.isTextNode(a)&&(r+=a._data)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return p.Guard.isTextNode(this._endNode)&&(r+=this._endNode._data.substring(0,this._endOffset)),r},t._create=function(e,r){var n=new t;return e&&(n._start=e),r&&(n._end=r),n},t.START_TO_START=0,t.START_TO_END=1,t.END_TO_END=2,t.END_TO_START=3,t}(l.AbstractRangeImpl);t.RangeImpl=f,d.idl_defineConst(f.prototype,"START_TO_START",0),d.idl_defineConst(f.prototype,"START_TO_END",1),d.idl_defineConst(f.prototype,"END_TO_END",2),d.idl_defineConst(f.prototype,"END_TO_START",3)},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(103),a=r(0),s=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o._iteratorCollection=void 0,o._reference=r,o._pointerBeforeReference=n,a.nodeIterator_iteratorList().add(o),o}return o(t,e),Object.defineProperty(t.prototype,"referenceNode",{get:function(){return this._reference},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointerBeforeReferenceNode",{get:function(){return this._pointerBeforeReference},enumerable:!0,configurable:!0}),t.prototype.nextNode=function(){return a.nodeIterator_traverse(this,!0)},t.prototype.previousNode=function(){return a.nodeIterator_traverse(this,!1)},t.prototype.detach=function(){a.nodeIterator_iteratorList().delete(this)},t._create=function(e,r,n){return new t(e,r,n)},t}(i.TraverserImpl);t.NodeIteratorImpl=s},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),a=r(103),s=r(0),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n._current=r,n}return o(t,e),Object.defineProperty(t.prototype,"currentNode",{get:function(){return this._current},set:function(e){this._current=e},enumerable:!0,configurable:!0}),t.prototype.parentNode=function(){for(var e=this._current;null!==e&&e!==this._root;)if(null!==(e=e._parent)&&s.traversal_filter(this,e)===i.FilterResult.Accept)return this._current=e,e;return null},t.prototype.firstChild=function(){return s.treeWalker_traverseChildren(this,!0)},t.prototype.lastChild=function(){return s.treeWalker_traverseChildren(this,!1)},t.prototype.nextSibling=function(){return s.treeWalker_traverseSiblings(this,!0)},t.prototype.previousNode=function(){for(var e=this._current;e!==this._root;){for(var t=e._previousSibling;t;){e=t;for(var r=s.traversal_filter(this,e);r!==i.FilterResult.Reject&&e._lastChild;)e=e._lastChild,r=s.traversal_filter(this,e);if(r===i.FilterResult.Accept)return this._current=e,e;t=e._previousSibling}if(e===this._root||null===e._parent)return null;if(e=e._parent,s.traversal_filter(this,e)===i.FilterResult.Accept)return this._current=e,e}return null},t.prototype.previousSibling=function(){return s.treeWalker_traverseSiblings(this,!1)},t.prototype.nextNode=function(){for(var e=this._current,t=i.FilterResult.Accept;;){for(;t!==i.FilterResult.Reject&&e._firstChild;)if(e=e._firstChild,(t=s.traversal_filter(this,e))===i.FilterResult.Accept)return this._current=e,e;for(var r=null,n=e;null!==n;){if(n===this._root)return null;if(null!==(r=n._nextSibling)){e=r;break}n=n._parent}if((t=s.traversal_filter(this,e))===i.FilterResult.Accept)return this._current=e,e}},t._create=function(e,r){return new t(e,r)},t}(a.TraverserImpl);t.TreeWalkerImpl=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(12),i=function(){function e(){}return e.prototype.acceptNode=function(e){return n.FilterResult.Accept},e._create=function(){return new e},e.FILTER_ACCEPT=1,e.FILTER_REJECT=2,e.FILTER_SKIP=3,e.SHOW_ALL=4294967295,e.SHOW_ELEMENT=1,e.SHOW_ATTRIBUTE=2,e.SHOW_TEXT=4,e.SHOW_CDATA_SECTION=8,e.SHOW_ENTITY_REFERENCE=16,e.SHOW_ENTITY=32,e.SHOW_PROCESSING_INSTRUCTION=64,e.SHOW_COMMENT=128,e.SHOW_DOCUMENT=256,e.SHOW_DOCUMENT_TYPE=512,e.SHOW_DOCUMENT_FRAGMENT=1024,e.SHOW_NOTATION=2048,e}();t.NodeFilterImpl=i,o.idl_defineConst(i.prototype,"FILTER_ACCEPT",1),o.idl_defineConst(i.prototype,"FILTER_REJECT",2),o.idl_defineConst(i.prototype,"FILTER_SKIP",3),o.idl_defineConst(i.prototype,"SHOW_ALL",4294967295),o.idl_defineConst(i.prototype,"SHOW_ELEMENT",1),o.idl_defineConst(i.prototype,"SHOW_ATTRIBUTE",2),o.idl_defineConst(i.prototype,"SHOW_TEXT",4),o.idl_defineConst(i.prototype,"SHOW_CDATA_SECTION",8),o.idl_defineConst(i.prototype,"SHOW_ENTITY_REFERENCE",16),o.idl_defineConst(i.prototype,"SHOW_ENTITY",32),o.idl_defineConst(i.prototype,"SHOW_PROCESSING_INSTRUCTION",64),o.idl_defineConst(i.prototype,"SHOW_COMMENT",128),o.idl_defineConst(i.prototype,"SHOW_DOCUMENT",256),o.idl_defineConst(i.prototype,"SHOW_DOCUMENT_TYPE",512),o.idl_defineConst(i.prototype,"SHOW_DOCUMENT_FRAGMENT",1024),o.idl_defineConst(i.prototype,"SHOW_NOTATION",2048)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t,r,n,o,i,a,s,l){this._type=e,this._target=t,this._addedNodes=r,this._removedNodes=n,this._previousSibling=o,this._nextSibling=i,this._attributeName=a,this._attributeNamespace=s,this._oldValue=l}return Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"addedNodes",{get:function(){return this._addedNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"removedNodes",{get:function(){return this._removedNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this._previousSibling},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this._nextSibling},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"attributeName",{get:function(){return this._attributeName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"attributeNamespace",{get:function(){return this._attributeNamespace},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"oldValue",{get:function(){return this._oldValue},enumerable:!0,configurable:!0}),e._create=function(t,r,n,o,i,a,s,l,u){return new e(t,r,n,o,i,a,s,l,u)},e}();t.MutationRecordImpl=n},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),i=r(9),a=r(7),s=r(0),l=function(){function e(e,t){this._element=e,this._attribute=t,this._tokenSet=new Set;var r=t._localName,n=s.element_getAnAttributeValue(e,r),i=this;this._element._attributeChangeSteps.push(function(e,t,r,n,o){t===i._attribute._localName&&null===o&&(n?i._tokenSet=s.orderedSet_parse(n):i._tokenSet.clear())}),o.dom.features.steps&&s.dom_runAttributeChangeSteps(e,r,n,n,null)}return Object.defineProperty(e.prototype,"length",{get:function(){return this._tokenSet.size},enumerable:!0,configurable:!0}),e.prototype.item=function(e){var t,r,o=0;try{for(var i=n(this._tokenSet),a=i.next();!a.done;a=i.next()){var s=a.value;if(o===e)return s;o++}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return null},e.prototype.contains=function(e){return this._tokenSet.has(e)},e.prototype.add=function(){for(var e,t,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{for(var l=n(r),u=l.next();!u.done;u=l.next()){var c=u.value;if(""===c)throw new i.SyntaxError("Cannot add an empty token.");if(a.codePoint.ASCIIWhiteSpace.test(c))throw new i.InvalidCharacterError("Token cannot contain whitespace.");this._tokenSet.add(c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}s.tokenList_updateSteps(this)},e.prototype.remove=function(){for(var e,t,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{for(var l=n(r),u=l.next();!u.done;u=l.next()){var c=u.value;if(""===c)throw new i.SyntaxError("Cannot remove an empty token.");if(a.codePoint.ASCIIWhiteSpace.test(c))throw new i.InvalidCharacterError("Token cannot contain whitespace.");this._tokenSet.delete(c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}s.tokenList_updateSteps(this)},e.prototype.toggle=function(e,t){if(void 0===t&&(t=void 0),""===e)throw new i.SyntaxError("Cannot toggle an empty token.");if(a.codePoint.ASCIIWhiteSpace.test(e))throw new i.InvalidCharacterError("Token cannot contain whitespace.");return this._tokenSet.has(e)?void 0!==t&&!1!==t||(this._tokenSet.delete(e),s.tokenList_updateSteps(this),!1):(void 0===t||!0===t)&&(this._tokenSet.add(e),s.tokenList_updateSteps(this),!0)},e.prototype.replace=function(e,t){if(""===e||""===t)throw new i.SyntaxError("Cannot replace an empty token.");if(a.codePoint.ASCIIWhiteSpace.test(e)||a.codePoint.ASCIIWhiteSpace.test(t))throw new i.InvalidCharacterError("Token cannot contain whitespace.");return!!this._tokenSet.has(e)&&(a.set.replace(this._tokenSet,e,t),s.tokenList_updateSteps(this),!0)},e.prototype.supports=function(e){return s.tokenList_validationSteps(this,e)},Object.defineProperty(e.prototype,"value",{get:function(){return s.tokenList_serializeSteps(this)},set:function(e){s.element_setAnAttributeValue(this._element,this._attribute._localName,e)},enumerable:!0,configurable:!0}),e.prototype[Symbol.iterator]=function(){var e=this._tokenSet[Symbol.iterator]();return{next:function(){return e.next()}}},e._create=function(t,r){return new e(t,r)},e}();t.DOMTokenListImpl=l},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(104),a=r(0),s=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n._detail=null,n._detail=r&&r.detail||null,n}return o(t,e),Object.defineProperty(t.prototype,"detail",{get:function(){return this._detail},enumerable:!0,configurable:!0}),t.prototype.initCustomEvent=function(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1),void 0===n&&(n=null),this._dispatchFlag||(a.event_initialize(this,e,t,r),this._detail=n)},t}(i.EventImpl);t.CustomEventImpl=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6),o=r(2),i=r(105),a=r(17);t.nodeIterator_traverse=function(e,t){for(var r=e._reference,n=e._pointerBeforeReference;;){if(t)if(n)n=!1;else{var s=a.tree_getFollowingNode(e._root,r);if(!s)return null;r=s}else if(n){var l=a.tree_getPrecedingNode(e.root,r);if(!l)return null;r=l}else n=!0;if(i.traversal_filter(e,r)===o.FilterResult.Accept)break}return e._reference=r,e._pointerBeforeReference=n,r},t.nodeIterator_iteratorList=function(){return n.dom.window._iteratorList}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),o=r(7),i=r(174);function a(e){if(!i.xml_isName(e))throw new n.InvalidCharacterError("Invalid XML name: "+e);if(!i.xml_isQName(e))throw new n.InvalidCharacterError("Invalid XML qualified name: "+e+".")}t.namespace_validate=a,t.namespace_validateAndExtract=function(e,t){e||(e=null),a(t);var r=t.split(":"),i=2===r.length?r[0]:null,s=2===r.length?r[1]:t;if(i&&null===e)throw new n.NamespaceError("Qualified name includes a prefix but the namespace is null.");if("xml"===i&&e!==o.namespace.XML)throw new n.NamespaceError('Qualified name includes the "xml" prefix but the namespace is not the XML namespace.');if(e!==o.namespace.XMLNS&&("xmlns"===i||"xmlns"===t))throw new n.NamespaceError('Qualified name includes the "xmlns" prefix but the namespace is not the XMLNS namespace.');if(e===o.namespace.XMLNS&&"xmlns"!==i&&"xmlns"!==t)throw new n.NamespaceError('Qualified name does not include the "xmlns" prefix but the namespace is the XMLNS namespace.');return[e,i,s]},t.namespace_extractQName=function(e){a(e);var t=e.split(":");return[2===t.length?t[0]:null,2===t.length?t[1]:e]}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.xml_isName=function(e){for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(!(r>=97&&r<=122||r>=65&&r<=90||58===r||95===r||r>=192&&r<=214||r>=216&&r<=246||r>=248&&r<=767||r>=880&&r<=893||r>=895&&r<=8191||r>=8204&&r<=8205||r>=8304&&r<=8591||r>=11264&&r<=12271||r>=12289&&r<=55295||r>=63744&&r<=64975||r>=65008&&r<=65533||0!==t&&(45===r||46===r||r>=48&&r<=57||183===r||r>=768&&r<=879||r>=8255&&r<=8256))){if(r>=55296&&r<=56319&&t<e.length-1){var n=e.charCodeAt(t+1);if(n>=56320&&n<=57343&&(t++,(r=1024*(r-55296)+n-56320+65536)>=65536&&r<=983039))continue}return!1}}return!0},t.xml_isQName=function(e){for(var t=!1,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(!(n>=97&&n<=122||n>=65&&n<=90||95===n||n>=192&&n<=214||n>=216&&n<=246||n>=248&&n<=767||n>=880&&n<=893||n>=895&&n<=8191||n>=8204&&n<=8205||n>=8304&&n<=8591||n>=11264&&n<=12271||n>=12289&&n<=55295||n>=63744&&n<=64975||n>=65008&&n<=65533||0!==r&&(45===n||46===n||n>=48&&n<=57||183===n||n>=768&&n<=879||n>=8255&&n<=8256))){if(0===r||58!==n){if(n>=55296&&n<=56319&&r<e.length-1){var o=e.charCodeAt(r+1);if(o>=56320&&o<=57343&&(r++,(n=1024*(n-55296)+o-56320+65536)>=65536&&n<=983039))continue}return!1}if(t)return!1;if(r===e.length-1)return!1;t=!0}}return!0},t.xml_isLegalChar=function(e){for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(!(9===r||10===r||13===r||r>=32&&r<=55295||r>=57344&&r<=65533)){if(r>=55296&&r<=56319&&t<e.length-1){var n=e.charCodeAt(t+1);if(n>=56320&&n<=57343&&(t++,(r=1024*(r-55296)+n-56320+65536)>=65536&&r<=1114111))continue}return!1}}return!0},t.xml_isPubidChar=function(e){for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(!(r>=97&&r<=122||r>=65&&r<=90||r>=39&&r<=59||32===r||13===r||10===r||r>=35&&r<=37||33===r||61===r||63===r||64===r||95===r))return!1}return!0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(17);t.boundaryPoint_position=function e(t,r){var i=t[0],a=t[1],s=r[0],l=r[1];if(console.assert(o.tree_rootNode(i)===o.tree_rootNode(s),"Boundary points must share the same root node."),i===s)return a===l?n.BoundaryPosition.Equal:a<l?n.BoundaryPosition.Before:n.BoundaryPosition.After;if(o.tree_isFollowing(s,i)){var u=e([s,l],[i,a]);if(u===n.BoundaryPosition.Before)return n.BoundaryPosition.After;if(u===n.BoundaryPosition.After)return n.BoundaryPosition.Before}if(o.tree_isAncestorOf(s,i)){for(var c=s;!o.tree_isChildOf(i,c);)null!==c._parent&&(c=c._parent);if(o.tree_index(c)<a)return n.BoundaryPosition.After}return n.BoundaryPosition.Before}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),i=r(3),a=r(7),s=r(29),l=r(108),u=r(30),c=r(37),d=r(52);t.node_stringReplaceAll=function(e,t){var r=null;""!==e&&(r=s.create_text(t._nodeDocument,e)),c.mutation_replaceAll(r,t)},t.node_clone=function e(t,r,a){var l,p,f,h,m;if(void 0===r&&(r=null),void 0===a&&(a=!1),null===r&&(r=t._nodeDocument),i.Guard.isElementNode(t)){m=d.element_createAnElement(r,t._localName,t._namespace,t._namespacePrefix,t._is,!1);try{for(var g=n(t._attributeList),y=g.next();!y.done;y=g.next()){var v=e(y.value,r);d.element_append(v,m)}}catch(e){l={error:e}}finally{try{y&&!y.done&&(p=g.return)&&p.call(g)}finally{if(l)throw l.error}}}else if(i.Guard.isDocumentNode(t)){var b=s.create_document();b._encoding=t._encoding,b._contentType=t._contentType,b._URL=t._URL,b._origin=t._origin,b._type=t._type,b._mode=t._mode,m=b}else if(i.Guard.isDocumentTypeNode(t))m=s.create_documentType(r,t._name,t._publicId,t._systemId);else if(i.Guard.isAttrNode(t)){var x=s.create_attr(r,t.localName);x._namespace=t._namespace,x._namespacePrefix=t._namespacePrefix,x._value=t._value,m=x}else m=i.Guard.isExclusiveTextNode(t)?s.create_text(r,t._data):i.Guard.isCDATASectionNode(t)?s.create_cdataSection(r,t._data):i.Guard.isCommentNode(t)?s.create_comment(r,t._data):i.Guard.isProcessingInstructionNode(t)?s.create_processingInstruction(r,t._target,t._data):i.Guard.isDocumentFragmentNode(t)?s.create_documentFragment(r):Object.create(t);if(i.Guard.isDocumentNode(m)?(m._nodeDocument=m,r=m):m._nodeDocument=r,o.dom.features.steps&&u.dom_runCloningSteps(m,t,r,a),a)try{for(var _=n(t._children),S=_.next();!S.done;S=_.next()){var C=e(S.value,r,!0);c.mutation_append(C,m)}}catch(e){f={error:e}}finally{try{S&&!S.done&&(h=_.return)&&h.call(_)}finally{if(f)throw f.error}}return m},t.node_equals=function e(t,r){var o,a,s,l;if(t._nodeType!==r._nodeType)return!1;if(i.Guard.isDocumentTypeNode(t)&&i.Guard.isDocumentTypeNode(r)){if(t._name!==r._name||t._publicId!==r._publicId||t._systemId!==r._systemId)return!1}else if(i.Guard.isElementNode(t)&&i.Guard.isElementNode(r)){if(t._namespace!==r._namespace||t._namespacePrefix!==r._namespacePrefix||t._localName!==r._localName||t._attributeList.length!==r._attributeList.length)return!1}else if(i.Guard.isAttrNode(t)&&i.Guard.isAttrNode(r)){if(t._namespace!==r._namespace||t._localName!==r._localName||t._value!==r._value)return!1}else if(i.Guard.isProcessingInstructionNode(t)&&i.Guard.isProcessingInstructionNode(r)){if(t._target!==r._target||t._data!==r._data)return!1}else if(i.Guard.isCharacterDataNode(t)&&i.Guard.isCharacterDataNode(r)&&t._data!==r._data)return!1;if(i.Guard.isElementNode(t)&&i.Guard.isElementNode(r)){var u={};try{for(var c=n(t._attributeList),d=c.next();!d.done;d=c.next())u[(h=d.value)._localName]=h}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}try{for(var p=n(r._attributeList),f=p.next();!f.done;f=p.next()){var h,m=f.value;if(!(h=u[m._localName]))return!1;if(!e(h,m))return!1}}catch(e){s={error:e}}finally{try{f&&!f.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}}if(t._children.size!==r._children.size)return!1;for(var g=t._children[Symbol.iterator](),y=r._children[Symbol.iterator](),v=g.next(),b=y.next();!v.done&&!b.done;){if(!e(v.value,b.value))return!1;v=g.next(),b=y.next()}return!0},t.node_listOfElementsWithQualifiedName=function(e,t){return"*"===e?s.create_htmlCollection(t):"html"===t._nodeDocument._type?s.create_htmlCollection(t,function(t){return t._namespace===a.namespace.HTML&&t._qualifiedName===e.toLowerCase()||t._namespace!==a.namespace.HTML&&t._qualifiedName===e}):s.create_htmlCollection(t,function(t){return t._qualifiedName===e})},t.node_listOfElementsWithNamespace=function(e,t,r){return""===e&&(e=null),"*"===e&&"*"===t?s.create_htmlCollection(r):"*"===e?s.create_htmlCollection(r,function(e){return e._localName===t}):"*"===t?s.create_htmlCollection(r,function(t){return t._namespace===e}):s.create_htmlCollection(r,function(r){return r._localName===t&&r._namespace===e})},t.node_listOfElementsWithClassNames=function(e,t){var r=l.orderedSet_parse(e);if(0===r.size)return s.create_htmlCollection(t,function(){return!1});var n="quirks"!==t._nodeDocument._mode;return s.create_htmlCollection(t,function(e){var t=e.classList;return l.orderedSet_contains(t._tokenSet,r,n)})},t.node_locateANamespacePrefix=function e(t,r){if(t._namespace===r&&null!==t._namespacePrefix)return t._namespacePrefix;for(var n=0;n<t._attributeList.length;n++){var o=t._attributeList[n];if("xmlns"===o._namespacePrefix&&o._value===r)return o._localName}return t._parent&&i.Guard.isElementNode(t._parent)?e(t._parent,r):null},t.node_locateANamespace=function e(t,r){if(i.Guard.isElementNode(t)){if(null!==t._namespace&&t._namespacePrefix===r)return t._namespace;for(var n=0;n<t._attributeList.length;n++){var o=t._attributeList[n];if(o._namespace===a.namespace.XMLNS&&"xmlns"===o._namespacePrefix&&o._localName===r)return o._value||null;if(null===r&&o._namespace===a.namespace.XMLNS&&null===o._namespacePrefix&&"xmlns"===o._localName)return o._value||null}return null===t.parentElement?null:e(t.parentElement,r)}return i.Guard.isDocumentNode(t)?null===t.documentElement?null:e(t.documentElement,r):i.Guard.isDocumentTypeNode(t)||i.Guard.isDocumentFragmentNode(t)?null:i.Guard.isAttrNode(t)?null===t._element?null:e(t._element,r):t._parent&&i.Guard.isElementNode(t._parent)?e(t._parent,r):null}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),i=r(3),a=r(9),s=r(29),l=r(17),u=r(107),c=r(37);t.text_contiguousTextNodes=function(e,t){var r;return void 0===t&&(t=!1),(r={})[Symbol.iterator]=function(){for(var r=e;r&&i.Guard.isTextNode(r._previousSibling);)r=r._previousSibling;return{next:function(){if(r&&!t&&r===e&&(r=i.Guard.isTextNode(r._nextSibling)?r._nextSibling:null),null===r)return{done:!0,value:null};var n={done:!1,value:r};return r=i.Guard.isTextNode(r._nextSibling)?r._nextSibling:null,n}}},r},t.text_contiguousExclusiveTextNodes=function(e,t){var r;return void 0===t&&(t=!1),(r={})[Symbol.iterator]=function(){for(var r=e;r&&i.Guard.isExclusiveTextNode(r._previousSibling);)r=r._previousSibling;return{next:function(){if(r&&!t&&r===e&&(r=i.Guard.isExclusiveTextNode(r._nextSibling)?r._nextSibling:null),null===r)return{done:!0,value:null};var n={done:!1,value:r};return r=i.Guard.isExclusiveTextNode(r._nextSibling)?r._nextSibling:null,n}}},r},t.text_descendantTextContent=function(e){for(var t="",r=l.tree_getFirstDescendantNode(e,!1,!1,function(e){return i.Guard.isTextNode(e)});null!==r;)t+=r._data,r=l.tree_getNextDescendantNode(e,r,!1,!1,function(e){return i.Guard.isTextNode(e)});return t},t.text_split=function(e,t){var r,i,d=e._data.length;if(t>d)throw new a.IndexSizeError;var p=d-t,f=u.characterData_substringData(e,t,p),h=s.create_text(e._nodeDocument,f),m=e._parent;if(null!==m){c.mutation_insert(h,m,e._nextSibling);try{for(var g=n(o.dom.rangeList),y=g.next();!y.done;y=g.next()){var v=y.value;v._start[0]===e&&v._start[1]>t&&(v._start[0]=h,v._start[1]-=t),v._end[0]===e&&v._end[1]>t&&(v._end[0]=h,v._end[1]-=t);var b=l.tree_index(e);v._start[0]===m&&v._start[1]===b+1&&v._start[1]++,v._end[0]===m&&v._end[1]===b+1&&v._end[1]++}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}}return u.characterData_replaceData(e,t,p,""),h}},function(e,t,r){"use strict";var n=r(4),o=r(41),i=r(24),a=r(48),s=[].join,l=o!=Object,u=a("join",",");n({target:"Array",proto:!0,forced:l||!u},{join:function(e){return s.call(i(this),void 0===e?",":e)}})},function(e,t,r){var n=r(4),o=r(83),i=String.fromCharCode,a=String.fromCodePoint;n({target:"String",stat:!0,forced:!!a&&1!=a.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,a=0;n>a;){if(t=+arguments[a++],o(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(t<65536?i(t):i(55296+((t-=65536)>>10),t%1024+56320))}return r.join("")}})},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var o=r(111),i=function(){function e(e,t){this._options={skipWhitespaceOnlyText:!1},this.err={line:-1,col:-1,index:-1,str:""},this._str=e,this._index=0,this._length=e.length,t&&(this._options.skipWhitespaceOnlyText=t.skipWhitespaceOnlyText||!1)}return e.prototype.nextToken=function(){if(this.eof())return{type:o.TokenType.EOF};var t=this.skipIfStartsWith("<")?this.openBracket():this.text();return this._options.skipWhitespaceOnlyText&&t.type===o.TokenType.Text&&e.isWhiteSpaceToken(t)&&(t=this.nextToken()),t},e.prototype.openBracket=function(){return this.skipIfStartsWith("?")?this.skipIfStartsWith("xml")?e.isSpace(this._str[this._index])?this.declaration():(this.seek(-3),this.pi()):this.pi():this.skipIfStartsWith("!")?this.skipIfStartsWith("--")?this.comment():this.skipIfStartsWith("[CDATA[")?this.cdata():this.skipIfStartsWith("DOCTYPE")?this.doctype():void this.throwError("Invalid '!' in opening tag."):this.skipIfStartsWith("/")?this.closeTag():this.openTag()},e.prototype.declaration=function(){for(var e="",t="",r="";!this.eof();){if(this.skipSpace(),this.skipIfStartsWith("?>"))return{type:o.TokenType.Declaration,version:e,encoding:t,standalone:r};var i=n(this.attribute(),2),a=i[0],s=i[1];"version"===a?e=s:"encoding"===a?t=s:"standalone"===a?r=s:this.throwError("Invalid attribute name: "+a)}this.throwError("Missing declaration end symbol `?>`")},e.prototype.doctype=function(){var e="",t="";this.skipSpace();var r=this.takeUntil2("[",">",!0);return this.skipSpace(),this.skipIfStartsWith("PUBLIC")?(e=this.quotedString(),t=this.quotedString()):this.skipIfStartsWith("SYSTEM")&&(t=this.quotedString()),this.skipSpace(),this.skipIfStartsWith("[")&&(this.skipUntil("]"),this.skipIfStartsWith("]")||this.throwError("Missing end bracket of DTD internal subset")),this.skipSpace(),this.skipIfStartsWith(">")||this.throwError("Missing doctype end symbol `>`"),{type:o.TokenType.DocType,name:r,pubId:e,sysId:t}},e.prototype.pi=function(){var e=this.takeUntilStartsWith("?>",!0);if(this.eof()&&this.throwError("Missing processing instruction end symbol `?>`"),this.skipSpace(),this.skipIfStartsWith("?>"))return{type:o.TokenType.PI,target:e,data:""};var t=this.takeUntilStartsWith("?>");return this.eof()&&this.throwError("Missing processing instruction end symbol `?>`"),this.seek(2),{type:o.TokenType.PI,target:e,data:t}},e.prototype.text=function(){var e=this.takeUntil("<");return{type:o.TokenType.Text,data:e}},e.prototype.comment=function(){var e=this.takeUntilStartsWith("--\x3e");return this.eof()&&this.throwError("Missing comment end symbol `--\x3e`"),this.seek(3),{type:o.TokenType.Comment,data:e}},e.prototype.cdata=function(){var e=this.takeUntilStartsWith("]]>");return this.eof()&&this.throwError("Missing CDATA end symbol `]>`"),this.seek(3),{type:o.TokenType.CDATA,data:e}},e.prototype.openTag=function(){this.skipSpace();var e=this.takeUntil2(">","/",!0);if(this.skipSpace(),this.skipIfStartsWith(">"))return{type:o.TokenType.Element,name:e,attributes:[],selfClosing:!1};if(this.skipIfStartsWith("/>"))return{type:o.TokenType.Element,name:e,attributes:[],selfClosing:!0};for(var t=[];!this.eof();){if(this.skipSpace(),this.skipIfStartsWith(">"))return{type:o.TokenType.Element,name:e,attributes:t,selfClosing:!1};if(this.skipIfStartsWith("/>"))return{type:o.TokenType.Element,name:e,attributes:t,selfClosing:!0};var r=this.attribute();t.push(r)}this.throwError("Missing opening element tag end symbol `>`")},e.prototype.closeTag=function(){this.skipSpace();var e=this.takeUntil(">",!0);return this.skipSpace(),this.skipIfStartsWith(">")||this.throwError("Missing closing element tag end symbol `>`"),{type:o.TokenType.ClosingTag,name:e}},e.prototype.attribute=function(){this.skipSpace();var e=this.takeUntil("=",!0);return this.skipSpace(),this.skipIfStartsWith("=")||this.throwError("Missing equals sign before attribute value"),[e,this.quotedString()]},e.prototype.quotedString=function(){this.skipSpace();var t=this.take(1);e.isQuote(t)||this.throwError("Missing start quote character before quoted value");var r=this.takeUntil(t);return this.skipIfStartsWith(t)||this.throwError("Missing end quote character after quoted value"),r},e.prototype.eof=function(){return this._index>=this._length},e.prototype.skipIfStartsWith=function(e){var t=e.length;if(1===t)return this._str[this._index]===e&&(this._index++,!0);for(var r=0;r<t;r++)if(this._str[this._index+r]!==e[r])return!1;return this._index+=t,!0},e.prototype.seek=function(e){this._index+=e,this._index<0&&(this._index=0),this._index>this._length&&(this._index=this._length)},e.prototype.skipSpace=function(){for(;!this.eof()&&e.isSpace(this._str[this._index]);)this._index++},e.prototype.take=function(e){if(1===e)return this._str[this._index++];var t=this._index;return this.seek(e),this._str.slice(t,this._index)},e.prototype.takeUntil=function(t,r){void 0===r&&(r=!1);for(var n=this._index;this._index<this._length;){var o=this._str[this._index];if(o===t||r&&e.isSpace(o))break;this._index++}return this._str.slice(n,this._index)},e.prototype.takeUntil2=function(t,r,n){void 0===n&&(n=!1);for(var o=this._index;this._index<this._length;){var i=this._str[this._index];if(i===t||i===r||n&&e.isSpace(i))break;this._index++}return this._str.slice(o,this._index)},e.prototype.takeUntilStartsWith=function(t,r){void 0===r&&(r=!1);for(var n=this._index,o=t.length;this._index<this._length;){for(var i=!0,a=0;a<o;a++){var s=this._str[this._index+a],l=t[a];if(r&&e.isSpace(s))return this._str.slice(n,this._index);if(s!==l){this._index++,i=!1;break}}if(i)return this._str.slice(n,this._index)}return this._index=this._length,this._str.slice(n)},e.prototype.skipUntil=function(e){for(;this._index<this._length&&this._str[this._index]!==e;)this._index++},e.isWhiteSpaceToken=function(e){for(var t=e.data,r=0;r<t.length;r++){var n=t[r];if(" "!==n&&"\n"!==n&&"\r"!==n&&"\t"!==n&&"\f"!==n)return!1}return!0},e.isSpace=function(e){return" "===e||"\n"===e||"\r"===e||"\t"===e},e.isQuote=function(e){return'"'===e||"'"===e},e.prototype.throwError=function(e){for(var t=/\r\n|\r|\n/g,r=null,n=0,o=0,i=this._str.length;null!==(r=t.exec(this._str))&&null!==r;)if(n++,r.index<this._index&&(o=t.lastIndex),r.index>this._index){i=r.index;break}throw this.err={line:n,col:this._index-o,index:this._index,str:this._str.substring(o,i)},new Error(e+"\nIndex: "+this.err.index+"\nLn: "+this.err.line+", Col: "+this.err.col+"\nInput: "+this.err.str)},e.prototype[Symbol.iterator]=function(){return this._index=0,{next:function(){var e=this.nextToken();return e.type===o.TokenType.EOF?{done:!0,value:null}:{done:!1,value:e}}.bind(this)}},e}();t.XMLStringLexer=i},function(e,t,r){"use strict";var n=r(39);e.exports=new n({include:[r(182)]})},function(e,t,r){"use strict";var n=r(39);e.exports=new n({include:[r(113)],implicit:[r(289),r(290),r(291),r(292)]})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(91),o=r(1),i=r(3),a=r(77),s=r(109);function l(e,t){var r=c(void 0===e||u(e)?e:n.DefaultBuilderOptions),o=u(e)?t:e,i=s.createDocument();d(i,r);var l=new a.XMLBuilderImpl(i);return void 0!==o&&l.ele(o),l}function u(e){if(!o.isPlainObject(e))return!1;for(var t in e)if(e.hasOwnProperty(t)&&!n.XMLBuilderOptionKeys.has(t))return!1;return!0}function c(e){void 0===e&&(e={});var t=o.applyDefaults(e,n.DefaultBuilderOptions);if(0===t.convert.att.length||0===t.convert.ins.length||0===t.convert.text.length||0===t.convert.cdata.length||0===t.convert.comment.length)throw new Error("JS object converter strings cannot be zero length.");return t}function d(e,t,r){var n=e;n._xmlBuilderOptions=t,n._isFragment=r}t.builder=function(e,t){var r=c(u(e)?e:n.DefaultBuilderOptions),s=i.Guard.isNode(e)||o.isArray(e)?e:t;if(void 0===s)throw new Error("Invalid arguments.");if(o.isArray(s)){for(var l=[],d=0;d<s.length;d++){var p=new a.XMLBuilderImpl(s[d]);p.set(r),l.push(p)}return l}var f=new a.XMLBuilderImpl(s);return f.set(r),f},t.create=l,t.fragment=function(e,t){var r=c(void 0===e||u(e)?e:n.DefaultBuilderOptions),o=u(e)?t:e,i=s.createDocument();d(i,r,!0);var l=new a.XMLBuilderImpl(i.createDocumentFragment());return void 0!==o&&l.ele(o),l},t.convert=function(e,t,r){var o,i,a;return u(e)&&void 0!==t?(o=e,i=t,a=r):(o=n.DefaultBuilderOptions,i=e,a=t||void 0),l(o,i).end(a)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(77);t.builder=n.builder,t.create=n.create,t.fragment=n.fragment,t.convert=n.convert,t.createCB=n.createCB,t.fragmentCB=n.fragmentCB},function(e,t,r){"use strict";r(31),r(32),r(33),r(191),r(192),r(194),r(64),r(19),r(198),r(199),r(89),r(201),r(65),r(20),r(66),r(22),r(23);var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var i=r(91),a=r(1),s=r(217),l=r(2),u=r(3),c=r(0),d=r(109),p=r(7),f=r(276),h=function(){function e(e){this._domNode=e}return Object.defineProperty(e.prototype,"node",{get:function(){return this._domNode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},enumerable:!0,configurable:!0}),e.prototype.set=function(e){return this._options=a.applyDefaults(a.applyDefaults(this._options,e,!0),i.DefaultBuilderOptions),this},e.prototype.ele=function(t,r,o){var i,s,l,u,p,h;if(a.isObject(t))return new f.ObjectReader(this._options).parse(this,t);if(null!==t&&/^\s*</.test(t))return new f.XMLReader(this._options).parse(this,t);if(null!==t&&/^\s*[\{\[]/.test(t))return new f.JSONReader(this._options).parse(this,t);if(null!==t&&/^(\s*|(#.*)|(%.*))*---/.test(t))return new f.YAMLReader(this._options).parse(this,t);if((null===t||a.isString(t))&&a.isString(r))u=(i=n([t,r,o],3))[0],p=i[1],h=i[2];else{if(null===t)throw new Error("Element name cannot be null. "+this._debugInfo());u=(s=n([void 0,t,a.isObject(r)?r:void 0],3))[0],p=s[1],h=s[2]}if(h&&(h=a.getValue(h)),u=(l=n(this._extractNamespace(d.sanitizeInput(u,this._options.invalidCharReplacement),d.sanitizeInput(p,this._options.invalidCharReplacement),!0),2))[0],p=l[1],void 0===u){var m=n(c.namespace_extractQName(p),1)[0];u=this.node.lookupNamespaceURI(m)}var g=null!=u?this._doc.createElementNS(u,p):this._doc.createElement(p);this.node.appendChild(g);var y=new e(g),v=this._doc.doctype;if(g===this._doc.documentElement&&null!==v){var b=this._doc.implementation.createDocumentType(this._doc.documentElement.tagName,v.publicId,v.systemId);this._doc.replaceChild(b,v)}return h&&!a.isEmpty(h)&&y.att(h),y},e.prototype.remove=function(){var e=this.up();return e.node.removeChild(this.node),e},e.prototype.att=function(e,t,r){var o,i,s,l,f,h,m=this;if(a.isMap(e)||a.isObject(e))return a.forEachObject(e,function(e,t){return m.att(e,t)},this),this;if(null!=e&&(e=a.getValue(e+"")),null!=t&&(t=a.getValue(t+"")),null!=r&&(r=a.getValue(r+"")),null!==e&&!a.isString(e)||!a.isString(t)||null!==r&&!a.isString(r)){if(!a.isString(e)||null!=t&&!a.isString(t))throw new Error("Attribute name and value not specified. "+this._debugInfo());l=(i=n([void 0,e,t],3))[0],f=i[1],h=i[2]}else l=(o=n([e,t,r],3))[0],f=o[1],h=o[2];if(this._options.keepNullAttributes&&null==h)h="";else if(null==h)return this;if(!u.Guard.isElementNode(this.node))throw new Error("An attribute can only be assigned to an element node.");var g=this.node;l=(s=n(this._extractNamespace(l,f,!1),2))[0],f=s[1],f=d.sanitizeInput(f,this._options.invalidCharReplacement),l=d.sanitizeInput(l,this._options.invalidCharReplacement),h=d.sanitizeInput(h,this._options.invalidCharReplacement);var y=n(c.namespace_extractQName(f),2),v=y[0],b=y[1],x=n(c.namespace_extractQName(g.prefix?g.prefix+":"+g.localName:g.localName),1)[0],_=null;return"xmlns"===v?(l=p.namespace.XMLNS,null===g.namespaceURI&&x===b&&(_=h)):null===v&&"xmlns"===b&&null===x&&(l=p.namespace.XMLNS,_=h),null!==_&&(this._updateNamespace(_),g=this.node),void 0!==l?g.setAttributeNS(l,f,h):g.setAttribute(f,h),this},e.prototype.removeAtt=function(e,t){var r,n,o=this;if(!u.Guard.isElementNode(this.node))throw new Error("An attribute can only be removed from an element node.");if(e=a.getValue(e),void 0!==t&&(t=a.getValue(t)),null!==e&&void 0===t)n=e;else{if(null!==e&&!a.isString(e)||void 0===t)throw new Error("Attribute namespace must be a string. "+this._debugInfo());r=e,n=t}return a.isArray(n)||a.isSet(n)?a.forEachArray(n,function(e){return void 0===r?o.removeAtt(e):o.removeAtt(r,e)},this):void 0!==r?(n=d.sanitizeInput(n,this._options.invalidCharReplacement),r=d.sanitizeInput(r,this._options.invalidCharReplacement),this.node.removeAttributeNS(r,n)):(n=d.sanitizeInput(n,this._options.invalidCharReplacement),this.node.removeAttribute(n)),this},e.prototype.txt=function(e){if(null==e){if(!this._options.keepNullNodes)return this;e=""}var t=this._doc.createTextNode(d.sanitizeInput(e,this._options.invalidCharReplacement));return this.node.appendChild(t),this},e.prototype.com=function(e){if(null==e){if(!this._options.keepNullNodes)return this;e=""}var t=this._doc.createComment(d.sanitizeInput(e,this._options.invalidCharReplacement));return this.node.appendChild(t),this},e.prototype.dat=function(e){if(null==e){if(!this._options.keepNullNodes)return this;e=""}var t=this._doc.createCDATASection(d.sanitizeInput(e,this._options.invalidCharReplacement));return this.node.appendChild(t),this},e.prototype.ins=function(e,t){var r=this;if(void 0===t&&(t=""),null==t){if(!this._options.keepNullNodes)return this;t=""}if(a.isArray(e)||a.isSet(e))a.forEachArray(e,function(e){var t=(e+="").indexOf(" "),n=-1===t?e:e.substr(0,t),o=-1===t?"":e.substr(t+1);r.ins(n,o)},this);else if(a.isMap(e)||a.isObject(e))a.forEachObject(e,function(e,t){return r.ins(e,t)},this);else{var n=this._doc.createProcessingInstruction(d.sanitizeInput(e,this._options.invalidCharReplacement),d.sanitizeInput(t,this._options.invalidCharReplacement));this.node.appendChild(n)}return this},e.prototype.dec=function(e){return this._options.version=e.version||"1.0",this._options.encoding=e.encoding,this._options.standalone=e.standalone,this},e.prototype.dtd=function(e){var t=d.sanitizeInput(e&&e.name||(this._doc.documentElement?this._doc.documentElement.tagName:"ROOT"),this._options.invalidCharReplacement),r=d.sanitizeInput(e&&e.pubID||"",this._options.invalidCharReplacement),n=d.sanitizeInput(e&&e.sysID||"",this._options.invalidCharReplacement);if(null!==this._doc.documentElement&&t!==this._doc.documentElement.tagName)throw new Error("DocType name does not match document element name.");var o=this._doc.implementation.createDocumentType(t,r,n);return null!==this._doc.doctype?this._doc.replaceChild(o,this._doc.doctype):this._doc.insertBefore(o,this._doc.documentElement),this},e.prototype.import=function(t){var r,i,a=this._domNode,s=this._doc,l=t.node;if(u.Guard.isDocumentNode(l)){var d=l.documentElement;if(null===d)throw new Error("Imported document has no document element node. "+this._debugInfo());var p=s.importNode(d,!0);a.appendChild(p);var f=n(c.namespace_extractQName(p.prefix?p.prefix+":"+p.localName:p.localName),1)[0],h=a.lookupNamespaceURI(f);new e(p)._updateNamespace(h)}else if(u.Guard.isDocumentFragmentNode(l))try{for(var m=o(l.childNodes),g=m.next();!g.done;g=m.next()){var y=g.value;p=s.importNode(y,!0),a.appendChild(p),u.Guard.isElementNode(p)&&(f=n(c.namespace_extractQName(p.prefix?p.prefix+":"+p.localName:p.localName),1)[0],h=a.lookupNamespaceURI(f),new e(p)._updateNamespace(h))}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}else p=s.importNode(l,!0),a.appendChild(p),u.Guard.isElementNode(p)&&(f=n(c.namespace_extractQName(p.prefix?p.prefix+":"+p.localName:p.localName),1)[0],h=a.lookupNamespaceURI(f),new e(p)._updateNamespace(h));return this},e.prototype.doc=function(){if(this._doc._isFragment){for(var t=this.node;t&&t.nodeType!==l.NodeType.DocumentFragment;)t=t.parentNode;if(null===t)throw new Error("Node has no parent node while searching for document fragment ancestor. "+this._debugInfo());return new e(t)}return new e(this._doc)},e.prototype.root=function(){var t=this._doc.documentElement;if(!t)throw new Error("Document root element is null. "+this._debugInfo());return new e(t)},e.prototype.up=function(){var t=this._domNode.parentNode;if(!t)throw new Error("Parent node is null. "+this._debugInfo());return new e(t)},e.prototype.prev=function(){var t=this._domNode.previousSibling;if(!t)throw new Error("Previous sibling node is null. "+this._debugInfo());return new e(t)},e.prototype.next=function(){var t=this._domNode.nextSibling;if(!t)throw new Error("Next sibling node is null. "+this._debugInfo());return new e(t)},e.prototype.first=function(){var t=this._domNode.firstChild;if(!t)throw new Error("First child node is null. "+this._debugInfo());return new e(t)},e.prototype.last=function(){var t=this._domNode.lastChild;if(!t)throw new Error("Last child node is null. "+this._debugInfo());return new e(t)},e.prototype.each=function(t,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var i=this._getFirstDescendantNode(this._domNode,r,n);i[0];){var a=this._getNextDescendantNode(this._domNode,i[0],n,i[1],i[2]);t.call(o,new e(i[0]),i[1],i[2]),i=a}return this},e.prototype.map=function(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);var o=[];return this.each(function(t,r,i){return o.push(e.call(n,t,r,i))},t,r),o},e.prototype.reduce=function(e,t,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=!1);var i=t;return this.each(function(t,r,n){return i=e.call(o,i,t,r,n)},r,n),i},e.prototype.find=function(t,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var i=this._getFirstDescendantNode(this._domNode,r,n);i[0];){var a=new e(i[0]);if(t.call(o,a,i[1],i[2]))return a;i=this._getNextDescendantNode(this._domNode,i[0],n,i[1],i[2])}},e.prototype.filter=function(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);var o=[];return this.each(function(t,r,i){e.call(n,t,r,i)&&o.push(t)},t,r),o},e.prototype.every=function(t,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var i=this._getFirstDescendantNode(this._domNode,r,n);i[0];){var a=new e(i[0]);if(!t.call(o,a,i[1],i[2]))return!1;i=this._getNextDescendantNode(this._domNode,i[0],n,i[1],i[2])}return!0},e.prototype.some=function(t,r,n,o){void 0===r&&(r=!1),void 0===n&&(n=!1);for(var i=this._getFirstDescendantNode(this._domNode,r,n);i[0];){var a=new e(i[0]);if(t.call(o,a,i[1],i[2]))return!0;i=this._getNextDescendantNode(this._domNode,i[0],n,i[1],i[2])}return!1},e.prototype.toArray=function(e,t){void 0===e&&(e=!1),void 0===t&&(t=!1);var r=[];return this.each(function(e){return r.push(e)},e,t),r},e.prototype.toString=function(e){return void 0===(e=e||{}).format&&(e.format="xml"),this._serialize(e)},e.prototype.toObject=function(e){return void 0===(e=e||{}).format&&(e.format="object"),this._serialize(e)},e.prototype.end=function(e){return void 0===(e=e||{}).format&&(e.format="xml"),this.doc()._serialize(e)},e.prototype._getFirstDescendantNode=function(e,t,r){return t?[this._domNode,0,0]:r?this._getNextDescendantNode(e,e,r,0,0):[this._domNode.firstChild,0,1]},e.prototype._getNextDescendantNode=function(e,t,r,n,o){if(!r)return e===t?[t.firstChild,0,o+1]:[t.nextSibling,n+1,o];if(t.firstChild)return[t.firstChild,0,o+1];if(t===e)return[null,-1,-1];if(t.nextSibling)return[t.nextSibling,n+1,o];for(var i=t.parentNode;i&&i!==e;){if(i.nextSibling)return[i.nextSibling,c.tree_index(i.nextSibling),o-1];i=i.parentNode,o--}return[null,-1,-1]},e.prototype._serialize=function(e){if("xml"===e.format)return new s.XMLWriter(this._options,e).serialize(this.node);if("map"===e.format)return new s.MapWriter(this._options,e).serialize(this.node);if("object"===e.format)return new s.ObjectWriter(this._options,e).serialize(this.node);if("json"===e.format)return new s.JSONWriter(this._options,e).serialize(this.node);if("yaml"===e.format)return new s.YAMLWriter(this._options,e).serialize(this.node);throw new Error("Invalid writer format: "+e.format+". "+this._debugInfo())},e.prototype._extractNamespace=function(e,t,r){var n=t.indexOf("@");if(n>0&&(void 0===e&&(e=t.slice(n+1)),t=t.slice(0,n)),void 0===e)e=r?this._options.defaultNamespace.ele:this._options.defaultNamespace.att;else if(null!==e&&"@"===e[0]){var o=e.slice(1);if(void 0===(e=this._options.namespaceAlias[o]))throw new Error("Namespace alias `"+o+"` is not defined. "+this._debugInfo())}return[e,t]},e.prototype._updateNamespace=function(t){var r,i,a,s,l=this._domNode;if(u.Guard.isElementNode(l)&&null!==t&&l.namespaceURI!==t){var d=n(c.namespace_extractQName(l.prefix?l.prefix+":"+l.localName:l.localName),2),p=d[0],f=d[1],h=c.create_element(this._doc,f,t,p);try{for(var m=o(l.attributes),g=m.next();!g.done;g=m.next()){var y=g.value,v=y.prefix?y.prefix+":"+y.localName:y.localName,b=n(c.namespace_extractQName(v),1)[0],x=y.namespaceURI;null===x&&null!==b&&(x=l.lookupNamespaceURI(b)),null===x?h.setAttribute(v,y.value):h.setAttributeNS(x,v,y.value)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}var _=l.parentNode;if(null===_)throw new Error("Parent node is null."+this._debugInfo());_.replaceChild(h,l),this._domNode=h;try{for(var S=o(l.childNodes),C=S.next();!C.done;C=S.next()){var T=C.value.cloneNode(!0);if(h.appendChild(T),u.Guard.isElementNode(T)){var w=n(c.namespace_extractQName(T.prefix?T.prefix+":"+T.localName:T.localName),1)[0],A=h.lookupNamespaceURI(w);new e(T)._updateNamespace(A)}}}catch(e){a={error:e}}finally{try{C&&!C.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}}},Object.defineProperty(e.prototype,"_doc",{get:function(){var e=this.node;if(u.Guard.isDocumentNode(e))return e;var t=e.ownerDocument;if(!t)throw new Error("Owner document is null. "+this._debugInfo());return t},enumerable:!0,configurable:!0}),e.prototype._debugInfo=function(e){var t=this.node,r=t.parentNode;e=e||t.nodeName;var n=r?r.nodeName:"";return n?"node: <"+e+">, parent: <"+n+">":"node: <"+e+">"},Object.defineProperty(e.prototype,"_options",{get:function(){var e=this._doc;if(void 0===e._xmlBuilderOptions)throw new Error("Builder options is not set.");return e._xmlBuilderOptions},set:function(e){this._doc._xmlBuilderOptions=e},enumerable:!0,configurable:!0}),e}();t.XMLBuilderImpl=h},function(e,t,r){var n=r(11),o=r(117),i=n.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},function(e,t,r){var n=r(46),o=r(82),i=r(85),a=r(18);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),r=i.f;return r?t.concat(r(e)):t}},function(e,t,r){var n=r(16),o=r(15),i=r(18),a=r(61);e.exports=n?Object.defineProperties:function(e,t){i(e);for(var r,n=a(t),s=n.length,l=0;s>l;)o.f(e,r=n[l++],t[r]);return e}},function(e,t,r){var n=r(46);e.exports=n("document","documentElement")},function(e,t,r){var n=r(24),o=r(82).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"[object Window]"==i.call(e)?function(e){try{return o(e)}catch(e){return a.slice()}}(e):o(n(e))}},function(e,t,r){"use strict";var n=r(4),o=r(36).every,i=r(48),a=r(28),s=i("every"),l=a("every");n({target:"Array",proto:!0,forced:!s||!l},{every:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){"use strict";var n=r(4),o=r(36).filter,i=r(63),a=r(28),s=i("filter"),l=a("filter");n({target:"Array",proto:!0,forced:!s||!l},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(46);e.exports=n("navigator","userAgent")||""},function(e,t,r){"use strict";var n=r(4),o=r(36).find,i=r(130),a=r(28),s=!0,l=a("find");"find"in[]&&Array(1).find(function(){s=!1}),n({target:"Array",proto:!0,forced:s||!l},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("find")},function(e,t,r){"use strict";var n=r(131).IteratorPrototype,o=r(60),i=r(40),a=r(62),s=r(49),l=function(){return this};e.exports=function(e,t,r){var u=t+" Iterator";return e.prototype=o(n,{next:i(1,r)}),a(e,u,!1,!0),s[u]=l,e}},function(e,t,r){var n=r(8);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},function(e,t,r){var n=r(13);e.exports=function(e){if(!n(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},function(e,t,r){"use strict";var n=r(4),o=r(36).map,i=r(63),a=r(28),s=i("map"),l=a("map");n({target:"Array",proto:!0,forced:!s||!l},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){"use strict";var n=r(4),o=r(200).left,i=r(48),a=r(28),s=i("reduce"),l=a("reduce",{1:0});n({target:"Array",proto:!0,forced:!s||!l},{reduce:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){var n=r(127),o=r(27),i=r(41),a=r(26),s=function(e){return function(t,r,s,l){n(r);var u=o(t),c=i(u),d=a(u.length),p=e?d-1:0,f=e?-1:1;if(s<2)for(;;){if(p in c){l=c[p],p+=f;break}if(p+=f,e?p<0:d<=p)throw TypeError("Reduce of empty array with no initial value")}for(;e?p>=0:d>p;p+=f)p in c&&(l=r(l,c[p],p,u));return l}};e.exports={left:s(!1),right:s(!0)}},function(e,t,r){"use strict";var n=r(4),o=r(36).some,i=r(48),a=r(28),s=i("some"),l=a("some");n({target:"Array",proto:!0,forced:!s||!l},{some:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){"use strict";var n=r(90),o=r(135);e.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t,r){var n=r(8);e.exports=!n(function(){return Object.isExtensible(Object.preventExtensions({}))})},function(e,t,r){var n=r(5),o=r(49),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},function(e,t,r){var n=r(135),o=r(49),i=r(5)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[n(e)]}},function(e,t,r){var n=r(18);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&n(i.call(e)),t}}},function(e,t,r){var n=r(5)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},function(e,t,r){var n=r(13),o=r(133);e.exports=function(e,t,r){var i,a;return o&&"function"==typeof(i=t.constructor)&&i!==r&&n(a=i.prototype)&&a!==r.prototype&&o(e,a),e}},function(e,t,r){var n=r(25);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},function(e,t,r){"use strict";var n=r(46),o=r(15),i=r(5),a=r(16),s=i("species");e.exports=function(e){var t=n(e),r=o.f;a&&t&&!t[s]&&r(t,s,{configurable:!0,get:function(){return this}})}},function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){void 0===e&&(e=1e3),this._items=new Set,this._limit=e}return e.prototype.add=function(e){if(this._items.add(e),this._items.size>this._limit){var t=this._items.values().next();t.done||this._items.delete(t.value)}return this},e.prototype.delete=function(e){return this._items.delete(e)},e.prototype.has=function(e){return this._items.has(e)},e.prototype.clear=function(){this._items.clear()},Object.defineProperty(e.prototype,"size",{get:function(){return this._items.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(e,t){var r=this;this._items.forEach(function(n){return e.call(t,n,n,r)})},e.prototype.keys=function(){return n(this,function(e){switch(e.label){case 0:return[5,o(this._items.keys())];case 1:return e.sent(),[2]}})},e.prototype.values=function(){return n(this,function(e){switch(e.label){case 0:return[5,o(this._items.values())];case 1:return e.sent(),[2]}})},e.prototype.entries=function(){return n(this,function(e){switch(e.label){case 0:return[5,o(this._items.entries())];case 1:return e.sent(),[2]}})},e.prototype[Symbol.iterator]=function(){return n(this,function(e){switch(e.label){case 0:return[5,o(this._items)];case 1:return e.sent(),[2]}})},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"FixedSizeSet"},enumerable:!0,configurable:!0}),e}();t.FixedSizeSet=i},function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){void 0===e&&(e=1e3),this._items=new Map,this._limit=e}return e.prototype.get=function(e){return this._items.get(e)},e.prototype.set=function(e,t){if(this._items.set(e,t),this._items.size>this._limit){var r=this._items.keys().next();r.done||this._items.delete(r.value)}},e.prototype.delete=function(e){return this._items.delete(e)},e.prototype.has=function(e){return this._items.has(e)},e.prototype.clear=function(){this._items.clear()},Object.defineProperty(e.prototype,"size",{get:function(){return this._items.size},enumerable:!0,configurable:!0}),e.prototype.forEach=function(e,t){this._items.forEach(function(r,n){return e.call(t,n,r)})},e.prototype.keys=function(){return n(this,function(e){switch(e.label){case 0:return[5,o(this._items.keys())];case 1:return e.sent(),[2]}})},e.prototype.values=function(){return n(this,function(e){switch(e.label){case 0:return[5,o(this._items.values())];case 1:return e.sent(),[2]}})},e.prototype.entries=function(){return n(this,function(e){switch(e.label){case 0:return[5,o(this._items.entries())];case 1:return e.sent(),[2]}})},e.prototype[Symbol.iterator]=function(){return n(this,function(e){switch(e.label){case 0:return[5,o(this._items)];case 1:return e.sent(),[2]}})},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"ObjectCache"},enumerable:!0,configurable:!0}),e}();t.ObjectCache=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){void 0===e&&(e=1e3),this._items=new Map,this._limit=e}return e.prototype.check=function(e,t){if(this._items.get(e)===t)return!0;if(this._items.get(t)===e)return!1;var r=Math.random()<.5;if(r?this._items.set(e,t):this._items.set(t,e),this._items.size>this._limit){var n=this._items.keys().next();n.done||this._items.delete(n.value)}return r},e}();t.CompareCache=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._initialized=!1,this._value=void 0,this._initFunc=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._initialized||(this._value=this._initFunc(),this._initialized=!0),this._value},enumerable:!0,configurable:!0}),e}();t.Lazy=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this._pointer=0,this._chars=Array.from(e),this._length=this._chars.length}return Object.defineProperty(e.prototype,"eof",{get:function(){return this._pointer>=this._length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),e.prototype.codePoint=function(){if(void 0===this._codePoint)if(this.eof)this._codePoint=-1;else{var e=this._chars[this._pointer].codePointAt(0);this._codePoint=void 0!==e?e:-1}return this._codePoint},e.prototype.c=function(){return void 0===this._c&&(this._c=this.eof?"":this._chars[this._pointer]),this._c},e.prototype.remaining=function(){return void 0===this._remaining&&(this._remaining=this.eof?"":this._chars.slice(this._pointer+1).join("")),this._remaining},e.prototype.substring=function(){return void 0===this._substring&&(this._substring=this.eof?"":this._chars.slice(this._pointer).join("")),this._substring},Object.defineProperty(e.prototype,"pointer",{get:function(){return this._pointer},set:function(e){e!==this._pointer&&(this._pointer=e,this._codePoint=void 0,this._c=void 0,this._remaining=void 0,this._substring=void 0)},enumerable:!0,configurable:!0}),e}();t.StringWalker=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(218);t.MapWriter=n.MapWriter;var o=r(258);t.XMLWriter=o.XMLWriter;var i=r(67);t.ObjectWriter=i.ObjectWriter;var a=r(260);t.JSONWriter=a.JSONWriter;var s=r(261);t.YAMLWriter=s.YAMLWriter},function(e,t,r){"use strict";r(19),r(219),r(20),r(22),r(23);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),a=r(67),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n._writerOptions=i.applyDefaults(r,{format:"map",wellFormed:!1,group:!1,verbose:!1}),n}return o(t,e),t.prototype.serialize=function(e){var t=i.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1,verbose:!1}),r=new a.ObjectWriter(this._builderOptions,t).serialize(e);return this._convertObject(r)},t.prototype._convertObject=function(e){if(i.isArray(e)){for(var t=0;t<e.length;t++)e[t]=this._convertObject(e[t]);return e}if(i.isObject(e)){var r=new Map;for(var n in e)r.set(n,this._convertObject(e[n]));return r}return e},t}(r(50).BaseWriter);t.MapWriter=s},function(e,t,r){"use strict";var n=r(139),o=r(143);e.exports=n("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},o)},function(e,t,r){"use strict";var n=r(4),o=r(8),i=r(59),a=r(13),s=r(27),l=r(26),u=r(134),c=r(128),d=r(63),p=r(5),f=r(129),h=p("isConcatSpreadable"),m=f>=51||!o(function(){var e=[];return e[h]=!1,e.concat()[0]!==e}),g=d("concat"),y=function(e){if(!a(e))return!1;var t=e[h];return void 0!==t?!!t:i(e)};n({target:"Array",proto:!0,forced:!m||!g},{concat:function(e){var t,r,n,o,i,a=s(this),d=c(a,0),p=0;for(t=-1,n=arguments.length;t<n;t++)if(y(i=-1===t?a:arguments[t])){if(p+(o=l(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<o;r++,p++)r in i&&u(d,p,i[r])}else{if(p>=9007199254740991)throw TypeError("Maximum allowed index exceeded");u(d,p++,i)}return d.length=p,d}})},function(e,t,r){"use strict";var n=r(8);function o(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=n(function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),t.BROKEN_CARET=n(function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")})},function(e,t,r){var n=r(223);e.exports=function(e){if(n(e))throw TypeError("The method doesn't accept regular expressions");return e}},function(e,t,r){var n=r(13),o=r(42),i=r(5)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,r){var n=r(5)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},function(e,t,r){"use strict";r(68);var n=r(25),o=r(8),i=r(5),a=r(93),s=r(21),l=i("species"),u=!o(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),c="$0"==="a".replace(/./,"$0"),d=i("replace"),p=!!/./[d]&&""===/./[d]("a","$0"),f=!o(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]});e.exports=function(e,t,r,d){var h=i(e),m=!o(function(){var t={};return t[h]=function(){return 7},7!=""[e](t)}),g=m&&!o(function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[l]=function(){return r},r.flags="",r[h]=/./[h]),r.exec=function(){return t=!0,null},r[h](""),!t});if(!m||!g||"replace"===e&&(!u||!c||p)||"split"===e&&!f){var y=/./[h],v=r(h,""[e],function(e,t,r,n,o){return t.exec===a?m&&!o?{done:!0,value:y.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}},{REPLACE_KEEPS_$0:c,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),b=v[0],x=v[1];n(String.prototype,e,b),n(RegExp.prototype,h,2==t?function(e,t){return x.call(e,this,t)}:function(e){return x.call(e,this)})}d&&s(RegExp.prototype[h],"sham",!0)}},function(e,t,r){"use strict";var n=r(137).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},function(e,t,r){var n=r(42),o=r(93);e.exports=function(e,t){var r=e.exec;if("function"==typeof r){var i=r.call(e,t);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==n(e))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(e,t)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(96);t.forgivingBase64Encode=function(t){return e.from(t).toString("base64")},t.forgivingBase64Decode=function(t){return""===t?"":((t=t.replace(n.ASCIIWhiteSpace,"")).length%4==0&&(t.endsWith("==")?t=t.substr(0,t.length-2):t.endsWith("=")&&(t=t.substr(0,t.length-1))),t.length%4==1?null:/[0-9A-Za-z+/]/.test(t)?e.from(t,"base64").toString("utf8"):null)}}).call(this,r(145).Buffer)},function(e,t,r){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,d=s>0?a-4:a;for(r=0;r<d;r+=4)t=o[e.charCodeAt(r)]<<18|o[e.charCodeAt(r+1)]<<12|o[e.charCodeAt(r+2)]<<6|o[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===s&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=0,s=r-o;a<s;a+=16383)i.push(u(e,a,a+16383>s?s:a+16383));return 1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=a[s],o[a.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,r){for(var o,i,a=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<<s)-1,u=l>>1,c=-7,d=r?o-1:0,p=r?-1:1,f=e[t+d];for(d+=p,i=f&(1<<-c)-1,f>>=-c,c+=s;c>0;i=256*i+e[t+d],d+=p,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=p,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),i-=u}return(f?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,l,u=8*i-o-1,c=(1<<u)-1,d=c>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:i-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?p/l:p*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+f]=255&s,f+=h,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[r+f]=255&a,f+=h,a/=256,u-=8);e[r+f-h]|=128*m}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(1);function i(e){var t,r;if(null===e||o.isString(e)||o.isNumber(e))return e;if(o.isArray(e)){var a=new Array;try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var u=l.value;a.push(i(u))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return a}if(o.isObject(e)){for(var c in a=new Map,e)if(e.hasOwnProperty(c)){var d=e[c];a.set(c,i(d))}return a}return e}t.parseJSONFromBytes=function(e){var t=o.utf8Decode(e);return JSON.parse.call(void 0,t)},t.serializeJSONToBytes=function(e){var t=JSON.stringify.call(void 0,e);return o.utf8Encode(t)},t.parseJSONIntoInfraValues=function(e){return i(JSON.parse.call(void 0,e))},t.convertAJSONDerivedJavaScriptValueToAnInfraValue=i},function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e},a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1);t.append=function(e,t){e.push(t)},t.extend=function(e,t){e.push.apply(e,i(t))},t.prepend=function(e,t){e.unshift(t)},t.replace=function(e,t,r){var n,o,i=0;try{for(var l=a(e),u=l.next();!u.done;u=l.next()){var c=u.value;if(s.isFunction(t))t.call(null,c)&&(e[i]=r);else if(c===t)return void(e[i]=r);i++}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}},t.insert=function(e,t,r){e.splice(r,0,t)},t.remove=function(e,t){for(var r=e.length;r--;){var n=e[r];if(s.isFunction(t))t.call(null,n)&&e.splice(r,1);else if(n===t)return void e.splice(r,1)}},t.empty=function(e){e.length=0},t.contains=function(e,t){var r,n;try{for(var o=a(e),i=o.next();!i.done;i=o.next()){var l=i.value;if(s.isFunction(t)){if(t.call(null,l))return!0}else if(l===t)return!0}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},t.size=function(e,t){var r,n;if(void 0===t)return e.length;var o=0;try{for(var i=a(e),s=i.next();!s.done;s=i.next()){var l=s.value;t.call(null,l)&&o++}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return o},t.isEmpty=function(e){return 0===e.length},t.forEach=function(e,t){var r,o,i,s,l,u;return n(this,function(n){switch(n.label){case 0:return void 0!==t?[3,2]:[5,a(e)];case 1:return n.sent(),[3,9];case 2:n.trys.push([2,7,8,9]),r=a(e),o=r.next(),n.label=3;case 3:return o.done?[3,6]:(i=o.value,t.call(null,i)?[4,i]:[3,5]);case 4:n.sent(),n.label=5;case 5:return o=r.next(),[3,3];case 6:return[3,9];case 7:return s=n.sent(),l={error:s},[3,9];case 8:try{o&&!o.done&&(u=r.return)&&u.call(r)}finally{if(l)throw l.error}return[7];case 9:return[2]}})},t.clone=function(e){return new(Array.bind.apply(Array,i([void 0],e)))},t.sortInAscendingOrder=function(e,t){return e.sort(function(e,r){return t.call(null,e,r)?-1:1})},t.sortInDescendingOrder=function(e,t){return e.sort(function(e,r){return t.call(null,e,r)?1:-1})}},function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},a=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1);t.get=function(e,t){return e.get(t)},t.set=function(e,t,r){e.set(t,r)},t.remove=function(e,t){var r,n,i,a;if(s.isFunction(t)){var l=[];try{for(var u=o(e),c=u.next();!c.done;c=u.next()){var d=c.value;t.call(null,d)&&l.push(d[0])}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}try{for(var p=o(l),f=p.next();!f.done;f=p.next()){var h=f.value;e.delete(h)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}else e.delete(t)},t.contains=function(e,t){var r,n;if(s.isFunction(t)){try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var l=a.value;if(t.call(null,l))return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1}return e.has(t)},t.keys=function(e){return new Set(e.keys())},t.values=function(e){return a(e.values())},t.size=function(e,t){var r,n;if(void 0===t)return e.size;var i=0;try{for(var a=o(e),s=a.next();!s.done;s=a.next()){var l=s.value;t.call(null,l)&&i++}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},t.isEmpty=function(e){return 0===e.size},t.forEach=function(e,t){var r,i,a,s,l,u;return n(this,function(n){switch(n.label){case 0:return void 0!==t?[3,2]:[5,o(e)];case 1:return n.sent(),[3,9];case 2:n.trys.push([2,7,8,9]),r=o(e),i=r.next(),n.label=3;case 3:return i.done?[3,6]:(a=i.value,t.call(null,a)?[4,a]:[3,5]);case 4:n.sent(),n.label=5;case 5:return i=r.next(),[3,3];case 6:return[3,9];case 7:return s=n.sent(),l={error:s},[3,9];case 8:try{i&&!i.done&&(u=r.return)&&u.call(r)}finally{if(l)throw l.error}return[7];case 9:return[2]}})},t.clone=function(e){return new Map(e)},t.sortInAscendingOrder=function(e,t){var r=new(Array.bind.apply(Array,a([void 0],e)));return r.sort(function(e,r){return t.call(null,e,r)?-1:1}),new Map(r)},t.sortInDescendingOrder=function(e,t){var r=new(Array.bind.apply(Array,a([void 0],e)));return r.sort(function(e,r){return t.call(null,e,r)?1:-1}),new Map(r)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HTML="http://www.w3.org/1999/xhtml",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/",t.MathML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLink="http://www.w3.org/1999/xlink"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enqueue=function(e,t){e.push(t)},t.dequeue=function(e){return e.shift()||null}},function(e,t,r){"use strict";var n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},a=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1);function l(e,t){var r,n;try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(!t.has(s))return!1}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!0}t.append=function(e,t){e.add(t)},t.extend=function(e,t){t.forEach(e.add,e)},t.prepend=function(e,t){var r=new Set(e);e.clear(),e.add(t),r.forEach(e.add,e)},t.replace=function(e,t,r){var n,i,a=new Set;try{for(var l=o(e),u=l.next();!u.done;u=l.next()){var c=u.value;s.isFunction(t)?t.call(null,c)?a.add(r):a.add(c):c===t?a.add(r):a.add(c)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}e.clear(),a.forEach(e.add,e)},t.insert=function(e,t,r){var n,i,a=new Set,s=0;try{for(var l=o(e),u=l.next();!u.done;u=l.next()){var c=u.value;s===r&&a.add(t),a.add(c),s++}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}e.clear(),a.forEach(e.add,e)},t.remove=function(e,t){var r,n,i,a;if(s.isFunction(t)){var l=[];try{for(var u=o(e),c=u.next();!c.done;c=u.next()){var d=c.value;t.call(null,d)&&l.push(d)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}try{for(var p=o(l),f=p.next();!f.done;f=p.next()){var h=f.value;e.delete(h)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}}else e.delete(t)},t.empty=function(e){e.clear()},t.contains=function(e,t){var r,n;if(!s.isFunction(t))return e.has(t);try{for(var i=o(e),a=i.next();!a.done;a=i.next()){var l=a.value;if(t.call(null,l))return!0}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},t.size=function(e,t){var r,n;if(void 0===t)return e.size;var i=0;try{for(var a=o(e),s=a.next();!s.done;s=a.next()){var l=s.value;t.call(null,l)&&i++}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},t.isEmpty=function(e){return 0===e.size},t.forEach=function(e,t){var r,i,a,s,l,u;return n(this,function(n){switch(n.label){case 0:return void 0!==t?[3,2]:[5,o(e)];case 1:return n.sent(),[3,9];case 2:n.trys.push([2,7,8,9]),r=o(e),i=r.next(),n.label=3;case 3:return i.done?[3,6]:(a=i.value,t.call(null,a)?[4,a]:[3,5]);case 4:n.sent(),n.label=5;case 5:return i=r.next(),[3,3];case 6:return[3,9];case 7:return s=n.sent(),l={error:s},[3,9];case 8:try{i&&!i.done&&(u=r.return)&&u.call(r)}finally{if(l)throw l.error}return[7];case 9:return[2]}})},t.clone=function(e){return new Set(e)},t.sortInAscendingOrder=function(e,t){var r=new(Array.bind.apply(Array,a([void 0],e)));return r.sort(function(e,r){return t.call(null,e,r)?-1:1}),new Set(r)},t.sortInDescendingOrder=function(e,t){var r=new(Array.bind.apply(Array,a([void 0],e)));return r.sort(function(e,r){return t.call(null,e,r)?1:-1}),new Set(r)},t.isSubsetOf=l,t.isSupersetOf=function(e,t){return l(t,e)},t.intersection=function(e,t){var r,n,i=new Set;try{for(var a=o(e),s=a.next();!s.done;s=a.next()){var l=s.value;t.has(l)&&i.add(l)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},t.union=function(e,t){var r=new Set(e);return t.forEach(r.add,r),r},t.range=function(e,t){for(var r=new Set,n=e;n<=t;n++)r.add(n);return r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.push=function(e,t){e.push(t)},t.pop=function(e){return e.pop()||null}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(96),i=r(147),a=r(146),s=r(1);function l(e,t){for(var r=0;;){var n=r<e.length?e.charCodeAt(r):null,o=r<t.length?t.charCodeAt(r):null;if(null===n)return!0;if(n!==o)return!1;r++}}function u(e){var t,r,o=Array.from(e),i=new Uint8Array(o.length),a=0;try{for(var s=n(e),l=s.next();!l.done;l=s.next()){var u=l.value.codePointAt(0);console.assert(void 0!==u&&u<=255,"isomorphicEncode requires string bytes to be less than or equal to 0x00FF."),void 0!==u&&u<=255&&(i[a++]=u)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i}function c(e){return/^[\u0000-\u007F]*$/.test(e)}function d(e){var t,r,o="";try{for(var i=n(e),a=i.next();!a.done;a=i.next()){var s=a.value,l=s.codePointAt(0);o+=void 0!==l&&l>=65&&l<=90?String.fromCodePoint(l+32):s}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o}function p(e){return e.replace(/^[\t\n\f\r ]+/,"").replace(/[\t\n\f\r ]+$/,"")}function f(e,t,r){if(!s.isArray(t))return f(e,Array.from(t),r);for(var n="";r.position<t.length&&e.call(null,t[r.position]);)n+=t[r.position],r.position++;return n}function h(e,t){f(function(e){return o.ASCIIWhiteSpace.test(e)},e,t)}t.isCodeUnitPrefix=l,t.isCodeUnitLessThan=function(e,t){if(l(t,e))return!1;if(l(e,t))return!0;for(var r=0;r<Math.min(e.length,t.length);r++){var n=e.charCodeAt(r),o=t.charCodeAt(r);if(n!==o)return n<o}return!1},t.isomorphicEncode=u,t.isASCIIString=c,t.asciiLowercase=d,t.asciiUppercase=function(e){var t,r,o="";try{for(var i=n(e),a=i.next();!a.done;a=i.next()){var s=a.value,l=s.codePointAt(0);o+=void 0!==l&&l>=97&&l<=122?String.fromCodePoint(l-32):s}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return o},t.asciiCaseInsensitiveMatch=function(e,t){return d(e)===d(t)},t.asciiEncode=function(e){return console.assert(c(e),"asciiEncode requires an ASCII string."),u(e)},t.asciiDecode=function(e){var t,r;try{for(var o=n(e),s=o.next();!s.done;s=o.next()){var l=s.value;console.assert(a.isASCIIByte(l),"asciiDecode requires an ASCII byte sequence.")}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i.isomorphicDecode(e)},t.stripNewlines=function(e){return e.replace(/[\n\r]/g,"")},t.normalizeNewlines=function(e){return e.replace(/\r\n/g,"\n").replace(/\r/g,"\n")},t.stripLeadingAndTrailingASCIIWhitespace=p,t.stripAndCollapseASCIIWhitespace=function(e){return p(e.replace(/[\t\n\f\r ]{2,}/g," "))},t.collectASequenceOfCodePoints=f,t.skipASCIIWhitespace=h,t.strictlySplit=function e(t,r){if(!s.isArray(t))return e(Array.from(t),r);var n={position:0},o=[],i=f(function(e){return r!==e},t,n);for(o.push(i);n.position<t.length;)console.assert(t[n.position]===r,"strictlySplit found no delimiter in input string."),n.position++,i=f(function(e){return r!==e},t,n),o.push(i);return o},t.splitAStringOnASCIIWhitespace=function e(t){if(!s.isArray(t))return e(Array.from(t));var r={position:0},n=[];for(h(t,r);r.position<t.length;){var i=f(function(e){return!o.ASCIIWhiteSpace.test(e)},t,r);n.push(i),h(t,r)}return n},t.splitAStringOnCommas=function e(t){if(!s.isArray(t))return e(Array.from(t));for(var r={position:0},n=[];r.position<t.length;){var o=f(function(e){return","!==e},t,r);n.push(p(o)),r.position<t.length&&(console.assert(","===t[r.position],"splitAStringOnCommas found no delimiter in input string."),r.position++)}return n},t.concatenate=function(e,t){return void 0===t&&(t=""),0===e.length?"":e.join(t)}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(97);t.abort_add=function(e,t){t._abortedFlag||t._abortAlgorithms.add(e)},t.abort_remove=function(e,t){t._abortAlgorithms.delete(e)},t.abort_signalAbort=function(e){var t,r;if(!e._abortedFlag){e._abortedFlag=!0;try{for(var i=n(e._abortAlgorithms),a=i.next();!a.done;a=i.next())a.value.call(e)}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}e._abortAlgorithms.clear(),o.event_fireAnEvent("abort",e)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(150),o=function(){function e(){}return e.asNode=function(e){if(n.Guard.isNode(e))return e;throw new Error("Invalid object. Node expected.")},e}();t.Cast=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return Object.defineProperty(e.prototype,"size",{get:function(){return 0},enumerable:!0,configurable:!0}),e.prototype.add=function(e){throw new Error("Cannot add to an empty set.")},e.prototype.clear=function(){},e.prototype.delete=function(e){return!1},e.prototype.forEach=function(e,t){},e.prototype.has=function(e){return!1},e.prototype[Symbol.iterator]=function(){return new o},e.prototype.entries=function(){return new o},e.prototype.keys=function(){return new o},e.prototype.values=function(){return new o},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"EmptySet"},enumerable:!0,configurable:!0}),e}();t.EmptySet=n;var o=function(){function e(){}return e.prototype[Symbol.iterator]=function(){return this},e.prototype.next=function(){return{done:!0,value:null}},e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.SchemeStart=0]="SchemeStart",e[e.Scheme=1]="Scheme",e[e.NoScheme=2]="NoScheme",e[e.SpecialRelativeOrAuthority=3]="SpecialRelativeOrAuthority",e[e.PathOrAuthority=4]="PathOrAuthority",e[e.Relative=5]="Relative",e[e.RelativeSlash=6]="RelativeSlash",e[e.SpecialAuthoritySlashes=7]="SpecialAuthoritySlashes",e[e.SpecialAuthorityIgnoreSlashes=8]="SpecialAuthorityIgnoreSlashes",e[e.Authority=9]="Authority",e[e.Host=10]="Host",e[e.Hostname=11]="Hostname",e[e.Port=12]="Port",e[e.File=13]="File",e[e.FileSlash=14]="FileSlash",e[e.FileHost=15]="FileHost",e[e.PathStart=16]="PathStart",e[e.Path=17]="Path",e[e.CannotBeABaseURLPath=18]="CannotBeABaseURLPath",e[e.Query=19]="Query",e[e.Fragment=20]="Fragment"}(t.ParserState||(t.ParserState={})),t.OpaqueOrigin=["","",null,null]},function(e,t,r){"use strict";var n=r(245),o=r(247);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){return o.isString(e)&&(e=b(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,l=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),d=["%","/","?",";","#"].concat(c),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(248);function b(e,t,r){if(e&&o.isObject(e)&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",u=e.split(s);u[0]=u[0].replace(/\\/g,"/");var b=e=u.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var x=l.exec(b);if(x)return this.path=b,this.href=b,this.pathname=x[1],x[2]?(this.search=x[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=a.exec(b);if(_){var S=(_=_[0]).toLowerCase();this.protocol=S,b=b.substr(_.length)}if(r||_||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var C="//"===b.substr(0,2);!C||_&&g[_]||(b=b.substr(2),this.slashes=!0)}if(!g[_]&&(C||_&&!y[_])){for(var T,w,A=-1,E=0;E<p.length;E++)-1!==(D=b.indexOf(p[E]))&&(-1===A||D<A)&&(A=D);for(-1!==(w=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(T=b.slice(0,w),b=b.slice(w+1),this.auth=decodeURIComponent(T)),A=-1,E=0;E<d.length;E++){var D;-1!==(D=b.indexOf(d[E]))&&(-1===A||D<A)&&(A=D)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var P="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!P)for(var I=this.hostname.split(/\./),O=(E=0,I.length);E<O;E++){var N=I[E];if(N&&!N.match(f)){for(var M="",R=0,F=N.length;R<F;R++)N.charCodeAt(R)>127?M+="x":M+=N[R];if(!M.match(f)){var B=I.slice(0,E),L=I.slice(E+1),k=N.match(h);k&&(B.push(k[1]),L.unshift(k[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",V=this.hostname||"";this.host=V+U,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[S])for(E=0,O=c.length;E<O;E++){var G=c[E];if(-1!==b.indexOf(G)){var z=encodeURIComponent(G);z===G&&(z=escape(G)),b=b.split(G).join(z)}}var j=b.indexOf("#");-1!==j&&(this.hash=b.substr(j),b=b.slice(0,j));var W=b.indexOf("?");if(-1!==W?(this.search=b.substr(W),this.query=b.substr(W+1),t&&(this.query=v.parse(this.query)),b=b.slice(0,W)):t&&(this.search="",this.query={}),b&&(this.pathname=b),y[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){U=this.pathname||"";var H=this.search||"";this.path=U+H}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=v.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(o.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var l=Object.keys(e),u=0;u<l.length;u++){var c=l[u];"protocol"!==c&&(r[c]=e[c])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var d=Object.keys(e),p=0;p<d.length;p++){var f=d[p];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),r.pathname=h.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var m=r.pathname||"",v=r.search||"";r.path=m+v}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),x=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=x||b||r.host&&e.pathname,S=_,C=r.pathname&&r.pathname.split("/")||[],T=(h=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(T&&(r.hostname="",r.port=null,r.host&&(""===C[0]?C[0]=r.host:C.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),_=_&&(""===h[0]||""===C[0])),x)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,C=h;else if(h.length)C||(C=[]),C.pop(),C=C.concat(h),r.search=e.search,r.query=e.query;else if(!o.isNullOrUndefined(e.search))return T&&(r.hostname=r.host=C.shift(),(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift())),r.search=e.search,r.query=e.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!C.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var w=C.slice(-1)[0],A=(r.host||e.host||C.length>1)&&("."===w||".."===w)||""===w,E=0,D=C.length;D>=0;D--)"."===(w=C[D])?C.splice(D,1):".."===w?(C.splice(D,1),E++):E&&(C.splice(D,1),E--);if(!_&&!S)for(;E--;E)C.unshift("..");!_||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),A&&"/"!==C.join("/").substr(-1)&&C.push("");var P,I=""===C[0]||C[0]&&"/"===C[0].charAt(0);return T&&(r.hostname=r.host=I?"":C.length?C.shift():"",(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift())),(_=_||r.host&&C.length)&&!I&&C.unshift(""),C.length?r.pathname=C.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){(function(e,n){var o;!function(){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof n&&n;i.global!==i&&i.window!==i&&i.self;var a,s=2147483647,l=/^xn--/,u=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,f=String.fromCharCode;function h(e){throw new RangeError(d[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function g(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(c,".")).split("."),t).join(".")}function y(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function v(e){return m(e,function(e){var t="";return e>65535&&(t+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+f(e)}).join("")}function b(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;n+=36)e=p(e/35);return p(n+36*e/(e+38))}function _(e){var t,r,n,o,i,a,l,u,c,d,f,m=[],g=e.length,y=0,b=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&h("not-basic"),m.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<g;){for(i=y,a=1,l=36;o>=g&&h("invalid-input"),((u=(f=e.charCodeAt(o++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>p((s-y)/a))&&h("overflow"),y+=u*a,!(u<(c=l<=_?1:l>=_+26?26:l-_));l+=36)a>p(s/(d=36-c))&&h("overflow"),a*=d;_=x(y-i,t=m.length+1,0==i),p(y/t)>s-b&&h("overflow"),b+=p(y/t),y%=t,m.splice(y++,0,b)}return v(m)}function S(e){var t,r,n,o,i,a,l,u,c,d,m,g,v,_,S,C=[];for(g=(e=y(e)).length,t=128,r=0,i=72,a=0;a<g;++a)(m=e[a])<128&&C.push(f(m));for(n=o=C.length,o&&C.push("-");n<g;){for(l=s,a=0;a<g;++a)(m=e[a])>=t&&m<l&&(l=m);for(l-t>p((s-r)/(v=n+1))&&h("overflow"),r+=(l-t)*v,t=l,a=0;a<g;++a)if((m=e[a])<t&&++r>s&&h("overflow"),m==t){for(u=r,c=36;!(u<(d=c<=i?1:c>=i+26?26:c-i));c+=36)S=u-d,_=36-d,C.push(f(b(d+S%_,0))),u=p(S/_);C.push(f(b(u,0))),i=x(r,v,n==o),r=0,++n}++r,++t}return C.join("")}a={version:"1.4.1",ucs2:{decode:y,encode:v},decode:_,encode:S,toASCII:function(e){return g(e,function(e){return u.test(e)?"xn--"+S(e):e})},toUnicode:function(e){return g(e,function(e){return l.test(e)?_(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return a}.call(t,r,t,e))||(e.exports=o)}()}).call(this,r(246)(e),r(78))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(249),t.encode=t.stringify=r(250)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,i){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var l=1e3;i&&"number"==typeof i.maxKeys&&(l=i.maxKeys);var u=e.length;l>0&&u>l&&(u=l);for(var c=0;c<u;++c){var d,p,f,h,m=e[c].replace(s,"%20"),g=m.indexOf(r);g>=0?(d=m.substr(0,g),p=m.substr(g+1)):(d=m,p=""),f=decodeURIComponent(d),h=decodeURIComponent(p),n(a,f)?o(a[f])?a[f].push(h):a[f]=[a[f],h]:a[f]=h}return a};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?i(a(e),function(a){var s=encodeURIComponent(n(a))+r;return o(e[a])?i(e[a],function(e){return s+encodeURIComponent(n(e))}).join(t):s+encodeURIComponent(n(e[a]))}).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function i(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52);t.attr_setAnExistingAttributeValue=function(e,t){null===e._element?e._value=t:n.element_change(e,e._element,t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(108),o=r(30),i=r(52);t.tokenList_validationSteps=function(e,t){if(!o.dom_hasSupportedTokens(e._attribute._localName))throw new TypeError("There are no supported tokens defined for attribute name: '"+e._attribute._localName+"'.");return o.dom_getSupportedTokens(e._attribute._localName).has(t.toLowerCase())},t.tokenList_updateSteps=function(e){(e._element.hasAttribute(e._attribute._localName)||0!==e._tokenSet.size)&&i.element_setAnAttributeValue(e._element,e._attribute._localName,n.orderedSet_serialize(e._tokenSet))},t.tokenList_serializeSteps=function(e){return i.element_getAnAttributeValue(e._element,e._attribute._localName)}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(1);function i(e){return o.isBoolean(e)?e:e.capture||!1}t.eventTarget_flatten=i,t.eventTarget_flattenMore=function(e){var t=i(e),r=!1,n=!1;return o.isBoolean(e)||(r=e.once||!1,n=e.passive||!1),[t,n,r]},t.eventTarget_addEventListener=function(e,t){if(null!==t.callback){for(var r=0;r<e._eventListenerList.length;r++){var n=e._eventListenerList[r];if(n.type===t.type&&n.callback.handleEvent===t.callback.handleEvent&&n.capture===t.capture)return}e._eventListenerList.push(t)}},t.eventTarget_removeEventListener=function(e,t,r){t.removed=!0,e._eventListenerList.splice(r,1)},t.eventTarget_removeAllEventListeners=function(e){var t,r;try{for(var o=n(e._eventListenerList),i=o.next();!i.done;i=o.next())i.value.removed=!0}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}e._eventListenerList.length=0}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),i=r(29);t.parentNode_convertNodesIntoANode=function(e,t){for(var r,a,s=null,l=0;l<e.length;l++){var u=e[l];if(o.isString(u)){var c=i.create_text(t,u);e[l]=c}}if(1===e.length)s=e[0];else{var d=s=i.create_documentFragment(t);try{for(var p=n(e),f=p.next();!f.done;f=p.next())u=f.value,d.appendChild(u)}catch(e){r={error:e}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(r)throw r.error}}}return s}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e};Object.defineProperty(t,"__esModule",{value:!0});var a=r(2),s=r(9),l=r(3),u=r(29),c=r(17),d=r(175),p=r(107),f=r(176),h=r(37),m=r(177);function g(e){return e._startNode===e._endNode&&e._startOffset===e._endOffset}function y(e){return c.tree_rootNode(e._startNode)}function v(e,t){return c.tree_rootNode(e)===y(t)&&d.boundaryPoint_position([e,0],t._start)===a.BoundaryPosition.After&&d.boundaryPoint_position([e,c.tree_nodeLength(e)],t._end)===a.BoundaryPosition.Before}function b(e,t){var r=c.tree_isAncestorOf(t._startNode,e,!0),n=c.tree_isAncestorOf(t._endNode,e,!0);return r&&!n||!r&&n}function x(e){var t,r,o,a,d,m,y=u.create_documentFragment(e._startNode._nodeDocument);if(g(e))return y;var _=e._startNode,S=e._startOffset,C=e._endNode,T=e._endOffset;if(_===C&&l.Guard.isCharacterDataNode(_))return(U=f.node_clone(_))._data=p.characterData_substringData(_,S,T-S),h.mutation_append(U,y),p.characterData_replaceData(_,S,T-S,""),y;for(var w=_;!c.tree_isAncestorOf(C,w,!0);){if(null===w._parent)throw new Error("Parent node is null.");w=w._parent}var A=null;if(!c.tree_isAncestorOf(C,_,!0))try{for(var E=n(w._children),D=E.next();!D.done;D=E.next())if(b(N=D.value,e)){A=N;break}}catch(e){t={error:e}}finally{try{D&&!D.done&&(r=E.return)&&r.call(E)}finally{if(t)throw t.error}}var P=null;if(!c.tree_isAncestorOf(_,C,!0))for(var I=i(w._children),O=I.length-1;O>0;O--){var N;if(b(N=I[O],e)){P=N;break}}var M,R,F=[];try{for(var B=n(w._children),L=B.next();!L.done;L=B.next())if(v(j=L.value,e)){if(l.Guard.isDocumentTypeNode(j))throw new s.HierarchyRequestError;F.push(j)}}catch(e){o={error:e}}finally{try{L&&!L.done&&(a=B.return)&&a.call(B)}finally{if(o)throw o.error}}if(c.tree_isAncestorOf(C,_,!0))M=_,R=S;else{for(var k=_;null!==k._parent&&!c.tree_isAncestorOf(C,k._parent);)k=k._parent;if(null===k._parent)throw new Error("Parent node is null.");M=k._parent,R=1+c.tree_index(k)}if(l.Guard.isCharacterDataNode(A))(U=f.node_clone(_))._data=p.characterData_substringData(_,S,c.tree_nodeLength(_)-S),h.mutation_append(U,y),p.characterData_replaceData(_,S,c.tree_nodeLength(_)-S,"");else if(null!==A){var U=f.node_clone(A);h.mutation_append(U,y);var V=x(u.create_range([_,S],[A,c.tree_nodeLength(A)]));h.mutation_append(V,U)}try{for(var G=n(F),z=G.next();!z.done;z=G.next()){var j=z.value;h.mutation_append(j,y)}}catch(e){d={error:e}}finally{try{z&&!z.done&&(m=G.return)&&m.call(G)}finally{if(d)throw d.error}}return l.Guard.isCharacterDataNode(P)?((U=f.node_clone(C))._data=p.characterData_substringData(C,0,T),h.mutation_append(U,y),p.characterData_replaceData(C,0,T,"")):null!==P&&(U=f.node_clone(P),h.mutation_append(U,y),V=x(u.create_range([P,0],[C,T])),h.mutation_append(V,U)),e._start=[M,R],e._end=[M,R],y}t.range_collapsed=g,t.range_root=y,t.range_isContained=v,t.range_isPartiallyContained=b,t.range_setTheStart=function(e,t,r){if(l.Guard.isDocumentTypeNode(t))throw new s.InvalidNodeTypeError;if(r>c.tree_nodeLength(t))throw new s.IndexSizeError;var n=[t,r];y(e)===c.tree_rootNode(t)&&d.boundaryPoint_position(n,e._end)!==a.BoundaryPosition.After||(e._end=n),e._start=n},t.range_setTheEnd=function(e,t,r){if(l.Guard.isDocumentTypeNode(t))throw new s.InvalidNodeTypeError;if(r>c.tree_nodeLength(t))throw new s.IndexSizeError;var n=[t,r];y(e)===c.tree_rootNode(t)&&d.boundaryPoint_position(n,e._start)!==a.BoundaryPosition.Before||(e._start=n),e._end=n},t.range_select=function(e,t){var r=e._parent;if(null===r)throw new s.InvalidNodeTypeError;var n=c.tree_index(e);t._start=[r,n],t._end=[r,n+1]},t.range_extract=x,t.range_cloneTheContents=function e(t){var r,o,a,d,m,y,_=u.create_documentFragment(t._startNode._nodeDocument);if(g(t))return _;var S=t._startNode,C=t._startOffset,T=t._endNode,w=t._endOffset;S===T&&l.Guard.isCharacterDataNode(S)&&((L=f.node_clone(S))._data=p.characterData_substringData(S,C,w-C),h.mutation_append(L,_));for(var A=S;!c.tree_isAncestorOf(T,A,!0);){if(null===A._parent)throw new Error("Parent node is null.");A=A._parent}var E=null;if(!c.tree_isAncestorOf(T,S,!0))try{for(var D=n(A._children),P=D.next();!P.done;P=D.next())if(b(M=P.value,t)){E=M;break}}catch(e){r={error:e}}finally{try{P&&!P.done&&(o=D.return)&&o.call(D)}finally{if(r)throw r.error}}var I=null;if(!c.tree_isAncestorOf(S,T,!0))for(var O=i(A._children),N=O.length-1;N>0;N--){var M;if(b(M=O[N],t)){I=M;break}}var R=[];try{for(var F=n(A._children),B=F.next();!B.done;B=F.next())if(v(G=B.value,t)){if(l.Guard.isDocumentTypeNode(G))throw new s.HierarchyRequestError;R.push(G)}}catch(e){a={error:e}}finally{try{B&&!B.done&&(d=F.return)&&d.call(F)}finally{if(a)throw a.error}}if(l.Guard.isCharacterDataNode(E))(L=f.node_clone(S))._data=p.characterData_substringData(S,C,c.tree_nodeLength(S)-C),h.mutation_append(L,_);else if(null!==E){var L=f.node_clone(E);h.mutation_append(L,_);var k=e(u.create_range([S,C],[E,c.tree_nodeLength(E)]));h.mutation_append(k,L)}try{for(var U=n(R),V=U.next();!V.done;V=U.next()){var G=V.value;L=f.node_clone(G),h.mutation_append(L,_)}}catch(e){m={error:e}}finally{try{V&&!V.done&&(y=U.return)&&y.call(U)}finally{if(m)throw m.error}}return l.Guard.isCharacterDataNode(I)?((L=f.node_clone(T))._data=p.characterData_substringData(T,0,w),h.mutation_append(L,_)):null!==I&&(L=f.node_clone(I),_.append(L),k=x(u.create_range([I,0],[T,w])),h.mutation_append(k,L)),_},t.range_insert=function(e,t){var r,o;if(l.Guard.isProcessingInstructionNode(t._startNode)||l.Guard.isCommentNode(t._startNode)||l.Guard.isTextNode(t._startNode)&&null===t._startNode._parent||t._startNode===e)throw new s.HierarchyRequestError;var i,a=null;if(l.Guard.isTextNode(t._startNode))a=t._startNode;else{var u=0;try{for(var d=n(t._startNode._children),p=d.next();!p.done;p=d.next()){var f=p.value;if(u===t._startOffset){a=f;break}u++}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}}if(null===a)i=t._startNode;else{if(null===a._parent)throw new Error("Parent node is null.");i=a._parent}h.mutation_ensurePreInsertionValidity(e,i,a),l.Guard.isTextNode(t._startNode)&&(a=m.text_split(t._startNode,t._startOffset)),e===a&&(a=e._nextSibling),null!==e._parent&&h.mutation_remove(e,e._parent);var y=null===a?c.tree_nodeLength(i):c.tree_index(a);l.Guard.isDocumentFragmentNode(e)?y+=c.tree_nodeLength(e):y++,h.mutation_preInsert(e,i,a),g(t)&&(t._end=[i,y])},t.range_getContainedNodes=function(e){var t;return(t={})[Symbol.iterator]=function(){var t=e.commonAncestorContainer,r=c.tree_getFirstDescendantNode(t);return{next:function(){for(;r&&!v(r,e);)r=c.tree_getNextDescendantNode(t,r);if(null===r)return{done:!0,value:null};var n={done:!1,value:r};return r=c.tree_getNextDescendantNode(t,r),n}}},t},t.range_getPartiallyContainedNodes=function(e){var t;return(t={})[Symbol.iterator]=function(){var t=e.commonAncestorContainer,r=c.tree_getFirstDescendantNode(t);return{next:function(){for(;r&&!b(r,e);)r=c.tree_getNextDescendantNode(t,r);if(null===r)return{done:!0,value:null};var n={done:!1,value:r};return r=c.tree_getNextDescendantNode(t,r),n}}},t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9);t.selectors_scopeMatchASelectorsString=function(e,t){throw new n.NotSupportedError}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(105);t.treeWalker_traverseChildren=function(e,t){for(var r=t?e._current._firstChild:e._current._lastChild;null!==r;){var i=o.traversal_filter(e,r);if(i===n.FilterResult.Accept)return e._current=r,r;if(i===n.FilterResult.Skip){var a=t?r._firstChild:r._lastChild;if(null!==a){r=a;continue}}for(;null!==r;){var s=t?r._nextSibling:r._previousSibling;if(null!==s){r=s;break}var l=r._parent;if(null===l||l===e._root||l===e._current)return null;r=l}}return null},t.treeWalker_traverseSiblings=function(e,t){var r=e._current;if(r===e._root)return null;for(;;){for(var i=t?r._nextSibling:r._previousSibling;null!==i;){r=i;var a=o.traversal_filter(e,r);if(a===n.FilterResult.Accept)return e._current=r,r;i=t?r._firstChild:r._lastChild,a!==n.FilterResult.Reject&&null!==i||(i=t?r._nextSibling:r._previousSibling)}if(null===(r=r._parent)||r===e._root)return null;if(o.traversal_filter(e,r)===n.FilterResult.Accept)return null}}},function(e,t,r){"use strict";r(89),r(74);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),a=r(2),s=r(50),l=r(3),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n._indentation={},n._lengthToLastNewline=0,n._writerOptions=i.applyDefaults(r,{wellFormed:!1,headless:!1,prettyPrint:!1,indent:" ",newline:"\n",offset:0,width:0,allowEmptyTags:!1,indentTextOnlyNodes:!1,spaceBeforeSlash:!1}),n}return o(t,e),t.prototype.serialize=function(e){return this._refs={suppressPretty:!1,emptyNode:!1,markup:""},e.nodeType!==a.NodeType.Document||this._writerOptions.headless||this.declaration(this._builderOptions.version,this._builderOptions.encoding,this._builderOptions.standalone),this.serializeNode(e,this._writerOptions.wellFormed),this._writerOptions.prettyPrint&&this._refs.markup.slice(-this._writerOptions.newline.length)===this._writerOptions.newline&&(this._refs.markup=this._refs.markup.slice(0,-this._writerOptions.newline.length)),this._refs.markup},t.prototype.declaration=function(e,t,r){this._beginLine(),this._refs.markup+='<?xml version="'+e+'"',void 0!==t&&(this._refs.markup+=' encoding="'+t+'"'),void 0!==r&&(this._refs.markup+=' standalone="'+(r?"yes":"no")+'"'),this._refs.markup+="?>",this._endLine()},t.prototype.docType=function(e,t,r){this._beginLine(),this._refs.markup+=t&&r?"<!DOCTYPE "+e+' PUBLIC "'+t+'" "'+r+'">':t?"<!DOCTYPE "+e+' PUBLIC "'+t+'">':r?"<!DOCTYPE "+e+' SYSTEM "'+r+'">':"<!DOCTYPE "+e+">",this._endLine()},t.prototype.openTagBegin=function(e){this._beginLine(),this._refs.markup+="<"+e},t.prototype.openTagEnd=function(e,t,r){if(this._refs.suppressPretty=!1,this._refs.emptyNode=!1,this._writerOptions.prettyPrint&&!t&&!r){for(var n=!0,o=!0,i=this.currentNode.firstChild,a=0,s=0;i;){if(l.Guard.isExclusiveTextNode(i))s++;else{if(!l.Guard.isCDATASectionNode(i)){n=!1,o=!1;break}a++}""!==i.data&&(o=!1),i=i.nextSibling}this._refs.suppressPretty=!this._writerOptions.indentTextOnlyNodes&&n&&(a<=1&&0===s||0===a),this._refs.emptyNode=o}(r||t||this._refs.emptyNode)&&this._writerOptions.allowEmptyTags?this._refs.markup+="></"+e+">":this._refs.markup+=r?" />":t||this._refs.emptyNode?this._writerOptions.spaceBeforeSlash?" />":"/>":">",this._endLine()},t.prototype.closeTag=function(e){this._refs.emptyNode||(this._beginLine(),this._refs.markup+="</"+e+">"),this._refs.suppressPretty=!1,this._refs.emptyNode=!1,this._endLine()},t.prototype.attribute=function(e,t){var r=e+'="'+t+'"';this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._refs.markup.length-this._lengthToLastNewline+1+r.length>this._writerOptions.width?(this._endLine(),this._beginLine(),this._refs.markup+=this._indent(1)+r):this._refs.markup+=" "+r},t.prototype.text=function(e){""!==e&&(this._beginLine(),this._refs.markup+=e,this._endLine())},t.prototype.cdata=function(e){""!==e&&(this._beginLine(),this._refs.markup+="<![CDATA["+e+"]]>",this._endLine())},t.prototype.comment=function(e){this._beginLine(),this._refs.markup+="\x3c!--"+e+"--\x3e",this._endLine()},t.prototype.instruction=function(e,t){this._beginLine(),this._refs.markup+="<?"+(""===t?e:e+" "+t)+"?>",this._endLine()},t.prototype._beginLine=function(){this._writerOptions.prettyPrint&&!this._refs.suppressPretty&&(this._refs.markup+=this._indent(this._writerOptions.offset+this.level))},t.prototype._endLine=function(){this._writerOptions.prettyPrint&&!this._refs.suppressPretty&&(this._refs.markup+=this._writerOptions.newline,this._lengthToLastNewline=this._refs.markup.length)},t.prototype._indent=function(e){if(e<=0)return"";if(void 0!==this._indentation[e])return this._indentation[e];var t=this._writerOptions.indent.repeat(e);return this._indentation[e]=t,t},t}(s.BaseWriter);t.XMLWriter=u},function(e,t,r){"use strict";var n=r(47),o=r(35);e.exports="".repeat||function(e){var t=String(o(this)),r="",i=n(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(r+=t);return r}},function(e,t,r){"use strict";r(31),r(32),r(33),r(19),r(178),r(20),r(22),r(23);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=r(67),s=r(1),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n._writerOptions=s.applyDefaults(r,{wellFormed:!1,prettyPrint:!1,indent:" ",newline:"\n",offset:0,group:!1,verbose:!1}),n}return o(t,e),t.prototype.serialize=function(e){var t=s.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1}),r=new a.ObjectWriter(this._builderOptions,t).serialize(e);return this._beginLine(this._writerOptions,0)+this._convertObject(r,this._writerOptions)},t.prototype._convertObject=function(e,t,r){var n,o,a=this;void 0===r&&(r=0);var l="",u=this._isLeafNode(e);if(s.isArray(e)){l+="[";var c=e.length,d=0;try{for(var p=i(e),f=p.next();!f.done;f=p.next()){var h=f.value;l+=this._endLine(t,r+1)+this._beginLine(t,r+1)+this._convertObject(h,t,r+1),d<c-1&&(l+=","),d++}}catch(e){n={error:e}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}l+=this._endLine(t,r)+this._beginLine(t,r),l+="]"}else if(s.isObject(e)){l+="{";var m=s.objectLength(e),g=0;s.forEachObject(e,function(e,n){u&&t.prettyPrint?l+=" ":l+=a._endLine(t,r+1)+a._beginLine(t,r+1),l+=a._key(e),t.prettyPrint&&(l+=" "),l+=a._convertObject(n,t,r+1),g<m-1&&(l+=","),g++},this),u&&t.prettyPrint?l+=" ":l+=this._endLine(t,r)+this._beginLine(t,r),l+="}"}else l+=this._val(e);return l},t.prototype._beginLine=function(e,t){if(!e.prettyPrint)return"";var r=e.offset+t+1;return r>0?new Array(r).join(e.indent):""},t.prototype._endLine=function(e,t){return e.prettyPrint?e.newline:""},t.prototype._key=function(e){return'"'+e+'":'},t.prototype._val=function(e){return JSON.stringify(e)},t.prototype._isLeafNode=function(e){return this._descendantCount(e)<=1},t.prototype._descendantCount=function(e,t){var r=this;return void 0===t&&(t=0),s.isArray(e)?s.forEachArray(e,function(e){return t+=r._descendantCount(e,t)},this):s.isObject(e)?s.forEachObject(e,function(e,n){return t+=r._descendantCount(n,t)},this):t++,t},t}(r(50).BaseWriter);t.JSONWriter=l},function(e,t,r){"use strict";r(31),r(32),r(33),r(19),r(178),r(89),r(20),r(22),r(23);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var a=r(67),s=r(1),l=function(e){function t(t,r){var n=e.call(this,t)||this;if(n._writerOptions=s.applyDefaults(r,{wellFormed:!1,indent:" ",newline:"\n",offset:0,group:!1,verbose:!1}),n._writerOptions.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(n._writerOptions.offset<0)throw new Error("YAML offset should be zero or a positive number.");return n}return o(t,e),t.prototype.serialize=function(e){var t=s.applyDefaults(this._writerOptions,{format:"object",wellFormed:!1}),r=new a.ObjectWriter(this._builderOptions,t).serialize(e),n=this._beginLine(this._writerOptions,0)+"---"+this._endLine(this._writerOptions)+this._convertObject(r,this._writerOptions,0);return n.slice(-this._writerOptions.newline.length)===this._writerOptions.newline&&(n=n.slice(0,-this._writerOptions.newline.length)),n},t.prototype._convertObject=function(e,t,r,n){var o,a,l=this;void 0===n&&(n=!1);var u="";if(s.isArray(e))try{for(var c=i(e),d=c.next();!d.done;d=c.next()){var p=d.value;u+=this._beginLine(t,r,!0),s.isObject(p)?s.isEmpty(p)?u+='""'+this._endLine(t):u+=this._convertObject(p,t,r,!0):u+=this._val(p)+this._endLine(t)}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}else s.forEachObject(e,function(e,o){n?(u+=l._key(e),n=!1):u+=l._beginLine(t,r)+l._key(e),s.isObject(o)?s.isEmpty(o)?u+=' ""'+l._endLine(t):u+=l._endLine(t)+l._convertObject(o,t,r+1):u+=" "+l._val(o)+l._endLine(t)},this);return u},t.prototype._beginLine=function(e,t,r){void 0===r&&(r=!1);var n=e.offset+t+1,o=new Array(n).join(e.indent);return r?o.substr(0,o.length-2)+"-"+o.substr(-1,1):o},t.prototype._endLine=function(e){return e.newline},t.prototype._key=function(e){return'"'+e+'":'},t.prototype._val=function(e){return JSON.stringify(e)},t}(r(50).BaseWriter);t.YAMLWriter=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(110).dom.setFeatures(!0);var n=r(110);t.DOMImplementation=n.DOMImplementation;var o=r(271);t.DOMParser=o.DOMParser;var i=r(274);t.XMLSerializer=i.XMLSerializer},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(0),i=function(){function e(){}return e.prototype.before=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.Cast.asNode(this),i=r._parent;if(null!==i){for(var a=r._previousSibling,s=!0;s&&a;){s=!1;for(var l=0;l<e.length;l++)if(e[l]===a){a=a._previousSibling,s=!0;break}}var u=o.parentNode_convertNodesIntoANode(e,r._nodeDocument);a=null===a?i._firstChild:a._nextSibling,o.mutation_preInsert(u,i,a)}},e.prototype.after=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.Cast.asNode(this),i=r._parent;if(i){for(var a=r._nextSibling,s=!0;s&&a;){s=!1;for(var l=0;l<e.length;l++)if(e[l]===a){a=a._nextSibling,s=!0;break}}var u=o.parentNode_convertNodesIntoANode(e,r._nodeDocument);o.mutation_preInsert(u,i,a)}},e.prototype.replaceWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=n.Cast.asNode(this),i=r._parent;if(i){for(var a=r._nextSibling,s=!0;s&&a;){s=!1;for(var l=0;l<e.length;l++)if(e[l]===a){a=a._nextSibling,s=!0;break}}var u=o.parentNode_convertNodesIntoANode(e,r._nodeDocument);r._parent===i?o.mutation_replace(r,u,i):o.mutation_preInsert(u,i,a)}},e.prototype.remove=function(){var e=n.Cast.asNode(this),t=e._parent;t&&o.mutation_remove(e,t)},e}();t.ChildNodeImpl=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DocumentOrShadowRootImpl=function(){}},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),i=r(3),a=r(7),s=function(){function e(e){this._nodeList=[],this._recordQueue=[],this._callback=e;var t=o.dom.window;a.set.append(t._mutationObservers,this)}return e.prototype.observe=function(e,t){var r,o;if(void 0===(t=t||{childList:!1,subtree:!1}).attributeOldValue&&void 0===t.attributeFilter||void 0!==t.attributes||(t.attributes=!0),void 0!==t.characterDataOldValue&&void 0===t.characterData&&(t.characterData=!0),!t.childList&&!t.attributes&&!t.characterData)throw new TypeError;if(t.attributeOldValue&&!t.attributes)throw new TypeError;if(void 0!==t.attributeFilter&&!t.attributes)throw new TypeError;if(t.characterDataOldValue&&!t.characterData)throw new TypeError;var s=!1,l=t,u=function(e){var t,r;if(e.observer===c){s=!0;try{for(var o=(t=void 0,n(c._nodeList)),u=o.next();!u.done;u=o.next()){var d=u.value;a.list.remove(d._registeredObserverList,function(t){return i.Guard.isTransientRegisteredObserver(t)&&t.source===e})}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}e.options=l}},c=this;try{for(var d=n(e._registeredObserverList),p=d.next();!p.done;p=d.next())u(p.value)}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}s||(e._registeredObserverList.push({observer:this,options:t}),this._nodeList.push(e))},e.prototype.disconnect=function(){var e,t,r=this;try{for(var o=n(this._nodeList),i=o.next();!i.done;i=o.next()){var s=i.value;a.list.remove(s._registeredObserverList,function(e){return e.observer===r})}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this._recordQueue=[]},e.prototype.takeRecords=function(){var e=this._recordQueue;return this._recordQueue=[],e},e}();t.MutationObserverImpl=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=function(){function e(){}return Object.defineProperty(e.prototype,"previousElementSibling",{get:function(){for(var e=n.Cast.asNode(this)._previousSibling;e;){if(n.Guard.isElementNode(e))return e;e=e._previousSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextElementSibling",{get:function(){for(var e=n.Cast.asNode(this)._nextSibling;e;){if(n.Guard.isElementNode(e))return e;e=e._nextSibling}return null},enumerable:!0,configurable:!0}),e}();t.NonDocumentTypeChildNodeImpl=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(0),i=function(){function e(){}return e.prototype.getElementById=function(e){for(var t=o.tree_getFirstDescendantNode(n.Cast.asNode(this),!1,!1,function(e){return n.Guard.isElementNode(e)});null!==t;){if(t._uniqueIdentifier===e)return t;t=o.tree_getNextDescendantNode(n.Cast.asNode(this),t,!1,!1,function(e){return n.Guard.isElementNode(e)})}return null},e}();t.NonElementParentNodeImpl=i},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(3),i=r(0),a=function(){function e(){}return Object.defineProperty(e.prototype,"children",{get:function(){return i.create_htmlCollection(o.Cast.asNode(this))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){for(var e=o.Cast.asNode(this)._firstChild;e;){if(o.Guard.isElementNode(e))return e;e=e._nextSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){for(var e=o.Cast.asNode(this)._lastChild;e;){if(o.Guard.isElementNode(e))return e;e=e._previousSibling}return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){var e,t,r=0;try{for(var i=n(o.Cast.asNode(this)._children),a=i.next();!a.done;a=i.next()){var s=a.value;o.Guard.isElementNode(s)&&r++}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},enumerable:!0,configurable:!0}),e.prototype.prepend=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.Cast.asNode(this),n=i.parentNode_convertNodesIntoANode(e,r._nodeDocument);i.mutation_preInsert(n,r,r._firstChild)},e.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=o.Cast.asNode(this),n=i.parentNode_convertNodesIntoANode(e,r._nodeDocument);i.mutation_append(n,r)},e.prototype.querySelector=function(e){var t=o.Cast.asNode(this),r=i.selectors_scopeMatchASelectorsString(e,t);return 0===r.length?null:r[0]},e.prototype.querySelectorAll=function(e){var t=o.Cast.asNode(this),r=i.selectors_scopeMatchASelectorsString(e,t);return i.create_nodeListStatic(t,r)},e}();t.ParentNodeImpl=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=function(){function e(){}return Object.defineProperty(e.prototype,"_name",{get:function(){return this.__name||""},set:function(e){this.__name=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_assignedSlot",{get:function(){return this.__assignedSlot||null},set:function(e){this.__assignedSlot=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"assignedSlot",{get:function(){return n.shadowTree_findASlot(this,!0)},enumerable:!0,configurable:!0}),e}();t.SlotableImpl=o},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(102),a=r(9),s=r(3),l=function(e){function t(t){var r=e.call(this)||this;if(s.Guard.isDocumentTypeNode(t.startContainer)||s.Guard.isAttrNode(t.startContainer)||s.Guard.isDocumentTypeNode(t.endContainer)||s.Guard.isAttrNode(t.endContainer))throw new a.InvalidNodeTypeError;return r._start=[t.startContainer,t.startOffset],r._end=[t.endContainer,t.endOffset],r}return o(t,e),t}(i.AbstractRangeImpl);t.StaticRangeImpl=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(272);t.DOMParser=n.DOMParserImpl},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),o=r(273),i=function(){function e(){}return e.prototype.parseFromString=function(e,t){if("text/html"===t)throw new Error("HTML parser not implemented.");try{return(r=(new o.XMLParserImpl).parse(e))._contentType=t,r}catch(e){var r,i="http://www.mozilla.org/newlayout/xml/parsererror.xml",a=(r=n.create_xmlDocument()).createElementNS(i,"parsererror"),s=r.createElementNS(i,"error");return s.setAttribute("message",e.message),a.appendChild(s),r.appendChild(a),r}},e}();t.DOMParserImpl=i},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var i=r(180),a=r(111),s=r(7),l=r(0),u=r(69),c=function(){function e(){}return e.prototype.parse=function(e){for(var t,r,c,d,p=new i.XMLStringLexer(e,{skipWhitespaceOnlyText:!0}),f=l.create_document(),h=f,m=p.nextToken();m.type!==a.TokenType.EOF;){switch(m.type){case a.TokenType.Declaration:var g=m;if("1.0"!==g.version)throw new Error("Invalid xml version: "+g.version);break;case a.TokenType.DocType:var y=m;if(!l.xml_isPubidChar(y.pubId))throw new Error("DocType public identifier does not match PubidChar construct.");if(!l.xml_isLegalChar(y.sysId)||-1!==y.sysId.indexOf('"')&&-1!==y.sysId.indexOf("'"))throw new Error("DocType system identifier contains invalid characters.");h.appendChild(f.implementation.createDocumentType(y.name,y.pubId,y.sysId));break;case a.TokenType.CDATA:var v=m;if(!l.xml_isLegalChar(v.data)||-1!==v.data.indexOf("]]>"))throw new Error("CDATA contains invalid characters.");h.appendChild(f.createCDATASection(v.data));break;case a.TokenType.Comment:var b=m;if(!l.xml_isLegalChar(b.data)||-1!==b.data.indexOf("--")||b.data.endsWith("-"))throw new Error("Comment data contains invalid characters.");h.appendChild(f.createComment(b.data));break;case a.TokenType.PI:var x=m;if(-1!==x.target.indexOf(":")||/^xml$/i.test(x.target))throw new Error("Processing instruction target contains invalid characters.");if(!l.xml_isLegalChar(x.data)||-1!==x.data.indexOf("?>"))throw new Error("Processing instruction data contains invalid characters.");h.appendChild(f.createProcessingInstruction(x.target,x.data));break;case a.TokenType.Text:var _=m;if(!l.xml_isLegalChar(_.data))throw new Error("Text data contains invalid characters.");h.appendChild(f.createTextNode(this._decodeText(_.data)));break;case a.TokenType.Element:var S=m,C=n(l.namespace_extractQName(S.name),2),T=C[0],w=C[1];if(-1!==w.indexOf(":")||!l.xml_isName(w))throw new Error("Node local name contains invalid characters.");if("xmlns"===T)throw new Error("An element cannot have the 'xmlns' prefix.");var A=h.lookupNamespaceURI(T),E={};try{for(var D=(t=void 0,o(S.attributes)),P=D.next();!P.done;P=D.next()){var I=n(P.value,2),O=I[0],N=I[1];if("xmlns"===O)A=N;else{var M=n(l.namespace_extractQName(O),2),R=M[0],F=M[1];"xmlns"===R&&(F===T&&(A=N),E[F]=N)}}}catch(e){t={error:e}}finally{try{P&&!P.done&&(r=D.return)&&r.call(D)}finally{if(t)throw t.error}}var B=null!==A?f.createElementNS(A,S.name):f.createElement(S.name);h.appendChild(B);var L=new u.LocalNameSet;try{for(var k=(c=void 0,o(S.attributes)),U=k.next();!U.done;U=k.next()){var V=n(U.value,2),G=(O=V[0],N=V[1],n(l.namespace_extractQName(O),2)),z=(R=G[0],F=G[1],null);if("xmlns"===R||null===R&&"xmlns"===F?z=s.namespace.XMLNS:null!==(z=B.lookupNamespaceURI(R))&&B.isDefaultNamespace(z)?z=null:null===z&&null!==R&&(z=E[R]||null),L.has(z,F))throw new Error("Element contains duplicate attributes.");if(L.set(z,F),z===s.namespace.XMLNS&&N===s.namespace.XMLNS)throw new Error("XMLNS namespace is reserved.");if(-1!==F.indexOf(":")||!l.xml_isName(F))throw new Error("Attribute local name contains invalid characters.");if("xmlns"===R&&""===N)throw new Error("Empty XML namespace is not allowed.");null!==z?B.setAttributeNS(z,O,this._decodeAttributeValue(N)):B.setAttribute(O,this._decodeAttributeValue(N))}}catch(e){c={error:e}}finally{try{U&&!U.done&&(d=k.return)&&d.call(k)}finally{if(c)throw c.error}}S.selfClosing||(h=B);break;case a.TokenType.ClosingTag:if(m.name!==h.nodeName)throw new Error("Closing tag name does not match opening tag name.");h._parent&&(h=h._parent)}m=p.nextToken()}return f},e.prototype._decodeText=function(e){return null==e?e:e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")},e.prototype._decodeAttributeValue=function(e){return null==e?e:e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")},e}();t.XMLParserImpl=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(275);t.XMLSerializer=n.XMLSerializerImpl},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),i=r(69),a=r(95),s=r(9),l=r(7),u=r(0),c=function(){function e(){}return e.prototype.serializeToString=function(e){return this._xmlSerialization(e,!1)},e.prototype._xmlSerialization=function(e,t){if(void 0===e._nodeDocument||e._nodeDocument._hasNamespaces){var r=new a.NamespacePrefixMap;r.set("xml",l.namespace.XML);try{return this._serializeNodeNS(e,null,r,{value:1},t)}catch(e){throw new s.InvalidStateError}}else try{return this._serializeNode(e,t)}catch(e){throw new s.InvalidStateError}},e.prototype._serializeNodeNS=function(e,t,r,n,i){switch(e.nodeType){case o.NodeType.Element:return this._serializeElementNS(e,t,r,n,i);case o.NodeType.Document:return this._serializeDocumentNS(e,t,r,n,i);case o.NodeType.Comment:return this._serializeComment(e,i);case o.NodeType.Text:return this._serializeText(e,i);case o.NodeType.DocumentFragment:return this._serializeDocumentFragmentNS(e,t,r,n,i);case o.NodeType.DocumentType:return this._serializeDocumentType(e,i);case o.NodeType.ProcessingInstruction:return this._serializeProcessingInstruction(e,i);case o.NodeType.CData:return this._serializeCData(e,i);default:throw new Error("Unknown node type: "+e.nodeType)}},e.prototype._serializeNode=function(e,t){switch(e.nodeType){case o.NodeType.Element:return this._serializeElement(e,t);case o.NodeType.Document:return this._serializeDocument(e,t);case o.NodeType.Comment:return this._serializeComment(e,t);case o.NodeType.Text:return this._serializeText(e,t);case o.NodeType.DocumentFragment:return this._serializeDocumentFragment(e,t);case o.NodeType.DocumentType:return this._serializeDocumentType(e,t);case o.NodeType.ProcessingInstruction:return this._serializeProcessingInstruction(e,t);case o.NodeType.CData:return this._serializeCData(e,t);default:throw new Error("Unknown node type: "+e.nodeType)}},e.prototype._serializeElementNS=function(t,r,o,i,a){var s,c;if(a&&(-1!==t.localName.indexOf(":")||!u.xml_isName(t.localName)))throw new Error("Node local name contains invalid characters (well-formed required).");var d="<",p="",f=!1,h=!1,m=o.copy(),g={},y=this._recordNamespaceInformation(t,m,g),v=r,b=t.namespaceURI;if(v===b)null!==y&&(h=!0),d+=p=b===l.namespace.XML?"xml:"+t.localName:t.localName;else{var x=t.prefix,_=null;if(null===x&&b===y||(_=m.get(x,b)),"xmlns"===x){if(a)throw new Error("An element cannot have the 'xmlns' prefix (well-formed required).");_=x}null!==_?(p=_+":"+t.localName,null!==y&&y!==l.namespace.XML&&(v=y||null),d+=p):null!==x?(x in g&&(x=this._generatePrefix(b,m,i)),m.set(x,b),d+=p+=x+":"+t.localName,d+=" xmlns:"+x+'="'+this._serializeAttributeValue(b,a)+'"',null!==y&&(v=y||null)):null===y||null!==y&&y!==b?(h=!0,v=b,d+=p+=t.localName,d+=' xmlns="'+this._serializeAttributeValue(b,a)+'"'):(v=b,d+=p+=t.localName)}d+=this._serializeAttributesNS(t,m,i,g,h,a);var S=b===l.namespace.HTML;if(S&&0===t.childNodes.length&&e._VoidElementNames.has(t.localName)?(d+=" /",f=!0):S||0!==t.childNodes.length||(d+="/",f=!0),d+=">",f)return d;if(S&&"template"===t.localName);else try{for(var C=n(t._children||t.childNodes),T=C.next();!T.done;T=C.next()){var w=T.value;d+=this._serializeNodeNS(w,v,m,i,a)}}catch(e){s={error:e}}finally{try{T&&!T.done&&(c=C.return)&&c.call(C)}finally{if(s)throw s.error}}return d+"</"+p+">"},e.prototype._serializeDocumentNS=function(e,t,r,o,i){var a,s;if(i&&null===e.documentElement)throw new Error("Missing document element (well-formed required).");var l="";try{for(var u=n(e._children||e.childNodes),c=u.next();!c.done;c=u.next()){var d=c.value;l+=this._serializeNodeNS(d,t,r,o,i)}}catch(e){a={error:e}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}return l},e.prototype._serializeComment=function(e,t){if(t&&(!u.xml_isLegalChar(e.data)||-1!==e.data.indexOf("--")||e.data.endsWith("-")))throw new Error("Comment data contains invalid characters (well-formed required).");return"\x3c!--"+e.data+"--\x3e"},e.prototype._serializeText=function(e,t){if(t&&!u.xml_isLegalChar(e.data))throw new Error("Text data contains invalid characters (well-formed required).");for(var r="",n=0;n<e.data.length;n++){var o=e.data[n];r+="&"===o?"&amp;":"<"===o?"&lt;":">"===o?"&gt;":o}return r},e.prototype._serializeDocumentFragmentNS=function(e,t,r,o,i){var a,s,l="";try{for(var u=n(e._children||e.childNodes),c=u.next();!c.done;c=u.next()){var d=c.value;l+=this._serializeNodeNS(d,t,r,o,i)}}catch(e){a={error:e}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}return l},e.prototype._serializeDocumentType=function(e,t){if(t&&!u.xml_isPubidChar(e.publicId))throw new Error("DocType public identifier does not match PubidChar construct (well-formed required).");if(t&&(!u.xml_isLegalChar(e.systemId)||-1!==e.systemId.indexOf('"')&&-1!==e.systemId.indexOf("'")))throw new Error("DocType system identifier contains invalid characters (well-formed required).");return e.publicId&&e.systemId?"<!DOCTYPE "+e.name+' PUBLIC "'+e.publicId+'" "'+e.systemId+'">':e.publicId?"<!DOCTYPE "+e.name+' PUBLIC "'+e.publicId+'">':e.systemId?"<!DOCTYPE "+e.name+' SYSTEM "'+e.systemId+'">':"<!DOCTYPE "+e.name+">"},e.prototype._serializeProcessingInstruction=function(e,t){if(t&&(-1!==e.target.indexOf(":")||/^xml$/i.test(e.target)))throw new Error("Processing instruction target contains invalid characters (well-formed required).");if(t&&(!u.xml_isLegalChar(e.data)||-1!==e.data.indexOf("?>")))throw new Error("Processing instruction data contains invalid characters (well-formed required).");return"<?"+(""===e.data?e.target:e.target+" "+e.data)+"?>"},e.prototype._serializeCData=function(e,t){if(t&&-1!==e.data.indexOf("]]>"))throw new Error("CDATA contains invalid characters (well-formed required).");return"<![CDATA["+e.data+"]]>"},e.prototype._serializeAttributesNS=function(e,t,r,o,a,s){var c,d,p="",f=s?new i.LocalNameSet:void 0;try{for(var h=n(e.attributes),m=h.next();!m.done;m=h.next()){var g=m.value;if(a||s||null!==g.namespaceURI){if(s&&f&&f.has(g.namespaceURI,g.localName))throw new Error("Element contains duplicate attributes (well-formed required).");s&&f&&f.set(g.namespaceURI,g.localName);var y=g.namespaceURI,v=null;if(null!==y)if(v=t.get(g.prefix,y),y===l.namespace.XMLNS){if(g.value===l.namespace.XML||null===g.prefix&&a||null!==g.prefix&&(!(g.localName in o)||o[g.localName]!==g.value)&&t.has(g.localName,g.value))continue;if(s&&g.value===l.namespace.XMLNS)throw new Error("XMLNS namespace is reserved (well-formed required).");if(s&&""===g.value)throw new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required).");"xmlns"===g.prefix&&(v="xmlns")}else null===v&&(p+=" xmlns:"+(v=null===g.prefix||t.hasPrefix(g.prefix)&&!t.has(g.prefix,y)?this._generatePrefix(y,t,r):g.prefix)+'="'+this._serializeAttributeValue(y,s)+'"');if(p+=" ",null!==v&&(p+=v+":"),s&&(-1!==g.localName.indexOf(":")||!u.xml_isName(g.localName)||"xmlns"===g.localName&&null===y))throw new Error("Attribute local name contains invalid characters (well-formed required).");p+=g.localName+'="'+this._serializeAttributeValue(g.value,s)+'"'}else p+=" "+g.localName+'="'+this._serializeAttributeValue(g.value,s)+'"'}}catch(e){c={error:e}}finally{try{m&&!m.done&&(d=h.return)&&d.call(h)}finally{if(c)throw c.error}}return p},e.prototype._recordNamespaceInformation=function(e,t,r){var o,i,a=null;try{for(var s=n(e.attributes),u=s.next();!u.done;u=s.next()){var c=u.value,d=c.namespaceURI,p=c.prefix;if(d===l.namespace.XMLNS){if(null===p){a=c.value;continue}var f=c.localName,h=c.value;if(h===l.namespace.XML)continue;if(""===h&&(h=null),t.has(f,h))continue;t.set(f,h),r[f]=h||""}}}catch(e){o={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return a},e.prototype._generatePrefix=function(e,t,r){var n="ns"+r.value;return r.value++,t.set(n,e),n},e.prototype._serializeAttributeValue=function(e,t){if(t&&null!==e&&!u.xml_isLegalChar(e))throw new Error("Invalid characters in attribute value.");if(null===e)return"";for(var r="",n=0;n<e.length;n++){var o=e[n];r+='"'===o?"&quot;":"&"===o?"&amp;":"<"===o?"&lt;":">"===o?"&gt;":o}return r},e.prototype._serializeElement=function(e,t){var r,o;if(t&&(-1!==e.localName.indexOf(":")||!u.xml_isName(e.localName)))throw new Error("Node local name contains invalid characters (well-formed required).");var i=!1,a=e.localName,s="<"+a;if(s+=this._serializeAttributes(e,t),0===e._children.size&&(s+="/",i=!0),s+=">",i)return s;try{for(var l=n(e._children),c=l.next();!c.done;c=l.next()){var d=c.value;s+=this._serializeNode(d,t)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}return s+"</"+a+">"},e.prototype._serializeDocument=function(e,t){var r,o;if(t&&null===e.documentElement)throw new Error("Missing document element (well-formed required).");var i="";try{for(var a=n(e._children),s=a.next();!s.done;s=a.next()){var l=s.value;i+=this._serializeNode(l,t)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i},e.prototype._serializeDocumentFragment=function(e,t){var r,o,i="";try{for(var a=n(e._children),s=a.next();!s.done;s=a.next()){var l=s.value;i+=this._serializeNode(l,t)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}return i},e.prototype._serializeAttributes=function(e,t){var r,o,i="",a=t?{}:void 0;try{for(var s=n(e.attributes),l=s.next();!l.done;l=s.next()){var c=l.value;if(t&&a&&c.localName in a)throw new Error("Element contains duplicate attributes (well-formed required).");if(t&&a&&(a[c.localName]=!0),t&&(-1!==c.localName.indexOf(":")||!u.xml_isName(c.localName)))throw new Error("Attribute local name contains invalid characters (well-formed required).");i+=" "+c.localName+'="'+this._serializeAttributeValue(c.value,t)+'"'}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i},e._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),e}();t.XMLSerializerImpl=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(277);t.XMLReader=n.XMLReader;var o=r(112);t.ObjectReader=o.ObjectReader;var i=r(280);t.JSONReader=i.JSONReader;var a=r(281);t.YAMLReader=a.YAMLReader},function(e,t,r){"use strict";r(31),r(32),r(33),r(19),r(65),r(20),r(22),r(23);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0});var s=r(180),l=r(111),u=r(7),c=r(0),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._parse=function(e,t){for(var r,n,o,d,p=new s.XMLStringLexer(t,{skipWhitespaceOnlyText:!0}),f=e,h=e,m=p.nextToken();m.type!==l.TokenType.EOF;){switch(m.type){case l.TokenType.Declaration:var g=m,y=this.sanitize(g.version);if("1.0"!==y)throw new Error("Invalid xml version: "+y);var v={version:y};g.encoding&&(v.encoding=this.sanitize(g.encoding)),g.standalone&&(v.standalone="yes"===this.sanitize(g.standalone)),h.set(v);break;case l.TokenType.DocType:var b=m;h=this.docType(h,this.sanitize(b.name),this.sanitize(b.pubId),this.sanitize(b.sysId))||h;break;case l.TokenType.CDATA:var x=m;h=this.cdata(h,this.sanitize(x.data))||h;break;case l.TokenType.Comment:var _=m;h=this.comment(h,this.sanitize(_.data))||h;break;case l.TokenType.PI:var S=m;h=this.instruction(h,this.sanitize(S.target),this.sanitize(S.data))||h;break;case l.TokenType.Text:var C=m;h=this.text(h,this._decodeText(this.sanitize(C.data)))||h;break;case l.TokenType.Element:var T=m,w=this.sanitize(T.name),A=i(c.namespace_extractQName(w),1)[0],E=h.node.lookupNamespaceURI(A),D={};try{for(var P=(r=void 0,a(T.attributes)),I=P.next();!I.done;I=P.next()){var O=i(I.value,2),N=O[0],M=O[1];if(N=this.sanitize(N),M=this.sanitize(M),"xmlns"===N)E=M;else{var R=i(c.namespace_extractQName(N),2),F=R[0],B=R[1];"xmlns"===F&&(B===A&&(E=M),D[B]=M)}}}catch(e){r={error:e}}finally{try{I&&!I.done&&(n=P.return)&&n.call(P)}finally{if(r)throw r.error}}var L=null!==E?this.element(h,E,w):this.element(h,void 0,w);if(void 0===L)break;h.node===e.node&&(f=L);try{for(var k=(o=void 0,a(T.attributes)),U=k.next();!U.done;U=k.next()){var V=i(U.value,2);N=V[0],M=V[1],N=this.sanitize(N),M=this.sanitize(M);var G=i(c.namespace_extractQName(N),2),z=(F=G[0],B=G[1],null);"xmlns"===F||null===F&&"xmlns"===B?z=u.namespace.XMLNS:null!==(z=L.node.lookupNamespaceURI(F))&&L.node.isDefaultNamespace(z)?z=null:null===z&&null!==F&&(z=D[F]||null),null!==z?this.attribute(L,z,N,this._decodeAttributeValue(M)):this.attribute(L,void 0,N,this._decodeAttributeValue(M))}}catch(e){o={error:e}}finally{try{U&&!U.done&&(d=k.return)&&d.call(k)}finally{if(o)throw o.error}}T.selfClosing||(h=L);break;case l.TokenType.ClosingTag:h.node.parentNode&&(h=h.up())}m=p.nextToken()}return f},t}(r(75).BaseReader);t.XMLReader=d},function(e,t,r){var n=r(4),o=r(279);n({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(e,t,r){"use strict";var n=r(16),o=r(8),i=r(61),a=r(85),s=r(79),l=r(27),u=r(41),c=Object.assign,d=Object.defineProperty;e.exports=!c||o(function(){if(n&&1!==c({b:1},c(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),7!=c({},e)[r]||"abcdefghijklmnopqrst"!=i(c({},t)).join("")})?function(e,t){for(var r=l(e),o=arguments.length,c=1,d=a.f,p=s.f;o>c;)for(var f,h=u(arguments[c++]),m=d?i(h).concat(d(h)):i(h),g=m.length,y=0;g>y;)f=m[y++],n&&!p.call(h,f)||(r[f]=h[f]);return r}:c},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(112),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._parse=function(e,t){return new i.ObjectReader(this._builderOptions).parse(e,JSON.parse(t))},t}(r(75).BaseReader);t.JSONReader=a},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(112),a=r(75),s=r(282),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype._parse=function(e,t){var r=s.safeLoad(t);if(void 0===r)throw new Error("Unable to parse YAML document.");return new i.ObjectReader(this._builderOptions).parse(e,r)},t}(a.BaseReader);t.YAMLReader=l},function(e,t,r){"use strict";var n=r(283);e.exports=n},function(e,t,r){"use strict";var n=r(284),o=r(303);function i(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=r(10),e.exports.Schema=r(39),e.exports.FAILSAFE_SCHEMA=r(113),e.exports.JSON_SCHEMA=r(182),e.exports.CORE_SCHEMA=r(181),e.exports.DEFAULT_SAFE_SCHEMA=r(54),e.exports.DEFAULT_FULL_SCHEMA=r(76),e.exports.load=n.load,e.exports.loadAll=n.loadAll,e.exports.safeLoad=n.safeLoad,e.exports.safeLoadAll=n.safeLoadAll,e.exports.dump=o.dump,e.exports.safeDump=o.safeDump,e.exports.YAMLException=r(53),e.exports.MINIMAL_SCHEMA=r(113),e.exports.SAFE_SCHEMA=r(54),e.exports.DEFAULT_SCHEMA=r(76),e.exports.scan=i("scan"),e.exports.parse=i("parse"),e.exports.compose=i("compose"),e.exports.addConstructor=i("addConstructor")},function(e,t,r){"use strict";var n=r(38),o=r(53),i=r(285),a=r(54),s=r(76),l=Object.prototype.hasOwnProperty,u=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,c=/[\x85\u2028\u2029]/,d=/[,\[\]\{\}]/,p=/^(?:!|!!|![a-z\-]+!)$/i,f=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function h(e){return Object.prototype.toString.call(e)}function m(e){return 10===e||13===e}function g(e){return 9===e||32===e}function y(e){return 9===e||32===e||10===e||13===e}function v(e){return 44===e||91===e||93===e||123===e||125===e}function b(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function x(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function _(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var S=new Array(256),C=new Array(256),T=0;T<256;T++)S[T]=x(T)?1:0,C[T]=x(T);function w(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||s,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function A(e,t){return new o(t,new i(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function E(e,t){throw A(e,t)}function D(e,t){e.onWarning&&e.onWarning.call(null,A(e,t))}var P={YAML:function(e,t,r){var n,o,i;null!==e.version&&E(e,"duplication of %YAML directive"),1!==r.length&&E(e,"YAML directive accepts exactly one argument"),null===(n=/^([0-9]+)\.([0-9]+)$/.exec(r[0]))&&E(e,"ill-formed argument of the YAML directive"),o=parseInt(n[1],10),i=parseInt(n[2],10),1!==o&&E(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=i<2,1!==i&&2!==i&&D(e,"unsupported YAML version of the document")},TAG:function(e,t,r){var n,o;2!==r.length&&E(e,"TAG directive accepts exactly two arguments"),n=r[0],o=r[1],p.test(n)||E(e,"ill-formed tag handle (first argument) of the TAG directive"),l.call(e.tagMap,n)&&E(e,'there is a previously declared suffix for "'+n+'" tag handle'),f.test(o)||E(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[n]=o}};function I(e,t,r,n){var o,i,a,s;if(t<r){if(s=e.input.slice(t,r),n)for(o=0,i=s.length;o<i;o+=1)9===(a=s.charCodeAt(o))||32<=a&&a<=1114111||E(e,"expected valid JSON character");else u.test(s)&&E(e,"the stream contains non-printable characters");e.result+=s}}function O(e,t,r,o){var i,a,s,u;for(n.isObject(r)||E(e,"cannot merge mappings; the provided source object is unacceptable"),s=0,u=(i=Object.keys(r)).length;s<u;s+=1)a=i[s],l.call(t,a)||(t[a]=r[a],o[a]=!0)}function N(e,t,r,n,o,i,a,s){var u,c;if(Array.isArray(o))for(u=0,c=(o=Array.prototype.slice.call(o)).length;u<c;u+=1)Array.isArray(o[u])&&E(e,"nested arrays are not supported inside keys"),"object"==typeof o&&"[object Object]"===h(o[u])&&(o[u]="[object Object]");if("object"==typeof o&&"[object Object]"===h(o)&&(o="[object Object]"),o=String(o),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(i))for(u=0,c=i.length;u<c;u+=1)O(e,t,i[u],r);else O(e,t,i,r);else e.json||l.call(r,o)||!l.call(t,o)||(e.line=a||e.line,e.position=s||e.position,E(e,"duplicated mapping key")),t[o]=i,delete r[o];return t}function M(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):E(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function R(e,t,r){for(var n=0,o=e.input.charCodeAt(e.position);0!==o;){for(;g(o);)o=e.input.charCodeAt(++e.position);if(t&&35===o)do{o=e.input.charCodeAt(++e.position)}while(10!==o&&13!==o&&0!==o);if(!m(o))break;for(M(e),o=e.input.charCodeAt(e.position),n++,e.lineIndent=0;32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position)}return-1!==r&&0!==n&&e.lineIndent<r&&D(e,"deficient indentation"),n}function F(e){var t,r=e.position;return!(45!==(t=e.input.charCodeAt(r))&&46!==t||t!==e.input.charCodeAt(r+1)||t!==e.input.charCodeAt(r+2)||(r+=3,0!==(t=e.input.charCodeAt(r))&&!y(t)))}function B(e,t){1===t?e.result+=" ":t>1&&(e.result+=n.repeat("\n",t-1))}function L(e,t){var r,n,o=e.tag,i=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),n=e.input.charCodeAt(e.position);0!==n&&45===n&&y(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,R(e,!0,-1)&&e.lineIndent<=t)a.push(null),n=e.input.charCodeAt(e.position);else if(r=e.line,V(e,t,3,!1,!0),a.push(e.result),R(e,!0,-1),n=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&0!==n)E(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=o,e.anchor=i,e.kind="sequence",e.result=a,!0)}function k(e){var t,r,n,o,i=!1,a=!1;if(33!==(o=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&E(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(i=!0,o=e.input.charCodeAt(++e.position)):33===o?(a=!0,r="!!",o=e.input.charCodeAt(++e.position)):r="!",t=e.position,i){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(n=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):E(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!y(o);)33===o&&(a?E(e,"tag suffix cannot contain exclamation marks"):(r=e.input.slice(t-1,e.position+1),p.test(r)||E(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);n=e.input.slice(t,e.position),d.test(n)&&E(e,"tag suffix cannot contain flow indicator characters")}return n&&!f.test(n)&&E(e,"tag name cannot contain such characters: "+n),i?e.tag=n:l.call(e.tagMap,r)?e.tag=e.tagMap[r]+n:"!"===r?e.tag="!"+n:"!!"===r?e.tag="tag:yaml.org,2002:"+n:E(e,'undeclared tag handle "'+r+'"'),!0}function U(e){var t,r;if(38!==(r=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&E(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!y(r)&&!v(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&E(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function V(e,t,r,o,i){var a,s,u,c,d,p,f,h,x=1,T=!1,w=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=s=u=4===r||3===r,o&&R(e,!0,-1)&&(T=!0,e.lineIndent>t?x=1:e.lineIndent===t?x=0:e.lineIndent<t&&(x=-1)),1===x)for(;k(e)||U(e);)R(e,!0,-1)?(T=!0,u=a,e.lineIndent>t?x=1:e.lineIndent===t?x=0:e.lineIndent<t&&(x=-1)):u=!1;if(u&&(u=T||i),1!==x&&4!==r||(f=1===r||2===r?t:t+1,h=e.position-e.lineStart,1===x?u&&(L(e,h)||function(e,t,r){var n,o,i,a,s,l=e.tag,u=e.anchor,c={},d={},p=null,f=null,h=null,m=!1,v=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=c),s=e.input.charCodeAt(e.position);0!==s;){if(n=e.input.charCodeAt(e.position+1),i=e.line,a=e.position,63!==s&&58!==s||!y(n)){if(!V(e,r,2,!1,!0))break;if(e.line===i){for(s=e.input.charCodeAt(e.position);g(s);)s=e.input.charCodeAt(++e.position);if(58===s)y(s=e.input.charCodeAt(++e.position))||E(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(N(e,c,d,p,f,null),p=f=h=null),v=!0,m=!1,o=!1,p=e.tag,f=e.result;else{if(!v)return e.tag=l,e.anchor=u,!0;E(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return e.tag=l,e.anchor=u,!0;E(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(m&&(N(e,c,d,p,f,null),p=f=h=null),v=!0,m=!0,o=!0):m?(m=!1,o=!0):E(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=n;if((e.line===i||e.lineIndent>t)&&(V(e,t,4,!0,o)&&(m?f=e.result:h=e.result),m||(N(e,c,d,p,f,h,i,a),p=f=h=null),R(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)E(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return m&&N(e,c,d,p,f,null),v&&(e.tag=l,e.anchor=u,e.kind="mapping",e.result=c),v}(e,h,f))||function(e,t){var r,n,o,i,a,s,l,u,c,d,p=!0,f=e.tag,h=e.anchor,m={};if(91===(d=e.input.charCodeAt(e.position)))o=93,s=!1,n=[];else{if(123!==d)return!1;o=125,s=!0,n={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=n),d=e.input.charCodeAt(++e.position);0!==d;){if(R(e,!0,t),(d=e.input.charCodeAt(e.position))===o)return e.position++,e.tag=f,e.anchor=h,e.kind=s?"mapping":"sequence",e.result=n,!0;p||E(e,"missed comma between flow collection entries"),c=null,i=a=!1,63===d&&y(e.input.charCodeAt(e.position+1))&&(i=a=!0,e.position++,R(e,!0,t)),r=e.line,V(e,t,1,!1,!0),u=e.tag,l=e.result,R(e,!0,t),d=e.input.charCodeAt(e.position),!a&&e.line!==r||58!==d||(i=!0,d=e.input.charCodeAt(++e.position),R(e,!0,t),V(e,t,1,!1,!0),c=e.result),s?N(e,n,m,u,l,c):i?n.push(N(e,null,m,u,l,c)):n.push(l),R(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(p=!0,d=e.input.charCodeAt(++e.position)):p=!1}E(e,"unexpected end of the stream within a flow collection")}(e,f)?w=!0:(s&&function(e,t){var r,o,i,a,s,l=1,u=!1,c=!1,d=t,p=0,f=!1;if(124===(a=e.input.charCodeAt(e.position)))o=!1;else{if(62!==a)return!1;o=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)1===l?l=43===a?3:2:E(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===i?E(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?E(e,"repeat of an indentation width identifier"):(d=t+i-1,c=!0)}if(g(a)){do{a=e.input.charCodeAt(++e.position)}while(g(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!m(a)&&0!==a)}for(;0!==a;){for(M(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!c||e.lineIndent<d)&&32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>d&&(d=e.lineIndent),m(a))p++;else{if(e.lineIndent<d){3===l?e.result+=n.repeat("\n",u?1+p:p):1===l&&u&&(e.result+="\n");break}for(o?g(a)?(f=!0,e.result+=n.repeat("\n",u?1+p:p)):f?(f=!1,e.result+=n.repeat("\n",p+1)):0===p?u&&(e.result+=" "):e.result+=n.repeat("\n",p):e.result+=n.repeat("\n",u?1+p:p),u=!0,c=!0,p=0,r=e.position;!m(a)&&0!==a;)a=e.input.charCodeAt(++e.position);I(e,r,e.position,!1)}}return!0}(e,f)||function(e,t){var r,n,o;if(39!==(r=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;0!==(r=e.input.charCodeAt(e.position));)if(39===r){if(I(e,n,e.position,!0),39!==(r=e.input.charCodeAt(++e.position)))return!0;n=e.position,e.position++,o=e.position}else m(r)?(I(e,n,o,!0),B(e,R(e,!1,t)),n=o=e.position):e.position===e.lineStart&&F(e)?E(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);E(e,"unexpected end of the stream within a single quoted scalar")}(e,f)||function(e,t){var r,n,o,i,a,s,l;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=n=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return I(e,r,e.position,!0),e.position++,!0;if(92===s){if(I(e,r,e.position,!0),m(s=e.input.charCodeAt(++e.position)))R(e,!1,t);else if(s<256&&S[s])e.result+=C[s],e.position++;else if((a=120===(l=s)?2:117===l?4:85===l?8:0)>0){for(o=a,i=0;o>0;o--)(a=b(s=e.input.charCodeAt(++e.position)))>=0?i=(i<<4)+a:E(e,"expected hexadecimal character");e.result+=_(i),e.position++}else E(e,"unknown escape sequence");r=n=e.position}else m(s)?(I(e,r,n,!0),B(e,R(e,!1,t)),r=n=e.position):e.position===e.lineStart&&F(e)?E(e,"unexpected end of the document within a double quoted scalar"):(e.position++,n=e.position)}E(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?w=!0:function(e){var t,r,n;if(42!==(n=e.input.charCodeAt(e.position)))return!1;for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!y(n)&&!v(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&E(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(r)||E(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],R(e,!0,-1),!0}(e)?(w=!0,null===e.tag&&null===e.anchor||E(e,"alias node should not have any properties")):function(e,t,r){var n,o,i,a,s,l,u,c,d=e.kind,p=e.result;if(y(c=e.input.charCodeAt(e.position))||v(c)||35===c||38===c||42===c||33===c||124===c||62===c||39===c||34===c||37===c||64===c||96===c)return!1;if((63===c||45===c)&&(y(n=e.input.charCodeAt(e.position+1))||r&&v(n)))return!1;for(e.kind="scalar",e.result="",o=i=e.position,a=!1;0!==c;){if(58===c){if(y(n=e.input.charCodeAt(e.position+1))||r&&v(n))break}else if(35===c){if(y(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&F(e)||r&&v(c))break;if(m(c)){if(s=e.line,l=e.lineStart,u=e.lineIndent,R(e,!1,-1),e.lineIndent>=t){a=!0,c=e.input.charCodeAt(e.position);continue}e.position=i,e.line=s,e.lineStart=l,e.lineIndent=u;break}}a&&(I(e,o,i,!1),B(e,e.line-s),o=i=e.position,a=!1),g(c)||(i=e.position+1),c=e.input.charCodeAt(++e.position)}return I(e,o,i,!1),!!e.result||(e.kind=d,e.result=p,!1)}(e,f,1===r)&&(w=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===x&&(w=u&&L(e,h))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&E(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,d=e.implicitTypes.length;c<d;c+=1)if((p=e.implicitTypes[c]).resolve(e.result)){e.result=p.construct(e.result),e.tag=p.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else l.call(e.typeMap[e.kind||"fallback"],e.tag)?(p=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&p.kind!==e.kind&&E(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result)?(e.result=p.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):E(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):E(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||w}function G(e){var t,r,n,o,i=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(o=e.input.charCodeAt(e.position))&&(R(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==o));){for(a=!0,o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!y(o);)o=e.input.charCodeAt(++e.position);for(n=[],(r=e.input.slice(t,e.position)).length<1&&E(e,"directive name must not be less than one character in length");0!==o;){for(;g(o);)o=e.input.charCodeAt(++e.position);if(35===o){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&!m(o));break}if(m(o))break;for(t=e.position;0!==o&&!y(o);)o=e.input.charCodeAt(++e.position);n.push(e.input.slice(t,e.position))}0!==o&&M(e),l.call(P,r)?P[r](e,r,n):D(e,'unknown document directive "'+r+'"')}R(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,R(e,!0,-1)):a&&E(e,"directives end mark is expected"),V(e,e.lineIndent-1,4,!1,!0),R(e,!0,-1),e.checkLineBreaks&&c.test(e.input.slice(i,e.position))&&D(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&F(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,R(e,!0,-1)):e.position<e.length-1&&E(e,"end of the stream or a document separator is expected")}function z(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var r=new w(e,t),n=e.indexOf("\0");for(-1!==n&&(r.position=n,E(r,"null byte is not allowed in input")),r.input+="\0";32===r.input.charCodeAt(r.position);)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)G(r);return r.documents}function j(e,t,r){null!==t&&"object"==typeof t&&void 0===r&&(r=t,t=null);var n=z(e,r);if("function"!=typeof t)return n;for(var o=0,i=n.length;o<i;o+=1)t(n[o])}function W(e,t){var r=z(e,t);if(0!==r.length){if(1===r.length)return r[0];throw new o("expected a single document in the stream, but found more")}}e.exports.loadAll=j,e.exports.load=W,e.exports.safeLoadAll=function(e,t,r){return"object"==typeof t&&null!==t&&void 0===r&&(r=t,t=null),j(e,t,n.extend({schema:a},r))},e.exports.safeLoad=function(e,t){return W(e,n.extend({schema:a},t))}},function(e,t,r){"use strict";var n=r(38);function o(e,t,r,n,o){this.name=e,this.buffer=t,this.position=r,this.line=n,this.column=o}o.prototype.getSnippet=function(e,t){var r,o,i,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,r="",o=this.position;o>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(o-1));)if(o-=1,this.position-o>t/2-1){r=" ... ",o+=5;break}for(i="",a=this.position;a<this.buffer.length&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(a));)if((a+=1)-this.position>t/2-1){i=" ... ",a-=5;break}return s=this.buffer.slice(o,a),n.repeat(" ",e)+r+s+i+"\n"+n.repeat(" ",e+this.position-o+r.length)+"^"},o.prototype.toString=function(e){var t,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(r+=":\n"+t),r},e.exports=o},function(e,t,r){"use strict";var n=r(10);e.exports=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},function(e,t,r){"use strict";var n=r(10);e.exports=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},function(e,t,r){"use strict";var n=r(10);e.exports=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},function(e,t,r){"use strict";var n=r(10);e.exports=new n("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},function(e,t,r){"use strict";var n=r(10);e.exports=new n("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},function(e,t,r){"use strict";var n=r(38),o=r(10);function i(e){return 48<=e&&e<=55}function a(e){return 48<=e&&e<=57}e.exports=new o("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,r,n=e.length,o=0,s=!1;if(!n)return!1;if("-"!==(t=e[o])&&"+"!==t||(t=e[++o]),"0"===t){if(o+1===n)return!0;if("b"===(t=e[++o])){for(o++;o<n;o++)if("_"!==(t=e[o])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(o++;o<n;o++)if("_"!==(t=e[o])){if(!(48<=(r=e.charCodeAt(o))&&r<=57||65<=r&&r<=70||97<=r&&r<=102))return!1;s=!0}return s&&"_"!==t}for(;o<n;o++)if("_"!==(t=e[o])){if(!i(e.charCodeAt(o)))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;o<n;o++)if("_"!==(t=e[o])){if(":"===t)break;if(!a(e.charCodeAt(o)))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(o)))},construct:function(e){var t,r,n=e,o=1,i=[];return-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(o=-1),t=(n=n.slice(1))[0]),"0"===n?0:"0"===t?"b"===n[1]?o*parseInt(n.slice(2),2):"x"===n[1]?o*parseInt(n,16):o*parseInt(n,8):-1!==n.indexOf(":")?(n.split(":").forEach(function(e){i.unshift(parseInt(e,10))}),n=0,r=1,i.forEach(function(e){n+=e*r,r*=60}),o*n):o*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!n.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},function(e,t,r){"use strict";var n=r(38),o=r(10),i=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),a=/^[-+]?[0-9]+e/;e.exports=new o("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!i.test(e)||"_"===e[e.length-1])},construct:function(e){var t,r,n,o;return r="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,o=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===r?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){o.unshift(parseFloat(e,10))}),t=0,n=1,o.forEach(function(e){t+=e*n,n*=60}),r*t):r*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||n.isNegativeZero(e))},represent:function(e,t){var r;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(n.isNegativeZero(e))return"-0.0";return r=e.toString(10),a.test(r)?r.replace("e",".e"):r},defaultStyle:"lowercase"})},function(e,t,r){"use strict";var n=r(10),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new n("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==o.exec(e)||null!==i.exec(e))},construct:function(e){var t,r,n,a,s,l,u,c,d=0,p=null;if(null===(t=o.exec(e))&&(t=i.exec(e)),null===t)throw new Error("Date resolve error");if(r=+t[1],n=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(r,n,a));if(s=+t[4],l=+t[5],u=+t[6],t[7]){for(d=t[7].slice(0,3);d.length<3;)d+="0";d=+d}return t[9]&&(p=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(p=-p)),c=new Date(Date.UTC(r,n,a,s,l,u,d)),p&&c.setTime(c.getTime()-p),c},instanceOf:Date,represent:function(e){return e.toISOString()}})},function(e,t,r){"use strict";var n=r(10);e.exports=new n("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},function(e,t,r){"use strict";var n;try{n=r(145).Buffer}catch(e){}var o=r(10),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new o("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,r,n=0,o=e.length,a=i;for(r=0;r<o;r++)if(!((t=a.indexOf(e.charAt(r)))>64)){if(t<0)return!1;n+=6}return n%8==0},construct:function(e){var t,r,o=e.replace(/[\r\n=]/g,""),a=o.length,s=i,l=0,u=[];for(t=0;t<a;t++)t%4==0&&t&&(u.push(l>>16&255),u.push(l>>8&255),u.push(255&l)),l=l<<6|s.indexOf(o.charAt(t));return 0==(r=a%4*6)?(u.push(l>>16&255),u.push(l>>8&255),u.push(255&l)):18===r?(u.push(l>>10&255),u.push(l>>2&255)):12===r&&u.push(l>>4&255),n?n.from?n.from(u):new n(u):u},predicate:function(e){return n&&n.isBuffer(e)},represent:function(e){var t,r,n="",o=0,a=e.length,s=i;for(t=0;t<a;t++)t%3==0&&t&&(n+=s[o>>18&63],n+=s[o>>12&63],n+=s[o>>6&63],n+=s[63&o]),o=(o<<8)+e[t];return 0==(r=a%3)?(n+=s[o>>18&63],n+=s[o>>12&63],n+=s[o>>6&63],n+=s[63&o]):2===r?(n+=s[o>>10&63],n+=s[o>>4&63],n+=s[o<<2&63],n+=s[64]):1===r&&(n+=s[o>>2&63],n+=s[o<<4&63],n+=s[64],n+=s[64]),n}})},function(e,t,r){"use strict";var n=r(10),o=Object.prototype.hasOwnProperty,i=Object.prototype.toString;e.exports=new n("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,r,n,a,s,l=[],u=e;for(t=0,r=u.length;t<r;t+=1){if(n=u[t],s=!1,"[object Object]"!==i.call(n))return!1;for(a in n)if(o.call(n,a)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==l.indexOf(a))return!1;l.push(a)}return!0},construct:function(e){return null!==e?e:[]}})},function(e,t,r){"use strict";var n=r(10),o=Object.prototype.toString;e.exports=new n("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,r,n,i,a,s=e;for(a=new Array(s.length),t=0,r=s.length;t<r;t+=1){if(n=s[t],"[object Object]"!==o.call(n))return!1;if(1!==(i=Object.keys(n)).length)return!1;a[t]=[i[0],n[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,r,n,o,i,a=e;for(i=new Array(a.length),t=0,r=a.length;t<r;t+=1)n=a[t],o=Object.keys(n),i[t]=[o[0],n[o[0]]];return i}})},function(e,t,r){"use strict";var n=r(10),o=Object.prototype.hasOwnProperty;e.exports=new n("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,r=e;for(t in r)if(o.call(r,t)&&null!==r[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},function(e,t,r){"use strict";var n=r(10);e.exports=new n("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},function(e,t,r){"use strict";var n=r(10);e.exports=new n("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,r=/\/([gim]*)$/.exec(e),n="";if("/"===t[0]){if(r&&(n=r[1]),n.length>3)return!1;if("/"!==t[t.length-n.length-1])return!1}return!0},construct:function(e){var t=e,r=/\/([gim]*)$/.exec(e),n="";return"/"===t[0]&&(r&&(n=r[1]),t=t.slice(1,t.length-n.length-1)),new RegExp(t,n)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},function(e,t,r){"use strict";var n;try{n=r(302)}catch(e){"undefined"!=typeof window&&(n=window.esprima)}var o=r(10);e.exports=new o("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",r=n.parse(t,{range:!0});return"Program"===r.type&&1===r.body.length&&"ExpressionStatement"===r.body[0].type&&("ArrowFunctionExpression"===r.body[0].expression.type||"FunctionExpression"===r.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,r="("+e+")",o=n.parse(r,{range:!0}),i=[];if("Program"!==o.type||1!==o.body.length||"ExpressionStatement"!==o.body[0].type||"ArrowFunctionExpression"!==o.body[0].expression.type&&"FunctionExpression"!==o.body[0].expression.type)throw new Error("Failed to resolve function");return o.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=o.body[0].expression.body.range,"BlockStatement"===o.body[0].expression.body.type?new Function(i,r.slice(t[0]+1,t[1]-1)):new Function(i,"return "+r.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},function(e,t,r){var n;n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(3),i=r(8),a=r(15);function s(e,t,r){var a=null,s=function(e,t){r&&r(e,t),a&&a.visit(e,t)},l="function"==typeof r?s:null,u=!1;if(t){u="boolean"==typeof t.comment&&t.comment;var c="boolean"==typeof t.attachComment&&t.attachComment;(u||c)&&((a=new n.CommentHandler).attach=c,t.comment=!0,l=s)}var d,p=!1;t&&"string"==typeof t.sourceType&&(p="module"===t.sourceType),d=t&&"boolean"==typeof t.jsx&&t.jsx?new o.JSXParser(e,t,l):new i.Parser(e,t,l);var f=p?d.parseModule():d.parseScript();return u&&a&&(f.comments=a.comments),d.config.tokens&&(f.tokens=d.tokens),d.config.tolerant&&(f.errors=d.errorHandler.errors),f}t.parse=s,t.parseModule=function(e,t,r){var n=t||{};return n.sourceType="module",s(e,n,r)},t.parseScript=function(e,t,r){var n=t||{};return n.sourceType="script",s(e,n,r)},t.tokenize=function(e,t,r){var n,o=new a.Tokenizer(e,t);n=[];try{for(;;){var i=o.getNextToken();if(!i)break;r&&(i=r(i)),n.push(i)}}catch(e){o.errorHandler.tolerate(e)}return o.errorHandler.tolerant&&(n.errors=o.errors()),n};var l=r(2);t.Syntax=l.Syntax,t.version="4.0.1"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===n.Syntax.BlockStatement&&0===e.body.length){for(var r=[],o=this.leading.length-1;o>=0;--o){var i=this.leading[o];t.end.offset>=i.start&&(r.unshift(i.comment),this.leading.splice(o,1),this.trailing.splice(o,1))}r.length&&(e.innerComments=r)}},e.prototype.findTrailingComments=function(e){var t=[];if(this.trailing.length>0){for(var r=this.trailing.length-1;r>=0;--r){var n=this.trailing[r];n.start>=e.end.offset&&t.unshift(n.comment)}return this.trailing.length=0,t}var o=this.stack[this.stack.length-1];if(o&&o.node.trailingComments){var i=o.node.trailingComments[0];i&&i.range[0]>=e.end.offset&&(t=o.node.trailingComments,delete o.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t,r=[];this.stack.length>0&&(i=this.stack[this.stack.length-1])&&i.start>=e.start.offset;)t=i.node,this.stack.pop();if(t){for(var n=(t.leadingComments?t.leadingComments.length:0)-1;n>=0;--n){var o=t.leadingComments[n];o.range[1]<=e.start.offset&&(r.unshift(o),t.leadingComments.splice(n,1))}return t.leadingComments&&0===t.leadingComments.length&&delete t.leadingComments,r}for(n=this.leading.length-1;n>=0;--n){var i;(i=this.leading[n]).start<=e.start.offset&&(r.unshift(i.comment),this.leading.splice(n,1))}return r},e.prototype.visitNode=function(e,t){if(!(e.type===n.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var r=this.findTrailingComments(t),o=this.findLeadingComments(t);o.length>0&&(e.leadingComments=o),r.length>0&&(e.trailingComments=r),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var r="L"===e.type[0]?"Line":"Block",n={type:r,value:e.value};if(e.range&&(n.range=e.range),e.loc&&(n.loc=e.loc),this.comments.push(n),this.attach){var o={comment:{type:r,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(o.comment.loc=e.loc),e.type=r,this.leading.push(o),this.trailing.push(o)}},e.prototype.visit=function(e,t){"LineComment"===e.type||"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=r(4),a=r(5),s=r(6),l=r(7),u=r(8),c=r(13),d=r(14);function p(e){var t;switch(e.type){case s.JSXSyntax.JSXIdentifier:t=e.name;break;case s.JSXSyntax.JSXNamespacedName:var r=e;t=p(r.namespace)+":"+p(r.name);break;case s.JSXSyntax.JSXMemberExpression:var n=e;t=p(n.object)+"."+p(n.property)}return t}c.TokenName[100]="JSXIdentifier",c.TokenName[101]="JSXText";var f=function(e){function t(t,r,n){return e.call(this,t,r,n)||this}return o(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",r=!0,n=!1,o=!1,a=!1;!this.scanner.eof()&&r&&!n;){var s=this.scanner.source[this.scanner.index];if(s===e)break;if(n=";"===s,t+=s,++this.scanner.index,!n)switch(t.length){case 2:o="#"===s;break;case 3:o&&(r=(a="x"===s)||i.Character.isDecimalDigit(s.charCodeAt(0)),o=o&&!a);break;default:r=(r=r&&!(o&&!i.Character.isDecimalDigit(s.charCodeAt(0))))&&!(a&&!i.Character.isHexDigit(s.charCodeAt(0)))}}if(r&&n&&t.length>2){var l=t.substr(1,t.length-2);o&&l.length>1?t=String.fromCharCode(parseInt(l.substr(1),10)):a&&l.length>2?t=String.fromCharCode(parseInt("0"+l.substr(1),16)):o||a||!d.XHTMLEntities[l]||(t=d.XHTMLEntities[l])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e)return{type:7,value:s=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===e||39===e){for(var t=this.scanner.index,r=this.scanner.source[this.scanner.index++],n="";!this.scanner.eof()&&(l=this.scanner.source[this.scanner.index++])!==r;)n+="&"===l?this.scanXHTMLEntity(r):l;return{type:8,value:n,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(46===e){var o=this.scanner.source.charCodeAt(this.scanner.index+1),a=this.scanner.source.charCodeAt(this.scanner.index+2),s=46===o&&46===a?"...":".";return t=this.scanner.index,this.scanner.index+=s.length,{type:7,value:s,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(i.Character.isIdentifierStart(e)&&92!==e){for(t=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var l=this.scanner.source.charCodeAt(this.scanner.index);if(i.Character.isIdentifierPart(l)&&92!==l)++this.scanner.index;else{if(45!==l)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(t,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}return this.scanner.lex()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var r=this.scanner.source[this.scanner.index];if("{"===r||"<"===r)break;++this.scanner.index,t+=r,i.Character.isLineTerminator(r.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===r&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var n={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(n)),n},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new a.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=t;this.expectJSX(":");var n=this.parseJSXIdentifier();t=this.finalize(e,new a.JSXNamespacedName(r,n))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var o=t;this.expectJSX(".");var i=this.parseJSXIdentifier();t=this.finalize(e,new a.JSXMemberExpression(o,i))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),r=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=r;this.expectJSX(":");var o=this.parseJSXIdentifier();e=this.finalize(t,new a.JSXNamespacedName(n,o))}else e=r;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var r=this.getTokenRaw(t);return this.finalize(e,new l.Literal(t.value,r))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new a.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),r=null;return this.matchJSX("=")&&(this.expectJSX("="),r=this.parseJSXAttributeValue()),this.finalize(e,new a.JSXAttribute(t,r))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new a.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),r=this.parseJSXAttributes(),n=this.matchJSX("/");return n&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new a.JSXOpeningElement(t,n,r))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new a.JSXClosingElement(t))}var r=this.parseJSXElementName(),n=this.parseJSXAttributes(),o=this.matchJSX("/");return o&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new a.JSXOpeningElement(r,o,n))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new a.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e,t=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(e=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),e=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(t,new a.JSXExpressionContainer(e))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),r=this.nextJSXText();if(r.start<r.end){var n=this.getTokenRaw(r),o=this.finalize(t,new a.JSXText(r.value,n));e.push(o)}if("{"!==this.scanner.source[this.scanner.index])break;var i=this.parseJSXExpressionContainer();e.push(i)}return e},t.prototype.parseComplexJSXElement=function(e){for(var t=[];!this.scanner.eof();){e.children=e.children.concat(this.parseJSXChildren());var r=this.createJSXChildNode(),n=this.parseJSXBoundaryElement();if(n.type===s.JSXSyntax.JSXOpeningElement){var o=n;if(o.selfClosing){var i=this.finalize(r,new a.JSXElement(o,[],null));e.children.push(i)}else t.push(e),e={node:r,opening:o,closing:null,children:[]}}if(n.type===s.JSXSyntax.JSXClosingElement){e.closing=n;var l=p(e.opening.name);if(l!==p(e.closing.name)&&this.tolerateError("Expected corresponding JSX closing tag for %0",l),!(t.length>0))break;i=this.finalize(e.node,new a.JSXElement(e.opening,e.children,e.closing)),(e=t[t.length-1]).children.push(i),t.pop()}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),r=[],n=null;if(!t.selfClosing){var o=this.parseComplexJSXElement({node:e,opening:t,closing:n,children:r});r=o.children,n=o.closing}return this.finalize(e,new a.JSXElement(t,r,n))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(u.Parser);t.JSXParser=f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={NonAsciiIdentifierStart:/[\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-\u08B4\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\u0AF9\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-\u0C5A\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\u0D5F-\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-\u13F5\u13F8-\u13FD\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\u19B0-\u19C9\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\u2118-\u211D\u2124\u2126\u2128\u212A-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\uAB70-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\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-\u08B4\u08E3-\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\u0AF9\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-\u0C5A\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\u0D5F-\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\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\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-\u19DA\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\u2118-\u211D\u2124\u2126\u2128\u212A-\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\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\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-\uAB65\uAB70-\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-\uFE2F\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&r.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&r.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6);t.JSXClosingElement=function(e){this.type=n.JSXSyntax.JSXClosingElement,this.name=e};t.JSXElement=function(e,t,r){this.type=n.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=r};t.JSXEmptyExpression=function(){this.type=n.JSXSyntax.JSXEmptyExpression};t.JSXExpressionContainer=function(e){this.type=n.JSXSyntax.JSXExpressionContainer,this.expression=e};t.JSXIdentifier=function(e){this.type=n.JSXSyntax.JSXIdentifier,this.name=e};t.JSXMemberExpression=function(e,t){this.type=n.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t};t.JSXAttribute=function(e,t){this.type=n.JSXSyntax.JSXAttribute,this.name=e,this.value=t};t.JSXNamespacedName=function(e,t){this.type=n.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t};t.JSXOpeningElement=function(e,t,r){this.type=n.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=r};t.JSXSpreadAttribute=function(e){this.type=n.JSXSyntax.JSXSpreadAttribute,this.argument=e};t.JSXText=function(e,t){this.type=n.JSXSyntax.JSXText,this.value=e,this.raw=t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.ArrayExpression=function(e){this.type=n.Syntax.ArrayExpression,this.elements=e};t.ArrayPattern=function(e){this.type=n.Syntax.ArrayPattern,this.elements=e};t.ArrowFunctionExpression=function(e,t,r){this.type=n.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=r,this.async=!1};t.AssignmentExpression=function(e,t,r){this.type=n.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=r};t.AssignmentPattern=function(e,t){this.type=n.Syntax.AssignmentPattern,this.left=e,this.right=t};t.AsyncArrowFunctionExpression=function(e,t,r){this.type=n.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=r,this.async=!0};t.AsyncFunctionDeclaration=function(e,t,r){this.type=n.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=r,this.generator=!1,this.expression=!1,this.async=!0};t.AsyncFunctionExpression=function(e,t,r){this.type=n.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=r,this.generator=!1,this.expression=!1,this.async=!0};t.AwaitExpression=function(e){this.type=n.Syntax.AwaitExpression,this.argument=e};t.BinaryExpression=function(e,t,r){var o="||"===e||"&&"===e;this.type=o?n.Syntax.LogicalExpression:n.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=r};t.BlockStatement=function(e){this.type=n.Syntax.BlockStatement,this.body=e};t.BreakStatement=function(e){this.type=n.Syntax.BreakStatement,this.label=e};t.CallExpression=function(e,t){this.type=n.Syntax.CallExpression,this.callee=e,this.arguments=t};t.CatchClause=function(e,t){this.type=n.Syntax.CatchClause,this.param=e,this.body=t};t.ClassBody=function(e){this.type=n.Syntax.ClassBody,this.body=e};t.ClassDeclaration=function(e,t,r){this.type=n.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=r};t.ClassExpression=function(e,t,r){this.type=n.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=r};t.ComputedMemberExpression=function(e,t){this.type=n.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t};t.ConditionalExpression=function(e,t,r){this.type=n.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=r};t.ContinueStatement=function(e){this.type=n.Syntax.ContinueStatement,this.label=e};t.DebuggerStatement=function(){this.type=n.Syntax.DebuggerStatement};t.Directive=function(e,t){this.type=n.Syntax.ExpressionStatement,this.expression=e,this.directive=t};t.DoWhileStatement=function(e,t){this.type=n.Syntax.DoWhileStatement,this.body=e,this.test=t};t.EmptyStatement=function(){this.type=n.Syntax.EmptyStatement};t.ExportAllDeclaration=function(e){this.type=n.Syntax.ExportAllDeclaration,this.source=e};t.ExportDefaultDeclaration=function(e){this.type=n.Syntax.ExportDefaultDeclaration,this.declaration=e};t.ExportNamedDeclaration=function(e,t,r){this.type=n.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=r};t.ExportSpecifier=function(e,t){this.type=n.Syntax.ExportSpecifier,this.exported=t,this.local=e};t.ExpressionStatement=function(e){this.type=n.Syntax.ExpressionStatement,this.expression=e};t.ForInStatement=function(e,t,r){this.type=n.Syntax.ForInStatement,this.left=e,this.right=t,this.body=r,this.each=!1};t.ForOfStatement=function(e,t,r){this.type=n.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=r};t.ForStatement=function(e,t,r,o){this.type=n.Syntax.ForStatement,this.init=e,this.test=t,this.update=r,this.body=o};t.FunctionDeclaration=function(e,t,r,o){this.type=n.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=r,this.generator=o,this.expression=!1,this.async=!1};t.FunctionExpression=function(e,t,r,o){this.type=n.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=r,this.generator=o,this.expression=!1,this.async=!1};t.Identifier=function(e){this.type=n.Syntax.Identifier,this.name=e};t.IfStatement=function(e,t,r){this.type=n.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=r};t.ImportDeclaration=function(e,t){this.type=n.Syntax.ImportDeclaration,this.specifiers=e,this.source=t};t.ImportDefaultSpecifier=function(e){this.type=n.Syntax.ImportDefaultSpecifier,this.local=e};t.ImportNamespaceSpecifier=function(e){this.type=n.Syntax.ImportNamespaceSpecifier,this.local=e};t.ImportSpecifier=function(e,t){this.type=n.Syntax.ImportSpecifier,this.local=e,this.imported=t};t.LabeledStatement=function(e,t){this.type=n.Syntax.LabeledStatement,this.label=e,this.body=t};t.Literal=function(e,t){this.type=n.Syntax.Literal,this.value=e,this.raw=t};t.MetaProperty=function(e,t){this.type=n.Syntax.MetaProperty,this.meta=e,this.property=t};t.MethodDefinition=function(e,t,r,o,i){this.type=n.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=r,this.kind=o,this.static=i};t.Module=function(e){this.type=n.Syntax.Program,this.body=e,this.sourceType="module"};t.NewExpression=function(e,t){this.type=n.Syntax.NewExpression,this.callee=e,this.arguments=t};t.ObjectExpression=function(e){this.type=n.Syntax.ObjectExpression,this.properties=e};t.ObjectPattern=function(e){this.type=n.Syntax.ObjectPattern,this.properties=e};t.Property=function(e,t,r,o,i,a){this.type=n.Syntax.Property,this.key=t,this.computed=r,this.value=o,this.kind=e,this.method=i,this.shorthand=a};t.RegexLiteral=function(e,t,r,o){this.type=n.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:r,flags:o}};t.RestElement=function(e){this.type=n.Syntax.RestElement,this.argument=e};t.ReturnStatement=function(e){this.type=n.Syntax.ReturnStatement,this.argument=e};t.Script=function(e){this.type=n.Syntax.Program,this.body=e,this.sourceType="script"};t.SequenceExpression=function(e){this.type=n.Syntax.SequenceExpression,this.expressions=e};t.SpreadElement=function(e){this.type=n.Syntax.SpreadElement,this.argument=e};t.StaticMemberExpression=function(e,t){this.type=n.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t};t.Super=function(){this.type=n.Syntax.Super};t.SwitchCase=function(e,t){this.type=n.Syntax.SwitchCase,this.test=e,this.consequent=t};t.SwitchStatement=function(e,t){this.type=n.Syntax.SwitchStatement,this.discriminant=e,this.cases=t};t.TaggedTemplateExpression=function(e,t){this.type=n.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t};t.TemplateElement=function(e,t){this.type=n.Syntax.TemplateElement,this.value=e,this.tail=t};t.TemplateLiteral=function(e,t){this.type=n.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t};t.ThisExpression=function(){this.type=n.Syntax.ThisExpression};t.ThrowStatement=function(e){this.type=n.Syntax.ThrowStatement,this.argument=e};t.TryStatement=function(e,t,r){this.type=n.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=r};t.UnaryExpression=function(e,t){this.type=n.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0};t.UpdateExpression=function(e,t,r){this.type=n.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=r};t.VariableDeclaration=function(e,t){this.type=n.Syntax.VariableDeclaration,this.declarations=e,this.kind=t};t.VariableDeclarator=function(e,t){this.type=n.Syntax.VariableDeclarator,this.id=e,this.init=t};t.WhileStatement=function(e,t){this.type=n.Syntax.WhileStatement,this.test=e,this.body=t};t.WithStatement=function(e,t){this.type=n.Syntax.WithStatement,this.object=e,this.body=t};t.YieldExpression=function(e,t){this.type=n.Syntax.YieldExpression,this.argument=e,this.delegate=t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),o=r(10),i=r(11),a=r(7),s=r(12),l=r(2),u=r(13),c=function(){function e(e,t,r){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=r,this.errorHandler=new o.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new s.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=Array.prototype.slice.call(arguments,1),i=e.replace(/%(\d)/g,function(e,t){return n.assert(t<o.length,"Message reference must be in range"),o[t]}),a=this.lastMarker.index,s=this.lastMarker.line,l=this.lastMarker.column+1;throw this.errorHandler.createError(a,s,l,i)},e.prototype.tolerateError=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var o=Array.prototype.slice.call(arguments,1),i=e.replace(/%(\d)/g,function(e,t){return n.assert(t<o.length,"Message reference must be in range"),o[t]}),a=this.lastMarker.index,s=this.scanner.lineNumber,l=this.lastMarker.column+1;this.errorHandler.tolerateError(a,s,l,i)},e.prototype.unexpectedTokenError=function(e,t){var r,n=t||i.Messages.UnexpectedToken;if(e?(t||(n=2===e.type?i.Messages.UnexpectedEOS:3===e.type?i.Messages.UnexpectedIdentifier:6===e.type?i.Messages.UnexpectedNumber:8===e.type?i.Messages.UnexpectedString:10===e.type?i.Messages.UnexpectedTemplate:i.Messages.UnexpectedToken,4===e.type&&(this.scanner.isFutureReservedWord(e.value)?n=i.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(e.value)&&(n=i.Messages.StrictReservedWord))),r=e.value):r="ILLEGAL",n=n.replace("%0",r),e&&"number"==typeof e.lineNumber){var o=e.start,a=e.lineNumber,s=this.lastMarker.index-this.lastMarker.column,l=e.start-s+1;return this.errorHandler.createError(o,a,l,n)}return o=this.lastMarker.index,a=this.lastMarker.line,l=this.lastMarker.column+1,this.errorHandler.createError(o,a,l,n)},e.prototype.throwUnexpectedToken=function(e,t){throw this.unexpectedTokenError(e,t)},e.prototype.tolerateUnexpectedToken=function(e,t){this.errorHandler.tolerate(this.unexpectedTokenError(e,t))},e.prototype.collectComments=function(){if(this.config.comment){var e=this.scanner.scanComments();if(e.length>0&&this.delegate)for(var t=0;t<e.length;++t){var r=e[t],n=void 0;n={type:r.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(r.slice[0],r.slice[1])},this.config.range&&(n.range=r.range),this.config.loc&&(n.loc=r.loc);var o={start:{line:r.loc.start.line,column:r.loc.start.column,offset:r.range[0]},end:{line:r.loc.end.line,column:r.loc.end.column,offset:r.range[1]}};this.delegate(n,o)}}else this.scanner.scanComments()},e.prototype.getTokenRaw=function(e){return this.scanner.source.slice(e.start,e.end)},e.prototype.convertToken=function(e){var t={type:u.TokenName[e.type],value:this.getTokenRaw(e)};if(this.config.range&&(t.range=[e.start,e.end]),this.config.loc&&(t.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),9===e.type){var r=e.pattern,n=e.flags;t.regex={pattern:r,flags:n}}return t},e.prototype.nextToken=function(){var e=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var t=this.scanner.lex();return this.hasLineTerminator=e.lineNumber!==t.lineNumber,t&&this.context.strict&&3===t.type&&this.scanner.isStrictModeReservedWord(t.value)&&(t.type=4),this.lookahead=t,this.config.tokens&&2!==t.type&&this.tokens.push(this.convertToken(t)),e},e.prototype.nextRegexToken=function(){this.collectComments();var e=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(e))),this.lookahead=e,this.nextToken(),e},e.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},e.prototype.startNode=function(e,t){void 0===t&&(t=0);var r=e.start-e.lineStart,n=e.lineNumber;return r<0&&(r+=t,n--),{index:e.start,line:n,column:r}},e.prototype.finalize=function(e,t){if(this.config.range&&(t.range=[e.index,this.lastMarker.index]),this.config.loc&&(t.loc={start:{line:e.line,column:e.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(t.loc.source=this.config.source)),this.delegate){var r={start:{line:e.line,column:e.column,offset:e.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(t,r)}return t},e.prototype.expect=function(e){var t=this.nextToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var e=this.lookahead;7===e.type&&","===e.value?this.nextToken():7===e.type&&";"===e.value?(this.nextToken(),this.tolerateUnexpectedToken(e)):this.tolerateUnexpectedToken(e,i.Messages.UnexpectedToken)}else this.expect(",")},e.prototype.expectKeyword=function(e){var t=this.nextToken();4===t.type&&t.value===e||this.throwUnexpectedToken(t)},e.prototype.match=function(e){return 7===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchKeyword=function(e){return 4===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchContextualKeyword=function(e){return 3===this.lookahead.type&&this.lookahead.value===e},e.prototype.matchAssign=function(){if(7!==this.lookahead.type)return!1;var e=this.lookahead.value;return"="===e||"*="===e||"**="===e||"/="===e||"%="===e||"+="===e||"-="===e||"<<="===e||">>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,r=this.context.isAssignmentTarget,n=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var o=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=r,this.context.firstCoverInitializedNameError=n,o},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,r=this.context.isAssignmentTarget,n=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var o=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&r,this.context.firstCoverInitializedNameError=n||this.context.firstCoverInitializedNameError,o},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e,t,r,n=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(n,new a.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,i.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),r=this.getTokenRaw(t),e=this.finalize(n,new a.Literal(t.value,r));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),r=this.getTokenRaw(t),e=this.finalize(n,new a.Literal("true"===t.value,r));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),r=this.getTokenRaw(t),e=this.finalize(n,new a.Literal(null,r));break;case 10:e=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),r=this.getTokenRaw(t),e=this.finalize(n,new a.RegexLiteral(t.regex,r,t.pattern,t.flags));break;default:e=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(n,new a.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(n,new a.ThisExpression)):e=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:e=this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new a.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var r=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(r)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new a.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,r=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var n=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=r,n},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var r=this.parseFormalParameters(),n=this.parsePropertyMethod(r);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,r.params,n,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,r=this.context.await;this.context.allowYield=!1,this.context.await=!0;var n=this.parseFormalParameters(),o=this.parsePropertyMethod(n);return this.context.allowYield=t,this.context.await=r,this.finalize(e,new a.AsyncFunctionExpression(null,n.params,o))},e.prototype.parseObjectPropertyKey=function(){var e,t=this.createNode(),r=this.nextToken();switch(r.type){case 8:case 6:this.context.strict&&r.octal&&this.tolerateUnexpectedToken(r,i.Messages.StrictOctalLiteral);var n=this.getTokenRaw(r);e=this.finalize(t,new a.Literal(r.value,n));break;case 3:case 1:case 5:case 4:e=this.finalize(t,new a.Identifier(r.value));break;case 7:"["===r.value?(e=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):e=this.throwUnexpectedToken(r);break;default:e=this.throwUnexpectedToken(r)}return e},e.prototype.isPropertyKey=function(e,t){return e.type===l.Syntax.Identifier&&e.name===t||e.type===l.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,r=this.createNode(),n=this.lookahead,o=null,s=null,l=!1,u=!1,c=!1,d=!1;if(3===n.type){var p=n.value;this.nextToken(),l=this.match("["),o=(d=!(this.hasLineTerminator||"async"!==p||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(r,new a.Identifier(p))}else this.match("*")?this.nextToken():(l=this.match("["),o=this.parseObjectPropertyKey());var f=this.qualifiedPropertyName(this.lookahead);if(3===n.type&&!d&&"get"===n.value&&f)t="get",l=this.match("["),o=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod();else if(3===n.type&&!d&&"set"===n.value&&f)t="set",l=this.match("["),o=this.parseObjectPropertyKey(),s=this.parseSetterMethod();else if(7===n.type&&"*"===n.value&&f)t="init",l=this.match("["),o=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),u=!0;else if(o||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":")&&!d)!l&&this.isPropertyKey(o,"__proto__")&&(e.value&&this.tolerateError(i.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),s=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))s=d?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),u=!0;else if(3===n.type)if(p=this.finalize(r,new a.Identifier(n.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),c=!0;var h=this.isolateCoverGrammar(this.parseAssignmentExpression);s=this.finalize(r,new a.AssignmentPattern(p,h))}else c=!0,s=p;else this.throwUnexpectedToken(this.nextToken());return this.finalize(r,new a.Property(t,o,l,s,u,c))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],r={value:!1};!this.match("}");)t.push(this.parseObjectProperty(r)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new a.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){n.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),r=t.value,o=t.cooked;return this.finalize(e,new a.TemplateElement({raw:r,cooked:o},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),r=t.value,n=t.cooked;return this.finalize(e,new a.TemplateElement({raw:r,cooked:n},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],r=[],n=this.parseTemplateHead();for(r.push(n);!n.tail;)t.push(this.parseExpression()),n=this.parseTemplateElement(),r.push(n);return this.finalize(e,new a.TemplateLiteral(r,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case l.Syntax.Identifier:case l.Syntax.MemberExpression:case l.Syntax.RestElement:case l.Syntax.AssignmentPattern:break;case l.Syntax.SpreadElement:e.type=l.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case l.Syntax.ArrayExpression:e.type=l.Syntax.ArrayPattern;for(var t=0;t<e.elements.length;t++)null!==e.elements[t]&&this.reinterpretExpressionAsPattern(e.elements[t]);break;case l.Syntax.ObjectExpression:for(e.type=l.Syntax.ObjectPattern,t=0;t<e.properties.length;t++)this.reinterpretExpressionAsPattern(e.properties[t].value);break;case l.Syntax.AssignmentExpression:e.type=l.Syntax.AssignmentPattern,delete e.operator,this.reinterpretExpressionAsPattern(e.left)}},e.prototype.parseGroupExpression=function(){var e;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),e={type:"ArrowParameterPlaceHolder",params:[],async:!1};else{var t=this.lookahead,r=[];if(this.match("..."))e=this.parseRestElement(r),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:"ArrowParameterPlaceHolder",params:[e],async:!1};else{var n=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var o=[];for(this.context.isAssignmentTarget=!1,o.push(e);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var i=0;i<o.length;i++)this.reinterpretExpressionAsPattern(o[i]);n=!0,e={type:"ArrowParameterPlaceHolder",params:o,async:!1}}else if(this.match("...")){for(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),o.push(this.parseRestElement(r)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1,i=0;i<o.length;i++)this.reinterpretExpressionAsPattern(o[i]);n=!0,e={type:"ArrowParameterPlaceHolder",params:o,async:!1}}else o.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(n)break}n||(e=this.finalize(this.startNode(t),new a.SequenceExpression(o)))}if(!n){if(this.expect(")"),this.match("=>")&&(e.type===l.Syntax.Identifier&&"yield"===e.name&&(n=!0,e={type:"ArrowParameterPlaceHolder",params:[e],async:!1}),!n)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===l.Syntax.SequenceExpression)for(i=0;i<e.expressions.length;i++)this.reinterpretExpressionAsPattern(e.expressions[i]);else this.reinterpretExpressionAsPattern(e);e={type:"ArrowParameterPlaceHolder",params:e.type===l.Syntax.SequenceExpression?e.expressions:[e],async:!1}}this.context.isBindingElement=!1}}}return e},e.prototype.parseArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.isIdentifierName=function(e){return 3===e.type||4===e.type||1===e.type||5===e.type},e.prototype.parseIdentifierName=function(){var e=this.createNode(),t=this.nextToken();return this.isIdentifierName(t)||this.throwUnexpectedToken(t),this.finalize(e,new a.Identifier(t.value))},e.prototype.parseNewExpression=function(){var e,t=this.createNode(),r=this.parseIdentifierName();if(n.assert("new"===r.name,"New expression must start with `new`"),this.match("."))if(this.nextToken(),3===this.lookahead.type&&this.context.inFunctionBody&&"target"===this.lookahead.value){var o=this.parseIdentifierName();e=new a.MetaProperty(r,o)}else this.throwUnexpectedToken(this.lookahead);else{var i=this.isolateCoverGrammar(this.parseLeftHandSideExpression),s=this.match("(")?this.parseArguments():[];e=new a.NewExpression(i,s),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(t,e)},e.prototype.parseAsyncArgument=function(){var e=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,e},e.prototype.parseAsyncArguments=function(){this.expect("(");var e=[];if(!this.match(")"))for(;;){var t=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(e.push(t),this.match(")"))break;if(this.expectCommaSeparator(),this.match(")"))break}return this.expect(")"),e},e.prototype.parseLeftHandSideExpressionAllowCall=function(){var e,t=this.lookahead,r=this.matchContextualKeyword("async"),n=this.context.allowIn;for(this.context.allowIn=!0,this.matchKeyword("super")&&this.context.inFunctionBody?(e=this.createNode(),this.nextToken(),e=this.finalize(e,new a.Super),this.match("(")||this.match(".")||this.match("[")||this.throwUnexpectedToken(this.lookahead)):e=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var o=this.parseIdentifierName();e=this.finalize(this.startNode(t),new a.StaticMemberExpression(e,o))}else if(this.match("(")){var i=r&&t.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var s=i?this.parseAsyncArguments():this.parseArguments();if(e=this.finalize(this.startNode(t),new a.CallExpression(e,s)),i&&this.match("=>")){for(var l=0;l<s.length;++l)this.reinterpretExpressionAsPattern(s[l]);e={type:"ArrowParameterPlaceHolder",params:s,async:!0}}}else if(this.match("["))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("["),o=this.isolateCoverGrammar(this.parseExpression),this.expect("]"),e=this.finalize(this.startNode(t),new a.ComputedMemberExpression(e,o));else{if(10!==this.lookahead.type||!this.lookahead.head)break;var u=this.parseTemplateLiteral();e=this.finalize(this.startNode(t),new a.TaggedTemplateExpression(e,u))}return this.context.allowIn=n,e},e.prototype.parseSuper=function(){var e=this.createNode();return this.expectKeyword("super"),this.match("[")||this.match(".")||this.throwUnexpectedToken(this.lookahead),this.finalize(e,new a.Super)},e.prototype.parseLeftHandSideExpression=function(){n.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var e=this.startNode(this.lookahead),t=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var r=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),t=this.finalize(e,new a.ComputedMemberExpression(t,r))}else if(this.match("."))this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("."),r=this.parseIdentifierName(),t=this.finalize(e,new a.StaticMemberExpression(t,r));else{if(10!==this.lookahead.type||!this.lookahead.head)break;var o=this.parseTemplateLiteral();t=this.finalize(e,new a.TaggedTemplateExpression(t,o))}return t},e.prototype.parseUpdateExpression=function(){var e,t=this.lookahead;if(this.match("++")||this.match("--")){var r=this.startNode(t),n=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&e.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(i.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(i.Messages.InvalidLHSInAssignment);var o=!0;e=this.finalize(r,new a.UpdateExpression(n.value,e,o)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(e=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&7===this.lookahead.type&&(this.match("++")||this.match("--"))){this.context.strict&&e.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(e.name)&&this.tolerateError(i.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(i.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var s=this.nextToken().value;o=!1,e=this.finalize(this.startNode(t),new a.UpdateExpression(s,e,o))}return e},e.prototype.parseAwaitExpression=function(){var e=this.createNode();this.nextToken();var t=this.parseUnaryExpression();return this.finalize(e,new a.AwaitExpression(t))},e.prototype.parseUnaryExpression=function(){var e;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var t=this.startNode(this.lookahead),r=this.nextToken();e=this.inheritCoverGrammar(this.parseUnaryExpression),e=this.finalize(t,new a.UnaryExpression(r.value,e)),this.context.strict&&"delete"===e.operator&&e.argument.type===l.Syntax.Identifier&&this.tolerateError(i.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else e=this.context.await&&this.matchContextualKeyword("await")?this.parseAwaitExpression():this.parseUpdateExpression();return e},e.prototype.parseExponentiationExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseUnaryExpression);if(t.type!==l.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var r=t,n=this.isolateCoverGrammar(this.parseExponentiationExpression);t=this.finalize(this.startNode(e),new a.BinaryExpression("**",r,n))}return t},e.prototype.binaryPrecedence=function(e){var t=e.value;return 7===e.type?this.operatorPrecedence[t]||0:4===e.type&&("instanceof"===t||this.context.allowIn&&"in"===t)?7:0},e.prototype.parseBinaryExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseExponentiationExpression),r=this.lookahead,n=this.binaryPrecedence(r);if(n>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var o=[e,this.lookahead],i=t,s=this.isolateCoverGrammar(this.parseExponentiationExpression),l=[i,r.value,s],u=[n];!((n=this.binaryPrecedence(this.lookahead))<=0);){for(;l.length>2&&n<=u[u.length-1];){s=l.pop();var c=l.pop();u.pop(),i=l.pop(),o.pop();var d=this.startNode(o[o.length-1]);l.push(this.finalize(d,new a.BinaryExpression(c,i,s)))}l.push(this.nextToken().value),u.push(n),o.push(this.lookahead),l.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var p=l.length-1;t=l[p];for(var f=o.pop();p>1;){var h=o.pop(),m=f&&f.lineStart;d=this.startNode(h,m),c=l[p-1],t=this.finalize(d,new a.BinaryExpression(c,l[p-2],t)),p-=2,f=h}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var r=this.context.allowIn;this.context.allowIn=!0;var n=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=r,this.expect(":");var o=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new a.ConditionalExpression(t,n,o)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case l.Syntax.Identifier:this.validateParam(e,t,t.name);break;case l.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case l.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case l.Syntax.ArrayPattern:for(var r=0;r<t.elements.length;r++)null!==t.elements[r]&&this.checkPatternParam(e,t.elements[r]);break;case l.Syntax.ObjectPattern:for(r=0;r<t.properties.length;r++)this.checkPatternParam(e,t.properties[r].value)}e.simple=e.simple&&t instanceof a.Identifier},e.prototype.reinterpretAsCoverFormalsList=function(e){var t,r=[e],n=!1;switch(e.type){case l.Syntax.Identifier:break;case"ArrowParameterPlaceHolder":r=e.params,n=e.async;break;default:return null}t={simple:!0,paramSet:{}};for(var o=0;o<r.length;++o)(a=r[o]).type===l.Syntax.AssignmentPattern?a.right.type===l.Syntax.YieldExpression&&(a.right.argument&&this.throwUnexpectedToken(this.lookahead),a.right.type=l.Syntax.Identifier,a.right.name="yield",delete a.right.argument,delete a.right.delegate):n&&a.type===l.Syntax.Identifier&&"await"===a.name&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(t,a),r[o]=a;if(this.context.strict||!this.context.allowYield)for(o=0;o<r.length;++o){var a;(a=r[o]).type===l.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(t.message===i.Messages.StrictParamDupe){var s=this.context.strict?t.stricted:t.firstRestricted;this.throwUnexpectedToken(s,t.message)}return{simple:t.simple,params:r,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.parseAssignmentExpression=function(){var e;if(!this.context.allowYield&&this.matchKeyword("yield"))e=this.parseYieldExpression();else{var t=this.lookahead,r=t;if(e=this.parseConditionalExpression(),3===r.type&&r.lineNumber===this.lookahead.lineNumber&&"async"===r.value&&(3===this.lookahead.type||this.matchKeyword("yield"))){var n=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(n),e={type:"ArrowParameterPlaceHolder",params:[n],async:!0}}if("ArrowParameterPlaceHolder"===e.type||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var o=e.async,s=this.reinterpretAsCoverFormalsList(e);if(s){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var u=this.context.strict,c=this.context.allowStrictDirective;this.context.allowStrictDirective=s.simple;var d=this.context.allowYield,p=this.context.await;this.context.allowYield=!0,this.context.await=o;var f=this.startNode(t);this.expect("=>");var h=void 0;if(this.match("{")){var m=this.context.allowIn;this.context.allowIn=!0,h=this.parseFunctionSourceElements(),this.context.allowIn=m}else h=this.isolateCoverGrammar(this.parseAssignmentExpression);var g=h.type!==l.Syntax.BlockStatement;this.context.strict&&s.firstRestricted&&this.throwUnexpectedToken(s.firstRestricted,s.message),this.context.strict&&s.stricted&&this.tolerateUnexpectedToken(s.stricted,s.message),e=o?this.finalize(f,new a.AsyncArrowFunctionExpression(s.params,h,g)):this.finalize(f,new a.ArrowFunctionExpression(s.params,h,g)),this.context.strict=u,this.context.allowStrictDirective=c,this.context.allowYield=d,this.context.await=p}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(i.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===l.Syntax.Identifier){var y=e;this.scanner.isRestrictedWord(y.name)&&this.tolerateUnexpectedToken(r,i.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(y.name)&&this.tolerateUnexpectedToken(r,i.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var v=(r=this.nextToken()).value,b=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new a.AssignmentExpression(v,e,b)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var r=[];for(r.push(t);2!==this.lookahead.type&&this.match(",");)this.nextToken(),r.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new a.SequenceExpression(r))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,i.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,i.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement()}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.finalize(e,new a.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var r=this.createNode(),n=this.parsePattern([],e);this.context.strict&&n.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(i.Messages.StrictVarName);var o=null;return"const"===e?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),o=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(i.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&n.type!==l.Syntax.Identifier||this.match("="))&&(this.expect("="),o=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(r,new a.VariableDeclarator(n,o))},e.prototype.parseBindingList=function(e,t){for(var r=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),r.push(this.parseLexicalBinding(e,t));return r},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),r=this.nextToken().value;n.assert("let"===r||"const"===r,"Lexical declaration must be either let or const");var o=this.parseBindingList(r,e);return this.consumeSemicolon(),this.finalize(t,new a.VariableDeclaration(o,r))},e.prototype.parseBindingRestElement=function(e,t){var r=this.createNode();this.expect("...");var n=this.parsePattern(e,t);return this.finalize(r,new a.RestElement(n))},e.prototype.parseArrayPattern=function(e,t){var r=this.createNode();this.expect("[");for(var n=[];!this.match("]");)if(this.match(","))this.nextToken(),n.push(null);else{if(this.match("...")){n.push(this.parseBindingRestElement(e,t));break}n.push(this.parsePatternWithDefault(e,t)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(r,new a.ArrayPattern(n))},e.prototype.parsePropertyPattern=function(e,t){var r,n,o=this.createNode(),i=!1,s=!1;if(3===this.lookahead.type){var l=this.lookahead;r=this.parseVariableIdentifier();var u=this.finalize(o,new a.Identifier(l.value));if(this.match("=")){e.push(l),s=!0,this.nextToken();var c=this.parseAssignmentExpression();n=this.finalize(this.startNode(l),new a.AssignmentPattern(u,c))}else this.match(":")?(this.expect(":"),n=this.parsePatternWithDefault(e,t)):(e.push(l),s=!0,n=u)}else i=this.match("["),r=this.parseObjectPropertyKey(),this.expect(":"),n=this.parsePatternWithDefault(e,t);return this.finalize(o,new a.Property("init",r,i,n,!1,s))},e.prototype.parseObjectPattern=function(e,t){var r=this.createNode(),n=[];for(this.expect("{");!this.match("}");)n.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(r,new a.ObjectPattern(n))},e.prototype.parsePattern=function(e,t){var r;return this.match("[")?r=this.parseArrayPattern(e,t):this.match("{")?r=this.parseObjectPattern(e,t):(!this.matchKeyword("let")||"const"!==t&&"let"!==t||this.tolerateUnexpectedToken(this.lookahead,i.Messages.LetInLexicalBinding),e.push(this.lookahead),r=this.parseVariableIdentifier(t)),r},e.prototype.parsePatternWithDefault=function(e,t){var r=this.lookahead,n=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var o=this.context.allowYield;this.context.allowYield=!0;var i=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=o,n=this.finalize(this.startNode(r),new a.AssignmentPattern(n,i))}return n},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),r=this.nextToken();return 4===r.type&&"yield"===r.value?this.context.strict?this.tolerateUnexpectedToken(r,i.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(r):3!==r.type?this.context.strict&&4===r.type&&this.scanner.isStrictModeReservedWord(r.value)?this.tolerateUnexpectedToken(r,i.Messages.StrictReservedWord):(this.context.strict||"let"!==r.value||"var"!==e)&&this.throwUnexpectedToken(r):(this.context.isModule||this.context.await)&&3===r.type&&"await"===r.value&&this.tolerateUnexpectedToken(r),this.finalize(t,new a.Identifier(r.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),r=this.parsePattern([],"var");this.context.strict&&r.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(i.Messages.StrictVarName);var n=null;return this.match("=")?(this.nextToken(),n=this.isolateCoverGrammar(this.parseAssignmentExpression)):r.type===l.Syntax.Identifier||e.inFor||this.expect("="),this.finalize(t,new a.VariableDeclarator(r,n))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},r=[];for(r.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),r.push(this.parseVariableDeclaration(t));return r},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new a.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new a.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(i.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e,t=this.createNode(),r=null;this.expectKeyword("if"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement)):(this.expect(")"),e=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),r=this.parseIfClause())),this.finalize(t,new a.IfStatement(n,e,r))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var r=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new a.DoWhileStatement(r,n))},e.prototype.parseWhileStatement=function(){var e,t=this.createNode();this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement);else{this.expect(")");var n=this.context.inIteration;this.context.inIteration=!0,e=this.parseStatement(),this.context.inIteration=n}return this.finalize(t,new a.WhileStatement(r,e))},e.prototype.parseForStatement=function(){var e,t,r,n=null,o=null,s=null,u=!0,c=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){n=this.createNode(),this.nextToken();var d=this.context.allowIn;this.context.allowIn=!1;var p=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=d,1===p.length&&this.matchKeyword("in")){var f=p[0];f.init&&(f.id.type===l.Syntax.ArrayPattern||f.id.type===l.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(i.Messages.ForInOfLoopInitializer,"for-in"),n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.nextToken(),e=n,t=this.parseExpression(),n=null}else 1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.nextToken(),e=n,t=this.parseAssignmentExpression(),n=null,u=!1):(n=this.finalize(n,new a.VariableDeclaration(p,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){n=this.createNode();var h=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(d=this.context.allowIn,this.context.allowIn=!1,p=this.parseBindingList(h,{inFor:!0}),this.context.allowIn=d,1===p.length&&null===p[0].init&&this.matchKeyword("in")?(n=this.finalize(n,new a.VariableDeclaration(p,h)),this.nextToken(),e=n,t=this.parseExpression(),n=null):1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(n=this.finalize(n,new a.VariableDeclaration(p,h)),this.nextToken(),e=n,t=this.parseAssignmentExpression(),n=null,u=!1):(this.consumeSemicolon(),n=this.finalize(n,new a.VariableDeclaration(p,h)))):(n=this.finalize(n,new a.Identifier(h)),this.nextToken(),e=n,t=this.parseExpression(),n=null)}else{var m=this.lookahead;if(d=this.context.allowIn,this.context.allowIn=!1,n=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=d,this.matchKeyword("in"))this.context.isAssignmentTarget&&n.type!==l.Syntax.AssignmentExpression||this.tolerateError(i.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(n),e=n,t=this.parseExpression(),n=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&n.type!==l.Syntax.AssignmentExpression||this.tolerateError(i.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(n),e=n,t=this.parseAssignmentExpression(),n=null,u=!1;else{if(this.match(",")){for(var g=[n];this.match(",");)this.nextToken(),g.push(this.isolateCoverGrammar(this.parseAssignmentExpression));n=this.finalize(this.startNode(m),new a.SequenceExpression(g))}this.expect(";")}}if(void 0===e&&(this.match(";")||(o=this.parseExpression()),this.expect(";"),this.match(")")||(s=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),r=this.finalize(this.createNode(),new a.EmptyStatement);else{this.expect(")");var y=this.context.inIteration;this.context.inIteration=!0,r=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=y}return void 0===e?this.finalize(c,new a.ForStatement(n,o,s,r)):u?this.finalize(c,new a.ForInStatement(e,t,r)):this.finalize(c,new a.ForOfStatement(e,t,r))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var r=this.parseVariableIdentifier();t=r;var n="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,n)||this.throwError(i.Messages.UnknownLabel,r.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(i.Messages.IllegalContinue),this.finalize(e,new a.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var r=this.parseVariableIdentifier(),n="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,n)||this.throwError(i.Messages.UnknownLabel,r.name),t=r}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(i.Messages.IllegalBreak),this.finalize(e,new a.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(i.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ReturnStatement(t))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(i.Messages.StrictModeWith);var e,t=this.createNode();this.expectKeyword("with"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new a.EmptyStatement)):(this.expect(")"),e=this.parseStatement()),this.finalize(t,new a.WithStatement(r,e))},e.prototype.parseSwitchCase=function(){var e,t=this.createNode();this.matchKeyword("default")?(this.nextToken(),e=null):(this.expectKeyword("case"),e=this.parseExpression()),this.expect(":");for(var r=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)r.push(this.parseStatementListItem());return this.finalize(t,new a.SwitchCase(e,r))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var r=this.context.inSwitch;this.context.inSwitch=!0;var n=[],o=!1;for(this.expect("{");!this.match("}");){var s=this.parseSwitchCase();null===s.test&&(o&&this.throwError(i.Messages.MultipleDefaultsInSwitch),o=!0),n.push(s)}return this.expect("}"),this.context.inSwitch=r,this.finalize(e,new a.SwitchStatement(t,n))},e.prototype.parseLabelledStatement=function(){var e,t=this.createNode(),r=this.parseExpression();if(r.type===l.Syntax.Identifier&&this.match(":")){this.nextToken();var n=r,o="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,o)&&this.throwError(i.Messages.Redeclaration,"Label",n.name),this.context.labelSet[o]=!0;var s=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),s=this.parseClassDeclaration();else if(this.matchKeyword("function")){var u=this.lookahead,c=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(u,i.Messages.StrictFunction):c.generator&&this.tolerateUnexpectedToken(u,i.Messages.GeneratorInLegacyContext),s=c}else s=this.parseStatement();delete this.context.labelSet[o],e=new a.LabeledStatement(n,s)}else this.consumeSemicolon(),e=new a.ExpressionStatement(r);return this.finalize(t,e)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(i.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new a.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],r=this.parsePattern(t),n={},o=0;o<t.length;o++){var s="$"+t[o].value;Object.prototype.hasOwnProperty.call(n,s)&&this.tolerateError(i.Messages.DuplicateBinding,t[o].value),n[s]=!0}this.context.strict&&r.type===l.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(i.Messages.StrictCatchVariable),this.expect(")");var u=this.parseBlock();return this.finalize(e,new a.CatchClause(r,u))},e.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},e.prototype.parseTryStatement=function(){var e=this.createNode();this.expectKeyword("try");var t=this.parseBlock(),r=this.matchKeyword("catch")?this.parseCatchClause():null,n=this.matchKeyword("finally")?this.parseFinallyClause():null;return r||n||this.throwError(i.Messages.NoCatchOrFinally),this.finalize(e,new a.TryStatement(t,r,n))},e.prototype.parseDebuggerStatement=function(){var e=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(e,new a.DebuggerStatement)},e.prototype.parseStatement=function(){var e;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:e=this.parseExpressionStatement();break;case 7:var t=this.lookahead.value;e="{"===t?this.parseBlock():"("===t?this.parseExpressionStatement():";"===t?this.parseEmptyStatement():this.parseExpressionStatement();break;case 3:e=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":e=this.parseBreakStatement();break;case"continue":e=this.parseContinueStatement();break;case"debugger":e=this.parseDebuggerStatement();break;case"do":e=this.parseDoWhileStatement();break;case"for":e=this.parseForStatement();break;case"function":e=this.parseFunctionDeclaration();break;case"if":e=this.parseIfStatement();break;case"return":e=this.parseReturnStatement();break;case"switch":e=this.parseSwitchStatement();break;case"throw":e=this.parseThrowStatement();break;case"try":e=this.parseTryStatement();break;case"var":e=this.parseVariableStatement();break;case"while":e=this.parseWhileStatement();break;case"with":e=this.parseWithStatement();break;default:e=this.parseExpressionStatement()}break;default:e=this.throwUnexpectedToken(this.lookahead)}return e},e.prototype.parseFunctionSourceElements=function(){var e=this.createNode();this.expect("{");var t=this.parseDirectivePrologues(),r=this.context.labelSet,n=this.context.inIteration,o=this.context.inSwitch,i=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;2!==this.lookahead.type&&!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=r,this.context.inIteration=n,this.context.inSwitch=o,this.context.inFunctionBody=i,this.finalize(e,new a.BlockStatement(t))},e.prototype.validateParam=function(e,t,r){var n="$"+r;this.context.strict?(this.scanner.isRestrictedWord(r)&&(e.stricted=t,e.message=i.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(e.paramSet,n)&&(e.stricted=t,e.message=i.Messages.StrictParamDupe)):e.firstRestricted||(this.scanner.isRestrictedWord(r)?(e.firstRestricted=t,e.message=i.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(r)?(e.firstRestricted=t,e.message=i.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(e.paramSet,n)&&(e.stricted=t,e.message=i.Messages.StrictParamDupe)),"function"==typeof Object.defineProperty?Object.defineProperty(e.paramSet,n,{value:!0,enumerable:!0,writable:!0,configurable:!0}):e.paramSet[n]=!0},e.prototype.parseRestElement=function(e){var t=this.createNode();this.expect("...");var r=this.parsePattern(e);return this.match("=")&&this.throwError(i.Messages.DefaultRestParameter),this.match(")")||this.throwError(i.Messages.ParameterAfterRestParameter),this.finalize(t,new a.RestElement(r))},e.prototype.parseFormalParameter=function(e){for(var t=[],r=this.match("...")?this.parseRestElement(t):this.parsePatternWithDefault(t),n=0;n<t.length;n++)this.validateParam(e,t[n],t[n].value);e.simple=e.simple&&r instanceof a.Identifier,e.params.push(r)},e.prototype.parseFormalParameters=function(e){var t;if(t={simple:!0,params:[],firstRestricted:e},this.expect("("),!this.match(")"))for(t.paramSet={};2!==this.lookahead.type&&(this.parseFormalParameter(t),!this.match(")"))&&(this.expect(","),!this.match(")")););return this.expect(")"),{simple:t.simple,params:t.params,stricted:t.stricted,firstRestricted:t.firstRestricted,message:t.message}},e.prototype.matchAsyncFunction=function(){var e=this.matchContextualKeyword("async");if(e){var t=this.scanner.saveState();this.scanner.scanComments();var r=this.scanner.lex();this.scanner.restoreState(t),e=t.lineNumber===r.lineNumber&&4===r.type&&"function"===r.value}return e},e.prototype.parseFunctionDeclaration=function(e){var t=this.createNode(),r=this.matchContextualKeyword("async");r&&this.nextToken(),this.expectKeyword("function");var n,o=!r&&this.match("*");o&&this.nextToken();var s=null,l=null;if(!e||!this.match("(")){var u=this.lookahead;s=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(u.value)&&this.tolerateUnexpectedToken(u,i.Messages.StrictFunctionName):this.scanner.isRestrictedWord(u.value)?(l=u,n=i.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(u.value)&&(l=u,n=i.Messages.StrictReservedWord)}var c=this.context.await,d=this.context.allowYield;this.context.await=r,this.context.allowYield=!o;var p=this.parseFormalParameters(l),f=p.params,h=p.stricted;l=p.firstRestricted,p.message&&(n=p.message);var m=this.context.strict,g=this.context.allowStrictDirective;this.context.allowStrictDirective=p.simple;var y=this.parseFunctionSourceElements();return this.context.strict&&l&&this.throwUnexpectedToken(l,n),this.context.strict&&h&&this.tolerateUnexpectedToken(h,n),this.context.strict=m,this.context.allowStrictDirective=g,this.context.await=c,this.context.allowYield=d,r?this.finalize(t,new a.AsyncFunctionDeclaration(s,f,y)):this.finalize(t,new a.FunctionDeclaration(s,f,y,o))},e.prototype.parseFunctionExpression=function(){var e=this.createNode(),t=this.matchContextualKeyword("async");t&&this.nextToken(),this.expectKeyword("function");var r,n=!t&&this.match("*");n&&this.nextToken();var o,s=null,l=this.context.await,u=this.context.allowYield;if(this.context.await=t,this.context.allowYield=!n,!this.match("(")){var c=this.lookahead;s=this.context.strict||n||!this.matchKeyword("yield")?this.parseVariableIdentifier():this.parseIdentifierName(),this.context.strict?this.scanner.isRestrictedWord(c.value)&&this.tolerateUnexpectedToken(c,i.Messages.StrictFunctionName):this.scanner.isRestrictedWord(c.value)?(o=c,r=i.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(c.value)&&(o=c,r=i.Messages.StrictReservedWord)}var d=this.parseFormalParameters(o),p=d.params,f=d.stricted;o=d.firstRestricted,d.message&&(r=d.message);var h=this.context.strict,m=this.context.allowStrictDirective;this.context.allowStrictDirective=d.simple;var g=this.parseFunctionSourceElements();return this.context.strict&&o&&this.throwUnexpectedToken(o,r),this.context.strict&&f&&this.tolerateUnexpectedToken(f,r),this.context.strict=h,this.context.allowStrictDirective=m,this.context.await=l,this.context.allowYield=u,t?this.finalize(e,new a.AsyncFunctionExpression(s,p,g)):this.finalize(e,new a.FunctionExpression(s,p,g,n))},e.prototype.parseDirective=function(){var e=this.lookahead,t=this.createNode(),r=this.parseExpression(),n=r.type===l.Syntax.Literal?this.getTokenRaw(e).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(t,n?new a.Directive(r,n):new a.ExpressionStatement(r))},e.prototype.parseDirectivePrologues=function(){for(var e=null,t=[];;){var r=this.lookahead;if(8!==r.type)break;var n=this.parseDirective();t.push(n);var o=n.directive;if("string"!=typeof o)break;"use strict"===o?(this.context.strict=!0,e&&this.tolerateUnexpectedToken(e,i.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(r,i.Messages.IllegalLanguageModeDirective)):!e&&r.octal&&(e=r)}return t},e.prototype.qualifiedPropertyName=function(e){switch(e.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return"["===e.value}return!1},e.prototype.parseGetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var r=this.parseFormalParameters();r.params.length>0&&this.tolerateError(i.Messages.BadGetterArity);var n=this.parsePropertyMethod(r);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,r.params,n,!1))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var r=this.parseFormalParameters();1!==r.params.length?this.tolerateError(i.Messages.BadSetterArity):r.params[0]instanceof a.RestElement&&this.tolerateError(i.Messages.BadSetterRestParameter);var n=this.parsePropertyMethod(r);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,r.params,n,!1))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var r=this.parseFormalParameters();this.context.allowYield=!1;var n=this.parsePropertyMethod(r);return this.context.allowYield=t,this.finalize(e,new a.FunctionExpression(null,r.params,n,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,r=!1;if(!this.hasLineTerminator){var n=this.context.allowYield;this.context.allowYield=!1,(r=this.match("*"))?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=n}return this.finalize(e,new a.YieldExpression(t,r))},e.prototype.parseClassElement=function(e){var t=this.lookahead,r=this.createNode(),n="",o=null,s=null,l=!1,u=!1,c=!1,d=!1;if(this.match("*"))this.nextToken();else if(l=this.match("["),"static"===(o=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,c=!0,l=this.match("["),this.match("*")?this.nextToken():o=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var p=this.lookahead.value;":"!==p&&"("!==p&&"*"!==p&&(d=!0,t=this.lookahead,o=this.parseObjectPropertyKey(),3===t.type&&"constructor"===t.value&&this.tolerateUnexpectedToken(t,i.Messages.ConstructorIsAsync))}var f=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&f?(n="get",l=this.match("["),o=this.parseObjectPropertyKey(),this.context.allowYield=!1,s=this.parseGetterMethod()):"set"===t.value&&f&&(n="set",l=this.match("["),o=this.parseObjectPropertyKey(),s=this.parseSetterMethod()):7===t.type&&"*"===t.value&&f&&(n="init",l=this.match("["),o=this.parseObjectPropertyKey(),s=this.parseGeneratorMethod(),u=!0),!n&&o&&this.match("(")&&(n="init",s=d?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),u=!0),n||this.throwUnexpectedToken(this.lookahead),"init"===n&&(n="method"),l||(c&&this.isPropertyKey(o,"prototype")&&this.throwUnexpectedToken(t,i.Messages.StaticPrototype),!c&&this.isPropertyKey(o,"constructor")&&(("method"!==n||!u||s&&s.generator)&&this.throwUnexpectedToken(t,i.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,i.Messages.DuplicateConstructor):e.value=!0,n="constructor")),this.finalize(r,new a.MethodDefinition(o,l,s,n,c))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new a.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),r=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),o=null;this.matchKeyword("extends")&&(this.nextToken(),o=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=r,this.finalize(t,new a.ClassDeclaration(n,o,i))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=3===this.lookahead.type?this.parseVariableIdentifier():null,n=null;this.matchKeyword("extends")&&(this.nextToken(),n=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var o=this.parseClassBody();return this.context.strict=t,this.finalize(e,new a.ClassExpression(r,n,o))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new a.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new a.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(i.Messages.InvalidModuleSpecifier);var t=this.nextToken(),r=this.getTokenRaw(t);return this.finalize(e,new a.Literal(t.value,r))},e.prototype.parseImportSpecifier=function(){var e,t,r=this.createNode();return 3===this.lookahead.type?(t=e=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),t=this.parseVariableIdentifier())):(t=e=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),t=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(r,new a.ImportSpecifier(t,e))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new a.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(i.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new a.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(i.Messages.IllegalImportDeclaration);var e,t=this.createNode();this.expectKeyword("import");var r=[];if(8===this.lookahead.type)e=this.parseModuleSpecifier();else{if(this.match("{")?r=r.concat(this.parseNamedImports()):this.match("*")?r.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(r.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?r.push(this.parseImportNamespaceSpecifier()):this.match("{")?r=r.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var n=this.lookahead.value?i.Messages.UnexpectedToken:i.Messages.MissingFromClause;this.throwError(n,this.lookahead.value)}this.nextToken(),e=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new a.ImportDeclaration(r,e))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),r=t;return this.matchContextualKeyword("as")&&(this.nextToken(),r=this.parseIdentifierName()),this.finalize(e,new a.ExportSpecifier(t,r))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(i.Messages.IllegalExportDeclaration);var e,t=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var r=this.parseFunctionDeclaration(!0);e=this.finalize(t,new a.ExportDefaultDeclaration(r))}else this.matchKeyword("class")?(r=this.parseClassDeclaration(!0),e=this.finalize(t,new a.ExportDefaultDeclaration(r))):this.matchContextualKeyword("async")?(r=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),e=this.finalize(t,new a.ExportDefaultDeclaration(r))):(this.matchContextualKeyword("from")&&this.throwError(i.Messages.UnexpectedToken,this.lookahead.value),r=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),e=this.finalize(t,new a.ExportDefaultDeclaration(r)));else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var n=this.lookahead.value?i.Messages.UnexpectedToken:i.Messages.MissingFromClause;this.throwError(n,this.lookahead.value)}this.nextToken();var o=this.parseModuleSpecifier();this.consumeSemicolon(),e=this.finalize(t,new a.ExportAllDeclaration(o))}else if(4===this.lookahead.type){switch(r=void 0,this.lookahead.value){case"let":case"const":r=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":r=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}e=this.finalize(t,new a.ExportNamedDeclaration(r,[],null))}else if(this.matchAsyncFunction())r=this.parseFunctionDeclaration(),e=this.finalize(t,new a.ExportNamedDeclaration(r,[],null));else{var s=[],l=null,u=!1;for(this.expect("{");!this.match("}");)u=u||this.matchKeyword("default"),s.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),l=this.parseModuleSpecifier(),this.consumeSemicolon()):u?(n=this.lookahead.value?i.Messages.UnexpectedToken:i.Messages.MissingFromClause,this.throwError(n,this.lookahead.value)):this.consumeSemicolon(),e=this.finalize(t,new a.ExportNamedDeclaration(null,s,l))}return e},e}();t.Parser=c},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("ASSERT: "+t)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(!this.tolerant)throw e;this.recordError(e)},e.prototype.constructError=function(e,t){var r=new Error(e);try{throw r}catch(e){Object.create&&Object.defineProperty&&(r=Object.create(e),Object.defineProperty(r,"column",{value:t}))}return r},e.prototype.createError=function(e,t,r,n){var o="Line "+t+": "+n,i=this.constructError(o,r);return i.index=e,i.lineNumber=t,i.description=n,i},e.prototype.throwError=function(e,t,r,n){throw this.createError(e,t,r,n)},e.prototype.tolerateError=function(e,t,r,n){var o=this.createError(e,t,r,n);if(!this.tolerant)throw o;this.recordError(o)},e}();t.ErrorHandler=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),o=r(4),i=r(11);function a(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function s(e){return"01234567".indexOf(e)}var l=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.isModule=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=i.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=i.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t,r,n=[];for(this.trackComment&&(n=[],t=this.index-e,r={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(++this.index,o.Character.isLineTerminator(i)){if(this.trackComment){r.end={line:this.lineNumber,column:this.index-this.lineStart-1};var a={multiLine:!1,slice:[t+e,this.index-1],range:[t,this.index-1],loc:r};n.push(a)}return 13===i&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,n}}return this.trackComment&&(r.end={line:this.lineNumber,column:this.index-this.lineStart},a={multiLine:!1,slice:[t+e,this.index],range:[t,this.index],loc:r},n.push(a)),n},e.prototype.skipMultiLineComment=function(){var e,t,r=[];for(this.trackComment&&(r=[],e=this.index-2,t={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var n=this.source.charCodeAt(this.index);if(o.Character.isLineTerminator(n))13===n&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===n){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[e+2,this.index-2],range:[e,this.index],loc:t};r.push(i)}return r}++this.index}else++this.index}return this.trackComment&&(t.end={line:this.lineNumber,column:this.index-this.lineStart},i={multiLine:!0,slice:[e+2,this.index],range:[e,this.index],loc:t},r.push(i)),this.tolerateUnexpectedToken(),r},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var r=this.source.charCodeAt(this.index);if(o.Character.isWhiteSpace(r))++this.index;else if(o.Character.isLineTerminator(r))++this.index,13===r&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===r)if(47===(r=this.source.charCodeAt(this.index+1))){this.index+=2;var n=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(n)),t=!0}else{if(42!==r)break;this.index+=2,n=this.skipMultiLineComment(),this.trackComment&&(e=e.concat(n))}else if(t&&45===r){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,n=this.skipSingleLineComment(3),this.trackComment&&(e=e.concat(n))}else{if(60!==r||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,n=this.skipSingleLineComment(4),this.trackComment&&(e=e.concat(n))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var r=this.source.charCodeAt(e+1);r>=56320&&r<=57343&&(t=1024*(t-55296)+r-56320+65536)}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,r=0,n=0;n<t;++n){if(this.eof()||!o.Character.isHexDigit(this.source.charCodeAt(this.index)))return null;r=16*r+a(this.source[this.index++])}return String.fromCharCode(r)},e.prototype.scanUnicodeCodePointEscape=function(){var e=this.source[this.index],t=0;for("}"===e&&this.throwUnexpectedToken();!this.eof()&&(e=this.source[this.index++],o.Character.isHexDigit(e.charCodeAt(0)));)t=16*t+a(e);return(t>1114111||"}"!==e)&&this.throwUnexpectedToken(),o.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!o.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e,t=this.codePointAt(this.index),r=o.Character.fromCodePoint(t);for(this.index+=r.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&o.Character.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken(),r=e);!this.eof()&&(t=this.codePointAt(this.index),o.Character.isIdentifierPart(t));)r+=e=o.Character.fromCodePoint(t),this.index+=e.length,92===t&&(r=r.substr(0,r.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&o.Character.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken(),r+=e);return r},e.prototype.octalToDecimal=function(e){var t="0"!==e,r=s(e);return!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,r=8*r+s(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+s(this.source[this.index++]))),{code:r,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,r=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();if(3!=(e=1===r.length?3:this.isKeyword(r)?4:"null"===r?5:"true"===r||"false"===r?1:3)&&t+r.length!==this.index){var n=this.index;this.index=t,this.tolerateUnexpectedToken(i.Messages.InvalidEscapedReservedWord),this.index=n}return{type:e,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(t=this.source.substr(this.index,4))?this.index+=4:"==="===(t=t.substr(0,3))||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:"&&"===(t=t.substr(0,2))||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)}return this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&o.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),o.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,r="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)r+=this.source[this.index++];return 0===r.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(o.Character.isIdentifierStart(t)||o.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:6,value:parseInt(r,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var r="",n=!1;for(o.Character.isOctalDigit(e.charCodeAt(0))?(n=!0,r="0"+this.source[this.index++]):++this.index;!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];return n||0!==r.length||this.throwUnexpectedToken(),(o.Character.isIdentifierStart(this.source.charCodeAt(this.index))||o.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(r,8),octal:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e<this.length;++e){var t=this.source[e];if("8"===t||"9"===t)return!1;if(!o.Character.isOctalDigit(t.charCodeAt(0)))return!0}return!0},e.prototype.scanNumericLiteral=function(){var e=this.index,t=this.source[e];n.assert(o.Character.isDecimalDigit(t.charCodeAt(0))||"."===t,"Numeric literal must start with a decimal digit or a decimal point");var r="";if("."!==t){if(r=this.source[this.index++],t=this.source[this.index],"0"===r){if("x"===t||"X"===t)return++this.index,this.scanHexLiteral(e);if("b"===t||"B"===t)return++this.index,this.scanBinaryLiteral(e);if("o"===t||"O"===t)return this.scanOctalLiteral(t,e);if(t&&o.Character.isOctalDigit(t.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(t,e)}for(;o.Character.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];t=this.source[this.index]}if("."===t){for(r+=this.source[this.index++];o.Character.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];t=this.source[this.index]}if("e"===t||"E"===t)if(r+=this.source[this.index++],"+"!==(t=this.source[this.index])&&"-"!==t||(r+=this.source[this.index++]),o.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;o.Character.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];else this.throwUnexpectedToken();return o.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanStringLiteral=function(){var e=this.index,t=this.source[e];n.assert("'"===t||'"'===t,"String literal must starts with a quote"),++this.index;for(var r=!1,a="";!this.eof();){var s=this.source[this.index++];if(s===t){t="";break}if("\\"===s)if((s=this.source[this.index++])&&o.Character.isLineTerminator(s.charCodeAt(0)))++this.lineNumber,"\r"===s&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(s){case"u":if("{"===this.source[this.index])++this.index,a+=this.scanUnicodeCodePointEscape();else{var l=this.scanHexEscape(s);null===l&&this.throwUnexpectedToken(),a+=l}break;case"x":var u=this.scanHexEscape(s);null===u&&this.throwUnexpectedToken(i.Messages.InvalidHexEscapeSequence),a+=u;break;case"n":a+="\n";break;case"r":a+="\r";break;case"t":a+="\t";break;case"b":a+="\b";break;case"f":a+="\f";break;case"v":a+="\v";break;case"8":case"9":a+=s,this.tolerateUnexpectedToken();break;default:if(s&&o.Character.isOctalDigit(s.charCodeAt(0))){var c=this.octalToDecimal(s);r=c.octal||r,a+=String.fromCharCode(c.code)}else a+=s}else{if(o.Character.isLineTerminator(s.charCodeAt(0)))break;a+=s}}return""!==t&&(this.index=e,this.throwUnexpectedToken()),{type:8,value:a,octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanTemplate=function(){var e="",t=!1,r=this.index,n="`"===this.source[r],a=!1,s=2;for(++this.index;!this.eof();){var l=this.source[this.index++];if("`"===l){s=1,a=!0,t=!0;break}if("$"===l){if("{"===this.source[this.index]){this.curlyStack.push("${"),++this.index,t=!0;break}e+=l}else if("\\"===l)if(l=this.source[this.index++],o.Character.isLineTerminator(l.charCodeAt(0)))++this.lineNumber,"\r"===l&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index;else switch(l){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"u":if("{"===this.source[this.index])++this.index,e+=this.scanUnicodeCodePointEscape();else{var u=this.index,c=this.scanHexEscape(l);null!==c?e+=c:(this.index=u,e+=l)}break;case"x":var d=this.scanHexEscape(l);null===d&&this.throwUnexpectedToken(i.Messages.InvalidHexEscapeSequence),e+=d;break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:"0"===l?(o.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(i.Messages.TemplateOctalLiteral),e+="\0"):o.Character.isOctalDigit(l.charCodeAt(0))?this.throwUnexpectedToken(i.Messages.TemplateOctalLiteral):e+=l}else o.Character.isLineTerminator(l.charCodeAt(0))?(++this.lineNumber,"\r"===l&&"\n"===this.source[this.index]&&++this.index,this.lineStart=this.index,e+="\n"):e+=l}return t||this.throwUnexpectedToken(),n||this.curlyStack.pop(),{type:10,value:this.source.slice(r+1,this.index-s),cooked:e,head:n,tail:a,lineNumber:this.lineNumber,lineStart:this.lineStart,start:r,end:this.index}},e.prototype.testRegExp=function(e,t){var r=e,n=this;t.indexOf("u")>=0&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,r){var o=parseInt(t||r,16);return o>1114111&&n.throwUnexpectedToken(i.Messages.InvalidRegExp),o<=65535?String.fromCharCode(o):"￿"}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(r)}catch(e){this.throwUnexpectedToken(i.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];n.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],r=!1,a=!1;!this.eof();)if(t+=e=this.source[this.index++],"\\"===e)e=this.source[this.index++],o.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(i.Messages.UnterminatedRegExp),t+=e;else if(o.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(i.Messages.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){a=!0;break}"["===e&&(r=!0)}return a||this.throwUnexpectedToken(i.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="";!this.eof();){var t=this.source[this.index];if(!o.Character.isIdentifierPart(t.charCodeAt(0)))break;if(++this.index,"\\"!==t||this.eof())e+=t;else if("u"===(t=this.source[this.index])){++this.index;var r=this.index,n=this.scanHexEscape("u");if(null!==n)for(e+=n;r<this.index;++r)this.source[r];else this.index=r,e+="u";this.tolerateUnexpectedToken()}else this.tolerateUnexpectedToken()}return e},e.prototype.scanRegExp=function(){var e=this.index,t=this.scanRegExpBody(),r=this.scanRegExpFlags();return{type:9,value:"",pattern:t,flags:r,regex:this.testRegExp(t,r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.lex=function(){if(this.eof())return{type:2,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};var e=this.source.charCodeAt(this.index);return o.Character.isIdentifierStart(e)?this.scanIdentifier():40===e||41===e||59===e?this.scanPunctuator():39===e||34===e?this.scanStringLiteral():46===e?o.Character.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():o.Character.isDecimalDigit(e)?this.scanNumericLiteral():96===e||125===e&&"${"===this.curlyStack[this.curlyStack.length-1]?this.scanTemplate():e>=55296&&e<57343&&o.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="<end>",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(10),o=r(12),i=r(13),a=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var r=this.values[this.paren-1];t="if"===r||"while"===r||"for"===r||"with"===r;break;case"}":if(t=!1,"function"===this.values[this.curly-3])t=!!(n=this.values[this.curly-4])&&!this.beforeFunctionExpression(n);else if("function"===this.values[this.curly-4]){var n;t=!(n=this.values[this.curly-5])||!this.beforeFunctionExpression(n)}}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),s=function(){function e(e,t){this.errorHandler=new n.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new o.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new a}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t<e.length;++t){var r=e[t],n=this.scanner.source.slice(r.slice[0],r.slice[1]),o={type:r.multiLine?"BlockComment":"LineComment",value:n};this.trackRange&&(o.range=r.range),this.trackLoc&&(o.loc=r.loc),this.buffer.push(o)}if(!this.scanner.eof()){var a=void 0;this.trackLoc&&(a={start:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},end:{}});var s="/"===this.scanner.source[this.scanner.index]&&this.reader.isRegexStart()?this.scanner.scanRegExp():this.scanner.lex();this.reader.push(s);var l={type:i.TokenName[s.type],value:this.scanner.source.slice(s.start,s.end)};if(this.trackRange&&(l.range=[s.start,s.end]),this.trackLoc&&(a.end={line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart},l.loc=a),9===s.type){var u=s.pattern,c=s.flags;l.regex={pattern:u,flags:c}}this.buffer.push(l)}}return this.buffer.shift()},e}();t.Tokenizer=s}])},e.exports=n()},function(e,t,r){"use strict";var n=r(38),o=r(53),i=r(76),a=r(54),s=Object.prototype.toString,l=Object.prototype.hasOwnProperty,u={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},c=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function d(e){var t,r,i;if(t=e.toString(16).toUpperCase(),e<=255)r="x",i=2;else if(e<=65535)r="u",i=4;else{if(!(e<=4294967295))throw new o("code point within a string may not be greater than 0xFFFFFFFF");r="U",i=8}return"\\"+r+n.repeat("0",i-t.length)+t}function p(e){this.schema=e.schema||i,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=n.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var r,n,o,i,a,s,u;if(null===t)return{};for(r={},o=0,i=(n=Object.keys(t)).length;o<i;o+=1)a=n[o],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(u=e.compiledTypeMap.fallback[a])&&l.call(u.styleAliases,s)&&(s=u.styleAliases[s]),r[a]=s;return r}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function f(e,t){for(var r,o=n.repeat(" ",t),i=0,a=-1,s="",l=e.length;i<l;)-1===(a=e.indexOf("\n",i))?(r=e.slice(i),i=l):(r=e.slice(i,a+1),i=a+1),r.length&&"\n"!==r&&(s+=o),s+=r;return s}function h(e,t){return"\n"+n.repeat(" ",e.indent*t)}function m(e){return 32===e||9===e}function g(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function y(e,t){return g(e)&&65279!==e&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e&&58!==e&&(35!==e||t&&function(e){return g(e)&&!m(e)&&65279!==e&&13!==e&&10!==e}(t))}function v(e){return/^\n* /.test(e)}function b(e,t,r,n){e.dump=function(){if(0===t.length)return"''";if(!e.noCompatMode&&-1!==c.indexOf(t))return"'"+t+"'";var i=e.indent*Math.max(1,r),a=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),s=n||e.flowLevel>-1&&r>=e.flowLevel;switch(function(e,t,r,n,o){var i,a,s,l,u=!1,c=!1,d=-1!==n,p=-1,f=g(l=e.charCodeAt(0))&&65279!==l&&!m(l)&&45!==l&&63!==l&&58!==l&&44!==l&&91!==l&&93!==l&&123!==l&&125!==l&&35!==l&&38!==l&&42!==l&&33!==l&&124!==l&&61!==l&&62!==l&&39!==l&&34!==l&&37!==l&&64!==l&&96!==l&&!m(e.charCodeAt(e.length-1));if(t)for(i=0;i<e.length;i++){if(!g(a=e.charCodeAt(i)))return 5;s=i>0?e.charCodeAt(i-1):null,f=f&&y(a,s)}else{for(i=0;i<e.length;i++){if(10===(a=e.charCodeAt(i)))u=!0,d&&(c=c||i-p-1>n&&" "!==e[p+1],p=i);else if(!g(a))return 5;s=i>0?e.charCodeAt(i-1):null,f=f&&y(a,s)}c=c||d&&i-p-1>n&&" "!==e[p+1]}return u||c?r>9&&v(e)?5:c?4:3:f&&!o(e)?1:2}(t,s,e.indent,a,function(t){return function(e,t){var r,n;for(r=0,n=e.implicitTypes.length;r<n;r+=1)if(e.implicitTypes[r].resolve(t))return!0;return!1}(e,t)})){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+x(t,e.indent)+_(f(t,i));case 4:return">"+x(t,e.indent)+_(f(function(e,t){for(var r,n,o,i=/(\n+)([^\n]*)/g,a=(o=-1!==(o=e.indexOf("\n"))?o:e.length,i.lastIndex=o,S(e.slice(0,o),t)),s="\n"===e[0]||" "===e[0];n=i.exec(e);){var l=n[1],u=n[2];r=" "===u[0],a+=l+(s||r||""===u?"":"\n")+S(u,t),s=r}return a}(t,a),i));case 5:return'"'+function(e){for(var t,r,n,o="",i=0;i<e.length;i++)(t=e.charCodeAt(i))>=55296&&t<=56319&&(r=e.charCodeAt(i+1))>=56320&&r<=57343?(o+=d(1024*(t-55296)+r-56320+65536),i++):o+=!(n=u[t])&&g(t)?e[i]:n||d(t);return o}(t)+'"';default:throw new o("impossible error: invalid scalar style")}}()}function x(e,t){var r=v(e)?String(t):"",n="\n"===e[e.length-1];return r+(!n||"\n"!==e[e.length-2]&&"\n"!==e?n?"":"-":"+")+"\n"}function _(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function S(e,t){if(""===e||" "===e[0])return e;for(var r,n,o=/ [^ ]/g,i=0,a=0,s=0,l="";r=o.exec(e);)(s=r.index)-i>t&&(n=a>i?a:s,l+="\n"+e.slice(i,n),i=n+1),a=s;return l+="\n",e.length-i>t&&a>i?l+=e.slice(i,a)+"\n"+e.slice(a+1):l+=e.slice(i),l.slice(1)}function C(e,t,r){var n,i,a,u,c,d;for(a=0,u=(i=r?e.explicitTypes:e.implicitTypes).length;a<u;a+=1)if(((c=i[a]).instanceOf||c.predicate)&&(!c.instanceOf||"object"==typeof t&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(e.tag=r?c.tag:"?",c.represent){if(d=e.styleMap[c.tag]||c.defaultStyle,"[object Function]"===s.call(c.represent))n=c.represent(t,d);else{if(!l.call(c.represent,d))throw new o("!<"+c.tag+'> tag resolver accepts not "'+d+'" style');n=c.represent[d](t,d)}e.dump=n}return!0}return!1}function T(e,t,r,n,i,a){e.tag=null,e.dump=r,C(e,r,!1)||C(e,r,!0);var l=s.call(e.dump);n&&(n=e.flowLevel<0||e.flowLevel>t);var u,c,d="[object Object]"===l||"[object Array]"===l;if(d&&(c=-1!==(u=e.duplicates.indexOf(r))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&t>0)&&(i=!1),c&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(d&&c&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===l)n&&0!==Object.keys(e.dump).length?(function(e,t,r,n){var i,a,s,l,u,c,d="",p=e.tag,f=Object.keys(r);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new o("sortKeys must be a boolean or a function");for(i=0,a=f.length;i<a;i+=1)c="",n&&0===i||(c+=h(e,t)),l=r[s=f[i]],T(e,t+1,s,!0,!0,!0)&&((u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,u&&(c+=h(e,t)),T(e,t+1,l,!0,u)&&(e.dump&&10===e.dump.charCodeAt(0)?c+=":":c+=": ",d+=c+=e.dump));e.tag=p,e.dump=d||"{}"}(e,t,e.dump,i),c&&(e.dump="&ref_"+u+e.dump)):(function(e,t,r){var n,o,i,a,s,l="",u=e.tag,c=Object.keys(r);for(n=0,o=c.length;n<o;n+=1)s="",0!==n&&(s+=", "),e.condenseFlow&&(s+='"'),a=r[i=c[n]],T(e,t,i,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),T(e,t,a,!1,!1)&&(l+=s+=e.dump));e.tag=u,e.dump="{"+l+"}"}(e,t,e.dump),c&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===l){var p=e.noArrayIndent&&t>0?t-1:t;n&&0!==e.dump.length?(function(e,t,r,n){var o,i,a="",s=e.tag;for(o=0,i=r.length;o<i;o+=1)T(e,t+1,r[o],!0,!0)&&(n&&0===o||(a+=h(e,t)),e.dump&&10===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=s,e.dump=a||"[]"}(e,p,e.dump,i),c&&(e.dump="&ref_"+u+e.dump)):(function(e,t,r){var n,o,i="",a=e.tag;for(n=0,o=r.length;n<o;n+=1)T(e,t,r[n],!1,!1)&&(0!==n&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=a,e.dump="["+i+"]"}(e,p,e.dump),c&&(e.dump="&ref_"+u+" "+e.dump))}else{if("[object String]"!==l){if(e.skipInvalid)return!1;throw new o("unacceptable kind of an object to dump "+l)}"?"!==e.tag&&b(e,e.dump,t,a)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function w(e,t){var r=new p(t=t||{});return r.noRefs||function(e,t){var r,n,o=[],i=[];for(function e(t,r,n){var o,i,a;if(null!==t&&"object"==typeof t)if(-1!==(i=r.indexOf(t)))-1===n.indexOf(i)&&n.push(i);else if(r.push(t),Array.isArray(t))for(i=0,a=t.length;i<a;i+=1)e(t[i],r,n);else for(i=0,a=(o=Object.keys(t)).length;i<a;i+=1)e(t[o[i]],r,n)}(e,o,i),r=0,n=i.length;r<n;r+=1)t.duplicates.push(o[i[r]]);t.usedDuplicates=new Array(n)}(e,r),T(r,0,e,!0,!0)?r.dump+"\n":""}e.exports.dump=w,e.exports.safeDump=function(e,t){return w(e,n.extend({schema:a},t))}},function(e,t,r){"use strict";r(31),r(32),r(33),r(64),r(19),r(65),r(20),r(68),r(92),r(144),r(22),r(94),r(23);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var s=r(91),l=r(1),u=r(183),c=r(0),d=r(7),p=r(95),f=r(69),h=r(3),m=r(305),g=r(306),y=r(307),v=function(e){function t(t,r){void 0===r&&(r=!1);var n=e.call(this)||this;return n._hasDeclaration=!1,n._docTypeName="",n._hasDocumentElement=!1,n._currentElementSerialized=!1,n._openTags=[],n._ended=!1,n._fragment=r,n._options=l.applyDefaults(t||{},s.DefaultXMLBuilderCBOptions),n._builderOptions={defaultNamespace:n._options.defaultNamespace,namespaceAlias:n._options.namespaceAlias},"json"===n._options.format?n._writer=new g.JSONCBWriter(n._options):"yaml"===n._options.format?n._writer=new y.YAMLCBWriter(n._options):n._writer=new m.XMLCBWriter(n._options),void 0!==n._options.data&&n.on("data",n._options.data),void 0!==n._options.end&&n.on("end",n._options.end),void 0!==n._options.error&&n.on("error",n._options.error),n._prefixMap=new p.NamespacePrefixMap,n._prefixMap.set("xml",d.namespace.XML),n._prefixIndex={value:1},n._push(n._writer.frontMatter()),n}return o(t,e),t.prototype.ele=function(e,t,r){var n,o;if(l.isObject(e)||l.isString(e)&&(/^\s*</.test(e)||/^\s*[\{\[]/.test(e)||/^(\s*|(#.*)|(%.*))*---/.test(e))){var a=u.fragment().set(this._options);try{a.ele(e)}catch(e){return this.emit("error",e),this}try{for(var s=i(a.node.childNodes),c=s.next();!c.done;c=s.next()){var d=c.value;this._fromNode(d)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return this}if(this._serializeOpenTag(!0),!this._fragment&&this._hasDocumentElement&&0===this._writer.level)return this.emit("error",new Error("Document cannot have multiple document element nodes.")),this;try{this._currentElement=u.fragment(this._builderOptions).ele(e,t,r)}catch(e){return this.emit("error",e),this}return this._fragment||this._hasDocumentElement||""===this._docTypeName||this._currentElement.node._qualifiedName===this._docTypeName?(this._currentElementSerialized=!1,this._fragment||(this._hasDocumentElement=!0),this):(this.emit("error",new Error("Document element name does not match DocType declaration name.")),this)},t.prototype.att=function(e,t,r){if(void 0===this._currentElement)return this.emit("error",new Error("Cannot insert an attribute node as child of a document node.")),this;try{this._currentElement.att(e,t,r)}catch(e){return this.emit("error",e),this}return this},t.prototype.com=function(e){var t;this._serializeOpenTag(!0);try{t=u.fragment(this._builderOptions).com(e).first().node}catch(e){return this.emit("error",e),this}return!this._options.wellFormed||c.xml_isLegalChar(t.data)&&-1===t.data.indexOf("--")&&!t.data.endsWith("-")?(this._push(this._writer.comment(t.data)),this):(this.emit("error",new Error("Comment data contains invalid characters (well-formed required).")),this)},t.prototype.txt=function(e){if(!this._fragment&&void 0===this._currentElement)return this.emit("error",new Error("Cannot insert a text node as child of a document node.")),this;var t;this._serializeOpenTag(!0);try{t=u.fragment(this._builderOptions).txt(e).first().node}catch(e){return this.emit("error",e),this}if(this._options.wellFormed&&!c.xml_isLegalChar(t.data))return this.emit("error",new Error("Text data contains invalid characters (well-formed required).")),this;var r=t.data.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return this._push(this._writer.text(r)),this},t.prototype.ins=function(e,t){var r;void 0===t&&(t=""),this._serializeOpenTag(!0);try{r=u.fragment(this._builderOptions).ins(e,t).first().node}catch(e){return this.emit("error",e),this}return this._options.wellFormed&&(-1!==r.target.indexOf(":")||/^xml$/i.test(r.target))?(this.emit("error",new Error("Processing instruction target contains invalid characters (well-formed required).")),this):this._options.wellFormed&&!c.xml_isLegalChar(r.data)?(this.emit("error",Error("Processing instruction data contains invalid characters (well-formed required).")),this):(this._push(this._writer.instruction(r.target,r.data)),this)},t.prototype.dat=function(e){var t;this._serializeOpenTag(!0);try{t=u.fragment(this._builderOptions).dat(e).first().node}catch(e){return this.emit("error",e),this}return this._push(this._writer.cdata(t.data)),this},t.prototype.dec=function(e){return void 0===e&&(e={version:"1.0"}),this._fragment?(this.emit("error",Error("Cannot insert an XML declaration into a document fragment.")),this):this._hasDeclaration?(this.emit("error",Error("XML declaration is already inserted.")),this):(this._push(this._writer.declaration(e.version||"1.0",e.encoding,e.standalone)),this._hasDeclaration=!0,this)},t.prototype.dtd=function(e){if(this._fragment)return this.emit("error",Error("Cannot insert a DocType declaration into a document fragment.")),this;if(""!==this._docTypeName)return this.emit("error",new Error("DocType declaration is already inserted.")),this;if(this._hasDocumentElement)return this.emit("error",new Error("Cannot insert DocType declaration after document element.")),this;var t;try{t=u.create().dtd(e).first().node}catch(e){return this.emit("error",e),this}return this._options.wellFormed&&!c.xml_isPubidChar(t.publicId)?(this.emit("error",new Error("DocType public identifier does not match PubidChar construct (well-formed required).")),this):this._options.wellFormed&&(!c.xml_isLegalChar(t.systemId)||-1!==t.systemId.indexOf('"')&&-1!==t.systemId.indexOf("'"))?(this.emit("error",new Error("DocType system identifier contains invalid characters (well-formed required).")),this):(this._docTypeName=e.name,this._push(this._writer.docType(e.name,t.publicId,t.systemId)),this)},t.prototype.import=function(e){var t,r,n=u.fragment().set(this._options);try{n.import(e)}catch(e){return this.emit("error",e),this}try{for(var o=i(n.node.childNodes),a=o.next();!a.done;a=o.next()){var s=a.value;this._fromNode(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return this},t.prototype.up=function(){return this._serializeOpenTag(!1),this._serializeCloseTag(),this},t.prototype.end=function(){for(this._serializeOpenTag(!1);this._openTags.length>0;)this._serializeCloseTag();return this._push(null),this},t.prototype._serializeOpenTag=function(e){if(!this._currentElementSerialized&&void 0!==this._currentElement){var r=this._currentElement.node;if(!this._options.wellFormed||-1===r.localName.indexOf(":")&&c.xml_isName(r.localName)){var n="",o=!1,i=this._prefixMap.copy(),a={},s=this._recordNamespaceInformation(r,i,a),l=0===this._openTags.length?null:this._openTags[this._openTags.length-1][1],u=r.namespaceURI;if(null===u&&(u=l),l===u)null!==s&&(o=!0),n=u===d.namespace.XML?"xml:"+r.localName:r.localName,this._writer.beginElement(n),this._push(this._writer.openTagBegin(n));else{var p=r.prefix,f=null;if(null===p&&u===s||(f=i.get(p,u)),"xmlns"===p){if(this._options.wellFormed)return void this.emit("error",new Error("An element cannot have the 'xmlns' prefix (well-formed required)."));f=p}null!==f?(n=f+":"+r.localName,null!==s&&s!==d.namespace.XML&&(l=s||null),this._writer.beginElement(n),this._push(this._writer.openTagBegin(n))):null!==p?(p in a&&(p=this._generatePrefix(u,i,this._prefixIndex)),i.set(p,u),n+=p+":"+r.localName,this._writer.beginElement(n),this._push(this._writer.openTagBegin(n)),this._push(this._writer.attribute("xmlns:"+p,this._serializeAttributeValue(u,this._options.wellFormed))),null!==s&&(l=s||null)):null===s||null!==s&&s!==u?(o=!0,n+=r.localName,l=u,this._writer.beginElement(n),this._push(this._writer.openTagBegin(n)),this._push(this._writer.attribute("xmlns",this._serializeAttributeValue(u,this._options.wellFormed)))):(n+=r.localName,l=u,this._writer.beginElement(n),this._push(this._writer.openTagBegin(n)))}this._serializeAttributes(r,i,this._prefixIndex,a,o,this._options.wellFormed);var h=u===d.namespace.HTML;h&&!e&&t._VoidElementNames.has(r.localName)?(this._push(this._writer.openTagEnd(n,!0,!0)),this._writer.endElement(n)):h||e?this._push(this._writer.openTagEnd(n,!1,!1)):(this._push(this._writer.openTagEnd(n,!0,!1)),this._writer.endElement(n)),this._currentElementSerialized=!0,this._openTags.push([n,l,this._prefixMap,e]),this._isPrefixMapModified(this._prefixMap,i)&&(this._prefixMap=i),this._writer.level++}else this.emit("error",new Error("Node local name contains invalid characters (well-formed required)."))}},t.prototype._serializeCloseTag=function(){this._writer.level--;var e=this._openTags.pop();if(void 0!==e){var t=a(e,4),r=t[0],n=(t[1],t[2]),o=t[3];this._prefixMap=n,o&&(this._push(this._writer.closeTag(r)),this._writer.endElement(r))}else this.emit("error",new Error("Last element is undefined."))},t.prototype._push=function(e){null===e?(this._ended=!0,this.emit("end")):this._ended?this.emit("error",new Error("Cannot push to ended stream.")):0!==e.length&&(this._writer.hasData=!0,this.emit("data",e,this._writer.level))},t.prototype._fromNode=function(e){var t,r,n,o;if(h.Guard.isElementNode(e)){var a=e.prefix?e.prefix+":"+e.localName:e.localName;null!==e.namespaceURI?this.ele(e.namespaceURI,a):this.ele(a);try{for(var s=i(e.attributes),l=s.next();!l.done;l=s.next()){var u=l.value,c=u.prefix?u.prefix+":"+u.localName:u.localName;null!==u.namespaceURI?this.att(u.namespaceURI,c,u.value):this.att(c,u.value)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}try{for(var d=i(e.childNodes),p=d.next();!p.done;p=d.next()){var f=p.value;this._fromNode(f)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}this.up()}else h.Guard.isExclusiveTextNode(e)&&e.data?this.txt(e.data):h.Guard.isCommentNode(e)?this.com(e.data):h.Guard.isCDATASectionNode(e)?this.dat(e.data):h.Guard.isProcessingInstructionNode(e)&&this.ins(e.target,e.data)},t.prototype._serializeAttributes=function(e,t,r,n,o,a){var s,l,u=a?new f.LocalNameSet:void 0;try{for(var p=i(e.attributes),h=p.next();!h.done;h=p.next()){var m=h.value;if(a||o||null!==m.namespaceURI){if(a&&u&&u.has(m.namespaceURI,m.localName))return void this.emit("error",new Error("Element contains duplicate attributes (well-formed required)."));a&&u&&u.set(m.namespaceURI,m.localName);var g=m.namespaceURI,y=null;if(null!==g)if(y=t.get(m.prefix,g),g===d.namespace.XMLNS){if(m.value===d.namespace.XML||null===m.prefix&&o||null!==m.prefix&&(!(m.localName in n)||n[m.localName]!==m.value)&&t.has(m.localName,m.value))continue;if(a&&m.value===d.namespace.XMLNS)return void this.emit("error",new Error("XMLNS namespace is reserved (well-formed required)."));if(a&&""===m.value)return void this.emit("error",new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required)."));"xmlns"===m.prefix&&(y="xmlns")}else null===y&&(y=null===m.prefix||t.hasPrefix(m.prefix)&&!t.has(m.prefix,g)?this._generatePrefix(g,t,r):m.prefix,this._push(this._writer.attribute("xmlns:"+y,this._serializeAttributeValue(g,this._options.wellFormed))));if(a&&(-1!==m.localName.indexOf(":")||!c.xml_isName(m.localName)||"xmlns"===m.localName&&null===g))return void this.emit("error",new Error("Attribute local name contains invalid characters (well-formed required)."));this._push(this._writer.attribute((null!==y?y+":":"")+m.localName,this._serializeAttributeValue(m.value,this._options.wellFormed)))}else this._push(this._writer.attribute(m.localName,this._serializeAttributeValue(m.value,this._options.wellFormed)))}}catch(e){s={error:e}}finally{try{h&&!h.done&&(l=p.return)&&l.call(p)}finally{if(s)throw s.error}}},t.prototype._serializeAttributeValue=function(e,t){return t&&null!==e&&!c.xml_isLegalChar(e)?(this.emit("error",new Error("Invalid characters in attribute value.")),""):null===e?"":e.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},t.prototype._recordNamespaceInformation=function(e,t,r){var n,o,a=null;try{for(var s=i(e.attributes),l=s.next();!l.done;l=s.next()){var u=l.value,c=u.namespaceURI,p=u.prefix;if(c===d.namespace.XMLNS){if(null===p){a=u.value;continue}var f=u.localName,h=u.value;if(h===d.namespace.XML)continue;if(""===h&&(h=null),t.has(f,h))continue;t.set(f,h),r[f]=h||""}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return a},t.prototype._generatePrefix=function(e,t,r){var n="ns"+r.value;return r.value++,t.set(n,e),n},t.prototype._isPrefixMapModified=function(e,t){var r=e._items,n=t._items,o=e._nullItems,i=t._nullItems;for(var a in n){var s=r[a];if(void 0===s)return!0;var l=n[a];if(s.length!==l.length)return!0;for(var u=0;u<s.length;u++)if(s[u]!==l[u])return!0}if(o.length!==i.length)return!0;for(u=0;u<o.length;u++)if(o[u]!==i[u])return!0;return!1},t._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),t}(r(308).EventEmitter);t.XMLBuilderCBImpl=v},function(e,t,r){"use strict";r(74);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var r=e.call(this,t)||this;return r._lineLength=0,r}return o(t,e),t.prototype.frontMatter=function(){return""},t.prototype.declaration=function(e,t,r){var n=this._beginLine()+"<?xml";return n+=' version="'+e+'"',void 0!==t&&(n+=' encoding="'+t+'"'),void 0!==r&&(n+=' standalone="'+(r?"yes":"no")+'"'),n+"?>"},t.prototype.docType=function(e,t,r){return this._beginLine()+(t&&r?"<!DOCTYPE "+e+' PUBLIC "'+t+'" "'+r+'">':t?"<!DOCTYPE "+e+' PUBLIC "'+t+'">':r?"<!DOCTYPE "+e+' SYSTEM "'+r+'">':"<!DOCTYPE "+e+">")},t.prototype.comment=function(e){return this._beginLine()+"\x3c!--"+e+"--\x3e"},t.prototype.text=function(e){return this._beginLine()+e},t.prototype.instruction=function(e,t){return t?this._beginLine()+"<?"+e+" "+t+"?>":this._beginLine()+"<?"+e+"?>"},t.prototype.cdata=function(e){return this._beginLine()+"<![CDATA["+e+"]]>"},t.prototype.openTagBegin=function(e){return this._lineLength+=1+e.length,this._beginLine()+"<"+e},t.prototype.openTagEnd=function(e,t,r){return r?" />":t?this._writerOptions.allowEmptyTags?"></"+e+">":this._writerOptions.spaceBeforeSlash?" />":"/>":">"},t.prototype.closeTag=function(e){return this._beginLine()+"</"+e+">"},t.prototype.attribute=function(e,t){var r=e+'="'+t+'"';return this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._lineLength+1+r.length>this._writerOptions.width?(r=this._beginLine()+this._indent(1)+r,this._lineLength=r.length,r):(this._lineLength+=1+r.length," "+r)},t.prototype.beginElement=function(e){},t.prototype.endElement=function(e){},t.prototype._beginLine=function(){if(this._writerOptions.prettyPrint){var e=(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level);return this._lineLength=e.length,e}return""},t.prototype._indent=function(e){return e<=0?"":this._writerOptions.indent.repeat(e)},t}(r(114).BaseCBWriter);t.XMLCBWriter=i},function(e,t,r){"use strict";r(74);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var r=e.call(this,t)||this;return r._hasChildren=[],r._additionalLevel=0,r}return o(t,e),t.prototype.frontMatter=function(){return""},t.prototype.declaration=function(e,t,r){return""},t.prototype.docType=function(e,t,r){return""},t.prototype.comment=function(e){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.comment)+this._sep()+this._val(e)+this._sep()+"}"},t.prototype.text=function(e){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.text)+this._sep()+this._val(e)+this._sep()+"}"},t.prototype.instruction=function(e,t){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.ins)+this._sep()+this._val(t?e+" "+t:e)+this._sep()+"}"},t.prototype.cdata=function(e){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.cdata)+this._sep()+this._val(e)+this._sep()+"}"},t.prototype.attribute=function(e,t){return this._comma()+this._beginLine(1)+"{"+this._sep()+this._key(this._builderOptions.convert.att+e)+this._sep()+this._val(t)+this._sep()+"}"},t.prototype.openTagBegin=function(e){var t=this._comma()+this._beginLine()+"{"+this._sep()+this._key(e)+this._sep()+"{";return this._additionalLevel++,this.hasData=!0,t+=this._beginLine()+this._key(this._builderOptions.convert.text)+this._sep()+"[",this._hasChildren.push(!1),t},t.prototype.openTagEnd=function(e,t,r){if(t){var n=this._sep()+"]";return this._additionalLevel--,n+(this._beginLine()+"}")+this._sep()+"}"}return""},t.prototype.closeTag=function(e){var t=this._beginLine()+"]";return this._additionalLevel--,t+(this._beginLine()+"}")+this._sep()+"}"},t.prototype.beginElement=function(e){},t.prototype.endElement=function(e){this._hasChildren.pop()},t.prototype._beginLine=function(e){return void 0===e&&(e=0),this._writerOptions.prettyPrint?(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level+e):""},t.prototype._indent=function(e){return e+this._additionalLevel<=0?"":this._writerOptions.indent.repeat(e+this._additionalLevel)},t.prototype._comma=function(){var e=this._hasChildren[this._hasChildren.length-1]?",":"";return this._hasChildren.length>0&&(this._hasChildren[this._hasChildren.length-1]=!0),e},t.prototype._sep=function(){return this._writerOptions.prettyPrint?" ":""},t.prototype._key=function(e){return'"'+e+'":'},t.prototype._val=function(e){return JSON.stringify(e)},t}(r(114).BaseCBWriter);t.JSONCBWriter=i},function(e,t,r){"use strict";r(74);var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var r=e.call(this,t)||this;if(r._rootWritten=!1,r._additionalLevel=0,t.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(t.offset<0)throw new Error("YAML offset should be zero or a positive number.");return r}return o(t,e),t.prototype.frontMatter=function(){return this._beginLine()+"---"},t.prototype.declaration=function(e,t,r){return""},t.prototype.docType=function(e,t,r){return""},t.prototype.comment=function(e){return this._beginLine()+this._key(this._builderOptions.convert.comment)+" "+this._val(e)},t.prototype.text=function(e){return this._beginLine()+this._key(this._builderOptions.convert.text)+" "+this._val(e)},t.prototype.instruction=function(e,t){return this._beginLine()+this._key(this._builderOptions.convert.ins)+" "+this._val(t?e+" "+t:e)},t.prototype.cdata=function(e){return this._beginLine()+this._key(this._builderOptions.convert.cdata)+" "+this._val(e)},t.prototype.attribute=function(e,t){this._additionalLevel++;var r=this._beginLine()+this._key(this._builderOptions.convert.att+e)+" "+this._val(t);return this._additionalLevel--,r},t.prototype.openTagBegin=function(e){var t=this._beginLine()+this._key(e);return this._rootWritten||(this._rootWritten=!0),this.hasData=!0,this._additionalLevel++,t+(this._beginLine(!0)+this._key(this._builderOptions.convert.text))},t.prototype.openTagEnd=function(e,t,r){return t?" "+this._val(""):""},t.prototype.closeTag=function(e){return this._additionalLevel--,""},t.prototype.beginElement=function(e){},t.prototype.endElement=function(e){},t.prototype._beginLine=function(e){return void 0===e&&(e=!1),(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level,e)},t.prototype._indent=function(e,t){if(e+this._additionalLevel<=0)return"";var r=this._writerOptions.indent.repeat(e+this._additionalLevel);return!t&&this._rootWritten?r.substr(0,r.length-2)+"-"+r.substr(-1,1):r},t.prototype._key=function(e){return'"'+e+'":'},t.prototype._val=function(e){return JSON.stringify(e)},t}(r(114).BaseCBWriter);t.YAMLCBWriter=i},function(e,t,r){"use strict";var n,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var o,i,a,s;if(u(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=p.bind(n);return o.listener=r,n.wrapFn=o,o}function h(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):g(o,o.length)}function m(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function g(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=g(l,u);for(r=0;r<u;++r)i(c[r],this,t)}return!0},s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return u(t),this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,o,i,a;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(77);t.createCB=function(e){return new n.XMLBuilderCBImpl(e)},t.fragmentCB=function(e){return new n.XMLBuilderCBImpl(e,!0)}}])},234(){}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n=r(581);return n.default})());