From 7335b57c647f86ce2fce9f0f7e3d2aff466a906f Mon Sep 17 00:00:00 2001 From: manzt Date: Tue, 14 Nov 2023 19:21:25 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=202198e?= =?UTF-8?q?5088a592843e18f0f1e536b7b2e215739f4=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{deflate-23b66e04.js => deflate-b9c4caee.js} | 2 +- assets/{index-fc258553.js => index-5def9da2.js} | 10 +++++----- assets/{jpeg-9b086afd.js => jpeg-8a2bf234.js} | 2 +- assets/{lerc-4e0c4a18.js => lerc-88516884.js} | 2 +- assets/{lzw-6314c407.js => lzw-a289c327.js} | 2 +- assets/{packbits-635cec19.js => packbits-7b7e1ed7.js} | 2 +- assets/raw-3a484560.js | 1 - assets/raw-7e701714.js | 1 + assets/{webimage-c7e44b7e.js => webimage-f3ac474a.js} | 2 +- index.html | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) rename assets/{deflate-23b66e04.js => deflate-b9c4caee.js} (63%) rename assets/{index-fc258553.js => index-5def9da2.js} (88%) rename assets/{jpeg-9b086afd.js => jpeg-8a2bf234.js} (99%) rename assets/{lerc-4e0c4a18.js => lerc-88516884.js} (99%) rename assets/{lzw-6314c407.js => lzw-a289c327.js} (95%) rename assets/{packbits-635cec19.js => packbits-7b7e1ed7.js} (81%) delete mode 100644 assets/raw-3a484560.js create mode 100644 assets/raw-7e701714.js rename assets/{webimage-c7e44b7e.js => webimage-f3ac474a.js} (90%) diff --git a/assets/deflate-23b66e04.js b/assets/deflate-b9c4caee.js similarity index 63% rename from assets/deflate-23b66e04.js rename to assets/deflate-b9c4caee.js index 178507bd0..29310e03e 100644 --- a/assets/deflate-23b66e04.js +++ b/assets/deflate-b9c4caee.js @@ -1 +1 @@ -import{i as r}from"./pako.esm-147cf1d7.js";import{B as a}from"./index-fc258553.js";class s extends a{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{s as default}; +import{i as r}from"./pako.esm-147cf1d7.js";import{B as a}from"./index-5def9da2.js";class s extends a{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{s as default}; diff --git a/assets/index-fc258553.js b/assets/index-5def9da2.js similarity index 88% rename from assets/index-fc258553.js rename to assets/index-5def9da2.js index cba0fc7df..22b6a7fd2 100644 --- a/assets/index-fc258553.js +++ b/assets/index-5def9da2.js @@ -2074,12 +2074,12 @@ void main(void) { DECKGL_FILTER_COLOR(gl_FragColor, geometry); } -`,g$={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:e=>e.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};class Am extends dn{constructor(...A){super(...A),y(this,"state",void 0)}getShaders(){return super.getShaders({vs:s$,fs:a$,modules:[Bo,Eo]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(A){super.updateState(A);const{changeFlags:t}=A;if(t.extensionsChanged){var n;const{gl:i}=this.context;(n=this.state.model)===null||n===void 0||n.delete(),this.state.model=this._getModel(i),this.getAttributeManager().invalidateAll()}}draw({uniforms:A}){const{billboard:t,sizeScale:n,sizeUnits:i,sizeMinPixels:r,sizeMaxPixels:o,getLineWidth:s}=this.props;let{padding:a}=this.props;a.length<4&&(a=[a[0],a[1],a[0],a[1]]),this.state.model.setUniforms(A).setUniforms({billboard:t,stroked:!!s,padding:a,sizeUnits:to[i],sizeScale:n,sizeMinPixels:r,sizeMaxPixels:o}).draw()}_getModel(A){const t=[0,0,1,0,1,1,0,1];return new Nn(A,{...this.getShaders(),id:this.props.id,geometry:new xi({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(t)}}}),isInstanced:!0})}}y(Am,"defaultProps",g$);y(Am,"layerName","TextBackgroundLayer");const a1={start:1,middle:0,end:-1},g1={top:1,center:0,bottom:-1},Hf=[0,0,0,255],I$=1,l$={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:Hf},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:PI.characterSet},fontFamily:PI.fontFamily,fontWeight:PI.fontWeight,lineHeight:I$,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:Hf},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:e=>e.text},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:Hf},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};class Ec extends Zn{constructor(...A){super(...A),y(this,"state",void 0),y(this,"getBoundingRect",(t,n)=>{const i=this.state.fontAtlasManager.mapping,r=this.state.getText,{wordBreak:o,maxWidth:s,lineHeight:a,getTextAnchor:g,getAlignmentBaseline:I}=this.props,l=r(t,n)||"",{size:[c,C]}=i1(l,a,o,s,i),u=a1[typeof g=="function"?g(t,n):g],E=g1[typeof I=="function"?I(t,n):I];return[(u-1)*c/2,(E-1)*C/2,c,C]}),y(this,"getIconOffsets",(t,n)=>{const i=this.state.fontAtlasManager.mapping,r=this.state.getText,{wordBreak:o,maxWidth:s,lineHeight:a,getTextAnchor:g,getAlignmentBaseline:I}=this.props,l=r(t,n)||"",{x:c,y:C,rowWidth:u,size:[E,B]}=i1(l,a,o,s,i),h=a1[typeof g=="function"?g(t,n):g],f=g1[typeof I=="function"?I(t,n):I],Q=c.length,d=new Array(Q*2);let w=0;for(let m=0;m=0?this.props.data[A.index]:null,A}_updateFontAtlas(){const{fontSettings:A,fontFamily:t,fontWeight:n}=this.props,{fontAtlasManager:i,characterSet:r}=this.state,o={...A,characterSet:r,fontFamily:t,fontWeight:n};if(!i.mapping)return i.setProps(o),!0;for(const s in o)if(o[s]!==i.props[s])return i.setProps(o),!0;return!1}_updateText(){var A;const{data:t,characterSet:n}=this.props,i=(A=t.attributes)===null||A===void 0?void 0:A.getText;let{getText:r}=this.props,o=t.startIndices,s;const a=n==="auto"&&new Set;if(i&&o){const{texts:g,characterCount:I}=A$({...ArrayBuffer.isView(i)?{value:i}:i,length:t.length,startIndices:o,characterSet:a});s=I,r=(l,{index:c})=>g[c]}else{const{iterable:g,objectInfo:I}=uc(t);o=[0],s=0;for(const l of g){I.index++;const c=Array.from(r(l,I)||"");a&&c.forEach(a.add,a),s+=c.length,o.push(s)}}this.setState({getText:r,startIndices:o,numInstances:s,characterSet:a||n})}renderLayers(){const{startIndices:A,numInstances:t,getText:n,fontAtlasManager:{scale:i,texture:r,mapping:o},styleVersion:s}=this.state,{data:a,_dataDiff:g,getPosition:I,getColor:l,getSize:c,getAngle:C,getPixelOffset:u,getBackgroundColor:E,getBorderColor:B,getBorderWidth:h,backgroundPadding:f,background:Q,billboard:d,fontSettings:w,outlineWidth:m,outlineColor:v,sizeScale:x,sizeUnits:D,sizeMinPixels:F,sizeMaxPixels:N,transitions:M,updateTriggers:P}=this.props,H=this.getSubLayerClass("characters",Zy),W=this.getSubLayerClass("background",Am);return[Q&&new W({getFillColor:E,getLineColor:B,getLineWidth:h,padding:f,getPosition:I,getSize:c,getAngle:C,getPixelOffset:u,billboard:d,sizeScale:x/this.state.fontAtlasManager.props.fontSize,sizeUnits:D,sizeMinPixels:F,sizeMaxPixels:N,transitions:M&&{getPosition:M.getPosition,getAngle:M.getAngle,getSize:M.getSize,getFillColor:M.getBackgroundColor,getLineColor:M.getBorderColor,getLineWidth:M.getBorderWidth,getPixelOffset:M.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:P.getPosition,getAngle:P.getAngle,getSize:P.getSize,getFillColor:P.getBackgroundColor,getLineColor:P.getBorderColor,getLineWidth:P.getBorderWidth,getPixelOffset:P.getPixelOffset,getBoundingRect:{getText:P.getText,getTextAnchor:P.getTextAnchor,getAlignmentBaseline:P.getAlignmentBaseline,styleVersion:s}}}),{data:a.attributes&&a.attributes.background?{length:a.length,attributes:a.attributes.background}:a,_dataDiff:g,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new H({sdf:w.sdf,smoothing:Number.isFinite(w.smoothing)?w.smoothing:PI.smoothing,outlineWidth:m,outlineColor:v,iconAtlas:r,iconMapping:o,getPosition:I,getColor:l,getSize:c,getAngle:C,getPixelOffset:u,billboard:d,sizeScale:x*i,sizeUnits:D,sizeMinPixels:F*i,sizeMaxPixels:N*i,transitions:M&&{getPosition:M.getPosition,getAngle:M.getAngle,getColor:M.getColor,getSize:M.getSize,getPixelOffset:M.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getIcon:P.getText,getPosition:P.getPosition,getAngle:P.getAngle,getColor:P.getColor,getSize:P.getSize,getPixelOffset:P.getPixelOffset,getIconOffsets:{getText:P.getText,getTextAnchor:P.getTextAnchor,getAlignmentBaseline:P.getAlignmentBaseline,styleVersion:s}}}),{data:a,_dataDiff:g,startIndices:A,numInstances:t,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(A){r$(A)}}y(Ec,"defaultProps",l$);y(Ec,"layerName","TextLayer");const au={circle:{type:jy,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:bE,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:Ec,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},gu={type:GE,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},a0={type:TE,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function jg({type:e,props:A}){const t={};for(const n in A)t[n]=e.defaultProps[A[n]];return t}function qf(e,A){const{transitions:t,updateTriggers:n}=e.props,i={updateTriggers:{},transitions:t&&{getPosition:t.geometry}};for(const r in A){const o=A[r];let s=e.props[r];r.startsWith("get")&&(s=e.getSubLayerAccessor(s),i.updateTriggers[o]=n[r],t&&(i.transitions[o]=t[r])),i[o]=s}return i}function c$(e){if(Array.isArray(e))return e;switch(oe.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return oe.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}function I1(e,A,t={}){const n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:i=0,endRow:r=e.length}=t;for(let o=i;o{s.push(t({geometry:{type:"Point",coordinates:l}},n,i))});break;case"LineString":a.push(t({geometry:e},n,i));break;case"MultiLineString":o.forEach(l=>{a.push(t({geometry:{type:"LineString",coordinates:l}},n,i))});break;case"Polygon":g.push(t({geometry:e},n,i)),o.forEach(l=>{I.push(t({geometry:{type:"LineString",coordinates:l}},n,i))});break;case"MultiPolygon":o.forEach(l=>{g.push(t({geometry:{type:"Polygon",coordinates:l}},n,i)),l.forEach(c=>{I.push(t({geometry:{type:"LineString",coordinates:c}},n,i))})});break}}const C$={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function u$(e,A){let t=C$[e];for(oe.assert(t,"Unknown GeoJSON type ".concat(e));A&&--t>0;)A=A[0];return A&&Number.isFinite(A[0])}function sG(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function uC(e){return e.geometry.coordinates}function B$(e,A){const t=sG(),{pointFeatures:n,lineFeatures:i,polygonFeatures:r,polygonOutlineFeatures:o}=e;return t.points.data=n,t.points._dataDiff=A.pointFeatures&&(()=>A.pointFeatures),t.points.getPosition=uC,t.lines.data=i,t.lines._dataDiff=A.lineFeatures&&(()=>A.lineFeatures),t.lines.getPath=uC,t.polygons.data=r,t.polygons._dataDiff=A.polygonFeatures&&(()=>A.polygonFeatures),t.polygons.getPolygon=uC,t.polygonsOutline.data=o,t.polygonsOutline._dataDiff=A.polygonOutlineFeatures&&(()=>A.polygonOutlineFeatures),t.polygonsOutline.getPath=uC,t}function E$(e,A){const t=sG(),{points:n,lines:i,polygons:r}=e,o=PZ(e,A);return t.points.data={length:n.positions.value.length/n.positions.size,attributes:{...n.attributes,getPosition:n.positions,instancePickingColors:{size:3,value:o.points}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},t.lines.data={length:i.pathIndices.value.length-1,startIndices:i.pathIndices.value,attributes:{...i.attributes,getPath:i.positions,instancePickingColors:{size:3,value:o.lines}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},t.lines._pathType="open",t.polygons.data={length:r.polygonIndices.value.length-1,startIndices:r.polygonIndices.value,attributes:{...r.attributes,getPolygon:r.positions,pickingColors:{size:3,value:o.polygons}},properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},t.polygons._normalize=!1,r.triangles&&(t.polygons.data.attributes.indices=r.triangles.value),t.polygonsOutline.data={length:r.primitivePolygonIndices.value.length-1,startIndices:r.primitivePolygonIndices.value,attributes:{...r.attributes,getPath:r.positions,instancePickingColors:{size:3,value:o.polygons}},properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},t.polygonsOutline._pathType="open",t}const h$=["points","linestrings","polygons"],f$={...jg(au.circle),...jg(au.icon),...jg(au.text),...jg(gu),...jg(a0),stroked:!0,filled:!0,extruded:!1,wireframe:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:e=>e.properties.icon},getText:{type:"accessor",value:e=>e.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}};class em extends Zn{initializeState(){this.state={layerProps:{},features:{}}}updateState({props:A,changeFlags:t}){if(!t.dataChanged)return;const{data:n}=this.props,i=n&&"points"in n&&"polygons"in n&&"lines"in n;this.setState({binary:i}),i?this._updateStateBinary({props:A,changeFlags:t}):this._updateStateJSON({props:A,changeFlags:t})}_updateStateBinary({props:A,changeFlags:t}){const n=E$(A.data,this.encodePickingColor);this.setState({layerProps:n})}_updateStateJSON({props:A,changeFlags:t}){const n=c$(A.data),i=this.getSubLayerRow.bind(this);let r={};const o={};if(Array.isArray(t.dataChanged)){const a=this.state.features;for(const g in a)r[g]=a[g].slice(),o[g]=[];for(const g of t.dataChanged){const I=I1(n,i,g);for(const l in a)o[l].push(eG({data:r[l],getIndex:c=>c.__source.index,dataRange:g,replace:I[l]}))}}else r=I1(n,i);const s=B$(r,o);this.setState({features:r,featuresDiff:o,layerProps:s})}getPickingInfo(A){const t=super.getPickingInfo(A),{index:n,sourceLayer:i}=t;return t.featureType=h$.find(r=>i.id.startsWith("".concat(this.id,"-").concat(r,"-"))),n>=0&&i.id.startsWith("".concat(this.id,"-points-text"))&&this.state.binary&&(t.index=this.props.data.points.globalFeatureIds.value[n]),t}_updateAutoHighlight(A){const t="".concat(this.id,"-points-"),n=A.featureType==="points";for(const i of this.getSubLayers())i.id.startsWith(t)===n&&i.updateAutoHighlight(A)}_renderPolygonLayer(){const{extruded:A,wireframe:t}=this.props,{layerProps:n}=this.state,i="polygons-fill",r=this.shouldRenderSubLayer(i,n.polygons.data)&&this.getSubLayerClass(i,a0.type);if(r){const o=qf(this,a0.props),s=A&&t;return s||delete o.getLineColor,o.updateTriggers.lineColors=s,new r(o,this.getSubLayerProps({id:i,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){const{extruded:A,stroked:t}=this.props,{layerProps:n}=this.state,i="polygons-stroke",r="linestrings",o=!A&&t&&this.shouldRenderSubLayer(i,n.polygonsOutline.data)&&this.getSubLayerClass(i,gu.type),s=this.shouldRenderSubLayer(r,n.lines.data)&&this.getSubLayerClass(r,gu.type);if(o||s){const a=qf(this,gu.props);return[o&&new o(a,this.getSubLayerProps({id:i,updateTriggers:a.updateTriggers}),n.polygonsOutline),s&&new s(a,this.getSubLayerProps({id:r,updateTriggers:a.updateTriggers}),n.lines)]}return null}_renderPointLayers(){const{pointType:A}=this.props,{layerProps:t,binary:n}=this.state;let{highlightedObjectIndex:i}=this.props;!n&&Number.isFinite(i)&&(i=t.points.data.findIndex(s=>s.__source.index===i));const r=new Set(A.split("+")),o=[];for(const s of r){const a="points-".concat(s),g=au[s],I=g&&this.shouldRenderSubLayer(a,t.points.data)&&this.getSubLayerClass(a,g.type);if(I){const l=qf(this,g.props);let c=t.points;if(s==="text"&&n){const{instancePickingColors:C,...u}=c.data.attributes;c={...c,data:{...c.data,attributes:u}}}o.push(new I(l,this.getSubLayerProps({id:a,updateTriggers:l.updateTriggers,highlightedObjectIndex:i}),c))}}return o}renderLayers(){const{extruded:A}=this.props,t=this._renderPolygonLayer(),n=this._renderLineLayers(),i=this._renderPointLayers();return[!A&&t,n,i,A&&t]}getSubLayerAccessor(A){const{binary:t}=this.state;return!t||typeof A!="function"?super.getSubLayerAccessor(A):(n,i)=>{const{data:r,index:o}=i,s=TZ(r,o);return A(s,i)}}}y(em,"layerName","GeoJsonLayer");y(em,"defaultProps",f$);class Q${constructor(A){y(this,"index",void 0),y(this,"isVisible",void 0),y(this,"isSelected",void 0),y(this,"parent",void 0),y(this,"children",void 0),y(this,"content",void 0),y(this,"state",void 0),y(this,"layers",void 0),y(this,"id",void 0),y(this,"bbox",void 0),y(this,"zoom",void 0),y(this,"userData",void 0),y(this,"_abortController",void 0),y(this,"_loader",void 0),y(this,"_loaderId",void 0),y(this,"_isLoaded",void 0),y(this,"_isCancelled",void 0),y(this,"_needsReload",void 0),this.index=A,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return!!this._loader&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const A=this.content?this.content.byteLength:0;return Number.isFinite(A)||oe.error("byteLength not defined in tile data")(),A}async _loadData({getData:A,requestScheduler:t,onLoad:n,onError:i}){const{index:r,id:o,bbox:s,userData:a,zoom:g}=this,I=this._loaderId;this._abortController=new AbortController;const{signal:l}=this._abortController,c=await t.scheduleRequest(this,E=>E.isSelected?1:-1);if(!c){this._isCancelled=!0;return}if(this._isCancelled){c.done();return}let C=null,u;try{C=await A({index:r,id:o,bbox:s,userData:a,zoom:g,signal:l})}catch(E){u=E||!0}finally{c.done()}if(I===this._loaderId){if(this._loader=void 0,this.content=C,this._isCancelled&&!C){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,u?i(u,this):n(this)}}loadData(A){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(A),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){var A;this.isLoaded||(this._isCancelled=!0,(A=this._abortController)===null||A===void 0||A.abort())}}const Mt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},c1=new QA,d$=new QA;class tm{constructor(A=[0,0,0],t=[0,0,0],n){y(this,"center",void 0),y(this,"halfDiagonal",void 0),y(this,"minimum",void 0),y(this,"maximum",void 0),n=n||c1.copy(A).add(t).scale(.5),this.center=new QA(n),this.halfDiagonal=new QA(t).subtract(this.center),this.minimum=new QA(A),this.maximum=new QA(t)}clone(){return new tm(this.minimum,this.maximum,this.center)}equals(A){return this===A||!!A&&this.minimum.equals(A.minimum)&&this.maximum.equals(A.maximum)}transform(A){return this.center.transformAsPoint(A),this.halfDiagonal.transform(A),this.minimum.transform(A),this.maximum.transform(A),this}intersectPlane(A){const{halfDiagonal:t}=this,n=d$.from(A.normal),i=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),r=this.center.dot(n)+A.distance;return r-i>0?Mt.INSIDE:r+i<0?Mt.OUTSIDE:Mt.INTERSECTING}distanceTo(A){return Math.sqrt(this.distanceSquaredTo(A))}distanceSquaredTo(A){const t=c1.from(A).subtract(this.center),{halfDiagonal:n}=this;let i=0,r;return r=Math.abs(t.x)-n.x,r>0&&(i+=r*r),r=Math.abs(t.y)-n.y,r>0&&(i+=r*r),r=Math.abs(t.z)-n.z,r>0&&(i+=r*r),i}}const Xg=new QA,C1=new QA;class nm{constructor(A=[0,0,0],t=0){y(this,"center",void 0),y(this,"radius",void 0),this.radius=-0,this.center=new QA,this.fromCenterRadius(A,t)}fromCenterRadius(A,t){return this.center.from(A),this.radius=t,this}fromCornerPoints(A,t){return t=Xg.from(t),this.center=new QA().from(A).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(A){return this===A||!!A&&this.center.equals(A.center)&&this.radius===A.radius}clone(){return new nm(this.center,this.radius)}union(A){const t=this.center,n=this.radius,i=A.center,r=A.radius,o=Xg.copy(i).subtract(t),s=o.magnitude();if(n>=s+r)return this.clone();if(r>=s+n)return A.clone();const a=(n+s+r)*.5;return C1.copy(o).scale((-n+a)/s).add(t),this.center.copy(C1),this.radius=a,this}expand(A){const n=Xg.from(A).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(A){this.center.transform(A);const t=K9(Xg,A);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(A){const t=this.distanceTo(A);return t*t}distanceTo(A){const n=Xg.from(A).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(A){const t=this.center,n=this.radius,r=A.normal.dot(t)+A.distance;return r<-n?Mt.OUTSIDE:r=a?Mt.INSIDE:Mt.INTERSECTING}distanceTo(A){return Math.sqrt(this.distanceSquaredTo(A))}distanceSquaredTo(A){const t=y$.from(A).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,BC),r=n.getColumn(1,EC),o=n.getColumn(2,hC),s=i.magnitude(),a=r.magnitude(),g=o.magnitude();i.normalize(),r.normalize(),o.normalize();let I=0,l;return l=Math.abs(t.dot(i))-s,l>0&&(I+=l*l),l=Math.abs(t.dot(r))-a,l>0&&(I+=l*l),l=Math.abs(t.dot(o))-g,l>0&&(I+=l*l),I}computePlaneDistances(A,t,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const o=this.center,s=this.halfAxes,a=s.getColumn(0,BC),g=s.getColumn(1,EC),I=s.getColumn(2,hC),l=m$.copy(a).add(g).add(I).add(o),c=w$.copy(l).subtract(A);let C=t.dot(c);return i=Math.min(C,i),r=Math.max(C,r),l.copy(o).add(a).add(g).subtract(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),l.copy(o).add(a).subtract(g).add(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),l.copy(o).add(a).subtract(g).subtract(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),o.copy(l).subtract(a).add(g).add(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),o.copy(l).subtract(a).add(g).subtract(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),o.copy(l).subtract(a).subtract(g).add(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),o.copy(l).subtract(a).subtract(g).subtract(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),n[0]=i,n[1]=r,n}transform(A){this.center.transformAsPoint(A);const t=this.halfAxes.getColumn(0,BC);t.transformAsPoint(A);const n=this.halfAxes.getColumn(1,EC);n.transformAsPoint(A);const i=this.halfAxes.getColumn(2,hC);return i.transformAsPoint(A),this.halfAxes=new St([...t,...n,...i]),this}getTransform(){throw new Error("not implemented")}}const u1=new QA,B1=new QA;class ns{constructor(A=[0,0,1],t=0){y(this,"normal",void 0),y(this,"distance",void 0),this.normal=new QA,this.distance=-0,this.fromNormalDistance(A,t)}fromNormalDistance(A,t){return fl(Number.isFinite(t)),this.normal.from(A).normalize(),this.distance=t,this}fromPointNormal(A,t){A=u1.from(A),this.normal.from(t).normalize();const n=-this.normal.dot(A);return this.distance=n,this}fromCoefficients(A,t,n,i){return this.normal.set(A,t,n),fl(yi(this.normal.len(),1)),this.distance=i,this}clone(){return new ns(this.normal,this.distance)}equals(A){return yi(this.distance,A.distance)&&yi(this.normal,A.normal)}getPointDistance(A){return this.normal.dot(A)+this.distance}transform(A){const t=B1.copy(this.normal).transformAsVector(A).normalize(),n=this.normal.scale(-this.distance).transform(A);return this.fromPointNormal(n,t)}projectPointOntoPlane(A,t=[0,0,0]){A=u1.from(A);const n=this.getPointDistance(A),i=B1.copy(this.normal).scale(n);return A.subtract(i).to(t)}}const E1=[new QA([1,0,0]),new QA([0,1,0]),new QA([0,0,1])],h1=new QA,v$=new QA;new ns(new QA(1,0,0),0);class Vi{constructor(A=[]){y(this,"planes",void 0),this.planes=A}fromBoundingSphere(A){this.planes.length=2*E1.length;const t=A.center,n=A.radius;let i=0;for(const r of E1){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new ns),s||(s=this.planes[i+1]=new ns);const a=h1.copy(r).scale(-n).add(t);-r.dot(a),o.fromPointNormal(a,r);const g=h1.copy(r).scale(n).add(t),I=v$.copy(r).negate();-I.dot(g),s.fromPointNormal(g,I),i+=2}return this}computeVisibility(A){let t=Mt.INSIDE;for(const n of this.planes)switch(A.intersectPlane(n)){case Mt.OUTSIDE:return Mt.OUTSIDE;case Mt.INTERSECTING:t=Mt.INTERSECTING;break}return t}computeVisibilityWithPlaneMask(A,t){if(fl(Number.isFinite(t),"parentPlaneMask is required."),t===Vi.MASK_OUTSIDE||t===Vi.MASK_INSIDE)return t;let n=Vi.MASK_INSIDE;const i=this.planes;for(let r=0;ra;)N$(s,fC),f1.copy(fC).transpose(),s.multiplyRight(fC),s.multiplyLeft(f1),o.multiplyRight(fC),++i>2&&(++r,i=0);return A.unitary=o.toTarget(A.unitary),A.diagonal=s.toTarget(A.diagonal),A}function x$(e){let A=0;for(let t=0;t<9;++t){const n=e[t];A+=n*n}return Math.sqrt(A)}const g0=[1,0,0],I0=[2,2,1];function F$(e){let A=0;for(let t=0;t<3;++t){const n=e[gi.getElementIndex(I0[t],g0[t])];A+=2*n*n}return Math.sqrt(A)}function N$(e,A){const t=nb.EPSILON15;let n=0,i=1;for(let g=0;g<3;++g){const I=Math.abs(e[gi.getElementIndex(I0[g],g0[g])]);I>n&&(i=g,n=I)}const r=g0[i],o=I0[i];let s=1,a=0;if(Math.abs(e[gi.getElementIndex(o,r)])>t){const g=e[gi.getElementIndex(o,o)],I=e[gi.getElementIndex(r,r)],l=e[gi.getElementIndex(o,r)],c=(g-I)/2/l;let C;c<0?C=-1/(-c+Math.sqrt(1+c*c)):C=1/(c+Math.sqrt(1+c*c)),s=1/Math.sqrt(1+C*C),a=C*s}return St.IDENTITY.to(A),A[gi.getElementIndex(r,r)]=A[gi.getElementIndex(o,o)]=s,A[gi.getElementIndex(o,r)]=a,A[gi.getElementIndex(r,o)]=-a,A}const dr=new QA,_$=new QA,L$=new QA,b$=new QA,G$=new QA,k$=new St,M$={diagonal:new St,unitary:new St};function T$(e,A=new im){if(!e||e.length===0)return A.halfAxes=new St([0,0,0,0,0,0,0,0,0]),A.center=new QA,A;const t=e.length,n=new QA(0,0,0);for(const D of e)n.add(D);const i=1/t;n.multiplyByScalar(i);let r=0,o=0,s=0,a=0,g=0,I=0;for(const D of e){const F=dr.copy(D).subtract(n);r+=F.x*F.x,o+=F.x*F.y,s+=F.x*F.z,a+=F.y*F.y,g+=F.y*F.z,I+=F.z*F.z}r*=i,o*=i,s*=i,a*=i,g*=i,I*=i;const l=k$;l[0]=r,l[1]=o,l[2]=s,l[3]=o,l[4]=a,l[5]=g,l[6]=s,l[7]=g,l[8]=I;const{unitary:c}=R$(l,M$),C=A.halfAxes.copy(c);let u=C.getColumn(0,L$),E=C.getColumn(1,b$),B=C.getColumn(2,G$),h=-Number.MAX_VALUE,f=-Number.MAX_VALUE,Q=-Number.MAX_VALUE,d=Number.MAX_VALUE,w=Number.MAX_VALUE,m=Number.MAX_VALUE;for(const D of e)dr.copy(D),h=Math.max(dr.dot(u),h),f=Math.max(dr.dot(E),f),Q=Math.max(dr.dot(B),Q),d=Math.min(dr.dot(u),d),w=Math.min(dr.dot(E),w),m=Math.min(dr.dot(B),m);u=u.multiplyByScalar(.5*(d+h)),E=E.multiplyByScalar(.5*(w+f)),B=B.multiplyByScalar(.5*(m+Q)),A.center.copy(u).add(E).add(B);const v=_$.set(h-d,f-w,Q-m).multiplyByScalar(.5),x=new St([v[0],0,0,0,v[1],0,0,0,v[2]]);return A.halfAxes.multiplyRight(x),A}const la=512,Q1=3,aG=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],gG=aG.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),U$=gG.concat([[.25,.5],[.75,.5]]);class ca{constructor(A,t,n){y(this,"x",void 0),y(this,"y",void 0),y(this,"z",void 0),y(this,"childVisible",void 0),y(this,"selected",void 0),y(this,"_children",void 0),this.x=A,this.y=t,this.z=n}get children(){if(!this._children){const A=this.x*2,t=this.y*2,n=this.z+1;this._children=[new ca(A,t,n),new ca(A,t+1,n),new ca(A+1,t,n),new ca(A+1,t+1,n)]}return this._children}update(A){const{viewport:t,cullingVolume:n,elevationBounds:i,minZ:r,maxZ:o,bounds:s,offset:a,project:g}=A,I=this.getBoundingVolume(i,a,g);if(s&&!this.insideBounds(s)||n.computeVisibility(I)<0)return!1;if(!this.childVisible){let{z:c}=this;if(c=r){const C=I.distanceTo(t.cameraPosition)*t.scale/t.height;c+=Math.floor(Math.log2(C))}if(c>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const c of this.children)c.update(A);return!0}getSelected(A=[]){if(this.selected&&A.push(this),this._children)for(const t of this._children)t.getSelected(A);return A}insideBounds([A,t,n,i]){const r=Math.pow(2,this.z),o=la/r;return this.x*oA&&(this.y+1)*o>t}getBoundingVolume(A,t,n){if(n){const a=this.z<1?U$:this.z<2?gG:aG,g=[];for(const I of a){const l=l0(this.x+I[0],this.y+I[1],this.z);l[2]=A[0],g.push(n(l)),A[0]!==A[1]&&(l[2]=A[1],g.push(n(l)))}return T$(g)}const i=Math.pow(2,this.z),r=la/i,o=this.x*r+t*la,s=la-(this.y+1)*r;return new tm([o,s,A[0]],[o+r,s+r,A[1]])}}function P$(e,A,t,n){const i=e instanceof cX&&e.resolution?e.projectPosition:null,r=Object.values(e.getFrustumPlanes()).map(({normal:C,distance:u})=>new ns(C.clone().negate(),u)),o=new Vi(r),s=e.distanceScales.unitsPerMeter[2],a=t&&t[0]*s||0,g=t&&t[1]*s||0,I=e instanceof Si&&e.pitch<=60?A:0;if(n){const[C,u,E,B]=n,h=no([C,B]),f=no([E,u]);n=[h[0],la-h[1],f[0],la-f[1]]}const l=new ca(0,0,0),c={viewport:e,project:i,cullingVolume:o,elevationBounds:[a,g],minZ:I,maxZ:A,bounds:n,offset:0};if(l.update(c),e instanceof Si&&e.subViewports&&e.subViewports.length>1){for(c.offset=-1;l.update(c)&&!(--c.offset<-Q1););for(c.offset=1;l.update(c)&&!(++c.offset>Q1););}return l.getSelected()}const er=512,H$=[-1/0,-1/0,1/0,1/0],q$={type:"url",value:null,validate:(e,A)=>A.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string"),equals:(e,A)=>{if(e===A)return!0;if(!Array.isArray(e)||!Array.isArray(A))return!1;const t=e.length;if(t!==A.length)return!1;for(let n=0;ni[0])),Math.min(...t.map(i=>i[1])),Math.max(...t.map(i=>i[0])),Math.max(...t.map(i=>i[1]))]}function J$(e){return Math.abs(e.split("").reduce((A,t)=>(A<<5)-A+t.charCodeAt(0)|0,0))}function O$(e,A){if(!e||!e.length)return null;const{index:t,id:n}=A;if(Array.isArray(e)){const r=J$(n)%e.length;e=e[r]}let i=e;for(const r of Object.keys(t)){const o=new RegExp("{".concat(r,"}"),"g");i=i.replace(o,String(t[r]))}return Number.isInteger(t.y)&&Number.isInteger(t.z)&&(i=i.replace(/\{-y\}/g,String(Math.pow(2,t.z)-t.y-1))),i}function Y$(e,A,t){let n;if(A&&A.length===2){const[i,r]=A,o=e.getBounds({z:i}),s=e.getBounds({z:r});n=[Math.min(o[0],s[0]),Math.min(o[1],s[1]),Math.max(o[2],s[2]),Math.max(o[3],s[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],t[0]),Math.max(n[1],t[1]),Math.min(n[2],t[2]),Math.min(n[3],t[3])]:[Math.max(Math.min(n[0],t[2]),t[0]),Math.max(Math.min(n[1],t[3]),t[1]),Math.min(Math.max(n[2],t[0]),t[2]),Math.min(Math.max(n[3],t[1]),t[3])]}function cB({viewport:e,z:A,cullRect:t}){const n=t.x-e.x,i=t.y-e.y,{width:r,height:o}=t;if(!Array.isArray(A)){const g={targetZ:A||0},I=e.unproject([n,i],g),l=e.unproject([n+r,i],g),c=e.unproject([n,i+o],g),C=e.unproject([n+r,i+o],g);return[Math.min(I[0],l[0],c[0],C[0]),Math.min(I[1],l[1],c[1],C[1]),Math.max(I[0],l[0],c[0],C[0]),Math.max(I[1],l[1],c[1],C[1])]}const s=cB({viewport:e,z:A[0],cullRect:t}),a=cB({viewport:e,z:A[1],cullRect:t});return[Math.min(s[0],a[0]),Math.min(s[1],a[1]),Math.max(s[2],a[2]),Math.max(s[3],a[3])]}function K$(e,A,t){return t?IG(e,t).map(i=>i*A/er):e.map(n=>n*A/er)}function rm(e,A){return Math.pow(2,e)*er/A}function l0(e,A,t){const n=rm(t,er),i=e/n*360-180,r=Math.PI-2*Math.PI*A/n,o=180/Math.PI*Math.atan(.5*(Math.exp(r)-Math.exp(-r)));return[i,o]}function d1(e,A,t,n){const i=rm(t,n);return[e/i*er,A/i*er]}function V$(e,A,t,n,i=er){if(e.isGeospatial){const[g,I]=l0(A,t,n),[l,c]=l0(A+1,t+1,n);return{west:g,north:I,east:l,south:c}}const[r,o]=d1(A,t,n,i),[s,a]=d1(A+1,t+1,n,i);return{left:r,top:o,right:s,bottom:a}}function W$(e,A,t,n,i){const r=Y$(e,null,n),o=rm(A,t),[s,a,g,I]=K$(r,o,i),l=[];for(let c=Math.floor(s);cA&&(g=A);let I=i;return o&&s&&i&&!e.isGeospatial&&(I=IG(i,o)),e.isGeospatial?P$(e,g,n,i):W$(e,g,r,I||H$,s)}const p1=1,UE=2,j$="never",X$="no-overlap",om="best-available",Z$=5,$$={[om]:eAA,[X$]:tAA,[j$]:()=>{}};class AAA{constructor(A){y(this,"opts",void 0),y(this,"_requestScheduler",void 0),y(this,"_cache",void 0),y(this,"_dirty",void 0),y(this,"_tiles",void 0),y(this,"_cacheByteSize",void 0),y(this,"_viewport",void 0),y(this,"_zRange",void 0),y(this,"_selectedTiles",void 0),y(this,"_frameNumber",void 0),y(this,"_modelMatrix",void 0),y(this,"_modelMatrixInverse",void 0),y(this,"_maxZoom",void 0),y(this,"_minZoom",void 0),y(this,"onTileLoad",void 0),y(this,"_getCullBounds",gc(cB)),this.opts=A,this.onTileLoad=t=>{this.opts.onTileLoad(t),this.opts.maxCacheByteSize&&(this._cacheByteSize+=t.byteLength,this._resizeCache())},this._requestScheduler=new PJ({maxRequests:A.maxRequests,throttleRequests:A.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new Se,this._modelMatrixInverse=new Se,this.setOptions(A)}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(A=>A.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(A=>A.needsReload)}setOptions(A){Object.assign(this.opts,A),Number.isFinite(A.maxZoom)&&(this._maxZoom=Math.floor(A.maxZoom)),Number.isFinite(A.minZoom)&&(this._minZoom=Math.ceil(A.minZoom))}finalize(){for(const A of this._cache.values())A.isLoading&&A.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const A of this._cache.keys()){const t=this._cache.get(A);!this._selectedTiles||!this._selectedTiles.includes(t)?this._cache.delete(A):t.setNeedsReload()}}update(A,{zRange:t,modelMatrix:n}={}){const i=new Se(n),r=!i.equals(this._modelMatrix);if(!this._viewport||!A.equals(this._viewport)||!yi(this._zRange,t)||r){r&&(this._modelMatrixInverse=i.clone().invert(),this._modelMatrix=i),this._viewport=A,this._zRange=t;const s=this.getTileIndices({viewport:A,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map(a=>this._getTile(a,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(s=>this._getTile(s.index,!0)));const o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(A,t){if(!A.isVisible)return!1;if(t&&this._viewport){const[n,i,r,o]=cB({viewport:this._viewport,z:this._zRange,cullRect:t}),{bbox:s}=A;if("west"in s)return s.westn&&s.southi;const a=Math.min(s.top,s.bottom),g=Math.max(s.top,s.bottom);return s.leftn&&ai}return!0}getTileIndices({viewport:A,maxZoom:t,minZoom:n,zRange:i,modelMatrix:r,modelMatrixInverse:o}){const{tileSize:s,extent:a,zoomOffset:g}=this.opts;return z$({viewport:A,maxZoom:t,minZoom:n,zRange:i,tileSize:s,extent:a,modelMatrix:r,modelMatrixInverse:o,zoomOffset:g})}getTileId(A){return"".concat(A.x,"-").concat(A.y,"-").concat(A.z)}getTileZoom(A){return A.z}getTileMetadata(A){const{tileSize:t}=this.opts;return{bbox:V$(this._viewport,A.x,A.y,A.z,t)}}getParentIndex(A){const t=Math.floor(A.x/2),n=Math.floor(A.y/2),i=A.z-1;return{x:t,y:n,z:i}}updateTileStates(){const A=this.opts.refinementStrategy||om,t=new Array(this._cache.size);let n=0;for(const i of this._cache.values())t[n++]=i.isVisible,i.isSelected=!1,i.isVisible=!1;for(const i of this._selectedTiles)i.isSelected=!0,i.isVisible=!0;(typeof A=="function"?A:$$[A])(Array.from(this._cache.values())),n=0;for(const i of this._cache.values())if(t[n++]!==i.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:A}=this.opts,t=[];let n=0;for(const i of this._cache.values())i.isLoading&&(n++,!i.isSelected&&!i.isVisible&&t.push(i));for(;A>0&&n>A&&t.length>0;)t.shift().abort(),n--}_rebuildTree(){const{_cache:A}=this;for(const t of A.values())t.parent=null,t.children&&(t.children.length=0);for(const t of A.values()){const n=this._getNearestAncestor(t);t.parent=n,n!=null&&n.children&&n.children.push(t)}}_resizeCache(){const{_cache:A,opts:t}=this,n=t.maxCacheSize||(t.maxCacheByteSize?1/0:Z$*this.selectedTiles.length),i=t.maxCacheByteSize||1/0;if(A.size>n||this._cacheByteSize>i){for(const[o,s]of A)if(s.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?s.byteLength:0,A.delete(o),this.opts.onTileUnload(s)),A.size<=n&&this._cacheByteSize<=i)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((o,s)=>o.zoom-s.zoom),this._dirty=!1)}_getTile(A,t){const n=this.getTileId(A);let i=this._cache.get(n),r=!1;return!i&&t?(i=new Q$(A),Object.assign(i,this.getTileMetadata(i.index)),Object.assign(i,{id:n,zoom:this.getTileZoom(i.index)}),r=!0,this._cache.set(n,i),this._dirty=!0):i&&i.needsReload&&(r=!0),i&&r&&i.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),i}_getNearestAncestor(A){const{_minZoom:t=0}=this;let n=A.index;for(;this.getTileZoom(n)>t;){n=this.getParentIndex(n);const i=this._getTile(n);if(i)return i}return null}}function eAA(e){for(const A of e)A.state=0;for(const A of e)A.isSelected&&!lG(A)&&sm(A);for(const A of e)A.isVisible=!!(A.state&UE)}function tAA(e){for(const t of e)t.state=0;for(const t of e)t.isSelected&&lG(t);const A=Array.from(e).sort((t,n)=>t.zoom-n.zoom);for(const t of A)if(t.isVisible=!!(t.state&UE),t.children&&(t.isVisible||t.state&p1))for(const n of t.children)n.state=p1;else t.isSelected&&sm(t)}function lG(e){let A=e;for(;A;){if(A.isLoaded||A.content)return A.state|=UE,!0;A=A.parent}return!1}function sm(e){for(const A of e.children)A.isLoaded||A.content?A.state|=UE:sm(A)}const nAA={TilesetClass:AAA,data:{type:"data",value:[]},dataComparator:q$.equals,renderSubLayers:{type:"function",value:e=>new em(e),compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:e=>console.error(e),compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:om,zRange:null,maxRequests:6,zoomOffset:0};class am extends Zn{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){var A,t;(A=this.state)===null||A===void 0||(t=A.tileset)===null||t===void 0||t.finalize()}get isLoaded(){var A,t;return(A=this.state)===null||A===void 0||(t=A.tileset)===null||t===void 0?void 0:t.selectedTiles.every(n=>n.isLoaded&&n.layers&&n.layers.every(i=>i.isLoaded))}shouldUpdateState({changeFlags:A}){return A.somethingChanged}updateState({changeFlags:A}){let{tileset:t}=this.state;const n=A.propsOrDataChanged||A.updateTriggersChanged,i=A.dataChanged||A.updateTriggersChanged&&(A.updateTriggersChanged.all||A.updateTriggersChanged.getTileData);t?n&&(t.setOptions(this._getTilesetOptions()),i?t.reloadAll():this.state.tileset.tiles.forEach(r=>{r.layers=null})):(t=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:t})),this._updateTileset()}_getTilesetOptions(){const{tileSize:A,maxCacheSize:t,maxCacheByteSize:n,refinementStrategy:i,extent:r,maxZoom:o,minZoom:s,maxRequests:a,zoomOffset:g}=this.props;return{maxCacheSize:t,maxCacheByteSize:n,maxZoom:o,minZoom:s,tileSize:A,refinementStrategy:i,extent:r,maxRequests:a,zoomOffset:g,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const{tileset:A}=this.state,{zRange:t,modelMatrix:n}=this.props,i=A.update(this.context.viewport,{zRange:t,modelMatrix:n}),{isLoaded:r}=A,o=this.state.isLoaded!==r,s=this.state.frameNumber!==i;r&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=r}_onViewportLoad(){const{tileset:A}=this.state,{onViewportLoad:t}=this.props;t&&t(A.selectedTiles)}_onTileLoad(A){this.props.onTileLoad(A),A.layers=null,this.setNeedsUpdate()}_onTileError(A,t){this.props.onTileError(A),t.layers=null,this.setNeedsUpdate()}_onTileUnload(A){this.props.onTileUnload(A)}getTileData(A){const{data:t,getTileData:n,fetch:i}=this.props,{signal:r}=A;return A.url=typeof t=="string"||Array.isArray(t)?O$(t,A):null,n?n(A):i&&A.url?i(A.url,{propName:"data",layer:this,signal:r}):null}renderSubLayers(A){return this.props.renderSubLayers(A)}getSubLayerPropsByTile(A){return null}getPickingInfo({info:A,sourceLayer:t}){return A.tile=t.props.tile,A}_updateAutoHighlight(A){A.sourceLayer&&A.sourceLayer.updateAutoHighlight(A)}renderLayers(){return this.state.tileset.tiles.map(A=>{const t=this.getSubLayerPropsByTile(A);if(!(!A.isLoaded&&!A.content))if(A.layers)t&&A.layers[0]&&Object.keys(t).some(n=>A.layers[0].props[n]!==t[n])&&(A.layers=A.layers.map(n=>n.clone(t)));else{const n=this.renderSubLayers({...this.props,id:"".concat(this.id,"-").concat(A.id),data:A.content,_offset:0,tile:A});A.layers=RE(n,Boolean).map(i=>i.clone({tile:A,...t}))}return A.layers})}filterSubLayer({layer:A,cullRect:t}){const{tile:n}=A.props;return this.state.tileset.isTileVisible(n,t)}}y(am,"defaultProps",nAA);y(am,"layerName","TileLayer");function Ft(e){return(A,...t)=>iAA(e,A,t)}function lg(e,A){return Ft(cG(e,A).get)}const{apply:iAA,construct:vhA,defineProperty:ShA,get:DhA,getOwnPropertyDescriptor:cG,getPrototypeOf:gm,has:RhA,ownKeys:rAA,set:xhA,setPrototypeOf:FhA}=Reflect,{iterator:hc,species:NhA,toStringTag:oAA,for:_hA}=Symbol,sAA=Object,{create:Im,defineProperty:aAA,freeze:LhA,is:bhA}=sAA,gAA=Array,IAA=gAA.prototype,CG=IAA[hc],lAA=Ft(CG),uG=ArrayBuffer,cAA=uG.prototype;lg(cAA,"byteLength");const y1=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;y1&&lg(y1.prototype,"byteLength");const BG=gm(Uint8Array);BG.from;const Xt=BG.prototype;Xt[hc];Ft(Xt.keys);Ft(Xt.values);Ft(Xt.entries);Ft(Xt.set);Ft(Xt.reverse);Ft(Xt.fill);Ft(Xt.copyWithin);Ft(Xt.sort);Ft(Xt.slice);Ft(Xt.subarray);lg(Xt,"buffer");lg(Xt,"byteOffset");lg(Xt,"length");lg(Xt,oAA);const cg=Uint32Array,CAA=Float32Array,CB=gm([][hc]()),uAA=Ft(CB.next),BAA=Ft(function*(){}().next),EAA=gm(CB),hAA=DataView.prototype,fAA=Ft(hAA.getUint16),lm=WeakMap,EG=lm.prototype,hG=Ft(EG.get),QAA=Ft(EG.set),fG=new lm,dAA=Im(null,{next:{value:function(){const A=hG(fG,this);return uAA(A)}},[hc]:{value:function(){return this}}});function pAA(e){if(e[hc]===CG)return e;const A=Im(dAA);return QAA(fG,A,lAA(e)),A}const yAA=new lm,mAA=Im(EAA,{next:{value:function(){const A=hG(yAA,this);return BAA(A)},writable:!0,configurable:!0}});for(const e of rAA(CB))e!=="next"&&aAA(mAA,e,cG(CB,e));const QG=new uG(4),wAA=new CAA(QG),vAA=new cg(QG),ri=new cg(512),oi=new cg(512);for(let e=0;e<256;++e){const A=e-127;A<-27?(ri[e]=0,ri[e|256]=32768,oi[e]=24,oi[e|256]=24):A<-14?(ri[e]=1024>>-A-14,ri[e|256]=1024>>-A-14|32768,oi[e]=-A-1,oi[e|256]=-A-1):A<=15?(ri[e]=A+15<<10,ri[e|256]=A+15<<10|32768,oi[e]=13,oi[e|256]=13):A<128?(ri[e]=31744,ri[e|256]=64512,oi[e]=24,oi[e|256]=24):(ri[e]=31744,ri[e|256]=64512,oi[e]=13,oi[e|256]=13)}const cm=new cg(2048),Cg=new cg(64),dG=new cg(64);for(let e=1;e<1024;++e){let A=e<<13,t=0;for(;!(A&8388608);)A<<=1,t-=8388608;A&=-8388609,t+=947912704,cm[e]=A|t}for(let e=1024;e<2048;++e)cm[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)Cg[e]=e<<23;Cg[31]=1199570944;Cg[32]=2147483648;for(let e=33;e<63;++e)Cg[e]=2147483648+(e-32<<23);Cg[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(dG[e]=1024);function SAA(e){const A=e>>10;return vAA[0]=cm[dG[A]+(e&1023)]+Cg[A],wAA[0]}function pG(e,A,...t){return SAA(fAA(e,A,...pAA(t)))}var Cm={exports:{}};function yG(e,A,t){const n=t&&t.debug||!1;n&&console.log("getting "+A+" in "+e);const i=typeof e=="object"?e.outer:e,r=`${A}\\="([^"]*)"`;n&&console.log("pattern:",r);const s=new RegExp(r).exec(i);if(n&&console.log("match:",s),s)return s[1]}Cm.exports=yG;Cm.exports.default=yG;var DAA=Cm.exports;const Jf=Gn(DAA);var um={exports:{}},Bm={exports:{}},Em={exports:{}};function mG(e,A,t){const i=new RegExp(A).exec(e.slice(t));return i?t+i.index:-1}Em.exports=mG;Em.exports.default=mG;var RAA=Em.exports,hm={exports:{}};function wG(e,A,t){const i=new RegExp(A).exec(e.slice(t));return i?t+i.index+i[0].length-1:-1}hm.exports=wG;hm.exports.default=wG;var xAA=hm.exports,fm={exports:{}};function vG(e,A){const t=new RegExp(A,"g"),n=e.match(t);return n?n.length:0}fm.exports=vG;fm.exports.default=vG;var FAA=fm.exports;const NAA=RAA,Of=xAA,m1=FAA;function SG(e,A,t){const n=t&&t.debug||!1,i=!(t&&typeof t.nested===!1),r=t&&t.startIndex||0;n&&console.log("[xml-utils] starting findTagByName with",A," and ",t);const o=NAA(e,`<${A}[ >/]`,r);if(n&&console.log("[xml-utils] start:",o),o===-1)return;const s=e.slice(o+A.length);let a=Of(s,"^[^<]*[ /]>",0);const g=a!==-1&&s[a-1]==="/";if(n&&console.log("[xml-utils] selfClosing:",g),g===!1)if(i){let C=0,u=1,E=0;for(;(a=Of(s,"[ /]"+A+">",C))!==-1;){const B=s.substring(C,a+1);if(u+=m1(B,"<"+A),E+=m1(B,"/"+A+">"),E>=u)break;C=a}}else a=Of(s,"[ /]"+A+">",0);const I=o+A.length+a+1;if(n&&console.log("[xml-utils] end:",I),I===-1)return;const l=e.slice(o,I);let c;return g?c=null:c=l.slice(l.indexOf(">")+1,l.lastIndexOf("<")),{inner:c,outer:l,start:o,end:I}}Bm.exports=SG;Bm.exports.default=SG;var _AA=Bm.exports;const LAA=_AA;function DG(e,A,t){const n=[],i=t&&t.debug||!1,r=t&&typeof t.nested=="boolean"?t.nested:!0;let o=t&&t.startIndex||0,s;for(;s=LAA(e,A,{debug:i,startIndex:o});)r?o=s.start+1+A.length:o=s.end,n.push(s);return i&&console.log("findTagsByName found",n.length,"tags"),n}um.exports=DG;um.exports.default=DG;var bAA=um.exports;const GAA=Gn(bAA),HI={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Ii={};for(const e in HI)HI.hasOwnProperty(e)&&(Ii[HI[e]]=parseInt(e,10));const kAA=[Ii.BitsPerSample,Ii.ExtraSamples,Ii.SampleFormat,Ii.StripByteCounts,Ii.StripOffsets,Ii.StripRowCounts,Ii.TileByteCounts,Ii.TileOffsets,Ii.SubIFDs],Yf={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ne={};for(const e in Yf)Yf.hasOwnProperty(e)&&(ne[Yf[e]]=parseInt(e,10));const In={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},MAA={Unspecified:0,Assocalpha:1,Unassalpha:2},GhA={Version:0,AddCompression:1},khA={None:0,Deflate:1},TAA={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function UAA(e,A){const{width:t,height:n}=e,i=new Uint8Array(t*n*3);let r;for(let o=0,s=0;o>24,a=e[i+2]<<24>>24;let g=(o+16)/116,I=s/500+g,l=g-a/200,c,C,u;I=OAA*(I*I*I>.008856?I*I*I:(I-16/116)/7.787),g=YAA*(g*g*g>.008856?g*g*g:(g-16/116)/7.787),l=KAA*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),c=I*3.2406+g*-1.5372+l*-.4986,C=I*-.9689+g*1.8758+l*.0415,u=I*.0557+g*-.204+l*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:12.92*c,C=C>.0031308?1.055*C**(1/2.4)-.055:12.92*C,u=u>.0031308?1.055*u**(1/2.4)-.055:12.92*u,n[r]=Math.max(0,Math.min(1,c))*255,n[r+1]=Math.max(0,Math.min(1,C))*255,n[r+2]=Math.max(0,Math.min(1,u))*255}return n}const WAA="modulepreload",zAA=function(e){return"/"+e},w1={},Ss=function(A,t,n){if(!t||t.length===0)return A();const i=document.getElementsByTagName("link");return Promise.all(t.map(r=>{if(r=zAA(r),r in w1)return;w1[r]=!0;const o=r.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!n)for(let I=i.length-1;I>=0;I--){const l=i[I];if(l.href===r&&(!o||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${s}`))return;const g=document.createElement("link");if(g.rel=o?"stylesheet":WAA,o||(g.as="script",g.crossOrigin=""),g.href=r,document.head.appendChild(g),o)return new Promise((I,l)=>{g.addEventListener("load",I),g.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>A()).catch(r=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=r,window.dispatchEvent(o),!o.defaultPrevented)throw r})},RG=new Map;function gr(e,A){Array.isArray(e)||(e=[e]),e.forEach(t=>RG.set(t,A))}async function jAA(e){const A=RG.get(e.Compression);if(!A)throw new Error(`Unknown compression method identifier: ${e.Compression}`);const t=await A();return new t(e)}gr([void 0,1],()=>Ss(()=>import("./raw-3a484560.js"),[]).then(e=>e.default));gr(5,()=>Ss(()=>import("./lzw-6314c407.js"),[]).then(e=>e.default));gr(6,()=>{throw new Error("old style JPEG compression is not supported.")});gr(7,()=>Ss(()=>import("./jpeg-9b086afd.js"),[]).then(e=>e.default));gr([8,32946],()=>Ss(()=>import("./deflate-23b66e04.js"),["assets/deflate-23b66e04.js","assets/pako.esm-147cf1d7.js"]).then(e=>e.default));gr(32773,()=>Ss(()=>import("./packbits-635cec19.js"),[]).then(e=>e.default));gr(34887,()=>Ss(()=>import("./lerc-4e0c4a18.js"),["assets/lerc-4e0c4a18.js","assets/pako.esm-147cf1d7.js"]).then(e=>e.default));gr(50001,()=>Ss(()=>import("./webimage-c7e44b7e.js"),[]).then(e=>e.default));function PE(e,A,t,n=1){return new(Object.getPrototypeOf(e)).constructor(A*t*n)}function XAA(e,A,t,n,i){const r=A/n,o=t/i;return e.map(s=>{const a=PE(s,n,i);for(let g=0;g{const a=PE(s,n,i);for(let g=0;g>8-i-m&l;else if(m+i<=16)I[d]=s.getUint16(w)>>16-i-m&l;else if(m+i<=24){const v=s.getUint16(w)<<8|s.getUint8(w+2);I[d]=v>>24-i-m&l}else I[d]=s.getUint32(w)>>32-i-m&l}}}}return I.buffer}class oeA{constructor(A,t,n,i,r,o){this.fileDirectory=A,this.geoKeys=t,this.dataView=n,this.littleEndian=i,this.tiles=r?{}:null,this.isTiled=!A.StripOffsets;const s=A.PlanarConfiguration;if(this.planarConfiguration=typeof s>"u"?1:s,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(A){return this.isTiled||(A+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-A*this.getTileHeight()}getBytesPerPixel(){let A=0;for(let t=0;t=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${A} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[A]/8)}getReaderForSample(A){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[A]:1,n=this.fileDirectory.BitsPerSample[A];switch(t){case 1:if(n<=8)return DataView.prototype.getUint8;if(n<=16)return DataView.prototype.getUint16;if(n<=32)return DataView.prototype.getUint32;break;case 2:if(n<=8)return DataView.prototype.getInt8;if(n<=16)return DataView.prototype.getInt16;if(n<=32)return DataView.prototype.getInt32;break;case 3:switch(n){case 16:return function(i,r){return pG(this,i,r)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(A=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[A]:1}getBitsPerSample(A=0){return this.fileDirectory.BitsPerSample[A]}getArrayForSample(A,t){const n=this.getSampleFormat(A),i=this.getBitsPerSample(A);return c0(n,i,t)}async getTileOrStrip(A,t,n,i,r){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let a;const{tiles:g}=this;this.planarConfiguration===1?a=t*o+A:this.planarConfiguration===2&&(a=n*o*s+t*o+A);let I,l;this.isTiled?(I=this.fileDirectory.TileOffsets[a],l=this.fileDirectory.TileByteCounts[a]):(I=this.fileDirectory.StripOffsets[a],l=this.fileDirectory.StripByteCounts[a]);const c=(await this.source.fetch([{offset:I,length:l}],r))[0];let C;return g===null||!g[a]?(C=(async()=>{let u=await i.decode(this.fileDirectory,c);const E=this.getSampleFormat(),B=this.getBitsPerSample();return ieA(E,B)&&(u=reA(u,E,this.planarConfiguration,this.getSamplesPerPixel(),B,this.getTileWidth(),this.getBlockHeight(t))),u})(),g!==null&&(g[a]=C)):C=g[a],{x:A,y:t,sample:n,data:await C}}async _readRaster(A,t,n,i,r,o,s,a,g){const I=this.getTileWidth(),l=this.getTileHeight(),c=this.getWidth(),C=this.getHeight(),u=Math.max(Math.floor(A[0]/I),0),E=Math.min(Math.ceil(A[2]/I),Math.ceil(c/I)),B=Math.max(Math.floor(A[1]/l),0),h=Math.min(Math.ceil(A[3]/l),Math.ceil(C/l)),f=A[2]-A[0];let Q=this.getBytesPerPixel();const d=[],w=[];for(let x=0;x{const W=H.data,J=new DataView(W),Z=this.getBlockHeight(H.y),z=H.y*l,O=H.x*I,Y=z+Z,T=(H.x+1)*I,q=w[N],j=Math.min(Z,Z-(Y-A[3]),C-z),AA=Math.min(I,I-(T-A[2]),c-O);for(let nA=Math.max(0,A[1]-z);nAI[2]||I[1]>I[3])throw new Error("Invalid subsets");const l=I[2]-I[0],c=I[3]-I[1],C=l*c,u=this.getSamplesPerPixel();if(!t||!t.length)for(let f=0;f=u)return Promise.reject(new RangeError(`Invalid sample index '${t[f]}'.`));let E;if(n){const f=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Q=Math.max.apply(null,this.fileDirectory.BitsPerSample);E=c0(f,Q,C*t.length),a&&E.fill(a)}else{E=[];for(let f=0;fg[2]||g[1]>g[3])throw new Error("Invalid subsets");const I=this.fileDirectory.PhotometricInterpretation;if(I===In.RGB){let h=[0,1,2];if(this.fileDirectory.ExtraSamples!==MAA.Unspecified&&s){h=[];for(let f=0;fJf(r,"sample")===void 0):i=i.filter(r=>Number(Jf(r,"sample"))===A);for(let r=0;r0;let r=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(A+(t?o:7-o));i&&(r?s!==0&&(s=~(s-1)&255,r=!1):s=~s&255),n+=s*256**o}return i&&(n=-n),n}getUint8(A,t){return this._dataView.getUint8(A,t)}getInt8(A,t){return this._dataView.getInt8(A,t)}getUint16(A,t){return this._dataView.getUint16(A,t)}getInt16(A,t){return this._dataView.getInt16(A,t)}getUint32(A,t){return this._dataView.getUint32(A,t)}getInt32(A,t){return this._dataView.getInt32(A,t)}getFloat16(A,t){return pG(this._dataView,A,t)}getFloat32(A,t){return this._dataView.getFloat32(A,t)}getFloat64(A,t){return this._dataView.getFloat64(A,t)}}class aeA{constructor(A,t,n,i){this._dataView=new DataView(A),this._sliceOffset=t,this._littleEndian=n,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(A,t){return this.sliceOffset<=A&&this.sliceTop>=A+t}readUint8(A){return this._dataView.getUint8(A-this._sliceOffset,this._littleEndian)}readInt8(A){return this._dataView.getInt8(A-this._sliceOffset,this._littleEndian)}readUint16(A){return this._dataView.getUint16(A-this._sliceOffset,this._littleEndian)}readInt16(A){return this._dataView.getInt16(A-this._sliceOffset,this._littleEndian)}readUint32(A){return this._dataView.getUint32(A-this._sliceOffset,this._littleEndian)}readInt32(A){return this._dataView.getInt32(A-this._sliceOffset,this._littleEndian)}readFloat32(A){return this._dataView.getFloat32(A-this._sliceOffset,this._littleEndian)}readFloat64(A){return this._dataView.getFloat64(A-this._sliceOffset,this._littleEndian)}readUint64(A){const t=this.readUint32(A),n=this.readUint32(A+4);let i;if(this._littleEndian){if(i=t+2**32*n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*t+n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(A){let t=0;const n=(this._dataView.getUint8(A+(this._littleEndian?7:0))&128)>0;let i=!0;for(let r=0;r<8;r++){let o=this._dataView.getUint8(A+(this._littleEndian?r:7-r));n&&(i?o!==0&&(o=~(o-1)&255,i=!1):o=~o&255),t+=o*256**r}return n&&(t=-t),t}readOffset(A){return this._bigTiff?this.readUint64(A):this.readUint32(A)}}const v1=`\r +`,g$={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:e=>e.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};class Am extends dn{constructor(...A){super(...A),y(this,"state",void 0)}getShaders(){return super.getShaders({vs:s$,fs:a$,modules:[Bo,Eo]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(A){super.updateState(A);const{changeFlags:t}=A;if(t.extensionsChanged){var n;const{gl:i}=this.context;(n=this.state.model)===null||n===void 0||n.delete(),this.state.model=this._getModel(i),this.getAttributeManager().invalidateAll()}}draw({uniforms:A}){const{billboard:t,sizeScale:n,sizeUnits:i,sizeMinPixels:r,sizeMaxPixels:o,getLineWidth:s}=this.props;let{padding:a}=this.props;a.length<4&&(a=[a[0],a[1],a[0],a[1]]),this.state.model.setUniforms(A).setUniforms({billboard:t,stroked:!!s,padding:a,sizeUnits:to[i],sizeScale:n,sizeMinPixels:r,sizeMaxPixels:o}).draw()}_getModel(A){const t=[0,0,1,0,1,1,0,1];return new Nn(A,{...this.getShaders(),id:this.props.id,geometry:new xi({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(t)}}}),isInstanced:!0})}}y(Am,"defaultProps",g$);y(Am,"layerName","TextBackgroundLayer");const a1={start:1,middle:0,end:-1},g1={top:1,center:0,bottom:-1},Hf=[0,0,0,255],I$=1,l$={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:Hf},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:PI.characterSet},fontFamily:PI.fontFamily,fontWeight:PI.fontWeight,lineHeight:I$,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:Hf},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:e=>e.text},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:Hf},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};class Ec extends Zn{constructor(...A){super(...A),y(this,"state",void 0),y(this,"getBoundingRect",(t,n)=>{const i=this.state.fontAtlasManager.mapping,r=this.state.getText,{wordBreak:o,maxWidth:s,lineHeight:a,getTextAnchor:g,getAlignmentBaseline:I}=this.props,l=r(t,n)||"",{size:[c,C]}=i1(l,a,o,s,i),u=a1[typeof g=="function"?g(t,n):g],E=g1[typeof I=="function"?I(t,n):I];return[(u-1)*c/2,(E-1)*C/2,c,C]}),y(this,"getIconOffsets",(t,n)=>{const i=this.state.fontAtlasManager.mapping,r=this.state.getText,{wordBreak:o,maxWidth:s,lineHeight:a,getTextAnchor:g,getAlignmentBaseline:I}=this.props,l=r(t,n)||"",{x:c,y:C,rowWidth:u,size:[E,B]}=i1(l,a,o,s,i),h=a1[typeof g=="function"?g(t,n):g],f=g1[typeof I=="function"?I(t,n):I],Q=c.length,d=new Array(Q*2);let w=0;for(let m=0;m=0?this.props.data[A.index]:null,A}_updateFontAtlas(){const{fontSettings:A,fontFamily:t,fontWeight:n}=this.props,{fontAtlasManager:i,characterSet:r}=this.state,o={...A,characterSet:r,fontFamily:t,fontWeight:n};if(!i.mapping)return i.setProps(o),!0;for(const s in o)if(o[s]!==i.props[s])return i.setProps(o),!0;return!1}_updateText(){var A;const{data:t,characterSet:n}=this.props,i=(A=t.attributes)===null||A===void 0?void 0:A.getText;let{getText:r}=this.props,o=t.startIndices,s;const a=n==="auto"&&new Set;if(i&&o){const{texts:g,characterCount:I}=A$({...ArrayBuffer.isView(i)?{value:i}:i,length:t.length,startIndices:o,characterSet:a});s=I,r=(l,{index:c})=>g[c]}else{const{iterable:g,objectInfo:I}=uc(t);o=[0],s=0;for(const l of g){I.index++;const c=Array.from(r(l,I)||"");a&&c.forEach(a.add,a),s+=c.length,o.push(s)}}this.setState({getText:r,startIndices:o,numInstances:s,characterSet:a||n})}renderLayers(){const{startIndices:A,numInstances:t,getText:n,fontAtlasManager:{scale:i,texture:r,mapping:o},styleVersion:s}=this.state,{data:a,_dataDiff:g,getPosition:I,getColor:l,getSize:c,getAngle:C,getPixelOffset:u,getBackgroundColor:E,getBorderColor:B,getBorderWidth:h,backgroundPadding:f,background:Q,billboard:d,fontSettings:w,outlineWidth:m,outlineColor:v,sizeScale:x,sizeUnits:D,sizeMinPixels:F,sizeMaxPixels:N,transitions:M,updateTriggers:P}=this.props,H=this.getSubLayerClass("characters",Zy),W=this.getSubLayerClass("background",Am);return[Q&&new W({getFillColor:E,getLineColor:B,getLineWidth:h,padding:f,getPosition:I,getSize:c,getAngle:C,getPixelOffset:u,billboard:d,sizeScale:x/this.state.fontAtlasManager.props.fontSize,sizeUnits:D,sizeMinPixels:F,sizeMaxPixels:N,transitions:M&&{getPosition:M.getPosition,getAngle:M.getAngle,getSize:M.getSize,getFillColor:M.getBackgroundColor,getLineColor:M.getBorderColor,getLineWidth:M.getBorderWidth,getPixelOffset:M.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:P.getPosition,getAngle:P.getAngle,getSize:P.getSize,getFillColor:P.getBackgroundColor,getLineColor:P.getBorderColor,getLineWidth:P.getBorderWidth,getPixelOffset:P.getPixelOffset,getBoundingRect:{getText:P.getText,getTextAnchor:P.getTextAnchor,getAlignmentBaseline:P.getAlignmentBaseline,styleVersion:s}}}),{data:a.attributes&&a.attributes.background?{length:a.length,attributes:a.attributes.background}:a,_dataDiff:g,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new H({sdf:w.sdf,smoothing:Number.isFinite(w.smoothing)?w.smoothing:PI.smoothing,outlineWidth:m,outlineColor:v,iconAtlas:r,iconMapping:o,getPosition:I,getColor:l,getSize:c,getAngle:C,getPixelOffset:u,billboard:d,sizeScale:x*i,sizeUnits:D,sizeMinPixels:F*i,sizeMaxPixels:N*i,transitions:M&&{getPosition:M.getPosition,getAngle:M.getAngle,getColor:M.getColor,getSize:M.getSize,getPixelOffset:M.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getIcon:P.getText,getPosition:P.getPosition,getAngle:P.getAngle,getColor:P.getColor,getSize:P.getSize,getPixelOffset:P.getPixelOffset,getIconOffsets:{getText:P.getText,getTextAnchor:P.getTextAnchor,getAlignmentBaseline:P.getAlignmentBaseline,styleVersion:s}}}),{data:a,_dataDiff:g,startIndices:A,numInstances:t,getIconOffsets:this.getIconOffsets,getIcon:n})]}static set fontAtlasCacheLimit(A){r$(A)}}y(Ec,"defaultProps",l$);y(Ec,"layerName","TextLayer");const au={circle:{type:jy,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:bE,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:Ec,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},gu={type:GE,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},a0={type:TE,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function jg({type:e,props:A}){const t={};for(const n in A)t[n]=e.defaultProps[A[n]];return t}function qf(e,A){const{transitions:t,updateTriggers:n}=e.props,i={updateTriggers:{},transitions:t&&{getPosition:t.geometry}};for(const r in A){const o=A[r];let s=e.props[r];r.startsWith("get")&&(s=e.getSubLayerAccessor(s),i.updateTriggers[o]=n[r],t&&(i.transitions[o]=t[r])),i[o]=s}return i}function c$(e){if(Array.isArray(e))return e;switch(oe.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return oe.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}function I1(e,A,t={}){const n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:i=0,endRow:r=e.length}=t;for(let o=i;o{s.push(t({geometry:{type:"Point",coordinates:l}},n,i))});break;case"LineString":a.push(t({geometry:e},n,i));break;case"MultiLineString":o.forEach(l=>{a.push(t({geometry:{type:"LineString",coordinates:l}},n,i))});break;case"Polygon":g.push(t({geometry:e},n,i)),o.forEach(l=>{I.push(t({geometry:{type:"LineString",coordinates:l}},n,i))});break;case"MultiPolygon":o.forEach(l=>{g.push(t({geometry:{type:"Polygon",coordinates:l}},n,i)),l.forEach(c=>{I.push(t({geometry:{type:"LineString",coordinates:c}},n,i))})});break}}const C$={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function u$(e,A){let t=C$[e];for(oe.assert(t,"Unknown GeoJSON type ".concat(e));A&&--t>0;)A=A[0];return A&&Number.isFinite(A[0])}function sG(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function uC(e){return e.geometry.coordinates}function B$(e,A){const t=sG(),{pointFeatures:n,lineFeatures:i,polygonFeatures:r,polygonOutlineFeatures:o}=e;return t.points.data=n,t.points._dataDiff=A.pointFeatures&&(()=>A.pointFeatures),t.points.getPosition=uC,t.lines.data=i,t.lines._dataDiff=A.lineFeatures&&(()=>A.lineFeatures),t.lines.getPath=uC,t.polygons.data=r,t.polygons._dataDiff=A.polygonFeatures&&(()=>A.polygonFeatures),t.polygons.getPolygon=uC,t.polygonsOutline.data=o,t.polygonsOutline._dataDiff=A.polygonOutlineFeatures&&(()=>A.polygonOutlineFeatures),t.polygonsOutline.getPath=uC,t}function E$(e,A){const t=sG(),{points:n,lines:i,polygons:r}=e,o=PZ(e,A);return t.points.data={length:n.positions.value.length/n.positions.size,attributes:{...n.attributes,getPosition:n.positions,instancePickingColors:{size:3,value:o.points}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},t.lines.data={length:i.pathIndices.value.length-1,startIndices:i.pathIndices.value,attributes:{...i.attributes,getPath:i.positions,instancePickingColors:{size:3,value:o.lines}},properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},t.lines._pathType="open",t.polygons.data={length:r.polygonIndices.value.length-1,startIndices:r.polygonIndices.value,attributes:{...r.attributes,getPolygon:r.positions,pickingColors:{size:3,value:o.polygons}},properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},t.polygons._normalize=!1,r.triangles&&(t.polygons.data.attributes.indices=r.triangles.value),t.polygonsOutline.data={length:r.primitivePolygonIndices.value.length-1,startIndices:r.primitivePolygonIndices.value,attributes:{...r.attributes,getPath:r.positions,instancePickingColors:{size:3,value:o.polygons}},properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},t.polygonsOutline._pathType="open",t}const h$=["points","linestrings","polygons"],f$={...jg(au.circle),...jg(au.icon),...jg(au.text),...jg(gu),...jg(a0),stroked:!0,filled:!0,extruded:!1,wireframe:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:e=>e.properties.icon},getText:{type:"accessor",value:e=>e.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}};class em extends Zn{initializeState(){this.state={layerProps:{},features:{}}}updateState({props:A,changeFlags:t}){if(!t.dataChanged)return;const{data:n}=this.props,i=n&&"points"in n&&"polygons"in n&&"lines"in n;this.setState({binary:i}),i?this._updateStateBinary({props:A,changeFlags:t}):this._updateStateJSON({props:A,changeFlags:t})}_updateStateBinary({props:A,changeFlags:t}){const n=E$(A.data,this.encodePickingColor);this.setState({layerProps:n})}_updateStateJSON({props:A,changeFlags:t}){const n=c$(A.data),i=this.getSubLayerRow.bind(this);let r={};const o={};if(Array.isArray(t.dataChanged)){const a=this.state.features;for(const g in a)r[g]=a[g].slice(),o[g]=[];for(const g of t.dataChanged){const I=I1(n,i,g);for(const l in a)o[l].push(eG({data:r[l],getIndex:c=>c.__source.index,dataRange:g,replace:I[l]}))}}else r=I1(n,i);const s=B$(r,o);this.setState({features:r,featuresDiff:o,layerProps:s})}getPickingInfo(A){const t=super.getPickingInfo(A),{index:n,sourceLayer:i}=t;return t.featureType=h$.find(r=>i.id.startsWith("".concat(this.id,"-").concat(r,"-"))),n>=0&&i.id.startsWith("".concat(this.id,"-points-text"))&&this.state.binary&&(t.index=this.props.data.points.globalFeatureIds.value[n]),t}_updateAutoHighlight(A){const t="".concat(this.id,"-points-"),n=A.featureType==="points";for(const i of this.getSubLayers())i.id.startsWith(t)===n&&i.updateAutoHighlight(A)}_renderPolygonLayer(){const{extruded:A,wireframe:t}=this.props,{layerProps:n}=this.state,i="polygons-fill",r=this.shouldRenderSubLayer(i,n.polygons.data)&&this.getSubLayerClass(i,a0.type);if(r){const o=qf(this,a0.props),s=A&&t;return s||delete o.getLineColor,o.updateTriggers.lineColors=s,new r(o,this.getSubLayerProps({id:i,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){const{extruded:A,stroked:t}=this.props,{layerProps:n}=this.state,i="polygons-stroke",r="linestrings",o=!A&&t&&this.shouldRenderSubLayer(i,n.polygonsOutline.data)&&this.getSubLayerClass(i,gu.type),s=this.shouldRenderSubLayer(r,n.lines.data)&&this.getSubLayerClass(r,gu.type);if(o||s){const a=qf(this,gu.props);return[o&&new o(a,this.getSubLayerProps({id:i,updateTriggers:a.updateTriggers}),n.polygonsOutline),s&&new s(a,this.getSubLayerProps({id:r,updateTriggers:a.updateTriggers}),n.lines)]}return null}_renderPointLayers(){const{pointType:A}=this.props,{layerProps:t,binary:n}=this.state;let{highlightedObjectIndex:i}=this.props;!n&&Number.isFinite(i)&&(i=t.points.data.findIndex(s=>s.__source.index===i));const r=new Set(A.split("+")),o=[];for(const s of r){const a="points-".concat(s),g=au[s],I=g&&this.shouldRenderSubLayer(a,t.points.data)&&this.getSubLayerClass(a,g.type);if(I){const l=qf(this,g.props);let c=t.points;if(s==="text"&&n){const{instancePickingColors:C,...u}=c.data.attributes;c={...c,data:{...c.data,attributes:u}}}o.push(new I(l,this.getSubLayerProps({id:a,updateTriggers:l.updateTriggers,highlightedObjectIndex:i}),c))}}return o}renderLayers(){const{extruded:A}=this.props,t=this._renderPolygonLayer(),n=this._renderLineLayers(),i=this._renderPointLayers();return[!A&&t,n,i,A&&t]}getSubLayerAccessor(A){const{binary:t}=this.state;return!t||typeof A!="function"?super.getSubLayerAccessor(A):(n,i)=>{const{data:r,index:o}=i,s=TZ(r,o);return A(s,i)}}}y(em,"layerName","GeoJsonLayer");y(em,"defaultProps",f$);class Q${constructor(A){y(this,"index",void 0),y(this,"isVisible",void 0),y(this,"isSelected",void 0),y(this,"parent",void 0),y(this,"children",void 0),y(this,"content",void 0),y(this,"state",void 0),y(this,"layers",void 0),y(this,"id",void 0),y(this,"bbox",void 0),y(this,"zoom",void 0),y(this,"userData",void 0),y(this,"_abortController",void 0),y(this,"_loader",void 0),y(this,"_loaderId",void 0),y(this,"_isLoaded",void 0),y(this,"_isCancelled",void 0),y(this,"_needsReload",void 0),this.index=A,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get data(){return this.isLoading&&this._loader?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return!!this._loader&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const A=this.content?this.content.byteLength:0;return Number.isFinite(A)||oe.error("byteLength not defined in tile data")(),A}async _loadData({getData:A,requestScheduler:t,onLoad:n,onError:i}){const{index:r,id:o,bbox:s,userData:a,zoom:g}=this,I=this._loaderId;this._abortController=new AbortController;const{signal:l}=this._abortController,c=await t.scheduleRequest(this,E=>E.isSelected?1:-1);if(!c){this._isCancelled=!0;return}if(this._isCancelled){c.done();return}let C=null,u;try{C=await A({index:r,id:o,bbox:s,userData:a,zoom:g,signal:l})}catch(E){u=E||!0}finally{c.done()}if(I===this._loaderId){if(this._loader=void 0,this.content=C,this._isCancelled&&!C){this._isLoaded=!1;return}this._isLoaded=!0,this._isCancelled=!1,u?i(u,this):n(this)}}loadData(A){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(A),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){var A;this.isLoaded||(this._isCancelled=!0,(A=this._abortController)===null||A===void 0||A.abort())}}const Mt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},c1=new QA,d$=new QA;class tm{constructor(A=[0,0,0],t=[0,0,0],n){y(this,"center",void 0),y(this,"halfDiagonal",void 0),y(this,"minimum",void 0),y(this,"maximum",void 0),n=n||c1.copy(A).add(t).scale(.5),this.center=new QA(n),this.halfDiagonal=new QA(t).subtract(this.center),this.minimum=new QA(A),this.maximum=new QA(t)}clone(){return new tm(this.minimum,this.maximum,this.center)}equals(A){return this===A||!!A&&this.minimum.equals(A.minimum)&&this.maximum.equals(A.maximum)}transform(A){return this.center.transformAsPoint(A),this.halfDiagonal.transform(A),this.minimum.transform(A),this.maximum.transform(A),this}intersectPlane(A){const{halfDiagonal:t}=this,n=d$.from(A.normal),i=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),r=this.center.dot(n)+A.distance;return r-i>0?Mt.INSIDE:r+i<0?Mt.OUTSIDE:Mt.INTERSECTING}distanceTo(A){return Math.sqrt(this.distanceSquaredTo(A))}distanceSquaredTo(A){const t=c1.from(A).subtract(this.center),{halfDiagonal:n}=this;let i=0,r;return r=Math.abs(t.x)-n.x,r>0&&(i+=r*r),r=Math.abs(t.y)-n.y,r>0&&(i+=r*r),r=Math.abs(t.z)-n.z,r>0&&(i+=r*r),i}}const Xg=new QA,C1=new QA;class nm{constructor(A=[0,0,0],t=0){y(this,"center",void 0),y(this,"radius",void 0),this.radius=-0,this.center=new QA,this.fromCenterRadius(A,t)}fromCenterRadius(A,t){return this.center.from(A),this.radius=t,this}fromCornerPoints(A,t){return t=Xg.from(t),this.center=new QA().from(A).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(A){return this===A||!!A&&this.center.equals(A.center)&&this.radius===A.radius}clone(){return new nm(this.center,this.radius)}union(A){const t=this.center,n=this.radius,i=A.center,r=A.radius,o=Xg.copy(i).subtract(t),s=o.magnitude();if(n>=s+r)return this.clone();if(r>=s+n)return A.clone();const a=(n+s+r)*.5;return C1.copy(o).scale((-n+a)/s).add(t),this.center.copy(C1),this.radius=a,this}expand(A){const n=Xg.from(A).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(A){this.center.transform(A);const t=K9(Xg,A);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(A){const t=this.distanceTo(A);return t*t}distanceTo(A){const n=Xg.from(A).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(A){const t=this.center,n=this.radius,r=A.normal.dot(t)+A.distance;return r<-n?Mt.OUTSIDE:r=a?Mt.INSIDE:Mt.INTERSECTING}distanceTo(A){return Math.sqrt(this.distanceSquaredTo(A))}distanceSquaredTo(A){const t=y$.from(A).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,BC),r=n.getColumn(1,EC),o=n.getColumn(2,hC),s=i.magnitude(),a=r.magnitude(),g=o.magnitude();i.normalize(),r.normalize(),o.normalize();let I=0,l;return l=Math.abs(t.dot(i))-s,l>0&&(I+=l*l),l=Math.abs(t.dot(r))-a,l>0&&(I+=l*l),l=Math.abs(t.dot(o))-g,l>0&&(I+=l*l),I}computePlaneDistances(A,t,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const o=this.center,s=this.halfAxes,a=s.getColumn(0,BC),g=s.getColumn(1,EC),I=s.getColumn(2,hC),l=m$.copy(a).add(g).add(I).add(o),c=w$.copy(l).subtract(A);let C=t.dot(c);return i=Math.min(C,i),r=Math.max(C,r),l.copy(o).add(a).add(g).subtract(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),l.copy(o).add(a).subtract(g).add(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),l.copy(o).add(a).subtract(g).subtract(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),o.copy(l).subtract(a).add(g).add(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),o.copy(l).subtract(a).add(g).subtract(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),o.copy(l).subtract(a).subtract(g).add(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),o.copy(l).subtract(a).subtract(g).subtract(I),c.copy(l).subtract(A),C=t.dot(c),i=Math.min(C,i),r=Math.max(C,r),n[0]=i,n[1]=r,n}transform(A){this.center.transformAsPoint(A);const t=this.halfAxes.getColumn(0,BC);t.transformAsPoint(A);const n=this.halfAxes.getColumn(1,EC);n.transformAsPoint(A);const i=this.halfAxes.getColumn(2,hC);return i.transformAsPoint(A),this.halfAxes=new St([...t,...n,...i]),this}getTransform(){throw new Error("not implemented")}}const u1=new QA,B1=new QA;class ns{constructor(A=[0,0,1],t=0){y(this,"normal",void 0),y(this,"distance",void 0),this.normal=new QA,this.distance=-0,this.fromNormalDistance(A,t)}fromNormalDistance(A,t){return fl(Number.isFinite(t)),this.normal.from(A).normalize(),this.distance=t,this}fromPointNormal(A,t){A=u1.from(A),this.normal.from(t).normalize();const n=-this.normal.dot(A);return this.distance=n,this}fromCoefficients(A,t,n,i){return this.normal.set(A,t,n),fl(yi(this.normal.len(),1)),this.distance=i,this}clone(){return new ns(this.normal,this.distance)}equals(A){return yi(this.distance,A.distance)&&yi(this.normal,A.normal)}getPointDistance(A){return this.normal.dot(A)+this.distance}transform(A){const t=B1.copy(this.normal).transformAsVector(A).normalize(),n=this.normal.scale(-this.distance).transform(A);return this.fromPointNormal(n,t)}projectPointOntoPlane(A,t=[0,0,0]){A=u1.from(A);const n=this.getPointDistance(A),i=B1.copy(this.normal).scale(n);return A.subtract(i).to(t)}}const E1=[new QA([1,0,0]),new QA([0,1,0]),new QA([0,0,1])],h1=new QA,v$=new QA;new ns(new QA(1,0,0),0);class Vi{constructor(A=[]){y(this,"planes",void 0),this.planes=A}fromBoundingSphere(A){this.planes.length=2*E1.length;const t=A.center,n=A.radius;let i=0;for(const r of E1){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new ns),s||(s=this.planes[i+1]=new ns);const a=h1.copy(r).scale(-n).add(t);-r.dot(a),o.fromPointNormal(a,r);const g=h1.copy(r).scale(n).add(t),I=v$.copy(r).negate();-I.dot(g),s.fromPointNormal(g,I),i+=2}return this}computeVisibility(A){let t=Mt.INSIDE;for(const n of this.planes)switch(A.intersectPlane(n)){case Mt.OUTSIDE:return Mt.OUTSIDE;case Mt.INTERSECTING:t=Mt.INTERSECTING;break}return t}computeVisibilityWithPlaneMask(A,t){if(fl(Number.isFinite(t),"parentPlaneMask is required."),t===Vi.MASK_OUTSIDE||t===Vi.MASK_INSIDE)return t;let n=Vi.MASK_INSIDE;const i=this.planes;for(let r=0;ra;)N$(s,fC),f1.copy(fC).transpose(),s.multiplyRight(fC),s.multiplyLeft(f1),o.multiplyRight(fC),++i>2&&(++r,i=0);return A.unitary=o.toTarget(A.unitary),A.diagonal=s.toTarget(A.diagonal),A}function x$(e){let A=0;for(let t=0;t<9;++t){const n=e[t];A+=n*n}return Math.sqrt(A)}const g0=[1,0,0],I0=[2,2,1];function F$(e){let A=0;for(let t=0;t<3;++t){const n=e[gi.getElementIndex(I0[t],g0[t])];A+=2*n*n}return Math.sqrt(A)}function N$(e,A){const t=nb.EPSILON15;let n=0,i=1;for(let g=0;g<3;++g){const I=Math.abs(e[gi.getElementIndex(I0[g],g0[g])]);I>n&&(i=g,n=I)}const r=g0[i],o=I0[i];let s=1,a=0;if(Math.abs(e[gi.getElementIndex(o,r)])>t){const g=e[gi.getElementIndex(o,o)],I=e[gi.getElementIndex(r,r)],l=e[gi.getElementIndex(o,r)],c=(g-I)/2/l;let C;c<0?C=-1/(-c+Math.sqrt(1+c*c)):C=1/(c+Math.sqrt(1+c*c)),s=1/Math.sqrt(1+C*C),a=C*s}return St.IDENTITY.to(A),A[gi.getElementIndex(r,r)]=A[gi.getElementIndex(o,o)]=s,A[gi.getElementIndex(o,r)]=a,A[gi.getElementIndex(r,o)]=-a,A}const dr=new QA,_$=new QA,L$=new QA,b$=new QA,G$=new QA,k$=new St,M$={diagonal:new St,unitary:new St};function T$(e,A=new im){if(!e||e.length===0)return A.halfAxes=new St([0,0,0,0,0,0,0,0,0]),A.center=new QA,A;const t=e.length,n=new QA(0,0,0);for(const D of e)n.add(D);const i=1/t;n.multiplyByScalar(i);let r=0,o=0,s=0,a=0,g=0,I=0;for(const D of e){const F=dr.copy(D).subtract(n);r+=F.x*F.x,o+=F.x*F.y,s+=F.x*F.z,a+=F.y*F.y,g+=F.y*F.z,I+=F.z*F.z}r*=i,o*=i,s*=i,a*=i,g*=i,I*=i;const l=k$;l[0]=r,l[1]=o,l[2]=s,l[3]=o,l[4]=a,l[5]=g,l[6]=s,l[7]=g,l[8]=I;const{unitary:c}=R$(l,M$),C=A.halfAxes.copy(c);let u=C.getColumn(0,L$),E=C.getColumn(1,b$),B=C.getColumn(2,G$),h=-Number.MAX_VALUE,f=-Number.MAX_VALUE,Q=-Number.MAX_VALUE,d=Number.MAX_VALUE,w=Number.MAX_VALUE,m=Number.MAX_VALUE;for(const D of e)dr.copy(D),h=Math.max(dr.dot(u),h),f=Math.max(dr.dot(E),f),Q=Math.max(dr.dot(B),Q),d=Math.min(dr.dot(u),d),w=Math.min(dr.dot(E),w),m=Math.min(dr.dot(B),m);u=u.multiplyByScalar(.5*(d+h)),E=E.multiplyByScalar(.5*(w+f)),B=B.multiplyByScalar(.5*(m+Q)),A.center.copy(u).add(E).add(B);const v=_$.set(h-d,f-w,Q-m).multiplyByScalar(.5),x=new St([v[0],0,0,0,v[1],0,0,0,v[2]]);return A.halfAxes.multiplyRight(x),A}const la=512,Q1=3,aG=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],gG=aG.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),U$=gG.concat([[.25,.5],[.75,.5]]);class ca{constructor(A,t,n){y(this,"x",void 0),y(this,"y",void 0),y(this,"z",void 0),y(this,"childVisible",void 0),y(this,"selected",void 0),y(this,"_children",void 0),this.x=A,this.y=t,this.z=n}get children(){if(!this._children){const A=this.x*2,t=this.y*2,n=this.z+1;this._children=[new ca(A,t,n),new ca(A,t+1,n),new ca(A+1,t,n),new ca(A+1,t+1,n)]}return this._children}update(A){const{viewport:t,cullingVolume:n,elevationBounds:i,minZ:r,maxZ:o,bounds:s,offset:a,project:g}=A,I=this.getBoundingVolume(i,a,g);if(s&&!this.insideBounds(s)||n.computeVisibility(I)<0)return!1;if(!this.childVisible){let{z:c}=this;if(c=r){const C=I.distanceTo(t.cameraPosition)*t.scale/t.height;c+=Math.floor(Math.log2(C))}if(c>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const c of this.children)c.update(A);return!0}getSelected(A=[]){if(this.selected&&A.push(this),this._children)for(const t of this._children)t.getSelected(A);return A}insideBounds([A,t,n,i]){const r=Math.pow(2,this.z),o=la/r;return this.x*oA&&(this.y+1)*o>t}getBoundingVolume(A,t,n){if(n){const a=this.z<1?U$:this.z<2?gG:aG,g=[];for(const I of a){const l=l0(this.x+I[0],this.y+I[1],this.z);l[2]=A[0],g.push(n(l)),A[0]!==A[1]&&(l[2]=A[1],g.push(n(l)))}return T$(g)}const i=Math.pow(2,this.z),r=la/i,o=this.x*r+t*la,s=la-(this.y+1)*r;return new tm([o,s,A[0]],[o+r,s+r,A[1]])}}function P$(e,A,t,n){const i=e instanceof cX&&e.resolution?e.projectPosition:null,r=Object.values(e.getFrustumPlanes()).map(({normal:C,distance:u})=>new ns(C.clone().negate(),u)),o=new Vi(r),s=e.distanceScales.unitsPerMeter[2],a=t&&t[0]*s||0,g=t&&t[1]*s||0,I=e instanceof Si&&e.pitch<=60?A:0;if(n){const[C,u,E,B]=n,h=no([C,B]),f=no([E,u]);n=[h[0],la-h[1],f[0],la-f[1]]}const l=new ca(0,0,0),c={viewport:e,project:i,cullingVolume:o,elevationBounds:[a,g],minZ:I,maxZ:A,bounds:n,offset:0};if(l.update(c),e instanceof Si&&e.subViewports&&e.subViewports.length>1){for(c.offset=-1;l.update(c)&&!(--c.offset<-Q1););for(c.offset=1;l.update(c)&&!(++c.offset>Q1););}return l.getSelected()}const er=512,H$=[-1/0,-1/0,1/0,1/0],q$={type:"url",value:null,validate:(e,A)=>A.optional&&e===null||typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string"),equals:(e,A)=>{if(e===A)return!0;if(!Array.isArray(e)||!Array.isArray(A))return!1;const t=e.length;if(t!==A.length)return!1;for(let n=0;ni[0])),Math.min(...t.map(i=>i[1])),Math.max(...t.map(i=>i[0])),Math.max(...t.map(i=>i[1]))]}function J$(e){return Math.abs(e.split("").reduce((A,t)=>(A<<5)-A+t.charCodeAt(0)|0,0))}function O$(e,A){if(!e||!e.length)return null;const{index:t,id:n}=A;if(Array.isArray(e)){const r=J$(n)%e.length;e=e[r]}let i=e;for(const r of Object.keys(t)){const o=new RegExp("{".concat(r,"}"),"g");i=i.replace(o,String(t[r]))}return Number.isInteger(t.y)&&Number.isInteger(t.z)&&(i=i.replace(/\{-y\}/g,String(Math.pow(2,t.z)-t.y-1))),i}function Y$(e,A,t){let n;if(A&&A.length===2){const[i,r]=A,o=e.getBounds({z:i}),s=e.getBounds({z:r});n=[Math.min(o[0],s[0]),Math.min(o[1],s[1]),Math.max(o[2],s[2]),Math.max(o[3],s[3])]}else n=e.getBounds();return e.isGeospatial?[Math.max(n[0],t[0]),Math.max(n[1],t[1]),Math.min(n[2],t[2]),Math.min(n[3],t[3])]:[Math.max(Math.min(n[0],t[2]),t[0]),Math.max(Math.min(n[1],t[3]),t[1]),Math.min(Math.max(n[2],t[0]),t[2]),Math.min(Math.max(n[3],t[1]),t[3])]}function cB({viewport:e,z:A,cullRect:t}){const n=t.x-e.x,i=t.y-e.y,{width:r,height:o}=t;if(!Array.isArray(A)){const g={targetZ:A||0},I=e.unproject([n,i],g),l=e.unproject([n+r,i],g),c=e.unproject([n,i+o],g),C=e.unproject([n+r,i+o],g);return[Math.min(I[0],l[0],c[0],C[0]),Math.min(I[1],l[1],c[1],C[1]),Math.max(I[0],l[0],c[0],C[0]),Math.max(I[1],l[1],c[1],C[1])]}const s=cB({viewport:e,z:A[0],cullRect:t}),a=cB({viewport:e,z:A[1],cullRect:t});return[Math.min(s[0],a[0]),Math.min(s[1],a[1]),Math.max(s[2],a[2]),Math.max(s[3],a[3])]}function K$(e,A,t){return t?IG(e,t).map(i=>i*A/er):e.map(n=>n*A/er)}function rm(e,A){return Math.pow(2,e)*er/A}function l0(e,A,t){const n=rm(t,er),i=e/n*360-180,r=Math.PI-2*Math.PI*A/n,o=180/Math.PI*Math.atan(.5*(Math.exp(r)-Math.exp(-r)));return[i,o]}function d1(e,A,t,n){const i=rm(t,n);return[e/i*er,A/i*er]}function V$(e,A,t,n,i=er){if(e.isGeospatial){const[g,I]=l0(A,t,n),[l,c]=l0(A+1,t+1,n);return{west:g,north:I,east:l,south:c}}const[r,o]=d1(A,t,n,i),[s,a]=d1(A+1,t+1,n,i);return{left:r,top:o,right:s,bottom:a}}function W$(e,A,t,n,i){const r=Y$(e,null,n),o=rm(A,t),[s,a,g,I]=K$(r,o,i),l=[];for(let c=Math.floor(s);cA&&(g=A);let I=i;return o&&s&&i&&!e.isGeospatial&&(I=IG(i,o)),e.isGeospatial?P$(e,g,n,i):W$(e,g,r,I||H$,s)}const p1=1,UE=2,j$="never",X$="no-overlap",om="best-available",Z$=5,$$={[om]:eAA,[X$]:tAA,[j$]:()=>{}};class AAA{constructor(A){y(this,"opts",void 0),y(this,"_requestScheduler",void 0),y(this,"_cache",void 0),y(this,"_dirty",void 0),y(this,"_tiles",void 0),y(this,"_cacheByteSize",void 0),y(this,"_viewport",void 0),y(this,"_zRange",void 0),y(this,"_selectedTiles",void 0),y(this,"_frameNumber",void 0),y(this,"_modelMatrix",void 0),y(this,"_modelMatrixInverse",void 0),y(this,"_maxZoom",void 0),y(this,"_minZoom",void 0),y(this,"onTileLoad",void 0),y(this,"_getCullBounds",gc(cB)),this.opts=A,this.onTileLoad=t=>{this.opts.onTileLoad(t),this.opts.maxCacheByteSize&&(this._cacheByteSize+=t.byteLength,this._resizeCache())},this._requestScheduler=new PJ({maxRequests:A.maxRequests,throttleRequests:A.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new Se,this._modelMatrixInverse=new Se,this.setOptions(A)}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles!==null&&this._selectedTiles.every(A=>A.isLoaded)}get needsReload(){return this._selectedTiles!==null&&this._selectedTiles.some(A=>A.needsReload)}setOptions(A){Object.assign(this.opts,A),Number.isFinite(A.maxZoom)&&(this._maxZoom=Math.floor(A.maxZoom)),Number.isFinite(A.minZoom)&&(this._minZoom=Math.ceil(A.minZoom))}finalize(){for(const A of this._cache.values())A.isLoading&&A.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const A of this._cache.keys()){const t=this._cache.get(A);!this._selectedTiles||!this._selectedTiles.includes(t)?this._cache.delete(A):t.setNeedsReload()}}update(A,{zRange:t,modelMatrix:n}={}){const i=new Se(n),r=!i.equals(this._modelMatrix);if(!this._viewport||!A.equals(this._viewport)||!yi(this._zRange,t)||r){r&&(this._modelMatrixInverse=i.clone().invert(),this._modelMatrix=i),this._viewport=A,this._zRange=t;const s=this.getTileIndices({viewport:A,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map(a=>this._getTile(a,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(s=>this._getTile(s.index,!0)));const o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(A,t){if(!A.isVisible)return!1;if(t&&this._viewport){const[n,i,r,o]=cB({viewport:this._viewport,z:this._zRange,cullRect:t}),{bbox:s}=A;if("west"in s)return s.westn&&s.southi;const a=Math.min(s.top,s.bottom),g=Math.max(s.top,s.bottom);return s.leftn&&ai}return!0}getTileIndices({viewport:A,maxZoom:t,minZoom:n,zRange:i,modelMatrix:r,modelMatrixInverse:o}){const{tileSize:s,extent:a,zoomOffset:g}=this.opts;return z$({viewport:A,maxZoom:t,minZoom:n,zRange:i,tileSize:s,extent:a,modelMatrix:r,modelMatrixInverse:o,zoomOffset:g})}getTileId(A){return"".concat(A.x,"-").concat(A.y,"-").concat(A.z)}getTileZoom(A){return A.z}getTileMetadata(A){const{tileSize:t}=this.opts;return{bbox:V$(this._viewport,A.x,A.y,A.z,t)}}getParentIndex(A){const t=Math.floor(A.x/2),n=Math.floor(A.y/2),i=A.z-1;return{x:t,y:n,z:i}}updateTileStates(){const A=this.opts.refinementStrategy||om,t=new Array(this._cache.size);let n=0;for(const i of this._cache.values())t[n++]=i.isVisible,i.isSelected=!1,i.isVisible=!1;for(const i of this._selectedTiles)i.isSelected=!0,i.isVisible=!0;(typeof A=="function"?A:$$[A])(Array.from(this._cache.values())),n=0;for(const i of this._cache.values())if(t[n++]!==i.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:A}=this.opts,t=[];let n=0;for(const i of this._cache.values())i.isLoading&&(n++,!i.isSelected&&!i.isVisible&&t.push(i));for(;A>0&&n>A&&t.length>0;)t.shift().abort(),n--}_rebuildTree(){const{_cache:A}=this;for(const t of A.values())t.parent=null,t.children&&(t.children.length=0);for(const t of A.values()){const n=this._getNearestAncestor(t);t.parent=n,n!=null&&n.children&&n.children.push(t)}}_resizeCache(){const{_cache:A,opts:t}=this,n=t.maxCacheSize||(t.maxCacheByteSize?1/0:Z$*this.selectedTiles.length),i=t.maxCacheByteSize||1/0;if(A.size>n||this._cacheByteSize>i){for(const[o,s]of A)if(s.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?s.byteLength:0,A.delete(o),this.opts.onTileUnload(s)),A.size<=n&&this._cacheByteSize<=i)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((o,s)=>o.zoom-s.zoom),this._dirty=!1)}_getTile(A,t){const n=this.getTileId(A);let i=this._cache.get(n),r=!1;return!i&&t?(i=new Q$(A),Object.assign(i,this.getTileMetadata(i.index)),Object.assign(i,{id:n,zoom:this.getTileZoom(i.index)}),r=!0,this._cache.set(n,i),this._dirty=!0):i&&i.needsReload&&(r=!0),i&&r&&i.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),i}_getNearestAncestor(A){const{_minZoom:t=0}=this;let n=A.index;for(;this.getTileZoom(n)>t;){n=this.getParentIndex(n);const i=this._getTile(n);if(i)return i}return null}}function eAA(e){for(const A of e)A.state=0;for(const A of e)A.isSelected&&!lG(A)&&sm(A);for(const A of e)A.isVisible=!!(A.state&UE)}function tAA(e){for(const t of e)t.state=0;for(const t of e)t.isSelected&&lG(t);const A=Array.from(e).sort((t,n)=>t.zoom-n.zoom);for(const t of A)if(t.isVisible=!!(t.state&UE),t.children&&(t.isVisible||t.state&p1))for(const n of t.children)n.state=p1;else t.isSelected&&sm(t)}function lG(e){let A=e;for(;A;){if(A.isLoaded||A.content)return A.state|=UE,!0;A=A.parent}return!1}function sm(e){for(const A of e.children)A.isLoaded||A.content?A.state|=UE:sm(A)}const nAA={TilesetClass:AAA,data:{type:"data",value:[]},dataComparator:q$.equals,renderSubLayers:{type:"function",value:e=>new em(e),compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:e=>console.error(e),compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:om,zRange:null,maxRequests:6,zoomOffset:0};class am extends Zn{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){var A,t;(A=this.state)===null||A===void 0||(t=A.tileset)===null||t===void 0||t.finalize()}get isLoaded(){var A,t;return(A=this.state)===null||A===void 0||(t=A.tileset)===null||t===void 0?void 0:t.selectedTiles.every(n=>n.isLoaded&&n.layers&&n.layers.every(i=>i.isLoaded))}shouldUpdateState({changeFlags:A}){return A.somethingChanged}updateState({changeFlags:A}){let{tileset:t}=this.state;const n=A.propsOrDataChanged||A.updateTriggersChanged,i=A.dataChanged||A.updateTriggersChanged&&(A.updateTriggersChanged.all||A.updateTriggersChanged.getTileData);t?n&&(t.setOptions(this._getTilesetOptions()),i?t.reloadAll():this.state.tileset.tiles.forEach(r=>{r.layers=null})):(t=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:t})),this._updateTileset()}_getTilesetOptions(){const{tileSize:A,maxCacheSize:t,maxCacheByteSize:n,refinementStrategy:i,extent:r,maxZoom:o,minZoom:s,maxRequests:a,zoomOffset:g}=this.props;return{maxCacheSize:t,maxCacheByteSize:n,maxZoom:o,minZoom:s,tileSize:A,refinementStrategy:i,extent:r,maxRequests:a,zoomOffset:g,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const{tileset:A}=this.state,{zRange:t,modelMatrix:n}=this.props,i=A.update(this.context.viewport,{zRange:t,modelMatrix:n}),{isLoaded:r}=A,o=this.state.isLoaded!==r,s=this.state.frameNumber!==i;r&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=r}_onViewportLoad(){const{tileset:A}=this.state,{onViewportLoad:t}=this.props;t&&t(A.selectedTiles)}_onTileLoad(A){this.props.onTileLoad(A),A.layers=null,this.setNeedsUpdate()}_onTileError(A,t){this.props.onTileError(A),t.layers=null,this.setNeedsUpdate()}_onTileUnload(A){this.props.onTileUnload(A)}getTileData(A){const{data:t,getTileData:n,fetch:i}=this.props,{signal:r}=A;return A.url=typeof t=="string"||Array.isArray(t)?O$(t,A):null,n?n(A):i&&A.url?i(A.url,{propName:"data",layer:this,signal:r}):null}renderSubLayers(A){return this.props.renderSubLayers(A)}getSubLayerPropsByTile(A){return null}getPickingInfo({info:A,sourceLayer:t}){return A.tile=t.props.tile,A}_updateAutoHighlight(A){A.sourceLayer&&A.sourceLayer.updateAutoHighlight(A)}renderLayers(){return this.state.tileset.tiles.map(A=>{const t=this.getSubLayerPropsByTile(A);if(!(!A.isLoaded&&!A.content))if(A.layers)t&&A.layers[0]&&Object.keys(t).some(n=>A.layers[0].props[n]!==t[n])&&(A.layers=A.layers.map(n=>n.clone(t)));else{const n=this.renderSubLayers({...this.props,id:"".concat(this.id,"-").concat(A.id),data:A.content,_offset:0,tile:A});A.layers=RE(n,Boolean).map(i=>i.clone({tile:A,...t}))}return A.layers})}filterSubLayer({layer:A,cullRect:t}){const{tile:n}=A.props;return this.state.tileset.isTileVisible(n,t)}}y(am,"defaultProps",nAA);y(am,"layerName","TileLayer");function Ft(e){return(A,...t)=>iAA(e,A,t)}function lg(e,A){return Ft(cG(e,A).get)}const{apply:iAA,construct:ShA,defineProperty:DhA,get:RhA,getOwnPropertyDescriptor:cG,getPrototypeOf:gm,has:xhA,ownKeys:rAA,set:FhA,setPrototypeOf:NhA}=Reflect,{iterator:hc,species:_hA,toStringTag:oAA,for:LhA}=Symbol,sAA=Object,{create:Im,defineProperty:aAA,freeze:bhA,is:GhA}=sAA,gAA=Array,IAA=gAA.prototype,CG=IAA[hc],lAA=Ft(CG),uG=ArrayBuffer,cAA=uG.prototype;lg(cAA,"byteLength");const y1=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;y1&&lg(y1.prototype,"byteLength");const BG=gm(Uint8Array);BG.from;const Xt=BG.prototype;Xt[hc];Ft(Xt.keys);Ft(Xt.values);Ft(Xt.entries);Ft(Xt.set);Ft(Xt.reverse);Ft(Xt.fill);Ft(Xt.copyWithin);Ft(Xt.sort);Ft(Xt.slice);Ft(Xt.subarray);lg(Xt,"buffer");lg(Xt,"byteOffset");lg(Xt,"length");lg(Xt,oAA);const cg=Uint32Array,CAA=Float32Array,CB=gm([][hc]()),uAA=Ft(CB.next),BAA=Ft(function*(){}().next),EAA=gm(CB),hAA=DataView.prototype,fAA=Ft(hAA.getUint16),lm=WeakMap,EG=lm.prototype,hG=Ft(EG.get),QAA=Ft(EG.set),fG=new lm,dAA=Im(null,{next:{value:function(){const A=hG(fG,this);return uAA(A)}},[hc]:{value:function(){return this}}});function pAA(e){if(e[hc]===CG)return e;const A=Im(dAA);return QAA(fG,A,lAA(e)),A}const yAA=new lm,mAA=Im(EAA,{next:{value:function(){const A=hG(yAA,this);return BAA(A)},writable:!0,configurable:!0}});for(const e of rAA(CB))e!=="next"&&aAA(mAA,e,cG(CB,e));const QG=new uG(4),wAA=new CAA(QG),vAA=new cg(QG),ri=new cg(512),oi=new cg(512);for(let e=0;e<256;++e){const A=e-127;A<-27?(ri[e]=0,ri[e|256]=32768,oi[e]=24,oi[e|256]=24):A<-14?(ri[e]=1024>>-A-14,ri[e|256]=1024>>-A-14|32768,oi[e]=-A-1,oi[e|256]=-A-1):A<=15?(ri[e]=A+15<<10,ri[e|256]=A+15<<10|32768,oi[e]=13,oi[e|256]=13):A<128?(ri[e]=31744,ri[e|256]=64512,oi[e]=24,oi[e|256]=24):(ri[e]=31744,ri[e|256]=64512,oi[e]=13,oi[e|256]=13)}const cm=new cg(2048),Cg=new cg(64),dG=new cg(64);for(let e=1;e<1024;++e){let A=e<<13,t=0;for(;!(A&8388608);)A<<=1,t-=8388608;A&=-8388609,t+=947912704,cm[e]=A|t}for(let e=1024;e<2048;++e)cm[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)Cg[e]=e<<23;Cg[31]=1199570944;Cg[32]=2147483648;for(let e=33;e<63;++e)Cg[e]=2147483648+(e-32<<23);Cg[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(dG[e]=1024);function SAA(e){const A=e>>10;return vAA[0]=cm[dG[A]+(e&1023)]+Cg[A],wAA[0]}function pG(e,A,...t){return SAA(fAA(e,A,...pAA(t)))}var Cm={exports:{}};function yG(e,A,t){const n=t&&t.debug||!1;n&&console.log("getting "+A+" in "+e);const i=typeof e=="object"?e.outer:e,r=`${A}\\="([^"]*)"`;n&&console.log("pattern:",r);const s=new RegExp(r).exec(i);if(n&&console.log("match:",s),s)return s[1]}Cm.exports=yG;Cm.exports.default=yG;var DAA=Cm.exports;const Jf=Gn(DAA);var um={exports:{}},Bm={exports:{}},Em={exports:{}};function mG(e,A,t){const i=new RegExp(A).exec(e.slice(t));return i?t+i.index:-1}Em.exports=mG;Em.exports.default=mG;var RAA=Em.exports,hm={exports:{}};function wG(e,A,t){const i=new RegExp(A).exec(e.slice(t));return i?t+i.index+i[0].length-1:-1}hm.exports=wG;hm.exports.default=wG;var xAA=hm.exports,fm={exports:{}};function vG(e,A){const t=new RegExp(A,"g"),n=e.match(t);return n?n.length:0}fm.exports=vG;fm.exports.default=vG;var FAA=fm.exports;const NAA=RAA,Of=xAA,m1=FAA;function SG(e,A,t){const n=t&&t.debug||!1,i=!(t&&typeof t.nested===!1),r=t&&t.startIndex||0;n&&console.log("[xml-utils] starting findTagByName with",A," and ",t);const o=NAA(e,`<${A}[ >/]`,r);if(n&&console.log("[xml-utils] start:",o),o===-1)return;const s=e.slice(o+A.length);let a=Of(s,"^[^<]*[ /]>",0);const g=a!==-1&&s[a-1]==="/";if(n&&console.log("[xml-utils] selfClosing:",g),g===!1)if(i){let C=0,u=1,E=0;for(;(a=Of(s,"[ /]"+A+">",C))!==-1;){const B=s.substring(C,a+1);if(u+=m1(B,"<"+A),E+=m1(B,"/"+A+">"),E>=u)break;C=a}}else a=Of(s,"[ /]"+A+">",0);const I=o+A.length+a+1;if(n&&console.log("[xml-utils] end:",I),I===-1)return;const l=e.slice(o,I);let c;return g?c=null:c=l.slice(l.indexOf(">")+1,l.lastIndexOf("<")),{inner:c,outer:l,start:o,end:I}}Bm.exports=SG;Bm.exports.default=SG;var _AA=Bm.exports;const LAA=_AA;function DG(e,A,t){const n=[],i=t&&t.debug||!1,r=t&&typeof t.nested=="boolean"?t.nested:!0;let o=t&&t.startIndex||0,s;for(;s=LAA(e,A,{debug:i,startIndex:o});)r?o=s.start+1+A.length:o=s.end,n.push(s);return i&&console.log("findTagsByName found",n.length,"tags"),n}um.exports=DG;um.exports.default=DG;var bAA=um.exports;const GAA=Gn(bAA),HI={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Ii={};for(const e in HI)HI.hasOwnProperty(e)&&(Ii[HI[e]]=parseInt(e,10));const kAA=[Ii.BitsPerSample,Ii.ExtraSamples,Ii.SampleFormat,Ii.StripByteCounts,Ii.StripOffsets,Ii.StripRowCounts,Ii.TileByteCounts,Ii.TileOffsets,Ii.SubIFDs],Yf={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ne={};for(const e in Yf)Yf.hasOwnProperty(e)&&(ne[Yf[e]]=parseInt(e,10));const In={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9},MAA={Unspecified:0,Assocalpha:1,Unassalpha:2},khA={Version:0,AddCompression:1},MhA={None:0,Deflate:1},TAA={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};function UAA(e,A){const{width:t,height:n}=e,i=new Uint8Array(t*n*3);let r;for(let o=0,s=0;o>24,a=e[i+2]<<24>>24;let g=(o+16)/116,I=s/500+g,l=g-a/200,c,C,u;I=OAA*(I*I*I>.008856?I*I*I:(I-16/116)/7.787),g=YAA*(g*g*g>.008856?g*g*g:(g-16/116)/7.787),l=KAA*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),c=I*3.2406+g*-1.5372+l*-.4986,C=I*-.9689+g*1.8758+l*.0415,u=I*.0557+g*-.204+l*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:12.92*c,C=C>.0031308?1.055*C**(1/2.4)-.055:12.92*C,u=u>.0031308?1.055*u**(1/2.4)-.055:12.92*u,n[r]=Math.max(0,Math.min(1,c))*255,n[r+1]=Math.max(0,Math.min(1,C))*255,n[r+2]=Math.max(0,Math.min(1,u))*255}return n}const WAA="modulepreload",zAA=function(e){return"/"+e},w1={},Ss=function(A,t,n){if(!t||t.length===0)return A();const i=document.getElementsByTagName("link");return Promise.all(t.map(r=>{if(r=zAA(r),r in w1)return;w1[r]=!0;const o=r.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!n)for(let I=i.length-1;I>=0;I--){const l=i[I];if(l.href===r&&(!o||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${s}`))return;const g=document.createElement("link");if(g.rel=o?"stylesheet":WAA,o||(g.as="script",g.crossOrigin=""),g.href=r,document.head.appendChild(g),o)return new Promise((I,l)=>{g.addEventListener("load",I),g.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>A()).catch(r=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=r,window.dispatchEvent(o),!o.defaultPrevented)throw r})},RG=new Map;function gr(e,A){Array.isArray(e)||(e=[e]),e.forEach(t=>RG.set(t,A))}async function jAA(e){const A=RG.get(e.Compression);if(!A)throw new Error(`Unknown compression method identifier: ${e.Compression}`);const t=await A();return new t(e)}gr([void 0,1],()=>Ss(()=>import("./raw-7e701714.js"),[]).then(e=>e.default));gr(5,()=>Ss(()=>import("./lzw-a289c327.js"),[]).then(e=>e.default));gr(6,()=>{throw new Error("old style JPEG compression is not supported.")});gr(7,()=>Ss(()=>import("./jpeg-8a2bf234.js"),[]).then(e=>e.default));gr([8,32946],()=>Ss(()=>import("./deflate-b9c4caee.js"),["assets/deflate-b9c4caee.js","assets/pako.esm-147cf1d7.js"]).then(e=>e.default));gr(32773,()=>Ss(()=>import("./packbits-7b7e1ed7.js"),[]).then(e=>e.default));gr(34887,()=>Ss(()=>import("./lerc-88516884.js"),["assets/lerc-88516884.js","assets/pako.esm-147cf1d7.js"]).then(e=>e.default));gr(50001,()=>Ss(()=>import("./webimage-f3ac474a.js"),[]).then(e=>e.default));function PE(e,A,t,n=1){return new(Object.getPrototypeOf(e)).constructor(A*t*n)}function XAA(e,A,t,n,i){const r=A/n,o=t/i;return e.map(s=>{const a=PE(s,n,i);for(let g=0;g{const a=PE(s,n,i);for(let g=0;g>8-i-m&l;else if(m+i<=16)I[d]=s.getUint16(w)>>16-i-m&l;else if(m+i<=24){const v=s.getUint16(w)<<8|s.getUint8(w+2);I[d]=v>>24-i-m&l}else I[d]=s.getUint32(w)>>32-i-m&l}}}}return I.buffer}class oeA{constructor(A,t,n,i,r,o){this.fileDirectory=A,this.geoKeys=t,this.dataView=n,this.littleEndian=i,this.tiles=r?{}:null,this.isTiled=!A.StripOffsets;const s=A.PlanarConfiguration;if(this.planarConfiguration=typeof s>"u"?1:s,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(A){return this.isTiled||(A+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-A*this.getTileHeight()}getBytesPerPixel(){let A=0;for(let t=0;t=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${A} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[A]/8)}getReaderForSample(A){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[A]:1,n=this.fileDirectory.BitsPerSample[A];switch(t){case 1:if(n<=8)return DataView.prototype.getUint8;if(n<=16)return DataView.prototype.getUint16;if(n<=32)return DataView.prototype.getUint32;break;case 2:if(n<=8)return DataView.prototype.getInt8;if(n<=16)return DataView.prototype.getInt16;if(n<=32)return DataView.prototype.getInt32;break;case 3:switch(n){case 16:return function(i,r){return pG(this,i,r)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}break}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(A=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[A]:1}getBitsPerSample(A=0){return this.fileDirectory.BitsPerSample[A]}getArrayForSample(A,t){const n=this.getSampleFormat(A),i=this.getBitsPerSample(A);return c0(n,i,t)}async getTileOrStrip(A,t,n,i,r){const o=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight());let a;const{tiles:g}=this;this.planarConfiguration===1?a=t*o+A:this.planarConfiguration===2&&(a=n*o*s+t*o+A);let I,l;this.isTiled?(I=this.fileDirectory.TileOffsets[a],l=this.fileDirectory.TileByteCounts[a]):(I=this.fileDirectory.StripOffsets[a],l=this.fileDirectory.StripByteCounts[a]);const c=(await this.source.fetch([{offset:I,length:l}],r))[0];let C;return g===null||!g[a]?(C=(async()=>{let u=await i.decode(this.fileDirectory,c);const E=this.getSampleFormat(),B=this.getBitsPerSample();return ieA(E,B)&&(u=reA(u,E,this.planarConfiguration,this.getSamplesPerPixel(),B,this.getTileWidth(),this.getBlockHeight(t))),u})(),g!==null&&(g[a]=C)):C=g[a],{x:A,y:t,sample:n,data:await C}}async _readRaster(A,t,n,i,r,o,s,a,g){const I=this.getTileWidth(),l=this.getTileHeight(),c=this.getWidth(),C=this.getHeight(),u=Math.max(Math.floor(A[0]/I),0),E=Math.min(Math.ceil(A[2]/I),Math.ceil(c/I)),B=Math.max(Math.floor(A[1]/l),0),h=Math.min(Math.ceil(A[3]/l),Math.ceil(C/l)),f=A[2]-A[0];let Q=this.getBytesPerPixel();const d=[],w=[];for(let x=0;x{const W=H.data,J=new DataView(W),Z=this.getBlockHeight(H.y),z=H.y*l,O=H.x*I,Y=z+Z,T=(H.x+1)*I,q=w[N],j=Math.min(Z,Z-(Y-A[3]),C-z),AA=Math.min(I,I-(T-A[2]),c-O);for(let nA=Math.max(0,A[1]-z);nAI[2]||I[1]>I[3])throw new Error("Invalid subsets");const l=I[2]-I[0],c=I[3]-I[1],C=l*c,u=this.getSamplesPerPixel();if(!t||!t.length)for(let f=0;f=u)return Promise.reject(new RangeError(`Invalid sample index '${t[f]}'.`));let E;if(n){const f=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Q=Math.max.apply(null,this.fileDirectory.BitsPerSample);E=c0(f,Q,C*t.length),a&&E.fill(a)}else{E=[];for(let f=0;fg[2]||g[1]>g[3])throw new Error("Invalid subsets");const I=this.fileDirectory.PhotometricInterpretation;if(I===In.RGB){let h=[0,1,2];if(this.fileDirectory.ExtraSamples!==MAA.Unspecified&&s){h=[];for(let f=0;fJf(r,"sample")===void 0):i=i.filter(r=>Number(Jf(r,"sample"))===A);for(let r=0;r0;let r=!0;for(let o=0;o<8;o++){let s=this._dataView.getUint8(A+(t?o:7-o));i&&(r?s!==0&&(s=~(s-1)&255,r=!1):s=~s&255),n+=s*256**o}return i&&(n=-n),n}getUint8(A,t){return this._dataView.getUint8(A,t)}getInt8(A,t){return this._dataView.getInt8(A,t)}getUint16(A,t){return this._dataView.getUint16(A,t)}getInt16(A,t){return this._dataView.getInt16(A,t)}getUint32(A,t){return this._dataView.getUint32(A,t)}getInt32(A,t){return this._dataView.getInt32(A,t)}getFloat16(A,t){return pG(this._dataView,A,t)}getFloat32(A,t){return this._dataView.getFloat32(A,t)}getFloat64(A,t){return this._dataView.getFloat64(A,t)}}class aeA{constructor(A,t,n,i){this._dataView=new DataView(A),this._sliceOffset=t,this._littleEndian=n,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(A,t){return this.sliceOffset<=A&&this.sliceTop>=A+t}readUint8(A){return this._dataView.getUint8(A-this._sliceOffset,this._littleEndian)}readInt8(A){return this._dataView.getInt8(A-this._sliceOffset,this._littleEndian)}readUint16(A){return this._dataView.getUint16(A-this._sliceOffset,this._littleEndian)}readInt16(A){return this._dataView.getInt16(A-this._sliceOffset,this._littleEndian)}readUint32(A){return this._dataView.getUint32(A-this._sliceOffset,this._littleEndian)}readInt32(A){return this._dataView.getInt32(A-this._sliceOffset,this._littleEndian)}readFloat32(A){return this._dataView.getFloat32(A-this._sliceOffset,this._littleEndian)}readFloat64(A){return this._dataView.getFloat64(A-this._sliceOffset,this._littleEndian)}readUint64(A){const t=this.readUint32(A),n=this.readUint32(A+4);let i;if(this._littleEndian){if(i=t+2**32*n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*t+n,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(A){let t=0;const n=(this._dataView.getUint8(A+(this._littleEndian?7:0))&128)>0;let i=!0;for(let r=0;r<8;r++){let o=this._dataView.getUint8(A+(this._littleEndian?r:7-r));n&&(i?o!==0&&(o=~(o-1)&255,i=!1):o=~o&255),t+=o*256**r}return n&&(t=-t),t}readOffset(A){return this._bigTiff?this.readUint64(A):this.readUint32(A)}}const v1=`\r \r `;function FG(e){if(typeof Object.fromEntries<"u")return Object.fromEntries(e);const A={};for(const[t,n]of e)A[t.toLowerCase()]=n;return A}function geA(e){const A=e.split(`\r `).map(t=>{const n=t.split(":").map(i=>i.trim());return n[0]=n[0].toLowerCase(),n});return FG(A)}function IeA(e){const[A,...t]=e.split(";").map(i=>i.trim()),n=t.map(i=>i.split("="));return{type:A,params:FG(n)}}function C0(e){let A,t,n;return e&&([,A,t,n]=e.match(/bytes (\d+)-(\d+)\/(\d+)/),A=parseInt(A,10),t=parseInt(t,10),n=parseInt(n,10)),{start:A,end:t,total:n}}function leA(e,A){let t=null;const n=new TextDecoder("ascii"),i=[],r=`--${A}`,o=`${r}--`;for(let s=0;s<10;++s)n.decode(new Uint8Array(e,s,r.length))===r&&(t=s);if(t===null)throw new Error("Could not find initial boundary");for(;tthis.fetchSlice(n,t)))}async fetchSlice(A){throw new Error(`fetching of slice ${A} not possible, not implemented`)}get fileSize(){return null}async close(){}}class ceA extends Map{constructor(A={}){if(super(),!(A.maxSize&&A.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof A.maxAge=="number"&&A.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=A.maxSize,this.maxAge=A.maxAge||Number.POSITIVE_INFINITY,this.onEviction=A.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(A){if(typeof this.onEviction=="function")for(const[t,n]of A)this.onEviction(t,n.value)}_deleteIfExpired(A,t){return typeof t.expiry=="number"&&t.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(A,t.value),this.delete(A)):!1}_getOrDeleteIfExpired(A,t){if(this._deleteIfExpired(A,t)===!1)return t.value}_getItemValue(A,t){return t.expiry?this._getOrDeleteIfExpired(A,t):t.value}_peek(A,t){const n=t.get(A);return this._getItemValue(A,n)}_set(A,t){this.cache.set(A,t),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(A,t){this.oldCache.delete(A),this._set(A,t)}*_entriesAscending(){for(const A of this.oldCache){const[t,n]=A;this.cache.has(t)||this._deleteIfExpired(t,n)===!1&&(yield A)}for(const A of this.cache){const[t,n]=A;this._deleteIfExpired(t,n)===!1&&(yield A)}}get(A){if(this.cache.has(A)){const t=this.cache.get(A);return this._getItemValue(A,t)}if(this.oldCache.has(A)){const t=this.oldCache.get(A);if(this._deleteIfExpired(A,t)===!1)return this._moveToRecent(A,t),t.value}}set(A,t,{maxAge:n=this.maxAge}={}){const i=typeof n=="number"&&n!==Number.POSITIVE_INFINITY?Date.now()+n:void 0;this.cache.has(A)?this.cache.set(A,{value:t,expiry:i}):this._set(A,{value:t,expiry:i})}has(A){return this.cache.has(A)?!this._deleteIfExpired(A,this.cache.get(A)):this.oldCache.has(A)?!this._deleteIfExpired(A,this.oldCache.get(A)):!1}peek(A){if(this.cache.has(A))return this._peek(A,this.cache);if(this.oldCache.has(A))return this._peek(A,this.oldCache)}delete(A){const t=this.cache.delete(A);return t&&this._size--,this.oldCache.delete(A)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(A){if(!(A&&A>0))throw new TypeError("`maxSize` must be a number greater than 0");const t=[...this._entriesAscending()],n=t.length-A;n<0?(this.cache=new Map(t),this.oldCache=new Map,this._size=t.length):(n>0&&this._emitEvictions(t.slice(0,n)),this.oldCache=new Map(t.slice(n)),this.cache=new Map,this._size=0),this.maxSize=A}*keys(){for(const[A]of this)yield A}*values(){for(const[,A]of this)yield A}*[Symbol.iterator](){for(const A of this.cache){const[t,n]=A;this._deleteIfExpired(t,n)===!1&&(yield[t,n.value])}for(const A of this.oldCache){const[t,n]=A;this.cache.has(t)||this._deleteIfExpired(t,n)===!1&&(yield[t,n.value])}}*entriesDescending(){let A=[...this.cache];for(let t=A.length-1;t>=0;--t){const n=A[t],[i,r]=n;this._deleteIfExpired(i,r)===!1&&(yield[i,r.value])}A=[...this.oldCache];for(let t=A.length-1;t>=0;--t){const n=A[t],[i,r]=n;this.cache.has(i)||this._deleteIfExpired(i,r)===!1&&(yield[i,r.value])}}*entriesAscending(){for(const[A,t]of this._entriesAscending())yield[A,t.value]}get size(){if(!this._size)return this.oldCache.size;let A=0;for(const t of this.oldCache.keys())this.cache.has(t)||A++;return Math.min(this._size+A,this.maxSize)}entries(){return this.entriesAscending()}forEach(A,t=this){for(const[n,i]of this.entriesAscending())A.call(t,i,n,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}async function CeA(e){return new Promise(A=>setTimeout(A,e))}function ueA(e,A){const t=Array.isArray(e)?e:Array.from(e),n=Array.isArray(A)?A:Array.from(A);return t.map((i,r)=>[i,n[r]])}class Ja extends Error{constructor(A){super(A),Error.captureStackTrace&&Error.captureStackTrace(this,Ja),this.name="AbortError"}}class BeA extends Error{constructor(A,t){super(t),this.errors=A,this.message=t,this.name="AggregateError"}}const EeA=BeA;class heA{constructor(A,t,n=null){this.offset=A,this.length=t,this.data=n}get top(){return this.offset+this.length}}class S1{constructor(A,t,n){this.offset=A,this.length=t,this.blockIds=n}}class feA extends HE{constructor(A,{blockSize:t=65536,cacheSize:n=100}={}){super(),this.source=A,this.blockSize=t,this.blockCache=new ceA({maxSize:n}),this.blockRequests=new Map,this.blockIdsToFetch=new Set,this.abortedBlockIds=new Set}get fileSize(){return this.source.fileSize}async fetch(A,t){const n=[],i=[],r=[];for(const{offset:c,length:C}of A){let u=c+C;const{fileSize:E}=this;E!==null&&(u=Math.min(u,E));const B=Math.floor(c/this.blockSize)*this.blockSize;for(let h=B;hthis.abortedBlockIds.has(c)||!this.blockCache.has(c));if(a.forEach(c=>this.blockIdsToFetch.add(c)),a.length>0&&t&&!t.aborted){this.fetchBlocks(null);for(const c of a){const C=this.blockRequests.get(c);if(!C)throw new Error(`Block ${c} is not in the block requests`);s.push(C)}await Promise.allSettled(s)}if(t&&t.aborted)throw new Ja("Request was aborted");const g=r.map(c=>this.blockCache.get(c)),I=g.filter(c=>!c);if(I.length)throw new EeA(I,"Request failed");const l=new Map(ueA(r,g));return this.readSliceData(A,l)}fetchBlocks(A){if(this.blockIdsToFetch.size>0){const t=this.groupBlocks(this.blockIdsToFetch),n=this.source.fetch(t,A);for(let i=0;i{try{const s=(await n)[i],a=o*this.blockSize,g=a-s.offset,I=Math.min(g+this.blockSize,s.data.byteLength),l=s.data.slice(g,I),c=new heA(a,l.byteLength,l,o);this.blockCache.set(o,c),this.abortedBlockIds.delete(o)}catch(s){if(s.name==="AbortError")s.signal=A,this.blockCache.delete(o),this.abortedBlockIds.add(o);else throw s}finally{this.blockRequests.delete(o)}})())}this.blockIdsToFetch.clear()}}groupBlocks(A){const t=Array.from(A).sort((o,s)=>o-s);if(t.length===0)return[];let n=[],i=null;const r=[];for(const o of t)i===null||i+1===o?(n.push(o),i=o):(r.push(new S1(n[0]*this.blockSize,n.length*this.blockSize,n)),n=[o],i=o);return r.push(new S1(n[0]*this.blockSize,n.length*this.blockSize,n)),r}readSliceData(A,t){return A.map(n=>{let i=n.offset+n.length;this.fileSize!==null&&(i=Math.min(this.fileSize,i));const r=Math.floor(n.offset/this.blockSize),o=Math.floor(i/this.blockSize),s=new ArrayBuffer(n.length),a=new Uint8Array(s);for(let g=r;g<=o;++g){const I=t.get(g),l=I.offset-n.offset,c=I.top-i;let C=0,u=0,E;l<0?C=-l:l>0&&(u=l),c<0?E=I.length-C:E=i-I.offset-C;const B=new Uint8Array(I.data,C,E);a.set(B,u)}return s})}}class Qm{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(A){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class dm{constructor(A){this.url=A}async request({headers:A,credentials:t,signal:n}={}){throw new Error("request is not implemented")}}class QeA extends Qm{constructor(A){super(),this.response=A}get status(){return this.response.status}getHeader(A){return this.response.headers.get(A)}async getData(){return this.response.arrayBuffer?await this.response.arrayBuffer():(await this.response.buffer()).buffer}}class deA extends dm{constructor(A,t){super(A),this.credentials=t}async request({headers:A,credentials:t,signal:n}={}){const i=await fetch(this.url,{headers:A,credentials:t,signal:n});return new QeA(i)}}class peA extends Qm{constructor(A,t){super(),this.xhr=A,this.data=t}get status(){return this.xhr.status}getHeader(A){return this.xhr.getResponseHeader(A)}async getData(){return this.data}}class yeA extends dm{constructRequest(A,t){return new Promise((n,i)=>{const r=new XMLHttpRequest;r.open("GET",this.url),r.responseType="arraybuffer";for(const[o,s]of Object.entries(A))r.setRequestHeader(o,s);r.onload=()=>{const o=r.response;n(new peA(r,o))},r.onerror=i,r.onabort=()=>i(new Ja("Request aborted")),r.send(),t&&(t.aborted&&r.abort(),t.addEventListener("abort",()=>r.abort()))})}async request({headers:A,signal:t}={}){return await this.constructRequest(A,t)}}class meA extends Qm{constructor(A,t){super(),this.response=A,this.dataPromise=t}get status(){return this.response.statusCode}getHeader(A){return this.response.headers[A]}async getData(){return await this.dataPromise}}class weA extends dm{constructor(A){super(A),this.parsedUrl=wa.parse(this.url),this.httpApi=(this.parsedUrl.protocol==="http:",wa)}constructRequest(A,t){return new Promise((n,i)=>{const r=this.httpApi.get({...this.parsedUrl,headers:A},o=>{const s=new Promise(a=>{const g=[];o.on("data",I=>{g.push(I)}),o.on("end",()=>{const I=Buffer.concat(g).buffer;a(I)}),o.on("error",i)});n(new meA(o,s))});r.on("error",i),t&&(t.aborted&&r.destroy(new Ja("Request aborted")),t.addEventListener("abort",()=>r.destroy(new Ja("Request aborted"))))})}async request({headers:A,signal:t}={}){return await this.constructRequest(A,t)}}class pm extends HE{constructor(A,t,n,i){super(),this.client=A,this.headers=t,this.maxRanges=n,this.allowFullFile=i,this._fileSize=null}async fetch(A,t){return this.maxRanges>=A.length?this.fetchSlices(A,t):(this.maxRanges>0&&A.length>1,Promise.all(A.map(n=>this.fetchSlice(n,t))))}async fetchSlices(A,t){const n=await this.client.request({headers:{...this.headers,Range:`bytes=${A.map(({offset:i,length:r})=>`${i}-${i+r}`).join(",")}`},signal:t});if(n.ok)if(n.status===206){const{type:i,params:r}=IeA(n.getHeader("content-type"));if(i==="multipart/byteranges"){const l=leA(await n.getData(),r.boundary);return this._fileSize=l[0].fileSize||null,l}const o=await n.getData(),{start:s,end:a,total:g}=C0(n.getHeader("content-range"));this._fileSize=g||null;const I=[{data:o,offset:s,length:a-s}];if(A.length>1){const l=await Promise.all(A.slice(1).map(c=>this.fetchSlice(c,t)));return I.concat(l)}return I}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const i=await n.getData();return this._fileSize=i.byteLength,[{data:i,offset:0,length:i.byteLength}]}else throw new Error("Error fetching data.")}async fetchSlice(A,t){const{offset:n,length:i}=A,r=await this.client.request({headers:{...this.headers,Range:`bytes=${n}-${n+i}`},signal:t});if(r.ok)if(r.status===206){const o=await r.getData(),{total:s}=C0(r.getHeader("content-range"));return this._fileSize=s||null,{data:o,offset:n,length:i}}else{if(!this.allowFullFile)throw new Error("Server responded with full file");const o=await r.getData();return this._fileSize=o.byteLength,{data:o,offset:0,length:o.byteLength}}else throw new Error("Error fetching data.")}get fileSize(){return this._fileSize}}function ym(e,{blockSize:A,cacheSize:t}){return A===null?e:new feA(e,{blockSize:A,cacheSize:t})}function veA(e,{headers:A={},credentials:t,maxRanges:n=0,allowFullFile:i=!1,...r}={}){const o=new deA(e,t),s=new pm(o,A,n,i);return ym(s,r)}function SeA(e,{headers:A={},maxRanges:t=0,allowFullFile:n=!1,...i}={}){const r=new yeA(e),o=new pm(r,A,t,n);return ym(o,i)}function DeA(e,{headers:A={},maxRanges:t=0,allowFullFile:n=!1,...i}={}){const r=new weA(e),o=new pm(r,A,t,n);return ym(o,i)}function ReA(e,{forceXHR:A=!1,...t}={}){return typeof fetch=="function"&&!A?veA(e,t):typeof XMLHttpRequest<"u"?SeA(e,t):DeA(e,t)}class xeA extends HE{constructor(A){super(),this.file=A}async fetchSlice(A,t){return new Promise((n,i)=>{const r=this.file.slice(A.offset,A.offset+A.length),o=new FileReader;o.onload=s=>n(s.target.result),o.onerror=i,o.onabort=i,o.readAsArrayBuffer(r),t&&t.addEventListener("abort",()=>o.abort())})}}function FeA(e){return new xeA(e)}function NeA(e){return new Promise((A,t)=>{wa.close(e,n=>{n?t(n):A()})})}function _eA(e,A,t=void 0){return new Promise((n,i)=>{wa.open(e,A,t,(r,o)=>{r?i(r):n(o)})})}function LeA(...e){return new Promise((A,t)=>{wa.read(...e,(n,i,r)=>{n?t(n):A({bytesRead:i,buffer:r})})})}class beA extends HE{constructor(A){super(),this.path=A,this.openRequest=_eA(A,"r")}async fetchSlice(A){const t=await this.openRequest,{buffer:n}=await LeA(t,Buffer.alloc(A.length),0,A.length,A.offset);return n.buffer}async close(){const A=await this.openRequest;await NeA(A)}}function GeA(e){return new beA(e)}function keA(e,A){let t=e.length-A,n=0;do{for(let i=A;i>0;i--)e[n+A]+=e[n],n++;t-=A}while(t>0)}function MeA(e,A,t){let n=0,i=e.length;const r=i/t;for(;i>A;){for(let s=A;s>0;--s)e[n+A]+=e[n],++n;i-=A}const o=e.slice();for(let s=0;s=e.byteLength);++a){let g;if(A===2){switch(i[0]){case 8:g=new Uint8Array(e,a*s*t*o,s*t*o);break;case 16:g=new Uint16Array(e,a*s*t*o,s*t*o/2);break;case 32:g=new Uint32Array(e,a*s*t*o,s*t*o/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}keA(g,s)}else A===3&&(g=new Uint8Array(e,a*s*t*o,s*t*o),MeA(g,s,o))}return e}class UeA{async decode(A,t){const n=await this.decodeBlock(t),i=A.Predictor||1;if(i!==1){const r=!A.StripOffsets,o=r?A.TileWidth:A.ImageWidth,s=r?A.TileLength:A.RowsPerStrip||A.ImageLength;return TeA(n,i,o,s,A.BitsPerSample,A.PlanarConfiguration)}return n}}function u0(e){switch(e){case ne.BYTE:case ne.ASCII:case ne.SBYTE:case ne.UNDEFINED:return 1;case ne.SHORT:case ne.SSHORT:return 2;case ne.LONG:case ne.SLONG:case ne.FLOAT:case ne.IFD:return 4;case ne.RATIONAL:case ne.SRATIONAL:case ne.DOUBLE:case ne.LONG8:case ne.SLONG8:case ne.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${e}`)}}function PeA(e){const A=e.GeoKeyDirectory;if(!A)return null;const t={};for(let n=4;n<=A[3]*4;n+=4){const i=TAA[A[n]],r=A[n+1]?HI[A[n+1]]:null,o=A[n+2],s=A[n+3];let a=null;if(!r)a=s;else{if(a=e[r],typeof a>"u"||a===null)throw new Error(`Could not get value of geoKey '${i}'.`);typeof a=="string"?a=a.substring(s,s+o-1):a.subarray&&(a=a.subarray(s,s+o),o===1&&(a=a[0]))}t[i]=a}return t}function qs(e,A,t,n){let i=null,r=null;const o=u0(A);switch(A){case ne.BYTE:case ne.ASCII:case ne.UNDEFINED:i=new Uint8Array(t),r=e.readUint8;break;case ne.SBYTE:i=new Int8Array(t),r=e.readInt8;break;case ne.SHORT:i=new Uint16Array(t),r=e.readUint16;break;case ne.SSHORT:i=new Int16Array(t),r=e.readInt16;break;case ne.LONG:case ne.IFD:i=new Uint32Array(t),r=e.readUint32;break;case ne.SLONG:i=new Int32Array(t),r=e.readInt32;break;case ne.LONG8:case ne.IFD8:i=new Array(t),r=e.readUint64;break;case ne.SLONG8:i=new Array(t),r=e.readInt64;break;case ne.RATIONAL:i=new Uint32Array(t*2),r=e.readUint32;break;case ne.SRATIONAL:i=new Int32Array(t*2),r=e.readInt32;break;case ne.FLOAT:i=new Float32Array(t),r=e.readFloat32;break;case ne.DOUBLE:i=new Float64Array(t),r=e.readFloat64;break;default:throw new RangeError(`Invalid field type: ${A}`)}if(A===ne.RATIONAL||A===ne.SRATIONAL)for(let s=0;su.getWidth()-E.getWidth());for(let u=0;uB||o&&o>h)break}}let c=t;if(s){const[C,u]=a.getOrigin(),[E,B]=g.getResolution(a);c=[Math.round((s[0]-C)/E),Math.round((s[1]-u)/B),Math.round((s[2]-C)/E),Math.round((s[3]-u)/B)],c=[Math.min(c[0],c[2]),Math.min(c[1],c[3]),Math.max(c[0],c[2]),Math.max(c[1],c[3])]}return g.readRasters({...A,window:c})}}class fc extends qeA{constructor(A,t,n,i,r={}){super(),this.source=A,this.littleEndian=t,this.bigTiff=n,this.firstIFDOffset=i,this.cache=r.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(A,t){const n=this.bigTiff?4048:1024;return new aeA((await this.source.fetch([{offset:A,length:typeof t<"u"?t:n}]))[0],A,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(A){const t=this.bigTiff?20:12,n=this.bigTiff?8:2;let i=await this.getSlice(A);const r=this.bigTiff?i.readUint64(A):i.readUint16(A),o=r*t+(this.bigTiff?16:6);i.covers(A,o)||(i=await this.getSlice(A,o));const s={};let a=A+(this.bigTiff?8:2);for(let l=0;l{const t=await this.ifdRequests[A-1];if(t.nextIFDByteOffset===0)throw new QC(A);return this.parseFileDirectoryAt(t.nextIFDByteOffset)})(),this.ifdRequests[A]}async getImage(A=0){const t=await this.requestIFD(A);return new xG(t.fileDirectory,t.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let A=0,t=!0;for(;t;)try{await this.requestIFD(A),++A}catch(n){if(n instanceof QC)t=!1;else throw n}return A}async getGhostValues(){const A=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const t="GDAL_STRUCTURAL_METADATA_SIZE=",n=t.length+100;let i=await this.getSlice(A,n);if(t===qs(i,ne.ASCII,t.length,A)){const o=qs(i,ne.ASCII,n,A).split(` `)[0],s=Number(o.split("=")[1].split(" ")[0])+o.length;s>n&&(i=await this.getSlice(A,s));const a=qs(i,ne.ASCII,s,A);this.ghostValues={},a.split(` -`).filter(g=>g.length>0).map(g=>g.split("=")).forEach(([g,I])=>{this.ghostValues[g]=I})}return this.ghostValues}static async fromSource(A,t,n){const i=(await A.fetch([{offset:0,length:1024}],n))[0],r=new seA(i),o=r.getUint16(0,0);let s;if(o===18761)s=!0;else if(o===19789)s=!1;else throw new TypeError("Invalid byte order value.");const a=r.getUint16(2,s);let g;if(a===42)g=!1;else if(a===43){if(g=!0,r.getUint16(4,s)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const I=g?r.getUint64(8,s):r.getUint32(4,s);return new fc(A,s,g,I,t)}close(){return typeof this.source.close=="function"?this.source.close():!1}}async function qE(e,A={},t){return fc.fromSource(ReA(e,A),t)}async function NG(e,A){return fc.fromSource(GeA(e),A)}async function JE(e,A){return fc.fromSource(FeA(e),A)}const _G="__viv",JeA=`${_G}-offsets`;function OeA(e){YeA(e)||console.warn("GeoTIFF source is missing offsets proxy.")}function YeA(e){return e[_G]}function KeA(e,A){const t=(n,i)=>i==="getImage"?r=>{if(!(r in n.ifdRequests)&&r in A){const o=A[r];n.ifdRequests[r]=n.parseFileDirectoryAt(o)}return n.getImage(r)}:i===JeA?!0:Reflect.get(n,i);return new Proxy(e,{get:t})}let qn,dC=null;function D1(){return dC!==null&&dC.buffer===qn.memory.buffer||(dC=new Uint8Array(qn.memory.buffer)),dC}let R1=0,pC=null;function x1(){return pC!==null&&pC.buffer===qn.memory.buffer||(pC=new Int32Array(qn.memory.buffer)),pC}async function mm(e){e===void 0&&(e="".replace(/\.js$/,"_bg.wasm")),(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:A,module:t}=await async function(n,i){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,i)}catch(o){if(n.headers.get("Content-Type")=="application/wasm")throw o;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",o)}const r=await n.arrayBuffer();return await WebAssembly.instantiate(r,i)}{const r=await WebAssembly.instantiate(n,i);return r instanceof WebAssembly.Instance?{instance:r,module:n}:r}}(await e,{});return qn=A.exports,mm.__wbindgen_wasm_module=t,qn}var VeA=Object.freeze({__proto__:null,decompress:function(e,A){try{const g=qn.__wbindgen_add_to_stack_pointer(-16);var t=function(I,l){const c=l(1*I.length);return D1().set(I,c/1),R1=I.length,c}(e,qn.__wbindgen_malloc),n=R1;qn.decompress(g,t,n,A);var i=x1()[g/4+0],r=x1()[g/4+1],o=(s=i,a=r,D1().subarray(s/1,s/1+a)).slice();return qn.__wbindgen_free(i,1*r),o}finally{qn.__wbindgen_add_to_stack_pointer(16)}var s,a},default:mm});const WeA=[62,0,0,0,63,52,53,54,55,56,57,58,59,60,61,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,0,0,0,0,0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function yC(e){return WeA[e-43]}const zeA=function(e){let A,t=e.endsWith("==")?2:e.endsWith("=")?1:0,n=e.length,i=new Uint8Array(n/4*3);for(let r=0,o=0;r>16,i[o+1]=A>>8&255,i[o+2]=255&A;return i.subarray(0,i.length-t)}("AGFzbQEAAAABWQ5gAn9/AX9gA39/fwF/YAJ/fwBgAX8AYAN/f38AYAF/AX9gBH9/f38AYAR/f39/AX9gBn9/f39/fwBgAX8BfmAAAGAFf39/f38AYAV/f39/fwF/YAJ+fwF/A21sBQgICwMBAgUMAQABAAIABQACAgYGDQYDAgACAAAEBAQCAgYGAAYBBgIHAwQDBAQDAwADBQMDBAQEBAQCAgAHAAQAAgMBAgcFBAIDAQUCAgIDAgIDAwcCAQAABAIACgAAAQAFAgADBQkJCQMCBAUBcAErKwUDAQARBgkBfwFBgIDAAAsHXwUGbWVtb3J5AgAKZGVjb21wcmVzcwAnH19fd2JpbmRnZW5fYWRkX3RvX3N0YWNrX3BvaW50ZXIAYhFfX3diaW5kZ2VuX21hbGxvYwB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gCCCICIAA2AgwgBCAANgIIIABBADYCGCAAIAQ2AgwgACACNgIIDAULIAMgADYCAAsgACACNgIYIAAgADYCDCAAIAA2AggMAwsgBkEDdiIBQQN0QZSnwABqIQICf0GMp8AAKAIAIgRBASABdCIBcQRAIAIoAggMAQtBjKfAACABIARyNgIAIAILIQEgAiAANgIIIAEgADYCDCAAIAI2AgwgACABNgIIDAILQaiqwAAgADYCAEGgqsAAQaCqwAAoAgAgBmoiAjYCACAAIAJBAXI2AgQMAQtBpKrAACAANgIAQZyqwABBnKrAACgCACAGaiICNgIAIAAgAkEBcjYCBCAAIAJqIAI2AgALIAVBCGoPC0G0qsAAIQADQAJAIAAoAgAiASADTQRAIAEgACgCBGoiByADSw0BCyAAKAIIIQAMAQsLQaiqwAAgBTYCAEGgqsAAIARBWGoiADYCACAFIABBAXI2AgQgACAFakEoNgIEQcSqwABBgICAATYCACADIAdBYGpBeHFBeGoiACAAIANBEGpJGyIBQRs2AgRBtKrAACkCACEJIAFBEGpBvKrAACkCADcCACABIAk3AghBwKrAAEEANgIAQbiqwAAgBDYCAEG0qsAAIAU2AgBBvKrAACABQQhqNgIAIAFBHGohAANAIABBBzYCACAHIABBBGoiAEsNAAsgASADRg0AIAEgASgCBEF+cTYCBCADIAEgA2siBUEBcjYCBCABIAU2AgAgBUGAAk8EQCADQgA3AhAgA0EcagJ/QQAgBUEIdiIARQ0AGkEfIAVB////B0sNABogBUEGIABnIgBrQR9xdkEBcSAAQQF0a0E+agsiADYCACAAQQJ0QZypwABqIQECQAJAAkACQEGQp8AAKAIAIgRBASAAQR9xdCIHcQRAIAEoAgAiBEEEaigCAEF4cSAFRw0BIAQhAAwCC0GQp8AAIAQgB3I2AgAgASADNgIAIANBGGogATYCAAwDCyAFQQBBGSAAQQF2a0EfcSAAQR9GG3QhAQNAIAQgAUEddkEEcWpBEGoiBygCACIARQ0CIAFBAXQhASAAIQQgAEEEaigCAEF4cSAFRw0ACwsgACgCCCIBIAM2AgwgACADNgIIIANBG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gIAIARBQGskAAuuAgEIfyMAQTBrIgEkAEGAICECIAFBGGoQLyABKAIcIQQgASgCGCEFIAFBEGoQMiABKAIUIQYgASgCECEHIAFBCGpBgCBBARBAIAFBgCA2AiggASABKAIMIgg2AiQgASABKAIIIgM2AiAgCEGBIE8EQCABQSBqQYAgEEUgASgCICEDIAEoAighAgsgAEEAOwBHIABBADsBOCAAIAM2AiggACAFNgIQIABBCDoARiAAQQA6AAsgAEIANwMAIABBMGpCADcDACAAQSxqIAI2AgAgAEEkakEANgIAIABBIGogBjYCACAAQRxqIAc2AgAgAEEYakEANgIAIABBFGogBDYCACAAQQk6AAogAEGAAjsBQiAAQYECOwFEIABBggI7AUAgAEH/AzsBCCABQTBqJAALxwICBX8BfiMAQRBrIgMkACAALQALIQIgA0IANwMIIAEoAgAhBQJAAkAgAAJ/IAEoAgQiBEHAACACayIGQfgBcUEDdiICSQRAIARBCU8NAiADQQhqIAUgBBBLGiABQQA2AgQgAUGIg8AANgIAIARBA3QMAQsgBkH/AXFByABPDQIgA0EIaiAFIAIQSxogASAEIAJrNgIEIAEgAiAFajYCACAGQfgBcQsgAC0ACyIBajoACyAAIAApAwAgAykDCCIHQjiGIAdCKIZCgICAgICAwP8Ag4QgB0IYhkKAgICAgOA/gyAHQgiGQoCAgIDwH4OEhCAHQgiIQoCAgPgPgyAHQhiIQoCA/AeDhCAHQiiIQoD+A4MgB0I4iISEhCABQT9xrYiENwMAIANBEGokAA8LIARBCEHYhcAAEDcACyACQQhByIXAABA3AAuqAgEDfyMAQYABayIEJAACQAJAAn8CQCABKAIAIgNBEHFFBEAgACgCACECIANBIHENASACrSABEBUMAgsgACgCACECQQAhAANAIAAgBGpB/wBqIAJBD3EiA0EwciADQdcAaiADQQpJGzoAACAAQX9qIQAgAkEEdiICDQALIABBgAFqIgJBgQFPDQIgAUGkjsAAQQIgACAEakGAAWpBACAAaxAIDAELQQAhAANAIAAgBGpB/wBqIAJBD3EiA0EwciADQTdqIANBCkkbOgAAIABBf2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AAgATYCACAAQYAgNgIEC4YBAQF/IwBBQGoiASQAIAFBKzYCDCABQYCBwAA2AgggAUGsgcAANgIUIAEgADYCECABQSxqQQI2AgAgAUE8akEhNgIAIAFCAjcCHCABQayMwAA2AhggAUEdNgI0IAEgAUEwajYCKCABIAFBEGo2AjggASABQQhqNgIwIAFBGGpB8IDAABBRAAtxAQN/IwBBIGsiAiQAAkAgACABEBkNACABQRxqKAIAIQMgASgCGCACQRxqQQA2AgAgAkHwi8AANgIYIAJCATcCDCACQfSLwAA2AgggAyACQQhqEAkNACAAQQRqIAEQGSACQSBqJAAPCyACQSBqJABBAQswAQF/AkACQEGAwABBAhBZIgENAQwAC0GAwABBAhBjAAsgACABNgIAIABBgCA2AgQLewECfwJAAkAgACgCBCIBBEAgACgCDCICIAFPDQEgACgCACIBIAJqIAEtAAA6AAAgAEEANgIIIAAgACgCDEEBajYCDCAAKAIERQ0CIAAoAgAtAAAPC0EAQQBBiIbAABA2AAsgAiABQZiGwAAQNgALQQBBAEGohsAAEDYAC2gBAn8gACAALQBGIgFBAWoiAjoACiAAQQEgAUEPcXRBAmoiATsBQCAAQX8gAkEPcXRBf3M7AQggAEEYaigCACABQf//A3EiAU8EQCAAIAE2AhgLIABBJGooAgAgAU8EQCAAIAE2AiQLC1ABAX8gAEEUaigCACIBRSABQQJ0RXJFBEAgACgCEBAECyAAQSBqKAIAIgFFIAFBAXRFckUEQCAAKAIcEAQLIABBLGooAgAEQCAAKAIoEAQLC2wBAX8jAEEwayIDJAAgAyABNgIEIAMgADYCACADQRxqQQI2AgAgA0EsakEcNgIAIANCAjcCDCADQYCNwAA2AgggA0EcNgIkIAMgA0EgajYCGCADIAM2AiggAyADQQRqNgIgIANBCGogAhBRAAtsAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2AgAgA0EcakECNgIAIANBLGpBHDYCACADQgI3AgwgA0HMkcAANgIIIANBHDYCJCADIANBIGo2AhggAyADQQRqNgIoIAMgAzYCICADQQhqIAIQUQALbAEBfyMAQTBrIgMkACADIAE2AgQgAyAANgIAIANBHGpBAjYCACADQSxqQRw2AgAgA0ICNwIMIANBgJLAADYCCCADQRw2AiQgAyADQSBqNgIYIAMgA0EEajYCKCADIAM2AiAgA0EIaiACEFEAC2wBAX8jAEEwayIDJAAgAyABNgIEIAMgADYCACADQRxqQQI2AgAgA0EsakEcNgIAIANCAjcCDCADQayRwAA2AgggA0EcNgIkIAMgA0EgajYCGCADIANBBGo2AiggAyADNgIgIANBCGogAhBRAAtcAQF/IwBBEGsiAyQAAkAgACgCBCABayACTwRAIANBADYCAAwBCyADIAAgASACEBYgAygCAEEBRw0AIANBCGooAgAiAARAIAMoAgQgABBjAAsQXQALIANBEGokAAtaAQF/IwBBEGsiAiQAAkAgACgCBCABa0EBTwRAIAJBADYCAAwBCyACIAAgARAeIAIoAgBBAUcNACACQQhqKAIAIgAEQCACKAIEIAAQYwALEF0ACyACQRBqJAALWgEBfyMAQRBrIgIkAAJAIAAoAgQgAWtBAU8EQCACQQA2AgAMAQsgAiAAIAEQHSACKAIAQQFHDQAgAkEIaigCACIABEAgAigCBCAAEGMACxBdAAsgAkEQaiQAC1kBAX8jAEEgayICJAAgAiAAKAIANgIEIAJBGGogAUEQaikCADcDACACQRBqIAFBCGopAgA3AwAgAiABKQIANwMIIAJBBGpB2InAACACQQhqEAkgAkEgaiQAC0YAAkBBCCACSQRAAn9BCCACSQRAIAIgAxAQDAELIAMQAAsiAg0BQQAPCyAAIAMQCg8LIAIgACADIAEgASADSxsQSyAAEAQLWQEBfyMAQSBrIgIkACACIAAoAgA2AgQgAkEYaiABQRBqKQIANwMAIAJBEGogAUEIaikCADcDACACIAEpAgA3AwggAkEEakHwj8AAIAJBCGoQCSACQSBqJAALWQACQAJAAkAgAUF/SgRAAkAgAgRAIAENAQwECyABRQ0DIAFBARBZIgINBAwCCyABEEciAkUNAQwDCxBdAAsgAUEBEGMAC0EBIQILIAAgATYCBCAAIAI2AgALVgEBfyMAQSBrIgIkACACIAA2AgQgA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gQiAgRAIAAgAjYCBCAAQQhqQQE2AgAgACABKAIANgIADwsgAEEANgIACzEBAX8gACABKAIEIAEoAggiAksEfyABIAIQRSABKAIIBSACCzYCBCAAIAEoAgA2AgALKAEBfyAAKAIIIgIgAU8EQCAAKAIAGiAAIAE2AggPCyAAIAEgAmsQKAssAQF/IwBBEGsiASQAIAFBCGogAEEIaigCADYCACABIAApAgA3AwAgARAsAAs0AQF/IwBBEGsiAiQAIAIgATYCDCACIAA2AgggAkG8jMAANgIEIAJB8IvAADYCACACEEoACyEAIAEEQANAIABBADoAACAAQQFqIQAgAUF/aiIBDQALCwsgAQF/AkAgACgCACIBRQ0AIABBBGooAgBFDQAgARAECwsgAQF/AkAgACgCBCIBRQ0AIABBCGooAgBFDQAgARAECwsMACAAIAEgAiADED4LCwAgAQRAIAAQBAsLEgAgACgCACABIAEgAmoQH0EACxQAIAAoAgAgASAAKAIEKAIMEQAACxkAAn9BCCABSQRAIAEgABAQDAELIAAQAAsLEAAgACACNgIEIAAgATYCAAsTACAAQaCLwAA2AgQgACABNgIACxAAIAEgACgCACAAKAIEEAULEQBBzIvAAEERQeCLwAAQSAALDgAgACgCABoDQAwACwALCwAgADUCACABEBULDQAgACgCACABIAIQCwsLACAAMQAAIAEQFQsLACAAIwBqJAAjAAsZACAAIAFB+KbAACgCACIAQQ4gABsRAgAACw0AIAFBxJDAAEECEAULCQAgAEEAOgBHCwcAIAAtAEcLDQBC9Pme5u6jqvn+AAsNAEL3uO76qszV7uUACwwAQunQotvMouq7RgsDAAELAwABCwvfJgEAQYCAwAAL1SYvVXNlcnMvZm04MTMvLnJ1c3R1cC90b29sY2hhaW5zL3N0YWJsZS14ODZfNjQtYXBwbGUtZGFyd2luL2xpYi9ydXN0bGliL3NyYy9ydXN0L2xpYnJhcnkvY29yZS9zcmMvYWxsb2MvbGF5b3V0LnJzAAAQAHAAAAALAQAAOQAAAGNhbGxlZCBgUmVzdWx0Ojp1bndyYXAoKWAgb24gYW4gYEVycmAgdmF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VzdGMdMS40OS4wIChlMTg4NGE4ZTMgMjAyMC0xMi0yOSkGd2FscnVzBjAuMTguMAx3YXNtLWJpbmRnZW4SMC4yLjcwIChiNjM1NWMyNzAp");let Kf;async function jeA(e,A){Kf||(Kf=await(async()=>(await mm(zeA),VeA))());const t=Kf.decompress(e,A);if(t.length===0)throw Error("Failed to decode with LZW decoder.");return t}class XeA extends UeA{constructor(t){super();mo(this,"maxUncompressedSize");const n=t.TileWidth||t.ImageWidth,i=t.TileLength||t.ImageLength,r=t.BitsPerSample[0]/8;this.maxUncompressedSize=n*i*r}async decodeBlock(t){const n=new Uint8Array(t);return(await jeA(n,this.maxUncompressedSize)).buffer}}function Zg(e,A,t,n,i){LG(e,A,t||0,n||e.length-1,i||ZeA)}function LG(e,A,t,n,i){for(;n>t;){if(n-t>600){var r=n-t+1,o=A-t+1,s=Math.log(r),a=.5*Math.exp(2*s/3),g=.5*Math.sqrt(s*a*(r-a)/r)*(o-r/2<0?-1:1),I=Math.max(t,Math.floor(A-o*a/r+g)),l=Math.min(n,Math.floor(A+(r-o)*a/r+g));LG(e,A,I,l,i)}var c=e[A],C=t,u=n;for($g(e,t,A),i(e[n],c)>0&&$g(e,t,n);C0;)u--}i(e[t],c)===0?$g(e,t,u):(u++,$g(e,u,n)),u<=A&&(t=u+1),A<=u&&(n=u-1)}}function $g(e,A,t){var n=e[A];e[A]=e[t],e[t]=n}function ZeA(e,A){return eA?1:0}const Pn={uint8:"Uint8",uint16:"Uint16",uint32:"Uint32",float:"Float32",double:"Float64",int8:"Int8",int16:"Int16",int32:"Int32"};function Iu(e){let A=e.length,t=1/0,n=-1/0,i=0;for(;A--;)e[A]n&&(n=e[A]),i+=e[A];const r=i/e.length;A=e.length;let o=0;for(;A--;)o+=(e[A]-r)**2;const s=(o/e.length)**.5,a=Math.floor(e.length/2),g=Math.floor(e.length/4),I=3*Math.floor(e.length/4);Zg(e,a);const l=e[a];Zg(e,g,0,a);const c=e[g];Zg(e,I,a,e.length-1);const C=e[I],u=e.filter(Q=>Q>0),E=5e-4,B=Math.floor(u.length*(1-E)),h=Math.floor(u.length*E);Zg(u,B),Zg(u,h,0,B);const f=[u[h]||0,u[B]||0];return{mean:r,sd:s,q1:c,q3:C,median:l,domain:[t,n],contrastLimits:f}}function B0(e){return Array.isArray(e)?e:[e]}function $eA(e){if(!Number.isInteger(e))throw Error("Not an integer.");const A=new ArrayBuffer(4);new DataView(A).setInt32(0,e,!1);const n=new Uint8Array(A);return Array.from(n)}function ro(e){const A=e[e.length-1];return A===3||A===4}function uB(e){return e.toLowerCase().split("").reverse()}function bG(e){const A=new Map(e.map((t,n)=>[t,n]));if(A.size!==e.length)throw Error("Labels must be unique, found duplicated label.");return t=>{const n=A.get(t);if(n===void 0)throw Error("Invalid dimension.");return n}}function ho(e){const A=ro(e.shape),[t,n]=e.shape.slice(A?-3:-2);return{height:t,width:n}}function GG(e){return 2**Math.floor(Math.log2(e))}const wm="__vivSignalAborted";function kG(e){const A=e.getTileWidth(),t=e.getTileHeight(),n=Math.min(A,t);return GG(n)}function AtA(e){return e.nodeType===1}function etA(e){return e.nodeType===3}function MG(e,A){var n;if(etA(e))return((n=e.nodeValue)==null?void 0:n.trim())??"";if(e.childNodes.length===0&&(!e.attributes||e.attributes.length===0))return"";const t={};if(e.attributes&&e.attributes.length>0){const i={};for(let r=0;r{const a=[...n];return a[t("x")]=e.SizeX>>s,a[t("y")]=e.SizeY>>s,a};if(!(e.Type in Pn))throw Error(`Pixel type ${e.Type} not supported.`);const r=Pn[e.Type],o=ntA(e);return o?{labels:A,getShape:i,dtype:r,physicalSizes:o}:{labels:A,getShape:i,dtype:r}}function rtA(e){const t=e.fileDirectory.SampleFormat?e.fileDirectory.SampleFormat[0]:1,n=e.fileDirectory.BitsPerSample[0];switch(t){case 1:if(n<=8)return Pn.uint8;if(n<=16)return Pn.uint16;if(n<=32)return Pn.uint32;break;case 2:if(n<=8)return Pn.int8;if(n<=16)return Pn.int16;if(n<=32)return Pn.int32;break;case 3:switch(n){case 16:return Pn.float;case 32:return Pn.float;case 64:return Pn.double}break}throw Error("Unsupported data format/bitsPerSample")}function TG(e){let[A,t,n]=[0,0,0];for(const r of e)A=Math.max(A,r.selection.c),t=Math.max(t,r.selection.z),n=Math.max(n,r.selection.t);const i=e[0].tiff;return{x:i.getWidth(),y:i.getHeight(),z:t+1,c:A+1,t:n+1}}function otA(e,A){const t=Array(A).fill(0);for(const n of e){const i=n.selection.c,r=n.tiff.getSamplesPerPixel(),o=t[i];if(o&&o!=r)throw Error("Channel samples per pixel mismatch");t[i]=r}return t}function stA(e,A){const t=A[0].tiff,n=TG(A),i=[];for(const s of e.toLowerCase())i.unshift(n[s]);const r=uB(e),o=rtA(t);return{shape:i,labels:r,dtype:o}}function atA(e,A,t,n,i,r,o){const s=[];for(let a=0;a({"Acquisition Date":s,"Dimensions (XY)":`${g.x} x ${g.y}`,PixelsType:i,"Z-sections/Timepoints":`${g.z} x ${g.t}`,Channels:g.c})}}function F1(e){const A={},t=e.split("/").pop(),n=t==null?void 0:t.split(".");return n&&(A.name=n.slice(0,-1).join("."),[,A.extension]=n),A}var me;(function(e){e.assertEqual=i=>i;function A(i){}e.assertIs=A;function t(i){throw new Error}e.assertNever=t,e.arrayToEnum=i=>{const r={};for(const o of i)r[o]=o;return r},e.getValidEnumValues=i=>{const r=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of r)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(r){return i[r]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const r=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&r.push(o);return r},e.find=(i,r)=>{for(const o of i)if(r(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,r=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}e.joinValues=n,e.jsonStringifyReplacer=(i,r)=>typeof r=="bigint"?r.toString():r})(me||(me={}));var N1;(function(e){e.mergeShapes=(A,t)=>({...A,...t})})(N1||(N1={}));const fA=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_o=e=>{switch(typeof e){case"undefined":return fA.undefined;case"string":return fA.string;case"number":return isNaN(e)?fA.nan:fA.number;case"boolean":return fA.boolean;case"function":return fA.function;case"bigint":return fA.bigint;case"symbol":return fA.symbol;case"object":return Array.isArray(e)?fA.array:e===null?fA.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?fA.promise:typeof Map<"u"&&e instanceof Map?fA.map:typeof Set<"u"&&e instanceof Set?fA.set:typeof Date<"u"&&e instanceof Date?fA.date:fA.object;default:return fA.unknown}},sA=me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class mi extends Error{constructor(A){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=A}get errors(){return this.issues}format(A){const t=A||function(r){return r.message},n={_errors:[]},i=r=>{for(const o of r.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let s=n,a=0;for(;at.message){const t={},n=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(A(i))):n.push(A(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}mi.create=e=>new mi(e);const BB=(e,A)=>{let t;switch(e.code){case sA.invalid_type:e.received===fA.undefined?t="Required":t=`Expected ${e.expected}, received ${e.received}`;break;case sA.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(e.expected,me.jsonStringifyReplacer)}`;break;case sA.unrecognized_keys:t=`Unrecognized key(s) in object: ${me.joinValues(e.keys,", ")}`;break;case sA.invalid_union:t="Invalid input";break;case sA.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${me.joinValues(e.options)}`;break;case sA.invalid_enum_value:t=`Invalid enum value. Expected ${me.joinValues(e.options)}, received '${e.received}'`;break;case sA.invalid_arguments:t="Invalid function arguments";break;case sA.invalid_return_type:t="Invalid function return type";break;case sA.invalid_date:t="Invalid date";break;case sA.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(t=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?t=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?t=`Invalid input: must end with "${e.validation.endsWith}"`:me.assertNever(e.validation):e.validation!=="regex"?t=`Invalid ${e.validation}`:t="Invalid";break;case sA.too_small:e.type==="array"?t=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?t=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?t=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?t=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:t="Invalid input";break;case sA.too_big:e.type==="array"?t=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?t=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?t=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?t=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?t=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:t="Invalid input";break;case sA.custom:t="Invalid input";break;case sA.invalid_intersection_types:t="Intersection results could not be merged";break;case sA.not_multiple_of:t=`Number must be a multiple of ${e.multipleOf}`;break;case sA.not_finite:t="Number must be finite";break;default:t=A.defaultError,me.assertNever(e)}return{message:t}};let ItA=BB;function E0(){return ItA}const h0=e=>{const{data:A,path:t,errorMaps:n,issueData:i}=e,r=[...t,...i.path||[]],o={...i,path:r};let s="";const a=n.filter(g=>!!g).slice().reverse();for(const g of a)s=g(o,{data:A,defaultError:s}).message;return{...i,path:r,message:i.message||s}};function yA(e,A){const t=h0({issueData:A,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,E0(),BB].filter(n=>!!n)});e.common.issues.push(t)}class zt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(A,t){const n=[];for(const i of t){if(i.status==="aborted")return te;i.status==="dirty"&&A.dirty(),n.push(i.value)}return{status:A.value,value:n}}static async mergeObjectAsync(A,t){const n=[];for(const i of t)n.push({key:await i.key,value:await i.value});return zt.mergeObjectSync(A,n)}static mergeObjectSync(A,t){const n={};for(const i of t){const{key:r,value:o}=i;if(r.status==="aborted"||o.status==="aborted")return te;r.status==="dirty"&&A.dirty(),o.status==="dirty"&&A.dirty(),r.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[r.value]=o.value)}return{status:A.value,value:n}}}const te=Object.freeze({status:"aborted"}),ltA=e=>({status:"dirty",value:e}),sn=e=>({status:"valid",value:e}),_1=e=>e.status==="aborted",L1=e=>e.status==="dirty",EB=e=>e.status==="valid",f0=e=>typeof Promise<"u"&&e instanceof Promise;var bA;(function(e){e.errToObj=A=>typeof A=="string"?{message:A}:A||{},e.toString=A=>typeof A=="string"?A:A==null?void 0:A.message})(bA||(bA={}));class Di{constructor(A,t,n,i){this._cachedPath=[],this.parent=A,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const b1=(e,A)=>{if(EB(A))return{success:!0,data:A.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new mi(e.common.issues);return this._error=t,this._error}}};function ee(e){if(!e)return{};const{errorMap:A,invalid_type_error:t,required_error:n,description:i}=e;if(A&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return A?{errorMap:A,description:i}:{errorMap:(o,s)=>o.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:n??s.defaultError}:{message:t??s.defaultError},description:i}}class Ce{constructor(A){this.spa=this.safeParseAsync,this._def=A,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(A){return _o(A.data)}_getOrReturnCtx(A,t){return t||{common:A.parent.common,data:A.data,parsedType:_o(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}_processInputParams(A){return{status:new zt,ctx:{common:A.parent.common,data:A.data,parsedType:_o(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}}_parseSync(A){const t=this._parse(A);if(f0(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(A){const t=this._parse(A);return Promise.resolve(t)}parse(A,t){const n=this.safeParse(A,t);if(n.success)return n.data;throw n.error}safeParse(A,t){var n;const i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:_o(A)},r=this._parseSync({data:A,path:i.path,parent:i});return b1(i,r)}async parseAsync(A,t){const n=await this.safeParseAsync(A,t);if(n.success)return n.data;throw n.error}async safeParseAsync(A,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:_o(A)},i=this._parse({data:A,path:n.path,parent:n}),r=await(f0(i)?i:Promise.resolve(i));return b1(n,r)}refine(A,t){const n=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,r)=>{const o=A(i),s=()=>r.addIssue({code:sA.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(a=>a?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(A,t){return this._refinement((n,i)=>A(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(A){return new nr({schema:this,typeName:KA.ZodEffects,effect:{type:"refinement",refinement:A}})}superRefine(A){return this._refinement(A)}optional(){return Or.create(this,this._def)}nullable(){return Ka.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wi.create(this,this._def)}promise(){return Dl.create(this,this._def)}or(A){return dB.create([this,A],this._def)}and(A){return pB.create(this,A,this._def)}transform(A){return new nr({...ee(this._def),schema:this,typeName:KA.ZodEffects,effect:{type:"transform",transform:A}})}default(A){const t=typeof A=="function"?A:()=>A;return new SB({...ee(this._def),innerType:this,defaultValue:t,typeName:KA.ZodDefault})}brand(){return new mtA({typeName:KA.ZodBranded,type:this,...ee(this._def)})}catch(A){const t=typeof A=="function"?A:()=>A;return new w0({...ee(this._def),innerType:this,catchValue:t,typeName:KA.ZodCatch})}describe(A){const t=this.constructor;return new t({...this._def,description:A})}pipe(A){return OE.create(this,A)}readonly(){return S0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ctA=/^c[^\s-]{8,}$/i,CtA=/^[a-z][a-z0-9]*$/,utA=/^[0-9A-HJKMNP-TV-Z]{26}$/,BtA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,EtA=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,htA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Vf;const ftA=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,QtA=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,dtA=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ptA(e,A){return!!((A==="v4"||!A)&&ftA.test(e)||(A==="v6"||!A)&&QtA.test(e))}class fi extends Ce{_parse(A){if(this._def.coerce&&(A.data=String(A.data)),this._getType(A)!==fA.string){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_type,expected:fA.string,received:r.parsedType}),te}const n=new zt;let i;for(const r of this._def.checks)if(r.kind==="min")A.data.lengthr.value&&(i=this._getOrReturnCtx(A,i),yA(i,{code:sA.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){const o=A.data.length>r.value,s=A.data.lengthA.test(i),{validation:t,code:sA.invalid_string,...bA.errToObj(n)})}_addCheck(A){return new fi({...this._def,checks:[...this._def.checks,A]})}email(A){return this._addCheck({kind:"email",...bA.errToObj(A)})}url(A){return this._addCheck({kind:"url",...bA.errToObj(A)})}emoji(A){return this._addCheck({kind:"emoji",...bA.errToObj(A)})}uuid(A){return this._addCheck({kind:"uuid",...bA.errToObj(A)})}cuid(A){return this._addCheck({kind:"cuid",...bA.errToObj(A)})}cuid2(A){return this._addCheck({kind:"cuid2",...bA.errToObj(A)})}ulid(A){return this._addCheck({kind:"ulid",...bA.errToObj(A)})}ip(A){return this._addCheck({kind:"ip",...bA.errToObj(A)})}datetime(A){var t;return typeof A=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:A}):this._addCheck({kind:"datetime",precision:typeof(A==null?void 0:A.precision)>"u"?null:A==null?void 0:A.precision,offset:(t=A==null?void 0:A.offset)!==null&&t!==void 0?t:!1,...bA.errToObj(A==null?void 0:A.message)})}regex(A,t){return this._addCheck({kind:"regex",regex:A,...bA.errToObj(t)})}includes(A,t){return this._addCheck({kind:"includes",value:A,position:t==null?void 0:t.position,...bA.errToObj(t==null?void 0:t.message)})}startsWith(A,t){return this._addCheck({kind:"startsWith",value:A,...bA.errToObj(t)})}endsWith(A,t){return this._addCheck({kind:"endsWith",value:A,...bA.errToObj(t)})}min(A,t){return this._addCheck({kind:"min",value:A,...bA.errToObj(t)})}max(A,t){return this._addCheck({kind:"max",value:A,...bA.errToObj(t)})}length(A,t){return this._addCheck({kind:"length",value:A,...bA.errToObj(t)})}nonempty(A){return this.min(1,bA.errToObj(A))}trim(){return new fi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(A=>A.kind==="datetime")}get isEmail(){return!!this._def.checks.find(A=>A.kind==="email")}get isURL(){return!!this._def.checks.find(A=>A.kind==="url")}get isEmoji(){return!!this._def.checks.find(A=>A.kind==="emoji")}get isUUID(){return!!this._def.checks.find(A=>A.kind==="uuid")}get isCUID(){return!!this._def.checks.find(A=>A.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(A=>A.kind==="cuid2")}get isULID(){return!!this._def.checks.find(A=>A.kind==="ulid")}get isIP(){return!!this._def.checks.find(A=>A.kind==="ip")}get minLength(){let A=null;for(const t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxLength(){let A=null;for(const t of this._def.checks)t.kind==="max"&&(A===null||t.value{var A;return new fi({checks:[],typeName:KA.ZodString,coerce:(A=e==null?void 0:e.coerce)!==null&&A!==void 0?A:!1,...ee(e)})};function ytA(e,A){const t=(e.toString().split(".")[1]||"").length,n=(A.toString().split(".")[1]||"").length,i=t>n?t:n,r=parseInt(e.toFixed(i).replace(".","")),o=parseInt(A.toFixed(i).replace(".",""));return r%o/Math.pow(10,i)}class is extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(A){if(this._def.coerce&&(A.data=Number(A.data)),this._getType(A)!==fA.number){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_type,expected:fA.number,received:r.parsedType}),te}let n;const i=new zt;for(const r of this._def.checks)r.kind==="int"?me.isInteger(A.data)||(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):r.kind==="min"?(r.inclusive?A.datar.value:A.data>=r.value)&&(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="multipleOf"?ytA(A.data,r.value)!==0&&(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):r.kind==="finite"?Number.isFinite(A.data)||(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.not_finite,message:r.message}),i.dirty()):me.assertNever(r);return{status:i.value,value:A.data}}gte(A,t){return this.setLimit("min",A,!0,bA.toString(t))}gt(A,t){return this.setLimit("min",A,!1,bA.toString(t))}lte(A,t){return this.setLimit("max",A,!0,bA.toString(t))}lt(A,t){return this.setLimit("max",A,!1,bA.toString(t))}setLimit(A,t,n,i){return new is({...this._def,checks:[...this._def.checks,{kind:A,value:t,inclusive:n,message:bA.toString(i)}]})}_addCheck(A){return new is({...this._def,checks:[...this._def.checks,A]})}int(A){return this._addCheck({kind:"int",message:bA.toString(A)})}positive(A){return this._addCheck({kind:"min",value:0,inclusive:!1,message:bA.toString(A)})}negative(A){return this._addCheck({kind:"max",value:0,inclusive:!1,message:bA.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:0,inclusive:!0,message:bA.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:0,inclusive:!0,message:bA.toString(A)})}multipleOf(A,t){return this._addCheck({kind:"multipleOf",value:A,message:bA.toString(t)})}finite(A){return this._addCheck({kind:"finite",message:bA.toString(A)})}safe(A){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:bA.toString(A)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:bA.toString(A)})}get minValue(){let A=null;for(const t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxValue(){let A=null;for(const t of this._def.checks)t.kind==="max"&&(A===null||t.valueA.kind==="int"||A.kind==="multipleOf"&&me.isInteger(A.value))}get isFinite(){let A=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(A===null||n.valuenew is({checks:[],typeName:KA.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ee(e)});class rs extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(A){if(this._def.coerce&&(A.data=BigInt(A.data)),this._getType(A)!==fA.bigint){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_type,expected:fA.bigint,received:r.parsedType}),te}let n;const i=new zt;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?A.datar.value:A.data>=r.value)&&(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="multipleOf"?A.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):me.assertNever(r);return{status:i.value,value:A.data}}gte(A,t){return this.setLimit("min",A,!0,bA.toString(t))}gt(A,t){return this.setLimit("min",A,!1,bA.toString(t))}lte(A,t){return this.setLimit("max",A,!0,bA.toString(t))}lt(A,t){return this.setLimit("max",A,!1,bA.toString(t))}setLimit(A,t,n,i){return new rs({...this._def,checks:[...this._def.checks,{kind:A,value:t,inclusive:n,message:bA.toString(i)}]})}_addCheck(A){return new rs({...this._def,checks:[...this._def.checks,A]})}positive(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:bA.toString(A)})}negative(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:bA.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:bA.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:bA.toString(A)})}multipleOf(A,t){return this._addCheck({kind:"multipleOf",value:A,message:bA.toString(t)})}get minValue(){let A=null;for(const t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxValue(){let A=null;for(const t of this._def.checks)t.kind==="max"&&(A===null||t.value{var A;return new rs({checks:[],typeName:KA.ZodBigInt,coerce:(A=e==null?void 0:e.coerce)!==null&&A!==void 0?A:!1,...ee(e)})};class hB extends Ce{_parse(A){if(this._def.coerce&&(A.data=!!A.data),this._getType(A)!==fA.boolean){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.boolean,received:n.parsedType}),te}return sn(A.data)}}hB.create=e=>new hB({typeName:KA.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ee(e)});class Oa extends Ce{_parse(A){if(this._def.coerce&&(A.data=new Date(A.data)),this._getType(A)!==fA.date){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_type,expected:fA.date,received:r.parsedType}),te}if(isNaN(A.data.getTime())){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_date}),te}const n=new zt;let i;for(const r of this._def.checks)r.kind==="min"?A.data.getTime()r.value&&(i=this._getOrReturnCtx(A,i),yA(i,{code:sA.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):me.assertNever(r);return{status:n.value,value:new Date(A.data.getTime())}}_addCheck(A){return new Oa({...this._def,checks:[...this._def.checks,A]})}min(A,t){return this._addCheck({kind:"min",value:A.getTime(),message:bA.toString(t)})}max(A,t){return this._addCheck({kind:"max",value:A.getTime(),message:bA.toString(t)})}get minDate(){let A=null;for(const t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A!=null?new Date(A):null}get maxDate(){let A=null;for(const t of this._def.checks)t.kind==="max"&&(A===null||t.valuenew Oa({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:KA.ZodDate,...ee(e)});class Q0 extends Ce{_parse(A){if(this._getType(A)!==fA.symbol){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.symbol,received:n.parsedType}),te}return sn(A.data)}}Q0.create=e=>new Q0({typeName:KA.ZodSymbol,...ee(e)});class fB extends Ce{_parse(A){if(this._getType(A)!==fA.undefined){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.undefined,received:n.parsedType}),te}return sn(A.data)}}fB.create=e=>new fB({typeName:KA.ZodUndefined,...ee(e)});class QB extends Ce{_parse(A){if(this._getType(A)!==fA.null){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.null,received:n.parsedType}),te}return sn(A.data)}}QB.create=e=>new QB({typeName:KA.ZodNull,...ee(e)});class d0 extends Ce{constructor(){super(...arguments),this._any=!0}_parse(A){return sn(A.data)}}d0.create=e=>new d0({typeName:KA.ZodAny,...ee(e)});class xa extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(A){return sn(A.data)}}xa.create=e=>new xa({typeName:KA.ZodUnknown,...ee(e)});class oo extends Ce{_parse(A){const t=this._getOrReturnCtx(A);return yA(t,{code:sA.invalid_type,expected:fA.never,received:t.parsedType}),te}}oo.create=e=>new oo({typeName:KA.ZodNever,...ee(e)});class p0 extends Ce{_parse(A){if(this._getType(A)!==fA.undefined){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.void,received:n.parsedType}),te}return sn(A.data)}}p0.create=e=>new p0({typeName:KA.ZodVoid,...ee(e)});class wi extends Ce{_parse(A){const{ctx:t,status:n}=this._processInputParams(A),i=this._def;if(t.parsedType!==fA.array)return yA(t,{code:sA.invalid_type,expected:fA.array,received:t.parsedType}),te;if(i.exactLength!==null){const o=t.data.length>i.exactLength.value,s=t.data.lengthi.maxLength.value&&(yA(t,{code:sA.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,s)=>i.type._parseAsync(new Di(t,o,t.path,s)))).then(o=>zt.mergeArray(n,o));const r=[...t.data].map((o,s)=>i.type._parseSync(new Di(t,o,t.path,s)));return zt.mergeArray(n,r)}get element(){return this._def.type}min(A,t){return new wi({...this._def,minLength:{value:A,message:bA.toString(t)}})}max(A,t){return new wi({...this._def,maxLength:{value:A,message:bA.toString(t)}})}length(A,t){return new wi({...this._def,exactLength:{value:A,message:bA.toString(t)}})}nonempty(A){return this.min(1,A)}}wi.create=(e,A)=>new wi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:KA.ZodArray,...ee(A)});function Xs(e){if(e instanceof et){const A={};for(const t in e.shape){const n=e.shape[t];A[t]=Or.create(Xs(n))}return new et({...e._def,shape:()=>A})}else return e instanceof wi?new wi({...e._def,type:Xs(e.element)}):e instanceof Or?Or.create(Xs(e.unwrap())):e instanceof Ka?Ka.create(Xs(e.unwrap())):e instanceof tr?tr.create(e.items.map(A=>Xs(A))):e}class et extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const A=this._def.shape(),t=me.objectKeys(A);return this._cached={shape:A,keys:t}}_parse(A){if(this._getType(A)!==fA.object){const g=this._getOrReturnCtx(A);return yA(g,{code:sA.invalid_type,expected:fA.object,received:g.parsedType}),te}const{status:n,ctx:i}=this._processInputParams(A),{shape:r,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof oo&&this._def.unknownKeys==="strip"))for(const g in i.data)o.includes(g)||s.push(g);const a=[];for(const g of o){const I=r[g],l=i.data[g];a.push({key:{status:"valid",value:g},value:I._parse(new Di(i,l,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof oo){const g=this._def.unknownKeys;if(g==="passthrough")for(const I of s)a.push({key:{status:"valid",value:I},value:{status:"valid",value:i.data[I]}});else if(g==="strict")s.length>0&&(yA(i,{code:sA.unrecognized_keys,keys:s}),n.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const I of s){const l=i.data[I];a.push({key:{status:"valid",value:I},value:g._parse(new Di(i,l,i.path,I)),alwaysSet:I in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const g=[];for(const I of a){const l=await I.key;g.push({key:l,value:await I.value,alwaysSet:I.alwaysSet})}return g}).then(g=>zt.mergeObjectSync(n,g)):zt.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(A){return bA.errToObj,new et({...this._def,unknownKeys:"strict",...A!==void 0?{errorMap:(t,n)=>{var i,r,o,s;const a=(o=(r=(i=this._def).errorMap)===null||r===void 0?void 0:r.call(i,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(s=bA.errToObj(A).message)!==null&&s!==void 0?s:a}:{message:a}}}:{}})}strip(){return new et({...this._def,unknownKeys:"strip"})}passthrough(){return new et({...this._def,unknownKeys:"passthrough"})}extend(A){return new et({...this._def,shape:()=>({...this._def.shape(),...A})})}merge(A){return new et({unknownKeys:A._def.unknownKeys,catchall:A._def.catchall,shape:()=>({...this._def.shape(),...A._def.shape()}),typeName:KA.ZodObject})}setKey(A,t){return this.augment({[A]:t})}catchall(A){return new et({...this._def,catchall:A})}pick(A){const t={};return me.objectKeys(A).forEach(n=>{A[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new et({...this._def,shape:()=>t})}omit(A){const t={};return me.objectKeys(this.shape).forEach(n=>{A[n]||(t[n]=this.shape[n])}),new et({...this._def,shape:()=>t})}deepPartial(){return Xs(this)}partial(A){const t={};return me.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];A&&!A[n]?t[n]=i:t[n]=i.optional()}),new et({...this._def,shape:()=>t})}required(A){const t={};return me.objectKeys(this.shape).forEach(n=>{if(A&&!A[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof Or;)r=r._def.innerType;t[n]=r}}),new et({...this._def,shape:()=>t})}keyof(){return UG(me.objectKeys(this.shape))}}et.create=(e,A)=>new et({shape:()=>e,unknownKeys:"strip",catchall:oo.create(),typeName:KA.ZodObject,...ee(A)});et.strictCreate=(e,A)=>new et({shape:()=>e,unknownKeys:"strict",catchall:oo.create(),typeName:KA.ZodObject,...ee(A)});et.lazycreate=(e,A)=>new et({shape:e,unknownKeys:"strip",catchall:oo.create(),typeName:KA.ZodObject,...ee(A)});class dB extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A),n=this._def.options;function i(r){for(const s of r)if(s.result.status==="valid")return s.result;for(const s of r)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const o=r.map(s=>new mi(s.ctx.common.issues));return yA(t,{code:sA.invalid_union,unionErrors:o}),te}if(t.common.async)return Promise.all(n.map(async r=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let r;const o=[];for(const a of n){const g={...t,common:{...t.common,issues:[]},parent:null},I=a._parseSync({data:t.data,path:t.path,parent:g});if(I.status==="valid")return I;I.status==="dirty"&&!r&&(r={result:I,ctx:g}),g.common.issues.length&&o.push(g.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const s=o.map(a=>new mi(a));return yA(t,{code:sA.invalid_union,unionErrors:s}),te}}get options(){return this._def.options}}dB.create=(e,A)=>new dB({options:e,typeName:KA.ZodUnion,...ee(A)});const lu=e=>e instanceof mB?lu(e.schema):e instanceof nr?lu(e.innerType()):e instanceof wB?[e.value]:e instanceof os?e.options:e instanceof vB?Object.keys(e.enum):e instanceof SB?lu(e._def.innerType):e instanceof fB?[void 0]:e instanceof QB?[null]:null;class vm extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A);if(t.parsedType!==fA.object)return yA(t,{code:sA.invalid_type,expected:fA.object,received:t.parsedType}),te;const n=this.discriminator,i=t.data[n],r=this.optionsMap.get(i);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(yA(t,{code:sA.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),te)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(A,t,n){const i=new Map;for(const r of t){const o=lu(r.shape[A]);if(!o)throw new Error(`A discriminator value for key \`${A}\` could not be extracted from all schema options`);for(const s of o){if(i.has(s))throw new Error(`Discriminator property ${String(A)} has duplicate value ${String(s)}`);i.set(s,r)}}return new vm({typeName:KA.ZodDiscriminatedUnion,discriminator:A,options:t,optionsMap:i,...ee(n)})}}function y0(e,A){const t=_o(e),n=_o(A);if(e===A)return{valid:!0,data:e};if(t===fA.object&&n===fA.object){const i=me.objectKeys(A),r=me.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...A};for(const s of r){const a=y0(e[s],A[s]);if(!a.valid)return{valid:!1};o[s]=a.data}return{valid:!0,data:o}}else if(t===fA.array&&n===fA.array){if(e.length!==A.length)return{valid:!1};const i=[];for(let r=0;r{if(_1(r)||_1(o))return te;const s=y0(r.value,o.value);return s.valid?((L1(r)||L1(o))&&t.dirty(),{status:t.value,value:s.data}):(yA(n,{code:sA.invalid_intersection_types}),te)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,o])=>i(r,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}pB.create=(e,A,t)=>new pB({left:e,right:A,typeName:KA.ZodIntersection,...ee(t)});class tr extends Ce{_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==fA.array)return yA(n,{code:sA.invalid_type,expected:fA.array,received:n.parsedType}),te;if(n.data.lengththis._def.items.length&&(yA(n,{code:sA.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((o,s)=>{const a=this._def.items[s]||this._def.rest;return a?a._parse(new Di(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(r).then(o=>zt.mergeArray(t,o)):zt.mergeArray(t,r)}get items(){return this._def.items}rest(A){return new tr({...this._def,rest:A})}}tr.create=(e,A)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tr({items:e,typeName:KA.ZodTuple,rest:null,...ee(A)})};class yB extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==fA.object)return yA(n,{code:sA.invalid_type,expected:fA.object,received:n.parsedType}),te;const i=[],r=this._def.keyType,o=this._def.valueType;for(const s in n.data)i.push({key:r._parse(new Di(n,s,n.path,s)),value:o._parse(new Di(n,n.data[s],n.path,s))});return n.common.async?zt.mergeObjectAsync(t,i):zt.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(A,t,n){return t instanceof Ce?new yB({keyType:A,valueType:t,typeName:KA.ZodRecord,...ee(n)}):new yB({keyType:fi.create(),valueType:A,typeName:KA.ZodRecord,...ee(t)})}}class m0 extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==fA.map)return yA(n,{code:sA.invalid_type,expected:fA.map,received:n.parsedType}),te;const i=this._def.keyType,r=this._def.valueType,o=[...n.data.entries()].map(([s,a],g)=>({key:i._parse(new Di(n,s,n.path,[g,"key"])),value:r._parse(new Di(n,a,n.path,[g,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const a of o){const g=await a.key,I=await a.value;if(g.status==="aborted"||I.status==="aborted")return te;(g.status==="dirty"||I.status==="dirty")&&t.dirty(),s.set(g.value,I.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const a of o){const g=a.key,I=a.value;if(g.status==="aborted"||I.status==="aborted")return te;(g.status==="dirty"||I.status==="dirty")&&t.dirty(),s.set(g.value,I.value)}return{status:t.value,value:s}}}}m0.create=(e,A,t)=>new m0({valueType:A,keyType:e,typeName:KA.ZodMap,...ee(t)});class Ya extends Ce{_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==fA.set)return yA(n,{code:sA.invalid_type,expected:fA.set,received:n.parsedType}),te;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(yA(n,{code:sA.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const r=this._def.valueType;function o(a){const g=new Set;for(const I of a){if(I.status==="aborted")return te;I.status==="dirty"&&t.dirty(),g.add(I.value)}return{status:t.value,value:g}}const s=[...n.data.values()].map((a,g)=>r._parse(new Di(n,a,n.path,g)));return n.common.async?Promise.all(s).then(a=>o(a)):o(s)}min(A,t){return new Ya({...this._def,minSize:{value:A,message:bA.toString(t)}})}max(A,t){return new Ya({...this._def,maxSize:{value:A,message:bA.toString(t)}})}size(A,t){return this.min(A,t).max(A,t)}nonempty(A){return this.min(1,A)}}Ya.create=(e,A)=>new Ya({valueType:e,minSize:null,maxSize:null,typeName:KA.ZodSet,...ee(A)});class qI extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(A){const{ctx:t}=this._processInputParams(A);if(t.parsedType!==fA.function)return yA(t,{code:sA.invalid_type,expected:fA.function,received:t.parsedType}),te;function n(s,a){return h0({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,E0(),BB].filter(g=>!!g),issueData:{code:sA.invalid_arguments,argumentsError:a}})}function i(s,a){return h0({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,E0(),BB].filter(g=>!!g),issueData:{code:sA.invalid_return_type,returnTypeError:a}})}const r={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Dl){const s=this;return sn(async function(...a){const g=new mi([]),I=await s._def.args.parseAsync(a,r).catch(C=>{throw g.addIssue(n(a,C)),g}),l=await Reflect.apply(o,this,I);return await s._def.returns._def.type.parseAsync(l,r).catch(C=>{throw g.addIssue(i(l,C)),g})})}else{const s=this;return sn(function(...a){const g=s._def.args.safeParse(a,r);if(!g.success)throw new mi([n(a,g.error)]);const I=Reflect.apply(o,this,g.data),l=s._def.returns.safeParse(I,r);if(!l.success)throw new mi([i(I,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...A){return new qI({...this._def,args:tr.create(A).rest(xa.create())})}returns(A){return new qI({...this._def,returns:A})}implement(A){return this.parse(A)}strictImplement(A){return this.parse(A)}static create(A,t,n){return new qI({args:A||tr.create([]).rest(xa.create()),returns:t||xa.create(),typeName:KA.ZodFunction,...ee(n)})}}class mB extends Ce{get schema(){return this._def.getter()}_parse(A){const{ctx:t}=this._processInputParams(A);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}mB.create=(e,A)=>new mB({getter:e,typeName:KA.ZodLazy,...ee(A)});class wB extends Ce{_parse(A){if(A.data!==this._def.value){const t=this._getOrReturnCtx(A);return yA(t,{received:t.data,code:sA.invalid_literal,expected:this._def.value}),te}return{status:"valid",value:A.data}}get value(){return this._def.value}}wB.create=(e,A)=>new wB({value:e,typeName:KA.ZodLiteral,...ee(A)});function UG(e,A){return new os({values:e,typeName:KA.ZodEnum,...ee(A)})}class os extends Ce{_parse(A){if(typeof A.data!="string"){const t=this._getOrReturnCtx(A),n=this._def.values;return yA(t,{expected:me.joinValues(n),received:t.parsedType,code:sA.invalid_type}),te}if(this._def.values.indexOf(A.data)===-1){const t=this._getOrReturnCtx(A),n=this._def.values;return yA(t,{received:t.data,code:sA.invalid_enum_value,options:n}),te}return sn(A.data)}get options(){return this._def.values}get enum(){const A={};for(const t of this._def.values)A[t]=t;return A}get Values(){const A={};for(const t of this._def.values)A[t]=t;return A}get Enum(){const A={};for(const t of this._def.values)A[t]=t;return A}extract(A){return os.create(A)}exclude(A){return os.create(this.options.filter(t=>!A.includes(t)))}}os.create=UG;class vB extends Ce{_parse(A){const t=me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(A);if(n.parsedType!==fA.string&&n.parsedType!==fA.number){const i=me.objectValues(t);return yA(n,{expected:me.joinValues(i),received:n.parsedType,code:sA.invalid_type}),te}if(t.indexOf(A.data)===-1){const i=me.objectValues(t);return yA(n,{received:n.data,code:sA.invalid_enum_value,options:i}),te}return sn(A.data)}get enum(){return this._def.values}}vB.create=(e,A)=>new vB({values:e,typeName:KA.ZodNativeEnum,...ee(A)});class Dl extends Ce{unwrap(){return this._def.type}_parse(A){const{ctx:t}=this._processInputParams(A);if(t.parsedType!==fA.promise&&t.common.async===!1)return yA(t,{code:sA.invalid_type,expected:fA.promise,received:t.parsedType}),te;const n=t.parsedType===fA.promise?t.data:Promise.resolve(t.data);return sn(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Dl.create=(e,A)=>new Dl({type:e,typeName:KA.ZodPromise,...ee(A)});class nr extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===KA.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(A){const{status:t,ctx:n}=this._processInputParams(A),i=this._def.effect||null,r={addIssue:o=>{yA(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),i.type==="preprocess"){const o=i.transform(n.data,r);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(s=>this._def.schema._parseAsync({data:s,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=s=>{const a=i.refinement(s,r);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?te:(s.status==="dirty"&&t.dirty(),o(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?te:(s.status==="dirty"&&t.dirty(),o(s.value).then(()=>({status:t.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!EB(o))return o;const s=i.transform(o.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>EB(o)?Promise.resolve(i.transform(o.value,r)).then(s=>({status:t.value,value:s})):o);me.assertNever(i)}}nr.create=(e,A,t)=>new nr({schema:e,typeName:KA.ZodEffects,effect:A,...ee(t)});nr.createWithPreprocess=(e,A,t)=>new nr({schema:A,effect:{type:"preprocess",transform:e},typeName:KA.ZodEffects,...ee(t)});class Or extends Ce{_parse(A){return this._getType(A)===fA.undefined?sn(void 0):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}}Or.create=(e,A)=>new Or({innerType:e,typeName:KA.ZodOptional,...ee(A)});class Ka extends Ce{_parse(A){return this._getType(A)===fA.null?sn(null):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}}Ka.create=(e,A)=>new Ka({innerType:e,typeName:KA.ZodNullable,...ee(A)});class SB extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A);let n=t.data;return t.parsedType===fA.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}SB.create=(e,A)=>new SB({innerType:e,typeName:KA.ZodDefault,defaultValue:typeof A.default=="function"?A.default:()=>A.default,...ee(A)});class w0 extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return f0(i)?i.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new mi(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new mi(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}w0.create=(e,A)=>new w0({innerType:e,typeName:KA.ZodCatch,catchValue:typeof A.catch=="function"?A.catch:()=>A.catch,...ee(A)});class v0 extends Ce{_parse(A){if(this._getType(A)!==fA.nan){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.nan,received:n.parsedType}),te}return{status:"valid",value:A.data}}}v0.create=e=>new v0({typeName:KA.ZodNaN,...ee(e)});class mtA extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class OE extends Ce{_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?te:r.status==="dirty"?(t.dirty(),ltA(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?te:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(A,t){return new OE({in:A,out:t,typeName:KA.ZodPipeline})}}class S0 extends Ce{_parse(A){const t=this._def.innerType._parse(A);return EB(t)&&(t.value=Object.freeze(t.value)),t}}S0.create=(e,A)=>new S0({innerType:e,typeName:KA.ZodReadonly,...ee(A)});et.lazycreate;var KA;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(KA||(KA={}));const un=fi.create;is.create;v0.create;rs.create;hB.create;Oa.create;Q0.create;fB.create;QB.create;d0.create;xa.create;oo.create;p0.create;wi.create;const _n=et.create;et.strictCreate;dB.create;vm.create;pB.create;tr.create;yB.create;m0.create;Ya.create;qI.create;mB.create;wB.create;const Sm=os.create;vB.create;Dl.create;nr.create;Or.create;Ka.create;const D0=nr.createWithPreprocess;OE.create;const bt={string:e=>fi.create({...e,coerce:!0}),number:e=>is.create({...e,coerce:!0}),boolean:e=>hB.create({...e,coerce:!0}),bigint:e=>rs.create({...e,coerce:!0}),date:e=>Oa.create({...e,coerce:!0})};function ug({attr:e,...A}){return{...e,...A}}const wtA=Sm(["XYZCT","XYZTC","XYCTZ","XYCZT","XYTCZ","XYTZC"]),vtA=Sm(["int8","int16","int32","uint8","uint16","uint32","float","bit","double","complex","double-complex"]),Wf=Sm(["Ym","Zm","Em","Pm","Tm","Gm","Mm","km","hm","dam","m","dm","cm","mm","µm","nm","pm","fm","am","zm","ym","Ã…","thou","li","in","ft","yd","mi","ua","ly","pc","pt","pixel","reference frame"]),StA=_n({}).extend({attr:_n({ID:un(),SamplesPerPixel:bt.number().optional(),Name:un().optional(),Color:bt.number().transform($eA).optional()})}).transform(ug),DtA=_n({}).extend({attr:_n({FileName:un()})}).transform(ug),RtA=_n({UUID:DtA.optional()}).extend({attr:_n({IFD:bt.number(),PlaneCount:bt.number(),FirstT:bt.number().optional(),FirstC:bt.number().optional(),FirstZ:bt.number().optional()})}).transform(ug),xtA=_n({Channel:D0(B0,StA.array()),TiffData:D0(B0,RtA.array())}).extend({attr:_n({ID:un(),DimensionOrder:wtA,Type:vtA,SizeT:bt.number(),SizeC:bt.number(),SizeZ:bt.number(),SizeY:bt.number(),SizeX:bt.number(),PhysicalSizeX:bt.number().optional(),PhysicalSizeY:bt.number().optional(),PhysicalSizeZ:bt.number().optional(),SignificantBits:bt.number().optional(),PhysicalSizeXUnit:Wf.optional(),PhysicalSizeYUnit:Wf.optional(),PhysicalSizeZUnit:Wf.optional(),BigEndian:un().transform(e=>e.toLowerCase()==="true").optional(),Interleaved:un().transform(e=>e.toLowerCase()==="true").optional()})}).transform(ug).transform(({Channel:e,...A})=>({Channels:e,...A})),FtA=_n({AquisitionDate:un().optional().default(""),Description:un().optional().default(""),Pixels:xtA}).extend({attr:_n({ID:un(),Name:un().optional()})}).transform(ug),NtA=_n({Image:D0(B0,FtA.array())}).extend({attr:_n({xmlns:un(),"xmlns:xsi":un(),"xsi:schemaLocation":un()})}).transform(ug);function PG(e){const A=ttA(e);return NtA.parse(A).Image.map(t=>({...t,format(){const n=["X","Y","Z"].map(i=>{const r=t.Pixels[`PhysicalSize${i}`],o=t.Pixels[`PhysicalSize${i}Unit`];return r&&o?`${r} ${o}`:"-"}).join(" x ");return{"Acquisition Date":t.AquisitionDate,"Dimensions (XY)":`${t.Pixels.SizeX} x ${t.Pixels.SizeY}`,"Pixels Type":t.Pixels.Type,"Pixels Size (XYZ)":n,"Z-sections/Timepoints":`${t.Pixels.SizeZ} x ${t.Pixels.SizeT}`,Channels:t.Pixels.SizeC}}}))}class HG{constructor(A,t,n,i,r,o,s){mo(this,"_indexer");this.dtype=t,this.tileSize=n,this.shape=i,this.labels=r,this.meta=o,this.pool=s,this._indexer=A}async getRaster({selection:A,signal:t}){const n=await this._indexer(A);return this._readRasters(n,{signal:t})}async getTile({x:A,y:t,selection:n,signal:i}){const{height:r,width:o}=this._getTileExtent(A,t),s=A*this.tileSize,a=t*this.tileSize,g=[s,a,s+o,a+r],I=await this._indexer(n);return this._readRasters(I,{window:g,width:o,height:r,signal:i})}async _readRasters(A,t){var o;const n=ro(this.shape),i=await A.readRasters({interleave:n,...t,pool:this.pool});if((o=t==null?void 0:t.signal)!=null&&o.aborted)throw wm;return{data:n?i:i[0],width:i.width,height:i.height}}_getTileExtent(A,t){const{height:n,width:i}=ho(this);let r=this.tileSize,o=this.tileSize;const s=Math.floor(i/this.tileSize),a=Math.floor(n/this.tileSize);return A===s&&(o=i%this.tileSize),t===a&&(r=n%this.tileSize),{height:r,width:o}}onTileError(A){console.error(A)}}function _tA(e,A){const{SizeT:t,SizeC:n,SizeZ:i}=A[0].Pixels,r=qG(A,0);return(o,s)=>{const a=r(o),g=s*i*t*n;return e.getImage(a+g)}}function LtA(e,A,t=0){const n=qG(A,t),i=new Map;return async(r,o)=>{const s=n(r),a=await e.getImage(s);if(o===0)return a;const{SubIFDs:g}=a.fileDirectory;if(!g)throw Error("Indexing Error: OME-TIFF is missing SubIFDs.");const I=`${r.t}-${r.c}-${r.z}-${o}`;if(!i.has(I)){const c=g[o-1];i.set(I,e.parseFileDirectoryAt(c))}const l=await i.get(I);return new xG(l.fileDirectory,l.geoKeyDirectory,a.dataView,e.littleEndian,e.cache,e.source)}}function qG(e,A=0){const{SizeC:t,SizeZ:n,SizeT:i,DimensionOrder:r}=e[A].Pixels;let o=0;if(A>0)for(let s=0;so+s*n*t+a*n+g;case"XYZTC":return({t:s,c:a,z:g})=>o+a*n*i+s*n+g;case"XYCTZ":return({t:s,c:a,z:g})=>o+g*t*i+s*t+a;case"XYCZT":return({t:s,c:a,z:g})=>o+s*t*n+g*t+a;case"XYTCZ":return({t:s,c:a,z:g})=>o+g*i*t+a*i+s;case"XYTZC":return({t:s,c:a,z:g})=>o+a*i*n+g*i+s;default:throw new Error(`Invalid OME-XML DimensionOrder, got ${r}.`)}}function btA(e){function A({c:n=0,t:i=0,z:r=0}){return`${n}-${i}-${r}`}const t=new Map(e.map(({selection:n,tiff:i})=>[A(n),i]));return async n=>{const i=A(n),r=t.get(i);if(!r)throw new Error(`No image available for selection ${i}`);return r}}function GtA(e,A,t,n){return t?LtA(e,A,n):_tA(e,A)}async function ktA(e,A){const t=await e.getImage(0),{ImageDescription:n,SubIFDs:i,PhotometricInterpretation:r}=t.fileDirectory,o=PG(n);let s=o,a;i?a=i.length+1:(a=o.length,s=[o[0]]);const g=(I,l,c)=>{const{labels:C,getShape:u,physicalSizes:E,dtype:B}=itA(c),h=kG(t),f={photometricInterpretation:r,physicalSizes:E},Q=u(I),d=m=>l(m,I);return new HG(d,B,h,Q,C,f,A)};return s.map((I,l)=>{const c=GtA(e,o,i,l);return{data:Array.from({length:a}).map((u,E)=>g(E,c,I)),metadata:I}})}function MtA(e){const A=e[0].tiff.getWidth(),t=e[0].tiff.getHeight();for(const n of e)if(n.tiff.getWidth()!==A||n.tiff.getHeight()!==t)throw new Error("All images must have the same width and height")}async function TtA(e,A){for(let t=0;t<=Math.max(...e.map(n=>n.selection.t));t+=1)for(let n=0;n<=Math.max(...e.map(i=>i.selection.c));n+=1)for(let i=0;i<=Math.max(...e.map(r=>r.selection.z));i+=1)await A({t,c:n,z:i})}async function UtA(e,A,t,n){MtA(A);const i=A[0].tiff,{PhotometricInterpretation:r}=i.fileDirectory,o="XYZCT",s=kG(i),a={photometricInterpretation:r},g=btA(A),{shape:I,labels:l,dtype:c}=stA(o,A),C=gtA(e,A,t,o,c);return await TtA(A,g),{data:[new HG(g,c,s,I,l,a,n)],metadata:C}}gr(5,()=>XeA);const DB="file://";async function G1(e,A={}){const{headers:t={},offsets:n,pool:i,images:r="first"}=A;let o;typeof e=="string"?e.startsWith(DB)?o=await NG(e.slice(DB.length)):o=await qE(e,{headers:t,cacheSize:1/0}):o=await JE(e),n&&(o=KeA(o,n)),OeA(o);const s=await ktA(o,i);return r==="all"?s:s[0]}function k1(e,A,t){return t.length===1?e:e+`_${A.toString()}`}async function PtA(e,A={}){var s;const{pool:t,headers:n={},name:i="MultiTiff"}=A,r=[],o=[];for(const a of e){const[g,I]=a,l=Array.isArray(g)?g:[g];if(typeof I=="string"){const c=F1(I),C=(s=c.extension)==null?void 0:s.toLowerCase();if(C==="tif"||C==="tiff"){const u=c.name;if(u){let E;I.startsWith(DB)?E=await NG(I.slice(DB.length)):E=await qE(I,{headers:n,cacheSize:1/0});for(let B=0;B0)return UtA(i,r,A.channelNames||o,t);throw new Error("Unable to load image from provided TiffFolder source.")}const R0=new Map;function Dm(e,A){R0.set(e,A)}async function HtA(e){if(!R0.has(e.id))throw new Error(`Compression codec ${e.id} is not supported by Zarr.js yet.`);return(await R0.get(e.id)()).fromConfig(e)}function Rm(e){return new Proxy(e,{set(A,t,n,i){return A.setItem(t,n)},get(A,t,n){return A.getItem(t)},deleteProperty(A,t){return A.deleteItem(t)},has(A,t){return A.containsItem(t)}})}function qtA(e){return typeof e=="object"&&e!==null&&"__zarr__"in e}function zf(e){return qtA(e)&&e.__zarr__==="KeyError"}class Yr extends Error{constructor(A){super(`path ${A} contains an array`),this.__zarr__="ContainsArrayError",Object.setPrototypeOf(this,Yr.prototype)}}class Bg extends Error{constructor(A){super(`path ${A} contains a group`),this.__zarr__="ContainsGroupError",Object.setPrototypeOf(this,Bg.prototype)}}class YE extends Error{constructor(A){super(`group not found at path ${A}`),this.__zarr__="GroupNotFoundError",Object.setPrototypeOf(this,YE.prototype)}}class Jt extends Error{constructor(A){super(A),this.__zarr__="PermissionError",Object.setPrototypeOf(this,Jt.prototype)}}class Eg extends Error{constructor(A){super(`key ${A} not present`),this.__zarr__="KeyError",Object.setPrototypeOf(this,Eg.prototype)}}class xm extends RangeError{constructor(A,t){super(`too many indices for array; expected ${t.length}, got ${A.length}`),this.__zarr__="TooManyIndicesError",Object.setPrototypeOf(this,xm.prototype)}}let x0=class JG extends RangeError{constructor(A){super(A),this.__zarr__="BoundsCheckError",Object.setPrototypeOf(this,JG.prototype)}};class RB extends RangeError{constructor(A,t,n,i){super(`slice arguments slice(${A}, ${t}, ${n}) invalid: ${i}`),this.__zarr__="InvalidSliceError",Object.setPrototypeOf(this,RB.prototype)}}class Fm extends Error{constructor(){super("Negative step size is not supported when indexing."),this.__zarr__="NegativeStepError",Object.setPrototypeOf(this,Fm.prototype)}}class hn extends Error{constructor(A){super(A),this.__zarr__="ValueError",Object.setPrototypeOf(this,hn.prototype)}}class Nm extends Error{constructor(A){super(A),this.__zarr__="HTTPError",Object.setPrototypeOf(this,Nm.prototype)}}function ss(e,A=void 0,t=null){if(e===void 0)throw new RB(e,A,t,"The first argument must not be undefined");if(typeof e=="string"&&e!==":"||typeof A=="string"&&A!==":")throw new RB(e,A,t,'Arguments can only be integers, ":" or null');return A===void 0&&(A=e,e=null),{start:e===":"?null:e,stop:A===":"?null:A,step:t,_slice:!0}}function JtA(e,A,t,n){if(e<0?(e+=n,e<0&&(e=t<0?-1:0)):e>=n&&(e=t<0?n-1:n),A<0?(A+=n,A<0&&(A=t<0?-1:0)):A>=n&&(A=t<0?n-1:n),t<0){if(AA.length)throw new xm(e,A)}function as(e,A){const t=[],n=[];for(let i=0;i1)throw new RangeError("an index can only have a single ellipsis ('...')");if(n===1){const i=t,r=e.length-(i+1),o=e.length-1;if(o>=A.length)e=e.filter(s=>s!=="...");else{const s=A.length-o;let a=e.slice(0,i).concat(new Array(s).fill(null));r>0&&(a=a.concat(e.slice(e.length-r))),e=a}}if(e.length=A||e<0)throw new x0(`index out of bounds for dimension with length ${A}`);return e}function KtA(e){return typeof e=="number"}function KG(e){if(!Array.isArray(e))return!1;for(const A of e)if(typeof A!="number")return!1;return!0}function Lm(e){return e!==null&&e._slice===!0}function VtA(e){return Lm(e)&&(e.step===null||e.step===1)}function WtA(e){e=YG(e);for(let A=0;An()),t=A.map(n=>n.next());for(let n=0;;){if(t[n].done){if(A[n]=e[n](),t[n]=A[n].next(),++n>=A.length)return}else yield t.map(({value:i})=>i),n=0;t[n]=A[n].next()}}class M1{constructor(A,t){A=so(A,t.shape),this.dimIndexers=[];const n=t.shape;for(let i=0;i()=>n.iter()),t=ztA(...A);for(const n of t){const i=[],r=[],o=[];for(const s of n)i.push(s.dimChunkIndex),r.push(s.dimChunkSelection),s.dimOutSelection!==null&&o.push(s.dimOutSelection);yield{chunkCoords:i,chunkSelection:r,outSelection:o}}}}class jtA{constructor(A,t,n){A=_m(A,t),this.dimSelection=A,this.dimLength=t,this.dimChunkLength=n,this.numItems=1}*iter(){const A=Math.floor(this.dimSelection/this.dimChunkLength),t=A*this.dimChunkLength,n=this.dimSelection-t;yield{dimChunkIndex:A,dimChunkSelection:n,dimOutSelection:null}}}class T1{constructor(A,t,n){const[i,r,o]=OG(A,t);if(this.start=i,this.stop=r,this.step=o,this.step<1)throw new Fm;this.dimLength=t,this.dimChunkLength=n,this.numItems=Math.max(0,Math.ceil((this.stop-this.start)/this.step)),this.numChunks=Math.ceil(this.dimLength/this.dimChunkLength)}*iter(){const A=Math.floor(this.start/this.dimChunkLength),t=Math.ceil(this.stop/this.dimChunkLength);for(let n=A;n0&&(s+=this.step-C),g=Math.ceil((i-this.start)/this.step)}else s=this.start-i,g=0;this.stop>r?a=o:a=this.stop-i;const I=ss(s,a,this.step),l=Math.ceil((a-s)/this.step),c=ss(g,g+l);yield{dimChunkIndex:n,dimChunkSelection:I,dimOutSelection:c}}}}const hg=typeof process<"u"&&process.versions&&process.versions.node;function U1(){}function Wn(e){if(e===null)return"";for(e instanceof String&&(e=e.valueOf()),e=e.replace(/\\/g,"/");e.length>0&&e[0]==="/";)e=e.slice(1);for(;e.length>0&&e[e.length-1]==="/";)e=e.slice(0,e.length-1);e=e.replace(/\/\/+/g,"/");const A=e.split("/");for(const t of A)if(t==="."||t==="..")throw Error("path containing '.' or '..' segment not allowed");return e}function bm(e){return typeof e=="number"&&(e=[e]),e.map(A=>Math.floor(A))}function XtA(e,A){if(e===null||e===!0)throw new Error("Chunk guessing is not supported yet");return e===!1?A:(typeof e=="number"&&(e=[e]),e.lengtht===-1||t===null?A[n]:Math.floor(t)))}function ZtA(e){return e=e.toUpperCase(),e}function P1(e,A){if(e===null)return!0;Array.isArray(e)||(e=[e]);for(let t=0;t=0;i--)t[i]=n,n*=e[i];return t}function jf(e,A){const t=typeof e=="string"?new URL(e):e;t.pathname.endsWith("/")||(t.pathname+="/");const n=new URL(A,t);return n.search=t.search,n.href}function VG(e){const A=e.BYTES_PER_ELEMENT;if(A===1)return;if(hg){const o=Buffer.from(e.buffer,e.byteOffset,e.length*A);A===2&&o.swap16(),A===4&&o.swap32(),A===8&&o.swap64();return}const t=new Uint8Array(e.buffer,e.byteOffset,e.length*A),n=A/2,i=A-1;let r;for(let o=0;os*a),r=t.map((s,a)=>a+1===n?1:t.slice(a+1).reduce((g,I)=>g*I,1)),o=Array(n).fill(0);for(let s=0;s0?e+"/":""}async function zG(e,A,t,n){if(A.length===0)return;const i=A.split("/");let r="";for(const o of i.slice(0,i.length-1))r+=o,await ji(e,r)?await F0(e,r,n):await vi(e,r)||await F0(e,r),r+="/"}async function F0(e,A=null,t=!1){if(A=Wn(A),t)throw Error("Group overwriting not implemented yet :(");if(await ji(e,A))throw new Yr(A);if(await vi(e,A))throw new Bg(A);const n={zarr_format:2},i=ao(A)+km;await e.setItem(i,JSON.stringify(n))}async function JI(e,A=null,t=null,n=!1){A=Wn(A),await zG(e,A,t,n),await F0(e,A,n)}async function anA(e,A,t,n,i,r,o,s,a,g,I,l){if(a)throw Error("Array overwriting not implemented yet :(");if(await ji(e,i))throw new Yr(i);if(await vi(e,i))throw new Bg(i);if(n=n,A=bm(A),t=XtA(t,A),s=ZtA(s),o=o,I!==null&&I.length>0)throw Error("Filters are not supported yet");let c=o;typeof o=="number"&&(Number.isNaN(o)&&(c="NaN"),Number.POSITIVE_INFINITY===o&&(c="Infinity"),Number.NEGATIVE_INFINITY===o&&(c="-Infinity")),I=null;const C={zarr_format:2,shape:A,chunks:t,dtype:n,fill_value:c,order:s,compressor:r,filters:I};l&&(C.dimension_separator=l);const u=ao(i)+xB;await e.setItem(u,JSON.stringify(C))}async function gnA(e,A,t,n,i=null,r=null,o=null,s="C",a=!1,g=null,I=null,l){i=Wn(i),await zG(e,i,g,a),await anA(e,A,t,n,i,r,o,s,a,g,I,l)}function FB(e){if(typeof e!="string"){if(hg&&Buffer.isBuffer(e))return JSON.parse(e.toString());if(Gm(e)){const A=new TextDecoder,t=new Uint8Array(e);return JSON.parse(A.decode(t))}else return e}return JSON.parse(e)}class jG{constructor(A,t,n,i=!0){this.store=A,this.key=t,this.readOnly=n,this.cache=i,this.cachedValue=null}async asObject(){if(this.cache&&this.cachedValue!==null)return this.cachedValue;const A=await this.getNoSync();return this.cache&&(this.cachedValue=A),A}async getNoSync(){try{const A=await this.store.getItem(this.key);return FB(A)}catch{return{}}}async setNoSync(A,t){const n=await this.getNoSync();return n[A]=t,await this.putNoSync(n),!0}async putNoSync(A){await this.store.setItem(this.key,JSON.stringify(A)),this.cache&&(this.cachedValue=A)}async delNoSync(A){const t=await this.getNoSync();return delete t[A],await this.putNoSync(t),!0}async put(A){if(this.readOnly)throw new Jt("attributes are read-only");return this.putNoSync(A)}async setItem(A,t){if(this.readOnly)throw new Jt("attributes are read-only");return this.setNoSync(A,t)}async getItem(A){return(await this.asObject())[A]}async deleteItem(A){if(this.readOnly)throw new Jt("attributes are read-only");return this.delNoSync(A)}async containsItem(A){return(await this.asObject())[A]!==void 0}proxy(){return Rm(this)}}const H1=globalThis.Float16Array,InA={"|b":Int8Array,"|b1":Uint8Array,"|B":Uint8Array,"|u1":Uint8Array,"|i1":Int8Array,"b":Int8Array,">B":Uint8Array,">u1":Uint8Array,">i1":Int8Array,">u2":Uint16Array,">i2":Int16Array,">u4":Uint32Array,">i4":Int32Array,">f4":Float32Array,">f2":H1,">f8":Float64Array};function Qi(e){const A=InA[e];if(!A)throw e.slice(1)==="f2"?Error(`'${e}' is not supported natively in zarr.js. In order to access this dataset you must make Float16Array available as a global. See https://github.com/gzuidhof/zarr.js/issues/127`):Error(`Dtype not recognized or not supported in zarr.js, got ${e}.`);return A}function XG(e){if(e instanceof Uint8Array)return"|u1";if(e instanceof Int8Array)return"|i1";if(e instanceof Uint16Array)return"0&&typeof a[0]=="number"&&(a=e[0].constructor.from(a)),a}function cnA(e,A,t,n){const i=so(n,t,!0),[r,o]=as(i,t);Tm(e,A,t,r)}function CnA(e,A,t,n,i){const r=so(i,t,!1),[o,s]=as(r,t);if(JSON.stringify(s)!==JSON.stringify(n))throw new hn(`Shape mismatch in target and source NestedArray: ${s} and ${n}`);_0(e,A,t,o)}function _0(e,A,t,n){const i=n[0];if(typeof A=="number"){Tm(e,A,t,n.map(g=>typeof g=="number"?[g,g+1,1,1]:g));return}if(typeof i=="number"){_0(e[i],A,t.slice(1),n.slice(1));return}const[r,o,s,a]=i;if(t.length===1){if(s===1)e.set(A,r);else for(let g=0;gr*o,1),i=new t(n);return ZG(e,A,i,0),i}function ZG(e,A,t,n){if(A.length===1){t.set(e,n);return}if(A.length===2){for(let o=0;oo*s,1);for(let o=0;oa*g,1);A===null&&(A=new ArrayBuffer(r*parseInt(n[n.length-1],10)));const o=A.byteLength/parseInt(n[n.length-1],10);if(r!==o)throw new Error(`Buffer has ${o} of dtype ${n}, shape is too large or small ${t} (flat=${r})`);const s=Qi(n);this.data=$G(A,s,t)}else this.data=A}get(A){const[t,n]=lnA(this.data,this.shape,A);return n.length===0?t:new Oi(t,n,this.dtype)}set(A=null,t){A===null&&(A=[ss(null)]),typeof t=="number"?this.shape.length===0?this.data[0]=t:cnA(this.data,t,this.shape,A):CnA(this.data,t.data,this.shape,t.shape,A)}flatten(){return this.shape.length===1?this.data:unA(this.data,this.shape,Qi(this.dtype))}static arange(A,t="i*r,1),n=new A(t);return n.set([...Array(t).keys()]),n}function $G(e,A,t,n=0){if(t.length===1)return new A(e.slice(n,n+t[0]*A.BYTES_PER_ELEMENT));const i=new Array(t[0]);if(t.length===2){for(let s=0;ss*a,1);for(let s=0;sg*I,1);A===null&&(A=new ArrayBuffer(o*parseInt(n[n.length-1],10)));const s=A.byteLength/parseInt(n[n.length-1],10);if(o!==s)throw new Error(`Buffer has ${s} of dtype ${n}, shape is too large or small ${t} (flat=${o})`);const a=Qi(n);this.data=new a(A)}else this.data=A}set(A=null,t,n){A===null&&(A=[ss(null)]),typeof t=="number"?this.shape.length===0?this.data[0]=t:EnA(this.data,this.strides,this.shape,A,t):t instanceof Lo&&n?fnA(this.data,this.strides,this.shape,A,t.data,t.strides,t.shape,n):hnA(this.data,this.strides,this.shape,A,t.data,t.strides,t.shape)}}var ek={exports:{}};(function(e){var A=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(a,g,I){this.fn=a,this.context=g,this.once=I||!1}function r(a,g,I,l,c){if(typeof I!="function")throw new TypeError("The listener must be a function");var C=new i(I,l||a,c),u=t?t+g:g;return a._events[u]?a._events[u].fn?a._events[u]=[a._events[u],C]:a._events[u].push(C):(a._events[u]=C,a._eventsCount++),a}function o(a,g){--a._eventsCount===0?a._events=new n:delete a._events[g]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var g=[],I,l;if(this._eventsCount===0)return g;for(l in I=this._events)A.call(I,l)&&g.push(t?l.slice(1):l);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(I)):g},s.prototype.listeners=function(g){var I=t?t+g:g,l=this._events[I];if(!l)return[];if(l.fn)return[l.fn];for(var c=0,C=l.length,u=new Array(C);c{if(typeof A!="number"||A<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(A===Number.POSITIVE_INFINITY){o(e);return}n={customTimers:{setTimeout,clearTimeout},...n},i=n.customTimers.setTimeout.call(void 0,()=>{if(typeof t=="function"){try{o(t())}catch(I){s(I)}return}const a=typeof t=="string"?t:`Promise timed out after ${A} milliseconds`,g=t instanceof Error?t:new tk(a);typeof e.cancel=="function"&&e.cancel(),s(g)},A),(async()=>{try{o(await e)}catch(a){s(a)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return r.clear=()=>{clearTimeout(i),i=void 0},r}function pnA(e,A,t){let n=0,i=e.length;for(;i>0;){const r=Math.trunc(i/2);let o=n+r;t(e[o],A)<=0?(n=++o,i-=r+1):i=r}return n}class ynA{constructor(){Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:[]})}enqueue(A,t){var n;t={priority:0,...t};const i={priority:t.priority,run:A};if(this.size&&((n=this._queue[this.size-1])===null||n===void 0?void 0:n.priority)>=t.priority){this._queue.push(i);return}const r=pnA(this._queue,i,(o,s)=>s.priority-o.priority);this._queue.splice(r,0,i)}dequeue(){const A=this._queue.shift();return A==null?void 0:A.run}filter(A){return this._queue.filter(t=>t.priority===A.priority).map(t=>t.run)}get size(){return this._queue.length}}const mC=()=>{},mnA=new tk;class q1 extends QnA{constructor(A){var t,n,i,r;if(super(),Object.defineProperty(this,"_carryoverConcurrencyCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isIntervalIgnored",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalCap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interval",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalEnd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queueClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pendingCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_concurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isPaused",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolveEmpty",{enumerable:!0,configurable:!0,writable:!0,value:mC}),Object.defineProperty(this,"_resolveIdle",{enumerable:!0,configurable:!0,writable:!0,value:mC}),Object.defineProperty(this,"_timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_throwOnTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),A={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:ynA,...A},!(typeof A.intervalCap=="number"&&A.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(t=A.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:""}\` (${typeof A.intervalCap})`);if(A.interval===void 0||!(Number.isFinite(A.interval)&&A.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(r=(i=A.interval)===null||i===void 0?void 0:i.toString())!==null&&r!==void 0?r:""}\` (${typeof A.interval})`);this._carryoverConcurrencyCount=A.carryoverConcurrencyCount,this._isIntervalIgnored=A.intervalCap===Number.POSITIVE_INFINITY||A.interval===0,this._intervalCap=A.intervalCap,this._interval=A.interval,this._queue=new A.queueClass,this._queueClass=A.queueClass,this.concurrency=A.concurrency,this._timeout=A.timeout,this._throwOnTimeout=A.throwOnTimeout===!0,this._isPaused=A.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()},t)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const A=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();return t?(this.emit("active"),t(),A&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(A){if(!(typeof A=="number"&&A>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${A}\` (${typeof A})`);this._concurrency=A,this._processQueue()}async add(A,t={}){return new Promise((n,i)=>{const r=async()=>{this._pendingCount++,this._intervalCount++;try{const s=await(this._timeout===void 0&&t.timeout===void 0?A():dnA(Promise.resolve(A()),t.timeout===void 0?this._timeout:t.timeout,()=>{(t.throwOnTimeout===void 0?this._throwOnTimeout:t.throwOnTimeout)&&i(mnA)}));n(s),this.emit("completed",s)}catch(o){i(o),this.emit("error",o)}this._next()};this._queue.enqueue(r,t),this._tryToStartAnother(),this.emit("add")})}async addAll(A,t){return Promise.all(A.map(async n=>this.add(n,t)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(A=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t(),A()}})}async onSizeLessThan(A){if(!(this._queue.size{const n=()=>{this._queue.size{const t=this._resolveIdle;this._resolveIdle=()=>{t(),A()}})}get size(){return this._queue.size}sizeBy(A){return this._queue.filter(A).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(A){this._timeout=A}}class KE{constructor(A,t=null,n,i=!1,r=null,o=!0,s=!0){this.store=A,this._chunkStore=r,this.path=Wn(t),this.keyPrefix=ao(this.path),this.readOnly=i,this.cacheMetadata=o,this.cacheAttrs=s,this.meta=n,this.meta.compressor!==null?this.compressor=HtA(this.meta.compressor):this.compressor=null;const a=this.keyPrefix+WG;this.attrs=new jG(this.store,a,this.readOnly,s)}get chunkStore(){return this._chunkStore?this._chunkStore:this.store}get name(){return this.path.length>0?this.path[0]!=="/"?"/"+this.path:this.path:null}get basename(){const A=this.name;if(A===null)return null;const t=A.split("/");return t[t.length-1]}get shape(){return this.meta.shape}get chunks(){return this.meta.chunks}get chunkSize(){return this.chunks.reduce((A,t)=>A*t,1)}get dtype(){return this.meta.dtype}get fillValue(){const A=this.meta.fill_value;return A==="NaN"?NaN:A==="Infinity"?1/0:A==="-Infinity"?-1/0:this.meta.fill_value}get nDims(){return this.meta.shape.length}get size(){return this.meta.shape.reduce((A,t)=>A*t,1)}get length(){return this.shape[0]}get _chunkDataShape(){if(this.shape.length===0)return[1];{const A=[];for(let t=0;tA*t,1)}static async create(A,t=null,n=!1,i=null,r=!0,o=!0){const s=await this.loadMetadataForConstructor(A,t);return new KE(A,t,s,n,i,r,o)}static async loadMetadataForConstructor(A,t){try{t=Wn(t);const n=ao(t),i=await A.getItem(n+xB);return FB(i)}catch(n){throw await vi(A,t)?new Bg(t??""):new Error("Failed to load metadata for ZarrArray:"+n.toString())}}async reloadMetadata(){const A=this.keyPrefix+xB,t=this.store.getItem(A);return this.meta=FB(await t),this.meta}async refreshMetadata(){this.cacheMetadata||await this.reloadMetadata()}get(A=null,t={}){return this.getBasicSelection(A,!1,t)}getRaw(A=null,t={}){return this.getBasicSelection(A,!0,t)}async getBasicSelection(A,t=!1,{concurrencyLimit:n=10,progressCallback:i,storeOptions:r}={}){if(this.cacheMetadata||await this.reloadMetadata(),this.shape.length===0)throw new Error("Shape [] indexing is not supported yet");return this.getBasicSelectionND(A,t,n,i,r)}getBasicSelectionND(A,t,n,i,r){const o=new M1(A,this);return this.getSelection(o,t,n,i,r)}async getSelection(A,t,n,i,r){const o=this.dtype,s=A.shape,a=A.shape.reduce((l,c)=>l*c,1);if(t&&a===this.chunkSize){const l=A.iter(),c=l.next();if(c.done===!1&&l.next().done===!0){const C=c.value;return await this.decodeDirectToRawArray(C,s,a)}}const g=t?new Lo(null,s,o):new Oi(null,s,o);if(a===0)return g;const I=new q1({concurrency:n});if(i){let l=0,c=0;for(const C of A.iter())c+=1;i({progress:0,queueSize:c});for(const C of A.iter())(async()=>(await I.add(()=>this.chunkGetItem(C.chunkCoords,C.chunkSelection,g,C.outSelection,A.dropAxes,r)),l+=1,i({progress:l,queueSize:c})))()}else for(const l of A.iter())I.add(()=>this.chunkGetItem(l.chunkCoords,l.chunkSelection,g,l.outSelection,A.dropAxes,r));return await I.onIdle(),g.shape.length===0?g.data[0]:g}async chunkGetItem(A,t,n,i,r,o){if(A.length!==this._chunkDataShape.length)throw new hn(`Inconsistent shapes: chunkCoordsLength: ${A.length}, cDataShapeLength: ${this.chunkDataShape.length}`);const s=this.chunkKey(A);try{const a=await this.chunkStore.getItem(s,o),g=await this.decodeChunk(a);if(n instanceof Oi){if(WtA(i)&&P1(t,this.chunks)&&!this.meta.filters){n.set(i,this.toNestedArray(g));return}const l=this.toNestedArray(g).get(t);if(r!==null)throw new Error("Drop axes is not supported yet");n.set(i,l)}else n.set(i,this.chunkBufferToRawArray(g),t)}catch(a){if(zf(a))this.fillValue!==null&&n.set(i,this.fillValue);else throw a}}async getRawChunk(A,t){if(A.length!==this.shape.length)throw new Error(`Chunk coordinates ${A.join(".")} do not correspond to shape ${this.shape}.`);try{for(let s=0;ss!==1);return new Lo(r,o,this.dtype)}chunkKey(A){var t;const n=(t=this.meta.dimension_separator)!==null&&t!==void 0?t:".";return this.keyPrefix+A.join(n)}ensureByteArray(A){return typeof A=="string"?new Uint8Array(Buffer.from(A).buffer):new Uint8Array(A)}toTypedArray(A){return new(Qi(this.dtype))(A)}toNestedArray(A){const t=this.ensureByteArray(A).buffer;return new Oi(t,this.chunks,this.dtype)}async decodeChunk(A){let t=this.ensureByteArray(A);if(this.compressor!==null&&(t=await(await this.compressor).decode(t)),this.dtype.includes(">")&&VG(this.toTypedArray(t.buffer)),this.meta.order==="F"&&this.nDims>1){const n=this.toTypedArray(t.buffer),i=new(Qi(this.dtype))(n.length);return snA(n,i,this.chunks),i.buffer}return t.buffer}chunkBufferToRawArray(A){return new Lo(A,this.chunks,this.dtype)}async decodeDirectToRawArray({chunkCoords:A},t,n){const i=this.chunkKey(A);try{const r=await this.chunkStore.getItem(i);return new Lo(await this.decodeChunk(r),t,this.dtype)}catch(r){if(zf(r)){const o=new(Qi(this.dtype))(n);return new Lo(o.fill(this.fillValue),t)}else throw r}}async set(A=null,t,n={}){await this.setBasicSelection(A,t,n)}async setBasicSelection(A,t,{concurrencyLimit:n=10,progressCallback:i}={}){if(this.readOnly)throw new Jt("Object is read only");if(this.cacheMetadata||await this.reloadMetadata(),this.shape.length===0)throw new Error("Shape [] indexing is not supported yet");await this.setBasicSelectionND(A,t,n,i)}async setBasicSelectionND(A,t,n,i){const r=new M1(A,this);await this.setSelection(r,t,n,i)}getChunkValue(A,t,n,i){let r;if(i.length===0)r=n;else if(typeof n=="number")r=n;else if(r=n.get(A.outSelection),t.dropAxes!==null)throw new Error("Handling drop axes not supported yet");return r}async setSelection(A,t,n,i){const r=A.shape;if(r.length!==0){if(typeof t!="number")if(t instanceof Oi){if(!$tA(t.shape,r))throw new hn(`Shape mismatch in source NestedArray and set selection: ${t.shape} and ${r}`)}else throw new Error("Unknown data type for setting :(")}const o=new q1({concurrency:n});if(i){let s=0;for(const g of A.iter())s+=1;let a=0;i({progress:0,queueSize:s});for(const g of A.iter()){const I=this.getChunkValue(g,A,t,r);(async()=>(await o.add(()=>this.chunkSetItem(g.chunkCoords,g.chunkSelection,I)),a+=1,i({progress:a,queueSize:s})))()}}else for(const s of A.iter()){const a=this.getChunkValue(s,A,t,r);o.add(()=>this.chunkSetItem(s.chunkCoords,s.chunkSelection,a))}await o.onIdle()}async chunkSetItem(A,t,n){if(this.meta.order==="F"&&this.nDims>1)throw new Error("Setting content for arrays in F-order is not supported.");const i=this.chunkKey(A);let r=null;const o=Qi(this.dtype),s=this.chunkSize;if(P1(t,this.chunks))typeof n=="number"?(r=new o(s),r.fill(n)):r=n.flatten();else{let g;try{const l=await this.chunkStore.getItem(i),c=await this.decodeChunk(l);g=this.toTypedArray(c)}catch(l){if(zf(l))g=new o(s),this.fillValue!==null&&g.fill(this.fillValue);else throw l}const I=new Oi(g,this.chunks,this.dtype);I.set(t,n),r=I.flatten()}const a=await this.encodeChunk(r);this.chunkStore.setItem(i,a)}async encodeChunk(A){if(this.dtype.includes(">")&&(A=enA(A)),this.compressor!==null){const t=new Uint8Array(A.buffer);return(await(await this.compressor).encode(t)).buffer}return A.buffer}}class wnA{constructor(A={}){this.root=A}proxy(){return Rm(this)}getParent(A){let t=this.root;const n=A.split("/");for(const i of n.slice(0,n.length-1))if(t=t[i],!t)throw Error(A);return[t,n[n.length-1]]}requireParent(A){let t=this.root;const n=A.split("/");for(const i of n.slice(0,n.length-1))t[i]===void 0&&(t[i]={}),t=t[i];return[t,n[n.length-1]]}getItem(A){const[t,n]=this.getParent(A),i=t[n];if(i===void 0)throw new Eg(A);return i}setItem(A,t){const[n,i]=this.requireParent(A);return n[i]=t,!0}deleteItem(A){const[t,n]=this.getParent(A);return delete t[n]}containsItem(A){try{return this.getItem(A)!==void 0}catch{return!1}}keys(){throw new Error("Method not implemented.")}}var ci;(function(e){e.HEAD="HEAD",e.GET="GET",e.PUT="PUT"})(ci||(ci={}));const vnA=[ci.HEAD,ci.GET,ci.PUT];class Um{constructor(A,t={}){this.url=A;const{fetchOptions:n={},supportedMethods:i=vnA}=t;this.fetchOptions=n,this.supportedMethods=new Set(i)}keys(){throw new Error("Method not implemented.")}async getItem(A,t){const n=jf(this.url,A),i=await fetch(n,{...this.fetchOptions,...t});if(i.status===404)throw new Eg(A);if(i.status!==200)throw new Nm(String(i.status));return hg?Buffer.from(await i.arrayBuffer()):i.arrayBuffer()}async setItem(A,t){if(!this.supportedMethods.has(ci.PUT))throw new Error("HTTP PUT no a supported method for store.");const n=jf(this.url,A);return typeof t=="string"&&(t=new TextEncoder().encode(t).buffer),(await fetch(n,{...this.fetchOptions,method:ci.PUT,body:t})).status.toString()[0]==="2"}deleteItem(A){throw new Error("Method not implemented.")}async containsItem(A){const t=jf(this.url,A),n=this.supportedMethods.has(ci.HEAD)?ci.HEAD:ci.GET;return(await fetch(t,{...this.fetchOptions,method:n})).status===200}}async function fg({shape:e,chunks:A=!0,dtype:t="0?this.path[0]!=="/"?"/"+this.path:this.path:"/"}get basename(){const A=this.name.split("/");return A[A.length-1]}get chunkStore(){return this._chunkStore?this._chunkStore:this.store}static async create(A,t=null,n=!1,i=null,r=!0){const o=await this.loadMetadataForConstructor(A,t);return new Ca(A,t,o,n,i,r)}static async loadMetadataForConstructor(A,t){t=Wn(t);const n=ao(t);try{const i=await A.getItem(n+km);return FB(i)}catch{throw await ji(A,t)?new Yr(t):new YE(t)}}itemPath(A){const t=typeof A=="string"&&A.length>0&&A[0]==="/",n=Wn(A);return!t&&this.path.length>0?this.keyPrefix+n:n}async createGroup(A,t=!1){if(this.readOnly)throw new Jt("group is read only");const n=this.itemPath(A);return await JI(this.store,n,this._chunkStore,t),Ca.create(this.store,n,this.readOnly,this._chunkStore,this.attrs.cache)}async requireGroup(A,t=!1){if(this.readOnly)throw new Jt("group is read only");const n=this.itemPath(A);return await vi(this.store,n)||await JI(this.store,n,this._chunkStore,t),Ca.create(this.store,n,this.readOnly,this._chunkStore,this.attrs.cache)}getOptsForArrayCreation(A,t={}){const n=this.itemPath(A);return t.path=n,t.cacheAttrs===void 0&&(t.cacheAttrs=this.attrs.cache),t.store=this.store,t.chunkStore=this.chunkStore,t}array(A,t,n,i){if(this.readOnly)throw new Jt("group is read only");return n=this.getOptsForArrayCreation(A,n),n.overwrite=i===void 0?n.overwrite:i,J1(t,n)}empty(A,t,n={}){if(this.readOnly)throw new Jt("group is read only");return n=this.getOptsForArrayCreation(A,n),SnA(t,n)}zeros(A,t,n={}){if(this.readOnly)throw new Jt("group is read only");return n=this.getOptsForArrayCreation(A,n),DnA(t,n)}ones(A,t,n={}){if(this.readOnly)throw new Jt("group is read only");return n=this.getOptsForArrayCreation(A,n),RnA(t,n)}full(A,t,n,i={}){if(this.readOnly)throw new Jt("group is read only");return i=this.getOptsForArrayCreation(A,i),xnA(t,n,i)}createDataset(A,t,n,i){if(this.readOnly)throw new Jt("group is read only");i=this.getOptsForArrayCreation(A,i);let r;if(n===void 0){if(t===void 0)throw new hn("Shape must be set if no data is passed to CreateDataset");r=fg({shape:t,...i})}else r=J1(n,i);return r}async getItem(A){const t=this.itemPath(A);if(await ji(this.store,t))return KE.create(this.store,t,this.readOnly,this.chunkStore,void 0,this.attrs.cache);if(await vi(this.store,t))return Ca.create(this.store,t,this.readOnly,this._chunkStore,this.attrs.cache);throw new Eg(A)}async setItem(A,t){return await this.array(A,t,{},!0),!0}async deleteItem(A){throw this.readOnly?new Jt("group is read only"):new Error("Method not implemented.")}async containsItem(A){const t=this.itemPath(A);return await ji(this.store,t)||vi(this.store,t)}proxy(){return Rm(this)}}async function FnA(e,A=null,t="a",n,i=!0){if(e=G0(e),n!==void 0&&(n=G0(e)),A=Wn(A),t==="r"||t==="r+"){if(!await vi(e,A))throw await ji(e,A)?new Yr(A):new YE(A)}else if(t==="w")await JI(e,A,n,!0);else if(t==="a"){if(!await vi(e,A)){if(await ji(e,A))throw new Yr(A);await JI(e,A,n)}}else if(t==="w-"||t==="x"){if(await ji(e,A))throw new Yr(A);if(await vi(e,A))throw new Bg(A);await JI(e,A,n)}else throw new hn(`Invalid mode argument: ${t}`);const r=t==="r";return Ca.create(e,A,r,n,i)}/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */const NnA=4,O1=0,Y1=1,_nA=2;function Qg(e){let A=e.length;for(;--A>=0;)e[A]=0}const LnA=0,nk=1,bnA=2,GnA=3,knA=258,Pm=29,Qc=256,Rl=Qc+1+Pm,Fa=30,Hm=19,ik=2*Rl+1,Po=15,Xf=16,MnA=7,qm=256,rk=16,ok=17,sk=18,k0=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),cu=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),TnA=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ak=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),UnA=512,Pi=new Array((Rl+2)*2);Qg(Pi);const OI=new Array(Fa*2);Qg(OI);const xl=new Array(UnA);Qg(xl);const Fl=new Array(knA-GnA+1);Qg(Fl);const Jm=new Array(Pm);Qg(Jm);const NB=new Array(Fa);Qg(NB);function Zf(e,A,t,n,i){this.static_tree=e,this.extra_bits=A,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let gk,Ik,lk;function $f(e,A){this.dyn_tree=e,this.max_code=0,this.stat_desc=A}const ck=e=>e<256?xl[e]:xl[256+(e>>>7)],Nl=(e,A)=>{e.pending_buf[e.pending++]=A&255,e.pending_buf[e.pending++]=A>>>8&255},tn=(e,A,t)=>{e.bi_valid>Xf-t?(e.bi_buf|=A<>Xf-e.bi_valid,e.bi_valid+=t-Xf):(e.bi_buf|=A<{tn(e,t[A*2],t[A*2+1])},Ck=(e,A)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--A>0);return t>>>1},PnA=e=>{e.bi_valid===16?(Nl(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},HnA=(e,A)=>{const t=A.dyn_tree,n=A.max_code,i=A.stat_desc.static_tree,r=A.stat_desc.has_stree,o=A.stat_desc.extra_bits,s=A.stat_desc.extra_base,a=A.stat_desc.max_length;let g,I,l,c,C,u,E=0;for(c=0;c<=Po;c++)e.bl_count[c]=0;for(t[e.heap[e.heap_max]*2+1]=0,g=e.heap_max+1;ga&&(c=a,E++),t[I*2+1]=c,!(I>n)&&(e.bl_count[c]++,C=0,I>=s&&(C=o[I-s]),u=t[I*2],e.opt_len+=u*(c+C),r&&(e.static_len+=u*(i[I*2+1]+C)));if(E!==0){do{for(c=a-1;e.bl_count[c]===0;)c--;e.bl_count[c]--,e.bl_count[c+1]+=2,e.bl_count[a]--,E-=2}while(E>0);for(c=a;c!==0;c--)for(I=e.bl_count[c];I!==0;)l=e.heap[--g],!(l>n)&&(t[l*2+1]!==c&&(e.opt_len+=(c-t[l*2+1])*t[l*2],t[l*2+1]=c),I--)}},uk=(e,A,t)=>{const n=new Array(Po+1);let i=0,r,o;for(r=1;r<=Po;r++)n[r]=i=i+t[r-1]<<1;for(o=0;o<=A;o++){let s=e[o*2+1];s!==0&&(e[o*2]=Ck(n[s]++,s))}},qnA=()=>{let e,A,t,n,i;const r=new Array(Po+1);for(t=0,n=0;n>=7;n{let A;for(A=0;A{e.bi_valid>8?Nl(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},JnA=(e,A,t,n)=>{Ek(e),n&&(Nl(e,t),Nl(e,~t)),e.pending_buf.set(e.window.subarray(A,A+t),e.pending),e.pending+=t},K1=(e,A,t,n)=>{const i=A*2,r=t*2;return e[i]{const n=e.heap[t];let i=t<<1;for(;i<=e.heap_len&&(i{let n,i,r=0,o,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+r*2]<<8|e.pending_buf[e.d_buf+r*2+1],i=e.pending_buf[e.l_buf+r],r++,n===0?Ci(e,i,A):(o=Fl[i],Ci(e,o+Qc+1,A),s=k0[o],s!==0&&(i-=Jm[o],tn(e,i,s)),n--,o=ck(n),Ci(e,o,t),s=cu[o],s!==0&&(n-=NB[o],tn(e,n,s)));while(r{const t=A.dyn_tree,n=A.stat_desc.static_tree,i=A.stat_desc.has_stree,r=A.stat_desc.elems;let o,s,a=-1,g;for(e.heap_len=0,e.heap_max=ik,o=0;o>1;o>=1;o--)AQ(e,t,o);g=r;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],AQ(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,t[g*2]=t[o*2]+t[s*2],e.depth[g]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,t[o*2+1]=t[s*2+1]=g,e.heap[1]=g++,AQ(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],HnA(e,A),uk(t,a,e.bl_count)},W1=(e,A,t)=>{let n,i=-1,r,o=A[0*2+1],s=0,a=7,g=4;for(o===0&&(a=138,g=3),A[(t+1)*2+1]=65535,n=0;n<=t;n++)r=o,o=A[(n+1)*2+1],!(++s{let n,i=-1,r,o=A[0*2+1],s=0,a=7,g=4;for(o===0&&(a=138,g=3),n=0;n<=t;n++)if(r=o,o=A[(n+1)*2+1],!(++s{let A;for(W1(e,e.dyn_ltree,e.l_desc.max_code),W1(e,e.dyn_dtree,e.d_desc.max_code),M0(e,e.bl_desc),A=Hm-1;A>=3&&e.bl_tree[ak[A]*2+1]===0;A--);return e.opt_len+=3*(A+1)+5+5+4,A},YnA=(e,A,t,n)=>{let i;for(tn(e,A-257,5),tn(e,t-1,5),tn(e,n-4,4),i=0;i{let A=4093624447,t;for(t=0;t<=31;t++,A>>>=1)if(A&1&&e.dyn_ltree[t*2]!==0)return O1;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Y1;for(t=32;t{j1||(qnA(),j1=!0),e.l_desc=new $f(e.dyn_ltree,gk),e.d_desc=new $f(e.dyn_dtree,Ik),e.bl_desc=new $f(e.bl_tree,lk),e.bi_buf=0,e.bi_valid=0,Bk(e)},hk=(e,A,t,n)=>{tn(e,(LnA<<1)+(n?1:0),3),JnA(e,A,t,!0)},WnA=e=>{tn(e,nk<<1,3),Ci(e,qm,Pi),PnA(e)},znA=(e,A,t,n)=>{let i,r,o=0;e.level>0?(e.strm.data_type===_nA&&(e.strm.data_type=KnA(e)),M0(e,e.l_desc),M0(e,e.d_desc),o=OnA(e),i=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=i&&(i=r)):i=r=t+5,t+4<=i&&A!==-1?hk(e,A,t,n):e.strategy===NnA||r===i?(tn(e,(nk<<1)+(n?1:0),3),V1(e,Pi,OI)):(tn(e,(bnA<<1)+(n?1:0),3),YnA(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),V1(e,e.dyn_ltree,e.dyn_dtree)),Bk(e),n&&Ek(e)},jnA=(e,A,t)=>(e.pending_buf[e.d_buf+e.last_lit*2]=A>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=A&255,e.pending_buf[e.l_buf+e.last_lit]=t&255,e.last_lit++,A===0?e.dyn_ltree[t*2]++:(e.matches++,A--,e.dyn_ltree[(Fl[t]+Qc+1)*2]++,e.dyn_dtree[ck(A)*2]++),e.last_lit===e.lit_bufsize-1);var XnA=VnA,ZnA=hk,$nA=znA,AiA=jnA,eiA=WnA,tiA={_tr_init:XnA,_tr_stored_block:ZnA,_tr_flush_block:$nA,_tr_tally:AiA,_tr_align:eiA};const niA=(e,A,t,n)=>{let i=e&65535|0,r=e>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+A[n++]|0,r=r+i|0;while(--o);i%=65521,r%=65521}return i|r<<16|0};var _l=niA;const iiA=()=>{let e,A=[];for(var t=0;t<256;t++){e=t;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;A[t]=e}return A},riA=new Uint32Array(iiA()),oiA=(e,A,t,n)=>{const i=riA,r=n+t;e^=-1;for(let o=n;o>>8^i[(e^A[o])&255];return e^-1};var ut=oiA,gs={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ds={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:siA,_tr_stored_block:aiA,_tr_flush_block:giA,_tr_tally:Kr,_tr_align:IiA}=tiA,{Z_NO_FLUSH:Rs,Z_PARTIAL_FLUSH:liA,Z_FULL_FLUSH:ciA,Z_FINISH:Vr,Z_BLOCK:X1,Z_OK:ui,Z_STREAM_END:Z1,Z_STREAM_ERROR:Rn,Z_DATA_ERROR:CiA,Z_BUF_ERROR:eQ,Z_DEFAULT_COMPRESSION:uiA,Z_FILTERED:BiA,Z_HUFFMAN_ONLY:wC,Z_RLE:EiA,Z_FIXED:hiA,Z_DEFAULT_STRATEGY:fiA,Z_UNKNOWN:QiA,Z_DEFLATED:VE}=Ds,diA=9,piA=15,yiA=8,miA=29,wiA=256,T0=wiA+1+miA,viA=30,SiA=19,DiA=2*T0+1,RiA=15,Ee=3,_r=258,zn=_r+Ee+1,xiA=32,WE=42,U0=69,Cu=73,uu=91,Bu=103,Ho=113,BI=666,gt=1,dc=2,Is=3,dg=4,FiA=3,Lr=(e,A)=>(e.msg=gs[A],A),$1=e=>(e<<1)-(e>4?9:0),Sr=e=>{let A=e.length;for(;--A>=0;)e[A]=0};let NiA=(e,A,t)=>(A<{const A=e.state;let t=A.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(A.pending_buf.subarray(A.pending_out,A.pending_out+t),e.next_out),e.next_out+=t,A.pending_out+=t,e.total_out+=t,e.avail_out-=t,A.pending-=t,A.pending===0&&(A.pending_out=0))},Dt=(e,A)=>{giA(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,A),e.block_start=e.strstart,mr(e.strm)},de=(e,A)=>{e.pending_buf[e.pending++]=A},AI=(e,A)=>{e.pending_buf[e.pending++]=A>>>8&255,e.pending_buf[e.pending++]=A&255},_iA=(e,A,t,n)=>{let i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,A.set(e.input.subarray(e.next_in,e.next_in+i),t),e.state.wrap===1?e.adler=_l(e.adler,A,i,t):e.state.wrap===2&&(e.adler=ut(e.adler,A,i,t)),e.next_in+=i,e.total_in+=i,i)},fk=(e,A)=>{let t=e.max_chain_length,n=e.strstart,i,r,o=e.prev_length,s=e.nice_match;const a=e.strstart>e.w_size-zn?e.strstart-(e.w_size-zn):0,g=e.window,I=e.w_mask,l=e.prev,c=e.strstart+_r;let C=g[n+o-1],u=g[n+o];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=A,!(g[i+o]!==u||g[i+o-1]!==C||g[i]!==g[n]||g[++i]!==g[n+1])){n+=2,i++;do;while(g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&no){if(e.match_start=A,o=r,r>=s)break;C=g[n+o-1],u=g[n+o]}}while((A=l[A&I])>a&&--t!==0);return o<=e.lookahead?o:e.lookahead},ls=e=>{const A=e.w_size;let t,n,i,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=A+(A-zn)){e.window.set(e.window.subarray(A,A+A),0),e.match_start-=A,e.strstart-=A,e.block_start-=A,n=e.hash_size,t=n;do i=e.head[--t],e.head[t]=i>=A?i-A:0;while(--n);n=A,t=n;do i=e.prev[--t],e.prev[t]=i>=A?i-A:0;while(--n);r+=A}if(e.strm.avail_in===0)break;if(n=_iA(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=Ee)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=Wr(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=Wr(e,e.ins_h,e.window[o+Ee-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert{let t=65535;for(t>e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ls(e),e.lookahead===0&&A===Rs)return gt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+t;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Dt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-zn&&(Dt(e,!1),e.strm.avail_out===0))return gt}return e.insert=0,A===Vr?(Dt(e,!0),e.strm.avail_out===0?Is:dg):(e.strstart>e.block_start&&(Dt(e,!1),e.strm.avail_out===0),gt)},tQ=(e,A)=>{let t,n;for(;;){if(e.lookahead=Ee&&(e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+Ee-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-zn&&(e.match_length=fk(e,t)),e.match_length>=Ee)if(n=Kr(e,e.strstart-e.match_start,e.match_length-Ee),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ee){e.match_length--;do e.strstart++,e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+Ee-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+1]);else n=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Dt(e,!1),e.strm.avail_out===0))return gt}return e.insert=e.strstart{let t,n,i;for(;;){if(e.lookahead=Ee&&(e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+Ee-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Ee-1,t!==0&&e.prev_length4096)&&(e.match_length=Ee-1)),e.prev_length>=Ee&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Ee,n=Kr(e,e.strstart-1-e.prev_match,e.prev_length-Ee),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+Ee-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Ee-1,e.strstart++,n&&(Dt(e,!1),e.strm.avail_out===0))return gt}else if(e.match_available){if(n=Kr(e,0,e.window[e.strstart-1]),n&&Dt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return gt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Kr(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let t,n,i,r;const o=e.window;for(;;){if(e.lookahead<=_r){if(ls(e),e.lookahead<=_r&&A===Rs)return gt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Ee&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){r=e.strstart+_r;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ee?(t=Kr(e,1,e.match_length-Ee),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(Dt(e,!1),e.strm.avail_out===0))return gt}return e.insert=0,A===Vr?(Dt(e,!0),e.strm.avail_out===0?Is:dg):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?gt:dc},GiA=(e,A)=>{let t;for(;;){if(e.lookahead===0&&(ls(e),e.lookahead===0)){if(A===Rs)return gt;break}if(e.match_length=0,t=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(Dt(e,!1),e.strm.avail_out===0))return gt}return e.insert=0,A===Vr?(Dt(e,!0),e.strm.avail_out===0?Is:dg):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?gt:dc};function si(e,A,t,n,i){this.good_length=e,this.max_lazy=A,this.nice_length=t,this.max_chain=n,this.func=i}const EI=[new si(0,0,0,0,LiA),new si(4,4,8,4,tQ),new si(4,5,16,8,tQ),new si(4,6,32,32,tQ),new si(4,4,16,16,Js),new si(8,16,32,32,Js),new si(8,16,128,128,Js),new si(8,32,128,256,Js),new si(32,128,258,1024,Js),new si(32,258,258,4096,Js)],kiA=e=>{e.window_size=2*e.w_size,Sr(e.head),e.max_lazy_match=EI[e.level].max_lazy,e.good_match=EI[e.level].good_length,e.nice_match=EI[e.level].nice_length,e.max_chain_length=EI[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Ee-1,e.match_available=0,e.ins_h=0};function MiA(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=VE,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(DiA*2),this.dyn_dtree=new Uint16Array((2*viA+1)*2),this.bl_tree=new Uint16Array((2*SiA+1)*2),Sr(this.dyn_ltree),Sr(this.dyn_dtree),Sr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(RiA+1),this.heap=new Uint16Array(2*T0+1),Sr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*T0+1),Sr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Qk=e=>{if(!e||!e.state)return Lr(e,Rn);e.total_in=e.total_out=0,e.data_type=QiA;const A=e.state;return A.pending=0,A.pending_out=0,A.wrap<0&&(A.wrap=-A.wrap),A.status=A.wrap?WE:Ho,e.adler=A.wrap===2?0:1,A.last_flush=Rs,siA(A),ui},dk=e=>{const A=Qk(e);return A===ui&&kiA(e.state),A},TiA=(e,A)=>!e||!e.state||e.state.wrap!==2?Rn:(e.state.gzhead=A,ui),pk=(e,A,t,n,i,r)=>{if(!e)return Rn;let o=1;if(A===uiA&&(A=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>diA||t!==VE||n<8||n>15||A<0||A>9||r<0||r>hiA)return Lr(e,Rn);n===8&&(n=9);const s=new MiA;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<pk(e,A,VE,piA,yiA,fiA),PiA=(e,A)=>{let t,n;if(!e||!e.state||A>X1||A<0)return e?Lr(e,Rn):Rn;const i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===BI&&A!==Vr)return Lr(e,e.avail_out===0?eQ:Rn);i.strm=e;const r=i.last_flush;if(i.last_flush=A,i.status===WE)if(i.wrap===2)e.adler=0,de(i,31),de(i,139),de(i,8),i.gzhead?(de(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),de(i,i.gzhead.time&255),de(i,i.gzhead.time>>8&255),de(i,i.gzhead.time>>16&255),de(i,i.gzhead.time>>24&255),de(i,i.level===9?2:i.strategy>=wC||i.level<2?4:0),de(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(de(i,i.gzhead.extra.length&255),de(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=ut(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U0):(de(i,0),de(i,0),de(i,0),de(i,0),de(i,0),de(i,i.level===9?2:i.strategy>=wC||i.level<2?4:0),de(i,FiA),i.status=Ho);else{let o=VE+(i.w_bits-8<<4)<<8,s=-1;i.strategy>=wC||i.level<2?s=0:i.level<6?s=1:i.level===6?s=2:s=3,o|=s<<6,i.strstart!==0&&(o|=xiA),o+=31-o%31,i.status=Ho,AI(i,o),i.strstart!==0&&(AI(i,e.adler>>>16),AI(i,e.adler&65535)),e.adler=1}if(i.status===U0)if(i.gzhead.extra){for(t=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>t&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),mr(e),t=i.pending,i.pending===i.pending_buf_size));)de(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>t&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Cu)}else i.status=Cu;if(i.status===Cu)if(i.gzhead.name){t=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>t&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),mr(e),t=i.pending,i.pending===i.pending_buf_size)){n=1;break}i.gzindext&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),n===0&&(i.gzindex=0,i.status=uu)}else i.status=uu;if(i.status===uu)if(i.gzhead.comment){t=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>t&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),mr(e),t=i.pending,i.pending===i.pending_buf_size)){n=1;break}i.gzindext&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),n===0&&(i.status=Bu)}else i.status=Bu;if(i.status===Bu&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&mr(e),i.pending+2<=i.pending_buf_size&&(de(i,e.adler&255),de(i,e.adler>>8&255),e.adler=0,i.status=Ho)):i.status=Ho),i.pending!==0){if(mr(e),e.avail_out===0)return i.last_flush=-1,ui}else if(e.avail_in===0&&$1(A)<=$1(r)&&A!==Vr)return Lr(e,eQ);if(i.status===BI&&e.avail_in!==0)return Lr(e,eQ);if(e.avail_in!==0||i.lookahead!==0||A!==Rs&&i.status!==BI){let o=i.strategy===wC?GiA(i,A):i.strategy===EiA?biA(i,A):EI[i.level].func(i,A);if((o===Is||o===dg)&&(i.status=BI),o===gt||o===Is)return e.avail_out===0&&(i.last_flush=-1),ui;if(o===dc&&(A===liA?IiA(i):A!==X1&&(aiA(i,0,0,!1),A===ciA&&(Sr(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),mr(e),e.avail_out===0))return i.last_flush=-1,ui}return A!==Vr?ui:i.wrap<=0?Z1:(i.wrap===2?(de(i,e.adler&255),de(i,e.adler>>8&255),de(i,e.adler>>16&255),de(i,e.adler>>24&255),de(i,e.total_in&255),de(i,e.total_in>>8&255),de(i,e.total_in>>16&255),de(i,e.total_in>>24&255)):(AI(i,e.adler>>>16),AI(i,e.adler&65535)),mr(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?ui:Z1)},HiA=e=>{if(!e||!e.state)return Rn;const A=e.state.status;return A!==WE&&A!==U0&&A!==Cu&&A!==uu&&A!==Bu&&A!==Ho&&A!==BI?Lr(e,Rn):(e.state=null,A===Ho?Lr(e,CiA):ui)},qiA=(e,A)=>{let t=A.length;if(!e||!e.state)return Rn;const n=e.state,i=n.wrap;if(i===2||i===1&&n.status!==WE||n.lookahead)return Rn;if(i===1&&(e.adler=_l(e.adler,A,t,0)),n.wrap=0,t>=n.w_size){i===0&&(Sr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let a=new Uint8Array(n.w_size);a.set(A.subarray(t-n.w_size,t),0),A=a,t=n.w_size}const r=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=A,ls(n);n.lookahead>=Ee;){let a=n.strstart,g=n.lookahead-(Ee-1);do n.ins_h=Wr(n,n.ins_h,n.window[a+Ee-1]),n.prev[a&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=a,a++;while(--g);n.strstart=a,n.lookahead=Ee-1,ls(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Ee-1,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=r,n.wrap=i,ui};var JiA=UiA,OiA=pk,YiA=dk,KiA=Qk,ViA=TiA,WiA=PiA,ziA=HiA,jiA=qiA,XiA="pako deflate (from Nodeca project)",YI={deflateInit:JiA,deflateInit2:OiA,deflateReset:YiA,deflateResetKeep:KiA,deflateSetHeader:ViA,deflate:WiA,deflateEnd:ziA,deflateSetDictionary:jiA,deflateInfo:XiA};const ZiA=(e,A)=>Object.prototype.hasOwnProperty.call(e,A);var $iA=function(e){const A=Array.prototype.slice.call(arguments,1);for(;A.length;){const t=A.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const n in t)ZiA(t,n)&&(e[n]=t[n])}}return e},ArA=e=>{let A=0;for(let n=0,i=e.length;n=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ll[254]=Ll[254]=1;var erA=e=>{let A,t,n,i,r,o=e.length,s=0;for(i=0;i>>6,A[r++]=128|t&63):t<65536?(A[r++]=224|t>>>12,A[r++]=128|t>>>6&63,A[r++]=128|t&63):(A[r++]=240|t>>>18,A[r++]=128|t>>>12&63,A[r++]=128|t>>>6&63,A[r++]=128|t&63);return A};const trA=(e,A)=>{if(A<65534&&e.subarray&&yk)return String.fromCharCode.apply(null,e.length===A?e:e.subarray(0,A));let t="";for(let n=0;n{let t,n;const i=A||e.length,r=new Array(i*2);for(n=0,t=0;t4){r[n++]=65533,t+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&t1){r[n++]=65533;continue}o<65536?r[n++]=o:(o-=65536,r[n++]=55296|o>>10&1023,r[n++]=56320|o&1023)}return trA(r,n)},irA=(e,A)=>{A=A||e.length,A>e.length&&(A=e.length);let t=A-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?A:t+Ll[e[t]]>A?t:A},bl={string2buf:erA,buf2string:nrA,utf8border:irA};function rrA(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var mk=rrA;const wk=Object.prototype.toString,{Z_NO_FLUSH:orA,Z_SYNC_FLUSH:srA,Z_FULL_FLUSH:arA,Z_FINISH:grA,Z_OK:_B,Z_STREAM_END:IrA,Z_DEFAULT_COMPRESSION:lrA,Z_DEFAULT_STRATEGY:crA,Z_DEFLATED:CrA}=Ds;function pc(e){this.options=zE.assign({level:lrA,method:CrA,chunkSize:16384,windowBits:15,memLevel:8,strategy:crA},e||{});let A=this.options;A.raw&&A.windowBits>0?A.windowBits=-A.windowBits:A.gzip&&A.windowBits>0&&A.windowBits<16&&(A.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new mk,this.strm.avail_out=0;let t=YI.deflateInit2(this.strm,A.level,A.method,A.windowBits,A.memLevel,A.strategy);if(t!==_B)throw new Error(gs[t]);if(A.header&&YI.deflateSetHeader(this.strm,A.header),A.dictionary){let n;if(typeof A.dictionary=="string"?n=bl.string2buf(A.dictionary):wk.call(A.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(A.dictionary):n=A.dictionary,t=YI.deflateSetDictionary(this.strm,n),t!==_B)throw new Error(gs[t]);this._dict_set=!0}}pc.prototype.push=function(e,A){const t=this.strm,n=this.options.chunkSize;let i,r;if(this.ended)return!1;for(A===~~A?r=A:r=A===!0?grA:orA,typeof e=="string"?t.input=bl.string2buf(e):wk.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(r===srA||r===arA)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=YI.deflate(t,r),i===IrA)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=YI.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===_B;if(t.avail_out===0){this.onData(t.output);continue}if(r>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};pc.prototype.onData=function(e){this.chunks.push(e)};pc.prototype.onEnd=function(e){e===_B&&(this.result=zE.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Om(e,A){const t=new pc(A);if(t.push(e,!0),t.err)throw t.msg||gs[t.err];return t.result}function urA(e,A){return A=A||{},A.raw=!0,Om(e,A)}function BrA(e,A){return A=A||{},A.gzip=!0,Om(e,A)}var ErA=pc,hrA=Om,frA=urA,QrA=BrA,drA=Ds,prA={Deflate:ErA,deflate:hrA,deflateRaw:frA,gzip:QrA,constants:drA};const vC=30,yrA=12;var mrA=function(A,t){let n,i,r,o,s,a,g,I,l,c,C,u,E,B,h,f,Q,d,w,m,v,x,D,F;const N=A.state;n=A.next_in,D=A.input,i=n+(A.avail_in-5),r=A.next_out,F=A.output,o=r-(t-A.avail_out),s=r+(A.avail_out-257),a=N.dmax,g=N.wsize,I=N.whave,l=N.wnext,c=N.window,C=N.hold,u=N.bits,E=N.lencode,B=N.distcode,h=(1<>>24,C>>>=d,u-=d,d=Q>>>16&255,d===0)F[r++]=Q&65535;else if(d&16){w=Q&65535,d&=15,d&&(u>>=d,u-=d),u<15&&(C+=D[n++]<>>24,C>>>=d,u-=d,d=Q>>>16&255,d&16){if(m=Q&65535,d&=15,ua){A.msg="invalid distance too far back",N.mode=vC;break A}if(C>>>=d,u-=d,d=r-o,m>d){if(d=m-d,d>I&&N.sane){A.msg="invalid distance too far back",N.mode=vC;break A}if(v=0,x=c,l===0){if(v+=g-d,d2;)F[r++]=x[v++],F[r++]=x[v++],F[r++]=x[v++],w-=3;w&&(F[r++]=x[v++],w>1&&(F[r++]=x[v++]))}else{v=r-m;do F[r++]=F[v++],F[r++]=F[v++],F[r++]=F[v++],w-=3;while(w>2);w&&(F[r++]=F[v++],w>1&&(F[r++]=F[v++]))}}else if(d&64){A.msg="invalid distance code",N.mode=vC;break A}else{Q=B[(Q&65535)+(C&(1<>3,n-=w,u-=w<<3,C&=(1<{const a=s.bits;let g=0,I=0,l=0,c=0,C=0,u=0,E=0,B=0,h=0,f=0,Q,d,w,m,v,x=null,D=0,F;const N=new Uint16Array(Os+1),M=new Uint16Array(Os+1);let P=null,H=0,W,J,Z;for(g=0;g<=Os;g++)N[g]=0;for(I=0;I=1&&N[c]===0;c--);if(C>c&&(C=c),c===0)return i[r++]=1<<24|64<<16|0,i[r++]=1<<24|64<<16|0,s.bits=1,0;for(l=1;l0&&(e===tx||c!==1))return-1;for(M[1]=0,g=1;gAx||e===nx&&h>ex)return 1;for(;;){W=g-E,o[I]F?(J=P[H+o[I]],Z=x[D+o[I]]):(J=32+64,Z=0),Q=1<>E)+d]=W<<24|J<<16|Z|0;while(d!==0);for(Q=1<>=1;if(Q!==0?(f&=Q-1,f+=Q):f=0,I++,--N[g]===0){if(g===c)break;g=A[t+o[I]]}if(g>C&&(f&m)!==w){for(E===0&&(E=C),v+=l,u=g-E,B=1<Ax||e===nx&&h>ex)return 1;w=f&m,i[w]=C<<24|u<<16|v-r|0}}return f!==0&&(i[v+f]=g-E<<24|64<<16|0),s.bits=C,0};var KI=RrA;const xrA=0,vk=1,Sk=2,{Z_FINISH:ix,Z_BLOCK:FrA,Z_TREES:SC,Z_OK:cs,Z_STREAM_END:NrA,Z_NEED_DICT:_rA,Z_STREAM_ERROR:Ln,Z_DATA_ERROR:Dk,Z_MEM_ERROR:Rk,Z_BUF_ERROR:LrA,Z_DEFLATED:rx}=Ds,xk=1,ox=2,sx=3,ax=4,gx=5,Ix=6,lx=7,cx=8,Cx=9,ux=10,LB=11,Mi=12,iQ=13,Bx=14,rQ=15,Ex=16,hx=17,fx=18,Qx=19,DC=20,RC=21,dx=22,px=23,yx=24,mx=25,wx=26,oQ=27,vx=28,Sx=29,ze=30,Fk=31,brA=32,GrA=852,krA=592,MrA=15,TrA=MrA,Dx=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function UrA(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Nk=e=>{if(!e||!e.state)return Ln;const A=e.state;return e.total_in=e.total_out=A.total=0,e.msg="",A.wrap&&(e.adler=A.wrap&1),A.mode=xk,A.last=0,A.havedict=0,A.dmax=32768,A.head=null,A.hold=0,A.bits=0,A.lencode=A.lendyn=new Int32Array(GrA),A.distcode=A.distdyn=new Int32Array(krA),A.sane=1,A.back=-1,cs},_k=e=>{if(!e||!e.state)return Ln;const A=e.state;return A.wsize=0,A.whave=0,A.wnext=0,Nk(e)},Lk=(e,A)=>{let t;if(!e||!e.state)return Ln;const n=e.state;return A<0?(t=0,A=-A):(t=(A>>4)+1,A<48&&(A&=15)),A&&(A<8||A>15)?Ln:(n.window!==null&&n.wbits!==A&&(n.window=null),n.wrap=t,n.wbits=A,_k(e))},bk=(e,A)=>{if(!e)return Ln;const t=new UrA;e.state=t,t.window=null;const n=Lk(e,A);return n!==cs&&(e.state=null),n},PrA=e=>bk(e,TrA);let Rx=!0,sQ,aQ;const HrA=e=>{if(Rx){sQ=new Int32Array(512),aQ=new Int32Array(32);let A=0;for(;A<144;)e.lens[A++]=8;for(;A<256;)e.lens[A++]=9;for(;A<280;)e.lens[A++]=7;for(;A<288;)e.lens[A++]=8;for(KI(vk,e.lens,0,288,sQ,0,e.work,{bits:9}),A=0;A<32;)e.lens[A++]=5;KI(Sk,e.lens,0,32,aQ,0,e.work,{bits:5}),Rx=!1}e.lencode=sQ,e.lenbits=9,e.distcode=aQ,e.distbits=5},Gk=(e,A,t,n)=>{let i;const r=e.state;return r.window===null&&(r.wsize=1<=r.wsize?(r.window.set(A.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(i=r.wsize-r.wnext,i>n&&(i=n),r.window.set(A.subarray(t-n,t-n+i),r.wnext),n-=i,n?(r.window.set(A.subarray(t-n,t),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave{let t,n,i,r,o,s,a,g,I,l,c,C,u,E,B=0,h,f,Q,d,w,m,v,x;const D=new Uint8Array(4);let F,N;const M=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ln;t=e.state,t.mode===Mi&&(t.mode=iQ),o=e.next_out,i=e.output,a=e.avail_out,r=e.next_in,n=e.input,s=e.avail_in,g=t.hold,I=t.bits,l=s,c=a,x=cs;A:for(;;)switch(t.mode){case xk:if(t.wrap===0){t.mode=iQ;break}for(;I<16;){if(s===0)break A;s--,g+=n[r++]<>>8&255,t.check=ut(t.check,D,2,0),g=0,I=0,t.mode=ox;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((g&255)<<8)+(g>>8))%31){e.msg="incorrect header check",t.mode=ze;break}if((g&15)!==rx){e.msg="unknown compression method",t.mode=ze;break}if(g>>>=4,I-=4,v=(g&15)+8,t.wbits===0)t.wbits=v;else if(v>t.wbits){e.msg="invalid window size",t.mode=ze;break}t.dmax=1<>8&1),t.flags&512&&(D[0]=g&255,D[1]=g>>>8&255,t.check=ut(t.check,D,2,0)),g=0,I=0,t.mode=sx;case sx:for(;I<32;){if(s===0)break A;s--,g+=n[r++]<>>8&255,D[2]=g>>>16&255,D[3]=g>>>24&255,t.check=ut(t.check,D,4,0)),g=0,I=0,t.mode=ax;case ax:for(;I<16;){if(s===0)break A;s--,g+=n[r++]<>8),t.flags&512&&(D[0]=g&255,D[1]=g>>>8&255,t.check=ut(t.check,D,2,0)),g=0,I=0,t.mode=gx;case gx:if(t.flags&1024){for(;I<16;){if(s===0)break A;s--,g+=n[r++]<>>8&255,t.check=ut(t.check,D,2,0)),g=0,I=0}else t.head&&(t.head.extra=null);t.mode=Ix;case Ix:if(t.flags&1024&&(C=t.length,C>s&&(C=s),C&&(t.head&&(v=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(r,r+C),v)),t.flags&512&&(t.check=ut(t.check,n,C,r)),s-=C,r+=C,t.length-=C),t.length))break A;t.length=0,t.mode=lx;case lx:if(t.flags&2048){if(s===0)break A;C=0;do v=n[r+C++],t.head&&v&&t.length<65536&&(t.head.name+=String.fromCharCode(v));while(v&&C>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=Mi;break;case ux:for(;I<32;){if(s===0)break A;s--,g+=n[r++]<>>=I&7,I-=I&7,t.mode=oQ;break}for(;I<3;){if(s===0)break A;s--,g+=n[r++]<>>=1,I-=1,g&3){case 0:t.mode=Bx;break;case 1:if(HrA(t),t.mode=DC,A===SC){g>>>=2,I-=2;break A}break;case 2:t.mode=hx;break;case 3:e.msg="invalid block type",t.mode=ze}g>>>=2,I-=2;break;case Bx:for(g>>>=I&7,I-=I&7;I<32;){if(s===0)break A;s--,g+=n[r++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=ze;break}if(t.length=g&65535,g=0,I=0,t.mode=rQ,A===SC)break A;case rQ:t.mode=Ex;case Ex:if(C=t.length,C){if(C>s&&(C=s),C>a&&(C=a),C===0)break A;i.set(n.subarray(r,r+C),o),s-=C,r+=C,a-=C,o+=C,t.length-=C;break}t.mode=Mi;break;case hx:for(;I<14;){if(s===0)break A;s--,g+=n[r++]<>>=5,I-=5,t.ndist=(g&31)+1,g>>>=5,I-=5,t.ncode=(g&15)+4,g>>>=4,I-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=ze;break}t.have=0,t.mode=fx;case fx:for(;t.have>>=3,I-=3}for(;t.have<19;)t.lens[M[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,F={bits:t.lenbits},x=KI(xrA,t.lens,0,19,t.lencode,0,t.work,F),t.lenbits=F.bits,x){e.msg="invalid code lengths set",t.mode=ze;break}t.have=0,t.mode=Qx;case Qx:for(;t.have>>24,f=B>>>16&255,Q=B&65535,!(h<=I);){if(s===0)break A;s--,g+=n[r++]<>>=h,I-=h,t.lens[t.have++]=Q;else{if(Q===16){for(N=h+2;I>>=h,I-=h,t.have===0){e.msg="invalid bit length repeat",t.mode=ze;break}v=t.lens[t.have-1],C=3+(g&3),g>>>=2,I-=2}else if(Q===17){for(N=h+3;I>>=h,I-=h,v=0,C=3+(g&7),g>>>=3,I-=3}else{for(N=h+7;I>>=h,I-=h,v=0,C=11+(g&127),g>>>=7,I-=7}if(t.have+C>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ze;break}for(;C--;)t.lens[t.have++]=v}}if(t.mode===ze)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=ze;break}if(t.lenbits=9,F={bits:t.lenbits},x=KI(vk,t.lens,0,t.nlen,t.lencode,0,t.work,F),t.lenbits=F.bits,x){e.msg="invalid literal/lengths set",t.mode=ze;break}if(t.distbits=6,t.distcode=t.distdyn,F={bits:t.distbits},x=KI(Sk,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,F),t.distbits=F.bits,x){e.msg="invalid distances set",t.mode=ze;break}if(t.mode=DC,A===SC)break A;case DC:t.mode=RC;case RC:if(s>=6&&a>=258){e.next_out=o,e.avail_out=a,e.next_in=r,e.avail_in=s,t.hold=g,t.bits=I,mrA(e,c),o=e.next_out,i=e.output,a=e.avail_out,r=e.next_in,n=e.input,s=e.avail_in,g=t.hold,I=t.bits,t.mode===Mi&&(t.back=-1);break}for(t.back=0;B=t.lencode[g&(1<>>24,f=B>>>16&255,Q=B&65535,!(h<=I);){if(s===0)break A;s--,g+=n[r++]<>d)],h=B>>>24,f=B>>>16&255,Q=B&65535,!(d+h<=I);){if(s===0)break A;s--,g+=n[r++]<>>=d,I-=d,t.back+=d}if(g>>>=h,I-=h,t.back+=h,t.length=Q,f===0){t.mode=wx;break}if(f&32){t.back=-1,t.mode=Mi;break}if(f&64){e.msg="invalid literal/length code",t.mode=ze;break}t.extra=f&15,t.mode=dx;case dx:if(t.extra){for(N=t.extra;I>>=t.extra,I-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=px;case px:for(;B=t.distcode[g&(1<>>24,f=B>>>16&255,Q=B&65535,!(h<=I);){if(s===0)break A;s--,g+=n[r++]<>d)],h=B>>>24,f=B>>>16&255,Q=B&65535,!(d+h<=I);){if(s===0)break A;s--,g+=n[r++]<>>=d,I-=d,t.back+=d}if(g>>>=h,I-=h,t.back+=h,f&64){e.msg="invalid distance code",t.mode=ze;break}t.offset=Q,t.extra=f&15,t.mode=yx;case yx:if(t.extra){for(N=t.extra;I>>=t.extra,I-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ze;break}t.mode=mx;case mx:if(a===0)break A;if(C=c-a,t.offset>C){if(C=t.offset-C,C>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ze;break}C>t.wnext?(C-=t.wnext,u=t.wsize-C):u=t.wnext-C,C>t.length&&(C=t.length),E=t.window}else E=i,u=o-t.offset,C=t.length;C>a&&(C=a),a-=C,t.length-=C;do i[o++]=E[u++];while(--C);t.length===0&&(t.mode=RC);break;case wx:if(a===0)break A;i[o++]=t.length,a--,t.mode=RC;break;case oQ:if(t.wrap){for(;I<32;){if(s===0)break A;s--,g|=n[r++]<{if(!e||!e.state)return Ln;let A=e.state;return A.window&&(A.window=null),e.state=null,cs},OrA=(e,A)=>{if(!e||!e.state)return Ln;const t=e.state;return t.wrap&2?(t.head=A,A.done=!1,cs):Ln},YrA=(e,A)=>{const t=A.length;let n,i,r;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==LB)?Ln:n.mode===LB&&(i=1,i=_l(i,A,t,0),i!==n.check)?Dk:(r=Gk(e,A,t,t),r?(n.mode=Fk,Rk):(n.havedict=1,cs))};var KrA=_k,VrA=Lk,WrA=Nk,zrA=PrA,jrA=bk,XrA=qrA,ZrA=JrA,$rA=OrA,AoA=YrA,eoA="pako inflate (from Nodeca project)",Hi={inflateReset:KrA,inflateReset2:VrA,inflateResetKeep:WrA,inflateInit:zrA,inflateInit2:jrA,inflate:XrA,inflateEnd:ZrA,inflateGetHeader:$rA,inflateSetDictionary:AoA,inflateInfo:eoA};function toA(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var noA=toA;const kk=Object.prototype.toString,{Z_NO_FLUSH:ioA,Z_FINISH:roA,Z_OK:Gl,Z_STREAM_END:gQ,Z_NEED_DICT:IQ,Z_STREAM_ERROR:ooA,Z_DATA_ERROR:xx,Z_MEM_ERROR:soA}=Ds;function yc(e){this.options=zE.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const A=this.options;A.raw&&A.windowBits>=0&&A.windowBits<16&&(A.windowBits=-A.windowBits,A.windowBits===0&&(A.windowBits=-15)),A.windowBits>=0&&A.windowBits<16&&!(e&&e.windowBits)&&(A.windowBits+=32),A.windowBits>15&&A.windowBits<48&&(A.windowBits&15||(A.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new mk,this.strm.avail_out=0;let t=Hi.inflateInit2(this.strm,A.windowBits);if(t!==Gl)throw new Error(gs[t]);if(this.header=new noA,Hi.inflateGetHeader(this.strm,this.header),A.dictionary&&(typeof A.dictionary=="string"?A.dictionary=bl.string2buf(A.dictionary):kk.call(A.dictionary)==="[object ArrayBuffer]"&&(A.dictionary=new Uint8Array(A.dictionary)),A.raw&&(t=Hi.inflateSetDictionary(this.strm,A.dictionary),t!==Gl)))throw new Error(gs[t])}yc.prototype.push=function(e,A){const t=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let r,o,s;if(this.ended)return!1;for(A===~~A?o=A:o=A===!0?roA:ioA,kk.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),r=Hi.inflate(t,o),r===IQ&&i&&(r=Hi.inflateSetDictionary(t,i),r===Gl?r=Hi.inflate(t,o):r===xx&&(r=IQ));t.avail_in>0&&r===gQ&&t.state.wrap>0&&e[t.next_in]!==0;)Hi.inflateReset(t),r=Hi.inflate(t,o);switch(r){case ooA:case xx:case IQ:case soA:return this.onEnd(r),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||r===gQ))if(this.options.to==="string"){let a=bl.utf8border(t.output,t.next_out),g=t.next_out-a,I=bl.buf2string(t.output,a);t.next_out=g,t.avail_out=n-g,g&&t.output.set(t.output.subarray(a,a+g),0),this.onData(I)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(r===Gl&&s===0)){if(r===gQ)return r=Hi.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};yc.prototype.onData=function(e){this.chunks.push(e)};yc.prototype.onEnd=function(e){e===Gl&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=zE.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ym(e,A){const t=new yc(A);if(t.push(e),t.err)throw t.msg||gs[t.err];return t.result}function aoA(e,A){return A=A||{},A.raw=!0,Ym(e,A)}var goA=yc,IoA=Ym,loA=aoA,coA=Ym,CoA=Ds,uoA={Inflate:goA,inflate:IoA,inflateRaw:loA,ungzip:coA,constants:CoA};const{Deflate:BoA,deflate:EoA,deflateRaw:hoA,gzip:foA}=prA,{Inflate:QoA,inflate:doA,inflateRaw:poA,ungzip:yoA}=uoA;var moA=BoA,woA=EoA,voA=hoA,SoA=foA,DoA=QoA,RoA=doA,xoA=poA,FoA=yoA,NoA=Ds,bB={Deflate:moA,deflate:woA,deflateRaw:voA,gzip:SoA,Inflate:DoA,inflate:RoA,inflateRaw:xoA,ungzip:FoA,constants:NoA},xC;const _oA=(xC=class{constructor(e=1){if(e<0||e>9)throw new Error("Invalid gzip compression level, it should be between 0 and 9");this.level=e}static fromConfig({level:e}){return new xC(e)}encode(e){return bB.gzip(e,{level:this.level})}decode(e,A){const t=bB.ungzip(e);return A!==void 0?(A.set(t),A):t}},xC.codecId="gzip",xC);var Fx=_oA,FC;const LoA=(FC=class{constructor(e=1){if(e<-1||e>9)throw new Error("Invalid zlib compression level, it should be between -1 and 9");this.level=e}static fromConfig({level:e}){return new FC(e)}encode(e){return bB.deflate(e,{level:this.level})}decode(e,A){const t=bB.inflate(e);return A!==void 0?(A.set(t),A):t}},FC.codecId="zlib",FC);var Nx=LoA,boA=function(){return typeof document<"u"&&document.currentScript&&document.currentScript.src,function(e){e=e||{};var A;A||(A=typeof e<"u"?e:{});var t,n;A.ready=new Promise(function(_,G){t=_,n=G});var i={},r;for(r in A)A.hasOwnProperty(r)&&(i[r]=A[r]);var o="./this.program",s=A.print||console.log.bind(console),a=A.printErr||console.warn.bind(console);for(r in i)i.hasOwnProperty(r)&&(A[r]=i[r]);i=null,A.thisProgram&&(o=A.thisProgram);var g;A.wasmBinary&&(g=A.wasmBinary),A.noExitRuntime&&A.noExitRuntime,typeof WebAssembly!="object"&&nA("no native wasm support detected");var I,l=!1,c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function C(_,G,U){var V=G+U;for(U=G;_[U]&&!(U>=V);)++U;if(16X?V+=String.fromCharCode(X):(X-=65536,V+=String.fromCharCode(55296|X>>10,56320|X&1023))}}else V+=String.fromCharCode(X)}return V}function u(_,G,U){var V=x;if(0=tA){var mA=_.charCodeAt(++X);tA=65536+((tA&1023)<<10)|mA&1023}if(127>=tA){if(G>=U)break;V[G++]=tA}else{if(2047>=tA){if(G+1>=U)break;V[G++]=192|tA>>6}else{if(65535>=tA){if(G+2>=U)break;V[G++]=224|tA>>12}else{if(G+3>=U)break;V[G++]=240|tA>>18,V[G++]=128|tA>>12&63}V[G++]=128|tA>>6&63}V[G++]=128|tA&63}}V[G]=0}}var E=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function B(_,G){for(var U=_>>1,V=U+G/2;!(U>=V)&&F[U];)++U;if(U<<=1,32>1];if(X==0||U==G/2)return V;++U,V+=String.fromCharCode(X)}}function h(_,G,U){if(U===void 0&&(U=2147483647),2>U)return 0;U-=2;var V=G;U=U<2*_.length?U/2:_.length;for(var X=0;X>1]=_.charCodeAt(X),G+=2;return D[G>>1]=0,G-V}function f(_){return 2*_.length}function Q(_,G){for(var U=0,V="";!(U>=G/4);){var X=N[_+4*U>>2];if(X==0)break;++U,65536<=X?(X-=65536,V+=String.fromCharCode(55296|X>>10,56320|X&1023)):V+=String.fromCharCode(X)}return V}function d(_,G,U){if(U===void 0&&(U=2147483647),4>U)return 0;var V=G;U=V+U-4;for(var X=0;X<_.length;++X){var tA=_.charCodeAt(X);if(55296<=tA&&57343>=tA){var mA=_.charCodeAt(++X);tA=65536+((tA&1023)<<10)|mA&1023}if(N[G>>2]=tA,G+=4,G+4>U)break}return N[G>>2]=0,G-V}function w(_){for(var G=0,U=0;U<_.length;++U){var V=_.charCodeAt(U);55296<=V&&57343>=V&&++U,G+=4}return G}var m,v,x,D,F,N,M,P,H;function W(_){m=_,A.HEAP8=v=new Int8Array(_),A.HEAP16=D=new Int16Array(_),A.HEAP32=N=new Int32Array(_),A.HEAPU8=x=new Uint8Array(_),A.HEAPU16=F=new Uint16Array(_),A.HEAPU32=M=new Uint32Array(_),A.HEAPF32=P=new Float32Array(_),A.HEAPF64=H=new Float64Array(_)}var J=A.INITIAL_MEMORY||16777216;A.wasmMemory?I=A.wasmMemory:I=new WebAssembly.Memory({initial:J/65536,maximum:32768}),I&&(m=I.buffer),J=m.byteLength,W(m);var Z,z=[],O=[],Y=[],T=[];function q(){var _=A.preRun.shift();z.unshift(_)}var j=0,AA=null;A.preloadedImages={},A.preloadedAudios={};function nA(_){throw A.onAbort&&A.onAbort(_),a(_),l=!0,_=new WebAssembly.RuntimeError("abort("+_+"). Build with -s ASSERTIONS=1 for more info."),n(_),_}function IA(_){var G=BA;return String.prototype.startsWith?G.startsWith(_):G.indexOf(_)===0}function aA(){return IA("data:application/octet-stream;base64,")}var BA="blosc_codec.wasm";if(!aA()){var lA=BA;BA=A.locateFile?A.locateFile(lA,""):""+lA}function MA(){try{if(g)return new Uint8Array(g);throw"both async and sync fetching of the wasm failed"}catch(_){nA(_)}}function EA(_){for(;0<_.length;){var G=_.shift();if(typeof G=="function")G(A);else{var U=G.T;typeof U=="number"?G.O===void 0?Z.get(U)():Z.get(U)(G.O):U(G.O===void 0?null:G.O)}}}function pA(_){this.N=_-16,this.$=function(G){N[this.N+8>>2]=G},this.X=function(G){N[this.N+0>>2]=G},this.Y=function(){N[this.N+4>>2]=0},this.W=function(){v[this.N+12>>0]=0},this.Z=function(){v[this.N+13>>0]=0},this.V=function(G,U){this.$(G),this.X(U),this.Y(),this.W(),this.Z()}}function qA(_){switch(_){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+_)}}var NA=void 0;function JA(_){for(var G="";x[_];)G+=NA[x[_++]];return G}var dA={},GA={},ie={};function Ie(_){if(_===void 0)return"_unknown";_=_.replace(/[^a-zA-Z0-9_]/g,"$");var G=_.charCodeAt(0);return 48<=G&&57>=G?"_"+_:_}function he(_,G){return _=Ie(_),new Function("body","return function "+_+`() { +`).filter(g=>g.length>0).map(g=>g.split("=")).forEach(([g,I])=>{this.ghostValues[g]=I})}return this.ghostValues}static async fromSource(A,t,n){const i=(await A.fetch([{offset:0,length:1024}],n))[0],r=new seA(i),o=r.getUint16(0,0);let s;if(o===18761)s=!0;else if(o===19789)s=!1;else throw new TypeError("Invalid byte order value.");const a=r.getUint16(2,s);let g;if(a===42)g=!1;else if(a===43){if(g=!0,r.getUint16(4,s)!==8)throw new Error("Unsupported offset byte-size.")}else throw new TypeError("Invalid magic number.");const I=g?r.getUint64(8,s):r.getUint32(4,s);return new fc(A,s,g,I,t)}close(){return typeof this.source.close=="function"?this.source.close():!1}}async function qE(e,A={},t){return fc.fromSource(ReA(e,A),t)}async function NG(e,A){return fc.fromSource(GeA(e),A)}async function JE(e,A){return fc.fromSource(FeA(e),A)}const _G="__viv",JeA=`${_G}-offsets`;function OeA(e){YeA(e)||console.warn("GeoTIFF source is missing offsets proxy.")}function YeA(e){return e[_G]}function KeA(e,A){const t=(n,i)=>i==="getImage"?r=>{if(!(r in n.ifdRequests)&&r in A){const o=A[r];n.ifdRequests[r]=n.parseFileDirectoryAt(o)}return n.getImage(r)}:i===JeA?!0:Reflect.get(n,i);return new Proxy(e,{get:t})}let qn,dC=null;function D1(){return dC!==null&&dC.buffer===qn.memory.buffer||(dC=new Uint8Array(qn.memory.buffer)),dC}let R1=0,pC=null;function x1(){return pC!==null&&pC.buffer===qn.memory.buffer||(pC=new Int32Array(qn.memory.buffer)),pC}async function mm(e){e===void 0&&(e="".replace(/\.js$/,"_bg.wasm")),(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));const{instance:A,module:t}=await async function(n,i){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,i)}catch(o){if(n.headers.get("Content-Type")=="application/wasm")throw o;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",o)}const r=await n.arrayBuffer();return await WebAssembly.instantiate(r,i)}{const r=await WebAssembly.instantiate(n,i);return r instanceof WebAssembly.Instance?{instance:r,module:n}:r}}(await e,{});return qn=A.exports,mm.__wbindgen_wasm_module=t,qn}var VeA=Object.freeze({__proto__:null,decompress:function(e,A){try{const g=qn.__wbindgen_add_to_stack_pointer(-16);var t=function(I,l){const c=l(1*I.length);return D1().set(I,c/1),R1=I.length,c}(e,qn.__wbindgen_malloc),n=R1;qn.decompress(g,t,n,A);var i=x1()[g/4+0],r=x1()[g/4+1],o=(s=i,a=r,D1().subarray(s/1,s/1+a)).slice();return qn.__wbindgen_free(i,1*r),o}finally{qn.__wbindgen_add_to_stack_pointer(16)}var s,a},default:mm});const WeA=[62,0,0,0,63,52,53,54,55,56,57,58,59,60,61,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,0,0,0,0,0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function yC(e){return WeA[e-43]}const zeA=function(e){let A,t=e.endsWith("==")?2:e.endsWith("=")?1:0,n=e.length,i=new Uint8Array(n/4*3);for(let r=0,o=0;r>16,i[o+1]=A>>8&255,i[o+2]=255&A;return i.subarray(0,i.length-t)}("AGFzbQEAAAABWQ5gAn9/AX9gA39/fwF/YAJ/fwBgAX8AYAN/f38AYAF/AX9gBH9/f38AYAR/f39/AX9gBn9/f39/fwBgAX8BfmAAAGAFf39/f38AYAV/f39/fwF/YAJ+fwF/A21sBQgICwMBAgUMAQABAAIABQACAgYGDQYDAgACAAAEBAQCAgYGAAYBBgIHAwQDBAQDAwADBQMDBAQEBAQCAgAHAAQAAgMBAgcFBAIDAQUCAgIDAgIDAwcCAQAABAIACgAAAQAFAgADBQkJCQMCBAUBcAErKwUDAQARBgkBfwFBgIDAAAsHXwUGbWVtb3J5AgAKZGVjb21wcmVzcwAnH19fd2JpbmRnZW5fYWRkX3RvX3N0YWNrX3BvaW50ZXIAYhFfX3diaW5kZ2VuX21hbGxvYwBMD19fd2JpbmRnZW5fZnJlZQBWCTABAEEBCypqJDUCZmVDNQFmZUNha2pXDD1pVBohSVtTaGdfXDEOXlhqaQscQWAbP2QKsugBbNMqAgh/AX4CQAJAAkACQCAAQfUBTwRAIABBzf97Tw0CIABBC2oiAEF4cSEGQZCnwA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ARyNgIAIAILIQEgAiAANgIIIAEgADYCDCAAIAI2AgwgACABNgIIDAILQaiqwAAgADYCAEGgqsAAQaCqwAAoAgAgBmoiAjYCACAAIAJBAXI2AgQMAQtBpKrAACAANgIAQZyqwABBnKrAACgCACAGaiICNgIAIAAgAkEBcjYCBCAAIAJqIAI2AgALIAVBCGoPC0G0qsAAIQADQAJAIAAoAgAiASADTQRAIAEgACgCBGoiByADSw0BCyAAKAIIIQAMAQsLQaiqwAAgBTYCAEGgqsAAIARBWGoiADYCACAFIABBAXI2AgQgACAFakEoNgIEQcSqwABBgICAATYCACADIAdBYGpBeHFBeGoiACAAIANBEGpJGyIBQRs2AgRBtKrAACkCACEJIAFBEGpBvKrAACkCADcCACABIAk3AghBwKrAAEEANgIAQbiqwAAgBDYCAEG0qsAAIAU2AgBBvKrAACABQQhqNgIAIAFBHGohAANAIABBBzYCACAHIABBBGoiAEsNAAsgASADRg0AIAEgASgCBEF+cTYCBCADIAEgA2siBUEBcjYCBCABIAU2AgAgBUGAAk8EQCADQgA3AhAgA0EcagJ/QQAgBUEIdiIARQ0AGkEfIAVB////B0sNABogBUEGIABnIgBrQR9xdkEBcSAAQQF0a0E+agsiADYCACAAQQJ0QZypwABqIQECQAJAAkACQEGQp8AAKAIAIgRBASAAQR9xdCIHcQRAIAEoAgAiBEEEaigCAEF4cSAFRw0BIAQhAAwCC0GQp8AAIAQgB3I2AgAgASADNgIAIANBGGogATYCAAwDCyAFQQBBGSAAQQF2a0EfcSAAQR9GG3QhAQNAIAQgAUEddkEEcWpBEGoiBygCACIARQ0CIAFBAXQhASAAIQQgAEEEaigCAEF4cSAFRw0ACwsgACgCCCIBIAM2AgwgACADNgIIIANBGGpBADYCACADIAA2AgwgAyABNgIIDAMLIAcgAzYCACADQRhqIAQ2AgALIAMgAzYCDCADIAM2AggMAQsgBUEDdiIBQQN0QZSnwABqIQACf0GMp8AAKAIAIgRBASABdCIBcQRAIAAoAggMAQtBjKfAACABIARyNgIAIAALIQEgACADN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BqQYAgEEUgASgCICEDIAEoAighAgsgAEEAOwBHIABBADsBOCAAIAM2AiggACAFNgIQIABBCDoARiAAQQA6AAsgAEIANwMAIABBMGpCADcDACAAQSxqIAI2AgAgAEEkakEANgIAIABBIGogBjYCACAAQRxqIAc2AgAgAEEYakEANgIAIABBFGogBDYCACAAQQk6AAogAEGAAjsBQiAAQYECOwFEIABBggI7AUAgAEH/AzsBCCABQTBqJAALxwICBX8BfiMAQRBrIgMkACAALQALIQIgA0IANwMIIAEoAgAhBQJAAkAgAAJ/IAEoAgQiBEHAACACayIGQfgBcUEDdiICSQRAIARBCU8NAiADQQhqIAUgBBBLGiABQQA2AgQgAUGIg8AANgIAIARBA3QMAQsgBkH/AXFByABPDQIgA0EIaiAFIAIQSxogASAEIAJrNgIEIAEgAiAFajYCACAGQfgBcQsgAC0ACyIBajoACyAAIAApAwAgAykDCCIHQjiGIAdCKIZCgICAgICAwP8Ag4QgB0IYhkKAgICAgOA/gyAHQgiGQoCAgIDwH4OEhCAHQgiIQoCAgPgPgyAHQhiIQoCA/AeDhCAHQiiIQoD+A4MgB0I4iISEhCABQT9xrYiENwMAIANBEGokAA8LIARBCEHYhcAAEDcACyACQQhByIXAABA3AAuqAgEDfyMAQYABayIEJAACQAJAAn8CQCABKAIAIgNBEHFFBEAgACgCACECIANBIHENASACrSABEBUMAgsgACgCACECQQAhAANAIAAgBGpB/wBqIAJBD3EiA0EwciADQdcAaiADQQpJGzoAACAAQX9qIQAgAkEEdiICDQALIABBgAFqIgJBgQFPDQIgAUGkjsAAQQIgACAEakGAAWpBACAAaxAIDAELQQAhAANAIAAgBGpB/wBqIAJBD3EiA0EwciADQTdqIANBCkkbOgAAIABBf2ohACACQQR2IgINAAsgAEGAAWoiAkGBAU8NAiABQaSOwABBAiAAIARqQYABakEAIABrEAgLIARBgAFqJAAPCyACQYABQZSOwAAQOQALIAJBgAFBlI7AABA5AAuxAgEEfyMAQUBqIgIkACABKAIEIgNFBEAgAUEEaiEDIAEoAgA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jggASABQQhqNgIwIAFBGGpB8IDAABBRAAtxAQN/IwBBIGsiAiQAAkAgACABEBkNACABQRxqKAIAIQMgASgCGCACQRxqQQA2AgAgAkHwi8AANgIYIAJCATcCDCACQfSLwAA2AgggAyACQQhqEAkNACAAQQRqIAEQGSACQSBqJAAPCyACQSBqJABBAQswAQF/AkACQEGAwABBAhBZIgENAQwAC0GAwABBAhBjAAsgACABNgIAIABBgCA2AgQLewECfwJAAkAgACgCBCIBBEAgACgCDCICIAFPDQEgACgCACIBIAJqIAEtAAA6AAAgAEEANgIIIAAgACgCDEEBajYCDCAAKAIERQ0CIAAoAgAtAAAPC0EAQQBBiIbAABA2AAsgAiABQZiGwAAQNgALQQBBAEGohsAAEDYAC2gBAn8gACAALQBGIgFBAWoiAjoACiAAQQEgAUEPcXRBAmoiATsBQCAAQX8gAkEPcXRBf3M7AQggAEEYaigCACABQf//A3EiAU8EQCAAIAE2AhgLIABBJGooAgAgAU8EQCAAIAE2AiQLC1ABAX8gAEEUaigCACIBRSABQQJ0RXJFBEAgACgCEBAECyAAQSBqKAIAIgFFIAFBAXRFckUEQCAAKAIcEAQLIABBLGooAgAEQCAAKAIoEAQLC2wBAX8jAEEwayIDJAAgAyABNgIEIAMgADYCACADQRxqQQI2AgAgA0EsakEcNgIAIANCAjcCDCADQYCNwAA2AgggA0EcNgIkIAMgA0EgajYCGCADIAM2AiggAyADQQRqNgIgIANBCGogAhBRAAtsAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2AgAgA0EcakECNgIAIANBLGpBHDYCACADQgI3AgwgA0HMkcAANgIIIANBHDYCJCADIANBIGo2AhggAyADQQRqNgIoIAMgAzYCICADQQhqIAIQUQALbAEBfyMAQTBrIgMkACADIAE2AgQgAyAANgIAIANBHGpBAjYCACADQSxqQRw2AgAgA0ICNwIMIANBgJLAADYCCCADQRw2AiQgAyADQSBqNgIYIAMgA0EEajYCKCADIAM2AiAgA0EIaiACEFEAC2wBAX8jAEEwayIDJAAgAyABNgIEIAMgADYCACADQRxqQQI2AgAgA0EsakEcNgIAIANCAjcCDCADQayRwAA2AgggA0EcNgIkIAMgA0EgajYCGCADIANBBGo2AiggAyADNgIgIANBCGogAhBRAAtcAQF/IwBBEGsiAyQAAkAgACgCBCABayACTwRAIANBADYCAAwBCyADIAAgASACEBYgAygCAEEBRw0AIANBCGooAgAiAARAIAMoAgQgABBjAAsQXQALIANBEGokAAtaAQF/IwBBEGsiAiQAAkAgACgCBCABa0EBTwRAIAJBADYCAAwBCyACIAAgARAeIAIoAgBBAUcNACACQQhqKAIAIgAEQCACKAIEIAAQYwALEF0ACyACQRBqJAALWgEBfyMAQRBrIgIkAAJAIAAoAgQgAWtBAU8EQCACQQA2AgAMAQsgAiAAIAEQHSACKAIAQQFHDQAgAkEIaigCACIABEAgAigCBCAAEGMACxBdAAsgAkEQaiQAC1kBAX8jAEEgayICJAAgAiAAKAIANgIEIAJBGGogAUEQaikCADcDACACQRBqIAFBCGopAgA3AwAgAiABKQIANwMIIAJBBGpB2InAACACQQhqEAkgAkEgaiQAC0YAAkBBCCACSQRAAn9BCCACSQRAIAIgAxAQDAELIAMQAAsiAg0BQQAPCyAAIAMQCg8LIAIgACADIAEgASADSxsQSyAAEAQLWQEBfyMAQSBrIgIkACACIAAoAgA2AgQgAkEYaiABQRBqKQIANwMAIAJBEGogAUEIaikCADcDACACIAEpAgA3AwggAkEEakHwj8AAIAJBCGoQCSACQSBqJAALWQACQAJAAkAgAUF/SgRAAkAgAgRAIAENAQwECyABRQ0DIAFBARBZIgINBAwCCyABEEciAkUNAQwDCxBdAAsgAUEBEGMAC0EBIQILIAAgATYCBCAAIAI2AgALVgEBfyMAQSBrIgIkACACIAA2AgQgAkEYaiABQRBqKQIANwMAIAJBEGogAUEIaikCADcDACACIAEpAgA3AwggAkEEakHwj8AAIAJBCGoQCSACQSBqJAALWQEDfwJAIAEoAgwiAiABKAIIIgNPBEAgASgCBCIEIAJJDQEgASgCACEBIAAgAiADazYCBCAAIAEgA2o2AgA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.decompress(e,A);if(t.length===0)throw Error("Failed to decode with LZW decoder.");return t}class XeA extends UeA{constructor(t){super();mo(this,"maxUncompressedSize");const n=t.TileWidth||t.ImageWidth,i=t.TileLength||t.ImageLength,r=t.BitsPerSample[0]/8;this.maxUncompressedSize=n*i*r}async decodeBlock(t){const n=new Uint8Array(t);return(await jeA(n,this.maxUncompressedSize)).buffer}}function Zg(e,A,t,n,i){LG(e,A,t||0,n||e.length-1,i||ZeA)}function LG(e,A,t,n,i){for(;n>t;){if(n-t>600){var r=n-t+1,o=A-t+1,s=Math.log(r),a=.5*Math.exp(2*s/3),g=.5*Math.sqrt(s*a*(r-a)/r)*(o-r/2<0?-1:1),I=Math.max(t,Math.floor(A-o*a/r+g)),l=Math.min(n,Math.floor(A+(r-o)*a/r+g));LG(e,A,I,l,i)}var c=e[A],C=t,u=n;for($g(e,t,A),i(e[n],c)>0&&$g(e,t,n);C0;)u--}i(e[t],c)===0?$g(e,t,u):(u++,$g(e,u,n)),u<=A&&(t=u+1),A<=u&&(n=u-1)}}function $g(e,A,t){var n=e[A];e[A]=e[t],e[t]=n}function ZeA(e,A){return eA?1:0}const Pn={uint8:"Uint8",uint16:"Uint16",uint32:"Uint32",float:"Float32",double:"Float64",int8:"Int8",int16:"Int16",int32:"Int32"};function Iu(e){let A=e.length,t=1/0,n=-1/0,i=0;for(;A--;)e[A]n&&(n=e[A]),i+=e[A];const r=i/e.length;A=e.length;let o=0;for(;A--;)o+=(e[A]-r)**2;const s=(o/e.length)**.5,a=Math.floor(e.length/2),g=Math.floor(e.length/4),I=3*Math.floor(e.length/4);Zg(e,a);const l=e[a];Zg(e,g,0,a);const c=e[g];Zg(e,I,a,e.length-1);const C=e[I],u=e.filter(Q=>Q>0),E=5e-4,B=Math.floor(u.length*(1-E)),h=Math.floor(u.length*E);Zg(u,B),Zg(u,h,0,B);const f=[u[h]||0,u[B]||0];return{mean:r,sd:s,q1:c,q3:C,median:l,domain:[t,n],contrastLimits:f}}function B0(e){return Array.isArray(e)?e:[e]}function $eA(e){if(!Number.isInteger(e))throw Error("Not an integer.");const A=new ArrayBuffer(4);new DataView(A).setInt32(0,e,!1);const n=new Uint8Array(A);return Array.from(n)}function ro(e){const A=e[e.length-1];return A===3||A===4}function uB(e){return e.toLowerCase().split("").reverse()}function bG(e){const A=new Map(e.map((t,n)=>[t,n]));if(A.size!==e.length)throw Error("Labels must be unique, found duplicated label.");return t=>{const n=A.get(t);if(n===void 0)throw Error("Invalid dimension.");return n}}function ho(e){const A=ro(e.shape),[t,n]=e.shape.slice(A?-3:-2);return{height:t,width:n}}function GG(e){return 2**Math.floor(Math.log2(e))}const wm="__vivSignalAborted";function kG(e){const A=e.getTileWidth(),t=e.getTileHeight(),n=Math.min(A,t);return GG(n)}function AtA(e){return e.nodeType===1}function etA(e){return e.nodeType===3}function MG(e,A){var n;if(etA(e))return((n=e.nodeValue)==null?void 0:n.trim())??"";if(e.childNodes.length===0&&(!e.attributes||e.attributes.length===0))return"";const t={};if(e.attributes&&e.attributes.length>0){const i={};for(let r=0;r{const a=[...n];return a[t("x")]=e.SizeX>>s,a[t("y")]=e.SizeY>>s,a};if(!(e.Type in Pn))throw Error(`Pixel type ${e.Type} not supported.`);const r=Pn[e.Type],o=ntA(e);return o?{labels:A,getShape:i,dtype:r,physicalSizes:o}:{labels:A,getShape:i,dtype:r}}function rtA(e){const t=e.fileDirectory.SampleFormat?e.fileDirectory.SampleFormat[0]:1,n=e.fileDirectory.BitsPerSample[0];switch(t){case 1:if(n<=8)return Pn.uint8;if(n<=16)return Pn.uint16;if(n<=32)return Pn.uint32;break;case 2:if(n<=8)return Pn.int8;if(n<=16)return Pn.int16;if(n<=32)return Pn.int32;break;case 3:switch(n){case 16:return Pn.float;case 32:return Pn.float;case 64:return Pn.double}break}throw Error("Unsupported data format/bitsPerSample")}function TG(e){let[A,t,n]=[0,0,0];for(const r of e)A=Math.max(A,r.selection.c),t=Math.max(t,r.selection.z),n=Math.max(n,r.selection.t);const i=e[0].tiff;return{x:i.getWidth(),y:i.getHeight(),z:t+1,c:A+1,t:n+1}}function otA(e,A){const t=Array(A).fill(0);for(const n of e){const i=n.selection.c,r=n.tiff.getSamplesPerPixel(),o=t[i];if(o&&o!=r)throw Error("Channel samples per pixel mismatch");t[i]=r}return t}function stA(e,A){const t=A[0].tiff,n=TG(A),i=[];for(const s of e.toLowerCase())i.unshift(n[s]);const r=uB(e),o=rtA(t);return{shape:i,labels:r,dtype:o}}function atA(e,A,t,n,i,r,o){const s=[];for(let a=0;a({"Acquisition Date":s,"Dimensions (XY)":`${g.x} x ${g.y}`,PixelsType:i,"Z-sections/Timepoints":`${g.z} x ${g.t}`,Channels:g.c})}}function F1(e){const A={},t=e.split("/").pop(),n=t==null?void 0:t.split(".");return n&&(A.name=n.slice(0,-1).join("."),[,A.extension]=n),A}var me;(function(e){e.assertEqual=i=>i;function A(i){}e.assertIs=A;function t(i){throw new Error}e.assertNever=t,e.arrayToEnum=i=>{const r={};for(const o of i)r[o]=o;return r},e.getValidEnumValues=i=>{const r=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of r)o[s]=i[s];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(r){return i[r]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const r=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&r.push(o);return r},e.find=(i,r)=>{for(const o of i)if(r(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,r=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(r)}e.joinValues=n,e.jsonStringifyReplacer=(i,r)=>typeof r=="bigint"?r.toString():r})(me||(me={}));var N1;(function(e){e.mergeShapes=(A,t)=>({...A,...t})})(N1||(N1={}));const fA=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_o=e=>{switch(typeof e){case"undefined":return fA.undefined;case"string":return fA.string;case"number":return isNaN(e)?fA.nan:fA.number;case"boolean":return fA.boolean;case"function":return fA.function;case"bigint":return fA.bigint;case"symbol":return fA.symbol;case"object":return Array.isArray(e)?fA.array:e===null?fA.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?fA.promise:typeof Map<"u"&&e instanceof Map?fA.map:typeof Set<"u"&&e instanceof Set?fA.set:typeof Date<"u"&&e instanceof Date?fA.date:fA.object;default:return fA.unknown}},sA=me.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class mi extends Error{constructor(A){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=A}get errors(){return this.issues}format(A){const t=A||function(r){return r.message},n={_errors:[]},i=r=>{for(const o of r.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let s=n,a=0;for(;at.message){const t={},n=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(A(i))):n.push(A(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}mi.create=e=>new mi(e);const BB=(e,A)=>{let t;switch(e.code){case sA.invalid_type:e.received===fA.undefined?t="Required":t=`Expected ${e.expected}, received ${e.received}`;break;case sA.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(e.expected,me.jsonStringifyReplacer)}`;break;case sA.unrecognized_keys:t=`Unrecognized key(s) in object: ${me.joinValues(e.keys,", ")}`;break;case sA.invalid_union:t="Invalid input";break;case sA.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${me.joinValues(e.options)}`;break;case sA.invalid_enum_value:t=`Invalid enum value. Expected ${me.joinValues(e.options)}, received '${e.received}'`;break;case sA.invalid_arguments:t="Invalid function arguments";break;case sA.invalid_return_type:t="Invalid function return type";break;case sA.invalid_date:t="Invalid date";break;case sA.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(t=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?t=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?t=`Invalid input: must end with "${e.validation.endsWith}"`:me.assertNever(e.validation):e.validation!=="regex"?t=`Invalid ${e.validation}`:t="Invalid";break;case sA.too_small:e.type==="array"?t=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?t=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?t=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?t=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:t="Invalid input";break;case sA.too_big:e.type==="array"?t=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?t=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?t=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?t=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?t=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:t="Invalid input";break;case sA.custom:t="Invalid input";break;case sA.invalid_intersection_types:t="Intersection results could not be merged";break;case sA.not_multiple_of:t=`Number must be a multiple of ${e.multipleOf}`;break;case sA.not_finite:t="Number must be finite";break;default:t=A.defaultError,me.assertNever(e)}return{message:t}};let ItA=BB;function E0(){return ItA}const h0=e=>{const{data:A,path:t,errorMaps:n,issueData:i}=e,r=[...t,...i.path||[]],o={...i,path:r};let s="";const a=n.filter(g=>!!g).slice().reverse();for(const g of a)s=g(o,{data:A,defaultError:s}).message;return{...i,path:r,message:i.message||s}};function yA(e,A){const t=h0({issueData:A,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,E0(),BB].filter(n=>!!n)});e.common.issues.push(t)}class zt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(A,t){const n=[];for(const i of t){if(i.status==="aborted")return te;i.status==="dirty"&&A.dirty(),n.push(i.value)}return{status:A.value,value:n}}static async mergeObjectAsync(A,t){const n=[];for(const i of t)n.push({key:await i.key,value:await i.value});return zt.mergeObjectSync(A,n)}static mergeObjectSync(A,t){const n={};for(const i of t){const{key:r,value:o}=i;if(r.status==="aborted"||o.status==="aborted")return te;r.status==="dirty"&&A.dirty(),o.status==="dirty"&&A.dirty(),r.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[r.value]=o.value)}return{status:A.value,value:n}}}const te=Object.freeze({status:"aborted"}),ltA=e=>({status:"dirty",value:e}),sn=e=>({status:"valid",value:e}),_1=e=>e.status==="aborted",L1=e=>e.status==="dirty",EB=e=>e.status==="valid",f0=e=>typeof Promise<"u"&&e instanceof Promise;var bA;(function(e){e.errToObj=A=>typeof A=="string"?{message:A}:A||{},e.toString=A=>typeof A=="string"?A:A==null?void 0:A.message})(bA||(bA={}));class Di{constructor(A,t,n,i){this._cachedPath=[],this.parent=A,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const b1=(e,A)=>{if(EB(A))return{success:!0,data:A.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new mi(e.common.issues);return this._error=t,this._error}}};function ee(e){if(!e)return{};const{errorMap:A,invalid_type_error:t,required_error:n,description:i}=e;if(A&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return A?{errorMap:A,description:i}:{errorMap:(o,s)=>o.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:n??s.defaultError}:{message:t??s.defaultError},description:i}}class Ce{constructor(A){this.spa=this.safeParseAsync,this._def=A,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(A){return _o(A.data)}_getOrReturnCtx(A,t){return t||{common:A.parent.common,data:A.data,parsedType:_o(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}_processInputParams(A){return{status:new zt,ctx:{common:A.parent.common,data:A.data,parsedType:_o(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}}_parseSync(A){const t=this._parse(A);if(f0(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(A){const t=this._parse(A);return Promise.resolve(t)}parse(A,t){const n=this.safeParse(A,t);if(n.success)return n.data;throw n.error}safeParse(A,t){var n;const i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:_o(A)},r=this._parseSync({data:A,path:i.path,parent:i});return b1(i,r)}async parseAsync(A,t){const n=await this.safeParseAsync(A,t);if(n.success)return n.data;throw n.error}async safeParseAsync(A,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:_o(A)},i=this._parse({data:A,path:n.path,parent:n}),r=await(f0(i)?i:Promise.resolve(i));return b1(n,r)}refine(A,t){const n=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,r)=>{const o=A(i),s=()=>r.addIssue({code:sA.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(a=>a?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(A,t){return this._refinement((n,i)=>A(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(A){return new nr({schema:this,typeName:KA.ZodEffects,effect:{type:"refinement",refinement:A}})}superRefine(A){return this._refinement(A)}optional(){return Or.create(this,this._def)}nullable(){return Ka.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wi.create(this,this._def)}promise(){return Dl.create(this,this._def)}or(A){return dB.create([this,A],this._def)}and(A){return pB.create(this,A,this._def)}transform(A){return new nr({...ee(this._def),schema:this,typeName:KA.ZodEffects,effect:{type:"transform",transform:A}})}default(A){const t=typeof A=="function"?A:()=>A;return new SB({...ee(this._def),innerType:this,defaultValue:t,typeName:KA.ZodDefault})}brand(){return new mtA({typeName:KA.ZodBranded,type:this,...ee(this._def)})}catch(A){const t=typeof A=="function"?A:()=>A;return new w0({...ee(this._def),innerType:this,catchValue:t,typeName:KA.ZodCatch})}describe(A){const t=this.constructor;return new t({...this._def,description:A})}pipe(A){return OE.create(this,A)}readonly(){return S0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ctA=/^c[^\s-]{8,}$/i,CtA=/^[a-z][a-z0-9]*$/,utA=/^[0-9A-HJKMNP-TV-Z]{26}$/,BtA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,EtA=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,htA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Vf;const ftA=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,QtA=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,dtA=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function ptA(e,A){return!!((A==="v4"||!A)&&ftA.test(e)||(A==="v6"||!A)&&QtA.test(e))}class fi extends Ce{_parse(A){if(this._def.coerce&&(A.data=String(A.data)),this._getType(A)!==fA.string){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_type,expected:fA.string,received:r.parsedType}),te}const n=new zt;let i;for(const r of this._def.checks)if(r.kind==="min")A.data.lengthr.value&&(i=this._getOrReturnCtx(A,i),yA(i,{code:sA.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){const o=A.data.length>r.value,s=A.data.lengthA.test(i),{validation:t,code:sA.invalid_string,...bA.errToObj(n)})}_addCheck(A){return new fi({...this._def,checks:[...this._def.checks,A]})}email(A){return this._addCheck({kind:"email",...bA.errToObj(A)})}url(A){return this._addCheck({kind:"url",...bA.errToObj(A)})}emoji(A){return this._addCheck({kind:"emoji",...bA.errToObj(A)})}uuid(A){return this._addCheck({kind:"uuid",...bA.errToObj(A)})}cuid(A){return this._addCheck({kind:"cuid",...bA.errToObj(A)})}cuid2(A){return this._addCheck({kind:"cuid2",...bA.errToObj(A)})}ulid(A){return this._addCheck({kind:"ulid",...bA.errToObj(A)})}ip(A){return this._addCheck({kind:"ip",...bA.errToObj(A)})}datetime(A){var t;return typeof A=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:A}):this._addCheck({kind:"datetime",precision:typeof(A==null?void 0:A.precision)>"u"?null:A==null?void 0:A.precision,offset:(t=A==null?void 0:A.offset)!==null&&t!==void 0?t:!1,...bA.errToObj(A==null?void 0:A.message)})}regex(A,t){return this._addCheck({kind:"regex",regex:A,...bA.errToObj(t)})}includes(A,t){return this._addCheck({kind:"includes",value:A,position:t==null?void 0:t.position,...bA.errToObj(t==null?void 0:t.message)})}startsWith(A,t){return this._addCheck({kind:"startsWith",value:A,...bA.errToObj(t)})}endsWith(A,t){return this._addCheck({kind:"endsWith",value:A,...bA.errToObj(t)})}min(A,t){return this._addCheck({kind:"min",value:A,...bA.errToObj(t)})}max(A,t){return this._addCheck({kind:"max",value:A,...bA.errToObj(t)})}length(A,t){return this._addCheck({kind:"length",value:A,...bA.errToObj(t)})}nonempty(A){return this.min(1,bA.errToObj(A))}trim(){return new fi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new fi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new fi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(A=>A.kind==="datetime")}get isEmail(){return!!this._def.checks.find(A=>A.kind==="email")}get isURL(){return!!this._def.checks.find(A=>A.kind==="url")}get isEmoji(){return!!this._def.checks.find(A=>A.kind==="emoji")}get isUUID(){return!!this._def.checks.find(A=>A.kind==="uuid")}get isCUID(){return!!this._def.checks.find(A=>A.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(A=>A.kind==="cuid2")}get isULID(){return!!this._def.checks.find(A=>A.kind==="ulid")}get isIP(){return!!this._def.checks.find(A=>A.kind==="ip")}get minLength(){let A=null;for(const t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxLength(){let A=null;for(const t of this._def.checks)t.kind==="max"&&(A===null||t.value{var A;return new fi({checks:[],typeName:KA.ZodString,coerce:(A=e==null?void 0:e.coerce)!==null&&A!==void 0?A:!1,...ee(e)})};function ytA(e,A){const t=(e.toString().split(".")[1]||"").length,n=(A.toString().split(".")[1]||"").length,i=t>n?t:n,r=parseInt(e.toFixed(i).replace(".","")),o=parseInt(A.toFixed(i).replace(".",""));return r%o/Math.pow(10,i)}class is extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(A){if(this._def.coerce&&(A.data=Number(A.data)),this._getType(A)!==fA.number){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_type,expected:fA.number,received:r.parsedType}),te}let n;const i=new zt;for(const r of this._def.checks)r.kind==="int"?me.isInteger(A.data)||(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):r.kind==="min"?(r.inclusive?A.datar.value:A.data>=r.value)&&(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):r.kind==="multipleOf"?ytA(A.data,r.value)!==0&&(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):r.kind==="finite"?Number.isFinite(A.data)||(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.not_finite,message:r.message}),i.dirty()):me.assertNever(r);return{status:i.value,value:A.data}}gte(A,t){return this.setLimit("min",A,!0,bA.toString(t))}gt(A,t){return this.setLimit("min",A,!1,bA.toString(t))}lte(A,t){return this.setLimit("max",A,!0,bA.toString(t))}lt(A,t){return this.setLimit("max",A,!1,bA.toString(t))}setLimit(A,t,n,i){return new is({...this._def,checks:[...this._def.checks,{kind:A,value:t,inclusive:n,message:bA.toString(i)}]})}_addCheck(A){return new is({...this._def,checks:[...this._def.checks,A]})}int(A){return this._addCheck({kind:"int",message:bA.toString(A)})}positive(A){return this._addCheck({kind:"min",value:0,inclusive:!1,message:bA.toString(A)})}negative(A){return this._addCheck({kind:"max",value:0,inclusive:!1,message:bA.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:0,inclusive:!0,message:bA.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:0,inclusive:!0,message:bA.toString(A)})}multipleOf(A,t){return this._addCheck({kind:"multipleOf",value:A,message:bA.toString(t)})}finite(A){return this._addCheck({kind:"finite",message:bA.toString(A)})}safe(A){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:bA.toString(A)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:bA.toString(A)})}get minValue(){let A=null;for(const t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxValue(){let A=null;for(const t of this._def.checks)t.kind==="max"&&(A===null||t.valueA.kind==="int"||A.kind==="multipleOf"&&me.isInteger(A.value))}get isFinite(){let A=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(A===null||n.valuenew is({checks:[],typeName:KA.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ee(e)});class rs extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(A){if(this._def.coerce&&(A.data=BigInt(A.data)),this._getType(A)!==fA.bigint){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_type,expected:fA.bigint,received:r.parsedType}),te}let n;const i=new zt;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?A.datar.value:A.data>=r.value)&&(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):r.kind==="multipleOf"?A.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(A,n),yA(n,{code:sA.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):me.assertNever(r);return{status:i.value,value:A.data}}gte(A,t){return this.setLimit("min",A,!0,bA.toString(t))}gt(A,t){return this.setLimit("min",A,!1,bA.toString(t))}lte(A,t){return this.setLimit("max",A,!0,bA.toString(t))}lt(A,t){return this.setLimit("max",A,!1,bA.toString(t))}setLimit(A,t,n,i){return new rs({...this._def,checks:[...this._def.checks,{kind:A,value:t,inclusive:n,message:bA.toString(i)}]})}_addCheck(A){return new rs({...this._def,checks:[...this._def.checks,A]})}positive(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:bA.toString(A)})}negative(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:bA.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:bA.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:bA.toString(A)})}multipleOf(A,t){return this._addCheck({kind:"multipleOf",value:A,message:bA.toString(t)})}get minValue(){let A=null;for(const t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxValue(){let A=null;for(const t of this._def.checks)t.kind==="max"&&(A===null||t.value{var A;return new rs({checks:[],typeName:KA.ZodBigInt,coerce:(A=e==null?void 0:e.coerce)!==null&&A!==void 0?A:!1,...ee(e)})};class hB extends Ce{_parse(A){if(this._def.coerce&&(A.data=!!A.data),this._getType(A)!==fA.boolean){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.boolean,received:n.parsedType}),te}return sn(A.data)}}hB.create=e=>new hB({typeName:KA.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ee(e)});class Oa extends Ce{_parse(A){if(this._def.coerce&&(A.data=new Date(A.data)),this._getType(A)!==fA.date){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_type,expected:fA.date,received:r.parsedType}),te}if(isNaN(A.data.getTime())){const r=this._getOrReturnCtx(A);return yA(r,{code:sA.invalid_date}),te}const n=new zt;let i;for(const r of this._def.checks)r.kind==="min"?A.data.getTime()r.value&&(i=this._getOrReturnCtx(A,i),yA(i,{code:sA.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):me.assertNever(r);return{status:n.value,value:new Date(A.data.getTime())}}_addCheck(A){return new Oa({...this._def,checks:[...this._def.checks,A]})}min(A,t){return this._addCheck({kind:"min",value:A.getTime(),message:bA.toString(t)})}max(A,t){return this._addCheck({kind:"max",value:A.getTime(),message:bA.toString(t)})}get minDate(){let A=null;for(const t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A!=null?new Date(A):null}get maxDate(){let A=null;for(const t of this._def.checks)t.kind==="max"&&(A===null||t.valuenew Oa({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:KA.ZodDate,...ee(e)});class Q0 extends Ce{_parse(A){if(this._getType(A)!==fA.symbol){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.symbol,received:n.parsedType}),te}return sn(A.data)}}Q0.create=e=>new Q0({typeName:KA.ZodSymbol,...ee(e)});class fB extends Ce{_parse(A){if(this._getType(A)!==fA.undefined){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.undefined,received:n.parsedType}),te}return sn(A.data)}}fB.create=e=>new fB({typeName:KA.ZodUndefined,...ee(e)});class QB extends Ce{_parse(A){if(this._getType(A)!==fA.null){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.null,received:n.parsedType}),te}return sn(A.data)}}QB.create=e=>new QB({typeName:KA.ZodNull,...ee(e)});class d0 extends Ce{constructor(){super(...arguments),this._any=!0}_parse(A){return sn(A.data)}}d0.create=e=>new d0({typeName:KA.ZodAny,...ee(e)});class xa extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(A){return sn(A.data)}}xa.create=e=>new xa({typeName:KA.ZodUnknown,...ee(e)});class oo extends Ce{_parse(A){const t=this._getOrReturnCtx(A);return yA(t,{code:sA.invalid_type,expected:fA.never,received:t.parsedType}),te}}oo.create=e=>new oo({typeName:KA.ZodNever,...ee(e)});class p0 extends Ce{_parse(A){if(this._getType(A)!==fA.undefined){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.void,received:n.parsedType}),te}return sn(A.data)}}p0.create=e=>new p0({typeName:KA.ZodVoid,...ee(e)});class wi extends Ce{_parse(A){const{ctx:t,status:n}=this._processInputParams(A),i=this._def;if(t.parsedType!==fA.array)return yA(t,{code:sA.invalid_type,expected:fA.array,received:t.parsedType}),te;if(i.exactLength!==null){const o=t.data.length>i.exactLength.value,s=t.data.lengthi.maxLength.value&&(yA(t,{code:sA.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,s)=>i.type._parseAsync(new Di(t,o,t.path,s)))).then(o=>zt.mergeArray(n,o));const r=[...t.data].map((o,s)=>i.type._parseSync(new Di(t,o,t.path,s)));return zt.mergeArray(n,r)}get element(){return this._def.type}min(A,t){return new wi({...this._def,minLength:{value:A,message:bA.toString(t)}})}max(A,t){return new wi({...this._def,maxLength:{value:A,message:bA.toString(t)}})}length(A,t){return new wi({...this._def,exactLength:{value:A,message:bA.toString(t)}})}nonempty(A){return this.min(1,A)}}wi.create=(e,A)=>new wi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:KA.ZodArray,...ee(A)});function Xs(e){if(e instanceof et){const A={};for(const t in e.shape){const n=e.shape[t];A[t]=Or.create(Xs(n))}return new et({...e._def,shape:()=>A})}else return e instanceof wi?new wi({...e._def,type:Xs(e.element)}):e instanceof Or?Or.create(Xs(e.unwrap())):e instanceof Ka?Ka.create(Xs(e.unwrap())):e instanceof tr?tr.create(e.items.map(A=>Xs(A))):e}class et extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const A=this._def.shape(),t=me.objectKeys(A);return this._cached={shape:A,keys:t}}_parse(A){if(this._getType(A)!==fA.object){const g=this._getOrReturnCtx(A);return yA(g,{code:sA.invalid_type,expected:fA.object,received:g.parsedType}),te}const{status:n,ctx:i}=this._processInputParams(A),{shape:r,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof oo&&this._def.unknownKeys==="strip"))for(const g in i.data)o.includes(g)||s.push(g);const a=[];for(const g of o){const I=r[g],l=i.data[g];a.push({key:{status:"valid",value:g},value:I._parse(new Di(i,l,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof oo){const g=this._def.unknownKeys;if(g==="passthrough")for(const I of s)a.push({key:{status:"valid",value:I},value:{status:"valid",value:i.data[I]}});else if(g==="strict")s.length>0&&(yA(i,{code:sA.unrecognized_keys,keys:s}),n.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const I of s){const l=i.data[I];a.push({key:{status:"valid",value:I},value:g._parse(new Di(i,l,i.path,I)),alwaysSet:I in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const g=[];for(const I of a){const l=await I.key;g.push({key:l,value:await I.value,alwaysSet:I.alwaysSet})}return g}).then(g=>zt.mergeObjectSync(n,g)):zt.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(A){return bA.errToObj,new et({...this._def,unknownKeys:"strict",...A!==void 0?{errorMap:(t,n)=>{var i,r,o,s;const a=(o=(r=(i=this._def).errorMap)===null||r===void 0?void 0:r.call(i,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(s=bA.errToObj(A).message)!==null&&s!==void 0?s:a}:{message:a}}}:{}})}strip(){return new et({...this._def,unknownKeys:"strip"})}passthrough(){return new et({...this._def,unknownKeys:"passthrough"})}extend(A){return new et({...this._def,shape:()=>({...this._def.shape(),...A})})}merge(A){return new et({unknownKeys:A._def.unknownKeys,catchall:A._def.catchall,shape:()=>({...this._def.shape(),...A._def.shape()}),typeName:KA.ZodObject})}setKey(A,t){return this.augment({[A]:t})}catchall(A){return new et({...this._def,catchall:A})}pick(A){const t={};return me.objectKeys(A).forEach(n=>{A[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new et({...this._def,shape:()=>t})}omit(A){const t={};return me.objectKeys(this.shape).forEach(n=>{A[n]||(t[n]=this.shape[n])}),new et({...this._def,shape:()=>t})}deepPartial(){return Xs(this)}partial(A){const t={};return me.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];A&&!A[n]?t[n]=i:t[n]=i.optional()}),new et({...this._def,shape:()=>t})}required(A){const t={};return me.objectKeys(this.shape).forEach(n=>{if(A&&!A[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof Or;)r=r._def.innerType;t[n]=r}}),new et({...this._def,shape:()=>t})}keyof(){return UG(me.objectKeys(this.shape))}}et.create=(e,A)=>new et({shape:()=>e,unknownKeys:"strip",catchall:oo.create(),typeName:KA.ZodObject,...ee(A)});et.strictCreate=(e,A)=>new et({shape:()=>e,unknownKeys:"strict",catchall:oo.create(),typeName:KA.ZodObject,...ee(A)});et.lazycreate=(e,A)=>new et({shape:e,unknownKeys:"strip",catchall:oo.create(),typeName:KA.ZodObject,...ee(A)});class dB extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A),n=this._def.options;function i(r){for(const s of r)if(s.result.status==="valid")return s.result;for(const s of r)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;const o=r.map(s=>new mi(s.ctx.common.issues));return yA(t,{code:sA.invalid_union,unionErrors:o}),te}if(t.common.async)return Promise.all(n.map(async r=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let r;const o=[];for(const a of n){const g={...t,common:{...t.common,issues:[]},parent:null},I=a._parseSync({data:t.data,path:t.path,parent:g});if(I.status==="valid")return I;I.status==="dirty"&&!r&&(r={result:I,ctx:g}),g.common.issues.length&&o.push(g.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const s=o.map(a=>new mi(a));return yA(t,{code:sA.invalid_union,unionErrors:s}),te}}get options(){return this._def.options}}dB.create=(e,A)=>new dB({options:e,typeName:KA.ZodUnion,...ee(A)});const lu=e=>e instanceof mB?lu(e.schema):e instanceof nr?lu(e.innerType()):e instanceof wB?[e.value]:e instanceof os?e.options:e instanceof vB?Object.keys(e.enum):e instanceof SB?lu(e._def.innerType):e instanceof fB?[void 0]:e instanceof QB?[null]:null;class vm extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A);if(t.parsedType!==fA.object)return yA(t,{code:sA.invalid_type,expected:fA.object,received:t.parsedType}),te;const n=this.discriminator,i=t.data[n],r=this.optionsMap.get(i);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(yA(t,{code:sA.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),te)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(A,t,n){const i=new Map;for(const r of t){const o=lu(r.shape[A]);if(!o)throw new Error(`A discriminator value for key \`${A}\` could not be extracted from all schema options`);for(const s of o){if(i.has(s))throw new Error(`Discriminator property ${String(A)} has duplicate value ${String(s)}`);i.set(s,r)}}return new vm({typeName:KA.ZodDiscriminatedUnion,discriminator:A,options:t,optionsMap:i,...ee(n)})}}function y0(e,A){const t=_o(e),n=_o(A);if(e===A)return{valid:!0,data:e};if(t===fA.object&&n===fA.object){const i=me.objectKeys(A),r=me.objectKeys(e).filter(s=>i.indexOf(s)!==-1),o={...e,...A};for(const s of r){const a=y0(e[s],A[s]);if(!a.valid)return{valid:!1};o[s]=a.data}return{valid:!0,data:o}}else if(t===fA.array&&n===fA.array){if(e.length!==A.length)return{valid:!1};const i=[];for(let r=0;r{if(_1(r)||_1(o))return te;const s=y0(r.value,o.value);return s.valid?((L1(r)||L1(o))&&t.dirty(),{status:t.value,value:s.data}):(yA(n,{code:sA.invalid_intersection_types}),te)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,o])=>i(r,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}pB.create=(e,A,t)=>new pB({left:e,right:A,typeName:KA.ZodIntersection,...ee(t)});class tr extends Ce{_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==fA.array)return yA(n,{code:sA.invalid_type,expected:fA.array,received:n.parsedType}),te;if(n.data.lengththis._def.items.length&&(yA(n,{code:sA.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((o,s)=>{const a=this._def.items[s]||this._def.rest;return a?a._parse(new Di(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(r).then(o=>zt.mergeArray(t,o)):zt.mergeArray(t,r)}get items(){return this._def.items}rest(A){return new tr({...this._def,rest:A})}}tr.create=(e,A)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tr({items:e,typeName:KA.ZodTuple,rest:null,...ee(A)})};class yB extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==fA.object)return yA(n,{code:sA.invalid_type,expected:fA.object,received:n.parsedType}),te;const i=[],r=this._def.keyType,o=this._def.valueType;for(const s in n.data)i.push({key:r._parse(new Di(n,s,n.path,s)),value:o._parse(new Di(n,n.data[s],n.path,s))});return n.common.async?zt.mergeObjectAsync(t,i):zt.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(A,t,n){return t instanceof Ce?new yB({keyType:A,valueType:t,typeName:KA.ZodRecord,...ee(n)}):new yB({keyType:fi.create(),valueType:A,typeName:KA.ZodRecord,...ee(t)})}}class m0 extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==fA.map)return yA(n,{code:sA.invalid_type,expected:fA.map,received:n.parsedType}),te;const i=this._def.keyType,r=this._def.valueType,o=[...n.data.entries()].map(([s,a],g)=>({key:i._parse(new Di(n,s,n.path,[g,"key"])),value:r._parse(new Di(n,a,n.path,[g,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const a of o){const g=await a.key,I=await a.value;if(g.status==="aborted"||I.status==="aborted")return te;(g.status==="dirty"||I.status==="dirty")&&t.dirty(),s.set(g.value,I.value)}return{status:t.value,value:s}})}else{const s=new Map;for(const a of o){const g=a.key,I=a.value;if(g.status==="aborted"||I.status==="aborted")return te;(g.status==="dirty"||I.status==="dirty")&&t.dirty(),s.set(g.value,I.value)}return{status:t.value,value:s}}}}m0.create=(e,A,t)=>new m0({valueType:A,keyType:e,typeName:KA.ZodMap,...ee(t)});class Ya extends Ce{_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==fA.set)return yA(n,{code:sA.invalid_type,expected:fA.set,received:n.parsedType}),te;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(yA(n,{code:sA.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const r=this._def.valueType;function o(a){const g=new Set;for(const I of a){if(I.status==="aborted")return te;I.status==="dirty"&&t.dirty(),g.add(I.value)}return{status:t.value,value:g}}const s=[...n.data.values()].map((a,g)=>r._parse(new Di(n,a,n.path,g)));return n.common.async?Promise.all(s).then(a=>o(a)):o(s)}min(A,t){return new Ya({...this._def,minSize:{value:A,message:bA.toString(t)}})}max(A,t){return new Ya({...this._def,maxSize:{value:A,message:bA.toString(t)}})}size(A,t){return this.min(A,t).max(A,t)}nonempty(A){return this.min(1,A)}}Ya.create=(e,A)=>new Ya({valueType:e,minSize:null,maxSize:null,typeName:KA.ZodSet,...ee(A)});class qI extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(A){const{ctx:t}=this._processInputParams(A);if(t.parsedType!==fA.function)return yA(t,{code:sA.invalid_type,expected:fA.function,received:t.parsedType}),te;function n(s,a){return h0({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,E0(),BB].filter(g=>!!g),issueData:{code:sA.invalid_arguments,argumentsError:a}})}function i(s,a){return h0({data:s,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,E0(),BB].filter(g=>!!g),issueData:{code:sA.invalid_return_type,returnTypeError:a}})}const r={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Dl){const s=this;return sn(async function(...a){const g=new mi([]),I=await s._def.args.parseAsync(a,r).catch(C=>{throw g.addIssue(n(a,C)),g}),l=await Reflect.apply(o,this,I);return await s._def.returns._def.type.parseAsync(l,r).catch(C=>{throw g.addIssue(i(l,C)),g})})}else{const s=this;return sn(function(...a){const g=s._def.args.safeParse(a,r);if(!g.success)throw new mi([n(a,g.error)]);const I=Reflect.apply(o,this,g.data),l=s._def.returns.safeParse(I,r);if(!l.success)throw new mi([i(I,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...A){return new qI({...this._def,args:tr.create(A).rest(xa.create())})}returns(A){return new qI({...this._def,returns:A})}implement(A){return this.parse(A)}strictImplement(A){return this.parse(A)}static create(A,t,n){return new qI({args:A||tr.create([]).rest(xa.create()),returns:t||xa.create(),typeName:KA.ZodFunction,...ee(n)})}}class mB extends Ce{get schema(){return this._def.getter()}_parse(A){const{ctx:t}=this._processInputParams(A);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}mB.create=(e,A)=>new mB({getter:e,typeName:KA.ZodLazy,...ee(A)});class wB extends Ce{_parse(A){if(A.data!==this._def.value){const t=this._getOrReturnCtx(A);return yA(t,{received:t.data,code:sA.invalid_literal,expected:this._def.value}),te}return{status:"valid",value:A.data}}get value(){return this._def.value}}wB.create=(e,A)=>new wB({value:e,typeName:KA.ZodLiteral,...ee(A)});function UG(e,A){return new os({values:e,typeName:KA.ZodEnum,...ee(A)})}class os extends Ce{_parse(A){if(typeof A.data!="string"){const t=this._getOrReturnCtx(A),n=this._def.values;return yA(t,{expected:me.joinValues(n),received:t.parsedType,code:sA.invalid_type}),te}if(this._def.values.indexOf(A.data)===-1){const t=this._getOrReturnCtx(A),n=this._def.values;return yA(t,{received:t.data,code:sA.invalid_enum_value,options:n}),te}return sn(A.data)}get options(){return this._def.values}get enum(){const A={};for(const t of this._def.values)A[t]=t;return A}get Values(){const A={};for(const t of this._def.values)A[t]=t;return A}get Enum(){const A={};for(const t of this._def.values)A[t]=t;return A}extract(A){return os.create(A)}exclude(A){return os.create(this.options.filter(t=>!A.includes(t)))}}os.create=UG;class vB extends Ce{_parse(A){const t=me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(A);if(n.parsedType!==fA.string&&n.parsedType!==fA.number){const i=me.objectValues(t);return yA(n,{expected:me.joinValues(i),received:n.parsedType,code:sA.invalid_type}),te}if(t.indexOf(A.data)===-1){const i=me.objectValues(t);return yA(n,{received:n.data,code:sA.invalid_enum_value,options:i}),te}return sn(A.data)}get enum(){return this._def.values}}vB.create=(e,A)=>new vB({values:e,typeName:KA.ZodNativeEnum,...ee(A)});class Dl extends Ce{unwrap(){return this._def.type}_parse(A){const{ctx:t}=this._processInputParams(A);if(t.parsedType!==fA.promise&&t.common.async===!1)return yA(t,{code:sA.invalid_type,expected:fA.promise,received:t.parsedType}),te;const n=t.parsedType===fA.promise?t.data:Promise.resolve(t.data);return sn(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Dl.create=(e,A)=>new Dl({type:e,typeName:KA.ZodPromise,...ee(A)});class nr extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===KA.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(A){const{status:t,ctx:n}=this._processInputParams(A),i=this._def.effect||null,r={addIssue:o=>{yA(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),i.type==="preprocess"){const o=i.transform(n.data,r);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(s=>this._def.schema._parseAsync({data:s,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=s=>{const a=i.refinement(s,r);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?te:(s.status==="dirty"&&t.dirty(),o(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?te:(s.status==="dirty"&&t.dirty(),o(s.value).then(()=>({status:t.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!EB(o))return o;const s=i.transform(o.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>EB(o)?Promise.resolve(i.transform(o.value,r)).then(s=>({status:t.value,value:s})):o);me.assertNever(i)}}nr.create=(e,A,t)=>new nr({schema:e,typeName:KA.ZodEffects,effect:A,...ee(t)});nr.createWithPreprocess=(e,A,t)=>new nr({schema:A,effect:{type:"preprocess",transform:e},typeName:KA.ZodEffects,...ee(t)});class Or extends Ce{_parse(A){return this._getType(A)===fA.undefined?sn(void 0):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}}Or.create=(e,A)=>new Or({innerType:e,typeName:KA.ZodOptional,...ee(A)});class Ka extends Ce{_parse(A){return this._getType(A)===fA.null?sn(null):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}}Ka.create=(e,A)=>new Ka({innerType:e,typeName:KA.ZodNullable,...ee(A)});class SB extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A);let n=t.data;return t.parsedType===fA.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}SB.create=(e,A)=>new SB({innerType:e,typeName:KA.ZodDefault,defaultValue:typeof A.default=="function"?A.default:()=>A.default,...ee(A)});class w0 extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return f0(i)?i.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new mi(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new mi(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}w0.create=(e,A)=>new w0({innerType:e,typeName:KA.ZodCatch,catchValue:typeof A.catch=="function"?A.catch:()=>A.catch,...ee(A)});class v0 extends Ce{_parse(A){if(this._getType(A)!==fA.nan){const n=this._getOrReturnCtx(A);return yA(n,{code:sA.invalid_type,expected:fA.nan,received:n.parsedType}),te}return{status:"valid",value:A.data}}}v0.create=e=>new v0({typeName:KA.ZodNaN,...ee(e)});class mtA extends Ce{_parse(A){const{ctx:t}=this._processInputParams(A),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class OE extends Ce{_parse(A){const{status:t,ctx:n}=this._processInputParams(A);if(n.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?te:r.status==="dirty"?(t.dirty(),ltA(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?te:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(A,t){return new OE({in:A,out:t,typeName:KA.ZodPipeline})}}class S0 extends Ce{_parse(A){const t=this._def.innerType._parse(A);return EB(t)&&(t.value=Object.freeze(t.value)),t}}S0.create=(e,A)=>new S0({innerType:e,typeName:KA.ZodReadonly,...ee(A)});et.lazycreate;var KA;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(KA||(KA={}));const un=fi.create;is.create;v0.create;rs.create;hB.create;Oa.create;Q0.create;fB.create;QB.create;d0.create;xa.create;oo.create;p0.create;wi.create;const _n=et.create;et.strictCreate;dB.create;vm.create;pB.create;tr.create;yB.create;m0.create;Ya.create;qI.create;mB.create;wB.create;const Sm=os.create;vB.create;Dl.create;nr.create;Or.create;Ka.create;const D0=nr.createWithPreprocess;OE.create;const bt={string:e=>fi.create({...e,coerce:!0}),number:e=>is.create({...e,coerce:!0}),boolean:e=>hB.create({...e,coerce:!0}),bigint:e=>rs.create({...e,coerce:!0}),date:e=>Oa.create({...e,coerce:!0})};function ug({attr:e,...A}){return{...e,...A}}const wtA=Sm(["XYZCT","XYZTC","XYCTZ","XYCZT","XYTCZ","XYTZC"]),vtA=Sm(["int8","int16","int32","uint8","uint16","uint32","float","bit","double","complex","double-complex"]),Wf=Sm(["Ym","Zm","Em","Pm","Tm","Gm","Mm","km","hm","dam","m","dm","cm","mm","µm","nm","pm","fm","am","zm","ym","Ã…","thou","li","in","ft","yd","mi","ua","ly","pc","pt","pixel","reference frame"]),StA=_n({}).extend({attr:_n({ID:un(),SamplesPerPixel:bt.number().optional(),Name:un().optional(),Color:bt.number().transform($eA).optional()})}).transform(ug),DtA=_n({}).extend({attr:_n({FileName:un()})}).transform(ug),RtA=_n({UUID:DtA.optional()}).extend({attr:_n({IFD:bt.number(),PlaneCount:bt.number(),FirstT:bt.number().optional(),FirstC:bt.number().optional(),FirstZ:bt.number().optional()})}).transform(ug),xtA=_n({Channel:D0(B0,StA.array()),TiffData:D0(B0,RtA.array()).optional()}).extend({attr:_n({ID:un(),DimensionOrder:wtA,Type:vtA,SizeT:bt.number(),SizeC:bt.number(),SizeZ:bt.number(),SizeY:bt.number(),SizeX:bt.number(),PhysicalSizeX:bt.number().optional(),PhysicalSizeY:bt.number().optional(),PhysicalSizeZ:bt.number().optional(),SignificantBits:bt.number().optional(),PhysicalSizeXUnit:Wf.optional(),PhysicalSizeYUnit:Wf.optional(),PhysicalSizeZUnit:Wf.optional(),BigEndian:un().transform(e=>e.toLowerCase()==="true").optional(),Interleaved:un().transform(e=>e.toLowerCase()==="true").optional()})}).transform(ug).transform(({Channel:e,...A})=>({Channels:e,...A})),FtA=_n({AquisitionDate:un().optional().default(""),Description:un().optional().default(""),Pixels:xtA}).extend({attr:_n({ID:un(),Name:un().optional()})}).transform(ug),NtA=_n({Image:D0(B0,FtA.array())}).extend({attr:_n({xmlns:un(),"xmlns:xsi":un(),"xsi:schemaLocation":un()})}).transform(ug);function PG(e){const A=ttA(e);return NtA.parse(A).Image.map(t=>({...t,format(){const n=["X","Y","Z"].map(i=>{const r=t.Pixels[`PhysicalSize${i}`],o=t.Pixels[`PhysicalSize${i}Unit`];return r&&o?`${r} ${o}`:"-"}).join(" x ");return{"Acquisition Date":t.AquisitionDate,"Dimensions (XY)":`${t.Pixels.SizeX} x ${t.Pixels.SizeY}`,"Pixels Type":t.Pixels.Type,"Pixels Size (XYZ)":n,"Z-sections/Timepoints":`${t.Pixels.SizeZ} x ${t.Pixels.SizeT}`,Channels:t.Pixels.SizeC}}}))}class HG{constructor(A,t,n,i,r,o,s){mo(this,"_indexer");this.dtype=t,this.tileSize=n,this.shape=i,this.labels=r,this.meta=o,this.pool=s,this._indexer=A}async getRaster({selection:A,signal:t}){const n=await this._indexer(A);return this._readRasters(n,{signal:t})}async getTile({x:A,y:t,selection:n,signal:i}){const{height:r,width:o}=this._getTileExtent(A,t),s=A*this.tileSize,a=t*this.tileSize,g=[s,a,s+o,a+r],I=await this._indexer(n);return this._readRasters(I,{window:g,width:o,height:r,signal:i})}async _readRasters(A,t){var o;const n=ro(this.shape),i=await A.readRasters({interleave:n,...t,pool:this.pool});if((o=t==null?void 0:t.signal)!=null&&o.aborted)throw wm;return{data:n?i:i[0],width:i.width,height:i.height}}_getTileExtent(A,t){const{height:n,width:i}=ho(this);let r=this.tileSize,o=this.tileSize;const s=Math.floor(i/this.tileSize),a=Math.floor(n/this.tileSize);return A===s&&(o=i%this.tileSize),t===a&&(r=n%this.tileSize),{height:r,width:o}}onTileError(A){console.error(A)}}function _tA(e,A){const{SizeT:t,SizeC:n,SizeZ:i}=A[0].Pixels,r=qG(A,0);return(o,s)=>{const a=r(o),g=s*i*t*n;return e.getImage(a+g)}}function LtA(e,A,t=0){const n=qG(A,t),i=new Map;return async(r,o)=>{const s=n(r),a=await e.getImage(s);if(o===0)return a;const{SubIFDs:g}=a.fileDirectory;if(!g)throw Error("Indexing Error: OME-TIFF is missing SubIFDs.");const I=`${r.t}-${r.c}-${r.z}-${o}`;if(!i.has(I)){const c=g[o-1];i.set(I,e.parseFileDirectoryAt(c))}const l=await i.get(I);return new xG(l.fileDirectory,l.geoKeyDirectory,a.dataView,e.littleEndian,e.cache,e.source)}}function qG(e,A=0){const{SizeC:t,SizeZ:n,SizeT:i,DimensionOrder:r}=e[A].Pixels;let o=0;if(A>0)for(let s=0;so+s*n*t+a*n+g;case"XYZTC":return({t:s,c:a,z:g})=>o+a*n*i+s*n+g;case"XYCTZ":return({t:s,c:a,z:g})=>o+g*t*i+s*t+a;case"XYCZT":return({t:s,c:a,z:g})=>o+s*t*n+g*t+a;case"XYTCZ":return({t:s,c:a,z:g})=>o+g*i*t+a*i+s;case"XYTZC":return({t:s,c:a,z:g})=>o+a*i*n+g*i+s;default:throw new Error(`Invalid OME-XML DimensionOrder, got ${r}.`)}}function btA(e){function A({c:n=0,t:i=0,z:r=0}){return`${n}-${i}-${r}`}const t=new Map(e.map(({selection:n,tiff:i})=>[A(n),i]));return async n=>{const i=A(n),r=t.get(i);if(!r)throw new Error(`No image available for selection ${i}`);return r}}function GtA(e,A,t,n){return t?LtA(e,A,n):_tA(e,A)}async function ktA(e,A){const t=await e.getImage(0),{ImageDescription:n,SubIFDs:i,PhotometricInterpretation:r}=t.fileDirectory,o=PG(n);let s=o,a;i?a=i.length+1:(a=o.length,s=[o[0]]);const g=(I,l,c)=>{const{labels:C,getShape:u,physicalSizes:E,dtype:B}=itA(c),h=kG(t),f={photometricInterpretation:r,physicalSizes:E},Q=u(I),d=m=>l(m,I);return new HG(d,B,h,Q,C,f,A)};return s.map((I,l)=>{const c=GtA(e,o,i,l);return{data:Array.from({length:a}).map((u,E)=>g(E,c,I)),metadata:I}})}function MtA(e){const A=e[0].tiff.getWidth(),t=e[0].tiff.getHeight();for(const n of e)if(n.tiff.getWidth()!==A||n.tiff.getHeight()!==t)throw new Error("All images must have the same width and height")}async function TtA(e,A){for(let t=0;t<=Math.max(...e.map(n=>n.selection.t));t+=1)for(let n=0;n<=Math.max(...e.map(i=>i.selection.c));n+=1)for(let i=0;i<=Math.max(...e.map(r=>r.selection.z));i+=1)await A({t,c:n,z:i})}async function UtA(e,A,t,n){MtA(A);const i=A[0].tiff,{PhotometricInterpretation:r}=i.fileDirectory,o="XYZCT",s=kG(i),a={photometricInterpretation:r},g=btA(A),{shape:I,labels:l,dtype:c}=stA(o,A),C=gtA(e,A,t,o,c);return await TtA(A,g),{data:[new HG(g,c,s,I,l,a,n)],metadata:C}}gr(5,()=>XeA);const DB="file://";async function G1(e,A={}){const{headers:t={},offsets:n,pool:i,images:r="first"}=A;let o;typeof e=="string"?e.startsWith(DB)?o=await NG(e.slice(DB.length)):o=await qE(e,{headers:t,cacheSize:1/0}):o=await JE(e),n&&(o=KeA(o,n)),OeA(o);const s=await ktA(o,i);return r==="all"?s:s[0]}function k1(e,A,t){return t.length===1?e:e+`_${A.toString()}`}async function PtA(e,A={}){var s;const{pool:t,headers:n={},name:i="MultiTiff"}=A,r=[],o=[];for(const a of e){const[g,I]=a,l=Array.isArray(g)?g:[g];if(typeof I=="string"){const c=F1(I),C=(s=c.extension)==null?void 0:s.toLowerCase();if(C==="tif"||C==="tiff"){const u=c.name;if(u){let E;I.startsWith(DB)?E=await NG(I.slice(DB.length)):E=await qE(I,{headers:n,cacheSize:1/0});for(let B=0;B0)return UtA(i,r,A.channelNames||o,t);throw new Error("Unable to load image from provided TiffFolder source.")}const R0=new Map;function Dm(e,A){R0.set(e,A)}async function HtA(e){if(!R0.has(e.id))throw new Error(`Compression codec ${e.id} is not supported by Zarr.js yet.`);return(await R0.get(e.id)()).fromConfig(e)}function Rm(e){return new Proxy(e,{set(A,t,n,i){return A.setItem(t,n)},get(A,t,n){return A.getItem(t)},deleteProperty(A,t){return A.deleteItem(t)},has(A,t){return A.containsItem(t)}})}function qtA(e){return typeof e=="object"&&e!==null&&"__zarr__"in e}function zf(e){return qtA(e)&&e.__zarr__==="KeyError"}class Yr extends Error{constructor(A){super(`path ${A} contains an array`),this.__zarr__="ContainsArrayError",Object.setPrototypeOf(this,Yr.prototype)}}class Bg extends Error{constructor(A){super(`path ${A} contains a group`),this.__zarr__="ContainsGroupError",Object.setPrototypeOf(this,Bg.prototype)}}class YE extends Error{constructor(A){super(`group not found at path ${A}`),this.__zarr__="GroupNotFoundError",Object.setPrototypeOf(this,YE.prototype)}}class Jt extends Error{constructor(A){super(A),this.__zarr__="PermissionError",Object.setPrototypeOf(this,Jt.prototype)}}class Eg extends Error{constructor(A){super(`key ${A} not present`),this.__zarr__="KeyError",Object.setPrototypeOf(this,Eg.prototype)}}class xm extends RangeError{constructor(A,t){super(`too many indices for array; expected ${t.length}, got ${A.length}`),this.__zarr__="TooManyIndicesError",Object.setPrototypeOf(this,xm.prototype)}}let x0=class JG extends RangeError{constructor(A){super(A),this.__zarr__="BoundsCheckError",Object.setPrototypeOf(this,JG.prototype)}};class RB extends RangeError{constructor(A,t,n,i){super(`slice arguments slice(${A}, ${t}, ${n}) invalid: ${i}`),this.__zarr__="InvalidSliceError",Object.setPrototypeOf(this,RB.prototype)}}class Fm extends Error{constructor(){super("Negative step size is not supported when indexing."),this.__zarr__="NegativeStepError",Object.setPrototypeOf(this,Fm.prototype)}}class hn extends Error{constructor(A){super(A),this.__zarr__="ValueError",Object.setPrototypeOf(this,hn.prototype)}}class Nm extends Error{constructor(A){super(A),this.__zarr__="HTTPError",Object.setPrototypeOf(this,Nm.prototype)}}function ss(e,A=void 0,t=null){if(e===void 0)throw new RB(e,A,t,"The first argument must not be undefined");if(typeof e=="string"&&e!==":"||typeof A=="string"&&A!==":")throw new RB(e,A,t,'Arguments can only be integers, ":" or null');return A===void 0&&(A=e,e=null),{start:e===":"?null:e,stop:A===":"?null:A,step:t,_slice:!0}}function JtA(e,A,t,n){if(e<0?(e+=n,e<0&&(e=t<0?-1:0)):e>=n&&(e=t<0?n-1:n),A<0?(A+=n,A<0&&(A=t<0?-1:0)):A>=n&&(A=t<0?n-1:n),t<0){if(AA.length)throw new xm(e,A)}function as(e,A){const t=[],n=[];for(let i=0;i1)throw new RangeError("an index can only have a single ellipsis ('...')");if(n===1){const i=t,r=e.length-(i+1),o=e.length-1;if(o>=A.length)e=e.filter(s=>s!=="...");else{const s=A.length-o;let a=e.slice(0,i).concat(new Array(s).fill(null));r>0&&(a=a.concat(e.slice(e.length-r))),e=a}}if(e.length=A||e<0)throw new x0(`index out of bounds for dimension with length ${A}`);return e}function KtA(e){return typeof e=="number"}function KG(e){if(!Array.isArray(e))return!1;for(const A of e)if(typeof A!="number")return!1;return!0}function Lm(e){return e!==null&&e._slice===!0}function VtA(e){return Lm(e)&&(e.step===null||e.step===1)}function WtA(e){e=YG(e);for(let A=0;An()),t=A.map(n=>n.next());for(let n=0;;){if(t[n].done){if(A[n]=e[n](),t[n]=A[n].next(),++n>=A.length)return}else yield t.map(({value:i})=>i),n=0;t[n]=A[n].next()}}class M1{constructor(A,t){A=so(A,t.shape),this.dimIndexers=[];const n=t.shape;for(let i=0;i()=>n.iter()),t=ztA(...A);for(const n of t){const i=[],r=[],o=[];for(const s of n)i.push(s.dimChunkIndex),r.push(s.dimChunkSelection),s.dimOutSelection!==null&&o.push(s.dimOutSelection);yield{chunkCoords:i,chunkSelection:r,outSelection:o}}}}class jtA{constructor(A,t,n){A=_m(A,t),this.dimSelection=A,this.dimLength=t,this.dimChunkLength=n,this.numItems=1}*iter(){const A=Math.floor(this.dimSelection/this.dimChunkLength),t=A*this.dimChunkLength,n=this.dimSelection-t;yield{dimChunkIndex:A,dimChunkSelection:n,dimOutSelection:null}}}class T1{constructor(A,t,n){const[i,r,o]=OG(A,t);if(this.start=i,this.stop=r,this.step=o,this.step<1)throw new Fm;this.dimLength=t,this.dimChunkLength=n,this.numItems=Math.max(0,Math.ceil((this.stop-this.start)/this.step)),this.numChunks=Math.ceil(this.dimLength/this.dimChunkLength)}*iter(){const A=Math.floor(this.start/this.dimChunkLength),t=Math.ceil(this.stop/this.dimChunkLength);for(let n=A;n0&&(s+=this.step-C),g=Math.ceil((i-this.start)/this.step)}else s=this.start-i,g=0;this.stop>r?a=o:a=this.stop-i;const I=ss(s,a,this.step),l=Math.ceil((a-s)/this.step),c=ss(g,g+l);yield{dimChunkIndex:n,dimChunkSelection:I,dimOutSelection:c}}}}const hg=typeof process<"u"&&process.versions&&process.versions.node;function U1(){}function Wn(e){if(e===null)return"";for(e instanceof String&&(e=e.valueOf()),e=e.replace(/\\/g,"/");e.length>0&&e[0]==="/";)e=e.slice(1);for(;e.length>0&&e[e.length-1]==="/";)e=e.slice(0,e.length-1);e=e.replace(/\/\/+/g,"/");const A=e.split("/");for(const t of A)if(t==="."||t==="..")throw Error("path containing '.' or '..' segment not allowed");return e}function bm(e){return typeof e=="number"&&(e=[e]),e.map(A=>Math.floor(A))}function XtA(e,A){if(e===null||e===!0)throw new Error("Chunk guessing is not supported yet");return e===!1?A:(typeof e=="number"&&(e=[e]),e.lengtht===-1||t===null?A[n]:Math.floor(t)))}function ZtA(e){return e=e.toUpperCase(),e}function P1(e,A){if(e===null)return!0;Array.isArray(e)||(e=[e]);for(let t=0;t=0;i--)t[i]=n,n*=e[i];return t}function jf(e,A){const t=typeof e=="string"?new URL(e):e;t.pathname.endsWith("/")||(t.pathname+="/");const n=new URL(A,t);return n.search=t.search,n.href}function VG(e){const A=e.BYTES_PER_ELEMENT;if(A===1)return;if(hg){const o=Buffer.from(e.buffer,e.byteOffset,e.length*A);A===2&&o.swap16(),A===4&&o.swap32(),A===8&&o.swap64();return}const t=new Uint8Array(e.buffer,e.byteOffset,e.length*A),n=A/2,i=A-1;let r;for(let o=0;os*a),r=t.map((s,a)=>a+1===n?1:t.slice(a+1).reduce((g,I)=>g*I,1)),o=Array(n).fill(0);for(let s=0;s0?e+"/":""}async function zG(e,A,t,n){if(A.length===0)return;const i=A.split("/");let r="";for(const o of i.slice(0,i.length-1))r+=o,await ji(e,r)?await F0(e,r,n):await vi(e,r)||await F0(e,r),r+="/"}async function F0(e,A=null,t=!1){if(A=Wn(A),t)throw Error("Group overwriting not implemented yet :(");if(await ji(e,A))throw new Yr(A);if(await vi(e,A))throw new Bg(A);const n={zarr_format:2},i=ao(A)+km;await e.setItem(i,JSON.stringify(n))}async function JI(e,A=null,t=null,n=!1){A=Wn(A),await zG(e,A,t,n),await F0(e,A,n)}async function anA(e,A,t,n,i,r,o,s,a,g,I,l){if(a)throw Error("Array overwriting not implemented yet :(");if(await ji(e,i))throw new Yr(i);if(await vi(e,i))throw new Bg(i);if(n=n,A=bm(A),t=XtA(t,A),s=ZtA(s),o=o,I!==null&&I.length>0)throw Error("Filters are not supported yet");let c=o;typeof o=="number"&&(Number.isNaN(o)&&(c="NaN"),Number.POSITIVE_INFINITY===o&&(c="Infinity"),Number.NEGATIVE_INFINITY===o&&(c="-Infinity")),I=null;const C={zarr_format:2,shape:A,chunks:t,dtype:n,fill_value:c,order:s,compressor:r,filters:I};l&&(C.dimension_separator=l);const u=ao(i)+xB;await e.setItem(u,JSON.stringify(C))}async function gnA(e,A,t,n,i=null,r=null,o=null,s="C",a=!1,g=null,I=null,l){i=Wn(i),await zG(e,i,g,a),await anA(e,A,t,n,i,r,o,s,a,g,I,l)}function FB(e){if(typeof e!="string"){if(hg&&Buffer.isBuffer(e))return JSON.parse(e.toString());if(Gm(e)){const A=new TextDecoder,t=new Uint8Array(e);return JSON.parse(A.decode(t))}else return e}return JSON.parse(e)}class jG{constructor(A,t,n,i=!0){this.store=A,this.key=t,this.readOnly=n,this.cache=i,this.cachedValue=null}async asObject(){if(this.cache&&this.cachedValue!==null)return this.cachedValue;const A=await this.getNoSync();return this.cache&&(this.cachedValue=A),A}async getNoSync(){try{const A=await this.store.getItem(this.key);return FB(A)}catch{return{}}}async setNoSync(A,t){const n=await this.getNoSync();return n[A]=t,await this.putNoSync(n),!0}async putNoSync(A){await this.store.setItem(this.key,JSON.stringify(A)),this.cache&&(this.cachedValue=A)}async delNoSync(A){const t=await this.getNoSync();return delete t[A],await this.putNoSync(t),!0}async put(A){if(this.readOnly)throw new Jt("attributes are read-only");return this.putNoSync(A)}async setItem(A,t){if(this.readOnly)throw new Jt("attributes are read-only");return this.setNoSync(A,t)}async getItem(A){return(await this.asObject())[A]}async deleteItem(A){if(this.readOnly)throw new Jt("attributes are read-only");return this.delNoSync(A)}async containsItem(A){return(await this.asObject())[A]!==void 0}proxy(){return Rm(this)}}const H1=globalThis.Float16Array,InA={"|b":Int8Array,"|b1":Uint8Array,"|B":Uint8Array,"|u1":Uint8Array,"|i1":Int8Array,"b":Int8Array,">B":Uint8Array,">u1":Uint8Array,">i1":Int8Array,">u2":Uint16Array,">i2":Int16Array,">u4":Uint32Array,">i4":Int32Array,">f4":Float32Array,">f2":H1,">f8":Float64Array};function Qi(e){const A=InA[e];if(!A)throw e.slice(1)==="f2"?Error(`'${e}' is not supported natively in zarr.js. In order to access this dataset you must make Float16Array available as a global. See https://github.com/gzuidhof/zarr.js/issues/127`):Error(`Dtype not recognized or not supported in zarr.js, got ${e}.`);return A}function XG(e){if(e instanceof Uint8Array)return"|u1";if(e instanceof Int8Array)return"|i1";if(e instanceof Uint16Array)return"0&&typeof a[0]=="number"&&(a=e[0].constructor.from(a)),a}function cnA(e,A,t,n){const i=so(n,t,!0),[r,o]=as(i,t);Tm(e,A,t,r)}function CnA(e,A,t,n,i){const r=so(i,t,!1),[o,s]=as(r,t);if(JSON.stringify(s)!==JSON.stringify(n))throw new hn(`Shape mismatch in target and source NestedArray: ${s} and ${n}`);_0(e,A,t,o)}function _0(e,A,t,n){const i=n[0];if(typeof A=="number"){Tm(e,A,t,n.map(g=>typeof g=="number"?[g,g+1,1,1]:g));return}if(typeof i=="number"){_0(e[i],A,t.slice(1),n.slice(1));return}const[r,o,s,a]=i;if(t.length===1){if(s===1)e.set(A,r);else for(let g=0;gr*o,1),i=new t(n);return ZG(e,A,i,0),i}function ZG(e,A,t,n){if(A.length===1){t.set(e,n);return}if(A.length===2){for(let o=0;oo*s,1);for(let o=0;oa*g,1);A===null&&(A=new ArrayBuffer(r*parseInt(n[n.length-1],10)));const o=A.byteLength/parseInt(n[n.length-1],10);if(r!==o)throw new Error(`Buffer has ${o} of dtype ${n}, shape is too large or small ${t} (flat=${r})`);const s=Qi(n);this.data=$G(A,s,t)}else this.data=A}get(A){const[t,n]=lnA(this.data,this.shape,A);return n.length===0?t:new Oi(t,n,this.dtype)}set(A=null,t){A===null&&(A=[ss(null)]),typeof t=="number"?this.shape.length===0?this.data[0]=t:cnA(this.data,t,this.shape,A):CnA(this.data,t.data,this.shape,t.shape,A)}flatten(){return this.shape.length===1?this.data:unA(this.data,this.shape,Qi(this.dtype))}static arange(A,t="i*r,1),n=new A(t);return n.set([...Array(t).keys()]),n}function $G(e,A,t,n=0){if(t.length===1)return new A(e.slice(n,n+t[0]*A.BYTES_PER_ELEMENT));const i=new Array(t[0]);if(t.length===2){for(let s=0;ss*a,1);for(let s=0;sg*I,1);A===null&&(A=new ArrayBuffer(o*parseInt(n[n.length-1],10)));const s=A.byteLength/parseInt(n[n.length-1],10);if(o!==s)throw new Error(`Buffer has ${s} of dtype ${n}, shape is too large or small ${t} (flat=${o})`);const a=Qi(n);this.data=new a(A)}else this.data=A}set(A=null,t,n){A===null&&(A=[ss(null)]),typeof t=="number"?this.shape.length===0?this.data[0]=t:EnA(this.data,this.strides,this.shape,A,t):t instanceof Lo&&n?fnA(this.data,this.strides,this.shape,A,t.data,t.strides,t.shape,n):hnA(this.data,this.strides,this.shape,A,t.data,t.strides,t.shape)}}var ek={exports:{}};(function(e){var A=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function i(a,g,I){this.fn=a,this.context=g,this.once=I||!1}function r(a,g,I,l,c){if(typeof I!="function")throw new TypeError("The listener must be a function");var C=new i(I,l||a,c),u=t?t+g:g;return a._events[u]?a._events[u].fn?a._events[u]=[a._events[u],C]:a._events[u].push(C):(a._events[u]=C,a._eventsCount++),a}function o(a,g){--a._eventsCount===0?a._events=new n:delete a._events[g]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var g=[],I,l;if(this._eventsCount===0)return g;for(l in I=this._events)A.call(I,l)&&g.push(t?l.slice(1):l);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(I)):g},s.prototype.listeners=function(g){var I=t?t+g:g,l=this._events[I];if(!l)return[];if(l.fn)return[l.fn];for(var c=0,C=l.length,u=new Array(C);c{if(typeof A!="number"||A<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(A===Number.POSITIVE_INFINITY){o(e);return}n={customTimers:{setTimeout,clearTimeout},...n},i=n.customTimers.setTimeout.call(void 0,()=>{if(typeof t=="function"){try{o(t())}catch(I){s(I)}return}const a=typeof t=="string"?t:`Promise timed out after ${A} milliseconds`,g=t instanceof Error?t:new tk(a);typeof e.cancel=="function"&&e.cancel(),s(g)},A),(async()=>{try{o(await e)}catch(a){s(a)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()});return r.clear=()=>{clearTimeout(i),i=void 0},r}function pnA(e,A,t){let n=0,i=e.length;for(;i>0;){const r=Math.trunc(i/2);let o=n+r;t(e[o],A)<=0?(n=++o,i-=r+1):i=r}return n}class ynA{constructor(){Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:[]})}enqueue(A,t){var n;t={priority:0,...t};const i={priority:t.priority,run:A};if(this.size&&((n=this._queue[this.size-1])===null||n===void 0?void 0:n.priority)>=t.priority){this._queue.push(i);return}const r=pnA(this._queue,i,(o,s)=>s.priority-o.priority);this._queue.splice(r,0,i)}dequeue(){const A=this._queue.shift();return A==null?void 0:A.run}filter(A){return this._queue.filter(t=>t.priority===A.priority).map(t=>t.run)}get size(){return this._queue.length}}const mC=()=>{},mnA=new tk;class q1 extends QnA{constructor(A){var t,n,i,r;if(super(),Object.defineProperty(this,"_carryoverConcurrencyCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isIntervalIgnored",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalCap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interval",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalEnd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queueClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pendingCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_concurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isPaused",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolveEmpty",{enumerable:!0,configurable:!0,writable:!0,value:mC}),Object.defineProperty(this,"_resolveIdle",{enumerable:!0,configurable:!0,writable:!0,value:mC}),Object.defineProperty(this,"_timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_throwOnTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),A={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:ynA,...A},!(typeof A.intervalCap=="number"&&A.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(t=A.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&n!==void 0?n:""}\` (${typeof A.intervalCap})`);if(A.interval===void 0||!(Number.isFinite(A.interval)&&A.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(r=(i=A.interval)===null||i===void 0?void 0:i.toString())!==null&&r!==void 0?r:""}\` (${typeof A.interval})`);this._carryoverConcurrencyCount=A.carryoverConcurrencyCount,this._isIntervalIgnored=A.intervalCap===Number.POSITIVE_INFINITY||A.interval===0,this._intervalCap=A.intervalCap,this._interval=A.interval,this._queue=new A.queueClass,this._queueClass=A.queueClass,this.concurrency=A.concurrency,this._timeout=A.timeout,this._throwOnTimeout=A.throwOnTimeout===!0,this._isPaused=A.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()},t)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const A=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();return t?(this.emit("active"),t(),A&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(A){if(!(typeof A=="number"&&A>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${A}\` (${typeof A})`);this._concurrency=A,this._processQueue()}async add(A,t={}){return new Promise((n,i)=>{const r=async()=>{this._pendingCount++,this._intervalCount++;try{const s=await(this._timeout===void 0&&t.timeout===void 0?A():dnA(Promise.resolve(A()),t.timeout===void 0?this._timeout:t.timeout,()=>{(t.throwOnTimeout===void 0?this._throwOnTimeout:t.throwOnTimeout)&&i(mnA)}));n(s),this.emit("completed",s)}catch(o){i(o),this.emit("error",o)}this._next()};this._queue.enqueue(r,t),this._tryToStartAnother(),this.emit("add")})}async addAll(A,t){return Promise.all(A.map(async n=>this.add(n,t)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(A=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t(),A()}})}async onSizeLessThan(A){if(!(this._queue.size{const n=()=>{this._queue.size{const t=this._resolveIdle;this._resolveIdle=()=>{t(),A()}})}get size(){return this._queue.size}sizeBy(A){return this._queue.filter(A).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(A){this._timeout=A}}class KE{constructor(A,t=null,n,i=!1,r=null,o=!0,s=!0){this.store=A,this._chunkStore=r,this.path=Wn(t),this.keyPrefix=ao(this.path),this.readOnly=i,this.cacheMetadata=o,this.cacheAttrs=s,this.meta=n,this.meta.compressor!==null?this.compressor=HtA(this.meta.compressor):this.compressor=null;const a=this.keyPrefix+WG;this.attrs=new jG(this.store,a,this.readOnly,s)}get chunkStore(){return this._chunkStore?this._chunkStore:this.store}get name(){return this.path.length>0?this.path[0]!=="/"?"/"+this.path:this.path:null}get basename(){const A=this.name;if(A===null)return null;const t=A.split("/");return t[t.length-1]}get shape(){return this.meta.shape}get chunks(){return this.meta.chunks}get chunkSize(){return this.chunks.reduce((A,t)=>A*t,1)}get dtype(){return this.meta.dtype}get fillValue(){const A=this.meta.fill_value;return A==="NaN"?NaN:A==="Infinity"?1/0:A==="-Infinity"?-1/0:this.meta.fill_value}get nDims(){return this.meta.shape.length}get size(){return this.meta.shape.reduce((A,t)=>A*t,1)}get length(){return this.shape[0]}get _chunkDataShape(){if(this.shape.length===0)return[1];{const A=[];for(let t=0;tA*t,1)}static async create(A,t=null,n=!1,i=null,r=!0,o=!0){const s=await this.loadMetadataForConstructor(A,t);return new KE(A,t,s,n,i,r,o)}static async loadMetadataForConstructor(A,t){try{t=Wn(t);const n=ao(t),i=await A.getItem(n+xB);return FB(i)}catch(n){throw await vi(A,t)?new Bg(t??""):new Error("Failed to load metadata for ZarrArray:"+n.toString())}}async reloadMetadata(){const A=this.keyPrefix+xB,t=this.store.getItem(A);return this.meta=FB(await t),this.meta}async refreshMetadata(){this.cacheMetadata||await this.reloadMetadata()}get(A=null,t={}){return this.getBasicSelection(A,!1,t)}getRaw(A=null,t={}){return this.getBasicSelection(A,!0,t)}async getBasicSelection(A,t=!1,{concurrencyLimit:n=10,progressCallback:i,storeOptions:r}={}){if(this.cacheMetadata||await this.reloadMetadata(),this.shape.length===0)throw new Error("Shape [] indexing is not supported yet");return this.getBasicSelectionND(A,t,n,i,r)}getBasicSelectionND(A,t,n,i,r){const o=new M1(A,this);return this.getSelection(o,t,n,i,r)}async getSelection(A,t,n,i,r){const o=this.dtype,s=A.shape,a=A.shape.reduce((l,c)=>l*c,1);if(t&&a===this.chunkSize){const l=A.iter(),c=l.next();if(c.done===!1&&l.next().done===!0){const C=c.value;return await this.decodeDirectToRawArray(C,s,a)}}const g=t?new Lo(null,s,o):new Oi(null,s,o);if(a===0)return g;const I=new q1({concurrency:n});if(i){let l=0,c=0;for(const C of A.iter())c+=1;i({progress:0,queueSize:c});for(const C of A.iter())(async()=>(await I.add(()=>this.chunkGetItem(C.chunkCoords,C.chunkSelection,g,C.outSelection,A.dropAxes,r)),l+=1,i({progress:l,queueSize:c})))()}else for(const l of A.iter())I.add(()=>this.chunkGetItem(l.chunkCoords,l.chunkSelection,g,l.outSelection,A.dropAxes,r));return await I.onIdle(),g.shape.length===0?g.data[0]:g}async chunkGetItem(A,t,n,i,r,o){if(A.length!==this._chunkDataShape.length)throw new hn(`Inconsistent shapes: chunkCoordsLength: ${A.length}, cDataShapeLength: ${this.chunkDataShape.length}`);const s=this.chunkKey(A);try{const a=await this.chunkStore.getItem(s,o),g=await this.decodeChunk(a);if(n instanceof Oi){if(WtA(i)&&P1(t,this.chunks)&&!this.meta.filters){n.set(i,this.toNestedArray(g));return}const l=this.toNestedArray(g).get(t);if(r!==null)throw new Error("Drop axes is not supported yet");n.set(i,l)}else n.set(i,this.chunkBufferToRawArray(g),t)}catch(a){if(zf(a))this.fillValue!==null&&n.set(i,this.fillValue);else throw a}}async getRawChunk(A,t){if(A.length!==this.shape.length)throw new Error(`Chunk coordinates ${A.join(".")} do not correspond to shape ${this.shape}.`);try{for(let s=0;ss!==1);return new Lo(r,o,this.dtype)}chunkKey(A){var t;const n=(t=this.meta.dimension_separator)!==null&&t!==void 0?t:".";return this.keyPrefix+A.join(n)}ensureByteArray(A){return typeof A=="string"?new Uint8Array(Buffer.from(A).buffer):new Uint8Array(A)}toTypedArray(A){return new(Qi(this.dtype))(A)}toNestedArray(A){const t=this.ensureByteArray(A).buffer;return new Oi(t,this.chunks,this.dtype)}async decodeChunk(A){let t=this.ensureByteArray(A);if(this.compressor!==null&&(t=await(await this.compressor).decode(t)),this.dtype.includes(">")&&VG(this.toTypedArray(t.buffer)),this.meta.order==="F"&&this.nDims>1){const n=this.toTypedArray(t.buffer),i=new(Qi(this.dtype))(n.length);return snA(n,i,this.chunks),i.buffer}return t.buffer}chunkBufferToRawArray(A){return new Lo(A,this.chunks,this.dtype)}async decodeDirectToRawArray({chunkCoords:A},t,n){const i=this.chunkKey(A);try{const r=await this.chunkStore.getItem(i);return new Lo(await this.decodeChunk(r),t,this.dtype)}catch(r){if(zf(r)){const o=new(Qi(this.dtype))(n);return new Lo(o.fill(this.fillValue),t)}else throw r}}async set(A=null,t,n={}){await this.setBasicSelection(A,t,n)}async setBasicSelection(A,t,{concurrencyLimit:n=10,progressCallback:i}={}){if(this.readOnly)throw new Jt("Object is read only");if(this.cacheMetadata||await this.reloadMetadata(),this.shape.length===0)throw new Error("Shape [] indexing is not supported yet");await this.setBasicSelectionND(A,t,n,i)}async setBasicSelectionND(A,t,n,i){const r=new M1(A,this);await this.setSelection(r,t,n,i)}getChunkValue(A,t,n,i){let r;if(i.length===0)r=n;else if(typeof n=="number")r=n;else if(r=n.get(A.outSelection),t.dropAxes!==null)throw new Error("Handling drop axes not supported yet");return r}async setSelection(A,t,n,i){const r=A.shape;if(r.length!==0){if(typeof t!="number")if(t instanceof Oi){if(!$tA(t.shape,r))throw new hn(`Shape mismatch in source NestedArray and set selection: ${t.shape} and ${r}`)}else throw new Error("Unknown data type for setting :(")}const o=new q1({concurrency:n});if(i){let s=0;for(const g of A.iter())s+=1;let a=0;i({progress:0,queueSize:s});for(const g of A.iter()){const I=this.getChunkValue(g,A,t,r);(async()=>(await o.add(()=>this.chunkSetItem(g.chunkCoords,g.chunkSelection,I)),a+=1,i({progress:a,queueSize:s})))()}}else for(const s of A.iter()){const a=this.getChunkValue(s,A,t,r);o.add(()=>this.chunkSetItem(s.chunkCoords,s.chunkSelection,a))}await o.onIdle()}async chunkSetItem(A,t,n){if(this.meta.order==="F"&&this.nDims>1)throw new Error("Setting content for arrays in F-order is not supported.");const i=this.chunkKey(A);let r=null;const o=Qi(this.dtype),s=this.chunkSize;if(P1(t,this.chunks))typeof n=="number"?(r=new o(s),r.fill(n)):r=n.flatten();else{let g;try{const l=await this.chunkStore.getItem(i),c=await this.decodeChunk(l);g=this.toTypedArray(c)}catch(l){if(zf(l))g=new o(s),this.fillValue!==null&&g.fill(this.fillValue);else throw l}const I=new Oi(g,this.chunks,this.dtype);I.set(t,n),r=I.flatten()}const a=await this.encodeChunk(r);this.chunkStore.setItem(i,a)}async encodeChunk(A){if(this.dtype.includes(">")&&(A=enA(A)),this.compressor!==null){const t=new Uint8Array(A.buffer);return(await(await this.compressor).encode(t)).buffer}return A.buffer}}class wnA{constructor(A={}){this.root=A}proxy(){return Rm(this)}getParent(A){let t=this.root;const n=A.split("/");for(const i of n.slice(0,n.length-1))if(t=t[i],!t)throw Error(A);return[t,n[n.length-1]]}requireParent(A){let t=this.root;const n=A.split("/");for(const i of n.slice(0,n.length-1))t[i]===void 0&&(t[i]={}),t=t[i];return[t,n[n.length-1]]}getItem(A){const[t,n]=this.getParent(A),i=t[n];if(i===void 0)throw new Eg(A);return i}setItem(A,t){const[n,i]=this.requireParent(A);return n[i]=t,!0}deleteItem(A){const[t,n]=this.getParent(A);return delete t[n]}containsItem(A){try{return this.getItem(A)!==void 0}catch{return!1}}keys(){throw new Error("Method not implemented.")}}var ci;(function(e){e.HEAD="HEAD",e.GET="GET",e.PUT="PUT"})(ci||(ci={}));const vnA=[ci.HEAD,ci.GET,ci.PUT];class Um{constructor(A,t={}){this.url=A;const{fetchOptions:n={},supportedMethods:i=vnA}=t;this.fetchOptions=n,this.supportedMethods=new Set(i)}keys(){throw new Error("Method not implemented.")}async getItem(A,t){const n=jf(this.url,A),i=await fetch(n,{...this.fetchOptions,...t});if(i.status===404)throw new Eg(A);if(i.status!==200)throw new Nm(String(i.status));return hg?Buffer.from(await i.arrayBuffer()):i.arrayBuffer()}async setItem(A,t){if(!this.supportedMethods.has(ci.PUT))throw new Error("HTTP PUT no a supported method for store.");const n=jf(this.url,A);return typeof t=="string"&&(t=new TextEncoder().encode(t).buffer),(await fetch(n,{...this.fetchOptions,method:ci.PUT,body:t})).status.toString()[0]==="2"}deleteItem(A){throw new Error("Method not implemented.")}async containsItem(A){const t=jf(this.url,A),n=this.supportedMethods.has(ci.HEAD)?ci.HEAD:ci.GET;return(await fetch(t,{...this.fetchOptions,method:n})).status===200}}async function fg({shape:e,chunks:A=!0,dtype:t="0?this.path[0]!=="/"?"/"+this.path:this.path:"/"}get basename(){const A=this.name.split("/");return A[A.length-1]}get chunkStore(){return this._chunkStore?this._chunkStore:this.store}static async create(A,t=null,n=!1,i=null,r=!0){const o=await this.loadMetadataForConstructor(A,t);return new Ca(A,t,o,n,i,r)}static async loadMetadataForConstructor(A,t){t=Wn(t);const n=ao(t);try{const i=await A.getItem(n+km);return FB(i)}catch{throw await ji(A,t)?new Yr(t):new YE(t)}}itemPath(A){const t=typeof A=="string"&&A.length>0&&A[0]==="/",n=Wn(A);return!t&&this.path.length>0?this.keyPrefix+n:n}async createGroup(A,t=!1){if(this.readOnly)throw new Jt("group is read only");const n=this.itemPath(A);return await JI(this.store,n,this._chunkStore,t),Ca.create(this.store,n,this.readOnly,this._chunkStore,this.attrs.cache)}async requireGroup(A,t=!1){if(this.readOnly)throw new Jt("group is read only");const n=this.itemPath(A);return await vi(this.store,n)||await JI(this.store,n,this._chunkStore,t),Ca.create(this.store,n,this.readOnly,this._chunkStore,this.attrs.cache)}getOptsForArrayCreation(A,t={}){const n=this.itemPath(A);return t.path=n,t.cacheAttrs===void 0&&(t.cacheAttrs=this.attrs.cache),t.store=this.store,t.chunkStore=this.chunkStore,t}array(A,t,n,i){if(this.readOnly)throw new Jt("group is read only");return n=this.getOptsForArrayCreation(A,n),n.overwrite=i===void 0?n.overwrite:i,J1(t,n)}empty(A,t,n={}){if(this.readOnly)throw new Jt("group is read only");return n=this.getOptsForArrayCreation(A,n),SnA(t,n)}zeros(A,t,n={}){if(this.readOnly)throw new Jt("group is read only");return n=this.getOptsForArrayCreation(A,n),DnA(t,n)}ones(A,t,n={}){if(this.readOnly)throw new Jt("group is read only");return n=this.getOptsForArrayCreation(A,n),RnA(t,n)}full(A,t,n,i={}){if(this.readOnly)throw new Jt("group is read only");return i=this.getOptsForArrayCreation(A,i),xnA(t,n,i)}createDataset(A,t,n,i){if(this.readOnly)throw new Jt("group is read only");i=this.getOptsForArrayCreation(A,i);let r;if(n===void 0){if(t===void 0)throw new hn("Shape must be set if no data is passed to CreateDataset");r=fg({shape:t,...i})}else r=J1(n,i);return r}async getItem(A){const t=this.itemPath(A);if(await ji(this.store,t))return KE.create(this.store,t,this.readOnly,this.chunkStore,void 0,this.attrs.cache);if(await vi(this.store,t))return Ca.create(this.store,t,this.readOnly,this._chunkStore,this.attrs.cache);throw new Eg(A)}async setItem(A,t){return await this.array(A,t,{},!0),!0}async deleteItem(A){throw this.readOnly?new Jt("group is read only"):new Error("Method not implemented.")}async containsItem(A){const t=this.itemPath(A);return await ji(this.store,t)||vi(this.store,t)}proxy(){return Rm(this)}}async function FnA(e,A=null,t="a",n,i=!0){if(e=G0(e),n!==void 0&&(n=G0(e)),A=Wn(A),t==="r"||t==="r+"){if(!await vi(e,A))throw await ji(e,A)?new Yr(A):new YE(A)}else if(t==="w")await JI(e,A,n,!0);else if(t==="a"){if(!await vi(e,A)){if(await ji(e,A))throw new Yr(A);await JI(e,A,n)}}else if(t==="w-"||t==="x"){if(await ji(e,A))throw new Yr(A);if(await vi(e,A))throw new Bg(A);await JI(e,A,n)}else throw new hn(`Invalid mode argument: ${t}`);const r=t==="r";return Ca.create(e,A,r,n,i)}/*! pako 2.0.3 https://github.com/nodeca/pako @license (MIT AND Zlib) */const NnA=4,O1=0,Y1=1,_nA=2;function Qg(e){let A=e.length;for(;--A>=0;)e[A]=0}const LnA=0,nk=1,bnA=2,GnA=3,knA=258,Pm=29,Qc=256,Rl=Qc+1+Pm,Fa=30,Hm=19,ik=2*Rl+1,Po=15,Xf=16,MnA=7,qm=256,rk=16,ok=17,sk=18,k0=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),cu=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),TnA=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ak=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),UnA=512,Pi=new Array((Rl+2)*2);Qg(Pi);const OI=new Array(Fa*2);Qg(OI);const xl=new Array(UnA);Qg(xl);const Fl=new Array(knA-GnA+1);Qg(Fl);const Jm=new Array(Pm);Qg(Jm);const NB=new Array(Fa);Qg(NB);function Zf(e,A,t,n,i){this.static_tree=e,this.extra_bits=A,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let gk,Ik,lk;function $f(e,A){this.dyn_tree=e,this.max_code=0,this.stat_desc=A}const ck=e=>e<256?xl[e]:xl[256+(e>>>7)],Nl=(e,A)=>{e.pending_buf[e.pending++]=A&255,e.pending_buf[e.pending++]=A>>>8&255},tn=(e,A,t)=>{e.bi_valid>Xf-t?(e.bi_buf|=A<>Xf-e.bi_valid,e.bi_valid+=t-Xf):(e.bi_buf|=A<{tn(e,t[A*2],t[A*2+1])},Ck=(e,A)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--A>0);return t>>>1},PnA=e=>{e.bi_valid===16?(Nl(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},HnA=(e,A)=>{const t=A.dyn_tree,n=A.max_code,i=A.stat_desc.static_tree,r=A.stat_desc.has_stree,o=A.stat_desc.extra_bits,s=A.stat_desc.extra_base,a=A.stat_desc.max_length;let g,I,l,c,C,u,E=0;for(c=0;c<=Po;c++)e.bl_count[c]=0;for(t[e.heap[e.heap_max]*2+1]=0,g=e.heap_max+1;ga&&(c=a,E++),t[I*2+1]=c,!(I>n)&&(e.bl_count[c]++,C=0,I>=s&&(C=o[I-s]),u=t[I*2],e.opt_len+=u*(c+C),r&&(e.static_len+=u*(i[I*2+1]+C)));if(E!==0){do{for(c=a-1;e.bl_count[c]===0;)c--;e.bl_count[c]--,e.bl_count[c+1]+=2,e.bl_count[a]--,E-=2}while(E>0);for(c=a;c!==0;c--)for(I=e.bl_count[c];I!==0;)l=e.heap[--g],!(l>n)&&(t[l*2+1]!==c&&(e.opt_len+=(c-t[l*2+1])*t[l*2],t[l*2+1]=c),I--)}},uk=(e,A,t)=>{const n=new Array(Po+1);let i=0,r,o;for(r=1;r<=Po;r++)n[r]=i=i+t[r-1]<<1;for(o=0;o<=A;o++){let s=e[o*2+1];s!==0&&(e[o*2]=Ck(n[s]++,s))}},qnA=()=>{let e,A,t,n,i;const r=new Array(Po+1);for(t=0,n=0;n>=7;n{let A;for(A=0;A{e.bi_valid>8?Nl(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},JnA=(e,A,t,n)=>{Ek(e),n&&(Nl(e,t),Nl(e,~t)),e.pending_buf.set(e.window.subarray(A,A+t),e.pending),e.pending+=t},K1=(e,A,t,n)=>{const i=A*2,r=t*2;return e[i]{const n=e.heap[t];let i=t<<1;for(;i<=e.heap_len&&(i{let n,i,r=0,o,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+r*2]<<8|e.pending_buf[e.d_buf+r*2+1],i=e.pending_buf[e.l_buf+r],r++,n===0?Ci(e,i,A):(o=Fl[i],Ci(e,o+Qc+1,A),s=k0[o],s!==0&&(i-=Jm[o],tn(e,i,s)),n--,o=ck(n),Ci(e,o,t),s=cu[o],s!==0&&(n-=NB[o],tn(e,n,s)));while(r{const t=A.dyn_tree,n=A.stat_desc.static_tree,i=A.stat_desc.has_stree,r=A.stat_desc.elems;let o,s,a=-1,g;for(e.heap_len=0,e.heap_max=ik,o=0;o>1;o>=1;o--)AQ(e,t,o);g=r;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],AQ(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,t[g*2]=t[o*2]+t[s*2],e.depth[g]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,t[o*2+1]=t[s*2+1]=g,e.heap[1]=g++,AQ(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],HnA(e,A),uk(t,a,e.bl_count)},W1=(e,A,t)=>{let n,i=-1,r,o=A[0*2+1],s=0,a=7,g=4;for(o===0&&(a=138,g=3),A[(t+1)*2+1]=65535,n=0;n<=t;n++)r=o,o=A[(n+1)*2+1],!(++s{let n,i=-1,r,o=A[0*2+1],s=0,a=7,g=4;for(o===0&&(a=138,g=3),n=0;n<=t;n++)if(r=o,o=A[(n+1)*2+1],!(++s{let A;for(W1(e,e.dyn_ltree,e.l_desc.max_code),W1(e,e.dyn_dtree,e.d_desc.max_code),M0(e,e.bl_desc),A=Hm-1;A>=3&&e.bl_tree[ak[A]*2+1]===0;A--);return e.opt_len+=3*(A+1)+5+5+4,A},YnA=(e,A,t,n)=>{let i;for(tn(e,A-257,5),tn(e,t-1,5),tn(e,n-4,4),i=0;i{let A=4093624447,t;for(t=0;t<=31;t++,A>>>=1)if(A&1&&e.dyn_ltree[t*2]!==0)return O1;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Y1;for(t=32;t{j1||(qnA(),j1=!0),e.l_desc=new $f(e.dyn_ltree,gk),e.d_desc=new $f(e.dyn_dtree,Ik),e.bl_desc=new $f(e.bl_tree,lk),e.bi_buf=0,e.bi_valid=0,Bk(e)},hk=(e,A,t,n)=>{tn(e,(LnA<<1)+(n?1:0),3),JnA(e,A,t,!0)},WnA=e=>{tn(e,nk<<1,3),Ci(e,qm,Pi),PnA(e)},znA=(e,A,t,n)=>{let i,r,o=0;e.level>0?(e.strm.data_type===_nA&&(e.strm.data_type=KnA(e)),M0(e,e.l_desc),M0(e,e.d_desc),o=OnA(e),i=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=i&&(i=r)):i=r=t+5,t+4<=i&&A!==-1?hk(e,A,t,n):e.strategy===NnA||r===i?(tn(e,(nk<<1)+(n?1:0),3),V1(e,Pi,OI)):(tn(e,(bnA<<1)+(n?1:0),3),YnA(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),V1(e,e.dyn_ltree,e.dyn_dtree)),Bk(e),n&&Ek(e)},jnA=(e,A,t)=>(e.pending_buf[e.d_buf+e.last_lit*2]=A>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=A&255,e.pending_buf[e.l_buf+e.last_lit]=t&255,e.last_lit++,A===0?e.dyn_ltree[t*2]++:(e.matches++,A--,e.dyn_ltree[(Fl[t]+Qc+1)*2]++,e.dyn_dtree[ck(A)*2]++),e.last_lit===e.lit_bufsize-1);var XnA=VnA,ZnA=hk,$nA=znA,AiA=jnA,eiA=WnA,tiA={_tr_init:XnA,_tr_stored_block:ZnA,_tr_flush_block:$nA,_tr_tally:AiA,_tr_align:eiA};const niA=(e,A,t,n)=>{let i=e&65535|0,r=e>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+A[n++]|0,r=r+i|0;while(--o);i%=65521,r%=65521}return i|r<<16|0};var _l=niA;const iiA=()=>{let e,A=[];for(var t=0;t<256;t++){e=t;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;A[t]=e}return A},riA=new Uint32Array(iiA()),oiA=(e,A,t,n)=>{const i=riA,r=n+t;e^=-1;for(let o=n;o>>8^i[(e^A[o])&255];return e^-1};var ut=oiA,gs={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ds={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:siA,_tr_stored_block:aiA,_tr_flush_block:giA,_tr_tally:Kr,_tr_align:IiA}=tiA,{Z_NO_FLUSH:Rs,Z_PARTIAL_FLUSH:liA,Z_FULL_FLUSH:ciA,Z_FINISH:Vr,Z_BLOCK:X1,Z_OK:ui,Z_STREAM_END:Z1,Z_STREAM_ERROR:Rn,Z_DATA_ERROR:CiA,Z_BUF_ERROR:eQ,Z_DEFAULT_COMPRESSION:uiA,Z_FILTERED:BiA,Z_HUFFMAN_ONLY:wC,Z_RLE:EiA,Z_FIXED:hiA,Z_DEFAULT_STRATEGY:fiA,Z_UNKNOWN:QiA,Z_DEFLATED:VE}=Ds,diA=9,piA=15,yiA=8,miA=29,wiA=256,T0=wiA+1+miA,viA=30,SiA=19,DiA=2*T0+1,RiA=15,Ee=3,_r=258,zn=_r+Ee+1,xiA=32,WE=42,U0=69,Cu=73,uu=91,Bu=103,Ho=113,BI=666,gt=1,dc=2,Is=3,dg=4,FiA=3,Lr=(e,A)=>(e.msg=gs[A],A),$1=e=>(e<<1)-(e>4?9:0),Sr=e=>{let A=e.length;for(;--A>=0;)e[A]=0};let NiA=(e,A,t)=>(A<{const A=e.state;let t=A.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(A.pending_buf.subarray(A.pending_out,A.pending_out+t),e.next_out),e.next_out+=t,A.pending_out+=t,e.total_out+=t,e.avail_out-=t,A.pending-=t,A.pending===0&&(A.pending_out=0))},Dt=(e,A)=>{giA(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,A),e.block_start=e.strstart,mr(e.strm)},de=(e,A)=>{e.pending_buf[e.pending++]=A},AI=(e,A)=>{e.pending_buf[e.pending++]=A>>>8&255,e.pending_buf[e.pending++]=A&255},_iA=(e,A,t,n)=>{let i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,A.set(e.input.subarray(e.next_in,e.next_in+i),t),e.state.wrap===1?e.adler=_l(e.adler,A,i,t):e.state.wrap===2&&(e.adler=ut(e.adler,A,i,t)),e.next_in+=i,e.total_in+=i,i)},fk=(e,A)=>{let t=e.max_chain_length,n=e.strstart,i,r,o=e.prev_length,s=e.nice_match;const a=e.strstart>e.w_size-zn?e.strstart-(e.w_size-zn):0,g=e.window,I=e.w_mask,l=e.prev,c=e.strstart+_r;let C=g[n+o-1],u=g[n+o];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=A,!(g[i+o]!==u||g[i+o-1]!==C||g[i]!==g[n]||g[++i]!==g[n+1])){n+=2,i++;do;while(g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&g[++n]===g[++i]&&no){if(e.match_start=A,o=r,r>=s)break;C=g[n+o-1],u=g[n+o]}}while((A=l[A&I])>a&&--t!==0);return o<=e.lookahead?o:e.lookahead},ls=e=>{const A=e.w_size;let t,n,i,r,o;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=A+(A-zn)){e.window.set(e.window.subarray(A,A+A),0),e.match_start-=A,e.strstart-=A,e.block_start-=A,n=e.hash_size,t=n;do i=e.head[--t],e.head[t]=i>=A?i-A:0;while(--n);n=A,t=n;do i=e.prev[--t],e.prev[t]=i>=A?i-A:0;while(--n);r+=A}if(e.strm.avail_in===0)break;if(n=_iA(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=Ee)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=Wr(e,e.ins_h,e.window[o+1]);e.insert&&(e.ins_h=Wr(e,e.ins_h,e.window[o+Ee-1]),e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert{let t=65535;for(t>e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ls(e),e.lookahead===0&&A===Rs)return gt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+t;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,Dt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-zn&&(Dt(e,!1),e.strm.avail_out===0))return gt}return e.insert=0,A===Vr?(Dt(e,!0),e.strm.avail_out===0?Is:dg):(e.strstart>e.block_start&&(Dt(e,!1),e.strm.avail_out===0),gt)},tQ=(e,A)=>{let t,n;for(;;){if(e.lookahead=Ee&&(e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+Ee-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-zn&&(e.match_length=fk(e,t)),e.match_length>=Ee)if(n=Kr(e,e.strstart-e.match_start,e.match_length-Ee),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=Ee){e.match_length--;do e.strstart++,e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+Ee-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+1]);else n=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Dt(e,!1),e.strm.avail_out===0))return gt}return e.insert=e.strstart{let t,n,i;for(;;){if(e.lookahead=Ee&&(e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+Ee-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=Ee-1,t!==0&&e.prev_length4096)&&(e.match_length=Ee-1)),e.prev_length>=Ee&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-Ee,n=Kr(e,e.strstart-1-e.prev_match,e.prev_length-Ee),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Wr(e,e.ins_h,e.window[e.strstart+Ee-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=Ee-1,e.strstart++,n&&(Dt(e,!1),e.strm.avail_out===0))return gt}else if(e.match_available){if(n=Kr(e,0,e.window[e.strstart-1]),n&&Dt(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return gt}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Kr(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let t,n,i,r;const o=e.window;for(;;){if(e.lookahead<=_r){if(ls(e),e.lookahead<=_r&&A===Rs)return gt;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=Ee&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){r=e.strstart+_r;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=Ee?(t=Kr(e,1,e.match_length-Ee),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(Dt(e,!1),e.strm.avail_out===0))return gt}return e.insert=0,A===Vr?(Dt(e,!0),e.strm.avail_out===0?Is:dg):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?gt:dc},GiA=(e,A)=>{let t;for(;;){if(e.lookahead===0&&(ls(e),e.lookahead===0)){if(A===Rs)return gt;break}if(e.match_length=0,t=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(Dt(e,!1),e.strm.avail_out===0))return gt}return e.insert=0,A===Vr?(Dt(e,!0),e.strm.avail_out===0?Is:dg):e.last_lit&&(Dt(e,!1),e.strm.avail_out===0)?gt:dc};function si(e,A,t,n,i){this.good_length=e,this.max_lazy=A,this.nice_length=t,this.max_chain=n,this.func=i}const EI=[new si(0,0,0,0,LiA),new si(4,4,8,4,tQ),new si(4,5,16,8,tQ),new si(4,6,32,32,tQ),new si(4,4,16,16,Js),new si(8,16,32,32,Js),new si(8,16,128,128,Js),new si(8,32,128,256,Js),new si(32,128,258,1024,Js),new si(32,258,258,4096,Js)],kiA=e=>{e.window_size=2*e.w_size,Sr(e.head),e.max_lazy_match=EI[e.level].max_lazy,e.good_match=EI[e.level].good_length,e.nice_match=EI[e.level].nice_length,e.max_chain_length=EI[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=Ee-1,e.match_available=0,e.ins_h=0};function MiA(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=VE,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(DiA*2),this.dyn_dtree=new Uint16Array((2*viA+1)*2),this.bl_tree=new Uint16Array((2*SiA+1)*2),Sr(this.dyn_ltree),Sr(this.dyn_dtree),Sr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(RiA+1),this.heap=new Uint16Array(2*T0+1),Sr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*T0+1),Sr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Qk=e=>{if(!e||!e.state)return Lr(e,Rn);e.total_in=e.total_out=0,e.data_type=QiA;const A=e.state;return A.pending=0,A.pending_out=0,A.wrap<0&&(A.wrap=-A.wrap),A.status=A.wrap?WE:Ho,e.adler=A.wrap===2?0:1,A.last_flush=Rs,siA(A),ui},dk=e=>{const A=Qk(e);return A===ui&&kiA(e.state),A},TiA=(e,A)=>!e||!e.state||e.state.wrap!==2?Rn:(e.state.gzhead=A,ui),pk=(e,A,t,n,i,r)=>{if(!e)return Rn;let o=1;if(A===uiA&&(A=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>diA||t!==VE||n<8||n>15||A<0||A>9||r<0||r>hiA)return Lr(e,Rn);n===8&&(n=9);const s=new MiA;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<pk(e,A,VE,piA,yiA,fiA),PiA=(e,A)=>{let t,n;if(!e||!e.state||A>X1||A<0)return e?Lr(e,Rn):Rn;const i=e.state;if(!e.output||!e.input&&e.avail_in!==0||i.status===BI&&A!==Vr)return Lr(e,e.avail_out===0?eQ:Rn);i.strm=e;const r=i.last_flush;if(i.last_flush=A,i.status===WE)if(i.wrap===2)e.adler=0,de(i,31),de(i,139),de(i,8),i.gzhead?(de(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),de(i,i.gzhead.time&255),de(i,i.gzhead.time>>8&255),de(i,i.gzhead.time>>16&255),de(i,i.gzhead.time>>24&255),de(i,i.level===9?2:i.strategy>=wC||i.level<2?4:0),de(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(de(i,i.gzhead.extra.length&255),de(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=ut(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U0):(de(i,0),de(i,0),de(i,0),de(i,0),de(i,0),de(i,i.level===9?2:i.strategy>=wC||i.level<2?4:0),de(i,FiA),i.status=Ho);else{let o=VE+(i.w_bits-8<<4)<<8,s=-1;i.strategy>=wC||i.level<2?s=0:i.level<6?s=1:i.level===6?s=2:s=3,o|=s<<6,i.strstart!==0&&(o|=xiA),o+=31-o%31,i.status=Ho,AI(i,o),i.strstart!==0&&(AI(i,e.adler>>>16),AI(i,e.adler&65535)),e.adler=1}if(i.status===U0)if(i.gzhead.extra){for(t=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>t&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),mr(e),t=i.pending,i.pending===i.pending_buf_size));)de(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>t&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Cu)}else i.status=Cu;if(i.status===Cu)if(i.gzhead.name){t=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>t&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),mr(e),t=i.pending,i.pending===i.pending_buf_size)){n=1;break}i.gzindext&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),n===0&&(i.gzindex=0,i.status=uu)}else i.status=uu;if(i.status===uu)if(i.gzhead.comment){t=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>t&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),mr(e),t=i.pending,i.pending===i.pending_buf_size)){n=1;break}i.gzindext&&(e.adler=ut(e.adler,i.pending_buf,i.pending-t,t)),n===0&&(i.status=Bu)}else i.status=Bu;if(i.status===Bu&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&mr(e),i.pending+2<=i.pending_buf_size&&(de(i,e.adler&255),de(i,e.adler>>8&255),e.adler=0,i.status=Ho)):i.status=Ho),i.pending!==0){if(mr(e),e.avail_out===0)return i.last_flush=-1,ui}else if(e.avail_in===0&&$1(A)<=$1(r)&&A!==Vr)return Lr(e,eQ);if(i.status===BI&&e.avail_in!==0)return Lr(e,eQ);if(e.avail_in!==0||i.lookahead!==0||A!==Rs&&i.status!==BI){let o=i.strategy===wC?GiA(i,A):i.strategy===EiA?biA(i,A):EI[i.level].func(i,A);if((o===Is||o===dg)&&(i.status=BI),o===gt||o===Is)return e.avail_out===0&&(i.last_flush=-1),ui;if(o===dc&&(A===liA?IiA(i):A!==X1&&(aiA(i,0,0,!1),A===ciA&&(Sr(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),mr(e),e.avail_out===0))return i.last_flush=-1,ui}return A!==Vr?ui:i.wrap<=0?Z1:(i.wrap===2?(de(i,e.adler&255),de(i,e.adler>>8&255),de(i,e.adler>>16&255),de(i,e.adler>>24&255),de(i,e.total_in&255),de(i,e.total_in>>8&255),de(i,e.total_in>>16&255),de(i,e.total_in>>24&255)):(AI(i,e.adler>>>16),AI(i,e.adler&65535)),mr(e),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?ui:Z1)},HiA=e=>{if(!e||!e.state)return Rn;const A=e.state.status;return A!==WE&&A!==U0&&A!==Cu&&A!==uu&&A!==Bu&&A!==Ho&&A!==BI?Lr(e,Rn):(e.state=null,A===Ho?Lr(e,CiA):ui)},qiA=(e,A)=>{let t=A.length;if(!e||!e.state)return Rn;const n=e.state,i=n.wrap;if(i===2||i===1&&n.status!==WE||n.lookahead)return Rn;if(i===1&&(e.adler=_l(e.adler,A,t,0)),n.wrap=0,t>=n.w_size){i===0&&(Sr(n.head),n.strstart=0,n.block_start=0,n.insert=0);let a=new Uint8Array(n.w_size);a.set(A.subarray(t-n.w_size,t),0),A=a,t=n.w_size}const r=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=A,ls(n);n.lookahead>=Ee;){let a=n.strstart,g=n.lookahead-(Ee-1);do n.ins_h=Wr(n,n.ins_h,n.window[a+Ee-1]),n.prev[a&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=a,a++;while(--g);n.strstart=a,n.lookahead=Ee-1,ls(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Ee-1,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=r,n.wrap=i,ui};var JiA=UiA,OiA=pk,YiA=dk,KiA=Qk,ViA=TiA,WiA=PiA,ziA=HiA,jiA=qiA,XiA="pako deflate (from Nodeca project)",YI={deflateInit:JiA,deflateInit2:OiA,deflateReset:YiA,deflateResetKeep:KiA,deflateSetHeader:ViA,deflate:WiA,deflateEnd:ziA,deflateSetDictionary:jiA,deflateInfo:XiA};const ZiA=(e,A)=>Object.prototype.hasOwnProperty.call(e,A);var $iA=function(e){const A=Array.prototype.slice.call(arguments,1);for(;A.length;){const t=A.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const n in t)ZiA(t,n)&&(e[n]=t[n])}}return e},ArA=e=>{let A=0;for(let n=0,i=e.length;n=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ll[254]=Ll[254]=1;var erA=e=>{let A,t,n,i,r,o=e.length,s=0;for(i=0;i>>6,A[r++]=128|t&63):t<65536?(A[r++]=224|t>>>12,A[r++]=128|t>>>6&63,A[r++]=128|t&63):(A[r++]=240|t>>>18,A[r++]=128|t>>>12&63,A[r++]=128|t>>>6&63,A[r++]=128|t&63);return A};const trA=(e,A)=>{if(A<65534&&e.subarray&&yk)return String.fromCharCode.apply(null,e.length===A?e:e.subarray(0,A));let t="";for(let n=0;n{let t,n;const i=A||e.length,r=new Array(i*2);for(n=0,t=0;t4){r[n++]=65533,t+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&t1){r[n++]=65533;continue}o<65536?r[n++]=o:(o-=65536,r[n++]=55296|o>>10&1023,r[n++]=56320|o&1023)}return trA(r,n)},irA=(e,A)=>{A=A||e.length,A>e.length&&(A=e.length);let t=A-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?A:t+Ll[e[t]]>A?t:A},bl={string2buf:erA,buf2string:nrA,utf8border:irA};function rrA(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var mk=rrA;const wk=Object.prototype.toString,{Z_NO_FLUSH:orA,Z_SYNC_FLUSH:srA,Z_FULL_FLUSH:arA,Z_FINISH:grA,Z_OK:_B,Z_STREAM_END:IrA,Z_DEFAULT_COMPRESSION:lrA,Z_DEFAULT_STRATEGY:crA,Z_DEFLATED:CrA}=Ds;function pc(e){this.options=zE.assign({level:lrA,method:CrA,chunkSize:16384,windowBits:15,memLevel:8,strategy:crA},e||{});let A=this.options;A.raw&&A.windowBits>0?A.windowBits=-A.windowBits:A.gzip&&A.windowBits>0&&A.windowBits<16&&(A.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new mk,this.strm.avail_out=0;let t=YI.deflateInit2(this.strm,A.level,A.method,A.windowBits,A.memLevel,A.strategy);if(t!==_B)throw new Error(gs[t]);if(A.header&&YI.deflateSetHeader(this.strm,A.header),A.dictionary){let n;if(typeof A.dictionary=="string"?n=bl.string2buf(A.dictionary):wk.call(A.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(A.dictionary):n=A.dictionary,t=YI.deflateSetDictionary(this.strm,n),t!==_B)throw new Error(gs[t]);this._dict_set=!0}}pc.prototype.push=function(e,A){const t=this.strm,n=this.options.chunkSize;let i,r;if(this.ended)return!1;for(A===~~A?r=A:r=A===!0?grA:orA,typeof e=="string"?t.input=bl.string2buf(e):wk.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(r===srA||r===arA)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=YI.deflate(t,r),i===IrA)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=YI.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===_B;if(t.avail_out===0){this.onData(t.output);continue}if(r>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};pc.prototype.onData=function(e){this.chunks.push(e)};pc.prototype.onEnd=function(e){e===_B&&(this.result=zE.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Om(e,A){const t=new pc(A);if(t.push(e,!0),t.err)throw t.msg||gs[t.err];return t.result}function urA(e,A){return A=A||{},A.raw=!0,Om(e,A)}function BrA(e,A){return A=A||{},A.gzip=!0,Om(e,A)}var ErA=pc,hrA=Om,frA=urA,QrA=BrA,drA=Ds,prA={Deflate:ErA,deflate:hrA,deflateRaw:frA,gzip:QrA,constants:drA};const vC=30,yrA=12;var mrA=function(A,t){let n,i,r,o,s,a,g,I,l,c,C,u,E,B,h,f,Q,d,w,m,v,x,D,F;const N=A.state;n=A.next_in,D=A.input,i=n+(A.avail_in-5),r=A.next_out,F=A.output,o=r-(t-A.avail_out),s=r+(A.avail_out-257),a=N.dmax,g=N.wsize,I=N.whave,l=N.wnext,c=N.window,C=N.hold,u=N.bits,E=N.lencode,B=N.distcode,h=(1<>>24,C>>>=d,u-=d,d=Q>>>16&255,d===0)F[r++]=Q&65535;else if(d&16){w=Q&65535,d&=15,d&&(u>>=d,u-=d),u<15&&(C+=D[n++]<>>24,C>>>=d,u-=d,d=Q>>>16&255,d&16){if(m=Q&65535,d&=15,ua){A.msg="invalid distance too far back",N.mode=vC;break A}if(C>>>=d,u-=d,d=r-o,m>d){if(d=m-d,d>I&&N.sane){A.msg="invalid distance too far back",N.mode=vC;break A}if(v=0,x=c,l===0){if(v+=g-d,d2;)F[r++]=x[v++],F[r++]=x[v++],F[r++]=x[v++],w-=3;w&&(F[r++]=x[v++],w>1&&(F[r++]=x[v++]))}else{v=r-m;do F[r++]=F[v++],F[r++]=F[v++],F[r++]=F[v++],w-=3;while(w>2);w&&(F[r++]=F[v++],w>1&&(F[r++]=F[v++]))}}else if(d&64){A.msg="invalid distance code",N.mode=vC;break A}else{Q=B[(Q&65535)+(C&(1<>3,n-=w,u-=w<<3,C&=(1<{const a=s.bits;let g=0,I=0,l=0,c=0,C=0,u=0,E=0,B=0,h=0,f=0,Q,d,w,m,v,x=null,D=0,F;const N=new Uint16Array(Os+1),M=new Uint16Array(Os+1);let P=null,H=0,W,J,Z;for(g=0;g<=Os;g++)N[g]=0;for(I=0;I=1&&N[c]===0;c--);if(C>c&&(C=c),c===0)return i[r++]=1<<24|64<<16|0,i[r++]=1<<24|64<<16|0,s.bits=1,0;for(l=1;l0&&(e===tx||c!==1))return-1;for(M[1]=0,g=1;gAx||e===nx&&h>ex)return 1;for(;;){W=g-E,o[I]F?(J=P[H+o[I]],Z=x[D+o[I]]):(J=32+64,Z=0),Q=1<>E)+d]=W<<24|J<<16|Z|0;while(d!==0);for(Q=1<>=1;if(Q!==0?(f&=Q-1,f+=Q):f=0,I++,--N[g]===0){if(g===c)break;g=A[t+o[I]]}if(g>C&&(f&m)!==w){for(E===0&&(E=C),v+=l,u=g-E,B=1<Ax||e===nx&&h>ex)return 1;w=f&m,i[w]=C<<24|u<<16|v-r|0}}return f!==0&&(i[v+f]=g-E<<24|64<<16|0),s.bits=C,0};var KI=RrA;const xrA=0,vk=1,Sk=2,{Z_FINISH:ix,Z_BLOCK:FrA,Z_TREES:SC,Z_OK:cs,Z_STREAM_END:NrA,Z_NEED_DICT:_rA,Z_STREAM_ERROR:Ln,Z_DATA_ERROR:Dk,Z_MEM_ERROR:Rk,Z_BUF_ERROR:LrA,Z_DEFLATED:rx}=Ds,xk=1,ox=2,sx=3,ax=4,gx=5,Ix=6,lx=7,cx=8,Cx=9,ux=10,LB=11,Mi=12,iQ=13,Bx=14,rQ=15,Ex=16,hx=17,fx=18,Qx=19,DC=20,RC=21,dx=22,px=23,yx=24,mx=25,wx=26,oQ=27,vx=28,Sx=29,ze=30,Fk=31,brA=32,GrA=852,krA=592,MrA=15,TrA=MrA,Dx=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function UrA(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Nk=e=>{if(!e||!e.state)return Ln;const A=e.state;return e.total_in=e.total_out=A.total=0,e.msg="",A.wrap&&(e.adler=A.wrap&1),A.mode=xk,A.last=0,A.havedict=0,A.dmax=32768,A.head=null,A.hold=0,A.bits=0,A.lencode=A.lendyn=new Int32Array(GrA),A.distcode=A.distdyn=new Int32Array(krA),A.sane=1,A.back=-1,cs},_k=e=>{if(!e||!e.state)return Ln;const A=e.state;return A.wsize=0,A.whave=0,A.wnext=0,Nk(e)},Lk=(e,A)=>{let t;if(!e||!e.state)return Ln;const n=e.state;return A<0?(t=0,A=-A):(t=(A>>4)+1,A<48&&(A&=15)),A&&(A<8||A>15)?Ln:(n.window!==null&&n.wbits!==A&&(n.window=null),n.wrap=t,n.wbits=A,_k(e))},bk=(e,A)=>{if(!e)return Ln;const t=new UrA;e.state=t,t.window=null;const n=Lk(e,A);return n!==cs&&(e.state=null),n},PrA=e=>bk(e,TrA);let Rx=!0,sQ,aQ;const HrA=e=>{if(Rx){sQ=new Int32Array(512),aQ=new Int32Array(32);let A=0;for(;A<144;)e.lens[A++]=8;for(;A<256;)e.lens[A++]=9;for(;A<280;)e.lens[A++]=7;for(;A<288;)e.lens[A++]=8;for(KI(vk,e.lens,0,288,sQ,0,e.work,{bits:9}),A=0;A<32;)e.lens[A++]=5;KI(Sk,e.lens,0,32,aQ,0,e.work,{bits:5}),Rx=!1}e.lencode=sQ,e.lenbits=9,e.distcode=aQ,e.distbits=5},Gk=(e,A,t,n)=>{let i;const r=e.state;return r.window===null&&(r.wsize=1<=r.wsize?(r.window.set(A.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(i=r.wsize-r.wnext,i>n&&(i=n),r.window.set(A.subarray(t-n,t-n+i),r.wnext),n-=i,n?(r.window.set(A.subarray(t-n,t),0),r.wnext=n,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave{let t,n,i,r,o,s,a,g,I,l,c,C,u,E,B=0,h,f,Q,d,w,m,v,x;const D=new Uint8Array(4);let F,N;const M=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ln;t=e.state,t.mode===Mi&&(t.mode=iQ),o=e.next_out,i=e.output,a=e.avail_out,r=e.next_in,n=e.input,s=e.avail_in,g=t.hold,I=t.bits,l=s,c=a,x=cs;A:for(;;)switch(t.mode){case xk:if(t.wrap===0){t.mode=iQ;break}for(;I<16;){if(s===0)break A;s--,g+=n[r++]<>>8&255,t.check=ut(t.check,D,2,0),g=0,I=0,t.mode=ox;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((g&255)<<8)+(g>>8))%31){e.msg="incorrect header check",t.mode=ze;break}if((g&15)!==rx){e.msg="unknown compression method",t.mode=ze;break}if(g>>>=4,I-=4,v=(g&15)+8,t.wbits===0)t.wbits=v;else if(v>t.wbits){e.msg="invalid window size",t.mode=ze;break}t.dmax=1<>8&1),t.flags&512&&(D[0]=g&255,D[1]=g>>>8&255,t.check=ut(t.check,D,2,0)),g=0,I=0,t.mode=sx;case sx:for(;I<32;){if(s===0)break A;s--,g+=n[r++]<>>8&255,D[2]=g>>>16&255,D[3]=g>>>24&255,t.check=ut(t.check,D,4,0)),g=0,I=0,t.mode=ax;case ax:for(;I<16;){if(s===0)break A;s--,g+=n[r++]<>8),t.flags&512&&(D[0]=g&255,D[1]=g>>>8&255,t.check=ut(t.check,D,2,0)),g=0,I=0,t.mode=gx;case gx:if(t.flags&1024){for(;I<16;){if(s===0)break A;s--,g+=n[r++]<>>8&255,t.check=ut(t.check,D,2,0)),g=0,I=0}else t.head&&(t.head.extra=null);t.mode=Ix;case Ix:if(t.flags&1024&&(C=t.length,C>s&&(C=s),C&&(t.head&&(v=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(r,r+C),v)),t.flags&512&&(t.check=ut(t.check,n,C,r)),s-=C,r+=C,t.length-=C),t.length))break A;t.length=0,t.mode=lx;case lx:if(t.flags&2048){if(s===0)break A;C=0;do v=n[r+C++],t.head&&v&&t.length<65536&&(t.head.name+=String.fromCharCode(v));while(v&&C>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=Mi;break;case ux:for(;I<32;){if(s===0)break A;s--,g+=n[r++]<>>=I&7,I-=I&7,t.mode=oQ;break}for(;I<3;){if(s===0)break A;s--,g+=n[r++]<>>=1,I-=1,g&3){case 0:t.mode=Bx;break;case 1:if(HrA(t),t.mode=DC,A===SC){g>>>=2,I-=2;break A}break;case 2:t.mode=hx;break;case 3:e.msg="invalid block type",t.mode=ze}g>>>=2,I-=2;break;case Bx:for(g>>>=I&7,I-=I&7;I<32;){if(s===0)break A;s--,g+=n[r++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=ze;break}if(t.length=g&65535,g=0,I=0,t.mode=rQ,A===SC)break A;case rQ:t.mode=Ex;case Ex:if(C=t.length,C){if(C>s&&(C=s),C>a&&(C=a),C===0)break A;i.set(n.subarray(r,r+C),o),s-=C,r+=C,a-=C,o+=C,t.length-=C;break}t.mode=Mi;break;case hx:for(;I<14;){if(s===0)break A;s--,g+=n[r++]<>>=5,I-=5,t.ndist=(g&31)+1,g>>>=5,I-=5,t.ncode=(g&15)+4,g>>>=4,I-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=ze;break}t.have=0,t.mode=fx;case fx:for(;t.have>>=3,I-=3}for(;t.have<19;)t.lens[M[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,F={bits:t.lenbits},x=KI(xrA,t.lens,0,19,t.lencode,0,t.work,F),t.lenbits=F.bits,x){e.msg="invalid code lengths set",t.mode=ze;break}t.have=0,t.mode=Qx;case Qx:for(;t.have>>24,f=B>>>16&255,Q=B&65535,!(h<=I);){if(s===0)break A;s--,g+=n[r++]<>>=h,I-=h,t.lens[t.have++]=Q;else{if(Q===16){for(N=h+2;I>>=h,I-=h,t.have===0){e.msg="invalid bit length repeat",t.mode=ze;break}v=t.lens[t.have-1],C=3+(g&3),g>>>=2,I-=2}else if(Q===17){for(N=h+3;I>>=h,I-=h,v=0,C=3+(g&7),g>>>=3,I-=3}else{for(N=h+7;I>>=h,I-=h,v=0,C=11+(g&127),g>>>=7,I-=7}if(t.have+C>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ze;break}for(;C--;)t.lens[t.have++]=v}}if(t.mode===ze)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=ze;break}if(t.lenbits=9,F={bits:t.lenbits},x=KI(vk,t.lens,0,t.nlen,t.lencode,0,t.work,F),t.lenbits=F.bits,x){e.msg="invalid literal/lengths set",t.mode=ze;break}if(t.distbits=6,t.distcode=t.distdyn,F={bits:t.distbits},x=KI(Sk,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,F),t.distbits=F.bits,x){e.msg="invalid distances set",t.mode=ze;break}if(t.mode=DC,A===SC)break A;case DC:t.mode=RC;case RC:if(s>=6&&a>=258){e.next_out=o,e.avail_out=a,e.next_in=r,e.avail_in=s,t.hold=g,t.bits=I,mrA(e,c),o=e.next_out,i=e.output,a=e.avail_out,r=e.next_in,n=e.input,s=e.avail_in,g=t.hold,I=t.bits,t.mode===Mi&&(t.back=-1);break}for(t.back=0;B=t.lencode[g&(1<>>24,f=B>>>16&255,Q=B&65535,!(h<=I);){if(s===0)break A;s--,g+=n[r++]<>d)],h=B>>>24,f=B>>>16&255,Q=B&65535,!(d+h<=I);){if(s===0)break A;s--,g+=n[r++]<>>=d,I-=d,t.back+=d}if(g>>>=h,I-=h,t.back+=h,t.length=Q,f===0){t.mode=wx;break}if(f&32){t.back=-1,t.mode=Mi;break}if(f&64){e.msg="invalid literal/length code",t.mode=ze;break}t.extra=f&15,t.mode=dx;case dx:if(t.extra){for(N=t.extra;I>>=t.extra,I-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=px;case px:for(;B=t.distcode[g&(1<>>24,f=B>>>16&255,Q=B&65535,!(h<=I);){if(s===0)break A;s--,g+=n[r++]<>d)],h=B>>>24,f=B>>>16&255,Q=B&65535,!(d+h<=I);){if(s===0)break A;s--,g+=n[r++]<>>=d,I-=d,t.back+=d}if(g>>>=h,I-=h,t.back+=h,f&64){e.msg="invalid distance code",t.mode=ze;break}t.offset=Q,t.extra=f&15,t.mode=yx;case yx:if(t.extra){for(N=t.extra;I>>=t.extra,I-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ze;break}t.mode=mx;case mx:if(a===0)break A;if(C=c-a,t.offset>C){if(C=t.offset-C,C>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ze;break}C>t.wnext?(C-=t.wnext,u=t.wsize-C):u=t.wnext-C,C>t.length&&(C=t.length),E=t.window}else E=i,u=o-t.offset,C=t.length;C>a&&(C=a),a-=C,t.length-=C;do i[o++]=E[u++];while(--C);t.length===0&&(t.mode=RC);break;case wx:if(a===0)break A;i[o++]=t.length,a--,t.mode=RC;break;case oQ:if(t.wrap){for(;I<32;){if(s===0)break A;s--,g|=n[r++]<{if(!e||!e.state)return Ln;let A=e.state;return A.window&&(A.window=null),e.state=null,cs},OrA=(e,A)=>{if(!e||!e.state)return Ln;const t=e.state;return t.wrap&2?(t.head=A,A.done=!1,cs):Ln},YrA=(e,A)=>{const t=A.length;let n,i,r;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==LB)?Ln:n.mode===LB&&(i=1,i=_l(i,A,t,0),i!==n.check)?Dk:(r=Gk(e,A,t,t),r?(n.mode=Fk,Rk):(n.havedict=1,cs))};var KrA=_k,VrA=Lk,WrA=Nk,zrA=PrA,jrA=bk,XrA=qrA,ZrA=JrA,$rA=OrA,AoA=YrA,eoA="pako inflate (from Nodeca project)",Hi={inflateReset:KrA,inflateReset2:VrA,inflateResetKeep:WrA,inflateInit:zrA,inflateInit2:jrA,inflate:XrA,inflateEnd:ZrA,inflateGetHeader:$rA,inflateSetDictionary:AoA,inflateInfo:eoA};function toA(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var noA=toA;const kk=Object.prototype.toString,{Z_NO_FLUSH:ioA,Z_FINISH:roA,Z_OK:Gl,Z_STREAM_END:gQ,Z_NEED_DICT:IQ,Z_STREAM_ERROR:ooA,Z_DATA_ERROR:xx,Z_MEM_ERROR:soA}=Ds;function yc(e){this.options=zE.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const A=this.options;A.raw&&A.windowBits>=0&&A.windowBits<16&&(A.windowBits=-A.windowBits,A.windowBits===0&&(A.windowBits=-15)),A.windowBits>=0&&A.windowBits<16&&!(e&&e.windowBits)&&(A.windowBits+=32),A.windowBits>15&&A.windowBits<48&&(A.windowBits&15||(A.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new mk,this.strm.avail_out=0;let t=Hi.inflateInit2(this.strm,A.windowBits);if(t!==Gl)throw new Error(gs[t]);if(this.header=new noA,Hi.inflateGetHeader(this.strm,this.header),A.dictionary&&(typeof A.dictionary=="string"?A.dictionary=bl.string2buf(A.dictionary):kk.call(A.dictionary)==="[object ArrayBuffer]"&&(A.dictionary=new Uint8Array(A.dictionary)),A.raw&&(t=Hi.inflateSetDictionary(this.strm,A.dictionary),t!==Gl)))throw new Error(gs[t])}yc.prototype.push=function(e,A){const t=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let r,o,s;if(this.ended)return!1;for(A===~~A?o=A:o=A===!0?roA:ioA,kk.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),r=Hi.inflate(t,o),r===IQ&&i&&(r=Hi.inflateSetDictionary(t,i),r===Gl?r=Hi.inflate(t,o):r===xx&&(r=IQ));t.avail_in>0&&r===gQ&&t.state.wrap>0&&e[t.next_in]!==0;)Hi.inflateReset(t),r=Hi.inflate(t,o);switch(r){case ooA:case xx:case IQ:case soA:return this.onEnd(r),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||r===gQ))if(this.options.to==="string"){let a=bl.utf8border(t.output,t.next_out),g=t.next_out-a,I=bl.buf2string(t.output,a);t.next_out=g,t.avail_out=n-g,g&&t.output.set(t.output.subarray(a,a+g),0),this.onData(I)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(r===Gl&&s===0)){if(r===gQ)return r=Hi.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};yc.prototype.onData=function(e){this.chunks.push(e)};yc.prototype.onEnd=function(e){e===Gl&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=zE.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ym(e,A){const t=new yc(A);if(t.push(e),t.err)throw t.msg||gs[t.err];return t.result}function aoA(e,A){return A=A||{},A.raw=!0,Ym(e,A)}var goA=yc,IoA=Ym,loA=aoA,coA=Ym,CoA=Ds,uoA={Inflate:goA,inflate:IoA,inflateRaw:loA,ungzip:coA,constants:CoA};const{Deflate:BoA,deflate:EoA,deflateRaw:hoA,gzip:foA}=prA,{Inflate:QoA,inflate:doA,inflateRaw:poA,ungzip:yoA}=uoA;var moA=BoA,woA=EoA,voA=hoA,SoA=foA,DoA=QoA,RoA=doA,xoA=poA,FoA=yoA,NoA=Ds,bB={Deflate:moA,deflate:woA,deflateRaw:voA,gzip:SoA,Inflate:DoA,inflate:RoA,inflateRaw:xoA,ungzip:FoA,constants:NoA},xC;const _oA=(xC=class{constructor(e=1){if(e<0||e>9)throw new Error("Invalid gzip compression level, it should be between 0 and 9");this.level=e}static fromConfig({level:e}){return new xC(e)}encode(e){return bB.gzip(e,{level:this.level})}decode(e,A){const t=bB.ungzip(e);return A!==void 0?(A.set(t),A):t}},xC.codecId="gzip",xC);var Fx=_oA,FC;const LoA=(FC=class{constructor(e=1){if(e<-1||e>9)throw new Error("Invalid zlib compression level, it should be between -1 and 9");this.level=e}static fromConfig({level:e}){return new FC(e)}encode(e){return bB.deflate(e,{level:this.level})}decode(e,A){const t=bB.inflate(e);return A!==void 0?(A.set(t),A):t}},FC.codecId="zlib",FC);var Nx=LoA,boA=function(){return typeof document<"u"&&document.currentScript&&document.currentScript.src,function(e){e=e||{};var A;A||(A=typeof e<"u"?e:{});var t,n;A.ready=new Promise(function(_,G){t=_,n=G});var i={},r;for(r in A)A.hasOwnProperty(r)&&(i[r]=A[r]);var o="./this.program",s=A.print||console.log.bind(console),a=A.printErr||console.warn.bind(console);for(r in i)i.hasOwnProperty(r)&&(A[r]=i[r]);i=null,A.thisProgram&&(o=A.thisProgram);var g;A.wasmBinary&&(g=A.wasmBinary),A.noExitRuntime&&A.noExitRuntime,typeof WebAssembly!="object"&&nA("no native wasm support detected");var I,l=!1,c=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function C(_,G,U){var V=G+U;for(U=G;_[U]&&!(U>=V);)++U;if(16X?V+=String.fromCharCode(X):(X-=65536,V+=String.fromCharCode(55296|X>>10,56320|X&1023))}}else V+=String.fromCharCode(X)}return V}function u(_,G,U){var V=x;if(0=tA){var mA=_.charCodeAt(++X);tA=65536+((tA&1023)<<10)|mA&1023}if(127>=tA){if(G>=U)break;V[G++]=tA}else{if(2047>=tA){if(G+1>=U)break;V[G++]=192|tA>>6}else{if(65535>=tA){if(G+2>=U)break;V[G++]=224|tA>>12}else{if(G+3>=U)break;V[G++]=240|tA>>18,V[G++]=128|tA>>12&63}V[G++]=128|tA>>6&63}V[G++]=128|tA&63}}V[G]=0}}var E=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function B(_,G){for(var U=_>>1,V=U+G/2;!(U>=V)&&F[U];)++U;if(U<<=1,32>1];if(X==0||U==G/2)return V;++U,V+=String.fromCharCode(X)}}function h(_,G,U){if(U===void 0&&(U=2147483647),2>U)return 0;U-=2;var V=G;U=U<2*_.length?U/2:_.length;for(var X=0;X>1]=_.charCodeAt(X),G+=2;return D[G>>1]=0,G-V}function f(_){return 2*_.length}function Q(_,G){for(var U=0,V="";!(U>=G/4);){var X=N[_+4*U>>2];if(X==0)break;++U,65536<=X?(X-=65536,V+=String.fromCharCode(55296|X>>10,56320|X&1023)):V+=String.fromCharCode(X)}return V}function d(_,G,U){if(U===void 0&&(U=2147483647),4>U)return 0;var V=G;U=V+U-4;for(var X=0;X<_.length;++X){var tA=_.charCodeAt(X);if(55296<=tA&&57343>=tA){var mA=_.charCodeAt(++X);tA=65536+((tA&1023)<<10)|mA&1023}if(N[G>>2]=tA,G+=4,G+4>U)break}return N[G>>2]=0,G-V}function w(_){for(var G=0,U=0;U<_.length;++U){var V=_.charCodeAt(U);55296<=V&&57343>=V&&++U,G+=4}return G}var m,v,x,D,F,N,M,P,H;function W(_){m=_,A.HEAP8=v=new Int8Array(_),A.HEAP16=D=new Int16Array(_),A.HEAP32=N=new Int32Array(_),A.HEAPU8=x=new Uint8Array(_),A.HEAPU16=F=new Uint16Array(_),A.HEAPU32=M=new Uint32Array(_),A.HEAPF32=P=new Float32Array(_),A.HEAPF64=H=new Float64Array(_)}var J=A.INITIAL_MEMORY||16777216;A.wasmMemory?I=A.wasmMemory:I=new WebAssembly.Memory({initial:J/65536,maximum:32768}),I&&(m=I.buffer),J=m.byteLength,W(m);var Z,z=[],O=[],Y=[],T=[];function q(){var _=A.preRun.shift();z.unshift(_)}var j=0,AA=null;A.preloadedImages={},A.preloadedAudios={};function nA(_){throw A.onAbort&&A.onAbort(_),a(_),l=!0,_=new WebAssembly.RuntimeError("abort("+_+"). Build with -s ASSERTIONS=1 for more info."),n(_),_}function IA(_){var G=BA;return String.prototype.startsWith?G.startsWith(_):G.indexOf(_)===0}function aA(){return IA("data:application/octet-stream;base64,")}var BA="blosc_codec.wasm";if(!aA()){var lA=BA;BA=A.locateFile?A.locateFile(lA,""):""+lA}function MA(){try{if(g)return new Uint8Array(g);throw"both async and sync fetching of the wasm failed"}catch(_){nA(_)}}function EA(_){for(;0<_.length;){var G=_.shift();if(typeof G=="function")G(A);else{var U=G.T;typeof U=="number"?G.O===void 0?Z.get(U)():Z.get(U)(G.O):U(G.O===void 0?null:G.O)}}}function pA(_){this.N=_-16,this.$=function(G){N[this.N+8>>2]=G},this.X=function(G){N[this.N+0>>2]=G},this.Y=function(){N[this.N+4>>2]=0},this.W=function(){v[this.N+12>>0]=0},this.Z=function(){v[this.N+13>>0]=0},this.V=function(G,U){this.$(G),this.X(U),this.Y(),this.W(),this.Z()}}function qA(_){switch(_){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+_)}}var NA=void 0;function JA(_){for(var G="";x[_];)G+=NA[x[_++]];return G}var dA={},GA={},ie={};function Ie(_){if(_===void 0)return"_unknown";_=_.replace(/[^a-zA-Z0-9_]/g,"$");var G=_.charCodeAt(0);return 48<=G&&57>=G?"_"+_:_}function he(_,G){return _=Ie(_),new Function("body","return function "+_+`() { "use strict"; return body.apply(this, arguments); }; `)(G)}function XA(_){var G=Error,U=he(_,function(V){this.name=_,this.message=V,V=Error(V).stack,V!==void 0&&(this.stack=this.toString()+` @@ -3892,8 +3892,8 @@ void main(void) { `),u,A)}if(!(s&&a)&&n){const{viewport:u}=this.context;return Yx(`Loading Volume ${String((I||0)*100).slice(0,5)}%...`,u,A)}return new Aw(this.props,{channelData:{data:o,width:s,height:a,depth:g},id:`XR3DLayer-0-${a}-${s}-0-${t}-${A}`,physicalSizeScalingMatrix:l,parameters:{[uA.CULL_FACE]:!0,[uA.CULL_FACE_MODE]:uA.FRONT,[uA.DEPTH_TEST]:!1,blendFunc:[uA.SRC_ALPHA,uA.ONE],blend:!0},resolutionMatrix:c,dtype:r})}};ew.layerName="VolumeLayer";ew.defaultProps=JaA;const OaA=typeof window<"u"?p.useLayoutEffect:p.useEffect,YaA=OaA;function TB(e,A){for(;e;){if(e===A)return!0;e=Object.getPrototypeOf(e)}return!1}const KaA={position:"absolute",zIndex:-1};function AM(e,A){if(typeof e=="function")return e(A);if(Array.isArray(e))return e.map(t=>AM(t,A));if($E(e)){if(VaA(e))return A.style=KaA,p.cloneElement(e,A);if(WaA(e))return p.cloneElement(e,A)}return e}function $E(e){return e&&typeof e=="object"&&"type"in e||!1}function VaA(e){const A=e.type,t=A&&A.defaultProps;return t&&t.mapStyle}function WaA(e){const A=e.type;return A&&A.deckGLViewProps}function q0(e){if(typeof e=="function")return p.createElement(io,{},e);if(Array.isArray(e))return e.map(q0);if($E(e)){if(e.type===p.Fragment)return q0(e.props.children);if(TB(e.type,io))return e}return e}function zaA({children:e,layers:A=[],views:t=null}){const n=[],i=[],r={};return p.Children.forEach(q0(e),o=>{if($E(o)){const s=o.type;if(TB(s,dn)){const a=jaA(s,o.props);i.push(a)}else n.push(o);if(TB(s,io)&&s!==io&&o.props.id){const a=new s(o.props);r[a.id]=a}}else o&&n.push(o)}),Object.keys(r).length>0&&(Array.isArray(t)?t.forEach(o=>{r[o.id]=o}):t&&(r[t.id]=t),t=Object.values(r)),A=i.length>0?[...i,...A]:A,{layers:A,children:n,views:t}}function jaA(e,A){const t={},n=e.defaultProps||{};for(const i in A)n[i]!==A[i]&&(t[i]=A[i]);return new e(t)}function XaA({children:e,deck:A,ContextProvider:t}){const{viewManager:n}=A||{};if(!n||!n.views.length)return[];const i={},r=n.views[0].id;for(const o of e){let s=r,a=o;$E(o)&&TB(o.type,io)&&(s=o.props.id||r,a=o.props.children);const g=n.getViewport(s),I=n.getViewState(s);if(g){const{x:l,y:c,width:C,height:u}=g;a=AM(a,{x:l,y:c,width:C,height:u,viewport:g,viewState:I}),i[s]||(i[s]={viewport:g,children:[]}),i[s].children.push(a)}}return Object.keys(i).map(o=>{const{viewport:s,children:a}=i[o],{x:g,y:I,width:l,height:c}=s,C={position:"absolute",left:g,top:I,width:l,height:c},u="view-".concat(o),E=p.createElement("div",{key:u,id:u,style:C},...a);if(t){const B={viewport:s,container:A.canvas.offsetParent,eventManager:A.eventManager,onViewStateChange:h=>{h.viewId=o,A._onViewStateChange(h)}};return p.createElement(t,{key:u,value:B},E)}return E})}const ZaA={mixBlendMode:null};function $aA({width:e,height:A,style:t}){const n={position:"absolute",zIndex:0,left:0,top:0,width:e,height:A},i={left:0,top:0};if(t)for(const r in t)r in ZaA?i[r]=t[r]:n[r]=t[r];return{containerStyle:n,canvasStyle:i}}function AgA(e){return{get deck(){return e.deck},pickObject:A=>e.deck.pickObject(A),pickMultipleObjects:A=>e.deck.pickMultipleObjects(A),pickObjects:A=>e.deck.pickObjects(A)}}function eM(e){e.redrawReason&&(e.deck._drawLayers(e.redrawReason),e.redrawReason=null)}function egA(e,A,t){const n=new A({...t,_customRender:i=>{e.redrawReason=i;const r=n.getViewports();e.lastRenderedViewports!==r?e.forceUpdate():eM(e)}});return n}const tM=p.forwardRef((e,A)=>{const[t,n]=p.useState(0),r=p.useRef({control:null,version:t,forceUpdate:()=>n(w=>w+1)}).current,o=p.useRef(null),s=p.useRef(null),a=p.useMemo(()=>zaA(e),[e.layers,e.views,e.children]);let g=!0;const I=w=>{var m;return g&&e.viewState?(r.viewStateUpdateRequested=w,null):(r.viewStateUpdateRequested=null,(m=e.onViewStateChange)===null||m===void 0?void 0:m.call(e,w))},l=w=>{if(g)r.interactionStateUpdateRequested=w;else{var m;r.interactionStateUpdateRequested=null,(m=e.onInteractionStateChange)===null||m===void 0||m.call(e,w)}},c=p.useMemo(()=>{const w={...e,style:null,width:"100%",height:"100%",parent:o.current,canvas:s.current,layers:a.layers,views:a.views,onViewStateChange:I,onInteractionStateChange:l};return delete w._customRender,r.deck&&r.deck.setProps(w),w},[e]);p.useEffect(()=>{const w=e.Deck||_E;return r.deck=egA(r,w,{...c,parent:o.current,canvas:s.current}),()=>{var m;return(m=r.deck)===null||m===void 0?void 0:m.finalize()}},[]),YaA(()=>{eM(r);const{viewStateUpdateRequested:w,interactionStateUpdateRequested:m}=r;w&&I(w),m&&l(m)}),p.useImperativeHandle(A,()=>AgA(r),[]);const C=r.deck&&r.deck.isInitialized?r.deck.getViewports():void 0,{ContextProvider:u,width:E,height:B,id:h,style:f}=e,{containerStyle:Q,canvasStyle:d}=p.useMemo(()=>$aA({width:E,height:B,style:f}),[E,B,f]);if(!r.viewStateUpdateRequested&&r.lastRenderedViewports===C||r.version!==t){r.lastRenderedViewports=C,r.version=t;const w=XaA({children:a.children,deck:r.deck,ContextProvider:u}),m=p.createElement("canvas",{key:"canvas",id:h||"deckgl-overlay",ref:s,style:d});r.control=p.createElement("div",{id:"".concat(h||"deckgl","-wrapper"),ref:o,style:Q},[m,w])}return g=!1,r.control});tM.defaultProps=_E.defaultProps;const tgA=tM;class Ah{constructor({id:A,x:t=0,y:n=0,height:i,width:r}){this.width=r,this.height=i,this.id=A,this.x=t,this.y=n}getDeckGlView(){return new cc({controller:!0,id:this.id,height:this.height,width:this.width,x:this.x,y:this.y})}filterViewState({viewState:A}){const{id:t,height:n,width:i}=this;return A.id===t?{height:n,width:i,...A}:null}getLayers({viewStates:A,props:t}){}}function Cs(e){return`-#${e}#`}function eh(e,A,t=0,n=!1,i){const r=Array.isArray(e)?e[0]:e,{width:o,height:s}=ho(r),a=(i||new Se).getScale(),[g,I]=[a[0]*o,a[1]*s],l=r.shape[r.labels.indexOf("z")],c=Math.log2(Math.min(A.width/g,A.height/I))-t,C=Jk(r);return{target:(i||new Se).transformPoint((n?C:new Se).transformPoint([o/2,s/2,n?l/2:0])),zoom:c}}function nM(e,A){var o,s;const{loader:t}=A,n=(s=(o=t[0])==null?void 0:o.constructor)==null?void 0:s.name,i=t.length>1?Zm:wc,r=t.length>1?t:t[0];return new i({...A,id:`${n}${Cs(e)}`,viewportId:e,loader:r})}const fu="overview";class ngA extends FE{constructor(A){super(A),this.events=["click"]}handleEvent(A){if(A.type!=="click")return;let[t,n]=this.getCenter(A);const{width:i,height:r,zoom:o,scale:s}=this.props;if(t<0||n<0||t>i||n>r)return;const a=1/(2**o*s);t*=a,n*=a,this.onViewStateChange&&this.onViewStateChange({viewState:{target:[t,n,0]}})}}class igA extends Ah{constructor({id:A,loader:t,detailHeight:n,detailWidth:i,scale:r=.2,margin:o=25,position:s="bottom-right",minimumWidth:a=150,maximumWidth:g=350,minimumHeight:I=150,maximumHeight:l=350,clickCenter:c=!0}){super({id:A}),this.margin=o,this.loader=t,this.position=s,this.detailHeight=n,this.detailWidth=i,this._setHeightWidthScale({detailWidth:i,detailHeight:n,scale:r,minimumWidth:a,maximumWidth:g,minimumHeight:I,maximumHeight:l}),this._setXY(),this.clickCenter=c}_setHeightWidthScale({detailWidth:A,detailHeight:t,scale:n,minimumWidth:i,maximumWidth:r,minimumHeight:o,maximumHeight:s}){const a=this.loader.length,{width:g,height:I}=ho(this.loader[0]);if(this._imageWidth=g,this._imageHeight=I,g>I){const l=I/g;this.width=Math.min(r,Math.max(A*n,i)),this.height=this.width*l,this.scale=2**(a-1)/g*this.width}else{const l=g/I;this.height=Math.min(s,Math.max(t*n,o)),this.width=this.height*l,this.scale=2**(a-1)/I*this.height}}_setXY(){const{height:A,width:t,margin:n,position:i,detailWidth:r,detailHeight:o}=this;switch(i){case"bottom-right":{this.x=r-t-n,this.y=o-A-n;break}case"top-right":{this.x=r-t-n,this.y=n;break}case"top-left":{this.x=n,this.y=n;break}case"bottom-left":{this.x=n,this.y=o-A-n;break}default:throw new Error("overviewLocation prop needs to be one of ['bottom-right', 'top-right', 'top-left', 'bottom-left']")}}getDeckGlView(){const{scale:A,clickCenter:t}=this,n=t&&{type:ngA,scale:A};return new cc({controller:n,id:this.id,height:this.height,width:this.width,x:this.x,y:this.y,clear:!0})}filterViewState({viewState:A}){const{_imageWidth:t,_imageHeight:n,scale:i}=this;return{...A,height:this.height,width:this.width,id:this.id,target:[t*i/2,n*i/2,0],zoom:-(this.loader.length-1)}}getLayers({viewStates:A,props:t}){const{detail:n,overview:i}=A;if(!n)throw new Error("Overview requires a viewState with id detail");const r=Vm(n).map(s=>s.map(a=>a*this.scale));return[new $m(t,{id:Cs(this.id),boundingBox:r,overviewScale:this.scale,zoom:-i.zoom})]}}const cQ="detail";class rgA extends Ah{constructor({id:A,x:t=0,y:n=0,height:i,width:r,snapScaleBar:o=!1}){super({id:A,x:t,y:n,height:i,width:r}),this.snapScaleBar=o}getLayers({props:A,viewStates:t}){var g,I,l;const{loader:n}=A,{id:i,height:r,width:o}=this,s=t[i],a=[nM(i,A)];if((l=(I=(g=n[0])==null?void 0:g.meta)==null?void 0:I.physicalSizes)!=null&&l.x){const{size:c,unit:C}=n[0].meta.physicalSizes.x;a.push(new ZE({id:Cs(i),loader:n,unit:C,size:c,snap:this.snapScaleBar,viewState:{...s,height:r,width:o}}))}return a}filterViewState({viewState:A,currentViewState:t}){if(A.id===fu){const{target:n}=A;if(n)return{...t,target:n}}return super.filterViewState({viewState:A})}}class Kx extends Ah{constructor({id:A,x:t=0,y:n=0,height:i,width:r,linkedIds:o=[],panLock:s=!0,zoomLock:a=!0,viewportOutlineColor:g=[255,255,255],viewportOutlineWidth:I=10,snapScaleBar:l=!1}){super({id:A,x:t,y:n,height:i,width:r}),this.linkedIds=o,this.panLock=s,this.zoomLock=a,this.viewportOutlineColor=g,this.viewportOutlineWidth=I,this.snapScaleBar=l}filterViewState({viewState:A,oldViewState:t,currentViewState:n}){const{id:i}=A,{id:r,linkedIds:o,panLock:s,zoomLock:a}=this;if(t&&o.indexOf(i)!==-1&&(a||s)){const g={height:n.height,width:n.width,target:[],zoom:null},[I,l]=n.target;if(a){const c=A.zoom-t.zoom;g.zoom=n.zoom+c}else g.zoom=n.zoom;if(s){const[c,C]=t.target,[u,E]=A.target,B=u-c,h=E-C;g.target.push(I+B),g.target.push(l+h)}else g.target.push(I),g.target.push(l);return{id:r,target:g.target,zoom:g.zoom,height:g.height,width:g.width}}return A.id===r?{id:r,target:A.target,zoom:A.zoom,height:A.height,width:A.width}:{id:r,target:n.target,zoom:n.zoom,height:n.height,width:n.width}}getLayers({props:A,viewStates:t}){var C,u,E;const{loader:n}=A,{id:i,viewportOutlineColor:r,viewportOutlineWidth:o,height:s,width:a}=this,g=t[i],I=Vm({...g,height:s,width:a}),l=[nM(i,A)],c=new Sl({id:`viewport-outline-${Cs(i)}`,coordinateSystem:YA.CARTESIAN,data:[I],getPolygon:B=>B,filled:!1,stroked:!0,getLineColor:r,getLineWidth:o*2**-g.zoom});if(l.push(c),(E=(u=(C=n[0])==null?void 0:C.meta)==null?void 0:u.physicalSizes)!=null&&E.x){const{size:B,unit:h}=n[0].meta.physicalSizes.x;l.push(new ZE({id:Cs(i),loader:n,unit:h,size:B,snap:this.snapScaleBar,viewState:{...g,height:s,width:a}}))}return l}}class ogA extends Ah{constructor({target:A,useFixedAxis:t,...n}){super(n),this.target=A,this.useFixedAxis=t}getDeckGlView(){const{height:A,width:t,id:n,x:i,y:r}=this;return new Ub({id:n,controller:!0,height:A,width:t,x:i,y:r,orbitAxis:"Y"})}filterViewState({viewState:A}){const{id:t,target:n,useFixedAxis:i}=this;return A.id===t?{...A,target:i?n:A.target}:null}getLayers({props:A}){const{loader:t}=A,{id:n}=this;return[new ew(A,{id:`${t.type}${Cs(n)}`})]}}var sgA=function e(A,t){if(A===t)return!0;if(A&&t&&typeof A=="object"&&typeof t=="object"){if(A.constructor!==t.constructor)return!1;var n,i,r;if(Array.isArray(A)){if(n=A.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!e(A[i],t[i]))return!1;return!0}if(A.constructor===RegExp)return A.source===t.source&&A.flags===t.flags;if(A.valueOf!==Object.prototype.valueOf)return A.valueOf()===t.valueOf();if(A.toString!==Object.prototype.toString)return A.toString()===t.toString();if(r=Object.keys(A),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){var o=r[i];if(!e(A[o],t[o]))return!1}return!0}return A!==A&&t!==t};const agA=Gn(sgA),ggA=(e,A)=>A===e||(e==null?void 0:e.zoom)===(A==null?void 0:A.zoom)&&(e==null?void 0:e.rotationX)===(A==null?void 0:A.rotationX)&&(e==null?void 0:e.rotationOrbit)===(A==null?void 0:A.rotationOrbit)&&agA(e==null?void 0:e.target,A==null?void 0:A.target);class IgA extends p.PureComponent{constructor(A){super(A),this.state={viewStates:{}};const{viewStates:t}=this.state,{views:n,viewStates:i}=this.props;n.forEach(r=>{t[r.id]=r.filterViewState({viewState:i.find(o=>o.id===r.id)})}),this._onViewStateChange=this._onViewStateChange.bind(this),this.layerFilter=this.layerFilter.bind(this),this.onHover=this.onHover.bind(this)}layerFilter({layer:A,viewport:t}){return A.id.includes(Cs(t.id))}_onViewStateChange({viewId:A,viewState:t,interactionState:n,oldViewState:i}){const{views:r,onViewStateChange:o}=this.props;return t=o&&o({viewId:A,viewState:t,interactionState:n,oldViewState:i})||t,this.setState(s=>{const a={};return r.forEach(g=>{const I=s.viewStates[g.id];a[g.id]=g.filterViewState({viewState:{...t,id:A},oldViewState:i,currentViewState:I})}),{viewStates:a}}),t}componentDidUpdate(A){const{props:t}=this,{views:n}=t,i={...this.state.viewStates};let r=!1;n.forEach(o=>{var l,c;const s=(l=t.viewStates)==null?void 0:l.find(C=>C.id===o.id);if(!s)return;const a=(c=A.viewStates)==null?void 0:c.find(C=>C.id===o.id);if(ggA(s,a))return;r=!0;const{height:g,width:I}=o;i[o.id]=o.filterViewState({viewState:{...s,height:g,width:I,id:o.id}})}),r&&this.setState({viewStates:i})}static getDerivedStateFromProps(A,t){const{views:n,viewStates:i}=A;if(n.some(r=>!t.viewStates[r.id]||r.height!==t.viewStates[r.id].height||r.width!==t.viewStates[r.id].width)){const r={};return n.forEach(o=>{const{height:s,width:a}=o,g=t.viewStates[o.id];r[o.id]=o.filterViewState({viewState:{...g||i.find(I=>I.id===o.id),height:s,width:a,id:o.id}})}),{viewStates:r}}return t}onHover(A,t){const{tile:n,coordinate:i,sourceLayer:r}=A,{onHover:o,hoverHooks:s}=this.props;if(o&&o(A,t),!s||!i||!r)return null;const{handleValue:a=()=>{},handleCoordnate:g=()=>{}}=s;let I;if(r.id.includes("Tiled")){if(!(n!=null&&n.content))return null;const{content:l,bbox:c,index:{z:C}}=n;if(!l.data||!c)return null;const{data:u,width:E,height:B}=l,{left:h,right:f,top:Q,bottom:d}=c,w=[h,u.heightD[x])}else{const{channelData:l}=r.props;if(!l)return null;const{data:c,width:C,height:u}=l;if(!c||!C||!u)return null;const E=[0,u,C,0],{zoom:B}=r.context.viewport,h=Math.max(1,2**Math.floor(-B)),f=[Math.floor((i[0]-E[0])/h),Math.floor((i[1]-E[3])/h)],Q=f[1]*C+f[0];I=c.map(d=>d[Q])}a(I),g(i)}_renderLayers(){const{onHover:A}=this,{viewStates:t}=this.state,{views:n,layerProps:i}=this.props;return n.map((r,o)=>r.getLayers({viewStates:t,props:{...i[o],onHover:A}}))}render(){const{views:A,randomize:t,useDevicePixels:n=!0,deckProps:i}=this.props,{viewStates:r}=this.state,o=A.map(s=>s.getDeckGlView());if(t){const s=Math.random(),a=o[0],g=s*1.49,I=Math.round(g*(A.length-1));o[0]=o[I],o[I]=a}return b.jsx(tgA,{...i??{},layerFilter:this.layerFilter,layers:(i==null?void 0:i.layers)===void 0?[...this._renderLayers()]:[...this._renderLayers(),...i.layers],onViewStateChange:this._onViewStateChange,views:o,viewState:r,useDevicePixels:n,getCursor:({isDragging:s})=>s?"grabbing":"crosshair"})}}const tw=e=>b.jsx(IgA,{...e}),lgA=e=>{const{loader:A,contrastLimits:t,colors:n,channelsVisible:i,viewStates:r,colormap:o,overview:s,overviewOn:a,selections:g,hoverHooks:I={handleValue:()=>{},handleCoordinate:()=>{}},height:l,width:c,lensEnabled:C=!1,lensSelection:u=0,lensRadius:E=100,lensBorderColor:B=[255,255,255],lensBorderRadius:h=.02,clickCenter:f=!0,transparentColor:Q,snapScaleBar:d=!1,onViewStateChange:w,onHover:m,onViewportLoad:v,extensions:x=[new xs],deckProps:D}=e,F=r==null?void 0:r.find(Z=>Z.id===cQ),N=p.useMemo(()=>F||eh(A,{height:l,width:c},.5),[A,F]),M=new rgA({id:cQ,height:l,width:c,snapScaleBar:d}),P={loader:A,contrastLimits:t,colors:n,channelsVisible:i,selections:g,onViewportLoad:v,colormap:o,lensEnabled:C,lensSelection:u,lensRadius:E,lensBorderColor:B,lensBorderRadius:h,extensions:x,transparentColor:Q},H=[M],W=[P],J=[{...N,id:cQ}];if(a&&A){const Z=(r==null?void 0:r.find(O=>O.id===fu))||{...N,id:fu},z=new igA({id:fu,loader:A,detailHeight:l,detailWidth:c,clickCenter:f,...s});H.push(z),W.push({...P,lensEnabled:!1}),J.push(Z)}return A?b.jsx(tw,{layerProps:W,views:H,viewStates:J,hoverHooks:I,onViewStateChange:w,onHover:m,deckProps:D}):null},cgA=e=>{const{loader:A,contrastLimits:t,colors:n,channelsVisible:i,viewStates:r,colormap:o,panLock:s,selections:a,zoomLock:g,height:I,width:l,lensEnabled:c=!1,lensSelection:C=0,lensRadius:u=100,lensBorderColor:E=[255,255,255],lensBorderRadius:B=.02,transparentColor:h,snapScaleBar:f=!1,onViewStateChange:Q,onHover:d,onViewportLoad:w,extensions:m=[new xs],deckProps:v}=e,x=r==null?void 0:r.find(J=>J.id==="left"),D=r==null?void 0:r.find(J=>J.id==="right"),F=p.useMemo(()=>{if(x&&D)return r;const J=eh(A,{height:I,width:l/2},.5);return[x||{...J,id:"left"},D||{...J,id:"right"}]},[A,x,D]),N=new Kx({id:"left",linkedIds:["right"],panLock:s,zoomLock:g,height:I,width:l/2,snapScaleBar:f}),M=new Kx({id:"right",x:l/2,linkedIds:["left"],panLock:s,zoomLock:g,height:I,width:l/2,snapScaleBar:f}),P={loader:A,contrastLimits:t,colors:n,channelsVisible:i,selections:a,onViewportLoad:w,colormap:o,lensEnabled:c,lensSelection:C,lensRadius:u,lensBorderColor:E,lensBorderRadius:B,extensions:m,transparentColor:h},H=[M,N],W=[P,P];return A?b.jsx(tw,{layerProps:W,views:H,randomize:!0,onViewStateChange:Q,onHover:d,viewStates:F,deckProps:v}):null},CgA=e=>{const{loader:A,contrastLimits:t,colors:n,channelsVisible:i,selections:r,colormap:o,resolution:s=Math.max(0,A.length-1),modelMatrix:a,onViewStateChange:g,xSlice:I=null,ySlice:l=null,zSlice:c=null,onViewportLoad:C,height:u,width:E,viewStates:B,clippingPlanes:h=[],useFixedAxis:f=!0,extensions:Q=[new XE.AdditiveBlendExtension]}=e,d=B==null?void 0:B.find(N=>(N==null?void 0:N.id)==="3d"),w=p.useMemo(()=>d||{...eh(A,{height:u,width:E},1,!0,a),rotationX:0,rotationOrbit:0},[A,s,a]),m=[d||{...w,id:"3d"}],v=new ogA({id:"3d",target:m[0].target,useFixedAxis:f}),x={loader:A,contrastLimits:t,colors:n,channelsVisible:i,selections:r,colormap:o,xSlice:I,ySlice:l,zSlice:c,resolution:s,extensions:Q,modelMatrix:a,onViewportLoad:()=>setTimeout(C,0),clippingPlanes:h},D=[v],F=[x];return A?b.jsx(tw,{layerProps:F,views:D,viewStates:m,onViewStateChange:g,useDevicePixels:!1}):null},ugA=e=>e.charAt(0).toUpperCase()+e.slice(1),nw=(e,A)=>{const t={};return Object.entries(e).forEach(([n,i])=>{typeof i=="boolean"&&(t[`toggle${ugA(n)}`]=()=>A(r=>({...r,[n]:!r[n]})))}),t},BgA={channelsVisible:[],contrastLimits:[],colors:[],domains:[],selections:[],ids:[],loader:[{labels:[],shape:[]}],image:0},CQ={channelsVisible:!0,contrastLimits:[0,65535],colors:[255,255,255],domains:[0,65535],selections:{z:0,c:0,t:0},ids:""},bn=py(e=>({...BgA,...nw(CQ,e),toggleIsOn:A=>e(t=>{const n=[...t.channelsVisible];return n[A]=!n[A],{...t,channelsVisible:n}}),setPropertiesForChannel:(A,t)=>e(n=>{const i=Object.entries(t),r={};return i.forEach(([o,s])=>{r[o]=[...n[o]],r[o][A]=s}),{...n,...r}}),removeChannel:A=>e(t=>{const n={},i=Object.keys(CQ);return Object.keys(t).forEach(r=>{i.includes(r)&&(n[r]=t[r].filter((o,s)=>s!==A))}),{...t,...n}}),addChannel:A=>e(t=>{const n=Object.entries(A),i={...t};return n.forEach(([r,o])=>{i[r]=[...t[r],o]}),Object.entries(CQ).forEach(([r,o])=>{i[r].length{}},ve=py(e=>({...Vx,...nw(Vx,e)})),Wx={isChannelLoading:[],isViewerLoading:!0,pixelValues:[],isOffsetsSnackbarOn:!1,loaderErrorSnackbar:{on:!1,message:null},isNoImageUrlSnackbarOn:!1,isVolumeRenderingWarningOn:!1,useLinkedView:!1,isControllerOn:!0,use3d:!1,useLens:!1,useColormap:!1,globalSelection:{z:0,t:0},channelOptions:[],metadata:null,viewState:null,source:"",pyramidResolution:0},UA=py(e=>({...Wx,...nw(Wx,e),setIsChannelLoading:(A,t)=>e(n=>{const i=[...n.isChannelLoading];return i[A]=t,{...n,isChannelLoading:i}}),addIsChannelLoading:A=>e(t=>{const n=[...t.isChannelLoading,A];return{...t,isChannelLoading:n}}),removeIsChannelLoading:A=>e(t=>{const n=[...t.isChannelLoading];return n.splice(A,1),{...t,isChannelLoading:n}})})),Fi=()=>{const[e,A]=bn(t=>[t.loader,t.image]);return Array.isArray(e[0])?e[A]:e},iw=()=>{const e=bn(t=>t.image),A=UA(t=>t.metadata);return Array.isArray(A)?A[e]:A};function mg(e,A,t,n){function i(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function s(I){try{g(n.next(I))}catch(l){o(l)}}function a(I){try{g(n.throw(I))}catch(l){o(l)}}function g(I){I.done?r(I.value):i(I.value).then(s,a)}g((n=n.apply(e,A||[])).next())})}function wg(e,A){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(g){return function(I){return a([g,I])}}function a(g){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(r=g[0]&2?i.return:g[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,g[1])).done)return r;switch(i=0,r&&(g=[g[0]&2,r.value]),g[0]){case 0:case 1:r=g;break;case 4:return t.label++,{value:g[1],done:!1};case 5:t.label++,i=g[1],g=[0];continue;case 7:g=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!r||g[1]>r[0]&&g[1]0)&&!(i=n.next()).done;)r.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return r}function hgA(){for(var e=[],A=0;A0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return t}function QgA(e){var A=e.name,t=A&&A.lastIndexOf(".")!==-1;if(t&&!e.type){var n=A.split(".").pop().toLowerCase(),i=fgA.get(n);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var dgA=[".DS_Store","Thumbs.db"];function pgA(e){return mg(this,void 0,void 0,function(){return wg(this,function(A){return UB(e)&&ygA(e)?[2,SgA(e.dataTransfer,e.type)]:mgA(e)?[2,wgA(e)]:Array.isArray(e)&&e.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,vgA(e)]:[2,[]]})})}function ygA(e){return UB(e.dataTransfer)}function mgA(e){return UB(e)&&UB(e.target)}function UB(e){return typeof e=="object"&&e!==null}function wgA(e){return J0(e.target.files).map(function(A){return vc(A)})}function vgA(e){return mg(this,void 0,void 0,function(){var A;return wg(this,function(t){switch(t.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return A=t.sent(),[2,A.map(function(n){return vc(n)})]}})})}function SgA(e,A){return mg(this,void 0,void 0,function(){var t,n;return wg(this,function(i){switch(i.label){case 0:return e===null?[2,[]]:e.items?(t=J0(e.items).filter(function(r){return r.kind==="file"}),A!=="drop"?[2,t]:[4,Promise.all(t.map(DgA))]):[3,2];case 1:return n=i.sent(),[2,zx(iM(n))];case 2:return[2,zx(J0(e.files).map(function(r){return vc(r)}))]}})})}function zx(e){return e.filter(function(A){return dgA.indexOf(A.name)===-1})}function J0(e){if(e===null)return[];for(var A=[],t=0;te.length)&&(A=e.length);for(var t=0,n=new Array(A);tt)return[!1,eF(t)];if(e.sizet)return[!1,eF(t)]}return[!0,null]}function eI(e){return e!=null}function HgA(e){var A=e.files,t=e.accept,n=e.minSize,i=e.maxSize,r=e.multiple,o=e.maxFiles;return!r&&A.length>1||r&&o>=1&&A.length>o?!1:A.every(function(s){var a=sM(s,t),g=$x(a,1),I=g[0],l=aM(s,n,i),c=$x(l,1),C=c[0];return I&&C})}function PB(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function NC(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(A){return A==="Files"||A==="application/x-moz-file"}):!!e.target&&!!e.target.files}function nF(e){e.preventDefault()}function qgA(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function JgA(e){return e.indexOf("Edge/")!==-1}function OgA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return qgA(e)||JgA(e)}function ai(){for(var e=arguments.length,A=new Array(e),t=0;t1?i-1:0),o=1;oe.length)&&(A=e.length);for(var t=0,n=new Array(A);t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function nIA(e,A){if(e==null)return{};var t={},n=Object.keys(e),i,r;for(r=0;r=0)&&(t[i]=e[i]);return t}var rw=p.forwardRef(function(e,A){var t=e.children,n=HB(e,KgA),i=lM(n),r=i.open,o=HB(i,VgA);return p.useImperativeHandle(A,function(){return{open:r}},[r]),RA.createElement(p.Fragment,null,t(Xe(Xe({},o),{},{open:r})))});rw.displayName="Dropzone";var IM={disabled:!1,getFilesFromEvent:pgA,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1};rw.defaultProps=IM;rw.propTypes={children:Ne.func,accept:Ne.oneOfType([Ne.string,Ne.arrayOf(Ne.string)]),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,validator:Ne.func};var K0={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function lM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},A=Xe(Xe({},IM),e),t=A.accept,n=A.disabled,i=A.getFilesFromEvent,r=A.maxSize,o=A.minSize,s=A.multiple,a=A.maxFiles,g=A.onDragEnter,I=A.onDragLeave,l=A.onDragOver,c=A.onDrop,C=A.onDropAccepted,u=A.onDropRejected,E=A.onFileDialogCancel,B=A.onFileDialogOpen,h=A.useFsAccessApi,f=A.preventDropOnDocument,Q=A.noClick,d=A.noKeyboard,w=A.noDrag,m=A.noDragEventsBubbling,v=A.validator,x=p.useMemo(function(){return typeof B=="function"?B:oF},[B]),D=p.useMemo(function(){return typeof E=="function"?E:oF},[E]),F=p.useRef(null),N=p.useRef(null),M=p.useReducer(iIA,K0),P=uQ(M,2),H=P[0],W=P[1],J=H.isFocused,Z=H.isFileDialogActive,z=H.draggedFiles,O=function(){Z&&setTimeout(function(){if(N.current){var gA=N.current.files;gA.length||(W({type:"closeDialog"}),D())}},300)};p.useEffect(function(){return h&&iF()?function(){}:(window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)})},[N,Z,D,h]);var Y=p.useRef([]),T=function(gA){F.current&&F.current.contains(gA.target)||(gA.preventDefault(),Y.current=[])};p.useEffect(function(){return f&&(document.addEventListener("dragover",nF,!1),document.addEventListener("drop",T,!1)),function(){f&&(document.removeEventListener("dragover",nF),document.removeEventListener("drop",T))}},[F,f]);var q=p.useCallback(function(eA){eA.preventDefault(),eA.persist(),JA(eA),Y.current=[].concat(jgA(Y.current),[eA.target]),NC(eA)&&Promise.resolve(i(eA)).then(function(gA){PB(eA)&&!m||(W({draggedFiles:gA,isDragActive:!0,type:"setDraggedFiles"}),g&&g(eA))})},[i,g,m]),j=p.useCallback(function(eA){eA.preventDefault(),eA.persist(),JA(eA);var gA=NC(eA);if(gA&&eA.dataTransfer)try{eA.dataTransfer.dropEffect="copy"}catch{}return gA&&l&&l(eA),!1},[l,m]),AA=p.useCallback(function(eA){eA.preventDefault(),eA.persist(),JA(eA);var gA=Y.current.filter(function(le){return F.current&&F.current.contains(le)}),LA=gA.indexOf(eA.target);LA!==-1&&gA.splice(LA,1),Y.current=gA,!(gA.length>0)&&(W({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),NC(eA)&&I&&I(eA))},[F,I,m]),nA=p.useCallback(function(eA,gA){var LA=[],le=[];eA.forEach(function(ZA){var Je=sM(ZA,t),$A=uQ(Je,2),VA=$A[0],Me=$A[1],ue=aM(ZA,o,r),WA=uQ(ue,2),_A=WA[0],pe=WA[1],we=v?v(ZA):null;if(VA&&_A&&!we)LA.push(ZA);else{var OA=[Me,pe];we&&(OA=OA.concat(we)),le.push({file:ZA,errors:OA.filter(function(rA){return rA})})}}),(!s&&LA.length>1||s&&a>=1&&LA.length>a)&&(LA.forEach(function(ZA){le.push({file:ZA,errors:[PgA]})}),LA.splice(0)),W({acceptedFiles:LA,fileRejections:le,type:"setFiles"}),c&&c(LA,le,gA),le.length>0&&u&&u(le,gA),LA.length>0&&C&&C(LA,gA)},[W,s,t,o,r,a,c,C,u,v]),IA=p.useCallback(function(eA){eA.preventDefault(),eA.persist(),JA(eA),Y.current=[],NC(eA)&&Promise.resolve(i(eA)).then(function(gA){PB(eA)&&!m||nA(gA,eA)}),W({type:"reset"})},[i,nA,m]),aA=p.useCallback(function(){if(h&&iF()){W({type:"openDialog"}),x();var eA={multiple:s,types:YgA(t)};window.showOpenFilePicker(eA).then(function(gA){return i(gA)}).then(function(gA){return nA(gA,null)}).catch(function(gA){return D(gA)}).finally(function(){return W({type:"closeDialog"})});return}N.current&&(W({type:"openDialog"}),x(),N.current.value=null,N.current.click())},[W,x,D,h,nA,t,s]),BA=p.useCallback(function(eA){!F.current||!F.current.isEqualNode(eA.target)||(eA.keyCode===32||eA.keyCode===13)&&(eA.preventDefault(),aA())},[F,N,aA]),lA=p.useCallback(function(){W({type:"focus"})},[]),MA=p.useCallback(function(){W({type:"blur"})},[]),EA=p.useCallback(function(){Q||(OgA()?setTimeout(aA,0):aA())},[N,Q,aA]),pA=function(gA){return n?null:gA},qA=function(gA){return d?null:pA(gA)},NA=function(gA){return w?null:pA(gA)},JA=function(gA){m&&gA.stopPropagation()},dA=p.useMemo(function(){return function(){var eA=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},gA=eA.refKey,LA=gA===void 0?"ref":gA,le=eA.role,ZA=eA.onKeyDown,Je=eA.onFocus,$A=eA.onBlur,VA=eA.onClick,Me=eA.onDragEnter,ue=eA.onDragOver,WA=eA.onDragLeave,_A=eA.onDrop,pe=HB(eA,WgA);return Xe(Xe(Y0({onKeyDown:qA(ai(ZA,BA)),onFocus:qA(ai(Je,lA)),onBlur:qA(ai($A,MA)),onClick:pA(ai(VA,EA)),onDragEnter:NA(ai(Me,q)),onDragOver:NA(ai(ue,j)),onDragLeave:NA(ai(WA,AA)),onDrop:NA(ai(_A,IA)),role:typeof le=="string"&&le!==""?le:"button"},LA,F),!n&&!d?{tabIndex:0}:{}),pe)}},[F,BA,lA,MA,EA,q,j,AA,IA,d,w,n]),GA=p.useCallback(function(eA){eA.stopPropagation()},[]),ie=p.useMemo(function(){return function(){var eA=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},gA=eA.refKey,LA=gA===void 0?"ref":gA,le=eA.onChange,ZA=eA.onClick,Je=HB(eA,zgA),$A=Y0({accept:t,multiple:s,type:"file",style:{display:"none"},onChange:pA(ai(le,IA)),onClick:pA(ai(ZA,GA)),autoComplete:"off",tabIndex:-1},LA,N);return Xe(Xe({},$A),Je)}},[N,t,s,IA,n]),Ie=z.length,he=Ie>0&&HgA({files:z,accept:t,minSize:o,maxSize:r,multiple:s,maxFiles:a}),XA=Ie>0&&!he;return Xe(Xe({},H),{},{isDragAccept:he,isDragReject:XA,isFocused:J&&!n,getRootProps:dA,getInputProps:ie,rootRef:F,inputRef:N,open:pA(aA)})}function iIA(e,A){switch(A.type){case"focus":return Xe(Xe({},e),{},{isFocused:!0});case"blur":return Xe(Xe({},e),{},{isFocused:!1});case"openDialog":return Xe(Xe({},K0),{},{isFileDialogActive:!0});case"closeDialog":return Xe(Xe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var t=A.isDragActive,n=A.draggedFiles;return Xe(Xe({},e),{},{draggedFiles:n,isDragActive:t});case"setFiles":return Xe(Xe({},e),{},{acceptedFiles:A.acceptedFiles,fileRejections:A.fileRejections});case"reset":return Xe({},K0);default:return e}}function oF(){}function Ve(e,A){if(Object.is(e,A))return!0;if(typeof e!="object"||e===null||typeof A!="object"||A===null)return!1;const t=Object.keys(e);if(t.length!==Object.keys(A).length)return!1;for(let n=0;nA.name):e instanceof File?[e.name]:e.split(",")}function lIA(e){const A=IIA(e);for(const t of A){const n=t.toLowerCase();if(!(n.includes(".tiff")||n.includes(".tif")))return!1}return!0}async function cIA(e){return Array.isArray(e)?e:e instanceof File?[e]:e.split(",")}async function CIA(e){return(await(typeof e=="string"?qE:JE)(e)).getImageCount()}async function uIA(e){const A=await cIA(e),t=[];let n=0;for(const i of A){const r=[],o=await CIA(i);for(let s=0;s{const{Pixels:{SizeC:E,SizeT:B,SizeZ:h}}=u;return E*B*h+C},1);const s=t[0].length,{Pixels:{SizeC:a,SizeT:g,SizeZ:I}}=A[0];return a*g*I*s}async function EIA(e,A,t){try{if(gIA(e)){if(e instanceof File)return await G1(e,{images:"all",pool:!1});const r=await fetch(e.replace(/ome\.tif(f?)/gi,"offsets.json")),o=r.status!==200,s=o?void 0:await r.json(),a=await G1(e,{offsets:s,images:"all",pool:!1}),g=await BIA(e,a.map(I=>I.metadata),a.map(I=>I.data));return o&&g>aIA&&A(!0),a}if(Array.isArray(e)&&typeof e[0].arrayBuffer!="function")throw new sF("Cannot upload a local Zarr or flat TIFF files with this browser. Try using Chrome, Firefox, or Microsoft Edge.");if(lIA(e)){const i=await uIA(e);return await PtA(i,{images:"all",pool:!1})}let n;try{n=await WoA(e)}catch{const i=await zoA(e,{type:"multiscales"}),r={Pixels:{Channels:i.metadata.omero.channels.map(o=>({Name:o.label,SamplesPerPixel:1}))}};n={data:i.data,metadata:r}}return n}catch(n){return n instanceof sF?t(n.message):(console.error(n),t(null)),{data:null}}}function cM(e){return e.split("?")[0].split("/").slice(-1)[0]}function hIA(e){const A=e.filter(n=>sw.includes(n.name.toLowerCase())),t={};for(const n of A)t[n.name]=Math.floor(n.size/2);return t}function fIA(e){return e=e.toLowerCase(),e==="x"||e==="y"||sw.includes(e)}function CM(e){const A=e[e.length-1];return A===3||A===4}function QIA(e,A){if(e.length!==A.length)throw new Error("Array lengths must be equal");return e.map((t,n)=>[t,A[n]])}function dIA({labels:e,shape:A}){let t=[];const n=QIA(e,A).map(([o,s])=>({name:o,size:s})),i=hIA(n),r=n.find(o=>!fIA(o.name));if(!r)return[i];for(let o=0;o{const r=()=>{i(t())};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}}),n}async function pIA({loader:e,selection:A}){const n=await(Array.isArray(e)?e[e.length-1]:e).getRaster({selection:A}),i=Iu(n.data),{domain:r,contrastLimits:o}=i;return{domain:r,contrastLimits:o}}async function yIA({loader:e,selection:A}){const t=e[e.length-1],{shape:n,labels:i}=t,r=n[i.indexOf("z")]>>e.length-1,o=await t.getRaster({selection:{...A,z:0}}),s=await t.getRaster({selection:{...A,z:Math.floor(r/2)}}),a=await t.getRaster({selection:{...A,z:Math.max(0,r-1)}}),g=Iu(o.data),I=Iu(s.data),l=Iu(a.data);return{domain:[Math.min(g.domain[0],I.domain[0],l.domain[0]),Math.max(g.domain[1],I.domain[1],l.domain[1])],contrastLimits:[Math.min(g.contrastLimits[0],I.contrastLimits[0],l.contrastLimits[0]),Math.max(g.contrastLimits[1],I.contrastLimits[1],l.contrastLimits[1])]}}const gw=async({loader:e,selection:A,use3d:t})=>(t?yIA:pIA)({loader:e,selection:A}),qB=async({loader:e,selections:A,use3d:t})=>{const n=await Promise.all(A.map(o=>gw({loader:e,selection:o,use3d:t}))),i=n.map(o=>o.domain),r=n.map(o=>o.contrastLimits);return{domains:i,contrastLimits:r}};function mIA(){let e=!1;return function(A){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(A)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(A.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e}function uM({Pixels:e}){const A=e.Channels.length,{SamplesPerPixel:t}=e.Channels[0],n=A===3&&e.Type==="uint8",i=e.SizeC===3&&A===1&&e.Interleaved;return t===3||n||i}function Iw(e,A){if(!e&&e!==0)return"";const t=e.toString();return t.length>A?t.substring(0,A).replace(/\.$/,""):t}function wIA(e){var i;const{x:A,y:t,z:n}=((i=e==null?void 0:e.meta)==null?void 0:i.physicalSizes)??{};if(A!=null&&A.size&&(t!=null&&t.size)&&(n!=null&&n.size)){const r=Math.min(n.size,A.size,t.size),o=[A.size/r,t.size/r,n.size/r];return new Se().scale(o)}return new Se().identity()}function lw(e){const A=Array.isArray(e)?e[0]:e,{shape:t,labels:n}=A,i=wIA(A),r=[0,i[0]*t[n.indexOf("x")]],o=[0,i[5]*t[n.indexOf("y")]],s=[0,i[10]*t[n.indexOf("z")]];return[r,o,s]}function vIA(e,A){const t=e?daA:XE;if(A===Na.MAX_INTENSITY_PROJECTION)return new t.MaximumIntensityProjectionExtension;if(A===Na.MIN_INTENSITY_PROJECTION)return new t.MinimumIntensityProjectionExtension;if(A===Na.ADDITIVE)return new t.AdditiveBlendExtension;throw new Error(`${A} rendering mode not supported`)}const SIA=(e,A)=>{const[t,n,i]=UA(g=>[g.use3d,g.toggleUse3d,g.toggleIsOffsetsSnackbarOn],Ve),[r,o]=ve(g=>[g.lensEnabled,g.toggleLensEnabled],Ve),s=Fi(),a=iw();p.useEffect(()=>{async function g(){UA.setState({isChannelLoading:[!0]}),UA.setState({isViewerLoading:!0}),t&&n();const{urlOrFile:I}=e,l=await EIA(I,i,u=>UA.setState({loaderErrorSnackbar:{on:!0,message:u}}));let c,C;Array.isArray(l)?l.length>1?(c=l.map(u=>u.metadata),C=l.map(u=>u.data)):(c=l[0].metadata,C=l[0].data):(c=l.metadata,C=l.data),C&&(console.info("Metadata (in JSON-like form) for current file being viewed: ",c),Vt.unstable_batchedUpdates(()=>{bn.setState({loader:C}),UA.setState({metadata:c})}),t&&n(),A==null||A.push(typeof I=="string"?`?image_url=${I}`:""))}e&&g()},[e,A]),p.useEffect(()=>{a&&(async()=>{UA.setState({isChannelLoading:[!0]}),UA.setState({isViewerLoading:!0}),t&&n();const I=dIA(s[0]),{Channels:l}=a.Pixels,c=l.map((d,w)=>d.Name??`Channel ${w}`);let C=[],u=[],E=[];if(uM(a))CM(s[0].shape)?(C=[[0,255]],u=[[0,255]],E=[[255,0,0]]):(C=[[0,255],[0,255],[0,255]],u=[[0,255],[0,255],[0,255]],E=[[255,0,0],[0,255,0],[0,0,255]]),r&&o(),UA.setState({useColormap:!1,useLens:!1});else{const d=await qB({loader:s,selections:I,use3d:!1});u=d.domains,C=d.contrastLimits,E=u.length===1?[[255,255,255]]:u.map((w,m)=>{var v;return(((v=l[m])==null?void 0:v.Color)&&l[m].Color.slice(0,-1))??ow[m]}),UA.setState({useLens:c.length!==1,useColormap:!0})}bn.setState({ids:u.map(()=>String(Math.random())),selections:I,domains:u,contrastLimits:C,colors:E,channelsVisible:E.map(()=>!0)}),UA.setState({isChannelLoading:I.map(d=>!d),isViewerLoading:!1,pixelValues:new Array(I.length).fill(V0),globalSelection:I[0],channelOptions:c});const[h,f,Q]=lw(s);ve.setState({xSlice:h,ySlice:f,zSlice:Q})})()},[s,a])},BM=()=>lM({onDrop:A=>{let t;A.length===1?t={urlOrFile:A[0],description:A[0].name}:t={urlOrFile:A,description:"data.zarr"},UA.setState({source:t})}});function Rt(e){return e&&e.ownerDocument||document}function us(e,A){typeof e=="function"?e(A):e&&(e.current=A)}function it(e,A){return p.useMemo(function(){return e==null&&A==null?null:function(t){us(e,t),us(A,t)}},[e,A])}var DIA=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Ze(e){var A=p.useRef(e);return DIA(function(){A.current=e}),p.useCallback(function(){return A.current.apply(void 0,arguments)},[])}function aF(e){return e.substring(2).toLowerCase()}function RIA(e){return document.documentElement.clientWidth-1;else{var w=Rt(I.current);d=!w.documentElement.contains(f.target)||I.current.contains(f.target)}!d&&(n||!Q)&&o(f)}}),B=function(Q){return function(d){c.current=!0;var w=A.props[Q];w&&w(d)}},h={ref:u};return a!==!1&&(h[a]=B(a)),p.useEffect(function(){if(a!==!1){var f=aF(a),Q=Rt(I.current),d=function(){g.current=!0};return Q.addEventListener(f,E),Q.addEventListener("touchmove",d),function(){Q.removeEventListener(f,E),Q.removeEventListener("touchmove",d)}}},[E,a]),r!==!1&&(h[r]=B(r)),p.useEffect(function(){if(r!==!1){var f=aF(r),Q=Rt(I.current);return Q.addEventListener(f,E),function(){Q.removeEventListener(f,E)}}},[E,r]),p.createElement(p.Fragment,null,p.cloneElement(A,h))}function De(e){if(typeof e!="string")throw new Error(Ma(7));return e.charAt(0).toUpperCase()+e.slice(1)}function go(){for(var e=arguments.length,A=new Array(e),t=0;t1&&arguments[1]!==void 0?arguments[1]:166,t;function n(){for(var i=arguments.length,r=new Array(i),o=0;o"u"?p.useEffect:p.useLayoutEffect;function llA(e){var A=e.classes,t=e.pulsate,n=t===void 0?!1:t,i=e.rippleX,r=e.rippleY,o=e.rippleSize,s=e.in,a=e.onExited,g=a===void 0?function(){}:a,I=e.timeout,l=p.useState(!1),c=l[0],C=l[1],u=vA(A.ripple,A.rippleVisible,n&&A.ripplePulsate),E={width:o,height:o,top:-(o/2)+r,left:-(o/2)+i},B=vA(A.child,c&&A.childLeaving,n&&A.childPulsate),h=Ze(g);return IlA(function(){if(!s){C(!0);var f=setTimeout(h,I);return function(){clearTimeout(f)}}},[h,s,I]),p.createElement("span",{className:u,style:E},p.createElement("span",{className:B}))}var X0=550,clA=80,ClA=function(A){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(X0,"ms ").concat(A.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(A.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(X0,"ms ").concat(A.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(A.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}},ulA=p.forwardRef(function(A,t){var n=A.center,i=n===void 0?!1:n,r=A.classes,o=A.className,s=xA(A,["center","classes","className"]),a=p.useState([]),g=a[0],I=a[1],l=p.useRef(0),c=p.useRef(null);p.useEffect(function(){c.current&&(c.current(),c.current=null)},[g]);var C=p.useRef(!1),u=p.useRef(null),E=p.useRef(null),B=p.useRef(null);p.useEffect(function(){return function(){clearTimeout(u.current)}},[]);var h=p.useCallback(function(w){var m=w.pulsate,v=w.rippleX,x=w.rippleY,D=w.rippleSize,F=w.cb;I(function(N){return[].concat(Zl(N),[p.createElement(llA,{key:l.current,classes:r,timeout:X0,pulsate:m,rippleX:v,rippleY:x,rippleSize:D})])}),l.current+=1,c.current=F},[r]),f=p.useCallback(function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=arguments.length>2?arguments[2]:void 0,x=m.pulsate,D=x===void 0?!1:x,F=m.center,N=F===void 0?i||m.pulsate:F,M=m.fakeElement,P=M===void 0?!1:M;if(w.type==="mousedown"&&C.current){C.current=!1;return}w.type==="touchstart"&&(C.current=!0);var H=P?null:B.current,W=H?H.getBoundingClientRect():{width:0,height:0,left:0,top:0},J,Z,z;if(N||w.clientX===0&&w.clientY===0||!w.clientX&&!w.touches)J=Math.round(W.width/2),Z=Math.round(W.height/2);else{var O=w.touches?w.touches[0]:w,Y=O.clientX,T=O.clientY;J=Math.round(Y-W.left),Z=Math.round(T-W.top)}if(N)z=Math.sqrt((2*Math.pow(W.width,2)+Math.pow(W.height,2))/3),z%2===0&&(z+=1);else{var q=Math.max(Math.abs((H?H.clientWidth:0)-J),J)*2+2,j=Math.max(Math.abs((H?H.clientHeight:0)-Z),Z)*2+2;z=Math.sqrt(Math.pow(q,2)+Math.pow(j,2))}w.touches?E.current===null&&(E.current=function(){h({pulsate:D,rippleX:J,rippleY:Z,rippleSize:z,cb:v})},u.current=setTimeout(function(){E.current&&(E.current(),E.current=null)},clA)):h({pulsate:D,rippleX:J,rippleY:Z,rippleSize:z,cb:v})},[i,h]),Q=p.useCallback(function(){f({},{pulsate:!0})},[f]),d=p.useCallback(function(w,m){if(clearTimeout(u.current),w.type==="touchend"&&E.current){w.persist(),E.current(),E.current=null,u.current=setTimeout(function(){d(w,m)});return}E.current=null,I(function(v){return v.length>0?v.slice(1):v}),c.current=m},[]);return p.useImperativeHandle(t,function(){return{pulsate:Q,start:f,stop:d}},[Q,f,d]),p.createElement("span",k({className:vA(r.root,o),ref:B},s),p.createElement(MIA,{component:null,exit:!0},g))});const BlA=se(ClA,{flip:!1,name:"MuiTouchRipple"})(p.memo(ulA));var ElA={root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},hlA=p.forwardRef(function(A,t){var n=A.action,i=A.buttonRef,r=A.centerRipple,o=r===void 0?!1:r,s=A.children,a=A.classes,g=A.className,I=A.component,l=I===void 0?"button":I,c=A.disabled,C=c===void 0?!1:c,u=A.disableRipple,E=u===void 0?!1:u,B=A.disableTouchRipple,h=B===void 0?!1:B,f=A.focusRipple,Q=f===void 0?!1:f,d=A.focusVisibleClassName,w=A.onBlur,m=A.onClick,v=A.onFocus,x=A.onFocusVisible,D=A.onKeyDown,F=A.onKeyUp,N=A.onMouseDown,M=A.onMouseLeave,P=A.onMouseUp,H=A.onTouchEnd,W=A.onTouchMove,J=A.onTouchStart,Z=A.onDragLeave,z=A.tabIndex,O=z===void 0?0:z,Y=A.TouchRippleProps,T=A.type,q=T===void 0?"button":T,j=xA(A,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),AA=p.useRef(null);function nA(){return Vt.findDOMNode(AA.current)}var IA=p.useRef(null),aA=p.useState(!1),BA=aA[0],lA=aA[1];C&&BA&&lA(!1);var MA=oh(),EA=MA.isFocusVisible,pA=MA.onBlurVisible,qA=MA.ref;p.useImperativeHandle(n,function(){return{focusVisible:function(){lA(!0),AA.current.focus()}}},[]),p.useEffect(function(){BA&&Q&&!E&&IA.current.pulsate()},[E,Q,BA]);function NA(rA,TA){var Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h;return Ze(function(xe){TA&&TA(xe);var Te=Le;return!Te&&IA.current&&IA.current[rA](xe),!0})}var JA=NA("start",N),dA=NA("stop",Z),GA=NA("stop",P),ie=NA("stop",function(rA){BA&&rA.preventDefault(),M&&M(rA)}),Ie=NA("start",J),he=NA("stop",H),XA=NA("stop",W),eA=NA("stop",function(rA){BA&&(pA(rA),lA(!1)),w&&w(rA)},!1),gA=Ze(function(rA){AA.current||(AA.current=rA.currentTarget),EA(rA)&&(lA(!0),x&&x(rA)),v&&v(rA)}),LA=function(){var TA=nA();return l&&l!=="button"&&!(TA.tagName==="A"&&TA.href)},le=p.useRef(!1),ZA=Ze(function(rA){Q&&!le.current&&BA&&IA.current&&rA.key===" "&&(le.current=!0,rA.persist(),IA.current.stop(rA,function(){IA.current.start(rA)})),rA.target===rA.currentTarget&&LA()&&rA.key===" "&&rA.preventDefault(),D&&D(rA),rA.target===rA.currentTarget&&LA()&&rA.key==="Enter"&&!C&&(rA.preventDefault(),m&&m(rA))}),Je=Ze(function(rA){Q&&rA.key===" "&&IA.current&&BA&&!rA.defaultPrevented&&(le.current=!1,rA.persist(),IA.current.stop(rA,function(){IA.current.pulsate(rA)})),F&&F(rA),m&&rA.target===rA.currentTarget&&LA()&&rA.key===" "&&!rA.defaultPrevented&&m(rA)}),$A=l;$A==="button"&&j.href&&($A="a");var VA={};$A==="button"?(VA.type=q,VA.disabled=C):(($A!=="a"||!j.href)&&(VA.role="button"),VA["aria-disabled"]=C);var Me=it(i,t),ue=it(qA,AA),WA=it(Me,ue),_A=p.useState(!1),pe=_A[0],we=_A[1];p.useEffect(function(){we(!0)},[]);var OA=pe&&!E&&!C;return p.createElement($A,k({className:vA(a.root,g,BA&&[a.focusVisible,d],C&&a.disabled),onBlur:eA,onClick:m,onFocus:gA,onKeyDown:ZA,onKeyUp:Je,onMouseDown:JA,onMouseLeave:ie,onMouseUp:GA,onDragLeave:dA,onTouchEnd:he,onTouchMove:XA,onTouchStart:Ie,ref:WA,tabIndex:C?-1:O},VA,j),s,OA?p.createElement(BlA,k({ref:IA,center:o},Y)):null)});const Sc=se(ElA,{name:"MuiButtonBase"})(hlA);var flA=function(A){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:A.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:A.palette.action.active,transition:A.transitions.create("background-color",{duration:A.transitions.duration.shortest}),"&:hover":{backgroundColor:mt(A.palette.action.active,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:A.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:A.palette.primary.main,"&:hover":{backgroundColor:mt(A.palette.primary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:A.palette.secondary.main,"&:hover":{backgroundColor:mt(A.palette.secondary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:A.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}},QlA=p.forwardRef(function(A,t){var n=A.edge,i=n===void 0?!1:n,r=A.children,o=A.classes,s=A.className,a=A.color,g=a===void 0?"default":a,I=A.disabled,l=I===void 0?!1:I,c=A.disableFocusRipple,C=c===void 0?!1:c,u=A.size,E=u===void 0?"medium":u,B=xA(A,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return p.createElement(Sc,k({className:vA(o.root,s,g!=="default"&&o["color".concat(De(g))],l&&o.disabled,E==="small"&&o["size".concat(De(E))],{start:o.edgeStart,end:o.edgeEnd}[i]),centerRipple:!0,focusRipple:!C,disabled:l,ref:t},B),p.createElement("span",{className:o.label},r))});const Bs=se(flA,{name:"MuiIconButton"})(QlA);var dlA=function(A){var t=A.palette.type==="light"?ll:cl,n=A.palette.type==="light"?cl:ll;return{root:k({},A.typography.body2,{borderRadius:A.shape.borderRadius,backgroundColor:"transparent",display:"flex",padding:"6px 16px"}),standardSuccess:{color:t(A.palette.success.main,.6),backgroundColor:n(A.palette.success.main,.9),"& $icon":{color:A.palette.success.main}},standardInfo:{color:t(A.palette.info.main,.6),backgroundColor:n(A.palette.info.main,.9),"& $icon":{color:A.palette.info.main}},standardWarning:{color:t(A.palette.warning.main,.6),backgroundColor:n(A.palette.warning.main,.9),"& $icon":{color:A.palette.warning.main}},standardError:{color:t(A.palette.error.main,.6),backgroundColor:n(A.palette.error.main,.9),"& $icon":{color:A.palette.error.main}},outlinedSuccess:{color:t(A.palette.success.main,.6),border:"1px solid ".concat(A.palette.success.main),"& $icon":{color:A.palette.success.main}},outlinedInfo:{color:t(A.palette.info.main,.6),border:"1px solid ".concat(A.palette.info.main),"& $icon":{color:A.palette.info.main}},outlinedWarning:{color:t(A.palette.warning.main,.6),border:"1px solid ".concat(A.palette.warning.main),"& $icon":{color:A.palette.warning.main}},outlinedError:{color:t(A.palette.error.main,.6),border:"1px solid ".concat(A.palette.error.main),"& $icon":{color:A.palette.error.main}},filledSuccess:{color:"#fff",fontWeight:A.typography.fontWeightMedium,backgroundColor:A.palette.success.main},filledInfo:{color:"#fff",fontWeight:A.typography.fontWeightMedium,backgroundColor:A.palette.info.main},filledWarning:{color:"#fff",fontWeight:A.typography.fontWeightMedium,backgroundColor:A.palette.warning.main},filledError:{color:"#fff",fontWeight:A.typography.fontWeightMedium,backgroundColor:A.palette.error.main},icon:{marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9},message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}},CF={success:p.createElement(rlA,{fontSize:"inherit"}),warning:p.createElement(olA,{fontSize:"inherit"}),error:p.createElement(slA,{fontSize:"inherit"}),info:p.createElement(alA,{fontSize:"inherit"})},plA=p.createElement(glA,{fontSize:"small"}),ylA=p.forwardRef(function(A,t){var n=A.action,i=A.children,r=A.classes,o=A.className,s=A.closeText,a=s===void 0?"Close":s,g=A.color,I=A.icon,l=A.iconMapping,c=l===void 0?CF:l,C=A.onClose,u=A.role,E=u===void 0?"alert":u,B=A.severity,h=B===void 0?"success":B,f=A.variant,Q=f===void 0?"standard":f,d=xA(A,["action","children","classes","className","closeText","color","icon","iconMapping","onClose","role","severity","variant"]);return p.createElement(fo,k({role:E,square:!0,elevation:0,className:vA(r.root,r["".concat(Q).concat(De(g||h))],o),ref:t},d),I!==!1?p.createElement("div",{className:r.icon},I||c[h]||CF[h]):null,p.createElement("div",{className:r.message},i),n!=null?p.createElement("div",{className:r.action},n):null,n==null&&C?p.createElement("div",{className:r.action},p.createElement(Bs,{size:"small","aria-label":a,title:a,color:"inherit",onClick:C},plA)):null)});const LC=se(dlA,{name:"MuiAlert"})(ylA);var mlA=function(A){return{root:{margin:0},body2:A.typography.body2,body1:A.typography.body1,caption:A.typography.caption,button:A.typography.button,h1:A.typography.h1,h2:A.typography.h2,h3:A.typography.h3,h4:A.typography.h4,h5:A.typography.h5,h6:A.typography.h6,subtitle1:A.typography.subtitle1,subtitle2:A.typography.subtitle2,overline:A.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:A.palette.primary.main},colorSecondary:{color:A.palette.secondary.main},colorTextPrimary:{color:A.palette.text.primary},colorTextSecondary:{color:A.palette.text.secondary},colorError:{color:A.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}},uF={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},wlA=p.forwardRef(function(A,t){var n=A.align,i=n===void 0?"inherit":n,r=A.classes,o=A.className,s=A.color,a=s===void 0?"initial":s,g=A.component,I=A.display,l=I===void 0?"initial":I,c=A.gutterBottom,C=c===void 0?!1:c,u=A.noWrap,E=u===void 0?!1:u,B=A.paragraph,h=B===void 0?!1:B,f=A.variant,Q=f===void 0?"body1":f,d=A.variantMapping,w=d===void 0?uF:d,m=xA(A,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),v=g||(h?"p":w[Q]||uF[Q])||"span";return p.createElement(v,k({className:vA(r.root,o,Q!=="inherit"&&r[Q],a!=="initial"&&r["color".concat(De(a))],E&&r.noWrap,C&&r.gutterBottom,h&&r.paragraph,i!=="inherit"&&r["align".concat(De(i))],l!=="initial"&&r["display".concat(De(l))]),ref:t},m))});const Es=se(mlA,{name:"MuiTypography"})(wlA);var vlA={root:{},underlineNone:{textDecoration:"none"},underlineHover:{textDecoration:"none","&:hover":{textDecoration:"underline"}},underlineAlways:{textDecoration:"underline"},button:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none","&::-moz-focus-inner":{borderStyle:"none"},"&$focusVisible":{outline:"auto"}},focusVisible:{}},SlA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.color,o=r===void 0?"primary":r,s=A.component,a=s===void 0?"a":s,g=A.onBlur,I=A.onFocus,l=A.TypographyClasses,c=A.underline,C=c===void 0?"hover":c,u=A.variant,E=u===void 0?"inherit":u,B=xA(A,["classes","className","color","component","onBlur","onFocus","TypographyClasses","underline","variant"]),h=oh(),f=h.isFocusVisible,Q=h.onBlurVisible,d=h.ref,w=p.useState(!1),m=w[0],v=w[1],x=it(t,d),D=function(M){m&&(Q(),v(!1)),g&&g(M)},F=function(M){f(M)&&v(!0),I&&I(M)};return p.createElement(Es,k({className:vA(n.root,n["underline".concat(De(C))],i,m&&n.focusVisible,a==="button"&&n.button),classes:l,color:o,component:a,onBlur:D,onFocus:F,ref:x,variant:E},B))});const sh=se(vlA,{name:"MuiLink"})(SlA);function DlA(){return b.jsxs(b.Fragment,{children:['Avivator could not find an IFD index for the requested OME-TIFF, and therefore longer latencies are expected. Please read our documentation on "Indexed TIFF" to generate an IFD index for your OME-TIFF and improve initial load times.',b.jsx(sh,{target:"_blank",rel:"noopener noreferrer",href:"http://viv.gehlenborglab.org/#data-preparation",children:"in this section of our documentation"})," ","and then place the offsets.json adjacent to the OME-TIFF wherever hosted."]})}function RlA({message:e}){return b.jsxs(b.Fragment,{children:[e?`The following error was thrown: "${e}". `:"Something has gone wrong loading your image. ","Please refer to the"," ",b.jsx(sh,{target:"_blank",rel:"noopener noreferrer",href:"http://viv.gehlenborglab.org",children:"docs"})," ","for information about supported file formats."]})}function xlA(){return b.jsxs(b.Fragment,{children:['You are seeing a random demo image because no image URL was provided. To view your own images, enter a URL into the "OME-TIFF/Bioformats-Zarr URL" field. See the'," ",b.jsx(sh,{target:"_blank",rel:"noopener noreferrer",href:"http://viv.gehlenborglab.org",children:"docs"})," ","for details on how to prepare your images for viewing with Avivator."]})}function FlA(){return b.jsx(b.Fragment,{children:"Volume rendering is only available on browsers that support WebGL2. If you are using Safari, you can turn on WebGL2 by navigating in the top menubar to check Develop > Experimental Features > WebGL 2.0 and then refreshing the page."})}const NlA=()=>{const[e,A,t,n,i,r,o]=UA(s=>[s.isOffsetsSnackbarOn,s.loaderErrorSnackbar,s.isNoImageUrlSnackbarOn,s.toggleIsOffsetsSnackbarOn,s.toggleIsNoImageUrlSnackbarOn,s.isVolumeRenderingWarningOn,s.toggleIsVolumeRenderingWarningOn],Ve);return b.jsxs(b.Fragment,{children:[b.jsx(_C,{open:e,anchorOrigin:{vertical:"top",horizontal:"center"},elevation:6,variant:"filled",children:b.jsx(LC,{onClose:n,severity:"warning",children:b.jsx(DlA,{})})}),b.jsx(_C,{open:A.on,anchorOrigin:{vertical:"top",horizontal:"center"},elevation:6,variant:"filled",children:b.jsx(LC,{onClose:()=>UA.setState({loaderErrorSnackbar:{on:!1,message:null}}),severity:"error",children:b.jsx(RlA,{message:A.message})})}),b.jsx(_C,{open:t,anchorOrigin:{vertical:"top",horizontal:"center"},elevation:6,variant:"filled",children:b.jsx(LC,{onClose:i,severity:"info",children:b.jsx(xlA,{})})}),b.jsx(_C,{open:r,anchorOrigin:{vertical:"top",horizontal:"center"},elevation:6,variant:"filled",children:b.jsx(LC,{onClose:o,severity:"warning",children:b.jsx(FlA,{})})})]})},_lA=NlA;function LlA(e){var A=typeof e;return e!=null&&(A=="object"||A=="function")}var QM=LlA,blA=typeof Lc=="object"&&Lc&&Lc.Object===Object&&Lc,GlA=blA,klA=GlA,MlA=typeof self=="object"&&self&&self.Object===Object&&self,TlA=klA||MlA||Function("return this")(),dM=TlA,UlA=dM,PlA=function(){return UlA.Date.now()},HlA=PlA,qlA=/\s/;function JlA(e){for(var A=e.length;A--&&qlA.test(e.charAt(A)););return A}var OlA=JlA,YlA=OlA,KlA=/^\s+/;function VlA(e){return e&&e.slice(0,YlA(e)+1).replace(KlA,"")}var WlA=VlA,zlA=dM,jlA=zlA.Symbol,pM=jlA,BF=pM,yM=Object.prototype,XlA=yM.hasOwnProperty,ZlA=yM.toString,tI=BF?BF.toStringTag:void 0;function $lA(e){var A=XlA.call(e,tI),t=e[tI];try{e[tI]=void 0;var n=!0}catch{}var i=ZlA.call(e);return n&&(A?e[tI]=t:delete e[tI]),i}var AcA=$lA,ecA=Object.prototype,tcA=ecA.toString;function ncA(e){return tcA.call(e)}var icA=ncA,EF=pM,rcA=AcA,ocA=icA,scA="[object Null]",acA="[object Undefined]",hF=EF?EF.toStringTag:void 0;function gcA(e){return e==null?e===void 0?acA:scA:hF&&hF in Object(e)?rcA(e):ocA(e)}var IcA=gcA;function lcA(e){return e!=null&&typeof e=="object"}var ccA=lcA,CcA=IcA,ucA=ccA,BcA="[object Symbol]";function EcA(e){return typeof e=="symbol"||ucA(e)&&CcA(e)==BcA}var hcA=EcA,fcA=WlA,fF=QM,QcA=hcA,QF=0/0,dcA=/^[-+]0x[0-9a-f]+$/i,pcA=/^0b[01]+$/i,ycA=/^0o[0-7]+$/i,mcA=parseInt;function wcA(e){if(typeof e=="number")return e;if(QcA(e))return QF;if(fF(e)){var A=typeof e.valueOf=="function"?e.valueOf():e;e=fF(A)?A+"":A}if(typeof e!="string")return e===0?e:+e;e=fcA(e);var t=pcA.test(e);return t||ycA.test(e)?mcA(e.slice(2),t?2:8):dcA.test(e)?QF:+e}var vcA=wcA,ScA=QM,EQ=HlA,dF=vcA,DcA="Expected a function",RcA=Math.max,xcA=Math.min;function FcA(e,A,t){var n,i,r,o,s,a,g=0,I=!1,l=!1,c=!0;if(typeof e!="function")throw new TypeError(DcA);A=dF(A)||0,ScA(t)&&(I=!!t.leading,l="maxWait"in t,r=l?RcA(dF(t.maxWait)||0,A):r,c="trailing"in t?!!t.trailing:c);function C(m){var v=n,x=i;return n=i=void 0,g=m,o=e.apply(x,v),o}function u(m){return g=m,s=setTimeout(h,A),I?C(m):o}function E(m){var v=m-a,x=m-g,D=A-v;return l?xcA(D,r-x):D}function B(m){var v=m-a,x=m-g;return a===void 0||v>=A||v<0||l&&x>=r}function h(){var m=EQ();if(B(m))return f(m);s=setTimeout(h,E(m))}function f(m){return s=void 0,c&&n?C(m):(n=i=void 0,o)}function Q(){s!==void 0&&clearTimeout(s),g=0,n=a=i=s=void 0}function d(){return s===void 0?o:f(EQ())}function w(){var m=EQ(),v=B(m);if(n=arguments,i=this,a=m,v){if(s===void 0)return u(a);if(l)return clearTimeout(s),s=setTimeout(h,A),C(a)}return s===void 0&&(s=setTimeout(h,A)),o}return w.cancel=Q,w.flush=d,w}var NcA=FcA;const mM=Gn(NcA),_cA=()=>{const[e,A,t]=UA(v=>[v.useLinkedView,v.use3d,v.viewState],Ve),[n,i,r,o]=bn(v=>[v.colors,v.contrastLimits,v.channelsVisible,v.selections],Ve),s=Fi(),a=aw(),[g,I,l,c,C,u,E,B,h,f,Q,d,w]=ve(v=>[v.lensSelection,v.colormap,v.renderingMode,v.xSlice,v.ySlice,v.zSlice,v.resolution,v.lensEnabled,v.zoomLock,v.panLock,v.isOverviewOn,v.onViewportLoad,v.useFixedAxis],Ve),m=({viewState:{zoom:v}})=>{const x=Math.min(Math.max(Math.round(-v),0),s.length-1);UA.setState({pyramidResolution:x})};return A?b.jsx(CgA,{loader:s,contrastLimits:i,colors:n,channelsVisible:r,selections:o,colormap:I,xSlice:c,ySlice:C,zSlice:u,resolution:E,extensions:[vIA(I,l)],height:a.height,width:a.width,onViewportLoad:d,useFixedAxis:w,viewStates:[t],onViewStateChange:mM(({viewState:v,viewId:x})=>UA.setState({viewState:{...v,id:x}}),250,{trailing:!0})}):e?b.jsx(cgA,{loader:s,contrastLimits:i,colors:n,channelsVisible:r,selections:o,height:a.height,width:a.width,zoomLock:h,panLock:f,hoverHooks:{handleValue:v=>UA.setState({pixelValues:v})},lensSelection:g,lensEnabled:B,onViewportLoad:d,extensions:[I?new kB:new MB],colormap:I||"viridis",snapScaleBar:!0}):b.jsx(lgA,{loader:s,contrastLimits:i,colors:n,channelsVisible:r,selections:o,height:a.height,width:a.width,overview:oIA,overviewOn:Q,hoverHooks:{handleValue:v=>UA.setState({pixelValues:v})},lensSelection:g,lensEnabled:B,onViewportLoad:d,extensions:[I?new kB:new MB],colormap:I||"viridis",onViewStateChange:m,snapScaleBar:!0})},LcA=_cA;var pr=44,bcA=function(A){return{root:{display:"inline-block"},static:{transition:A.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},determinate:{transition:A.transitions.create("transform")},colorPrimary:{color:A.palette.primary.main},colorSecondary:{color:A.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:A.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},circleDeterminate:{transition:A.transitions.create("stroke-dashoffset")},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}},GcA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.color,o=r===void 0?"primary":r,s=A.disableShrink,a=s===void 0?!1:s,g=A.size,I=g===void 0?40:g,l=A.style,c=A.thickness,C=c===void 0?3.6:c,u=A.value,E=u===void 0?0:u,B=A.variant,h=B===void 0?"indeterminate":B,f=xA(A,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),Q={},d={},w={};if(h==="determinate"||h==="static"){var m=2*Math.PI*((pr-C)/2);Q.strokeDasharray=m.toFixed(3),w["aria-valuenow"]=Math.round(E),Q.strokeDashoffset="".concat(((100-E)/100*m).toFixed(3),"px"),d.transform="rotate(-90deg)"}return p.createElement("div",k({className:vA(n.root,i,o!=="inherit"&&n["color".concat(De(o))],{determinate:n.determinate,indeterminate:n.indeterminate,static:n.static}[h]),style:k({width:I,height:I},d,l),ref:t,role:"progressbar"},w,f),p.createElement("svg",{className:n.svg,viewBox:"".concat(pr/2," ").concat(pr/2," ").concat(pr," ").concat(pr)},p.createElement("circle",{className:vA(n.circle,a&&n.circleDisableShrink,{determinate:n.circleDeterminate,indeterminate:n.circleIndeterminate,static:n.circleStatic}[h]),style:Q,cx:pr,cy:pr,r:(pr-C)/2,fill:"none",strokeWidth:C})))});const wM=se(bcA,{name:"MuiCircularProgress",flip:!1})(GcA);var kcA=[0,1,2,3,4,5,6,7,8,9,10],McA=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function TcA(e,A,t){var n={};McA.forEach(function(i){var r="grid-".concat(t,"-").concat(i);if(i===!0){n[r]={flexBasis:0,flexGrow:1,maxWidth:"100%"};return}if(i==="auto"){n[r]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};return}var o="".concat(Math.round(i/12*1e8)/1e6,"%");n[r]={flexBasis:o,flexGrow:0,maxWidth:o}}),t==="xs"?k(e,n):e[A.breakpoints.up(t)]=n}function hQ(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=parseFloat(e);return"".concat(t/A).concat(String(e).replace(String(t),"")||"px")}function UcA(e,A){var t={};return kcA.forEach(function(n){var i=e.spacing(n);i!==0&&(t["spacing-".concat(A,"-").concat(n)]={margin:"-".concat(hQ(i,2)),width:"calc(100% + ".concat(hQ(i),")"),"& > $item":{padding:hQ(i,2)}})}),t}var PcA=function(A){return k({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-content-xs-center":{justifyContent:"center"},"justify-content-xs-flex-end":{justifyContent:"flex-end"},"justify-content-xs-space-between":{justifyContent:"space-between"},"justify-content-xs-space-around":{justifyContent:"space-around"},"justify-content-xs-space-evenly":{justifyContent:"space-evenly"}},UcA(A,"xs"),A.breakpoints.keys.reduce(function(t,n){return TcA(t,A,n),t},{}))},HcA=p.forwardRef(function(A,t){var n=A.alignContent,i=n===void 0?"stretch":n,r=A.alignItems,o=r===void 0?"stretch":r,s=A.classes,a=A.className,g=A.component,I=g===void 0?"div":g,l=A.container,c=l===void 0?!1:l,C=A.direction,u=C===void 0?"row":C,E=A.item,B=E===void 0?!1:E,h=A.justify,f=A.justifyContent,Q=f===void 0?"flex-start":f,d=A.lg,w=d===void 0?!1:d,m=A.md,v=m===void 0?!1:m,x=A.sm,D=x===void 0?!1:x,F=A.spacing,N=F===void 0?0:F,M=A.wrap,P=M===void 0?"wrap":M,H=A.xl,W=H===void 0?!1:H,J=A.xs,Z=J===void 0?!1:J,z=A.zeroMinWidth,O=z===void 0?!1:z,Y=xA(A,["alignContent","alignItems","classes","className","component","container","direction","item","justify","justifyContent","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),T=vA(s.root,a,c&&[s.container,N!==0&&s["spacing-xs-".concat(String(N))]],B&&s.item,O&&s.zeroMinWidth,u!=="row"&&s["direction-xs-".concat(String(u))],P!=="wrap"&&s["wrap-xs-".concat(String(P))],o!=="stretch"&&s["align-items-xs-".concat(String(o))],i!=="stretch"&&s["align-content-xs-".concat(String(i))],(h||Q)!=="flex-start"&&s["justify-content-xs-".concat(String(h||Q))],Z!==!1&&s["grid-xs-".concat(String(Z))],D!==!1&&s["grid-sm-".concat(String(D))],v!==!1&&s["grid-md-".concat(String(v))],w!==!1&&s["grid-lg-".concat(String(w))],W!==!1&&s["grid-xl-".concat(String(W))]);return p.createElement(I,k({className:T,ref:t},Y))}),qcA=se(PcA,{name:"MuiGrid"})(HcA);const re=qcA;var Vs;function vM(){if(Vs)return Vs;var e=document.createElement("div"),A=document.createElement("div");return A.style.width="10px",A.style.height="1px",e.appendChild(A),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),Vs="reverse",e.scrollLeft>0?Vs="default":(e.scrollLeft=1,e.scrollLeft===0&&(Vs="negative")),document.body.removeChild(e),Vs}function pF(e,A){var t=e.scrollLeft;if(A!=="rtl")return t;var n=vM();switch(n){case"negative":return e.scrollWidth-e.clientWidth+t;case"reverse":return e.scrollWidth-e.clientWidth-t;default:return t}}function JcA(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function OcA(e,A,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){},r=n.ease,o=r===void 0?JcA:r,s=n.duration,a=s===void 0?300:s,g=null,I=A[e],l=!1,c=function(){l=!0},C=function u(E){if(l){i(new Error("Animation cancelled"));return}g===null&&(g=E);var B=Math.min(1,(E-g)/a);if(A[e]=o(B)*(t-I)+I,B>=1){requestAnimationFrame(function(){i(null)});return}requestAnimationFrame(u)};return I===t?(i(new Error("Element already at target position")),c):(requestAnimationFrame(C),c)}var YcA={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function KcA(e){var A=e.onChange,t=xA(e,["onChange"]),n=p.useRef(),i=p.useRef(null),r=function(){n.current=i.current.offsetHeight-i.current.clientHeight};return p.useEffect(function(){var o=Va(function(){var s=n.current;r(),s!==n.current&&A(n.current)});return window.addEventListener("resize",o),function(){o.clear(),window.removeEventListener("resize",o)}},[A]),p.useEffect(function(){r(),A(n.current)},[A]),p.createElement("div",k({style:YcA,ref:i},t))}var VcA=function(A){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:A.transitions.create()},colorPrimary:{backgroundColor:A.palette.primary.main},colorSecondary:{backgroundColor:A.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}},WcA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.color,o=A.orientation,s=xA(A,["classes","className","color","orientation"]);return p.createElement("span",k({className:vA(n.root,n["color".concat(De(r))],i,o==="vertical"&&n.vertical),ref:t},s))});const zcA=se(VcA,{name:"PrivateTabIndicator"})(WcA),jcA=Mn(p.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),XcA=Mn(p.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));var ZcA={root:{width:40,flexShrink:0,opacity:.8,"&$disabled":{opacity:0}},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}},disabled:{}},$cA=p.createElement(jcA,{fontSize:"small"}),ACA=p.createElement(XcA,{fontSize:"small"}),eCA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.direction,o=A.orientation,s=A.disabled,a=xA(A,["classes","className","direction","orientation","disabled"]);return p.createElement(Sc,k({component:"div",className:vA(n.root,i,s&&n.disabled,o==="vertical"&&n.vertical),ref:t,role:null,tabIndex:null},a),r==="left"?$cA:ACA)});const tCA=se(ZcA,{name:"MuiTabScrollButton"})(eCA);var nCA=function(A){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:y({},A.breakpoints.down("xs"),{display:"none"}),indicator:{}}},iCA=p.forwardRef(function(A,t){var n=A["aria-label"],i=A["aria-labelledby"],r=A.action,o=A.centered,s=o===void 0?!1:o,a=A.children,g=A.classes,I=A.className,l=A.component,c=l===void 0?"div":l,C=A.indicatorColor,u=C===void 0?"secondary":C,E=A.onChange,B=A.orientation,h=B===void 0?"horizontal":B,f=A.ScrollButtonComponent,Q=f===void 0?tCA:f,d=A.scrollButtons,w=d===void 0?"auto":d,m=A.selectionFollowsFocus,v=A.TabIndicatorProps,x=v===void 0?{}:v,D=A.TabScrollButtonProps,F=A.textColor,N=F===void 0?"inherit":F,M=A.value,P=A.variant,H=P===void 0?"standard":P,W=xA(A,["aria-label","aria-labelledby","action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant"]),J=tc(),Z=H==="scrollable",z=J.direction==="rtl",O=h==="vertical",Y=O?"scrollTop":"scrollLeft",T=O?"top":"left",q=O?"bottom":"right",j=O?"clientHeight":"clientWidth",AA=O?"height":"width",nA=p.useState(!1),IA=nA[0],aA=nA[1],BA=p.useState({}),lA=BA[0],MA=BA[1],EA=p.useState({start:!1,end:!1}),pA=EA[0],qA=EA[1],NA=p.useState({overflow:"hidden",marginBottom:null}),JA=NA[0],dA=NA[1],GA=new Map,ie=p.useRef(null),Ie=p.useRef(null),he=function(){var rA=ie.current,TA;if(rA){var Le=rA.getBoundingClientRect();TA={clientWidth:rA.clientWidth,scrollLeft:rA.scrollLeft,scrollTop:rA.scrollTop,scrollLeftNormalized:pF(rA,J.direction),scrollWidth:rA.scrollWidth,top:Le.top,bottom:Le.bottom,left:Le.left,right:Le.right}}var xe;if(rA&&M!==!1){var Te=Ie.current.children;if(Te.length>0){var Ue=Te[GA.get(M)];xe=Ue?Ue.getBoundingClientRect():null}}return{tabsMeta:TA,tabMeta:xe}},XA=Ze(function(){var OA,rA=he(),TA=rA.tabsMeta,Le=rA.tabMeta,xe=0;if(Le&&TA)if(O)xe=Le.top-TA.top+TA.scrollTop;else{var Te=z?TA.scrollLeftNormalized+TA.clientWidth-TA.scrollWidth:TA.scrollLeft;xe=Le.left-TA.left+Te}var Ue=(OA={},y(OA,T,xe),y(OA,AA,Le?Le[AA]:0),OA);if(isNaN(lA[T])||isNaN(lA[AA]))MA(Ue);else{var ot=Math.abs(lA[T]-Ue[T]),lt=Math.abs(lA[AA]-Ue[AA]);(ot>=1||lt>=1)&&MA(Ue)}}),eA=function(rA){OcA(Y,ie.current,rA)},gA=function(rA){var TA=ie.current[Y];O?TA+=rA:(TA+=rA*(z?-1:1),TA*=z&&vM()==="reverse"?-1:1),eA(TA)},LA=function(){gA(-ie.current[j])},le=function(){gA(ie.current[j])},ZA=p.useCallback(function(OA){dA({overflow:null,marginBottom:-OA})},[]),Je=function(){var rA={};rA.scrollbarSizeListener=Z?p.createElement(KcA,{className:g.scrollable,onChange:ZA}):null;var TA=pA.start||pA.end,Le=Z&&(w==="auto"&&TA||w==="desktop"||w==="on");return rA.scrollButtonStart=Le?p.createElement(Q,k({orientation:h,direction:z?"right":"left",onClick:LA,disabled:!pA.start,className:vA(g.scrollButtons,w!=="on"&&g.scrollButtonsDesktop)},D)):null,rA.scrollButtonEnd=Le?p.createElement(Q,k({orientation:h,direction:z?"left":"right",onClick:le,disabled:!pA.end,className:vA(g.scrollButtons,w!=="on"&&g.scrollButtonsDesktop)},D)):null,rA},$A=Ze(function(){var OA=he(),rA=OA.tabsMeta,TA=OA.tabMeta;if(!(!TA||!rA)){if(TA[T]rA[q]){var xe=rA[Y]+(TA[q]-rA[q]);eA(xe)}}}),VA=Ze(function(){if(Z&&w!=="off"){var OA=ie.current,rA=OA.scrollTop,TA=OA.scrollHeight,Le=OA.clientHeight,xe=OA.scrollWidth,Te=OA.clientWidth,Ue,ot;if(O)Ue=rA>1,ot=rA1,ot=z?lt>1:lt *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:A.palette.text.secondary,"&$selected":{color:A.palette.primary.main},"&$disabled":{color:A.palette.text.disabled}},textColorSecondary:{color:A.palette.text.secondary,"&$selected":{color:A.palette.secondary.main},"&$disabled":{color:A.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:A.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}},sCA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.disabled,o=r===void 0?!1:r,s=A.disableFocusRipple,a=s===void 0?!1:s,g=A.fullWidth,I=A.icon,l=A.indicator,c=A.label,C=A.onChange,u=A.onClick,E=A.onFocus,B=A.selected,h=A.selectionFollowsFocus,f=A.textColor,Q=f===void 0?"inherit":f,d=A.value,w=A.wrapped,m=w===void 0?!1:w,v=xA(A,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"]),x=function(N){C&&C(N,d),u&&u(N)},D=function(N){h&&!B&&C&&C(N,d),E&&E(N)};return p.createElement(Sc,k({focusRipple:!a,className:vA(n.root,n["textColor".concat(De(Q))],i,o&&n.disabled,B&&n.selected,c&&I&&n.labelIcon,g&&n.fullWidth,m&&n.wrapped),ref:t,role:"tab","aria-selected":B,disabled:o,onClick:x,onFocus:D,tabIndex:B?0:-1},v),p.createElement("span",{className:n.wrapper},I,c),l)});const yF=se(oCA,{name:"MuiTab"})(sCA);var aCA=function(A){return{root:{height:1,margin:0,border:"none",flexShrink:0,backgroundColor:A.palette.divider},absolute:{position:"absolute",bottom:0,left:0,width:"100%"},inset:{marginLeft:72},light:{backgroundColor:mt(A.palette.divider,.08)},middle:{marginLeft:A.spacing(2),marginRight:A.spacing(2)},vertical:{height:"100%",width:1},flexItem:{alignSelf:"stretch",height:"auto"}}},gCA=p.forwardRef(function(A,t){var n=A.absolute,i=n===void 0?!1:n,r=A.classes,o=A.className,s=A.component,a=s===void 0?"hr":s,g=A.flexItem,I=g===void 0?!1:g,l=A.light,c=l===void 0?!1:l,C=A.orientation,u=C===void 0?"horizontal":C,E=A.role,B=E===void 0?a!=="hr"?"separator":void 0:E,h=A.variant,f=h===void 0?"fullWidth":h,Q=xA(A,["absolute","classes","className","component","flexItem","light","orientation","role","variant"]);return p.createElement(a,k({className:vA(r.root,o,f!=="fullWidth"&&r[f],i&&r.absolute,I&&r.flexItem,c&&r.light,u==="vertical"&&r.vertical),role:B,ref:t},Q))});const Z0=se(aCA,{name:"MuiDivider"})(gCA);var SM=p.createContext();function ICA(){return p.useContext(SM)}const uw=SM;function vg(){return p.useContext(uw)}var lCA={root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},cCA=p.forwardRef(function(A,t){var n=A.autoFocus,i=A.checked,r=A.checkedIcon,o=A.classes,s=A.className,a=A.defaultChecked,g=A.disabled,I=A.icon,l=A.id,c=A.inputProps,C=A.inputRef,u=A.name,E=A.onBlur,B=A.onChange,h=A.onFocus,f=A.readOnly,Q=A.required,d=A.tabIndex,w=A.type,m=A.value,v=xA(A,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),x=ih({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),D=Ac(x,2),F=D[0],N=D[1],M=vg(),P=function(O){h&&h(O),M&&M.onFocus&&M.onFocus(O)},H=function(O){E&&E(O),M&&M.onBlur&&M.onBlur(O)},W=function(O){var Y=O.target.checked;N(Y),B&&B(O,Y)},J=g;M&&typeof J>"u"&&(J=M.disabled);var Z=w==="checkbox"||w==="radio";return p.createElement(Bs,k({component:"span",className:vA(o.root,s,F&&o.checked,J&&o.disabled),disabled:J,tabIndex:null,role:void 0,onFocus:P,onBlur:H,ref:t},v),p.createElement("input",k({autoFocus:n,checked:i,defaultChecked:a,className:o.input,disabled:J,id:Z&&l,name:u,onChange:W,readOnly:f,ref:C,required:Q,tabIndex:d,type:w,value:m},c)),F?r:I)});const CCA=se(lCA,{name:"PrivateSwitchBase"})(cCA),uCA=Mn(p.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),BCA=Mn(p.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),ECA=Mn(p.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));var hCA=function(A){return{root:{color:A.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:A.palette.primary.main,"&:hover":{backgroundColor:mt(A.palette.primary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:A.palette.action.disabled}},colorSecondary:{"&$checked":{color:A.palette.secondary.main,"&:hover":{backgroundColor:mt(A.palette.secondary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:A.palette.action.disabled}}}},fCA=p.createElement(BCA,null),QCA=p.createElement(uCA,null),dCA=p.createElement(ECA,null),pCA=p.forwardRef(function(A,t){var n=A.checkedIcon,i=n===void 0?fCA:n,r=A.classes,o=A.color,s=o===void 0?"secondary":o,a=A.icon,g=a===void 0?QCA:a,I=A.indeterminate,l=I===void 0?!1:I,c=A.indeterminateIcon,C=c===void 0?dCA:c,u=A.inputProps,E=A.size,B=E===void 0?"medium":E,h=xA(A,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),f=l?C:g,Q=l?C:i;return p.createElement(CCA,k({type:"checkbox",classes:{root:vA(r.root,r["color".concat(De(s))],l&&r.indeterminate),checked:r.checked,disabled:r.disabled},color:s,inputProps:k({"data-indeterminate":l},u),icon:p.cloneElement(f,{fontSize:f.props.fontSize===void 0&&B==="small"?B:f.props.fontSize}),checkedIcon:p.cloneElement(Q,{fontSize:Q.props.fontSize===void 0&&B==="small"?B:Q.props.fontSize}),ref:t},h))});const Bw=se(hCA,{name:"MuiCheckbox"})(pCA);var yCA=function(A){return{thumb:{"&$open":{"& $offset":{transform:"scale(1) translateY(-10px)"}}},open:{},offset:k({zIndex:1},A.typography.body2,{fontSize:A.typography.pxToRem(12),lineHeight:1.2,transition:A.transitions.create(["transform"],{duration:A.transitions.duration.shortest}),top:-34,transformOrigin:"bottom center",transform:"scale(0)",position:"absolute"}),circle:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"currentColor",transform:"rotate(-45deg)"},label:{color:A.palette.primary.contrastText,transform:"rotate(45deg)"}}};function mCA(e){var A=e.children,t=e.classes,n=e.className,i=e.open,r=e.value,o=e.valueLabelDisplay;return o==="off"?A:p.cloneElement(A,{className:vA(A.props.className,(i||o==="on")&&t.open,t.thumb)},p.createElement("span",{className:vA(t.offset,n)},p.createElement("span",{className:t.circle},p.createElement("span",{className:t.label},r))))}const wCA=se(yCA,{name:"PrivateValueLabel"})(mCA);function fQ(e,A){return e-A}function QQ(e,A,t){return Math.min(Math.max(A,e),t)}function mF(e,A){var t=e.reduce(function(i,r,o){var s=Math.abs(A-r);return i===null||s0&&gA.some(function(DA){return DA.label})&&o.marked,Y===!1&&o.trackFalse,M==="vertical"&&o.vertical,Y==="inverted"&&o.trackInverted),onMouseDown:Ns},BA),p.createElement("span",{className:o.rail}),p.createElement("span",{className:o.track,style:_s}),p.createElement("input",{value:eA.join(","),name:v,type:"hidden"}),gA.map(function(DA,kA){var be=GC(DA.value,m,d),Fe=MC[Te].offset(be),ae;return Y===!1?ae=eA.indexOf(DA.value)!==-1:ae=Y==="normal"&&(XA?DA.value>=eA[0]&&DA.value<=eA[eA.length-1]:DA.value<=eA[0])||Y==="inverted"&&(XA?DA.value<=eA[0]||DA.value>=eA[eA.length-1]:DA.value>=eA[0]),p.createElement(p.Fragment,{key:DA.value},p.createElement("span",{style:Fe,"data-index":kA,className:vA(o.mark,ae&&o.markActive)}),DA.label!=null?p.createElement("span",{"aria-hidden":!0,"data-index":kA,style:Fe,className:vA(o.markLabel,ae&&o.markLabelActive)},DA.label):null)}),eA.map(function(DA,kA){var be=GC(DA,m,d),Fe=MC[Te].offset(be);return p.createElement(j,{key:kA,valueLabelFormat:aA,valueLabelDisplay:nA,className:o.valueLabel,value:typeof aA=="function"?aA(H(DA),kA):aA,index:kA,open:JA===kA||pA===kA||nA==="on",disabled:u},p.createElement(z,{className:vA(o.thumb,o["thumbColor".concat(De(g))],pA===kA&&o.active,u&&o.disabled,VA===kA&&o.focusVisible),tabIndex:u?null:0,role:"slider",style:Fe,"data-index":kA,"aria-label":E?E(kA):n,"aria-labelledby":i,"aria-orientation":M,"aria-valuemax":H(d),"aria-valuemin":H(m),"aria-valuenow":H(DA),"aria-valuetext":B?B(H(DA),kA):r,onKeyDown:Le,onFocus:pe,onBlur:we,onMouseOver:OA,onMouseLeave:rA}))}))});const Ew=se(DCA,{name:"MuiSlider"})(RCA);function xCA(e){return e=typeof e=="function"?e():e,Vt.findDOMNode(e)}var dQ=typeof window<"u"?p.useLayoutEffect:p.useEffect,FCA=p.forwardRef(function(A,t){var n=A.children,i=A.container,r=A.disablePortal,o=r===void 0?!1:r,s=A.onRendered,a=p.useState(null),g=a[0],I=a[1],l=it(p.isValidElement(n)?n.ref:null,t);return dQ(function(){o||I(xCA(i)||document.body)},[i,o]),dQ(function(){if(g&&!o)return us(t,g),function(){us(t,null)}},[t,g,o]),dQ(function(){s&&(g||o)&&s()},[s,g,o]),o?p.isValidElement(n)?p.cloneElement(n,{ref:l}):n:g&&Vt.createPortal(n,g)});const DM=FCA;function RM(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var A=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),A}function NCA(e){var A=Rt(e);return A.body===e?nh(A).innerWidth>A.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function zI(e,A){A?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function DF(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function RF(e,A,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0,r=[A,t].concat(Zl(n)),o=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,function(s){s.nodeType===1&&r.indexOf(s)===-1&&o.indexOf(s.tagName)===-1&&zI(s,i)})}function pQ(e,A){var t=-1;return e.some(function(n,i){return A(n)?(t=i,!0):!1}),t}function _CA(e,A){var t=[],n=[],i=e.container,r;if(!A.disableScrollLock){if(NCA(i)){var o=RM();t.push({value:i.style.paddingRight,key:"padding-right",el:i}),i.style["padding-right"]="".concat(DF(i)+o,"px"),r=Rt(i).querySelectorAll(".mui-fixed"),[].forEach.call(r,function(I){n.push(I.style.paddingRight),I.style.paddingRight="".concat(DF(I)+o,"px")})}var s=i.parentElement,a=s.nodeName==="HTML"&&window.getComputedStyle(s)["overflow-y"]==="scroll"?s:i;t.push({value:a.style.overflow,key:"overflow",el:a}),a.style.overflow="hidden"}var g=function(){r&&[].forEach.call(r,function(l,c){n[c]?l.style.paddingRight=n[c]:l.style.removeProperty("padding-right")}),t.forEach(function(l){var c=l.value,C=l.el,u=l.key;c?C.style.setProperty(u,c):C.style.removeProperty(u)})};return g}function LCA(e){var A=[];return[].forEach.call(e.children,function(t){t.getAttribute&&t.getAttribute("aria-hidden")==="true"&&A.push(t)}),A}var bCA=function(){function e(){nJ(this,e),this.modals=[],this.containers=[]}return uy(e,[{key:"add",value:function(t,n){var i=this.modals.indexOf(t);if(i!==-1)return i;i=this.modals.length,this.modals.push(t),t.modalRef&&zI(t.modalRef,!1);var r=LCA(n);RF(n,t.mountNode,t.modalRef,r,!0);var o=pQ(this.containers,function(s){return s.container===n});return o!==-1?(this.containers[o].modals.push(t),i):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblingNodes:r}),i)}},{key:"mount",value:function(t,n){var i=pQ(this.containers,function(o){return o.modals.indexOf(t)!==-1}),r=this.containers[i];r.restore||(r.restore=_CA(r,n))}},{key:"remove",value:function(t){var n=this.modals.indexOf(t);if(n===-1)return n;var i=pQ(this.containers,function(s){return s.modals.indexOf(t)!==-1}),r=this.containers[i];if(r.modals.splice(r.modals.indexOf(t),1),this.modals.splice(n,1),r.modals.length===0)r.restore&&r.restore(),t.modalRef&&zI(t.modalRef,!0),RF(r.container,t.mountNode,t.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(i,1);else{var o=r.modals[r.modals.length-1];o.modalRef&&zI(o.modalRef,!1)}return n}},{key:"isTopModal",value:function(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}]),e}();function GCA(e){var A=e.children,t=e.disableAutoFocus,n=t===void 0?!1:t,i=e.disableEnforceFocus,r=i===void 0?!1:i,o=e.disableRestoreFocus,s=o===void 0?!1:o,a=e.getDoc,g=e.isEnabled,I=e.open,l=p.useRef(),c=p.useRef(null),C=p.useRef(null),u=p.useRef(),E=p.useRef(null),B=p.useCallback(function(Q){E.current=Vt.findDOMNode(Q)},[]),h=it(A.ref,B),f=p.useRef();return p.useEffect(function(){f.current=I},[I]),!f.current&&I&&typeof window<"u"&&(u.current=a().activeElement),p.useEffect(function(){if(I){var Q=Rt(E.current);!n&&E.current&&!E.current.contains(Q.activeElement)&&(E.current.hasAttribute("tabIndex")||E.current.setAttribute("tabIndex",-1),E.current.focus());var d=function(){var x=E.current;if(x!==null){if(!Q.hasFocus()||r||!g()||l.current){l.current=!1;return}E.current&&!E.current.contains(Q.activeElement)&&E.current.focus()}},w=function(x){r||!g()||x.keyCode!==9||Q.activeElement===E.current&&(l.current=!0,x.shiftKey?C.current.focus():c.current.focus())};Q.addEventListener("focus",d,!0),Q.addEventListener("keydown",w,!0);var m=setInterval(function(){d()},50);return function(){clearInterval(m),Q.removeEventListener("focus",d,!0),Q.removeEventListener("keydown",w,!0),s||(u.current&&u.current.focus&&u.current.focus(),u.current=null)}}},[n,r,s,g,I]),p.createElement(p.Fragment,null,p.createElement("div",{tabIndex:0,ref:c,"data-test":"sentinelStart"}),p.cloneElement(A,{ref:h}),p.createElement("div",{tabIndex:0,ref:C,"data-test":"sentinelEnd"}))}var xF={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},kCA=p.forwardRef(function(A,t){var n=A.invisible,i=n===void 0?!1:n,r=A.open,o=xA(A,["invisible","open"]);return r?p.createElement("div",k({"aria-hidden":!0,ref:t},o,{style:k({},xF.root,i?xF.invisible:{},o.style)})):null});const MCA=kCA;function TCA(e){return e=typeof e=="function"?e():e,Vt.findDOMNode(e)}function UCA(e){return e.children?e.children.props.hasOwnProperty("in"):!1}var PCA=new bCA,HCA=function(A){return{root:{position:"fixed",zIndex:A.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}},qCA=p.forwardRef(function(A,t){var n=og(),i=y_({name:"MuiModal",props:k({},A),theme:n}),r=i.BackdropComponent,o=r===void 0?MCA:r,s=i.BackdropProps,a=i.children,g=i.closeAfterTransition,I=g===void 0?!1:g,l=i.container,c=i.disableAutoFocus,C=c===void 0?!1:c,u=i.disableBackdropClick,E=u===void 0?!1:u,B=i.disableEnforceFocus,h=B===void 0?!1:B,f=i.disableEscapeKeyDown,Q=f===void 0?!1:f,d=i.disablePortal,w=d===void 0?!1:d,m=i.disableRestoreFocus,v=m===void 0?!1:m,x=i.disableScrollLock,D=x===void 0?!1:x,F=i.hideBackdrop,N=F===void 0?!1:F,M=i.keepMounted,P=M===void 0?!1:M,H=i.manager,W=H===void 0?PCA:H,J=i.onBackdropClick,Z=i.onClose,z=i.onEscapeKeyDown,O=i.onRendered,Y=i.open,T=xA(i,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),q=p.useState(!0),j=q[0],AA=q[1],nA=p.useRef({}),IA=p.useRef(null),aA=p.useRef(null),BA=it(aA,t),lA=UCA(i),MA=function(){return Rt(IA.current)},EA=function(){return nA.current.modalRef=aA.current,nA.current.mountNode=IA.current,nA.current},pA=function(){W.mount(EA(),{disableScrollLock:D}),aA.current.scrollTop=0},qA=Ze(function(){var gA=TCA(l)||MA().body;W.add(EA(),gA),aA.current&&pA()}),NA=p.useCallback(function(){return W.isTopModal(EA())},[W]),JA=Ze(function(gA){IA.current=gA,gA&&(O&&O(),Y&&NA()?pA():zI(aA.current,!0))}),dA=p.useCallback(function(){W.remove(EA())},[W]);if(p.useEffect(function(){return function(){dA()}},[dA]),p.useEffect(function(){Y?qA():(!lA||!I)&&dA()},[Y,dA,lA,I,qA]),!P&&!Y&&(!lA||j))return null;var GA=function(){AA(!1)},ie=function(){AA(!0),I&&dA()},Ie=function(LA){LA.target===LA.currentTarget&&(J&&J(LA),!E&&Z&&Z(LA,"backdropClick"))},he=function(LA){LA.key!=="Escape"||!NA()||(z&&z(LA),Q||(LA.stopPropagation(),Z&&Z(LA,"escapeKeyDown")))},XA=HCA(n||{zIndex:Q_}),eA={};return a.props.tabIndex===void 0&&(eA.tabIndex=a.props.tabIndex||"-1"),lA&&(eA.onEnter=go(GA,a.props.onEnter),eA.onExited=go(ie,a.props.onExited)),p.createElement(DM,{ref:JA,container:l,disablePortal:w},p.createElement("div",k({ref:BA,onKeyDown:he,role:"presentation"},T,{style:k({},XA.root,!Y&&j?XA.hidden:{},T.style)}),N?null:p.createElement(o,k({open:Y,onClick:Ie},s)),p.createElement(GCA,{disableEnforceFocus:h,disableAutoFocus:C,disableRestoreFocus:v,getDoc:MA,isEnabled:NA,open:Y},p.cloneElement(a,eA))))});const JCA=qCA;function FF(e,A){var t=0;return typeof A=="number"?t=A:A==="center"?t=e.height/2:A==="bottom"&&(t=e.height),t}function NF(e,A){var t=0;return typeof A=="number"?t=A:A==="center"?t=e.width/2:A==="right"&&(t=e.width),t}function _F(e){return[e.horizontal,e.vertical].map(function(A){return typeof A=="number"?"".concat(A,"px"):A}).join(" ")}function OCA(e,A){for(var t=A,n=0;t&&t!==e;)t=t.parentElement,n+=t.scrollTop;return n}function yQ(e){return typeof e=="function"?e():e}var YCA={root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},KCA=p.forwardRef(function(A,t){var n=A.action,i=A.anchorEl,r=A.anchorOrigin,o=r===void 0?{vertical:"top",horizontal:"left"}:r,s=A.anchorPosition,a=A.anchorReference,g=a===void 0?"anchorEl":a,I=A.children,l=A.classes,c=A.className,C=A.container,u=A.elevation,E=u===void 0?8:u,B=A.getContentAnchorEl,h=A.marginThreshold,f=h===void 0?16:h,Q=A.onEnter,d=A.onEntered,w=A.onEntering,m=A.onExit,v=A.onExited,x=A.onExiting,D=A.open,F=A.PaperProps,N=F===void 0?{}:F,M=A.transformOrigin,P=M===void 0?{vertical:"top",horizontal:"left"}:M,H=A.TransitionComponent,W=H===void 0?hM:H,J=A.transitionDuration,Z=J===void 0?"auto":J,z=A.TransitionProps,O=z===void 0?{}:z,Y=xA(A,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),T=p.useRef(),q=p.useCallback(function(EA){if(g==="anchorPosition")return s;var pA=yQ(i),qA=pA&&pA.nodeType===1?pA:Rt(T.current).body,NA=qA.getBoundingClientRect(),JA=EA===0?o.vertical:"center";return{top:NA.top+FF(NA,JA),left:NA.left+NF(NA,o.horizontal)}},[i,o.horizontal,o.vertical,s,g]),j=p.useCallback(function(EA){var pA=0;if(B&&g==="anchorEl"){var qA=B(EA);if(qA&&EA.contains(qA)){var NA=OCA(EA,qA);pA=qA.offsetTop+qA.clientHeight/2-NA||0}}return pA},[o.vertical,g,B]),AA=p.useCallback(function(EA){var pA=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{vertical:FF(EA,P.vertical)+pA,horizontal:NF(EA,P.horizontal)}},[P.horizontal,P.vertical]),nA=p.useCallback(function(EA){var pA=j(EA),qA={width:EA.offsetWidth,height:EA.offsetHeight},NA=AA(qA,pA);if(g==="none")return{top:null,left:null,transformOrigin:_F(NA)};var JA=q(pA),dA=JA.top-NA.vertical,GA=JA.left-NA.horizontal,ie=dA+qA.height,Ie=GA+qA.width,he=nh(yQ(i)),XA=he.innerHeight-f,eA=he.innerWidth-f;if(dAXA){var LA=ie-XA;dA-=LA,NA.vertical+=LA}if(GAeA){var ZA=Ie-eA;GA-=ZA,NA.horizontal+=ZA}return{top:"".concat(Math.round(dA),"px"),left:"".concat(Math.round(GA),"px"),transformOrigin:_F(NA)}},[i,g,q,j,AA,f]),IA=p.useCallback(function(){var EA=T.current;if(EA){var pA=nA(EA);pA.top!==null&&(EA.style.top=pA.top),pA.left!==null&&(EA.style.left=pA.left),EA.style.transformOrigin=pA.transformOrigin}},[nA]),aA=function(pA,qA){w&&w(pA,qA),IA()},BA=p.useCallback(function(EA){T.current=Vt.findDOMNode(EA)},[]);p.useEffect(function(){D&&IA()}),p.useImperativeHandle(n,function(){return D?{updatePosition:function(){IA()}}:null},[D,IA]),p.useEffect(function(){if(D){var EA=Va(function(){IA()});return window.addEventListener("resize",EA),function(){EA.clear(),window.removeEventListener("resize",EA)}}},[D,IA]);var lA=Z;Z==="auto"&&!W.muiSupportAuto&&(lA=void 0);var MA=C||(i?Rt(yQ(i)).body:void 0);return p.createElement(JCA,k({container:MA,open:D,ref:t,BackdropProps:{invisible:!0},className:vA(l.root,c)},Y),p.createElement(W,k({appear:!0,in:D,onEnter:Q,onEntered:d,onExit:m,onExited:v,onExiting:x,timeout:lA},O,{onEntering:go(aA,O.onEntering)}),p.createElement(fo,k({elevation:E,ref:BA},N,{className:vA(l.paper,N.className)}),I)))});const VCA=se(YCA,{name:"MuiPopover"})(KCA);var WCA=p.createContext({});const Qu=WCA;var zCA={root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},jCA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className,o=A.component,s=o===void 0?"ul":o,a=A.dense,g=a===void 0?!1:a,I=A.disablePadding,l=I===void 0?!1:I,c=A.subheader,C=xA(A,["children","classes","className","component","dense","disablePadding","subheader"]),u=p.useMemo(function(){return{dense:g}},[g]);return p.createElement(Qu.Provider,{value:u},p.createElement(s,k({className:vA(i.root,r,g&&i.dense,!l&&i.padding,c&&i.subheader),ref:t},C),c,n))});const XCA=se(zCA,{name:"MuiList"})(jCA);function mQ(e,A,t){return e===A?e.firstChild:A&&A.nextElementSibling?A.nextElementSibling:t?null:e.firstChild}function LF(e,A,t){return e===A?t?e.firstChild:e.lastChild:A&&A.previousElementSibling?A.previousElementSibling:t?null:e.lastChild}function xM(e,A){if(A===void 0)return!0;var t=e.innerText;return t===void 0&&(t=e.textContent),t=t.trim().toLowerCase(),t.length===0?!1:A.repeating?t[0]===A.keys[0]:t.indexOf(A.keys.join(""))===0}function nI(e,A,t,n,i,r){for(var o=!1,s=i(e,A,A?t:!1);s;){if(s===e.firstChild){if(o)return;o=!0}var a=n?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!xM(s,r)||a)s=i(e,s,t);else{s.focus();return}}}var ZCA=typeof window>"u"?p.useEffect:p.useLayoutEffect,$CA=p.forwardRef(function(A,t){var n=A.actions,i=A.autoFocus,r=i===void 0?!1:i,o=A.autoFocusItem,s=o===void 0?!1:o,a=A.children,g=A.className,I=A.disabledItemsFocusable,l=I===void 0?!1:I,c=A.disableListWrap,C=c===void 0?!1:c,u=A.onKeyDown,E=A.variant,B=E===void 0?"selectedMenu":E,h=xA(A,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),f=p.useRef(null),Q=p.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});ZCA(function(){r&&f.current.focus()},[r]),p.useImperativeHandle(n,function(){return{adjustStyleForScrollbar:function(F,N){var M=!f.current.style.width;if(F.clientHeight0&&(J-H.lastTime>500?(H.keys=[],H.repeating=!0,H.previousKeyMatched=!0):H.repeating&&W!==H.keys[0]&&(H.repeating=!1)),H.lastTime=J,H.keys.push(W);var Z=P&&!H.repeating&&xM(P,H);H.previousKeyMatched&&(Z||nI(N,P,!1,l,mQ,H))?F.preventDefault():H.previousKeyMatched=!1}u&&u(F)},w=p.useCallback(function(D){f.current=Vt.findDOMNode(D)},[]),m=it(w,t),v=-1;p.Children.forEach(a,function(D,F){p.isValidElement(D)&&(D.props.disabled||(B==="selectedMenu"&&D.props.selected||v===-1)&&(v=F))});var x=p.Children.map(a,function(D,F){if(F===v){var N={};return s&&(N.autoFocus=!0),D.props.tabIndex===void 0&&B==="selectedMenu"&&(N.tabIndex=0),p.cloneElement(D,N)}return D});return p.createElement(XCA,k({role:"menu",ref:m,className:g,onKeyDown:d,tabIndex:r?0:-1},h),x)});const hw=$CA;var bF={vertical:"top",horizontal:"right"},GF={vertical:"top",horizontal:"left"},AuA={paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},euA=p.forwardRef(function(A,t){var n=A.autoFocus,i=n===void 0?!0:n,r=A.children,o=A.classes,s=A.disableAutoFocusItem,a=s===void 0?!1:s,g=A.MenuListProps,I=g===void 0?{}:g,l=A.onClose,c=A.onEntering,C=A.open,u=A.PaperProps,E=u===void 0?{}:u,B=A.PopoverClasses,h=A.transitionDuration,f=h===void 0?"auto":h,Q=A.TransitionProps;Q=Q===void 0?{}:Q;var d=Q.onEntering,w=xA(Q,["onEntering"]),m=A.variant,v=m===void 0?"selectedMenu":m,x=xA(A,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant"]),D=tc(),F=i&&!a&&C,N=p.useRef(null),M=p.useRef(null),P=function(){return M.current},H=function(O,Y){N.current&&N.current.adjustStyleForScrollbar(O,D),c&&c(O,Y),d&&d(O,Y)},W=function(O){O.key==="Tab"&&(O.preventDefault(),l&&l(O,"tabKeyDown"))},J=-1;p.Children.map(r,function(z,O){p.isValidElement(z)&&(z.props.disabled||(v!=="menu"&&z.props.selected||J===-1)&&(J=O))});var Z=p.Children.map(r,function(z,O){return O===J?p.cloneElement(z,{ref:function(T){M.current=Vt.findDOMNode(T),us(z.ref,T)}}):z});return p.createElement(VCA,k({getContentAnchorEl:P,classes:B,onClose:l,TransitionProps:k({onEntering:H},w),anchorOrigin:D.direction==="rtl"?bF:GF,transformOrigin:D.direction==="rtl"?bF:GF,PaperProps:k({},E,{classes:k({},E.classes,{root:o.paper})}),open:C,ref:t,transitionDuration:f},x),p.createElement(hw,k({onKeyDown:W,actions:N,autoFocus:i&&(J===-1||a),autoFocusItem:F,variant:v},I,{className:vA(o.list,I.className)}),Z))});const tuA=se(AuA,{name:"MuiMenu"})(euA);function kF(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function fw(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return e&&(kF(e.value)&&e.value!==""||A&&kF(e.defaultValue)&&e.defaultValue!=="")}function nuA(e){return e.startAdornment}function MF(e,A){return Il(A)==="object"&&A!==null?e===A:String(e)===String(A)}function iuA(e){return e==null||typeof e=="string"&&!e.trim()}var ruA=p.forwardRef(function(A,t){var n=A["aria-label"],i=A.autoFocus,r=A.autoWidth,o=A.children,s=A.classes,a=A.className,g=A.defaultValue,I=A.disabled,l=A.displayEmpty,c=A.IconComponent,C=A.inputRef,u=A.labelId,E=A.MenuProps,B=E===void 0?{}:E,h=A.multiple,f=A.name,Q=A.onBlur,d=A.onChange,w=A.onClose,m=A.onFocus,v=A.onOpen,x=A.open,D=A.readOnly,F=A.renderValue,N=A.SelectDisplayProps,M=N===void 0?{}:N,P=A.tabIndex;A.type;var H=A.value,W=A.variant,J=W===void 0?"standard":W,Z=xA(A,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),z=ih({controlled:H,default:g,name:"Select"}),O=Ac(z,2),Y=O[0],T=O[1],q=p.useRef(null),j=p.useState(null),AA=j[0],nA=j[1],IA=p.useRef(x!=null),aA=IA.current,BA=p.useState(),lA=BA[0],MA=BA[1],EA=p.useState(!1),pA=EA[0],qA=EA[1],NA=it(t,C);p.useImperativeHandle(NA,function(){return{focus:function(){AA.focus()},node:q.current,value:Y}},[AA,Y]),p.useEffect(function(){i&&AA&&AA.focus()},[i,AA]),p.useEffect(function(){if(AA){var WA=Rt(AA).getElementById(u);if(WA){var _A=function(){getSelection().isCollapsed&&AA.focus()};return WA.addEventListener("click",_A),function(){WA.removeEventListener("click",_A)}}}},[u,AA]);var JA=function(_A,pe){_A?v&&v(pe):w&&w(pe),aA||(MA(r?null:AA.clientWidth),qA(_A))},dA=function(_A){_A.button===0&&(_A.preventDefault(),AA.focus(),JA(!0,_A))},GA=function(_A){JA(!1,_A)},ie=p.Children.toArray(o),Ie=function(_A){var pe=ie.map(function(OA){return OA.props.value}).indexOf(_A.target.value);if(pe!==-1){var we=ie[pe];T(we.props.value),d&&d(_A,we)}},he=function(_A){return function(pe){h||JA(!1,pe);var we;if(h){we=Array.isArray(Y)?Y.slice():[];var OA=Y.indexOf(_A.props.value);OA===-1?we.push(_A.props.value):we.splice(OA,1)}else we=_A.props.value;_A.props.onClick&&_A.props.onClick(pe),Y!==we&&(T(we),d&&(pe.persist(),Object.defineProperty(pe,"target",{writable:!0,value:{value:we,name:f}}),d(pe,_A)))}},XA=function(_A){if(!D){var pe=[" ","ArrowUp","ArrowDown","Enter"];pe.indexOf(_A.key)!==-1&&(_A.preventDefault(),JA(!0,_A))}},eA=AA!==null&&(aA?x:pA),gA=function(_A){!eA&&Q&&(_A.persist(),Object.defineProperty(_A,"target",{writable:!0,value:{value:Y,name:f}}),Q(_A))};delete Z["aria-invalid"];var LA,le,ZA=[],Je=!1;(fw({value:Y})||l)&&(F?LA=F(Y):Je=!0);var $A=ie.map(function(WA){if(!p.isValidElement(WA))return null;var _A;if(h){if(!Array.isArray(Y))throw new Error(Ma(2));_A=Y.some(function(pe){return MF(pe,WA.props.value)}),_A&&Je&&ZA.push(WA.props.children)}else _A=MF(Y,WA.props.value),_A&&Je&&(le=WA.props.children);return p.cloneElement(WA,{"aria-selected":_A?"true":void 0,onClick:he(WA),onKeyUp:function(we){we.key===" "&&we.preventDefault(),WA.props.onKeyUp&&WA.props.onKeyUp(we)},role:"option",selected:_A,value:void 0,"data-value":WA.props.value})});Je&&(LA=h?ZA.join(", "):le);var VA=lA;!r&&aA&&AA&&(VA=AA.clientWidth);var Me;typeof P<"u"?Me=P:Me=I?null:0;var ue=M.id||(f?"mui-component-select-".concat(f):void 0);return p.createElement(p.Fragment,null,p.createElement("div",k({className:vA(s.root,s.select,s.selectMenu,s[J],a,I&&s.disabled),ref:nA,tabIndex:Me,role:"button","aria-disabled":I?"true":void 0,"aria-expanded":eA?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[u,ue].filter(Boolean).join(" ")||void 0,onKeyDown:XA,onMouseDown:I||D?null:dA,onBlur:gA,onFocus:m},M,{id:ue}),iuA(LA)?p.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):LA),p.createElement("input",k({value:Array.isArray(Y)?Y.join(","):Y,name:f,ref:q,"aria-hidden":!0,onChange:Ie,tabIndex:-1,className:s.nativeInput,autoFocus:i},Z)),p.createElement(c,{className:vA(s.icon,s["icon".concat(De(J))],eA&&s.iconOpen,I&&s.disabled)}),p.createElement(tuA,k({id:"menu-".concat(f||""),anchorEl:AA,open:eA,onClose:GA},B,{MenuListProps:k({"aria-labelledby":u,role:"listbox",disableListWrap:!0},B.MenuListProps),PaperProps:k({},B.PaperProps,{style:k({minWidth:VA},B.PaperProps!=null?B.PaperProps.style:null)})}),$A))});const ouA=ruA;function Sg(e){var A=e.props,t=e.states,n=e.muiFormControl;return t.reduce(function(i,r){return i[r]=A[r],n&&typeof A[r]>"u"&&(i[r]=n[r]),i},{})}const FM=Mn(p.createElement("path",{d:"M7 10l5 5 5-5z"}));function TC(e,A){return parseInt(e[A],10)||0}var suA=typeof window<"u"?p.useLayoutEffect:p.useEffect,auA={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}},guA=p.forwardRef(function(A,t){var n=A.onChange,i=A.rows,r=A.rowsMax,o=A.rowsMin,s=A.maxRows,a=A.minRows,g=a===void 0?1:a,I=A.style,l=A.value,c=xA(A,["onChange","rows","rowsMax","rowsMin","maxRows","minRows","style","value"]),C=s||r,u=i||o||g,E=p.useRef(l!=null),B=E.current,h=p.useRef(null),f=it(t,h),Q=p.useRef(null),d=p.useRef(0),w=p.useState({}),m=w[0],v=w[1],x=p.useCallback(function(){var F=h.current,N=window.getComputedStyle(F),M=Q.current;M.style.width=N.width,M.value=F.value||A.placeholder||"x",M.value.slice(-1)===` -`&&(M.value+=" ");var P=N["box-sizing"],H=TC(N,"padding-bottom")+TC(N,"padding-top"),W=TC(N,"border-bottom-width")+TC(N,"border-top-width"),J=M.scrollHeight-H;M.value="x";var Z=M.scrollHeight-H,z=J;u&&(z=Math.max(Number(u)*Z,z)),C&&(z=Math.min(Number(C)*Z,z)),z=Math.max(z,Z);var O=z+(P==="border-box"?H+W:0),Y=Math.abs(z-J)<=1;v(function(T){return d.current<20&&(O>0&&Math.abs((T.outerHeightStyle||0)-O)>1||T.overflow!==Y)?(d.current+=1,{overflow:Y,outerHeightStyle:O}):T})},[C,u,A.placeholder]);p.useEffect(function(){var F=Va(function(){d.current=0,x()});return window.addEventListener("resize",F),function(){F.clear(),window.removeEventListener("resize",F)}},[x]),suA(function(){x()}),p.useEffect(function(){d.current=0},[l]);var D=function(N){d.current=0,B||x(),n&&n(N)};return p.createElement(p.Fragment,null,p.createElement("textarea",k({value:l,onChange:D,ref:f,rows:u,style:k({height:m.outerHeightStyle,overflow:m.overflow?"hidden":null},I)},c)),p.createElement("textarea",{"aria-hidden":!0,className:A.className,readOnly:!0,ref:Q,tabIndex:-1,style:k({},auA.shadow,I)}))});const IuA=guA;var luA=function(A){var t=A.palette.type==="light",n={color:"currentColor",opacity:t?.42:.5,transition:A.transitions.create("opacity",{duration:A.transitions.duration.shorter})},i={opacity:"0 !important"},r={opacity:t?.42:.5};return{"@global":{"@keyframes mui-auto-fill":{},"@keyframes mui-auto-fill-cancel":{}},root:k({},A.typography.body1,{color:A.palette.text.primary,lineHeight:"1.1876em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center","&$disabled":{color:A.palette.text.disabled,cursor:"default"}}),formControl:{},focused:{},disabled:{},adornedStart:{},adornedEnd:{},error:{},marginDense:{},multiline:{padding:"".concat(8-2,"px 0 ").concat(8-1,"px"),"&$marginDense":{paddingTop:4-1}},colorSecondary:{},fullWidth:{width:"100%"},input:{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"".concat(8-2,"px 0 ").concat(8-1,"px"),border:0,boxSizing:"content-box",background:"none",height:"1.1876em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{"-webkit-appearance":"none"},"label[data-shrink=false] + $formControl &":{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":r,"&:focus::-moz-placeholder":r,"&:focus:-ms-input-placeholder":r,"&:focus::-ms-input-placeholder":r},"&$disabled":{opacity:1},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},inputMarginDense:{paddingTop:4-1},inputMultiline:{height:"auto",resize:"none",padding:0},inputTypeSearch:{"-moz-appearance":"textfield","-webkit-appearance":"textfield"},inputAdornedStart:{},inputAdornedEnd:{},inputHiddenLabel:{}}},cuA=typeof window>"u"?p.useEffect:p.useLayoutEffect,CuA=p.forwardRef(function(A,t){var n=A["aria-describedby"],i=A.autoComplete,r=A.autoFocus,o=A.classes,s=A.className;A.color;var a=A.defaultValue,g=A.disabled,I=A.endAdornment;A.error;var l=A.fullWidth,c=l===void 0?!1:l,C=A.id,u=A.inputComponent,E=u===void 0?"input":u,B=A.inputProps,h=B===void 0?{}:B,f=A.inputRef;A.margin;var Q=A.multiline,d=Q===void 0?!1:Q,w=A.name,m=A.onBlur,v=A.onChange,x=A.onClick,D=A.onFocus,F=A.onKeyDown,N=A.onKeyUp,M=A.placeholder,P=A.readOnly,H=A.renderSuffix,W=A.rows,J=A.rowsMax,Z=A.rowsMin,z=A.maxRows,O=A.minRows,Y=A.startAdornment,T=A.type,q=T===void 0?"text":T,j=A.value,AA=xA(A,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","maxRows","minRows","startAdornment","type","value"]),nA=h.value!=null?h.value:j,IA=p.useRef(nA!=null),aA=IA.current,BA=p.useRef(),lA=p.useCallback(function($A){},[]),MA=it(h.ref,lA),EA=it(f,MA),pA=it(BA,EA),qA=p.useState(!1),NA=qA[0],JA=qA[1],dA=ICA(),GA=Sg({props:A,muiFormControl:dA,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});GA.focused=dA?dA.focused:NA,p.useEffect(function(){!dA&&g&&NA&&(JA(!1),m&&m())},[dA,g,NA,m]);var ie=dA&&dA.onFilled,Ie=dA&&dA.onEmpty,he=p.useCallback(function($A){fw($A)?ie&&ie():Ie&&Ie()},[ie,Ie]);cuA(function(){aA&&he({value:nA})},[nA,he,aA]);var XA=function(VA){if(GA.disabled){VA.stopPropagation();return}D&&D(VA),h.onFocus&&h.onFocus(VA),dA&&dA.onFocus?dA.onFocus(VA):JA(!0)},eA=function(VA){m&&m(VA),h.onBlur&&h.onBlur(VA),dA&&dA.onBlur?dA.onBlur(VA):JA(!1)},gA=function(VA){if(!aA){var Me=VA.target||BA.current;if(Me==null)throw new Error(Ma(1));he({value:Me.value})}for(var ue=arguments.length,WA=new Array(ue>1?ue-1:0),_A=1;_A span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:A.transitions.create("max-width",{duration:100,easing:A.transitions.easing.easeOut,delay:50})}}},QuA=p.forwardRef(function(A,t){A.children;var n=A.classes,i=A.className,r=A.label,o=A.labelWidth,s=A.notched,a=A.style,g=xA(A,["children","classes","className","label","labelWidth","notched","style"]),I=tc(),l=I.direction==="rtl"?"right":"left";if(r!==void 0)return p.createElement("fieldset",k({"aria-hidden":!0,className:vA(n.root,i),ref:t,style:a},g),p.createElement("legend",{className:vA(n.legendLabelled,s&&n.legendNotched)},r?p.createElement("span",null,r):p.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})));var c=o>0?o*.75+8:.01;return p.createElement("fieldset",k({"aria-hidden":!0,style:k(y({},"padding".concat(De(l)),8),a),className:vA(n.root,i),ref:t},g),p.createElement("legend",{className:n.legend,style:{width:s?c:.01}},p.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})))});const duA=se(fuA,{name:"PrivateNotchedOutline"})(QuA);var puA=function(A){var t=A.palette.type==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:A.shape.borderRadius,"&:hover $notchedOutline":{borderColor:A.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:A.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:A.palette.error.main},"&$disabled $notchedOutline":{borderColor:A.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:A.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:A.palette.type==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:A.palette.type==="light"?null:"#fff",caretColor:A.palette.type==="light"?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}},MM=p.forwardRef(function(A,t){var n=A.classes,i=A.fullWidth,r=i===void 0?!1:i,o=A.inputComponent,s=o===void 0?"input":o,a=A.label,g=A.labelWidth,I=g===void 0?0:g,l=A.multiline,c=l===void 0?!1:l,C=A.notched,u=A.type,E=u===void 0?"text":u,B=xA(A,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return p.createElement(Qw,k({renderSuffix:function(f){return p.createElement(duA,{className:n.notchedOutline,label:a,labelWidth:I,notched:typeof C<"u"?C:!!(f.startAdornment||f.filled||f.focused)})},classes:k({},n,{root:vA(n.root,n.underline),notchedOutline:null}),fullWidth:r,inputComponent:s,multiline:c,ref:t,type:E},B))});MM.muiName="Input";const TM=se(puA,{name:"MuiOutlinedInput"})(MM);var yuA=LM,muA=p.createElement(dw,null),wuA=p.createElement(kM,null),UM=p.forwardRef(function e(A,t){var n=A.autoWidth,i=n===void 0?!1:n,r=A.children,o=A.classes,s=A.displayEmpty,a=s===void 0?!1:s,g=A.IconComponent,I=g===void 0?FM:g,l=A.id,c=A.input,C=A.inputProps,u=A.label,E=A.labelId,B=A.labelWidth,h=B===void 0?0:B,f=A.MenuProps,Q=A.multiple,d=Q===void 0?!1:Q,w=A.native,m=w===void 0?!1:w,v=A.onClose,x=A.onOpen,D=A.open,F=A.renderValue,N=A.SelectDisplayProps,M=A.variant,P=M===void 0?"standard":M,H=xA(A,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),W=m?_M:ouA,J=vg(),Z=Sg({props:A,muiFormControl:J,states:["variant"]}),z=Z.variant||P,O=c||{standard:muA,outlined:p.createElement(TM,{label:u,labelWidth:h}),filled:wuA}[z];return p.cloneElement(O,k({inputComponent:W,inputProps:k({children:r,IconComponent:I,variant:z,type:void 0,multiple:d},m?{id:l}:{autoWidth:i,displayEmpty:a,labelId:E,MenuProps:f,onClose:v,onOpen:x,open:D,renderValue:F,SelectDisplayProps:k({id:l},N)},C,{classes:C?Qy({baseClasses:o,newClasses:C.classes,Component:e}):o},c?c.props.inputProps:{}),ref:t},H))});UM.muiName="Select";const Dg=se(yuA,{name:"MuiSelect"})(UM);var pw={},PM={exports:{}};(function(e){function A(t){return t&&t.__esModule?t:{default:t}}e.exports=A,e.exports.__esModule=!0,e.exports.default=e.exports})(PM);var Qo=PM.exports,HM={exports:{}},qM={exports:{}};(function(e){function A(t){"@babel/helpers - typeof";return e.exports=A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,A(t)}e.exports=A,e.exports.__esModule=!0,e.exports.default=e.exports})(qM);var vuA=qM.exports;(function(e){var A=vuA.default;function t(i){if(typeof WeakMap!="function")return null;var r=new WeakMap,o=new WeakMap;return(t=function(a){return a?o:r})(i)}function n(i,r){if(!r&&i&&i.__esModule)return i;if(i===null||A(i)!=="object"&&typeof i!="function")return{default:i};var o=t(r);if(o&&o.has(i))return o.get(i);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var I=a?Object.getOwnPropertyDescriptor(i,g):null;I&&(I.get||I.set)?Object.defineProperty(s,g,I):s[g]=i[g]}return s.default=i,o&&o.set(i,s),s}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(HM);var po=HM.exports,wQ={};const SuA=dT(ilA);var TF;function yo(){return TF||(TF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return A.createSvgIcon}});var A=SuA}(wQ)),wQ}var DuA=Qo,RuA=po;Object.defineProperty(pw,"__esModule",{value:!0});var JM=pw.default=void 0,xuA=RuA(p),FuA=DuA(yo()),NuA=(0,FuA.default)(xuA.createElement("path",{d:"M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"HighlightOff");JM=pw.default=NuA;var yw={},_uA=Qo,LuA=po;Object.defineProperty(yw,"__esModule",{value:!0});var OM=yw.default=void 0,buA=LuA(p),GuA=_uA(yo()),kuA=(0,GuA.default)(buA.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");OM=yw.default=kuA;/**! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gM(e,A){if(e){if(typeof e=="string")return O0(e,A);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return O0(e,A)}}function O0(e,A){(A==null||A>e.length)&&(A=e.length);for(var t=0,n=new Array(A);t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function nIA(e,A){if(e==null)return{};var t={},n=Object.keys(e),i,r;for(r=0;r=0)&&(t[i]=e[i]);return t}var rw=p.forwardRef(function(e,A){var t=e.children,n=HB(e,KgA),i=lM(n),r=i.open,o=HB(i,VgA);return p.useImperativeHandle(A,function(){return{open:r}},[r]),RA.createElement(p.Fragment,null,t(Xe(Xe({},o),{},{open:r})))});rw.displayName="Dropzone";var IM={disabled:!1,getFilesFromEvent:pgA,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1};rw.defaultProps=IM;rw.propTypes={children:Ne.func,accept:Ne.oneOfType([Ne.string,Ne.arrayOf(Ne.string)]),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,validator:Ne.func};var K0={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function lM(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},A=Xe(Xe({},IM),e),t=A.accept,n=A.disabled,i=A.getFilesFromEvent,r=A.maxSize,o=A.minSize,s=A.multiple,a=A.maxFiles,g=A.onDragEnter,I=A.onDragLeave,l=A.onDragOver,c=A.onDrop,C=A.onDropAccepted,u=A.onDropRejected,E=A.onFileDialogCancel,B=A.onFileDialogOpen,h=A.useFsAccessApi,f=A.preventDropOnDocument,Q=A.noClick,d=A.noKeyboard,w=A.noDrag,m=A.noDragEventsBubbling,v=A.validator,x=p.useMemo(function(){return typeof B=="function"?B:oF},[B]),D=p.useMemo(function(){return typeof E=="function"?E:oF},[E]),F=p.useRef(null),N=p.useRef(null),M=p.useReducer(iIA,K0),P=uQ(M,2),H=P[0],W=P[1],J=H.isFocused,Z=H.isFileDialogActive,z=H.draggedFiles,O=function(){Z&&setTimeout(function(){if(N.current){var gA=N.current.files;gA.length||(W({type:"closeDialog"}),D())}},300)};p.useEffect(function(){return h&&iF()?function(){}:(window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)})},[N,Z,D,h]);var Y=p.useRef([]),T=function(gA){F.current&&F.current.contains(gA.target)||(gA.preventDefault(),Y.current=[])};p.useEffect(function(){return f&&(document.addEventListener("dragover",nF,!1),document.addEventListener("drop",T,!1)),function(){f&&(document.removeEventListener("dragover",nF),document.removeEventListener("drop",T))}},[F,f]);var q=p.useCallback(function(eA){eA.preventDefault(),eA.persist(),JA(eA),Y.current=[].concat(jgA(Y.current),[eA.target]),NC(eA)&&Promise.resolve(i(eA)).then(function(gA){PB(eA)&&!m||(W({draggedFiles:gA,isDragActive:!0,type:"setDraggedFiles"}),g&&g(eA))})},[i,g,m]),j=p.useCallback(function(eA){eA.preventDefault(),eA.persist(),JA(eA);var gA=NC(eA);if(gA&&eA.dataTransfer)try{eA.dataTransfer.dropEffect="copy"}catch{}return gA&&l&&l(eA),!1},[l,m]),AA=p.useCallback(function(eA){eA.preventDefault(),eA.persist(),JA(eA);var gA=Y.current.filter(function(le){return F.current&&F.current.contains(le)}),LA=gA.indexOf(eA.target);LA!==-1&&gA.splice(LA,1),Y.current=gA,!(gA.length>0)&&(W({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),NC(eA)&&I&&I(eA))},[F,I,m]),nA=p.useCallback(function(eA,gA){var LA=[],le=[];eA.forEach(function(ZA){var Je=sM(ZA,t),$A=uQ(Je,2),VA=$A[0],Me=$A[1],ue=aM(ZA,o,r),WA=uQ(ue,2),_A=WA[0],pe=WA[1],we=v?v(ZA):null;if(VA&&_A&&!we)LA.push(ZA);else{var OA=[Me,pe];we&&(OA=OA.concat(we)),le.push({file:ZA,errors:OA.filter(function(rA){return rA})})}}),(!s&&LA.length>1||s&&a>=1&&LA.length>a)&&(LA.forEach(function(ZA){le.push({file:ZA,errors:[PgA]})}),LA.splice(0)),W({acceptedFiles:LA,fileRejections:le,type:"setFiles"}),c&&c(LA,le,gA),le.length>0&&u&&u(le,gA),LA.length>0&&C&&C(LA,gA)},[W,s,t,o,r,a,c,C,u,v]),IA=p.useCallback(function(eA){eA.preventDefault(),eA.persist(),JA(eA),Y.current=[],NC(eA)&&Promise.resolve(i(eA)).then(function(gA){PB(eA)&&!m||nA(gA,eA)}),W({type:"reset"})},[i,nA,m]),aA=p.useCallback(function(){if(h&&iF()){W({type:"openDialog"}),x();var eA={multiple:s,types:YgA(t)};window.showOpenFilePicker(eA).then(function(gA){return i(gA)}).then(function(gA){return nA(gA,null)}).catch(function(gA){return D(gA)}).finally(function(){return W({type:"closeDialog"})});return}N.current&&(W({type:"openDialog"}),x(),N.current.value=null,N.current.click())},[W,x,D,h,nA,t,s]),BA=p.useCallback(function(eA){!F.current||!F.current.isEqualNode(eA.target)||(eA.keyCode===32||eA.keyCode===13)&&(eA.preventDefault(),aA())},[F,N,aA]),lA=p.useCallback(function(){W({type:"focus"})},[]),MA=p.useCallback(function(){W({type:"blur"})},[]),EA=p.useCallback(function(){Q||(OgA()?setTimeout(aA,0):aA())},[N,Q,aA]),pA=function(gA){return n?null:gA},qA=function(gA){return d?null:pA(gA)},NA=function(gA){return w?null:pA(gA)},JA=function(gA){m&&gA.stopPropagation()},dA=p.useMemo(function(){return function(){var eA=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},gA=eA.refKey,LA=gA===void 0?"ref":gA,le=eA.role,ZA=eA.onKeyDown,Je=eA.onFocus,$A=eA.onBlur,VA=eA.onClick,Me=eA.onDragEnter,ue=eA.onDragOver,WA=eA.onDragLeave,_A=eA.onDrop,pe=HB(eA,WgA);return Xe(Xe(Y0({onKeyDown:qA(ai(ZA,BA)),onFocus:qA(ai(Je,lA)),onBlur:qA(ai($A,MA)),onClick:pA(ai(VA,EA)),onDragEnter:NA(ai(Me,q)),onDragOver:NA(ai(ue,j)),onDragLeave:NA(ai(WA,AA)),onDrop:NA(ai(_A,IA)),role:typeof le=="string"&&le!==""?le:"button"},LA,F),!n&&!d?{tabIndex:0}:{}),pe)}},[F,BA,lA,MA,EA,q,j,AA,IA,d,w,n]),GA=p.useCallback(function(eA){eA.stopPropagation()},[]),ie=p.useMemo(function(){return function(){var eA=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},gA=eA.refKey,LA=gA===void 0?"ref":gA,le=eA.onChange,ZA=eA.onClick,Je=HB(eA,zgA),$A=Y0({accept:t,multiple:s,type:"file",style:{display:"none"},onChange:pA(ai(le,IA)),onClick:pA(ai(ZA,GA)),autoComplete:"off",tabIndex:-1},LA,N);return Xe(Xe({},$A),Je)}},[N,t,s,IA,n]),Ie=z.length,he=Ie>0&&HgA({files:z,accept:t,minSize:o,maxSize:r,multiple:s,maxFiles:a}),XA=Ie>0&&!he;return Xe(Xe({},H),{},{isDragAccept:he,isDragReject:XA,isFocused:J&&!n,getRootProps:dA,getInputProps:ie,rootRef:F,inputRef:N,open:pA(aA)})}function iIA(e,A){switch(A.type){case"focus":return Xe(Xe({},e),{},{isFocused:!0});case"blur":return Xe(Xe({},e),{},{isFocused:!1});case"openDialog":return Xe(Xe({},K0),{},{isFileDialogActive:!0});case"closeDialog":return Xe(Xe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var t=A.isDragActive,n=A.draggedFiles;return Xe(Xe({},e),{},{draggedFiles:n,isDragActive:t});case"setFiles":return Xe(Xe({},e),{},{acceptedFiles:A.acceptedFiles,fileRejections:A.fileRejections});case"reset":return Xe({},K0);default:return e}}function oF(){}function Ve(e,A){if(Object.is(e,A))return!0;if(typeof e!="object"||e===null||typeof A!="object"||A===null)return!1;const t=Object.keys(e);if(t.length!==Object.keys(A).length)return!1;for(let n=0;nA.name):e instanceof File?[e.name]:e.split(",")}function lIA(e){const A=IIA(e);for(const t of A){const n=t.toLowerCase();if(!(n.includes(".tiff")||n.includes(".tif")))return!1}return!0}async function cIA(e){return Array.isArray(e)?e:e instanceof File?[e]:e.split(",")}async function CIA(e){return(await(typeof e=="string"?qE:JE)(e)).getImageCount()}async function uIA(e){const A=await cIA(e),t=[];let n=0;for(const i of A){const r=[],o=await CIA(i);for(let s=0;s{const{Pixels:{SizeC:E,SizeT:B,SizeZ:h}}=u;return E*B*h+C},1);const s=t[0].length,{Pixels:{SizeC:a,SizeT:g,SizeZ:I}}=A[0];return a*g*I*s}function EIA(e){return e instanceof Error&&"issues"in e}async function hIA(e,A,t){try{if(gIA(e)){if(e instanceof File)return await G1(e,{images:"all",pool:!1});const r=await fetch(e.replace(/ome\.tif(f?)/gi,"offsets.json")),o=r.status!==200,s=o?void 0:await r.json(),a=await G1(e,{offsets:s,images:"all",pool:!1}),g=await BIA(e,a.map(I=>I.metadata),a.map(I=>I.data));return o&&g>aIA&&A(!0),a}if(Array.isArray(e)&&typeof e[0].arrayBuffer!="function")throw new sF("Cannot upload a local Zarr or flat TIFF files with this browser. Try using Chrome, Firefox, or Microsoft Edge.");if(lIA(e)){const i=await uIA(e);return await PtA(i,{images:"all",pool:!1})}let n;try{n=await WoA(e)}catch(i){if(EIA(i))throw i;const r=await zoA(e,{type:"multiscales"}),o={Pixels:{Channels:r.metadata.omero.channels.map(s=>({Name:s.label,SamplesPerPixel:1}))}};n={data:r.data,metadata:o}}return n}catch(n){return n instanceof sF?t(n.message):(console.error(n),t(null)),{data:null}}}function cM(e){return e.split("?")[0].split("/").slice(-1)[0]}function fIA(e){const A=e.filter(n=>sw.includes(n.name.toLowerCase())),t={};for(const n of A)t[n.name]=Math.floor(n.size/2);return t}function QIA(e){return e=e.toLowerCase(),e==="x"||e==="y"||sw.includes(e)}function CM(e){const A=e[e.length-1];return A===3||A===4}function dIA(e,A){if(e.length!==A.length)throw new Error("Array lengths must be equal");return e.map((t,n)=>[t,A[n]])}function pIA({labels:e,shape:A}){let t=[];const n=dIA(e,A).map(([o,s])=>({name:o,size:s})),i=fIA(n),r=n.find(o=>!QIA(o.name));if(!r)return[i];for(let o=0;o{const r=()=>{i(t())};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}}),n}async function yIA({loader:e,selection:A}){const n=await(Array.isArray(e)?e[e.length-1]:e).getRaster({selection:A}),i=Iu(n.data),{domain:r,contrastLimits:o}=i;return{domain:r,contrastLimits:o}}async function mIA({loader:e,selection:A}){const t=e[e.length-1],{shape:n,labels:i}=t,r=n[i.indexOf("z")]>>e.length-1,o=await t.getRaster({selection:{...A,z:0}}),s=await t.getRaster({selection:{...A,z:Math.floor(r/2)}}),a=await t.getRaster({selection:{...A,z:Math.max(0,r-1)}}),g=Iu(o.data),I=Iu(s.data),l=Iu(a.data);return{domain:[Math.min(g.domain[0],I.domain[0],l.domain[0]),Math.max(g.domain[1],I.domain[1],l.domain[1])],contrastLimits:[Math.min(g.contrastLimits[0],I.contrastLimits[0],l.contrastLimits[0]),Math.max(g.contrastLimits[1],I.contrastLimits[1],l.contrastLimits[1])]}}const gw=async({loader:e,selection:A,use3d:t})=>(t?mIA:yIA)({loader:e,selection:A}),qB=async({loader:e,selections:A,use3d:t})=>{const n=await Promise.all(A.map(o=>gw({loader:e,selection:o,use3d:t}))),i=n.map(o=>o.domain),r=n.map(o=>o.contrastLimits);return{domains:i,contrastLimits:r}};function wIA(){let e=!1;return function(A){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(A)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(A.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e}function uM({Pixels:e}){const A=e.Channels.length,{SamplesPerPixel:t}=e.Channels[0],n=A===3&&e.Type==="uint8",i=e.SizeC===3&&A===1&&e.Interleaved;return t===3||n||i}function Iw(e,A){if(!e&&e!==0)return"";const t=e.toString();return t.length>A?t.substring(0,A).replace(/\.$/,""):t}function vIA(e){var i;const{x:A,y:t,z:n}=((i=e==null?void 0:e.meta)==null?void 0:i.physicalSizes)??{};if(A!=null&&A.size&&(t!=null&&t.size)&&(n!=null&&n.size)){const r=Math.min(n.size,A.size,t.size),o=[A.size/r,t.size/r,n.size/r];return new Se().scale(o)}return new Se().identity()}function lw(e){const A=Array.isArray(e)?e[0]:e,{shape:t,labels:n}=A,i=vIA(A),r=[0,i[0]*t[n.indexOf("x")]],o=[0,i[5]*t[n.indexOf("y")]],s=[0,i[10]*t[n.indexOf("z")]];return[r,o,s]}function SIA(e,A){const t=e?daA:XE;if(A===Na.MAX_INTENSITY_PROJECTION)return new t.MaximumIntensityProjectionExtension;if(A===Na.MIN_INTENSITY_PROJECTION)return new t.MinimumIntensityProjectionExtension;if(A===Na.ADDITIVE)return new t.AdditiveBlendExtension;throw new Error(`${A} rendering mode not supported`)}const DIA=(e,A)=>{const[t,n,i]=UA(g=>[g.use3d,g.toggleUse3d,g.toggleIsOffsetsSnackbarOn],Ve),[r,o]=ve(g=>[g.lensEnabled,g.toggleLensEnabled],Ve),s=Fi(),a=iw();p.useEffect(()=>{async function g(){UA.setState({isChannelLoading:[!0]}),UA.setState({isViewerLoading:!0}),t&&n();const{urlOrFile:I}=e,l=await hIA(I,i,u=>UA.setState({loaderErrorSnackbar:{on:!0,message:u}}));let c,C;Array.isArray(l)?l.length>1?(c=l.map(u=>u.metadata),C=l.map(u=>u.data)):(c=l[0].metadata,C=l[0].data):(c=l.metadata,C=l.data),C&&(console.info("Metadata (in JSON-like form) for current file being viewed: ",c),Vt.unstable_batchedUpdates(()=>{bn.setState({loader:C}),UA.setState({metadata:c})}),t&&n(),A==null||A.push(typeof I=="string"?`?image_url=${I}`:""))}e&&g()},[e,A]),p.useEffect(()=>{a&&(async()=>{UA.setState({isChannelLoading:[!0]}),UA.setState({isViewerLoading:!0}),t&&n();const I=pIA(s[0]),{Channels:l}=a.Pixels,c=l.map((d,w)=>d.Name??`Channel ${w}`);let C=[],u=[],E=[];if(uM(a))CM(s[0].shape)?(C=[[0,255]],u=[[0,255]],E=[[255,0,0]]):(C=[[0,255],[0,255],[0,255]],u=[[0,255],[0,255],[0,255]],E=[[255,0,0],[0,255,0],[0,0,255]]),r&&o(),UA.setState({useColormap:!1,useLens:!1});else{const d=await qB({loader:s,selections:I,use3d:!1});u=d.domains,C=d.contrastLimits,E=u.length===1?[[255,255,255]]:u.map((w,m)=>{var v;return(((v=l[m])==null?void 0:v.Color)&&l[m].Color.slice(0,-1))??ow[m]}),UA.setState({useLens:c.length!==1,useColormap:!0})}bn.setState({ids:u.map(()=>String(Math.random())),selections:I,domains:u,contrastLimits:C,colors:E,channelsVisible:E.map(()=>!0)}),UA.setState({isChannelLoading:I.map(d=>!d),isViewerLoading:!1,pixelValues:new Array(I.length).fill(V0),globalSelection:I[0],channelOptions:c});const[h,f,Q]=lw(s);ve.setState({xSlice:h,ySlice:f,zSlice:Q})})()},[s,a])},BM=()=>lM({onDrop:A=>{let t;A.length===1?t={urlOrFile:A[0],description:A[0].name}:t={urlOrFile:A,description:"data.zarr"},UA.setState({source:t})}});function Rt(e){return e&&e.ownerDocument||document}function us(e,A){typeof e=="function"?e(A):e&&(e.current=A)}function it(e,A){return p.useMemo(function(){return e==null&&A==null?null:function(t){us(e,t),us(A,t)}},[e,A])}var RIA=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Ze(e){var A=p.useRef(e);return RIA(function(){A.current=e}),p.useCallback(function(){return A.current.apply(void 0,arguments)},[])}function aF(e){return e.substring(2).toLowerCase()}function xIA(e){return document.documentElement.clientWidth-1;else{var w=Rt(I.current);d=!w.documentElement.contains(f.target)||I.current.contains(f.target)}!d&&(n||!Q)&&o(f)}}),B=function(Q){return function(d){c.current=!0;var w=A.props[Q];w&&w(d)}},h={ref:u};return a!==!1&&(h[a]=B(a)),p.useEffect(function(){if(a!==!1){var f=aF(a),Q=Rt(I.current),d=function(){g.current=!0};return Q.addEventListener(f,E),Q.addEventListener("touchmove",d),function(){Q.removeEventListener(f,E),Q.removeEventListener("touchmove",d)}}},[E,a]),r!==!1&&(h[r]=B(r)),p.useEffect(function(){if(r!==!1){var f=aF(r),Q=Rt(I.current);return Q.addEventListener(f,E),function(){Q.removeEventListener(f,E)}}},[E,r]),p.createElement(p.Fragment,null,p.cloneElement(A,h))}function De(e){if(typeof e!="string")throw new Error(Ma(7));return e.charAt(0).toUpperCase()+e.slice(1)}function go(){for(var e=arguments.length,A=new Array(e),t=0;t1&&arguments[1]!==void 0?arguments[1]:166,t;function n(){for(var i=arguments.length,r=new Array(i),o=0;o"u"?p.useEffect:p.useLayoutEffect;function clA(e){var A=e.classes,t=e.pulsate,n=t===void 0?!1:t,i=e.rippleX,r=e.rippleY,o=e.rippleSize,s=e.in,a=e.onExited,g=a===void 0?function(){}:a,I=e.timeout,l=p.useState(!1),c=l[0],C=l[1],u=vA(A.ripple,A.rippleVisible,n&&A.ripplePulsate),E={width:o,height:o,top:-(o/2)+r,left:-(o/2)+i},B=vA(A.child,c&&A.childLeaving,n&&A.childPulsate),h=Ze(g);return llA(function(){if(!s){C(!0);var f=setTimeout(h,I);return function(){clearTimeout(f)}}},[h,s,I]),p.createElement("span",{className:u,style:E},p.createElement("span",{className:B}))}var X0=550,ClA=80,ulA=function(A){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(X0,"ms ").concat(A.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(A.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(X0,"ms ").concat(A.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(A.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}},BlA=p.forwardRef(function(A,t){var n=A.center,i=n===void 0?!1:n,r=A.classes,o=A.className,s=xA(A,["center","classes","className"]),a=p.useState([]),g=a[0],I=a[1],l=p.useRef(0),c=p.useRef(null);p.useEffect(function(){c.current&&(c.current(),c.current=null)},[g]);var C=p.useRef(!1),u=p.useRef(null),E=p.useRef(null),B=p.useRef(null);p.useEffect(function(){return function(){clearTimeout(u.current)}},[]);var h=p.useCallback(function(w){var m=w.pulsate,v=w.rippleX,x=w.rippleY,D=w.rippleSize,F=w.cb;I(function(N){return[].concat(Zl(N),[p.createElement(clA,{key:l.current,classes:r,timeout:X0,pulsate:m,rippleX:v,rippleY:x,rippleSize:D})])}),l.current+=1,c.current=F},[r]),f=p.useCallback(function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=arguments.length>2?arguments[2]:void 0,x=m.pulsate,D=x===void 0?!1:x,F=m.center,N=F===void 0?i||m.pulsate:F,M=m.fakeElement,P=M===void 0?!1:M;if(w.type==="mousedown"&&C.current){C.current=!1;return}w.type==="touchstart"&&(C.current=!0);var H=P?null:B.current,W=H?H.getBoundingClientRect():{width:0,height:0,left:0,top:0},J,Z,z;if(N||w.clientX===0&&w.clientY===0||!w.clientX&&!w.touches)J=Math.round(W.width/2),Z=Math.round(W.height/2);else{var O=w.touches?w.touches[0]:w,Y=O.clientX,T=O.clientY;J=Math.round(Y-W.left),Z=Math.round(T-W.top)}if(N)z=Math.sqrt((2*Math.pow(W.width,2)+Math.pow(W.height,2))/3),z%2===0&&(z+=1);else{var q=Math.max(Math.abs((H?H.clientWidth:0)-J),J)*2+2,j=Math.max(Math.abs((H?H.clientHeight:0)-Z),Z)*2+2;z=Math.sqrt(Math.pow(q,2)+Math.pow(j,2))}w.touches?E.current===null&&(E.current=function(){h({pulsate:D,rippleX:J,rippleY:Z,rippleSize:z,cb:v})},u.current=setTimeout(function(){E.current&&(E.current(),E.current=null)},ClA)):h({pulsate:D,rippleX:J,rippleY:Z,rippleSize:z,cb:v})},[i,h]),Q=p.useCallback(function(){f({},{pulsate:!0})},[f]),d=p.useCallback(function(w,m){if(clearTimeout(u.current),w.type==="touchend"&&E.current){w.persist(),E.current(),E.current=null,u.current=setTimeout(function(){d(w,m)});return}E.current=null,I(function(v){return v.length>0?v.slice(1):v}),c.current=m},[]);return p.useImperativeHandle(t,function(){return{pulsate:Q,start:f,stop:d}},[Q,f,d]),p.createElement("span",k({className:vA(r.root,o),ref:B},s),p.createElement(TIA,{component:null,exit:!0},g))});const ElA=se(ulA,{flip:!1,name:"MuiTouchRipple"})(p.memo(BlA));var hlA={root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},flA=p.forwardRef(function(A,t){var n=A.action,i=A.buttonRef,r=A.centerRipple,o=r===void 0?!1:r,s=A.children,a=A.classes,g=A.className,I=A.component,l=I===void 0?"button":I,c=A.disabled,C=c===void 0?!1:c,u=A.disableRipple,E=u===void 0?!1:u,B=A.disableTouchRipple,h=B===void 0?!1:B,f=A.focusRipple,Q=f===void 0?!1:f,d=A.focusVisibleClassName,w=A.onBlur,m=A.onClick,v=A.onFocus,x=A.onFocusVisible,D=A.onKeyDown,F=A.onKeyUp,N=A.onMouseDown,M=A.onMouseLeave,P=A.onMouseUp,H=A.onTouchEnd,W=A.onTouchMove,J=A.onTouchStart,Z=A.onDragLeave,z=A.tabIndex,O=z===void 0?0:z,Y=A.TouchRippleProps,T=A.type,q=T===void 0?"button":T,j=xA(A,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),AA=p.useRef(null);function nA(){return Vt.findDOMNode(AA.current)}var IA=p.useRef(null),aA=p.useState(!1),BA=aA[0],lA=aA[1];C&&BA&&lA(!1);var MA=oh(),EA=MA.isFocusVisible,pA=MA.onBlurVisible,qA=MA.ref;p.useImperativeHandle(n,function(){return{focusVisible:function(){lA(!0),AA.current.focus()}}},[]),p.useEffect(function(){BA&&Q&&!E&&IA.current.pulsate()},[E,Q,BA]);function NA(rA,TA){var Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:h;return Ze(function(xe){TA&&TA(xe);var Te=Le;return!Te&&IA.current&&IA.current[rA](xe),!0})}var JA=NA("start",N),dA=NA("stop",Z),GA=NA("stop",P),ie=NA("stop",function(rA){BA&&rA.preventDefault(),M&&M(rA)}),Ie=NA("start",J),he=NA("stop",H),XA=NA("stop",W),eA=NA("stop",function(rA){BA&&(pA(rA),lA(!1)),w&&w(rA)},!1),gA=Ze(function(rA){AA.current||(AA.current=rA.currentTarget),EA(rA)&&(lA(!0),x&&x(rA)),v&&v(rA)}),LA=function(){var TA=nA();return l&&l!=="button"&&!(TA.tagName==="A"&&TA.href)},le=p.useRef(!1),ZA=Ze(function(rA){Q&&!le.current&&BA&&IA.current&&rA.key===" "&&(le.current=!0,rA.persist(),IA.current.stop(rA,function(){IA.current.start(rA)})),rA.target===rA.currentTarget&&LA()&&rA.key===" "&&rA.preventDefault(),D&&D(rA),rA.target===rA.currentTarget&&LA()&&rA.key==="Enter"&&!C&&(rA.preventDefault(),m&&m(rA))}),Je=Ze(function(rA){Q&&rA.key===" "&&IA.current&&BA&&!rA.defaultPrevented&&(le.current=!1,rA.persist(),IA.current.stop(rA,function(){IA.current.pulsate(rA)})),F&&F(rA),m&&rA.target===rA.currentTarget&&LA()&&rA.key===" "&&!rA.defaultPrevented&&m(rA)}),$A=l;$A==="button"&&j.href&&($A="a");var VA={};$A==="button"?(VA.type=q,VA.disabled=C):(($A!=="a"||!j.href)&&(VA.role="button"),VA["aria-disabled"]=C);var Me=it(i,t),ue=it(qA,AA),WA=it(Me,ue),_A=p.useState(!1),pe=_A[0],we=_A[1];p.useEffect(function(){we(!0)},[]);var OA=pe&&!E&&!C;return p.createElement($A,k({className:vA(a.root,g,BA&&[a.focusVisible,d],C&&a.disabled),onBlur:eA,onClick:m,onFocus:gA,onKeyDown:ZA,onKeyUp:Je,onMouseDown:JA,onMouseLeave:ie,onMouseUp:GA,onDragLeave:dA,onTouchEnd:he,onTouchMove:XA,onTouchStart:Ie,ref:WA,tabIndex:C?-1:O},VA,j),s,OA?p.createElement(ElA,k({ref:IA,center:o},Y)):null)});const Sc=se(hlA,{name:"MuiButtonBase"})(flA);var QlA=function(A){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:A.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:A.palette.action.active,transition:A.transitions.create("background-color",{duration:A.transitions.duration.shortest}),"&:hover":{backgroundColor:mt(A.palette.action.active,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:A.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:A.palette.primary.main,"&:hover":{backgroundColor:mt(A.palette.primary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:A.palette.secondary.main,"&:hover":{backgroundColor:mt(A.palette.secondary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:A.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}},dlA=p.forwardRef(function(A,t){var n=A.edge,i=n===void 0?!1:n,r=A.children,o=A.classes,s=A.className,a=A.color,g=a===void 0?"default":a,I=A.disabled,l=I===void 0?!1:I,c=A.disableFocusRipple,C=c===void 0?!1:c,u=A.size,E=u===void 0?"medium":u,B=xA(A,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return p.createElement(Sc,k({className:vA(o.root,s,g!=="default"&&o["color".concat(De(g))],l&&o.disabled,E==="small"&&o["size".concat(De(E))],{start:o.edgeStart,end:o.edgeEnd}[i]),centerRipple:!0,focusRipple:!C,disabled:l,ref:t},B),p.createElement("span",{className:o.label},r))});const Bs=se(QlA,{name:"MuiIconButton"})(dlA);var plA=function(A){var t=A.palette.type==="light"?ll:cl,n=A.palette.type==="light"?cl:ll;return{root:k({},A.typography.body2,{borderRadius:A.shape.borderRadius,backgroundColor:"transparent",display:"flex",padding:"6px 16px"}),standardSuccess:{color:t(A.palette.success.main,.6),backgroundColor:n(A.palette.success.main,.9),"& $icon":{color:A.palette.success.main}},standardInfo:{color:t(A.palette.info.main,.6),backgroundColor:n(A.palette.info.main,.9),"& $icon":{color:A.palette.info.main}},standardWarning:{color:t(A.palette.warning.main,.6),backgroundColor:n(A.palette.warning.main,.9),"& $icon":{color:A.palette.warning.main}},standardError:{color:t(A.palette.error.main,.6),backgroundColor:n(A.palette.error.main,.9),"& $icon":{color:A.palette.error.main}},outlinedSuccess:{color:t(A.palette.success.main,.6),border:"1px solid ".concat(A.palette.success.main),"& $icon":{color:A.palette.success.main}},outlinedInfo:{color:t(A.palette.info.main,.6),border:"1px solid ".concat(A.palette.info.main),"& $icon":{color:A.palette.info.main}},outlinedWarning:{color:t(A.palette.warning.main,.6),border:"1px solid ".concat(A.palette.warning.main),"& $icon":{color:A.palette.warning.main}},outlinedError:{color:t(A.palette.error.main,.6),border:"1px solid ".concat(A.palette.error.main),"& $icon":{color:A.palette.error.main}},filledSuccess:{color:"#fff",fontWeight:A.typography.fontWeightMedium,backgroundColor:A.palette.success.main},filledInfo:{color:"#fff",fontWeight:A.typography.fontWeightMedium,backgroundColor:A.palette.info.main},filledWarning:{color:"#fff",fontWeight:A.typography.fontWeightMedium,backgroundColor:A.palette.warning.main},filledError:{color:"#fff",fontWeight:A.typography.fontWeightMedium,backgroundColor:A.palette.error.main},icon:{marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9},message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}},CF={success:p.createElement(olA,{fontSize:"inherit"}),warning:p.createElement(slA,{fontSize:"inherit"}),error:p.createElement(alA,{fontSize:"inherit"}),info:p.createElement(glA,{fontSize:"inherit"})},ylA=p.createElement(IlA,{fontSize:"small"}),mlA=p.forwardRef(function(A,t){var n=A.action,i=A.children,r=A.classes,o=A.className,s=A.closeText,a=s===void 0?"Close":s,g=A.color,I=A.icon,l=A.iconMapping,c=l===void 0?CF:l,C=A.onClose,u=A.role,E=u===void 0?"alert":u,B=A.severity,h=B===void 0?"success":B,f=A.variant,Q=f===void 0?"standard":f,d=xA(A,["action","children","classes","className","closeText","color","icon","iconMapping","onClose","role","severity","variant"]);return p.createElement(fo,k({role:E,square:!0,elevation:0,className:vA(r.root,r["".concat(Q).concat(De(g||h))],o),ref:t},d),I!==!1?p.createElement("div",{className:r.icon},I||c[h]||CF[h]):null,p.createElement("div",{className:r.message},i),n!=null?p.createElement("div",{className:r.action},n):null,n==null&&C?p.createElement("div",{className:r.action},p.createElement(Bs,{size:"small","aria-label":a,title:a,color:"inherit",onClick:C},ylA)):null)});const LC=se(plA,{name:"MuiAlert"})(mlA);var wlA=function(A){return{root:{margin:0},body2:A.typography.body2,body1:A.typography.body1,caption:A.typography.caption,button:A.typography.button,h1:A.typography.h1,h2:A.typography.h2,h3:A.typography.h3,h4:A.typography.h4,h5:A.typography.h5,h6:A.typography.h6,subtitle1:A.typography.subtitle1,subtitle2:A.typography.subtitle2,overline:A.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:A.palette.primary.main},colorSecondary:{color:A.palette.secondary.main},colorTextPrimary:{color:A.palette.text.primary},colorTextSecondary:{color:A.palette.text.secondary},colorError:{color:A.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}},uF={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},vlA=p.forwardRef(function(A,t){var n=A.align,i=n===void 0?"inherit":n,r=A.classes,o=A.className,s=A.color,a=s===void 0?"initial":s,g=A.component,I=A.display,l=I===void 0?"initial":I,c=A.gutterBottom,C=c===void 0?!1:c,u=A.noWrap,E=u===void 0?!1:u,B=A.paragraph,h=B===void 0?!1:B,f=A.variant,Q=f===void 0?"body1":f,d=A.variantMapping,w=d===void 0?uF:d,m=xA(A,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),v=g||(h?"p":w[Q]||uF[Q])||"span";return p.createElement(v,k({className:vA(r.root,o,Q!=="inherit"&&r[Q],a!=="initial"&&r["color".concat(De(a))],E&&r.noWrap,C&&r.gutterBottom,h&&r.paragraph,i!=="inherit"&&r["align".concat(De(i))],l!=="initial"&&r["display".concat(De(l))]),ref:t},m))});const Es=se(wlA,{name:"MuiTypography"})(vlA);var SlA={root:{},underlineNone:{textDecoration:"none"},underlineHover:{textDecoration:"none","&:hover":{textDecoration:"underline"}},underlineAlways:{textDecoration:"underline"},button:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none","&::-moz-focus-inner":{borderStyle:"none"},"&$focusVisible":{outline:"auto"}},focusVisible:{}},DlA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.color,o=r===void 0?"primary":r,s=A.component,a=s===void 0?"a":s,g=A.onBlur,I=A.onFocus,l=A.TypographyClasses,c=A.underline,C=c===void 0?"hover":c,u=A.variant,E=u===void 0?"inherit":u,B=xA(A,["classes","className","color","component","onBlur","onFocus","TypographyClasses","underline","variant"]),h=oh(),f=h.isFocusVisible,Q=h.onBlurVisible,d=h.ref,w=p.useState(!1),m=w[0],v=w[1],x=it(t,d),D=function(M){m&&(Q(),v(!1)),g&&g(M)},F=function(M){f(M)&&v(!0),I&&I(M)};return p.createElement(Es,k({className:vA(n.root,n["underline".concat(De(C))],i,m&&n.focusVisible,a==="button"&&n.button),classes:l,color:o,component:a,onBlur:D,onFocus:F,ref:x,variant:E},B))});const sh=se(SlA,{name:"MuiLink"})(DlA);function RlA(){return b.jsxs(b.Fragment,{children:['Avivator could not find an IFD index for the requested OME-TIFF, and therefore longer latencies are expected. Please read our documentation on "Indexed TIFF" to generate an IFD index for your OME-TIFF and improve initial load times.',b.jsx(sh,{target:"_blank",rel:"noopener noreferrer",href:"http://viv.gehlenborglab.org/#data-preparation",children:"in this section of our documentation"})," ","and then place the offsets.json adjacent to the OME-TIFF wherever hosted."]})}function xlA({message:e}){return b.jsxs(b.Fragment,{children:[e?`The following error was thrown: "${e}". `:"Something has gone wrong loading your image. ","Please refer to the"," ",b.jsx(sh,{target:"_blank",rel:"noopener noreferrer",href:"http://viv.gehlenborglab.org",children:"docs"})," ","for information about supported file formats."]})}function FlA(){return b.jsxs(b.Fragment,{children:['You are seeing a random demo image because no image URL was provided. To view your own images, enter a URL into the "OME-TIFF/Bioformats-Zarr URL" field. See the'," ",b.jsx(sh,{target:"_blank",rel:"noopener noreferrer",href:"http://viv.gehlenborglab.org",children:"docs"})," ","for details on how to prepare your images for viewing with Avivator."]})}function NlA(){return b.jsx(b.Fragment,{children:"Volume rendering is only available on browsers that support WebGL2. If you are using Safari, you can turn on WebGL2 by navigating in the top menubar to check Develop > Experimental Features > WebGL 2.0 and then refreshing the page."})}const _lA=()=>{const[e,A,t,n,i,r,o]=UA(s=>[s.isOffsetsSnackbarOn,s.loaderErrorSnackbar,s.isNoImageUrlSnackbarOn,s.toggleIsOffsetsSnackbarOn,s.toggleIsNoImageUrlSnackbarOn,s.isVolumeRenderingWarningOn,s.toggleIsVolumeRenderingWarningOn],Ve);return b.jsxs(b.Fragment,{children:[b.jsx(_C,{open:e,anchorOrigin:{vertical:"top",horizontal:"center"},elevation:6,variant:"filled",children:b.jsx(LC,{onClose:n,severity:"warning",children:b.jsx(RlA,{})})}),b.jsx(_C,{open:A.on,anchorOrigin:{vertical:"top",horizontal:"center"},elevation:6,variant:"filled",children:b.jsx(LC,{onClose:()=>UA.setState({loaderErrorSnackbar:{on:!1,message:null}}),severity:"error",children:b.jsx(xlA,{message:A.message})})}),b.jsx(_C,{open:t,anchorOrigin:{vertical:"top",horizontal:"center"},elevation:6,variant:"filled",children:b.jsx(LC,{onClose:i,severity:"info",children:b.jsx(FlA,{})})}),b.jsx(_C,{open:r,anchorOrigin:{vertical:"top",horizontal:"center"},elevation:6,variant:"filled",children:b.jsx(LC,{onClose:o,severity:"warning",children:b.jsx(NlA,{})})})]})},LlA=_lA;function blA(e){var A=typeof e;return e!=null&&(A=="object"||A=="function")}var QM=blA,GlA=typeof Lc=="object"&&Lc&&Lc.Object===Object&&Lc,klA=GlA,MlA=klA,TlA=typeof self=="object"&&self&&self.Object===Object&&self,UlA=MlA||TlA||Function("return this")(),dM=UlA,PlA=dM,HlA=function(){return PlA.Date.now()},qlA=HlA,JlA=/\s/;function OlA(e){for(var A=e.length;A--&&JlA.test(e.charAt(A)););return A}var YlA=OlA,KlA=YlA,VlA=/^\s+/;function WlA(e){return e&&e.slice(0,KlA(e)+1).replace(VlA,"")}var zlA=WlA,jlA=dM,XlA=jlA.Symbol,pM=XlA,BF=pM,yM=Object.prototype,ZlA=yM.hasOwnProperty,$lA=yM.toString,tI=BF?BF.toStringTag:void 0;function AcA(e){var A=ZlA.call(e,tI),t=e[tI];try{e[tI]=void 0;var n=!0}catch{}var i=$lA.call(e);return n&&(A?e[tI]=t:delete e[tI]),i}var ecA=AcA,tcA=Object.prototype,ncA=tcA.toString;function icA(e){return ncA.call(e)}var rcA=icA,EF=pM,ocA=ecA,scA=rcA,acA="[object Null]",gcA="[object Undefined]",hF=EF?EF.toStringTag:void 0;function IcA(e){return e==null?e===void 0?gcA:acA:hF&&hF in Object(e)?ocA(e):scA(e)}var lcA=IcA;function ccA(e){return e!=null&&typeof e=="object"}var CcA=ccA,ucA=lcA,BcA=CcA,EcA="[object Symbol]";function hcA(e){return typeof e=="symbol"||BcA(e)&&ucA(e)==EcA}var fcA=hcA,QcA=zlA,fF=QM,dcA=fcA,QF=0/0,pcA=/^[-+]0x[0-9a-f]+$/i,ycA=/^0b[01]+$/i,mcA=/^0o[0-7]+$/i,wcA=parseInt;function vcA(e){if(typeof e=="number")return e;if(dcA(e))return QF;if(fF(e)){var A=typeof e.valueOf=="function"?e.valueOf():e;e=fF(A)?A+"":A}if(typeof e!="string")return e===0?e:+e;e=QcA(e);var t=ycA.test(e);return t||mcA.test(e)?wcA(e.slice(2),t?2:8):pcA.test(e)?QF:+e}var ScA=vcA,DcA=QM,EQ=qlA,dF=ScA,RcA="Expected a function",xcA=Math.max,FcA=Math.min;function NcA(e,A,t){var n,i,r,o,s,a,g=0,I=!1,l=!1,c=!0;if(typeof e!="function")throw new TypeError(RcA);A=dF(A)||0,DcA(t)&&(I=!!t.leading,l="maxWait"in t,r=l?xcA(dF(t.maxWait)||0,A):r,c="trailing"in t?!!t.trailing:c);function C(m){var v=n,x=i;return n=i=void 0,g=m,o=e.apply(x,v),o}function u(m){return g=m,s=setTimeout(h,A),I?C(m):o}function E(m){var v=m-a,x=m-g,D=A-v;return l?FcA(D,r-x):D}function B(m){var v=m-a,x=m-g;return a===void 0||v>=A||v<0||l&&x>=r}function h(){var m=EQ();if(B(m))return f(m);s=setTimeout(h,E(m))}function f(m){return s=void 0,c&&n?C(m):(n=i=void 0,o)}function Q(){s!==void 0&&clearTimeout(s),g=0,n=a=i=s=void 0}function d(){return s===void 0?o:f(EQ())}function w(){var m=EQ(),v=B(m);if(n=arguments,i=this,a=m,v){if(s===void 0)return u(a);if(l)return clearTimeout(s),s=setTimeout(h,A),C(a)}return s===void 0&&(s=setTimeout(h,A)),o}return w.cancel=Q,w.flush=d,w}var _cA=NcA;const mM=Gn(_cA),LcA=()=>{const[e,A,t]=UA(v=>[v.useLinkedView,v.use3d,v.viewState],Ve),[n,i,r,o]=bn(v=>[v.colors,v.contrastLimits,v.channelsVisible,v.selections],Ve),s=Fi(),a=aw(),[g,I,l,c,C,u,E,B,h,f,Q,d,w]=ve(v=>[v.lensSelection,v.colormap,v.renderingMode,v.xSlice,v.ySlice,v.zSlice,v.resolution,v.lensEnabled,v.zoomLock,v.panLock,v.isOverviewOn,v.onViewportLoad,v.useFixedAxis],Ve),m=({viewState:{zoom:v}})=>{const x=Math.min(Math.max(Math.round(-v),0),s.length-1);UA.setState({pyramidResolution:x})};return A?b.jsx(CgA,{loader:s,contrastLimits:i,colors:n,channelsVisible:r,selections:o,colormap:I,xSlice:c,ySlice:C,zSlice:u,resolution:E,extensions:[SIA(I,l)],height:a.height,width:a.width,onViewportLoad:d,useFixedAxis:w,viewStates:[t],onViewStateChange:mM(({viewState:v,viewId:x})=>UA.setState({viewState:{...v,id:x}}),250,{trailing:!0})}):e?b.jsx(cgA,{loader:s,contrastLimits:i,colors:n,channelsVisible:r,selections:o,height:a.height,width:a.width,zoomLock:h,panLock:f,hoverHooks:{handleValue:v=>UA.setState({pixelValues:v})},lensSelection:g,lensEnabled:B,onViewportLoad:d,extensions:[I?new kB:new MB],colormap:I||"viridis",snapScaleBar:!0}):b.jsx(lgA,{loader:s,contrastLimits:i,colors:n,channelsVisible:r,selections:o,height:a.height,width:a.width,overview:oIA,overviewOn:Q,hoverHooks:{handleValue:v=>UA.setState({pixelValues:v})},lensSelection:g,lensEnabled:B,onViewportLoad:d,extensions:[I?new kB:new MB],colormap:I||"viridis",onViewStateChange:m,snapScaleBar:!0})},bcA=LcA;var pr=44,GcA=function(A){return{root:{display:"inline-block"},static:{transition:A.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},determinate:{transition:A.transitions.create("transform")},colorPrimary:{color:A.palette.primary.main},colorSecondary:{color:A.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:A.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},circleDeterminate:{transition:A.transitions.create("stroke-dashoffset")},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}},kcA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.color,o=r===void 0?"primary":r,s=A.disableShrink,a=s===void 0?!1:s,g=A.size,I=g===void 0?40:g,l=A.style,c=A.thickness,C=c===void 0?3.6:c,u=A.value,E=u===void 0?0:u,B=A.variant,h=B===void 0?"indeterminate":B,f=xA(A,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),Q={},d={},w={};if(h==="determinate"||h==="static"){var m=2*Math.PI*((pr-C)/2);Q.strokeDasharray=m.toFixed(3),w["aria-valuenow"]=Math.round(E),Q.strokeDashoffset="".concat(((100-E)/100*m).toFixed(3),"px"),d.transform="rotate(-90deg)"}return p.createElement("div",k({className:vA(n.root,i,o!=="inherit"&&n["color".concat(De(o))],{determinate:n.determinate,indeterminate:n.indeterminate,static:n.static}[h]),style:k({width:I,height:I},d,l),ref:t,role:"progressbar"},w,f),p.createElement("svg",{className:n.svg,viewBox:"".concat(pr/2," ").concat(pr/2," ").concat(pr," ").concat(pr)},p.createElement("circle",{className:vA(n.circle,a&&n.circleDisableShrink,{determinate:n.circleDeterminate,indeterminate:n.circleIndeterminate,static:n.circleStatic}[h]),style:Q,cx:pr,cy:pr,r:(pr-C)/2,fill:"none",strokeWidth:C})))});const wM=se(GcA,{name:"MuiCircularProgress",flip:!1})(kcA);var McA=[0,1,2,3,4,5,6,7,8,9,10],TcA=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function UcA(e,A,t){var n={};TcA.forEach(function(i){var r="grid-".concat(t,"-").concat(i);if(i===!0){n[r]={flexBasis:0,flexGrow:1,maxWidth:"100%"};return}if(i==="auto"){n[r]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};return}var o="".concat(Math.round(i/12*1e8)/1e6,"%");n[r]={flexBasis:o,flexGrow:0,maxWidth:o}}),t==="xs"?k(e,n):e[A.breakpoints.up(t)]=n}function hQ(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=parseFloat(e);return"".concat(t/A).concat(String(e).replace(String(t),"")||"px")}function PcA(e,A){var t={};return McA.forEach(function(n){var i=e.spacing(n);i!==0&&(t["spacing-".concat(A,"-").concat(n)]={margin:"-".concat(hQ(i,2)),width:"calc(100% + ".concat(hQ(i),")"),"& > $item":{padding:hQ(i,2)}})}),t}var HcA=function(A){return k({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-content-xs-center":{justifyContent:"center"},"justify-content-xs-flex-end":{justifyContent:"flex-end"},"justify-content-xs-space-between":{justifyContent:"space-between"},"justify-content-xs-space-around":{justifyContent:"space-around"},"justify-content-xs-space-evenly":{justifyContent:"space-evenly"}},PcA(A,"xs"),A.breakpoints.keys.reduce(function(t,n){return UcA(t,A,n),t},{}))},qcA=p.forwardRef(function(A,t){var n=A.alignContent,i=n===void 0?"stretch":n,r=A.alignItems,o=r===void 0?"stretch":r,s=A.classes,a=A.className,g=A.component,I=g===void 0?"div":g,l=A.container,c=l===void 0?!1:l,C=A.direction,u=C===void 0?"row":C,E=A.item,B=E===void 0?!1:E,h=A.justify,f=A.justifyContent,Q=f===void 0?"flex-start":f,d=A.lg,w=d===void 0?!1:d,m=A.md,v=m===void 0?!1:m,x=A.sm,D=x===void 0?!1:x,F=A.spacing,N=F===void 0?0:F,M=A.wrap,P=M===void 0?"wrap":M,H=A.xl,W=H===void 0?!1:H,J=A.xs,Z=J===void 0?!1:J,z=A.zeroMinWidth,O=z===void 0?!1:z,Y=xA(A,["alignContent","alignItems","classes","className","component","container","direction","item","justify","justifyContent","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),T=vA(s.root,a,c&&[s.container,N!==0&&s["spacing-xs-".concat(String(N))]],B&&s.item,O&&s.zeroMinWidth,u!=="row"&&s["direction-xs-".concat(String(u))],P!=="wrap"&&s["wrap-xs-".concat(String(P))],o!=="stretch"&&s["align-items-xs-".concat(String(o))],i!=="stretch"&&s["align-content-xs-".concat(String(i))],(h||Q)!=="flex-start"&&s["justify-content-xs-".concat(String(h||Q))],Z!==!1&&s["grid-xs-".concat(String(Z))],D!==!1&&s["grid-sm-".concat(String(D))],v!==!1&&s["grid-md-".concat(String(v))],w!==!1&&s["grid-lg-".concat(String(w))],W!==!1&&s["grid-xl-".concat(String(W))]);return p.createElement(I,k({className:T,ref:t},Y))}),JcA=se(HcA,{name:"MuiGrid"})(qcA);const re=JcA;var Vs;function vM(){if(Vs)return Vs;var e=document.createElement("div"),A=document.createElement("div");return A.style.width="10px",A.style.height="1px",e.appendChild(A),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),Vs="reverse",e.scrollLeft>0?Vs="default":(e.scrollLeft=1,e.scrollLeft===0&&(Vs="negative")),document.body.removeChild(e),Vs}function pF(e,A){var t=e.scrollLeft;if(A!=="rtl")return t;var n=vM();switch(n){case"negative":return e.scrollWidth-e.clientWidth+t;case"reverse":return e.scrollWidth-e.clientWidth-t;default:return t}}function OcA(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function YcA(e,A,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){},r=n.ease,o=r===void 0?OcA:r,s=n.duration,a=s===void 0?300:s,g=null,I=A[e],l=!1,c=function(){l=!0},C=function u(E){if(l){i(new Error("Animation cancelled"));return}g===null&&(g=E);var B=Math.min(1,(E-g)/a);if(A[e]=o(B)*(t-I)+I,B>=1){requestAnimationFrame(function(){i(null)});return}requestAnimationFrame(u)};return I===t?(i(new Error("Element already at target position")),c):(requestAnimationFrame(C),c)}var KcA={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function VcA(e){var A=e.onChange,t=xA(e,["onChange"]),n=p.useRef(),i=p.useRef(null),r=function(){n.current=i.current.offsetHeight-i.current.clientHeight};return p.useEffect(function(){var o=Va(function(){var s=n.current;r(),s!==n.current&&A(n.current)});return window.addEventListener("resize",o),function(){o.clear(),window.removeEventListener("resize",o)}},[A]),p.useEffect(function(){r(),A(n.current)},[A]),p.createElement("div",k({style:KcA,ref:i},t))}var WcA=function(A){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:A.transitions.create()},colorPrimary:{backgroundColor:A.palette.primary.main},colorSecondary:{backgroundColor:A.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}},zcA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.color,o=A.orientation,s=xA(A,["classes","className","color","orientation"]);return p.createElement("span",k({className:vA(n.root,n["color".concat(De(r))],i,o==="vertical"&&n.vertical),ref:t},s))});const jcA=se(WcA,{name:"PrivateTabIndicator"})(zcA),XcA=Mn(p.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),ZcA=Mn(p.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));var $cA={root:{width:40,flexShrink:0,opacity:.8,"&$disabled":{opacity:0}},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}},disabled:{}},ACA=p.createElement(XcA,{fontSize:"small"}),eCA=p.createElement(ZcA,{fontSize:"small"}),tCA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.direction,o=A.orientation,s=A.disabled,a=xA(A,["classes","className","direction","orientation","disabled"]);return p.createElement(Sc,k({component:"div",className:vA(n.root,i,s&&n.disabled,o==="vertical"&&n.vertical),ref:t,role:null,tabIndex:null},a),r==="left"?ACA:eCA)});const nCA=se($cA,{name:"MuiTabScrollButton"})(tCA);var iCA=function(A){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:y({},A.breakpoints.down("xs"),{display:"none"}),indicator:{}}},rCA=p.forwardRef(function(A,t){var n=A["aria-label"],i=A["aria-labelledby"],r=A.action,o=A.centered,s=o===void 0?!1:o,a=A.children,g=A.classes,I=A.className,l=A.component,c=l===void 0?"div":l,C=A.indicatorColor,u=C===void 0?"secondary":C,E=A.onChange,B=A.orientation,h=B===void 0?"horizontal":B,f=A.ScrollButtonComponent,Q=f===void 0?nCA:f,d=A.scrollButtons,w=d===void 0?"auto":d,m=A.selectionFollowsFocus,v=A.TabIndicatorProps,x=v===void 0?{}:v,D=A.TabScrollButtonProps,F=A.textColor,N=F===void 0?"inherit":F,M=A.value,P=A.variant,H=P===void 0?"standard":P,W=xA(A,["aria-label","aria-labelledby","action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant"]),J=tc(),Z=H==="scrollable",z=J.direction==="rtl",O=h==="vertical",Y=O?"scrollTop":"scrollLeft",T=O?"top":"left",q=O?"bottom":"right",j=O?"clientHeight":"clientWidth",AA=O?"height":"width",nA=p.useState(!1),IA=nA[0],aA=nA[1],BA=p.useState({}),lA=BA[0],MA=BA[1],EA=p.useState({start:!1,end:!1}),pA=EA[0],qA=EA[1],NA=p.useState({overflow:"hidden",marginBottom:null}),JA=NA[0],dA=NA[1],GA=new Map,ie=p.useRef(null),Ie=p.useRef(null),he=function(){var rA=ie.current,TA;if(rA){var Le=rA.getBoundingClientRect();TA={clientWidth:rA.clientWidth,scrollLeft:rA.scrollLeft,scrollTop:rA.scrollTop,scrollLeftNormalized:pF(rA,J.direction),scrollWidth:rA.scrollWidth,top:Le.top,bottom:Le.bottom,left:Le.left,right:Le.right}}var xe;if(rA&&M!==!1){var Te=Ie.current.children;if(Te.length>0){var Ue=Te[GA.get(M)];xe=Ue?Ue.getBoundingClientRect():null}}return{tabsMeta:TA,tabMeta:xe}},XA=Ze(function(){var OA,rA=he(),TA=rA.tabsMeta,Le=rA.tabMeta,xe=0;if(Le&&TA)if(O)xe=Le.top-TA.top+TA.scrollTop;else{var Te=z?TA.scrollLeftNormalized+TA.clientWidth-TA.scrollWidth:TA.scrollLeft;xe=Le.left-TA.left+Te}var Ue=(OA={},y(OA,T,xe),y(OA,AA,Le?Le[AA]:0),OA);if(isNaN(lA[T])||isNaN(lA[AA]))MA(Ue);else{var ot=Math.abs(lA[T]-Ue[T]),lt=Math.abs(lA[AA]-Ue[AA]);(ot>=1||lt>=1)&&MA(Ue)}}),eA=function(rA){YcA(Y,ie.current,rA)},gA=function(rA){var TA=ie.current[Y];O?TA+=rA:(TA+=rA*(z?-1:1),TA*=z&&vM()==="reverse"?-1:1),eA(TA)},LA=function(){gA(-ie.current[j])},le=function(){gA(ie.current[j])},ZA=p.useCallback(function(OA){dA({overflow:null,marginBottom:-OA})},[]),Je=function(){var rA={};rA.scrollbarSizeListener=Z?p.createElement(VcA,{className:g.scrollable,onChange:ZA}):null;var TA=pA.start||pA.end,Le=Z&&(w==="auto"&&TA||w==="desktop"||w==="on");return rA.scrollButtonStart=Le?p.createElement(Q,k({orientation:h,direction:z?"right":"left",onClick:LA,disabled:!pA.start,className:vA(g.scrollButtons,w!=="on"&&g.scrollButtonsDesktop)},D)):null,rA.scrollButtonEnd=Le?p.createElement(Q,k({orientation:h,direction:z?"left":"right",onClick:le,disabled:!pA.end,className:vA(g.scrollButtons,w!=="on"&&g.scrollButtonsDesktop)},D)):null,rA},$A=Ze(function(){var OA=he(),rA=OA.tabsMeta,TA=OA.tabMeta;if(!(!TA||!rA)){if(TA[T]rA[q]){var xe=rA[Y]+(TA[q]-rA[q]);eA(xe)}}}),VA=Ze(function(){if(Z&&w!=="off"){var OA=ie.current,rA=OA.scrollTop,TA=OA.scrollHeight,Le=OA.clientHeight,xe=OA.scrollWidth,Te=OA.clientWidth,Ue,ot;if(O)Ue=rA>1,ot=rA1,ot=z?lt>1:lt *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:A.palette.text.secondary,"&$selected":{color:A.palette.primary.main},"&$disabled":{color:A.palette.text.disabled}},textColorSecondary:{color:A.palette.text.secondary,"&$selected":{color:A.palette.secondary.main},"&$disabled":{color:A.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:A.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}},aCA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.disabled,o=r===void 0?!1:r,s=A.disableFocusRipple,a=s===void 0?!1:s,g=A.fullWidth,I=A.icon,l=A.indicator,c=A.label,C=A.onChange,u=A.onClick,E=A.onFocus,B=A.selected,h=A.selectionFollowsFocus,f=A.textColor,Q=f===void 0?"inherit":f,d=A.value,w=A.wrapped,m=w===void 0?!1:w,v=xA(A,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"]),x=function(N){C&&C(N,d),u&&u(N)},D=function(N){h&&!B&&C&&C(N,d),E&&E(N)};return p.createElement(Sc,k({focusRipple:!a,className:vA(n.root,n["textColor".concat(De(Q))],i,o&&n.disabled,B&&n.selected,c&&I&&n.labelIcon,g&&n.fullWidth,m&&n.wrapped),ref:t,role:"tab","aria-selected":B,disabled:o,onClick:x,onFocus:D,tabIndex:B?0:-1},v),p.createElement("span",{className:n.wrapper},I,c),l)});const yF=se(sCA,{name:"MuiTab"})(aCA);var gCA=function(A){return{root:{height:1,margin:0,border:"none",flexShrink:0,backgroundColor:A.palette.divider},absolute:{position:"absolute",bottom:0,left:0,width:"100%"},inset:{marginLeft:72},light:{backgroundColor:mt(A.palette.divider,.08)},middle:{marginLeft:A.spacing(2),marginRight:A.spacing(2)},vertical:{height:"100%",width:1},flexItem:{alignSelf:"stretch",height:"auto"}}},ICA=p.forwardRef(function(A,t){var n=A.absolute,i=n===void 0?!1:n,r=A.classes,o=A.className,s=A.component,a=s===void 0?"hr":s,g=A.flexItem,I=g===void 0?!1:g,l=A.light,c=l===void 0?!1:l,C=A.orientation,u=C===void 0?"horizontal":C,E=A.role,B=E===void 0?a!=="hr"?"separator":void 0:E,h=A.variant,f=h===void 0?"fullWidth":h,Q=xA(A,["absolute","classes","className","component","flexItem","light","orientation","role","variant"]);return p.createElement(a,k({className:vA(r.root,o,f!=="fullWidth"&&r[f],i&&r.absolute,I&&r.flexItem,c&&r.light,u==="vertical"&&r.vertical),role:B,ref:t},Q))});const Z0=se(gCA,{name:"MuiDivider"})(ICA);var SM=p.createContext();function lCA(){return p.useContext(SM)}const uw=SM;function vg(){return p.useContext(uw)}var cCA={root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},CCA=p.forwardRef(function(A,t){var n=A.autoFocus,i=A.checked,r=A.checkedIcon,o=A.classes,s=A.className,a=A.defaultChecked,g=A.disabled,I=A.icon,l=A.id,c=A.inputProps,C=A.inputRef,u=A.name,E=A.onBlur,B=A.onChange,h=A.onFocus,f=A.readOnly,Q=A.required,d=A.tabIndex,w=A.type,m=A.value,v=xA(A,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),x=ih({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),D=Ac(x,2),F=D[0],N=D[1],M=vg(),P=function(O){h&&h(O),M&&M.onFocus&&M.onFocus(O)},H=function(O){E&&E(O),M&&M.onBlur&&M.onBlur(O)},W=function(O){var Y=O.target.checked;N(Y),B&&B(O,Y)},J=g;M&&typeof J>"u"&&(J=M.disabled);var Z=w==="checkbox"||w==="radio";return p.createElement(Bs,k({component:"span",className:vA(o.root,s,F&&o.checked,J&&o.disabled),disabled:J,tabIndex:null,role:void 0,onFocus:P,onBlur:H,ref:t},v),p.createElement("input",k({autoFocus:n,checked:i,defaultChecked:a,className:o.input,disabled:J,id:Z&&l,name:u,onChange:W,readOnly:f,ref:C,required:Q,tabIndex:d,type:w,value:m},c)),F?r:I)});const uCA=se(cCA,{name:"PrivateSwitchBase"})(CCA),BCA=Mn(p.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),ECA=Mn(p.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),hCA=Mn(p.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));var fCA=function(A){return{root:{color:A.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:A.palette.primary.main,"&:hover":{backgroundColor:mt(A.palette.primary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:A.palette.action.disabled}},colorSecondary:{"&$checked":{color:A.palette.secondary.main,"&:hover":{backgroundColor:mt(A.palette.secondary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:A.palette.action.disabled}}}},QCA=p.createElement(ECA,null),dCA=p.createElement(BCA,null),pCA=p.createElement(hCA,null),yCA=p.forwardRef(function(A,t){var n=A.checkedIcon,i=n===void 0?QCA:n,r=A.classes,o=A.color,s=o===void 0?"secondary":o,a=A.icon,g=a===void 0?dCA:a,I=A.indeterminate,l=I===void 0?!1:I,c=A.indeterminateIcon,C=c===void 0?pCA:c,u=A.inputProps,E=A.size,B=E===void 0?"medium":E,h=xA(A,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),f=l?C:g,Q=l?C:i;return p.createElement(uCA,k({type:"checkbox",classes:{root:vA(r.root,r["color".concat(De(s))],l&&r.indeterminate),checked:r.checked,disabled:r.disabled},color:s,inputProps:k({"data-indeterminate":l},u),icon:p.cloneElement(f,{fontSize:f.props.fontSize===void 0&&B==="small"?B:f.props.fontSize}),checkedIcon:p.cloneElement(Q,{fontSize:Q.props.fontSize===void 0&&B==="small"?B:Q.props.fontSize}),ref:t},h))});const Bw=se(fCA,{name:"MuiCheckbox"})(yCA);var mCA=function(A){return{thumb:{"&$open":{"& $offset":{transform:"scale(1) translateY(-10px)"}}},open:{},offset:k({zIndex:1},A.typography.body2,{fontSize:A.typography.pxToRem(12),lineHeight:1.2,transition:A.transitions.create(["transform"],{duration:A.transitions.duration.shortest}),top:-34,transformOrigin:"bottom center",transform:"scale(0)",position:"absolute"}),circle:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"currentColor",transform:"rotate(-45deg)"},label:{color:A.palette.primary.contrastText,transform:"rotate(45deg)"}}};function wCA(e){var A=e.children,t=e.classes,n=e.className,i=e.open,r=e.value,o=e.valueLabelDisplay;return o==="off"?A:p.cloneElement(A,{className:vA(A.props.className,(i||o==="on")&&t.open,t.thumb)},p.createElement("span",{className:vA(t.offset,n)},p.createElement("span",{className:t.circle},p.createElement("span",{className:t.label},r))))}const vCA=se(mCA,{name:"PrivateValueLabel"})(wCA);function fQ(e,A){return e-A}function QQ(e,A,t){return Math.min(Math.max(A,e),t)}function mF(e,A){var t=e.reduce(function(i,r,o){var s=Math.abs(A-r);return i===null||s0&&gA.some(function(DA){return DA.label})&&o.marked,Y===!1&&o.trackFalse,M==="vertical"&&o.vertical,Y==="inverted"&&o.trackInverted),onMouseDown:Ns},BA),p.createElement("span",{className:o.rail}),p.createElement("span",{className:o.track,style:_s}),p.createElement("input",{value:eA.join(","),name:v,type:"hidden"}),gA.map(function(DA,kA){var be=GC(DA.value,m,d),Fe=MC[Te].offset(be),ae;return Y===!1?ae=eA.indexOf(DA.value)!==-1:ae=Y==="normal"&&(XA?DA.value>=eA[0]&&DA.value<=eA[eA.length-1]:DA.value<=eA[0])||Y==="inverted"&&(XA?DA.value<=eA[0]||DA.value>=eA[eA.length-1]:DA.value>=eA[0]),p.createElement(p.Fragment,{key:DA.value},p.createElement("span",{style:Fe,"data-index":kA,className:vA(o.mark,ae&&o.markActive)}),DA.label!=null?p.createElement("span",{"aria-hidden":!0,"data-index":kA,style:Fe,className:vA(o.markLabel,ae&&o.markLabelActive)},DA.label):null)}),eA.map(function(DA,kA){var be=GC(DA,m,d),Fe=MC[Te].offset(be);return p.createElement(j,{key:kA,valueLabelFormat:aA,valueLabelDisplay:nA,className:o.valueLabel,value:typeof aA=="function"?aA(H(DA),kA):aA,index:kA,open:JA===kA||pA===kA||nA==="on",disabled:u},p.createElement(z,{className:vA(o.thumb,o["thumbColor".concat(De(g))],pA===kA&&o.active,u&&o.disabled,VA===kA&&o.focusVisible),tabIndex:u?null:0,role:"slider",style:Fe,"data-index":kA,"aria-label":E?E(kA):n,"aria-labelledby":i,"aria-orientation":M,"aria-valuemax":H(d),"aria-valuemin":H(m),"aria-valuenow":H(DA),"aria-valuetext":B?B(H(DA),kA):r,onKeyDown:Le,onFocus:pe,onBlur:we,onMouseOver:OA,onMouseLeave:rA}))}))});const Ew=se(RCA,{name:"MuiSlider"})(xCA);function FCA(e){return e=typeof e=="function"?e():e,Vt.findDOMNode(e)}var dQ=typeof window<"u"?p.useLayoutEffect:p.useEffect,NCA=p.forwardRef(function(A,t){var n=A.children,i=A.container,r=A.disablePortal,o=r===void 0?!1:r,s=A.onRendered,a=p.useState(null),g=a[0],I=a[1],l=it(p.isValidElement(n)?n.ref:null,t);return dQ(function(){o||I(FCA(i)||document.body)},[i,o]),dQ(function(){if(g&&!o)return us(t,g),function(){us(t,null)}},[t,g,o]),dQ(function(){s&&(g||o)&&s()},[s,g,o]),o?p.isValidElement(n)?p.cloneElement(n,{ref:l}):n:g&&Vt.createPortal(n,g)});const DM=NCA;function RM(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var A=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),A}function _CA(e){var A=Rt(e);return A.body===e?nh(A).innerWidth>A.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function zI(e,A){A?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function DF(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function RF(e,A,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0,r=[A,t].concat(Zl(n)),o=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,function(s){s.nodeType===1&&r.indexOf(s)===-1&&o.indexOf(s.tagName)===-1&&zI(s,i)})}function pQ(e,A){var t=-1;return e.some(function(n,i){return A(n)?(t=i,!0):!1}),t}function LCA(e,A){var t=[],n=[],i=e.container,r;if(!A.disableScrollLock){if(_CA(i)){var o=RM();t.push({value:i.style.paddingRight,key:"padding-right",el:i}),i.style["padding-right"]="".concat(DF(i)+o,"px"),r=Rt(i).querySelectorAll(".mui-fixed"),[].forEach.call(r,function(I){n.push(I.style.paddingRight),I.style.paddingRight="".concat(DF(I)+o,"px")})}var s=i.parentElement,a=s.nodeName==="HTML"&&window.getComputedStyle(s)["overflow-y"]==="scroll"?s:i;t.push({value:a.style.overflow,key:"overflow",el:a}),a.style.overflow="hidden"}var g=function(){r&&[].forEach.call(r,function(l,c){n[c]?l.style.paddingRight=n[c]:l.style.removeProperty("padding-right")}),t.forEach(function(l){var c=l.value,C=l.el,u=l.key;c?C.style.setProperty(u,c):C.style.removeProperty(u)})};return g}function bCA(e){var A=[];return[].forEach.call(e.children,function(t){t.getAttribute&&t.getAttribute("aria-hidden")==="true"&&A.push(t)}),A}var GCA=function(){function e(){nJ(this,e),this.modals=[],this.containers=[]}return uy(e,[{key:"add",value:function(t,n){var i=this.modals.indexOf(t);if(i!==-1)return i;i=this.modals.length,this.modals.push(t),t.modalRef&&zI(t.modalRef,!1);var r=bCA(n);RF(n,t.mountNode,t.modalRef,r,!0);var o=pQ(this.containers,function(s){return s.container===n});return o!==-1?(this.containers[o].modals.push(t),i):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblingNodes:r}),i)}},{key:"mount",value:function(t,n){var i=pQ(this.containers,function(o){return o.modals.indexOf(t)!==-1}),r=this.containers[i];r.restore||(r.restore=LCA(r,n))}},{key:"remove",value:function(t){var n=this.modals.indexOf(t);if(n===-1)return n;var i=pQ(this.containers,function(s){return s.modals.indexOf(t)!==-1}),r=this.containers[i];if(r.modals.splice(r.modals.indexOf(t),1),this.modals.splice(n,1),r.modals.length===0)r.restore&&r.restore(),t.modalRef&&zI(t.modalRef,!0),RF(r.container,t.mountNode,t.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(i,1);else{var o=r.modals[r.modals.length-1];o.modalRef&&zI(o.modalRef,!1)}return n}},{key:"isTopModal",value:function(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}]),e}();function kCA(e){var A=e.children,t=e.disableAutoFocus,n=t===void 0?!1:t,i=e.disableEnforceFocus,r=i===void 0?!1:i,o=e.disableRestoreFocus,s=o===void 0?!1:o,a=e.getDoc,g=e.isEnabled,I=e.open,l=p.useRef(),c=p.useRef(null),C=p.useRef(null),u=p.useRef(),E=p.useRef(null),B=p.useCallback(function(Q){E.current=Vt.findDOMNode(Q)},[]),h=it(A.ref,B),f=p.useRef();return p.useEffect(function(){f.current=I},[I]),!f.current&&I&&typeof window<"u"&&(u.current=a().activeElement),p.useEffect(function(){if(I){var Q=Rt(E.current);!n&&E.current&&!E.current.contains(Q.activeElement)&&(E.current.hasAttribute("tabIndex")||E.current.setAttribute("tabIndex",-1),E.current.focus());var d=function(){var x=E.current;if(x!==null){if(!Q.hasFocus()||r||!g()||l.current){l.current=!1;return}E.current&&!E.current.contains(Q.activeElement)&&E.current.focus()}},w=function(x){r||!g()||x.keyCode!==9||Q.activeElement===E.current&&(l.current=!0,x.shiftKey?C.current.focus():c.current.focus())};Q.addEventListener("focus",d,!0),Q.addEventListener("keydown",w,!0);var m=setInterval(function(){d()},50);return function(){clearInterval(m),Q.removeEventListener("focus",d,!0),Q.removeEventListener("keydown",w,!0),s||(u.current&&u.current.focus&&u.current.focus(),u.current=null)}}},[n,r,s,g,I]),p.createElement(p.Fragment,null,p.createElement("div",{tabIndex:0,ref:c,"data-test":"sentinelStart"}),p.cloneElement(A,{ref:h}),p.createElement("div",{tabIndex:0,ref:C,"data-test":"sentinelEnd"}))}var xF={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},MCA=p.forwardRef(function(A,t){var n=A.invisible,i=n===void 0?!1:n,r=A.open,o=xA(A,["invisible","open"]);return r?p.createElement("div",k({"aria-hidden":!0,ref:t},o,{style:k({},xF.root,i?xF.invisible:{},o.style)})):null});const TCA=MCA;function UCA(e){return e=typeof e=="function"?e():e,Vt.findDOMNode(e)}function PCA(e){return e.children?e.children.props.hasOwnProperty("in"):!1}var HCA=new GCA,qCA=function(A){return{root:{position:"fixed",zIndex:A.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}},JCA=p.forwardRef(function(A,t){var n=og(),i=y_({name:"MuiModal",props:k({},A),theme:n}),r=i.BackdropComponent,o=r===void 0?TCA:r,s=i.BackdropProps,a=i.children,g=i.closeAfterTransition,I=g===void 0?!1:g,l=i.container,c=i.disableAutoFocus,C=c===void 0?!1:c,u=i.disableBackdropClick,E=u===void 0?!1:u,B=i.disableEnforceFocus,h=B===void 0?!1:B,f=i.disableEscapeKeyDown,Q=f===void 0?!1:f,d=i.disablePortal,w=d===void 0?!1:d,m=i.disableRestoreFocus,v=m===void 0?!1:m,x=i.disableScrollLock,D=x===void 0?!1:x,F=i.hideBackdrop,N=F===void 0?!1:F,M=i.keepMounted,P=M===void 0?!1:M,H=i.manager,W=H===void 0?HCA:H,J=i.onBackdropClick,Z=i.onClose,z=i.onEscapeKeyDown,O=i.onRendered,Y=i.open,T=xA(i,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),q=p.useState(!0),j=q[0],AA=q[1],nA=p.useRef({}),IA=p.useRef(null),aA=p.useRef(null),BA=it(aA,t),lA=PCA(i),MA=function(){return Rt(IA.current)},EA=function(){return nA.current.modalRef=aA.current,nA.current.mountNode=IA.current,nA.current},pA=function(){W.mount(EA(),{disableScrollLock:D}),aA.current.scrollTop=0},qA=Ze(function(){var gA=UCA(l)||MA().body;W.add(EA(),gA),aA.current&&pA()}),NA=p.useCallback(function(){return W.isTopModal(EA())},[W]),JA=Ze(function(gA){IA.current=gA,gA&&(O&&O(),Y&&NA()?pA():zI(aA.current,!0))}),dA=p.useCallback(function(){W.remove(EA())},[W]);if(p.useEffect(function(){return function(){dA()}},[dA]),p.useEffect(function(){Y?qA():(!lA||!I)&&dA()},[Y,dA,lA,I,qA]),!P&&!Y&&(!lA||j))return null;var GA=function(){AA(!1)},ie=function(){AA(!0),I&&dA()},Ie=function(LA){LA.target===LA.currentTarget&&(J&&J(LA),!E&&Z&&Z(LA,"backdropClick"))},he=function(LA){LA.key!=="Escape"||!NA()||(z&&z(LA),Q||(LA.stopPropagation(),Z&&Z(LA,"escapeKeyDown")))},XA=qCA(n||{zIndex:Q_}),eA={};return a.props.tabIndex===void 0&&(eA.tabIndex=a.props.tabIndex||"-1"),lA&&(eA.onEnter=go(GA,a.props.onEnter),eA.onExited=go(ie,a.props.onExited)),p.createElement(DM,{ref:JA,container:l,disablePortal:w},p.createElement("div",k({ref:BA,onKeyDown:he,role:"presentation"},T,{style:k({},XA.root,!Y&&j?XA.hidden:{},T.style)}),N?null:p.createElement(o,k({open:Y,onClick:Ie},s)),p.createElement(kCA,{disableEnforceFocus:h,disableAutoFocus:C,disableRestoreFocus:v,getDoc:MA,isEnabled:NA,open:Y},p.cloneElement(a,eA))))});const OCA=JCA;function FF(e,A){var t=0;return typeof A=="number"?t=A:A==="center"?t=e.height/2:A==="bottom"&&(t=e.height),t}function NF(e,A){var t=0;return typeof A=="number"?t=A:A==="center"?t=e.width/2:A==="right"&&(t=e.width),t}function _F(e){return[e.horizontal,e.vertical].map(function(A){return typeof A=="number"?"".concat(A,"px"):A}).join(" ")}function YCA(e,A){for(var t=A,n=0;t&&t!==e;)t=t.parentElement,n+=t.scrollTop;return n}function yQ(e){return typeof e=="function"?e():e}var KCA={root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},VCA=p.forwardRef(function(A,t){var n=A.action,i=A.anchorEl,r=A.anchorOrigin,o=r===void 0?{vertical:"top",horizontal:"left"}:r,s=A.anchorPosition,a=A.anchorReference,g=a===void 0?"anchorEl":a,I=A.children,l=A.classes,c=A.className,C=A.container,u=A.elevation,E=u===void 0?8:u,B=A.getContentAnchorEl,h=A.marginThreshold,f=h===void 0?16:h,Q=A.onEnter,d=A.onEntered,w=A.onEntering,m=A.onExit,v=A.onExited,x=A.onExiting,D=A.open,F=A.PaperProps,N=F===void 0?{}:F,M=A.transformOrigin,P=M===void 0?{vertical:"top",horizontal:"left"}:M,H=A.TransitionComponent,W=H===void 0?hM:H,J=A.transitionDuration,Z=J===void 0?"auto":J,z=A.TransitionProps,O=z===void 0?{}:z,Y=xA(A,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),T=p.useRef(),q=p.useCallback(function(EA){if(g==="anchorPosition")return s;var pA=yQ(i),qA=pA&&pA.nodeType===1?pA:Rt(T.current).body,NA=qA.getBoundingClientRect(),JA=EA===0?o.vertical:"center";return{top:NA.top+FF(NA,JA),left:NA.left+NF(NA,o.horizontal)}},[i,o.horizontal,o.vertical,s,g]),j=p.useCallback(function(EA){var pA=0;if(B&&g==="anchorEl"){var qA=B(EA);if(qA&&EA.contains(qA)){var NA=YCA(EA,qA);pA=qA.offsetTop+qA.clientHeight/2-NA||0}}return pA},[o.vertical,g,B]),AA=p.useCallback(function(EA){var pA=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return{vertical:FF(EA,P.vertical)+pA,horizontal:NF(EA,P.horizontal)}},[P.horizontal,P.vertical]),nA=p.useCallback(function(EA){var pA=j(EA),qA={width:EA.offsetWidth,height:EA.offsetHeight},NA=AA(qA,pA);if(g==="none")return{top:null,left:null,transformOrigin:_F(NA)};var JA=q(pA),dA=JA.top-NA.vertical,GA=JA.left-NA.horizontal,ie=dA+qA.height,Ie=GA+qA.width,he=nh(yQ(i)),XA=he.innerHeight-f,eA=he.innerWidth-f;if(dAXA){var LA=ie-XA;dA-=LA,NA.vertical+=LA}if(GAeA){var ZA=Ie-eA;GA-=ZA,NA.horizontal+=ZA}return{top:"".concat(Math.round(dA),"px"),left:"".concat(Math.round(GA),"px"),transformOrigin:_F(NA)}},[i,g,q,j,AA,f]),IA=p.useCallback(function(){var EA=T.current;if(EA){var pA=nA(EA);pA.top!==null&&(EA.style.top=pA.top),pA.left!==null&&(EA.style.left=pA.left),EA.style.transformOrigin=pA.transformOrigin}},[nA]),aA=function(pA,qA){w&&w(pA,qA),IA()},BA=p.useCallback(function(EA){T.current=Vt.findDOMNode(EA)},[]);p.useEffect(function(){D&&IA()}),p.useImperativeHandle(n,function(){return D?{updatePosition:function(){IA()}}:null},[D,IA]),p.useEffect(function(){if(D){var EA=Va(function(){IA()});return window.addEventListener("resize",EA),function(){EA.clear(),window.removeEventListener("resize",EA)}}},[D,IA]);var lA=Z;Z==="auto"&&!W.muiSupportAuto&&(lA=void 0);var MA=C||(i?Rt(yQ(i)).body:void 0);return p.createElement(OCA,k({container:MA,open:D,ref:t,BackdropProps:{invisible:!0},className:vA(l.root,c)},Y),p.createElement(W,k({appear:!0,in:D,onEnter:Q,onEntered:d,onExit:m,onExited:v,onExiting:x,timeout:lA},O,{onEntering:go(aA,O.onEntering)}),p.createElement(fo,k({elevation:E,ref:BA},N,{className:vA(l.paper,N.className)}),I)))});const WCA=se(KCA,{name:"MuiPopover"})(VCA);var zCA=p.createContext({});const Qu=zCA;var jCA={root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},XCA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className,o=A.component,s=o===void 0?"ul":o,a=A.dense,g=a===void 0?!1:a,I=A.disablePadding,l=I===void 0?!1:I,c=A.subheader,C=xA(A,["children","classes","className","component","dense","disablePadding","subheader"]),u=p.useMemo(function(){return{dense:g}},[g]);return p.createElement(Qu.Provider,{value:u},p.createElement(s,k({className:vA(i.root,r,g&&i.dense,!l&&i.padding,c&&i.subheader),ref:t},C),c,n))});const ZCA=se(jCA,{name:"MuiList"})(XCA);function mQ(e,A,t){return e===A?e.firstChild:A&&A.nextElementSibling?A.nextElementSibling:t?null:e.firstChild}function LF(e,A,t){return e===A?t?e.firstChild:e.lastChild:A&&A.previousElementSibling?A.previousElementSibling:t?null:e.lastChild}function xM(e,A){if(A===void 0)return!0;var t=e.innerText;return t===void 0&&(t=e.textContent),t=t.trim().toLowerCase(),t.length===0?!1:A.repeating?t[0]===A.keys[0]:t.indexOf(A.keys.join(""))===0}function nI(e,A,t,n,i,r){for(var o=!1,s=i(e,A,A?t:!1);s;){if(s===e.firstChild){if(o)return;o=!0}var a=n?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!xM(s,r)||a)s=i(e,s,t);else{s.focus();return}}}var $CA=typeof window>"u"?p.useEffect:p.useLayoutEffect,AuA=p.forwardRef(function(A,t){var n=A.actions,i=A.autoFocus,r=i===void 0?!1:i,o=A.autoFocusItem,s=o===void 0?!1:o,a=A.children,g=A.className,I=A.disabledItemsFocusable,l=I===void 0?!1:I,c=A.disableListWrap,C=c===void 0?!1:c,u=A.onKeyDown,E=A.variant,B=E===void 0?"selectedMenu":E,h=xA(A,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),f=p.useRef(null),Q=p.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});$CA(function(){r&&f.current.focus()},[r]),p.useImperativeHandle(n,function(){return{adjustStyleForScrollbar:function(F,N){var M=!f.current.style.width;if(F.clientHeight0&&(J-H.lastTime>500?(H.keys=[],H.repeating=!0,H.previousKeyMatched=!0):H.repeating&&W!==H.keys[0]&&(H.repeating=!1)),H.lastTime=J,H.keys.push(W);var Z=P&&!H.repeating&&xM(P,H);H.previousKeyMatched&&(Z||nI(N,P,!1,l,mQ,H))?F.preventDefault():H.previousKeyMatched=!1}u&&u(F)},w=p.useCallback(function(D){f.current=Vt.findDOMNode(D)},[]),m=it(w,t),v=-1;p.Children.forEach(a,function(D,F){p.isValidElement(D)&&(D.props.disabled||(B==="selectedMenu"&&D.props.selected||v===-1)&&(v=F))});var x=p.Children.map(a,function(D,F){if(F===v){var N={};return s&&(N.autoFocus=!0),D.props.tabIndex===void 0&&B==="selectedMenu"&&(N.tabIndex=0),p.cloneElement(D,N)}return D});return p.createElement(ZCA,k({role:"menu",ref:m,className:g,onKeyDown:d,tabIndex:r?0:-1},h),x)});const hw=AuA;var bF={vertical:"top",horizontal:"right"},GF={vertical:"top",horizontal:"left"},euA={paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},tuA=p.forwardRef(function(A,t){var n=A.autoFocus,i=n===void 0?!0:n,r=A.children,o=A.classes,s=A.disableAutoFocusItem,a=s===void 0?!1:s,g=A.MenuListProps,I=g===void 0?{}:g,l=A.onClose,c=A.onEntering,C=A.open,u=A.PaperProps,E=u===void 0?{}:u,B=A.PopoverClasses,h=A.transitionDuration,f=h===void 0?"auto":h,Q=A.TransitionProps;Q=Q===void 0?{}:Q;var d=Q.onEntering,w=xA(Q,["onEntering"]),m=A.variant,v=m===void 0?"selectedMenu":m,x=xA(A,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant"]),D=tc(),F=i&&!a&&C,N=p.useRef(null),M=p.useRef(null),P=function(){return M.current},H=function(O,Y){N.current&&N.current.adjustStyleForScrollbar(O,D),c&&c(O,Y),d&&d(O,Y)},W=function(O){O.key==="Tab"&&(O.preventDefault(),l&&l(O,"tabKeyDown"))},J=-1;p.Children.map(r,function(z,O){p.isValidElement(z)&&(z.props.disabled||(v!=="menu"&&z.props.selected||J===-1)&&(J=O))});var Z=p.Children.map(r,function(z,O){return O===J?p.cloneElement(z,{ref:function(T){M.current=Vt.findDOMNode(T),us(z.ref,T)}}):z});return p.createElement(WCA,k({getContentAnchorEl:P,classes:B,onClose:l,TransitionProps:k({onEntering:H},w),anchorOrigin:D.direction==="rtl"?bF:GF,transformOrigin:D.direction==="rtl"?bF:GF,PaperProps:k({},E,{classes:k({},E.classes,{root:o.paper})}),open:C,ref:t,transitionDuration:f},x),p.createElement(hw,k({onKeyDown:W,actions:N,autoFocus:i&&(J===-1||a),autoFocusItem:F,variant:v},I,{className:vA(o.list,I.className)}),Z))});const nuA=se(euA,{name:"MuiMenu"})(tuA);function kF(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function fw(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return e&&(kF(e.value)&&e.value!==""||A&&kF(e.defaultValue)&&e.defaultValue!=="")}function iuA(e){return e.startAdornment}function MF(e,A){return Il(A)==="object"&&A!==null?e===A:String(e)===String(A)}function ruA(e){return e==null||typeof e=="string"&&!e.trim()}var ouA=p.forwardRef(function(A,t){var n=A["aria-label"],i=A.autoFocus,r=A.autoWidth,o=A.children,s=A.classes,a=A.className,g=A.defaultValue,I=A.disabled,l=A.displayEmpty,c=A.IconComponent,C=A.inputRef,u=A.labelId,E=A.MenuProps,B=E===void 0?{}:E,h=A.multiple,f=A.name,Q=A.onBlur,d=A.onChange,w=A.onClose,m=A.onFocus,v=A.onOpen,x=A.open,D=A.readOnly,F=A.renderValue,N=A.SelectDisplayProps,M=N===void 0?{}:N,P=A.tabIndex;A.type;var H=A.value,W=A.variant,J=W===void 0?"standard":W,Z=xA(A,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),z=ih({controlled:H,default:g,name:"Select"}),O=Ac(z,2),Y=O[0],T=O[1],q=p.useRef(null),j=p.useState(null),AA=j[0],nA=j[1],IA=p.useRef(x!=null),aA=IA.current,BA=p.useState(),lA=BA[0],MA=BA[1],EA=p.useState(!1),pA=EA[0],qA=EA[1],NA=it(t,C);p.useImperativeHandle(NA,function(){return{focus:function(){AA.focus()},node:q.current,value:Y}},[AA,Y]),p.useEffect(function(){i&&AA&&AA.focus()},[i,AA]),p.useEffect(function(){if(AA){var WA=Rt(AA).getElementById(u);if(WA){var _A=function(){getSelection().isCollapsed&&AA.focus()};return WA.addEventListener("click",_A),function(){WA.removeEventListener("click",_A)}}}},[u,AA]);var JA=function(_A,pe){_A?v&&v(pe):w&&w(pe),aA||(MA(r?null:AA.clientWidth),qA(_A))},dA=function(_A){_A.button===0&&(_A.preventDefault(),AA.focus(),JA(!0,_A))},GA=function(_A){JA(!1,_A)},ie=p.Children.toArray(o),Ie=function(_A){var pe=ie.map(function(OA){return OA.props.value}).indexOf(_A.target.value);if(pe!==-1){var we=ie[pe];T(we.props.value),d&&d(_A,we)}},he=function(_A){return function(pe){h||JA(!1,pe);var we;if(h){we=Array.isArray(Y)?Y.slice():[];var OA=Y.indexOf(_A.props.value);OA===-1?we.push(_A.props.value):we.splice(OA,1)}else we=_A.props.value;_A.props.onClick&&_A.props.onClick(pe),Y!==we&&(T(we),d&&(pe.persist(),Object.defineProperty(pe,"target",{writable:!0,value:{value:we,name:f}}),d(pe,_A)))}},XA=function(_A){if(!D){var pe=[" ","ArrowUp","ArrowDown","Enter"];pe.indexOf(_A.key)!==-1&&(_A.preventDefault(),JA(!0,_A))}},eA=AA!==null&&(aA?x:pA),gA=function(_A){!eA&&Q&&(_A.persist(),Object.defineProperty(_A,"target",{writable:!0,value:{value:Y,name:f}}),Q(_A))};delete Z["aria-invalid"];var LA,le,ZA=[],Je=!1;(fw({value:Y})||l)&&(F?LA=F(Y):Je=!0);var $A=ie.map(function(WA){if(!p.isValidElement(WA))return null;var _A;if(h){if(!Array.isArray(Y))throw new Error(Ma(2));_A=Y.some(function(pe){return MF(pe,WA.props.value)}),_A&&Je&&ZA.push(WA.props.children)}else _A=MF(Y,WA.props.value),_A&&Je&&(le=WA.props.children);return p.cloneElement(WA,{"aria-selected":_A?"true":void 0,onClick:he(WA),onKeyUp:function(we){we.key===" "&&we.preventDefault(),WA.props.onKeyUp&&WA.props.onKeyUp(we)},role:"option",selected:_A,value:void 0,"data-value":WA.props.value})});Je&&(LA=h?ZA.join(", "):le);var VA=lA;!r&&aA&&AA&&(VA=AA.clientWidth);var Me;typeof P<"u"?Me=P:Me=I?null:0;var ue=M.id||(f?"mui-component-select-".concat(f):void 0);return p.createElement(p.Fragment,null,p.createElement("div",k({className:vA(s.root,s.select,s.selectMenu,s[J],a,I&&s.disabled),ref:nA,tabIndex:Me,role:"button","aria-disabled":I?"true":void 0,"aria-expanded":eA?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[u,ue].filter(Boolean).join(" ")||void 0,onKeyDown:XA,onMouseDown:I||D?null:dA,onBlur:gA,onFocus:m},M,{id:ue}),ruA(LA)?p.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):LA),p.createElement("input",k({value:Array.isArray(Y)?Y.join(","):Y,name:f,ref:q,"aria-hidden":!0,onChange:Ie,tabIndex:-1,className:s.nativeInput,autoFocus:i},Z)),p.createElement(c,{className:vA(s.icon,s["icon".concat(De(J))],eA&&s.iconOpen,I&&s.disabled)}),p.createElement(nuA,k({id:"menu-".concat(f||""),anchorEl:AA,open:eA,onClose:GA},B,{MenuListProps:k({"aria-labelledby":u,role:"listbox",disableListWrap:!0},B.MenuListProps),PaperProps:k({},B.PaperProps,{style:k({minWidth:VA},B.PaperProps!=null?B.PaperProps.style:null)})}),$A))});const suA=ouA;function Sg(e){var A=e.props,t=e.states,n=e.muiFormControl;return t.reduce(function(i,r){return i[r]=A[r],n&&typeof A[r]>"u"&&(i[r]=n[r]),i},{})}const FM=Mn(p.createElement("path",{d:"M7 10l5 5 5-5z"}));function TC(e,A){return parseInt(e[A],10)||0}var auA=typeof window<"u"?p.useLayoutEffect:p.useEffect,guA={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}},IuA=p.forwardRef(function(A,t){var n=A.onChange,i=A.rows,r=A.rowsMax,o=A.rowsMin,s=A.maxRows,a=A.minRows,g=a===void 0?1:a,I=A.style,l=A.value,c=xA(A,["onChange","rows","rowsMax","rowsMin","maxRows","minRows","style","value"]),C=s||r,u=i||o||g,E=p.useRef(l!=null),B=E.current,h=p.useRef(null),f=it(t,h),Q=p.useRef(null),d=p.useRef(0),w=p.useState({}),m=w[0],v=w[1],x=p.useCallback(function(){var F=h.current,N=window.getComputedStyle(F),M=Q.current;M.style.width=N.width,M.value=F.value||A.placeholder||"x",M.value.slice(-1)===` +`&&(M.value+=" ");var P=N["box-sizing"],H=TC(N,"padding-bottom")+TC(N,"padding-top"),W=TC(N,"border-bottom-width")+TC(N,"border-top-width"),J=M.scrollHeight-H;M.value="x";var Z=M.scrollHeight-H,z=J;u&&(z=Math.max(Number(u)*Z,z)),C&&(z=Math.min(Number(C)*Z,z)),z=Math.max(z,Z);var O=z+(P==="border-box"?H+W:0),Y=Math.abs(z-J)<=1;v(function(T){return d.current<20&&(O>0&&Math.abs((T.outerHeightStyle||0)-O)>1||T.overflow!==Y)?(d.current+=1,{overflow:Y,outerHeightStyle:O}):T})},[C,u,A.placeholder]);p.useEffect(function(){var F=Va(function(){d.current=0,x()});return window.addEventListener("resize",F),function(){F.clear(),window.removeEventListener("resize",F)}},[x]),auA(function(){x()}),p.useEffect(function(){d.current=0},[l]);var D=function(N){d.current=0,B||x(),n&&n(N)};return p.createElement(p.Fragment,null,p.createElement("textarea",k({value:l,onChange:D,ref:f,rows:u,style:k({height:m.outerHeightStyle,overflow:m.overflow?"hidden":null},I)},c)),p.createElement("textarea",{"aria-hidden":!0,className:A.className,readOnly:!0,ref:Q,tabIndex:-1,style:k({},guA.shadow,I)}))});const luA=IuA;var cuA=function(A){var t=A.palette.type==="light",n={color:"currentColor",opacity:t?.42:.5,transition:A.transitions.create("opacity",{duration:A.transitions.duration.shorter})},i={opacity:"0 !important"},r={opacity:t?.42:.5};return{"@global":{"@keyframes mui-auto-fill":{},"@keyframes mui-auto-fill-cancel":{}},root:k({},A.typography.body1,{color:A.palette.text.primary,lineHeight:"1.1876em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center","&$disabled":{color:A.palette.text.disabled,cursor:"default"}}),formControl:{},focused:{},disabled:{},adornedStart:{},adornedEnd:{},error:{},marginDense:{},multiline:{padding:"".concat(8-2,"px 0 ").concat(8-1,"px"),"&$marginDense":{paddingTop:4-1}},colorSecondary:{},fullWidth:{width:"100%"},input:{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"".concat(8-2,"px 0 ").concat(8-1,"px"),border:0,boxSizing:"content-box",background:"none",height:"1.1876em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{"-webkit-appearance":"none"},"label[data-shrink=false] + $formControl &":{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":r,"&:focus::-moz-placeholder":r,"&:focus:-ms-input-placeholder":r,"&:focus::-ms-input-placeholder":r},"&$disabled":{opacity:1},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},inputMarginDense:{paddingTop:4-1},inputMultiline:{height:"auto",resize:"none",padding:0},inputTypeSearch:{"-moz-appearance":"textfield","-webkit-appearance":"textfield"},inputAdornedStart:{},inputAdornedEnd:{},inputHiddenLabel:{}}},CuA=typeof window>"u"?p.useEffect:p.useLayoutEffect,uuA=p.forwardRef(function(A,t){var n=A["aria-describedby"],i=A.autoComplete,r=A.autoFocus,o=A.classes,s=A.className;A.color;var a=A.defaultValue,g=A.disabled,I=A.endAdornment;A.error;var l=A.fullWidth,c=l===void 0?!1:l,C=A.id,u=A.inputComponent,E=u===void 0?"input":u,B=A.inputProps,h=B===void 0?{}:B,f=A.inputRef;A.margin;var Q=A.multiline,d=Q===void 0?!1:Q,w=A.name,m=A.onBlur,v=A.onChange,x=A.onClick,D=A.onFocus,F=A.onKeyDown,N=A.onKeyUp,M=A.placeholder,P=A.readOnly,H=A.renderSuffix,W=A.rows,J=A.rowsMax,Z=A.rowsMin,z=A.maxRows,O=A.minRows,Y=A.startAdornment,T=A.type,q=T===void 0?"text":T,j=A.value,AA=xA(A,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","maxRows","minRows","startAdornment","type","value"]),nA=h.value!=null?h.value:j,IA=p.useRef(nA!=null),aA=IA.current,BA=p.useRef(),lA=p.useCallback(function($A){},[]),MA=it(h.ref,lA),EA=it(f,MA),pA=it(BA,EA),qA=p.useState(!1),NA=qA[0],JA=qA[1],dA=lCA(),GA=Sg({props:A,muiFormControl:dA,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});GA.focused=dA?dA.focused:NA,p.useEffect(function(){!dA&&g&&NA&&(JA(!1),m&&m())},[dA,g,NA,m]);var ie=dA&&dA.onFilled,Ie=dA&&dA.onEmpty,he=p.useCallback(function($A){fw($A)?ie&&ie():Ie&&Ie()},[ie,Ie]);CuA(function(){aA&&he({value:nA})},[nA,he,aA]);var XA=function(VA){if(GA.disabled){VA.stopPropagation();return}D&&D(VA),h.onFocus&&h.onFocus(VA),dA&&dA.onFocus?dA.onFocus(VA):JA(!0)},eA=function(VA){m&&m(VA),h.onBlur&&h.onBlur(VA),dA&&dA.onBlur?dA.onBlur(VA):JA(!1)},gA=function(VA){if(!aA){var Me=VA.target||BA.current;if(Me==null)throw new Error(Ma(1));he({value:Me.value})}for(var ue=arguments.length,WA=new Array(ue>1?ue-1:0),_A=1;_A span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:A.transitions.create("max-width",{duration:100,easing:A.transitions.easing.easeOut,delay:50})}}},duA=p.forwardRef(function(A,t){A.children;var n=A.classes,i=A.className,r=A.label,o=A.labelWidth,s=A.notched,a=A.style,g=xA(A,["children","classes","className","label","labelWidth","notched","style"]),I=tc(),l=I.direction==="rtl"?"right":"left";if(r!==void 0)return p.createElement("fieldset",k({"aria-hidden":!0,className:vA(n.root,i),ref:t,style:a},g),p.createElement("legend",{className:vA(n.legendLabelled,s&&n.legendNotched)},r?p.createElement("span",null,r):p.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})));var c=o>0?o*.75+8:.01;return p.createElement("fieldset",k({"aria-hidden":!0,style:k(y({},"padding".concat(De(l)),8),a),className:vA(n.root,i),ref:t},g),p.createElement("legend",{className:n.legend,style:{width:s?c:.01}},p.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})))});const puA=se(QuA,{name:"PrivateNotchedOutline"})(duA);var yuA=function(A){var t=A.palette.type==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:A.shape.borderRadius,"&:hover $notchedOutline":{borderColor:A.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:A.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:A.palette.error.main},"&$disabled $notchedOutline":{borderColor:A.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:A.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:A.palette.type==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:A.palette.type==="light"?null:"#fff",caretColor:A.palette.type==="light"?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}},MM=p.forwardRef(function(A,t){var n=A.classes,i=A.fullWidth,r=i===void 0?!1:i,o=A.inputComponent,s=o===void 0?"input":o,a=A.label,g=A.labelWidth,I=g===void 0?0:g,l=A.multiline,c=l===void 0?!1:l,C=A.notched,u=A.type,E=u===void 0?"text":u,B=xA(A,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return p.createElement(Qw,k({renderSuffix:function(f){return p.createElement(puA,{className:n.notchedOutline,label:a,labelWidth:I,notched:typeof C<"u"?C:!!(f.startAdornment||f.filled||f.focused)})},classes:k({},n,{root:vA(n.root,n.underline),notchedOutline:null}),fullWidth:r,inputComponent:s,multiline:c,ref:t,type:E},B))});MM.muiName="Input";const TM=se(yuA,{name:"MuiOutlinedInput"})(MM);var muA=LM,wuA=p.createElement(dw,null),vuA=p.createElement(kM,null),UM=p.forwardRef(function e(A,t){var n=A.autoWidth,i=n===void 0?!1:n,r=A.children,o=A.classes,s=A.displayEmpty,a=s===void 0?!1:s,g=A.IconComponent,I=g===void 0?FM:g,l=A.id,c=A.input,C=A.inputProps,u=A.label,E=A.labelId,B=A.labelWidth,h=B===void 0?0:B,f=A.MenuProps,Q=A.multiple,d=Q===void 0?!1:Q,w=A.native,m=w===void 0?!1:w,v=A.onClose,x=A.onOpen,D=A.open,F=A.renderValue,N=A.SelectDisplayProps,M=A.variant,P=M===void 0?"standard":M,H=xA(A,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),W=m?_M:suA,J=vg(),Z=Sg({props:A,muiFormControl:J,states:["variant"]}),z=Z.variant||P,O=c||{standard:wuA,outlined:p.createElement(TM,{label:u,labelWidth:h}),filled:vuA}[z];return p.cloneElement(O,k({inputComponent:W,inputProps:k({children:r,IconComponent:I,variant:z,type:void 0,multiple:d},m?{id:l}:{autoWidth:i,displayEmpty:a,labelId:E,MenuProps:f,onClose:v,onOpen:x,open:D,renderValue:F,SelectDisplayProps:k({id:l},N)},C,{classes:C?Qy({baseClasses:o,newClasses:C.classes,Component:e}):o},c?c.props.inputProps:{}),ref:t},H))});UM.muiName="Select";const Dg=se(muA,{name:"MuiSelect"})(UM);var pw={},PM={exports:{}};(function(e){function A(t){return t&&t.__esModule?t:{default:t}}e.exports=A,e.exports.__esModule=!0,e.exports.default=e.exports})(PM);var Qo=PM.exports,HM={exports:{}},qM={exports:{}};(function(e){function A(t){"@babel/helpers - typeof";return e.exports=A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,A(t)}e.exports=A,e.exports.__esModule=!0,e.exports.default=e.exports})(qM);var SuA=qM.exports;(function(e){var A=SuA.default;function t(i){if(typeof WeakMap!="function")return null;var r=new WeakMap,o=new WeakMap;return(t=function(a){return a?o:r})(i)}function n(i,r){if(!r&&i&&i.__esModule)return i;if(i===null||A(i)!=="object"&&typeof i!="function")return{default:i};var o=t(r);if(o&&o.has(i))return o.get(i);var s={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var I=a?Object.getOwnPropertyDescriptor(i,g):null;I&&(I.get||I.set)?Object.defineProperty(s,g,I):s[g]=i[g]}return s.default=i,o&&o.set(i,s),s}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(HM);var po=HM.exports,wQ={};const DuA=dT(rlA);var TF;function yo(){return TF||(TF=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return A.createSvgIcon}});var A=DuA}(wQ)),wQ}var RuA=Qo,xuA=po;Object.defineProperty(pw,"__esModule",{value:!0});var JM=pw.default=void 0,FuA=xuA(p),NuA=RuA(yo()),_uA=(0,NuA.default)(FuA.createElement("path",{d:"M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"HighlightOff");JM=pw.default=_uA;var yw={},LuA=Qo,buA=po;Object.defineProperty(yw,"__esModule",{value:!0});var OM=yw.default=void 0,GuA=buA(p),kuA=LuA(yo()),MuA=(0,kuA.default)(GuA.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");OM=yw.default=MuA;/**! * @fileOverview Kickass library to create and place poppers near their reference elements. * @version 1.16.1-lts * @license @@ -3916,4 +3916,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. - */var Dc=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",MuA=function(){for(var e=["Edge","Trident","Firefox"],A=0;A=0)return 1;return 0}();function TuA(e){var A=!1;return function(){A||(A=!0,window.Promise.resolve().then(function(){A=!1,e()}))}}function UuA(e){var A=!1;return function(){A||(A=!0,setTimeout(function(){A=!1,e()},MuA))}}var PuA=Dc&&window.Promise,HuA=PuA?TuA:UuA;function YM(e){var A={};return e&&A.toString.call(e)==="[object Function]"}function Fs(e,A){if(e.nodeType!==1)return[];var t=e.ownerDocument.defaultView,n=t.getComputedStyle(e,null);return A?n[A]:n}function mw(e){return e.nodeName==="HTML"?e:e.parentNode||e.host}function Rc(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var A=Fs(e),t=A.overflow,n=A.overflowX,i=A.overflowY;return/(auto|scroll|overlay)/.test(t+i+n)?e:Rc(mw(e))}function KM(e){return e&&e.referenceNode?e.referenceNode:e}var UF=Dc&&!!(window.MSInputMethodContext&&document.documentMode),PF=Dc&&/MSIE 10/.test(navigator.userAgent);function Rg(e){return e===11?UF:e===10?PF:UF||PF}function Wa(e){if(!e)return document.documentElement;for(var A=Rg(10)?document.body:null,t=e.offsetParent||null;t===A&&e.nextElementSibling;)t=(e=e.nextElementSibling).offsetParent;var n=t&&t.nodeName;return!n||n==="BODY"||n==="HTML"?e?e.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(t.nodeName)!==-1&&Fs(t,"position")==="static"?Wa(t):t}function quA(e){var A=e.nodeName;return A==="BODY"?!1:A==="HTML"||Wa(e.firstElementChild)===e}function $0(e){return e.parentNode!==null?$0(e.parentNode):e}function OB(e,A){if(!e||!e.nodeType||!A||!A.nodeType)return document.documentElement;var t=e.compareDocumentPosition(A)&Node.DOCUMENT_POSITION_FOLLOWING,n=t?e:A,i=t?A:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var o=r.commonAncestorContainer;if(e!==o&&A!==o||n.contains(i))return quA(o)?o:Wa(o);var s=$0(e);return s.host?OB(s.host,A):OB(e,$0(A).host)}function za(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",t=A==="top"?"scrollTop":"scrollLeft",n=e.nodeName;if(n==="BODY"||n==="HTML"){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[t]}return e[t]}function JuA(e,A){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=za(A,"top"),i=za(A,"left"),r=t?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function HF(e,A){var t=A==="x"?"Left":"Top",n=t==="Left"?"Right":"Bottom";return parseFloat(e["border"+t+"Width"])+parseFloat(e["border"+n+"Width"])}function qF(e,A,t,n){return Math.max(A["offset"+e],A["scroll"+e],t["client"+e],t["offset"+e],t["scroll"+e],Rg(10)?parseInt(t["offset"+e])+parseInt(n["margin"+(e==="Height"?"Top":"Left")])+parseInt(n["margin"+(e==="Height"?"Bottom":"Right")]):0)}function VM(e){var A=e.body,t=e.documentElement,n=Rg(10)&&getComputedStyle(t);return{height:qF("Height",A,t,n),width:qF("Width",A,t,n)}}var OuA=function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")},YuA=function(){function e(A,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:!1,n=Rg(10),i=A.nodeName==="HTML",r=Ap(e),o=Ap(A),s=Rc(e),a=Fs(A),g=parseFloat(a.borderTopWidth),I=parseFloat(a.borderLeftWidth);t&&i&&(o.top=Math.max(o.top,0),o.left=Math.max(o.left,0));var l=Io({top:r.top-o.top-g,left:r.left-o.left-I,width:r.width,height:r.height});if(l.marginTop=0,l.marginLeft=0,!n&&i){var c=parseFloat(a.marginTop),C=parseFloat(a.marginLeft);l.top-=g-c,l.bottom-=g-c,l.left-=I-C,l.right-=I-C,l.marginTop=c,l.marginLeft=C}return(n&&!t?A.contains(s):A===s&&s.nodeName!=="BODY")&&(l=JuA(l,A)),l}function KuA(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=e.ownerDocument.documentElement,n=ww(e,t),i=Math.max(t.clientWidth,window.innerWidth||0),r=Math.max(t.clientHeight,window.innerHeight||0),o=A?0:za(t),s=A?0:za(t,"left"),a={top:o-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return Io(a)}function WM(e){var A=e.nodeName;if(A==="BODY"||A==="HTML")return!1;if(Fs(e,"position")==="fixed")return!0;var t=mw(e);return t?WM(t):!1}function zM(e){if(!e||!e.parentElement||Rg())return document.documentElement;for(var A=e.parentElement;A&&Fs(A,"transform")==="none";)A=A.parentElement;return A||document.documentElement}function vw(e,A,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,r={top:0,left:0},o=i?zM(e):OB(e,KM(A));if(n==="viewport")r=KuA(o,i);else{var s=void 0;n==="scrollParent"?(s=Rc(mw(A)),s.nodeName==="BODY"&&(s=e.ownerDocument.documentElement)):n==="window"?s=e.ownerDocument.documentElement:s=n;var a=ww(s,o,i);if(s.nodeName==="HTML"&&!WM(o)){var g=VM(e.ownerDocument),I=g.height,l=g.width;r.top+=a.top-a.marginTop,r.bottom=I+a.top,r.left+=a.left-a.marginLeft,r.right=l+a.left}else r=a}t=t||0;var c=typeof t=="number";return r.left+=c?t:t.left||0,r.top+=c?t:t.top||0,r.right-=c?t:t.right||0,r.bottom-=c?t:t.bottom||0,r}function VuA(e){var A=e.width,t=e.height;return A*t}function jM(e,A,t,n,i){var r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(e.indexOf("auto")===-1)return e;var o=vw(t,n,r,i),s={top:{width:o.width,height:A.top-o.top},right:{width:o.right-A.right,height:o.height},bottom:{width:o.width,height:o.bottom-A.bottom},left:{width:A.left-o.left,height:o.height}},a=Object.keys(s).map(function(c){return vn({key:c},s[c],{area:VuA(s[c])})}).sort(function(c,C){return C.area-c.area}),g=a.filter(function(c){var C=c.width,u=c.height;return C>=t.clientWidth&&u>=t.clientHeight}),I=g.length>0?g[0].key:a[0].key,l=e.split("-")[1];return I+(l?"-"+l:"")}function XM(e,A,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=n?zM(A):OB(A,KM(t));return ww(t,i,n)}function ZM(e){var A=e.ownerDocument.defaultView,t=A.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),i=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function YB(e){var A={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(t){return A[t]})}function $M(e,A,t){t=t.split("-")[0];var n=ZM(e),i={width:n.width,height:n.height},r=["right","left"].indexOf(t)!==-1,o=r?"top":"left",s=r?"left":"top",a=r?"height":"width",g=r?"width":"height";return i[o]=A[o]+A[a]/2-n[a]/2,t===s?i[s]=A[s]-n[g]:i[s]=A[YB(s)],i}function xc(e,A){return Array.prototype.find?e.find(A):e.filter(A)[0]}function WuA(e,A,t){if(Array.prototype.findIndex)return e.findIndex(function(i){return i[A]===t});var n=xc(e,function(i){return i[A]===t});return e.indexOf(n)}function AT(e,A,t){var n=t===void 0?e:e.slice(0,WuA(e,"name",t));return n.forEach(function(i){i.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var r=i.function||i.fn;i.enabled&&YM(r)&&(A.offsets.popper=Io(A.offsets.popper),A.offsets.reference=Io(A.offsets.reference),A=r(A,i))}),A}function zuA(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=XM(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=jM(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=$M(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=AT(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function eT(e,A){return e.some(function(t){var n=t.name,i=t.enabled;return i&&n===A})}function Sw(e){for(var A=[!1,"ms","Webkit","Moz","O"],t=e.charAt(0).toUpperCase()+e.slice(1),n=0;no[C]&&(e.offsets.popper[l]+=s[l]+u-o[C]),e.offsets.popper=Io(e.offsets.popper);var E=s[l]+s[g]/2-u/2,B=Fs(e.instance.popper),h=parseFloat(B["margin"+I]),f=parseFloat(B["border"+I+"Width"]),Q=E-e.offsets.popper[l]-h-f;return Q=Math.max(Math.min(o[g]-u,Q),0),e.arrowElement=n,e.offsets.arrow=(t={},ja(t,l,Math.round(Q)),ja(t,c,""),t),e}function aBA(e){return e==="end"?"start":e==="start"?"end":e}var rT=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],vQ=rT.slice(3);function JF(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=vQ.indexOf(e),n=vQ.slice(t+1).concat(vQ.slice(0,t));return A?n.reverse():n}var SQ={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function gBA(e,A){if(eT(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var t=vw(e.instance.popper,e.instance.reference,A.padding,A.boundariesElement,e.positionFixed),n=e.placement.split("-")[0],i=YB(n),r=e.placement.split("-")[1]||"",o=[];switch(A.behavior){case SQ.FLIP:o=[n,i];break;case SQ.CLOCKWISE:o=JF(n);break;case SQ.COUNTERCLOCKWISE:o=JF(n,!0);break;default:o=A.behavior}return o.forEach(function(s,a){if(n!==s||o.length===a+1)return e;n=e.placement.split("-")[0],i=YB(n);var g=e.offsets.popper,I=e.offsets.reference,l=Math.floor,c=n==="left"&&l(g.right)>l(I.left)||n==="right"&&l(g.left)l(I.top)||n==="bottom"&&l(g.top)l(t.right),E=l(g.top)l(t.bottom),h=n==="left"&&C||n==="right"&&u||n==="top"&&E||n==="bottom"&&B,f=["top","bottom"].indexOf(n)!==-1,Q=!!A.flipVariations&&(f&&r==="start"&&C||f&&r==="end"&&u||!f&&r==="start"&&E||!f&&r==="end"&&B),d=!!A.flipVariationsByContent&&(f&&r==="start"&&u||f&&r==="end"&&C||!f&&r==="start"&&B||!f&&r==="end"&&E),w=Q||d;(c||h||w)&&(e.flipped=!0,(c||h)&&(n=o[a+1]),w&&(r=aBA(r)),e.placement=n+(r?"-"+r:""),e.offsets.popper=vn({},e.offsets.popper,$M(e.instance.popper,e.offsets.reference,e.placement)),e=AT(e.instance.modifiers,e,"flip"))}),e}function IBA(e){var A=e.offsets,t=A.popper,n=A.reference,i=e.placement.split("-")[0],r=Math.floor,o=["top","bottom"].indexOf(i)!==-1,s=o?"right":"bottom",a=o?"left":"top",g=o?"width":"height";return t[s]r(n[s])&&(e.offsets.popper[a]=r(n[s])),e}function lBA(e,A,t,n){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+i[1],o=i[2];if(!r)return e;if(o.indexOf("%")===0){var s=void 0;switch(o){case"%p":s=t;break;case"%":case"%r":default:s=n}var a=Io(s);return a[A]/100*r}else if(o==="vh"||o==="vw"){var g=void 0;return o==="vh"?g=Math.max(document.documentElement.clientHeight,window.innerHeight||0):g=Math.max(document.documentElement.clientWidth,window.innerWidth||0),g/100*r}else return r}function cBA(e,A,t,n){var i=[0,0],r=["right","left"].indexOf(n)!==-1,o=e.split(/(\+|\-)/).map(function(I){return I.trim()}),s=o.indexOf(xc(o,function(I){return I.search(/,|\s/)!==-1}));o[s]&&o[s].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var a=/\s*,\s*|\s+/,g=s!==-1?[o.slice(0,s).concat([o[s].split(a)[0]]),[o[s].split(a)[1]].concat(o.slice(s+1))]:[o];return g=g.map(function(I,l){var c=(l===1?!r:r)?"height":"width",C=!1;return I.reduce(function(u,E){return u[u.length-1]===""&&["+","-"].indexOf(E)!==-1?(u[u.length-1]=E,C=!0,u):C?(u[u.length-1]+=E,C=!1,u):u.concat(E)},[]).map(function(u){return lBA(u,c,A,t)})}),g.forEach(function(I,l){I.forEach(function(c,C){Dw(c)&&(i[l]+=c*(I[C-1]==="-"?-1:1))})}),i}function CBA(e,A){var t=A.offset,n=e.placement,i=e.offsets,r=i.popper,o=i.reference,s=n.split("-")[0],a=void 0;return Dw(+t)?a=[+t,0]:a=cBA(t,r,o,s),s==="left"?(r.top+=a[0],r.left-=a[1]):s==="right"?(r.top+=a[0],r.left+=a[1]):s==="top"?(r.left+=a[0],r.top-=a[1]):s==="bottom"&&(r.left+=a[0],r.top+=a[1]),e.popper=r,e}function uBA(e,A){var t=A.boundariesElement||Wa(e.instance.popper);e.instance.reference===t&&(t=Wa(t));var n=Sw("transform"),i=e.instance.popper.style,r=i.top,o=i.left,s=i[n];i.top="",i.left="",i[n]="";var a=vw(e.instance.popper,e.instance.reference,A.padding,t,e.positionFixed);i.top=r,i.left=o,i[n]=s,A.boundaries=a;var g=A.priority,I=e.offsets.popper,l={primary:function(C){var u=I[C];return I[C]a[C]&&!A.escapeWithReference&&(E=Math.min(I[u],a[C]-(C==="right"?I.width:I.height))),ja({},u,E)}};return g.forEach(function(c){var C=["left","top"].indexOf(c)!==-1?"primary":"secondary";I=vn({},I,l[C](c))}),e.offsets.popper=I,e}function BBA(e){var A=e.placement,t=A.split("-")[0],n=A.split("-")[1];if(n){var i=e.offsets,r=i.reference,o=i.popper,s=["bottom","top"].indexOf(t)!==-1,a=s?"left":"top",g=s?"width":"height",I={start:ja({},a,r[a]),end:ja({},a,r[a]+r[g]-o[g])};e.offsets.popper=vn({},o,I[n])}return e}function EBA(e){if(!iT(e.instance.modifiers,"hide","preventOverflow"))return e;var A=e.offsets.reference,t=xc(e.instance.modifiers,function(n){return n.name==="preventOverflow"}).boundaries;if(A.bottomt.right||A.top>t.bottom||A.right2&&arguments[2]!==void 0?arguments[2]:{};OuA(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(n.update)},this.update=HuA(this.update.bind(this)),this.options=vn({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=A&&A.jquery?A[0]:A,this.popper=t&&t.jquery?t[0]:t,this.options.modifiers={},Object.keys(vn({},e.Defaults.modifiers,i.modifiers)).forEach(function(o){n.options.modifiers[o]=vn({},e.Defaults.modifiers[o]||{},i.modifiers?i.modifiers[o]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(o){return vn({name:o},n.options.modifiers[o])}).sort(function(o,s){return o.order-s.order}),this.modifiers.forEach(function(o){o.enabled&&YM(o.onLoad)&&o.onLoad(n.reference,n.popper,n.options,o,n.state)}),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return YuA(e,[{key:"update",value:function(){return zuA.call(this)}},{key:"destroy",value:function(){return juA.call(this)}},{key:"enableEventListeners",value:function(){return ZuA.call(this)}},{key:"disableEventListeners",value:function(){return ABA.call(this)}}]),e}();ah.Utils=(typeof window<"u"?window:global).PopperUtils;ah.placements=rT;ah.Defaults=QBA;const dBA=ah;function pBA(e,A){var t=A&&A.direction||"ltr";if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function OF(e){return typeof e=="function"?e():e}var yBA=typeof window<"u"?p.useLayoutEffect:p.useEffect,mBA={},wBA=p.forwardRef(function(A,t){var n=A.anchorEl,i=A.children,r=A.container,o=A.disablePortal,s=o===void 0?!1:o,a=A.keepMounted,g=a===void 0?!1:a,I=A.modifiers,l=A.open,c=A.placement,C=c===void 0?"bottom":c,u=A.popperOptions,E=u===void 0?mBA:u,B=A.popperRef,h=A.style,f=A.transition,Q=f===void 0?!1:f,d=xA(A,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),w=p.useRef(null),m=it(w,t),v=p.useRef(null),x=it(v,B),D=p.useRef(x);yBA(function(){D.current=x},[x]),p.useImperativeHandle(B,function(){return v.current},[]);var F=p.useState(!0),N=F[0],M=F[1],P=og(),H=pBA(C,P),W=p.useState(H),J=W[0],Z=W[1];p.useEffect(function(){v.current&&v.current.update()});var z=p.useCallback(function(){if(!(!w.current||!n||!l)){v.current&&(v.current.destroy(),D.current(null));var AA=function(aA){Z(aA.placement)};OF(n);var nA=new dBA(OF(n),w.current,k({placement:H},E,{modifiers:k({},s?{}:{preventOverflow:{boundariesElement:"window"}},I,E.modifiers),onCreate:go(AA,E.onCreate),onUpdate:go(AA,E.onUpdate)}));D.current(nA)}},[n,s,I,l,H,E]),O=p.useCallback(function(AA){us(m,AA),z()},[m,z]),Y=function(){M(!1)},T=function(){v.current&&(v.current.destroy(),D.current(null))},q=function(){M(!0),T()};if(p.useEffect(function(){return function(){T()}},[]),p.useEffect(function(){!l&&!Q&&T()},[l,Q]),!g&&!l&&(!Q||N))return null;var j={placement:J};return Q&&(j.TransitionProps={in:l,onEnter:Y,onExited:q}),p.createElement(DM,{disablePortal:s,container:r},p.createElement("div",k({ref:O,role:"tooltip"},d,{style:k({position:"fixed",top:0,left:0,display:!l&&g&&!Q?"none":null},h)}),typeof i=="function"?i(j):i))});const Rw=wBA;var vBA=function(A){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:A.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:A.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(A.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:A.transitions.create("background-color",{duration:A.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:A.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}},SBA=typeof window>"u"?p.useEffect:p.useLayoutEffect,DBA=p.forwardRef(function(A,t){var n=A.alignItems,i=n===void 0?"center":n,r=A.autoFocus,o=r===void 0?!1:r,s=A.button,a=s===void 0?!1:s,g=A.children,I=A.classes,l=A.className,c=A.component,C=A.ContainerComponent,u=C===void 0?"li":C,E=A.ContainerProps;E=E===void 0?{}:E;var B=E.className,h=xA(E,["className"]),f=A.dense,Q=f===void 0?!1:f,d=A.disabled,w=d===void 0?!1:d,m=A.disableGutters,v=m===void 0?!1:m,x=A.divider,D=x===void 0?!1:x,F=A.focusVisibleClassName,N=A.selected,M=N===void 0?!1:N,P=xA(A,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),H=p.useContext(Qu),W={dense:Q||H.dense||!1,alignItems:i},J=p.useRef(null);SBA(function(){o&&J.current&&J.current.focus()},[o]);var Z=p.Children.toArray(g),z=Z.length&&WI(Z[Z.length-1],["ListItemSecondaryAction"]),O=p.useCallback(function(j){J.current=Vt.findDOMNode(j)},[]),Y=it(O,t),T=k({className:vA(I.root,l,W.dense&&I.dense,!v&&I.gutters,D&&I.divider,w&&I.disabled,a&&I.button,i!=="center"&&I.alignItemsFlexStart,z&&I.secondaryAction,M&&I.selected),disabled:w},P),q=c||"li";return a&&(T.component=c||"div",T.focusVisibleClassName=vA(I.focusVisible,F),q=Sc),z?(q=!T.component&&!c?"div":q,u==="li"&&(q==="li"?q="div":T.component==="li"&&(T.component="div")),p.createElement(Qu.Provider,{value:W},p.createElement(u,k({className:vA(I.container,B),ref:Y},h),p.createElement(q,T,Z),Z.pop()))):p.createElement(Qu.Provider,{value:W},p.createElement(q,k({ref:Y},T),Z))});const RBA=se(vBA,{name:"MuiListItem"})(DBA);var xBA=function(A){return{root:k({},A.typography.body1,y({minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",width:"auto",overflow:"hidden",whiteSpace:"nowrap"},A.breakpoints.up("sm"),{minHeight:"auto"})),gutters:{},selected:{},dense:k({},A.typography.body2,{minHeight:"auto"})}},FBA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.component,o=r===void 0?"li":r,s=A.disableGutters,a=s===void 0?!1:s,g=A.ListItemClasses,I=A.role,l=I===void 0?"menuitem":I,c=A.selected,C=A.tabIndex,u=xA(A,["classes","className","component","disableGutters","ListItemClasses","role","selected","tabIndex"]),E;return A.disabled||(E=C!==void 0?C:-1),p.createElement(RBA,k({button:!0,role:l,tabIndex:E,component:o,selected:c,disableGutters:a,classes:k({dense:n.dense},g),className:vA(n.root,i,c&&n.selected,!a&&n.gutters),ref:t},u))});const du=se(xBA,{name:"MuiMenuItem"})(FBA);var xw={},NBA=Qo,_BA=po;Object.defineProperty(xw,"__esModule",{value:!0});var oT=xw.default=void 0,LBA=_BA(p),bBA=NBA(yo()),GBA=(0,bBA.default)(LBA.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}),"Lens");oT=xw.default=GBA;const kBA=ys(()=>({container:{width:"70px",height:"40px",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},button:{padding:"3px",width:"16px",height:"16px"},icon:{width:"17px",height:"17px"}})),MBA=({handleColorSelect:e})=>{const A=kBA();return b.jsx("div",{className:A.container,"aria-label":"color-swatch",children:ow.map(t=>b.jsx(Bs,{className:A.button,onClick:()=>e(t),children:b.jsx(oT,{fontSize:"small",style:{color:`rgb(${t})`},className:A.icon})},t))})},TBA=MBA,UBA=ys(()=>({paper:{backgroundColor:"rgba(0, 0, 0, 0.75)"},span:{width:"70px",textAlign:"center",paddingLeft:"2px",paddingRight:"2px"},colors:{"&:hover":{backgroundColor:"transparent"},paddingLeft:"2px",paddingRight:"2px"}}));function PBA({handleColorSelect:e,disabled:A,handleModeSelect:t}){const[n,i]=p.useReducer(a=>!a,!1),r=p.useRef(null),o=UBA();function s(a){const{mode:g}=a.currentTarget.dataset;t(g)}return b.jsxs(b.Fragment,{children:[b.jsx(Bs,{"aria-label":"Remove channel",size:"small",onClick:i,ref:r,disabled:A,children:b.jsx(OM,{fontSize:"small"})}),b.jsx(Rw,{open:n,anchorEl:r.current,placement:"bottom-end",children:b.jsx(fo,{className:o.paper,children:b.jsx(th,{onClickAway:i,children:b.jsxs(hw,{id:"channel-options",children:[b.jsx(du,{dense:!0,disableGutters:!0,className:o.colors,children:b.jsx(TBA,{handleColorSelect:e})}),b.jsx(du,{"data-mode":"full",dense:!0,disableGutters:!0,onClick:s,children:b.jsx("span",{className:o.span,children:"Full"})}),b.jsx(du,{"data-mode":"max/min",dense:!0,disableGutters:!0,onClick:s,children:b.jsx("span",{className:o.span,children:"Max/Min"})})]})})})})]})}const HBA=[220,220,220],qBA=(e,A)=>`rgb(${e?HBA:A})`,JBA=(e,A,t)=>A?b.jsx(wM,{size:"50%"}):t&&(e||typeof e=="number")?Iw(e,7):V0;function OBA({name:e,onSelectionChange:A,channelsVisible:t,pixelValue:n,toggleIsOn:i,handleSliderChange:r,domain:o,slider:s,color:a,handleRemoveChannel:g,handleColorSelect:I,isLoading:l}){const c=Fi(),C=ve(N=>N.colormap),[u,E,B]=UA(N=>[N.channelOptions,N.useLinkedView,N.use3d],Ve),h=qBA(C,a),f=({domain:N,mode:M,loader:P})=>{switch(M){case"max/min":return N;case"full":{const{dtype:H}=P[0],{max:W}=P0[H];return[H.startsWith("Int")?-W:0,W]}default:throw new Error}},[Q,d]=p.useState("max/min"),[w,m]=f({domain:o,mode:Q,loader:c}),{dtype:v}=c[0],x=v==="Float32"||v==="Float64",D=m-w<500&&x?(m-w)/500:1,F=!E&&!B;return b.jsxs(re,{container:!0,direction:"column",m:2,justifyContent:"center",children:[b.jsxs(re,{container:!0,direction:"row",justifyContent:"space-between",children:[b.jsx(re,{item:!0,xs:10,children:b.jsx(Dg,{native:!0,value:e,onChange:A,children:u.map(N=>b.jsx("option",{disabled:l,value:N,children:N},N))})}),b.jsx(re,{item:!0,xs:1,children:b.jsx(PBA,{handleColorSelect:I,disabled:l,handleModeSelect:d})}),b.jsx(re,{item:!0,xs:1,children:b.jsx(Bs,{"aria-label":"remove-channel",component:"span",size:"small",onClick:g,children:b.jsx(JM,{fontSize:"small"})})})]}),b.jsxs(re,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[b.jsx(re,{item:!0,xs:2,children:JBA(n,l,F)}),b.jsx(re,{item:!0,xs:2,children:b.jsx(Bw,{onChange:i,disabled:l,checked:t,style:{color:h,"&$checked":{color:h}}})}),b.jsx(re,{item:!0,xs:7,children:b.jsx(Ew,{disabled:l,value:s,onChange:r,valueLabelDisplay:"auto",getAriaLabel:()=>`${e}-${a}-${s}`,valueLabelFormat:N=>Iw(N,5),min:w,max:m,step:D,orientation:"horizontal",style:{color:h,marginTop:"7px"}})})]})]})}var YBA=_4(rr(N4,U4,A8,u8,v8,f8,D8,k8,Cy,AH)),KBA=lJ("div")(YBA,{name:"MuiBox"});const tp=KBA;var VBA=function(A){return{root:k({color:A.palette.text.secondary},A.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:A.palette.primary.main},"&$disabled":{color:A.palette.text.disabled},"&$error":{color:A.palette.error.main}}),colorSecondary:{"&$focused":{color:A.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:A.palette.error.main}}}},WBA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className;A.color;var o=A.component,s=o===void 0?"label":o;A.disabled,A.error,A.filled,A.focused,A.required;var a=xA(A,["children","classes","className","color","component","disabled","error","filled","focused","required"]),g=vg(),I=Sg({props:A,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]});return p.createElement(s,k({className:vA(i.root,i["color".concat(De(I.color||"primary"))],r,I.disabled&&i.disabled,I.error&&i.error,I.filled&&i.filled,I.focused&&i.focused,I.required&&i.required),ref:t},a),n,I.required&&p.createElement("span",{"aria-hidden":!0,className:vA(i.asterisk,I.error&&i.error)}," ","*"))});const zBA=se(VBA,{name:"MuiFormLabel"})(WBA);var jBA=function(A){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:A.transitions.create(["color","transform"],{duration:A.transitions.duration.shorter,easing:A.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}},XBA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.disableAnimation,o=r===void 0?!1:r;A.margin;var s=A.shrink;A.variant;var a=xA(A,["classes","className","disableAnimation","margin","shrink","variant"]),g=vg(),I=s;typeof I>"u"&&g&&(I=g.filled||g.focused||g.adornedStart);var l=Sg({props:A,muiFormControl:g,states:["margin","variant"]});return p.createElement(zBA,k({"data-shrink":I,className:vA(n.root,i,g&&n.formControl,!o&&n.animated,I&&n.shrink,l.margin==="dense"&&n.marginDense,{filled:n.filled,outlined:n.outlined}[l.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:t},a))});const Fw=se(jBA,{name:"MuiInputLabel"})(XBA);var ZBA={root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},$BA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className,o=A.color,s=o===void 0?"primary":o,a=A.component,g=a===void 0?"div":a,I=A.disabled,l=I===void 0?!1:I,c=A.error,C=c===void 0?!1:c,u=A.fullWidth,E=u===void 0?!1:u,B=A.focused,h=A.hiddenLabel,f=h===void 0?!1:h,Q=A.margin,d=Q===void 0?"none":Q,w=A.required,m=w===void 0?!1:w,v=A.size,x=A.variant,D=x===void 0?"standard":x,F=xA(A,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),N=p.useState(function(){var nA=!1;return n&&p.Children.forEach(n,function(IA){if(WI(IA,["Input","Select"])){var aA=WI(IA,["Select"])?IA.props.input:IA;aA&&nuA(aA.props)&&(nA=!0)}}),nA}),M=N[0],P=N[1],H=p.useState(function(){var nA=!1;return n&&p.Children.forEach(n,function(IA){WI(IA,["Input","Select"])&&fw(IA.props,!0)&&(nA=!0)}),nA}),W=H[0],J=H[1],Z=p.useState(!1),z=Z[0],O=Z[1],Y=B!==void 0?B:z;l&&Y&&O(!1);var T,q=p.useCallback(function(){J(!0)},[]),j=p.useCallback(function(){J(!1)},[]),AA={adornedStart:M,setAdornedStart:P,color:s,disabled:l,error:C,filled:W,focused:Y,fullWidth:E,hiddenLabel:f,margin:(v==="small"?"dense":void 0)||d,onBlur:function(){O(!1)},onEmpty:j,onFilled:q,onFocus:function(){O(!0)},registerEffect:T,required:m,variant:D};return p.createElement(uw.Provider,{value:AA},p.createElement(g,k({className:vA(i.root,r,d!=="none"&&i["margin".concat(De(d))],E&&i.fullWidth),ref:t},F),n))});const Nw=se(ZBA,{name:"MuiFormControl"})($BA);var AEA=function(A){return{root:k({color:A.palette.text.secondary},A.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:A.palette.text.disabled},"&$error":{color:A.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}},eEA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className,o=A.component,s=o===void 0?"p":o;A.disabled,A.error,A.filled,A.focused,A.margin,A.required,A.variant;var a=xA(A,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"]),g=vg(),I=Sg({props:A,muiFormControl:g,states:["variant","margin","disabled","error","filled","focused","required"]});return p.createElement(s,k({className:vA(i.root,(I.variant==="filled"||I.variant==="outlined")&&i.contained,r,I.disabled&&i.disabled,I.error&&i.error,I.filled&&i.filled,I.focused&&i.focused,I.required&&i.required,I.margin==="dense"&&i.marginDense),ref:t},a),n===" "?p.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):n)});const tEA=se(AEA,{name:"MuiFormHelperText"})(eEA);var nEA={standard:dw,filled:kM,outlined:TM},iEA={root:{}},rEA=p.forwardRef(function(A,t){var n=A.autoComplete,i=A.autoFocus,r=i===void 0?!1:i,o=A.children,s=A.classes,a=A.className,g=A.color,I=g===void 0?"primary":g,l=A.defaultValue,c=A.disabled,C=c===void 0?!1:c,u=A.error,E=u===void 0?!1:u,B=A.FormHelperTextProps,h=A.fullWidth,f=h===void 0?!1:h,Q=A.helperText,d=A.hiddenLabel,w=A.id,m=A.InputLabelProps,v=A.inputProps,x=A.InputProps,D=A.inputRef,F=A.label,N=A.multiline,M=N===void 0?!1:N,P=A.name,H=A.onBlur,W=A.onChange,J=A.onFocus,Z=A.placeholder,z=A.required,O=z===void 0?!1:z,Y=A.rows,T=A.rowsMax,q=A.maxRows,j=A.minRows,AA=A.select,nA=AA===void 0?!1:AA,IA=A.SelectProps,aA=A.type,BA=A.value,lA=A.variant,MA=lA===void 0?"standard":lA,EA=xA(A,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","maxRows","minRows","select","SelectProps","type","value","variant"]),pA={};if(MA==="outlined"&&(m&&typeof m.shrink<"u"&&(pA.notched=m.shrink),F)){var qA,NA=(qA=m==null?void 0:m.required)!==null&&qA!==void 0?qA:O;pA.label=p.createElement(p.Fragment,null,F,NA&&" *")}nA&&((!IA||!IA.native)&&(pA.id=void 0),pA["aria-describedby"]=void 0);var JA=Q&&w?"".concat(w,"-helper-text"):void 0,dA=F&&w?"".concat(w,"-label"):void 0,GA=nEA[MA],ie=p.createElement(GA,k({"aria-describedby":JA,autoComplete:n,autoFocus:r,defaultValue:l,fullWidth:f,multiline:M,name:P,rows:Y,rowsMax:T,maxRows:q,minRows:j,type:aA,value:BA,id:w,inputRef:D,onBlur:H,onChange:W,onFocus:J,placeholder:Z,inputProps:v},pA,x));return p.createElement(Nw,k({className:vA(s.root,a),disabled:C,error:E,fullWidth:f,hiddenLabel:d,ref:t,required:O,color:I,variant:MA},EA),F&&p.createElement(Fw,k({htmlFor:w,id:dA},m),F),nA?p.createElement(Dg,k({"aria-describedby":JA,id:w,labelId:dA,value:BA,input:ie},IA),o):ie,Q&&p.createElement(tEA,k({id:JA},B),Q))});const oEA=se(iEA,{name:"MuiTextField"})(rEA);var _w={},sEA=Qo,aEA=po;Object.defineProperty(_w,"__esModule",{value:!0});var sT=_w.default=void 0,gEA=aEA(p),IEA=sEA(yo()),lEA=(0,IEA.default)(gEA.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");sT=_w.default=lEA;var cEA=function(A){return{root:k({},A.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:A.shape.borderRadius,color:A.palette.text.primary,transition:A.transitions.create(["background-color","box-shadow","border"],{duration:A.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:mt(A.palette.text.primary,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:A.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:A.palette.primary.main,"&:hover":{backgroundColor:mt(A.palette.primary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:A.palette.secondary.main,"&:hover":{backgroundColor:mt(A.palette.secondary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat(A.palette.type==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(A.palette.action.disabledBackground)}},outlinedPrimary:{color:A.palette.primary.main,border:"1px solid ".concat(mt(A.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(A.palette.primary.main),backgroundColor:mt(A.palette.primary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:A.palette.secondary.main,border:"1px solid ".concat(mt(A.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(A.palette.secondary.main),backgroundColor:mt(A.palette.secondary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(A.palette.action.disabled)}},contained:{color:A.palette.getContrastText(A.palette.grey[300]),backgroundColor:A.palette.grey[300],boxShadow:A.shadows[2],"&:hover":{backgroundColor:A.palette.grey.A100,boxShadow:A.shadows[4],"@media (hover: none)":{boxShadow:A.shadows[2],backgroundColor:A.palette.grey[300]},"&$disabled":{backgroundColor:A.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:A.shadows[6]},"&:active":{boxShadow:A.shadows[8]},"&$disabled":{color:A.palette.action.disabled,boxShadow:A.shadows[0],backgroundColor:A.palette.action.disabledBackground}},containedPrimary:{color:A.palette.primary.contrastText,backgroundColor:A.palette.primary.main,"&:hover":{backgroundColor:A.palette.primary.dark,"@media (hover: none)":{backgroundColor:A.palette.primary.main}}},containedSecondary:{color:A.palette.secondary.contrastText,backgroundColor:A.palette.secondary.main,"&:hover":{backgroundColor:A.palette.secondary.dark,"@media (hover: none)":{backgroundColor:A.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:A.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:A.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:A.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:A.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:A.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:A.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}},CEA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className,o=A.color,s=o===void 0?"default":o,a=A.component,g=a===void 0?"button":a,I=A.disabled,l=I===void 0?!1:I,c=A.disableElevation,C=c===void 0?!1:c,u=A.disableFocusRipple,E=u===void 0?!1:u,B=A.endIcon,h=A.focusVisibleClassName,f=A.fullWidth,Q=f===void 0?!1:f,d=A.size,w=d===void 0?"medium":d,m=A.startIcon,v=A.type,x=v===void 0?"button":v,D=A.variant,F=D===void 0?"text":D,N=xA(A,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),M=m&&p.createElement("span",{className:vA(i.startIcon,i["iconSize".concat(De(w))])},m),P=B&&p.createElement("span",{className:vA(i.endIcon,i["iconSize".concat(De(w))])},B);return p.createElement(Sc,k({className:vA(i.root,i[F],r,s==="inherit"?i.colorInherit:s!=="default"&&i["".concat(F).concat(De(s))],w!=="medium"&&[i["".concat(F,"Size").concat(De(w))],i["size".concat(De(w))]],C&&i.disableElevation,l&&i.disabled,Q&&i.fullWidth),component:g,disabled:l,focusRipple:!E,focusVisibleClassName:vA(i.focusVisible,h),ref:t,type:x},N),p.createElement("span",{className:i.label},M,n,P))});const lr=se(cEA,{name:"MuiButton"})(CEA);var Lw={},uEA=Qo,BEA=po;Object.defineProperty(Lw,"__esModule",{value:!0});var aT=Lw.default=void 0,EEA=BEA(p),hEA=uEA(yo()),fEA=(0,hEA.default)(EEA.createElement("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");aT=Lw.default=fEA;var bw={},QEA=Qo,dEA=po;Object.defineProperty(bw,"__esModule",{value:!0});var gT=bw.default=void 0,pEA=dEA(p),yEA=QEA(yo()),mEA=(0,yEA.default)(pEA.createElement("path",{d:"M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.6-1.4-1.4-1.8-1.4-1.8-1-.7.1-.7.1-.7 1.2 0 1.9 1.2 1.9 1.2 1 1.8 2.8 1.3 3.5 1 0-.8.4-1.3.7-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.2.5-2.3 1.3-3.1-.2-.4-.6-1.6 0-3.2 0 0 1-.3 3.4 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.6.2 2.8 0 3.2.9.8 1.3 1.9 1.3 3.2 0 4.6-2.8 5.6-5.5 5.9.5.4.9 1 .9 2.2v3.3c0 .3.1.7.8.6A12 12 0 0 0 12 .3"}),"GitHub");gT=bw.default=mEA;var Gw={},wEA=Qo,vEA=po;Object.defineProperty(Gw,"__esModule",{value:!0});var IT=Gw.default=void 0,SEA=vEA(p),DEA=wEA(yo()),REA=(0,DEA.default)(SEA.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");IT=Gw.default=REA;const xEA={marginRight:"4.5px",marginTop:"3px"};function FEA(){const e=UA(A=>A.toggleIsControllerOn);return b.jsxs(re,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",children:[b.jsx(re,{style:{marginRight:"auto"},item:!0,children:b.jsx(Es,{variant:"body1",children:b.jsx("strong",{children:"AVIVATOR"})})}),b.jsx(re,{item:!0,children:b.jsx(Bs,{href:"https://github.com/hms-dbmi/viv","aria-label":"GitHub Repository",disableRipple:!0,children:b.jsx(gT,{})})}),b.jsx(re,{item:!0,children:b.jsx(Bs,{size:"small",onClick:e,disableRipple:!0,"aria-label":"hide-menu",style:xEA,children:b.jsx(IT,{fontSize:"small"})})})]})}function NEA(){const{getRootProps:e,getInputProps:A}=BM();return b.jsxs(lr,{fullWidth:!0,variant:"outlined",style:{borderStyle:"dashed",backgroundColor:"transparent",height:"2rem"},size:"small",...e(),children:[b.jsx("input",{...A({accept:".tif, .tiff"})}),"Choose a file"]})}const lT=ys(e=>({root:{maxHeight:A=>`${A.maxHeight-e.spacing(4)}px`,width:"365px",overflowX:"hidden",overflowY:"scroll","&::-webkit-scrollbar":{display:"none",background:"transparent"},scrollbarWidth:"none"},typography:{fontSize:".8rem"},paper:{paddingBottom:e.spacing(2),paddingRight:e.spacing(2),paddingLeft:e.spacing(2),backgroundColor:"rgba(0, 0, 0, 0.75)",borderRadius:2},item:{width:"100%"},divider:{paddingBottom:e.spacing(1),paddingTop:e.spacing(2)}}));function _EA(e){const A=bn(C=>C.image),[t,n]=UA(C=>[C.source,C.metadata]),i=(C,u)=>{C.preventDefault();const E={urlOrFile:u,description:cM(u)};UA.setState({source:E})},r=C=>bn.setState({image:C.target.value}),o=typeof t.urlOrFile=="string"?t.urlOrFile:"",[s,a]=p.useState(o),[g,I]=p.useReducer(C=>!C,!1),l=p.useRef(null),c=lT(e);return p.useEffect(()=>a(o),[o]),b.jsxs(re,{container:!0,direction:"column",spacing:0,children:[b.jsx(re,{item:!0,xs:12,children:b.jsx(FEA,{})}),b.jsxs(re,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[b.jsxs(re,{item:!0,xs:1,children:[b.jsx(sT,{onClick:I,ref:l}),b.jsx(Rw,{open:g,anchorEl:l.current,placement:"bottom-start",style:{width:"25%"},children:b.jsx(fo,{style:{padding:8},children:b.jsx(th,{onClickAway:I,children:b.jsxs(Es,{className:c.typography,children:["Provide a URL to an OME-TIFF file or a Bio-Formats Zarr store to view the image. View the"," ",b.jsx(sh,{target:"_blank",rel:"noopener noreferrer",href:"http://viv.gehlenborglab.org",children:"docs"})," ","to learn more about the supported file formats."]})})})})]}),b.jsx(re,{item:!0,xs:11,children:b.jsx("form",{onSubmit:C=>{i(C,s)},children:b.jsx(oEA,{id:"ome-input",label:"OME-TIFF/Bioformats-Zarr URL",variant:"filled",size:"small",fullWidth:!0,value:s,onChange:C=>a(C.target.value)})})})]}),!mIA()&&b.jsx(re,{item:!0,xs:12,style:{paddingTop:16},children:b.jsx(NEA,{})}),Array.isArray(n)&&b.jsx(re,{item:!0,xs:12,children:b.jsx(Dg,{native:!0,value:A,onChange:r,children:n.map((C,u)=>b.jsx("option",{value:u,children:C.Name},C.Name))})}),b.jsx(re,{item:!0,xs:12,className:c.divider,children:b.jsx(Z0,{})})]})}function LEA({children:e,...A}){const t=lT(A),[n,i]=UA(r=>[r.isControllerOn,r.toggleIsControllerOn],Ve);return n?b.jsx(tp,{position:"absolute",right:0,top:0,m:1,className:t.root,children:b.jsxs(fo,{className:t.paper,children:[b.jsx(_EA,{}),b.jsx(re,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:e.map((r,o)=>b.jsx(re,{item:!0,className:t.item,children:r},o))})]})}):b.jsx(tp,{position:"absolute",right:-8,top:-8,m:2,children:b.jsx(lr,{variant:"outlined",color:"default",size:"small",endIcon:b.jsx(aT,{}),onClick:i,"aria-label":"show-menu",children:"AVIVATOR"})})}function bEA(){const e=ve(t=>t.colormap),A=UA(t=>t.isViewerLoading);return b.jsxs(Nw,{fullWidth:!0,children:[b.jsxs(Fw,{htmlFor:"colormap-select",children:["Additive ",e===""?" Blending":"Color Mapping"]}),b.jsxs(Dg,{native:!0,onChange:t=>ve.setState({colormap:t.target.value}),value:e,inputProps:{name:"colormap",id:"colormap-select"},disabled:A,children:[b.jsx("option",{"aria-label":"None",value:""}),sIA.map(t=>b.jsx("option",{value:t,children:t},t))]})]})}function GEA(e){const{size:A,label:t}=e,[n,i]=bn(a=>[a.selections,a.setPropertiesForChannel],Ve),r=Fi(),o=UA(a=>a.globalSelection),s=p.useCallback(mM((a,g)=>{UA.setState({isChannelLoading:n.map(()=>!0)});const I=[...n].map(l=>({...l,[t]:g}));qB({loader:r,selections:I,use3d:!1}).then(({domains:l,contrastLimits:c})=>{Vt.unstable_batchedUpdates(()=>{VI(I.length).forEach((C,u)=>i(C,{domains:l[u],contrastLimits:c[u]}))}),Vt.unstable_batchedUpdates(()=>{ve.setState({onViewportLoad:()=>{ve.setState({onViewportLoad:()=>{}}),UA.setState({isChannelLoading:n.map(()=>!1)})}}),VI(I.length).forEach((C,u)=>i(C,{selections:I[u]}))})})},50,{trailing:!0}),[r,n]);return b.jsxs(re,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[b.jsxs(re,{item:!0,xs:1,children:[t,":"]}),b.jsx(re,{item:!0,xs:11,children:b.jsx(Ew,{value:o[t],onChange:(a,g)=>{UA.setState({globalSelection:{...o,[t]:g}}),a.type==="keydown"&&s(a,g)},onChangeCommitted:s,valueLabelDisplay:"auto",getAriaLabel:()=>`${t} slider`,marks:VI(A).map(a=>({value:a})),min:0,max:A,orientation:"horizontal",style:{marginTop:"7px"},step:null})})]})}function kEA(){const e=bn(s=>s.selections),[A,t,n]=ve(s=>[s.lensEnabled,s.toggleLensEnabled,s.lensSelection],Ve),i=UA(s=>s.channelOptions),r=e.map(s=>s.c),o=`rgb(${[255,255,255]})`;return b.jsxs(re,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[b.jsx(re,{item:!0,xs:2,children:"Lens:"}),b.jsx(re,{item:!0,xs:2,children:b.jsx(Bw,{onChange:t,checked:A,style:{color:o,"&$checked":{color:o}}})}),b.jsx(re,{item:!0,xs:7,children:b.jsx(Dg,{native:!0,value:n,onChange:s=>ve.setState({lensSelection:s.target.value}),children:r.map((s,a)=>b.jsx("option",{value:a,children:i[s]},i[s]+String(a)))})})]})}function MEA(e,A=2){if(e===0)return"0 Bytes";const t=1024,n=A<0?0:A,i=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(n))} ${i[r]}`}const cT=(e,A)=>{const{shape:t,labels:n}=e[A],i=t[n.indexOf("y")],r=t[n.indexOf("x")],o=t[n.indexOf("z")],s=Math.max(1,o>>A),a=4*i*r*s;return{height:i,width:r,depthDownsampled:s,totalBytes:a}},YF=(e,A)=>{var a,g,I;const{totalBytes:t,height:n,width:i,depthDownsampled:r}=cT(e,A),s=((a=window.performance)==null?void 0:a.memory)&&((I=(g=window.performance)==null?void 0:g.memory)==null?void 0:I.jsHeapSizeLimit)/2||2**31-1;return t1},TEA=ys(()=>({paper:{backgroundColor:"rgba(0, 0, 0, 1)"},span:{width:"70px",textAlign:"center",paddingLeft:"2px",paddingRight:"2px"},colors:{"&:hover":{backgroundColor:"transparent"},paddingLeft:"2px",paddingRight:"2px"}}));function UEA(){const[e,A]=bn(u=>[u.selections,u.setPropertiesForChannel],Ve),t=Fi(),[n,i,r,o]=UA(u=>[u.use3d,u.toggleUse3d,u.toggleIsVolumeRenderingWarningOn,u.isViewerLoading],Ve),[s,a]=p.useReducer(u=>!u,!1),g=p.useRef(null),I=TEA(),{shape:l,labels:c}=Array.isArray(t)?t[0]:t,C=Array.from({length:t.length}).filter((u,E)=>YF(t,E)).length;return b.jsxs(b.Fragment,{children:[b.jsxs(lr,{variant:"outlined",size:"small",ref:g,disabled:!(l[c.indexOf("z")]>1)||o||!C,onClick:()=>{a(),n&&(i(),UA.setState({isChannelLoading:Array(e.length).fill(!0)}),qB({loader:t,selections:e,use3d:!n}).then(({domains:u,contrastLimits:E})=>{VI(e.length).forEach((B,h)=>A(B,{domains:u[h],contrastLimits:E[h]})),UA.setState({isChannelLoading:Array(e.length).fill(!1)})}))},fullWidth:!0,children:[n?"Hide":"Show"," Volumetric Rendering"]}),b.jsx(Rw,{open:s,anchorEl:g.current,placement:"bottom-end",children:b.jsx(fo,{className:I.paper,children:b.jsx(th,{onClickAway:a,children:b.jsx(hw,{id:"resolution-options",children:Array.from({length:t.length}).fill(0).map((u,E)=>{if(t&&YF(t,E)){const{height:B,width:h,depthDownsampled:f,totalBytes:Q}=cT(t,E);return b.jsx(du,{dense:!0,disableGutters:!0,onClick:()=>{UA.setState({isChannelLoading:Array(e.length).fill(!0)});const[d,w,m]=lw(t);ve.setState({resolution:E,xSlice:d,ySlice:w,zSlice:m}),a(),qB({loader:t,selections:e,use3d:!0}).then(({domains:v,contrastLimits:x})=>{VI(e.length).forEach((F,N)=>A(F,{domains:v[N],contrastLimits:x[N]})),ve.setState({onViewportLoad:()=>{ve.setState({onViewportLoad:()=>{}}),UA.setState({isChannelLoading:Array(e.length).fill(!1)})}}),i(),!!document.createElement("canvas").getContext("webgl2")||r()})},children:`${E}x Downsampled, ~${MEA(Q)} per channel, (${B}, ${h}, ${f})`},`(${B}, ${h}, ${f})`)}return null})})})})})]})}const KF=Object.values(Na);function PEA(){const e=ve(i=>i.renderingMode),[A,t]=UA(i=>[i.isViewerLoading,i.use3d],Ve),n=t?KF:[...KF,""];return b.jsxs(Nw,{fullWidth:!0,children:[b.jsx(Fw,{htmlFor:"rendering-mode-select",children:"Rendering Mode"}),b.jsx(Dg,{native:!0,onChange:i=>ve.setState({renderingMode:i.target.value}),value:t?e:"",inputProps:{name:"rendering-mode",id:"rendering-mode-select"},disabled:A||!t,children:n.map(i=>b.jsx("option",{value:i,children:i},i))})]})}const HEA=ys(e=>U_({enabled:{},disabled:{color:e.palette.text.disabled,"& .MuiSlider-thumb":{color:"rgb(100, 100, 100, 1.0)"},"& .MuiSlider-track":{color:"rgb(100, 100, 100, 1.0)"}}})),qEA=()=>{const[e,A,t]=ve(l=>[l.xSlice,l.ySlice,l.zSlice],Ve),n=Fi(),i=UA(l=>l.use3d),[r,o,s]=lw(n),a=[[e,l=>ve.setState({xSlice:l}),"x",r],[A,l=>ve.setState({ySlice:l}),"y",o],[t,l=>ve.setState({zSlice:l}),"z",s]],g=HEA(),I=a.map(([l,c,C,[u,E]])=>b.jsxs(re,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[b.jsx(re,{item:!0,xs:1,style:{marginBottom:8},children:b.jsxs(Es,{className:i?g.enabled:g.disabled,style:{marginTop:4},children:[C,":"]})}),b.jsx(re,{item:!0,xs:11,children:b.jsx(Ew,{disabled:!i,className:i?g.enabled:g.disabled,value:l,onChange:(B,h)=>c(h),valueLabelDisplay:"auto",valueLabelFormat:B=>Iw(B,5),getAriaLabel:()=>`${C} slider`,min:u,max:E,step:.005,orientation:"horizontal"})})]},C));return b.jsxs(b.Fragment,{children:[b.jsxs(Es,{className:i?g.enabled:g.disabled,style:{marginTop:16},children:["Clipping Planes:"," "]})," ",I]})},JEA=qEA;var kw={},OEA=Qo,YEA=po;Object.defineProperty(kw,"__esModule",{value:!0});var CT=kw.default=void 0,KEA=YEA(p),VEA=OEA(yo()),WEA=(0,VEA.default)(KEA.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");CT=kw.default=WEA;const zEA=()=>{const[e,A,t,n,i]=UA(c=>[c.globalSelection,c.isViewerLoading,c.use3d,c.setIsChannelLoading,c.addIsChannelLoading],Ve),[r,o,s]=bn(c=>[c.selections,c.addChannel,c.setPropertiesForChannel],Ve),a=Fi(),g=iw(),{labels:I}=a[0],l=p.useCallback(()=>{let c=Object.fromEntries(I.map(u=>[u,0]));c={...c,...e};const C=r.length;gw({loader:a,selection:c,use3d:t}).then(({domain:u,contrastLimits:E})=>{s(C,{domains:u,contrastLimits:E,channelsVisible:!0}),ve.setState({onViewportLoad:()=>{ve.setState({onViewportLoad:()=>{}}),n(C,!1)}}),i(!0);const{Pixels:{Channels:B}}=g,{c:h}=c;o({selections:c,ids:String(Math.random()),channelsVisible:!1,colors:(B[h].Color&&B[h].Color.slice(0,-1))??(ow[h]||[255,255,255])})})},[I,a,e,t,o,i,r,n,s,g]);return b.jsx(lr,{disabled:r.length===rIA||A,onClick:l,fullWidth:!0,variant:"outlined",style:{borderStyle:"dashed"},startIcon:b.jsx(CT,{}),size:"small",children:"Add Channel"})},jEA=zEA,XEA=()=>{const[e,A]=ve(n=>[n.togglePanLock,n.panLock],Ve),t=UA(n=>n.isViewerLoading);return b.jsxs(lr,{disabled:t,onClick:e,variant:"outlined",size:"small",fullWidth:!0,children:[A?"Unlock":"Lock"," Pan"]})},ZEA=XEA,$EA=()=>{const[e,A]=ve(n=>[n.toggleZoomLock,n.zoomLock],Ve),t=UA(n=>n.isViewerLoading);return b.jsxs(lr,{disabled:t,onClick:e,variant:"outlined",size:"small",fullWidth:!0,children:[A?"Unlock":"Lock"," Zoom"]})},AhA=$EA,ehA=()=>{const e=ve(r=>r.isOverviewOn),[A,t,n,i]=UA(r=>[r.isViewerLoading,r.toggleUseLinkedView,r.useLinkedView,r.use3d],Ve);return b.jsxs(lr,{disabled:A||e||i,onClick:t,variant:"outlined",size:"small",fullWidth:!0,children:[n?"Hide":"Show"," Side-by-Side"]})},thA=ehA,nhA=()=>{const[e,A]=ve(r=>[r.isOverviewOn,r.toggleIsOverviewOn],Ve),[t,n,i]=UA(r=>[r.isViewerLoading,r.useLinkedView,r.use3d],Ve);return b.jsxs(lr,{disabled:t||n||i,onClick:A,variant:"outlined",size:"small",fullWidth:!0,children:[e?"Hide":"Show"," Picture-In-Picture"]})},ihA=nhA,rhA=ys(e=>U_({enabled:{marginLeft:"4px"},disabled:{color:e.palette.text.disabled,marginLeft:"4px"}})),ohA=()=>{const e=Fi(),[A,t]=ve(I=>[I.useFixedAxis,I.toggleUseFixedAxis],Ve),[n,i]=UA(I=>[I.viewState,I.use3d]),{height:r,width:o}=aw(),s=rhA(),a=b.jsx(re,{item:!0,xs:"auto",children:b.jsxs(re,{container:!0,direction:"row",children:[b.jsx(Bw,{onClick:t,style:{padding:0},disabled:!i,checked:A}),b.jsx(Es,{className:i?s.enabled:s.disabled,children:"Fix Camera Axis"})]})},"toggle-fixed-axis"),g=b.jsx(re,{item:!0,xs:"auto",children:b.jsx(lr,{onClick:()=>UA.setState({viewState:{...n,...eh(e,{height:r,width:o},1,!0),rotationX:0,rotationOrbit:0}}),disabled:!i,style:{padding:0},children:"Re-Center"})},"recenter");return b.jsx(re,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",style:{marginTop:16},children:[a,g]})},shA=ohA;function VF(e){const{children:A,value:t,index:n,...i}=e;return b.jsx("div",{role:"tabpanel",hidden:t!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`,...i,children:t===n&&A})}const ahA=()=>{const[e,A,t,n,i,r,o,s,a]=bn(J=>[J.channelsVisible,J.contrastLimits,J.colors,J.domains,J.selections,J.ids,J.setPropertiesForChannel,J.toggleIsOn,J.removeChannel],Ve),g=Fi(),I=ve(J=>J.colormap),[l,c,C,u,E,B,h,f,Q,d]=UA(J=>[J.channelOptions,J.useLinkedView,J.use3d,J.useColormap,J.useLens,J.isChannelLoading,J.setIsChannelLoading,J.removeIsChannelLoading,J.pixelValues,J.isViewerLoading],Ve),w=iw(),m=aw(),v=w&&uM(w),{shape:x,labels:D}=g[0],F=D.filter(J=>sw.includes(J)),N=r.map((J,Z)=>{const z=AA=>{const nA={...i[Z],c:l.indexOf(AA.target.value)};h(Z,!0),gw({loader:g,selection:nA,use3d:C}).then(({domain:IA,contrastLimits:aA})=>{const{Pixels:{Channels:BA}}=w,{c:lA}=nA,MA={contrastLimits:aA,domains:IA};BA[lA].Color&&(MA.colors=BA[lA].Color.slice(0,-1)),o(Z,MA),ve.setState({onViewportLoad:()=>{ve.setState({onViewportLoad:()=>{}}),h(Z,!1)}}),o(Z,{selections:nA})})},O=()=>s(Z),Y=(AA,nA)=>o(Z,{contrastLimits:nA}),T=()=>{a(Z),f(Z)},q=AA=>{o(Z,{colors:AA})},j=l[i[Z].c];return b.jsx(re,{style:{width:"100%"},item:!0,children:b.jsx(OBA,{name:j,onSelectionChange:z,channelsVisible:e[Z],pixelValue:Q[Z],toggleIsOn:O,handleSliderChange:Y,domain:n[Z],slider:A[Z],color:t[Z],handleRemoveChannel:T,handleColorSelect:q,isLoading:B[Z]})},`channel-controller-${j}-${J}`)}),M=F.map(J=>{const Z=x[D.indexOf(J)];return Z>1?b.jsx(GEA,{size:Z,label:J},J):null}),[P,H]=p.useState(0),W=(J,Z)=>{H(Z)};return b.jsxs(LEA,{maxHeight:m.height,children:[b.jsxs(rCA,{value:P,onChange:W,"aria-label":"simple tabs example",style:{height:"24px",minHeight:"24px"},children:[b.jsx(yF,{label:"Channels",style:{fontSize:".75rem",bottom:12}}),b.jsx(yF,{label:"Volume",style:{fontSize:".75rem",bottom:12}})]}),b.jsx(Z0,{}),b.jsxs(VF,{value:P,index:0,children:[u&&b.jsx(bEA,{}),E&&!I&&!C&&x[D.indexOf("c")]>1&&b.jsx(kEA,{channelOptions:i.map(J=>l[J.c])}),!C&&M,!d&&!v?b.jsx(re,{container:!0,children:N}):b.jsx(re,{container:!0,justifyContent:"center",children:!v&&b.jsx(wM,{})}),!v&&b.jsx(jEA,{})]}),b.jsxs(VF,{value:P,index:1,children:[b.jsx(PEA,{}),b.jsx(JEA,{}),b.jsx(shA,{})]}),b.jsx(Z0,{style:{marginTop:"8px",marginBottom:"8px"}}),b.jsx(UEA,{}),b.jsx(ihA,{}),b.jsx(thA,{}),c&&!C&&b.jsxs(b.Fragment,{children:[b.jsx(AhA,{}),b.jsx(ZEA,{})]})]})},ghA=ahA;function IhA({children:e}){const{getRootProps:A,getInputProps:t}=BM();return b.jsxs("div",{...A({onClick:n=>n.stopPropagation()}),children:[b.jsx("input",{...t()}),e]})}const lhA=ys(e=>({typography:{fontSize:".8rem"},paper:{paddingRight:e.spacing(1),paddingLeft:e.spacing(1),backgroundColor:"rgba(0, 0, 0, 0.75)",borderRadius:2}}));function chA(e,A,t){return`${e}/${A} [${t.join(", ")}]`}function ChA(){const e=lhA(),[A,t]=UA(s=>[s.use3d,s.pyramidResolution],Ve),n=Fi(),i=ve(s=>s.resolution),r=A?i:t,o=n[r];return o?b.jsx(tp,{style:{position:"fixed",marginTop:"calc(5% + 60px)",bottom:0},children:b.jsx(fo,{className:e.paper,children:b.jsx(Es,{className:e.typography,children:chA(r+1,n.length,o.shape)})})}):null}function WF(e){const{history:A,source:t,isDemoImage:n}=e,i=UA(s=>s.isViewerLoading),r=UA(s=>s.source),o=UA(s=>s.useLinkedView);return p.useEffect(()=>{UA.setState({source:t,isNoImageUrlSnackbarOn:n})},[]),SIA(r,A),b.jsxs(b.Fragment,{children:[b.jsx(IhA,{children:!i&&b.jsx(LcA,{})}),b.jsx(ghA,{}),b.jsx(_lA,{}),!o&&b.jsx(ChA,{})]})}const zF=d_({palette:{type:"dark",primary:Cl,secondary:Cl},props:{MuiButtonBase:{disableRipple:!0}}});function uhA(){return YS[Math.floor(Math.random()*YS.length)]}function BhA(){return new URLSearchParams(LP().search)}function EhA(e){const t=BhA().get("image_url"),{routeProps:{history:n}}=e;if(t){const r={urlOrFile:t,description:cM(t)};return b.jsx(OS,{theme:zF,children:b.jsx(WF,{source:r,history:n})})}const i=uhA();return b.jsx(OS,{theme:zF,children:b.jsx(WF,{source:i,history:n,isDemoImage:!0})})}gI.render(b.jsx(bP,{children:b.jsx(NP,{children:b.jsx(RP,{path:"/",render:e=>b.jsx(EhA,{routeProps:e})})})}),document.getElementById("root"));export{UeA as B,GhA as L,khA as a,Gn as g}; + */var Dc=typeof window<"u"&&typeof document<"u"&&typeof navigator<"u",TuA=function(){for(var e=["Edge","Trident","Firefox"],A=0;A=0)return 1;return 0}();function UuA(e){var A=!1;return function(){A||(A=!0,window.Promise.resolve().then(function(){A=!1,e()}))}}function PuA(e){var A=!1;return function(){A||(A=!0,setTimeout(function(){A=!1,e()},TuA))}}var HuA=Dc&&window.Promise,quA=HuA?UuA:PuA;function YM(e){var A={};return e&&A.toString.call(e)==="[object Function]"}function Fs(e,A){if(e.nodeType!==1)return[];var t=e.ownerDocument.defaultView,n=t.getComputedStyle(e,null);return A?n[A]:n}function mw(e){return e.nodeName==="HTML"?e:e.parentNode||e.host}function Rc(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var A=Fs(e),t=A.overflow,n=A.overflowX,i=A.overflowY;return/(auto|scroll|overlay)/.test(t+i+n)?e:Rc(mw(e))}function KM(e){return e&&e.referenceNode?e.referenceNode:e}var UF=Dc&&!!(window.MSInputMethodContext&&document.documentMode),PF=Dc&&/MSIE 10/.test(navigator.userAgent);function Rg(e){return e===11?UF:e===10?PF:UF||PF}function Wa(e){if(!e)return document.documentElement;for(var A=Rg(10)?document.body:null,t=e.offsetParent||null;t===A&&e.nextElementSibling;)t=(e=e.nextElementSibling).offsetParent;var n=t&&t.nodeName;return!n||n==="BODY"||n==="HTML"?e?e.ownerDocument.documentElement:document.documentElement:["TH","TD","TABLE"].indexOf(t.nodeName)!==-1&&Fs(t,"position")==="static"?Wa(t):t}function JuA(e){var A=e.nodeName;return A==="BODY"?!1:A==="HTML"||Wa(e.firstElementChild)===e}function $0(e){return e.parentNode!==null?$0(e.parentNode):e}function OB(e,A){if(!e||!e.nodeType||!A||!A.nodeType)return document.documentElement;var t=e.compareDocumentPosition(A)&Node.DOCUMENT_POSITION_FOLLOWING,n=t?e:A,i=t?A:e,r=document.createRange();r.setStart(n,0),r.setEnd(i,0);var o=r.commonAncestorContainer;if(e!==o&&A!==o||n.contains(i))return JuA(o)?o:Wa(o);var s=$0(e);return s.host?OB(s.host,A):OB(e,$0(A).host)}function za(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"top",t=A==="top"?"scrollTop":"scrollLeft",n=e.nodeName;if(n==="BODY"||n==="HTML"){var i=e.ownerDocument.documentElement,r=e.ownerDocument.scrollingElement||i;return r[t]}return e[t]}function OuA(e,A){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=za(A,"top"),i=za(A,"left"),r=t?-1:1;return e.top+=n*r,e.bottom+=n*r,e.left+=i*r,e.right+=i*r,e}function HF(e,A){var t=A==="x"?"Left":"Top",n=t==="Left"?"Right":"Bottom";return parseFloat(e["border"+t+"Width"])+parseFloat(e["border"+n+"Width"])}function qF(e,A,t,n){return Math.max(A["offset"+e],A["scroll"+e],t["client"+e],t["offset"+e],t["scroll"+e],Rg(10)?parseInt(t["offset"+e])+parseInt(n["margin"+(e==="Height"?"Top":"Left")])+parseInt(n["margin"+(e==="Height"?"Bottom":"Right")]):0)}function VM(e){var A=e.body,t=e.documentElement,n=Rg(10)&&getComputedStyle(t);return{height:qF("Height",A,t,n),width:qF("Width",A,t,n)}}var YuA=function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")},KuA=function(){function e(A,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:!1,n=Rg(10),i=A.nodeName==="HTML",r=Ap(e),o=Ap(A),s=Rc(e),a=Fs(A),g=parseFloat(a.borderTopWidth),I=parseFloat(a.borderLeftWidth);t&&i&&(o.top=Math.max(o.top,0),o.left=Math.max(o.left,0));var l=Io({top:r.top-o.top-g,left:r.left-o.left-I,width:r.width,height:r.height});if(l.marginTop=0,l.marginLeft=0,!n&&i){var c=parseFloat(a.marginTop),C=parseFloat(a.marginLeft);l.top-=g-c,l.bottom-=g-c,l.left-=I-C,l.right-=I-C,l.marginTop=c,l.marginLeft=C}return(n&&!t?A.contains(s):A===s&&s.nodeName!=="BODY")&&(l=OuA(l,A)),l}function VuA(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=e.ownerDocument.documentElement,n=ww(e,t),i=Math.max(t.clientWidth,window.innerWidth||0),r=Math.max(t.clientHeight,window.innerHeight||0),o=A?0:za(t),s=A?0:za(t,"left"),a={top:o-n.top+n.marginTop,left:s-n.left+n.marginLeft,width:i,height:r};return Io(a)}function WM(e){var A=e.nodeName;if(A==="BODY"||A==="HTML")return!1;if(Fs(e,"position")==="fixed")return!0;var t=mw(e);return t?WM(t):!1}function zM(e){if(!e||!e.parentElement||Rg())return document.documentElement;for(var A=e.parentElement;A&&Fs(A,"transform")==="none";)A=A.parentElement;return A||document.documentElement}function vw(e,A,t,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,r={top:0,left:0},o=i?zM(e):OB(e,KM(A));if(n==="viewport")r=VuA(o,i);else{var s=void 0;n==="scrollParent"?(s=Rc(mw(A)),s.nodeName==="BODY"&&(s=e.ownerDocument.documentElement)):n==="window"?s=e.ownerDocument.documentElement:s=n;var a=ww(s,o,i);if(s.nodeName==="HTML"&&!WM(o)){var g=VM(e.ownerDocument),I=g.height,l=g.width;r.top+=a.top-a.marginTop,r.bottom=I+a.top,r.left+=a.left-a.marginLeft,r.right=l+a.left}else r=a}t=t||0;var c=typeof t=="number";return r.left+=c?t:t.left||0,r.top+=c?t:t.top||0,r.right-=c?t:t.right||0,r.bottom-=c?t:t.bottom||0,r}function WuA(e){var A=e.width,t=e.height;return A*t}function jM(e,A,t,n,i){var r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0;if(e.indexOf("auto")===-1)return e;var o=vw(t,n,r,i),s={top:{width:o.width,height:A.top-o.top},right:{width:o.right-A.right,height:o.height},bottom:{width:o.width,height:o.bottom-A.bottom},left:{width:A.left-o.left,height:o.height}},a=Object.keys(s).map(function(c){return vn({key:c},s[c],{area:WuA(s[c])})}).sort(function(c,C){return C.area-c.area}),g=a.filter(function(c){var C=c.width,u=c.height;return C>=t.clientWidth&&u>=t.clientHeight}),I=g.length>0?g[0].key:a[0].key,l=e.split("-")[1];return I+(l?"-"+l:"")}function XM(e,A,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,i=n?zM(A):OB(A,KM(t));return ww(t,i,n)}function ZM(e){var A=e.ownerDocument.defaultView,t=A.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),i=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0),r={width:e.offsetWidth+i,height:e.offsetHeight+n};return r}function YB(e){var A={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(t){return A[t]})}function $M(e,A,t){t=t.split("-")[0];var n=ZM(e),i={width:n.width,height:n.height},r=["right","left"].indexOf(t)!==-1,o=r?"top":"left",s=r?"left":"top",a=r?"height":"width",g=r?"width":"height";return i[o]=A[o]+A[a]/2-n[a]/2,t===s?i[s]=A[s]-n[g]:i[s]=A[YB(s)],i}function xc(e,A){return Array.prototype.find?e.find(A):e.filter(A)[0]}function zuA(e,A,t){if(Array.prototype.findIndex)return e.findIndex(function(i){return i[A]===t});var n=xc(e,function(i){return i[A]===t});return e.indexOf(n)}function AT(e,A,t){var n=t===void 0?e:e.slice(0,zuA(e,"name",t));return n.forEach(function(i){i.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var r=i.function||i.fn;i.enabled&&YM(r)&&(A.offsets.popper=Io(A.offsets.popper),A.offsets.reference=Io(A.offsets.reference),A=r(A,i))}),A}function juA(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=XM(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=jM(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=$M(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=AT(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function eT(e,A){return e.some(function(t){var n=t.name,i=t.enabled;return i&&n===A})}function Sw(e){for(var A=[!1,"ms","Webkit","Moz","O"],t=e.charAt(0).toUpperCase()+e.slice(1),n=0;no[C]&&(e.offsets.popper[l]+=s[l]+u-o[C]),e.offsets.popper=Io(e.offsets.popper);var E=s[l]+s[g]/2-u/2,B=Fs(e.instance.popper),h=parseFloat(B["margin"+I]),f=parseFloat(B["border"+I+"Width"]),Q=E-e.offsets.popper[l]-h-f;return Q=Math.max(Math.min(o[g]-u,Q),0),e.arrowElement=n,e.offsets.arrow=(t={},ja(t,l,Math.round(Q)),ja(t,c,""),t),e}function gBA(e){return e==="end"?"start":e==="start"?"end":e}var rT=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],vQ=rT.slice(3);function JF(e){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t=vQ.indexOf(e),n=vQ.slice(t+1).concat(vQ.slice(0,t));return A?n.reverse():n}var SQ={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function IBA(e,A){if(eT(e.instance.modifiers,"inner")||e.flipped&&e.placement===e.originalPlacement)return e;var t=vw(e.instance.popper,e.instance.reference,A.padding,A.boundariesElement,e.positionFixed),n=e.placement.split("-")[0],i=YB(n),r=e.placement.split("-")[1]||"",o=[];switch(A.behavior){case SQ.FLIP:o=[n,i];break;case SQ.CLOCKWISE:o=JF(n);break;case SQ.COUNTERCLOCKWISE:o=JF(n,!0);break;default:o=A.behavior}return o.forEach(function(s,a){if(n!==s||o.length===a+1)return e;n=e.placement.split("-")[0],i=YB(n);var g=e.offsets.popper,I=e.offsets.reference,l=Math.floor,c=n==="left"&&l(g.right)>l(I.left)||n==="right"&&l(g.left)l(I.top)||n==="bottom"&&l(g.top)l(t.right),E=l(g.top)l(t.bottom),h=n==="left"&&C||n==="right"&&u||n==="top"&&E||n==="bottom"&&B,f=["top","bottom"].indexOf(n)!==-1,Q=!!A.flipVariations&&(f&&r==="start"&&C||f&&r==="end"&&u||!f&&r==="start"&&E||!f&&r==="end"&&B),d=!!A.flipVariationsByContent&&(f&&r==="start"&&u||f&&r==="end"&&C||!f&&r==="start"&&B||!f&&r==="end"&&E),w=Q||d;(c||h||w)&&(e.flipped=!0,(c||h)&&(n=o[a+1]),w&&(r=gBA(r)),e.placement=n+(r?"-"+r:""),e.offsets.popper=vn({},e.offsets.popper,$M(e.instance.popper,e.offsets.reference,e.placement)),e=AT(e.instance.modifiers,e,"flip"))}),e}function lBA(e){var A=e.offsets,t=A.popper,n=A.reference,i=e.placement.split("-")[0],r=Math.floor,o=["top","bottom"].indexOf(i)!==-1,s=o?"right":"bottom",a=o?"left":"top",g=o?"width":"height";return t[s]r(n[s])&&(e.offsets.popper[a]=r(n[s])),e}function cBA(e,A,t,n){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+i[1],o=i[2];if(!r)return e;if(o.indexOf("%")===0){var s=void 0;switch(o){case"%p":s=t;break;case"%":case"%r":default:s=n}var a=Io(s);return a[A]/100*r}else if(o==="vh"||o==="vw"){var g=void 0;return o==="vh"?g=Math.max(document.documentElement.clientHeight,window.innerHeight||0):g=Math.max(document.documentElement.clientWidth,window.innerWidth||0),g/100*r}else return r}function CBA(e,A,t,n){var i=[0,0],r=["right","left"].indexOf(n)!==-1,o=e.split(/(\+|\-)/).map(function(I){return I.trim()}),s=o.indexOf(xc(o,function(I){return I.search(/,|\s/)!==-1}));o[s]&&o[s].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var a=/\s*,\s*|\s+/,g=s!==-1?[o.slice(0,s).concat([o[s].split(a)[0]]),[o[s].split(a)[1]].concat(o.slice(s+1))]:[o];return g=g.map(function(I,l){var c=(l===1?!r:r)?"height":"width",C=!1;return I.reduce(function(u,E){return u[u.length-1]===""&&["+","-"].indexOf(E)!==-1?(u[u.length-1]=E,C=!0,u):C?(u[u.length-1]+=E,C=!1,u):u.concat(E)},[]).map(function(u){return cBA(u,c,A,t)})}),g.forEach(function(I,l){I.forEach(function(c,C){Dw(c)&&(i[l]+=c*(I[C-1]==="-"?-1:1))})}),i}function uBA(e,A){var t=A.offset,n=e.placement,i=e.offsets,r=i.popper,o=i.reference,s=n.split("-")[0],a=void 0;return Dw(+t)?a=[+t,0]:a=CBA(t,r,o,s),s==="left"?(r.top+=a[0],r.left-=a[1]):s==="right"?(r.top+=a[0],r.left+=a[1]):s==="top"?(r.left+=a[0],r.top-=a[1]):s==="bottom"&&(r.left+=a[0],r.top+=a[1]),e.popper=r,e}function BBA(e,A){var t=A.boundariesElement||Wa(e.instance.popper);e.instance.reference===t&&(t=Wa(t));var n=Sw("transform"),i=e.instance.popper.style,r=i.top,o=i.left,s=i[n];i.top="",i.left="",i[n]="";var a=vw(e.instance.popper,e.instance.reference,A.padding,t,e.positionFixed);i.top=r,i.left=o,i[n]=s,A.boundaries=a;var g=A.priority,I=e.offsets.popper,l={primary:function(C){var u=I[C];return I[C]a[C]&&!A.escapeWithReference&&(E=Math.min(I[u],a[C]-(C==="right"?I.width:I.height))),ja({},u,E)}};return g.forEach(function(c){var C=["left","top"].indexOf(c)!==-1?"primary":"secondary";I=vn({},I,l[C](c))}),e.offsets.popper=I,e}function EBA(e){var A=e.placement,t=A.split("-")[0],n=A.split("-")[1];if(n){var i=e.offsets,r=i.reference,o=i.popper,s=["bottom","top"].indexOf(t)!==-1,a=s?"left":"top",g=s?"width":"height",I={start:ja({},a,r[a]),end:ja({},a,r[a]+r[g]-o[g])};e.offsets.popper=vn({},o,I[n])}return e}function hBA(e){if(!iT(e.instance.modifiers,"hide","preventOverflow"))return e;var A=e.offsets.reference,t=xc(e.instance.modifiers,function(n){return n.name==="preventOverflow"}).boundaries;if(A.bottomt.right||A.top>t.bottom||A.right2&&arguments[2]!==void 0?arguments[2]:{};YuA(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(n.update)},this.update=quA(this.update.bind(this)),this.options=vn({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=A&&A.jquery?A[0]:A,this.popper=t&&t.jquery?t[0]:t,this.options.modifiers={},Object.keys(vn({},e.Defaults.modifiers,i.modifiers)).forEach(function(o){n.options.modifiers[o]=vn({},e.Defaults.modifiers[o]||{},i.modifiers?i.modifiers[o]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(o){return vn({name:o},n.options.modifiers[o])}).sort(function(o,s){return o.order-s.order}),this.modifiers.forEach(function(o){o.enabled&&YM(o.onLoad)&&o.onLoad(n.reference,n.popper,n.options,o,n.state)}),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return KuA(e,[{key:"update",value:function(){return juA.call(this)}},{key:"destroy",value:function(){return XuA.call(this)}},{key:"enableEventListeners",value:function(){return $uA.call(this)}},{key:"disableEventListeners",value:function(){return eBA.call(this)}}]),e}();ah.Utils=(typeof window<"u"?window:global).PopperUtils;ah.placements=rT;ah.Defaults=dBA;const pBA=ah;function yBA(e,A){var t=A&&A.direction||"ltr";if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function OF(e){return typeof e=="function"?e():e}var mBA=typeof window<"u"?p.useLayoutEffect:p.useEffect,wBA={},vBA=p.forwardRef(function(A,t){var n=A.anchorEl,i=A.children,r=A.container,o=A.disablePortal,s=o===void 0?!1:o,a=A.keepMounted,g=a===void 0?!1:a,I=A.modifiers,l=A.open,c=A.placement,C=c===void 0?"bottom":c,u=A.popperOptions,E=u===void 0?wBA:u,B=A.popperRef,h=A.style,f=A.transition,Q=f===void 0?!1:f,d=xA(A,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),w=p.useRef(null),m=it(w,t),v=p.useRef(null),x=it(v,B),D=p.useRef(x);mBA(function(){D.current=x},[x]),p.useImperativeHandle(B,function(){return v.current},[]);var F=p.useState(!0),N=F[0],M=F[1],P=og(),H=yBA(C,P),W=p.useState(H),J=W[0],Z=W[1];p.useEffect(function(){v.current&&v.current.update()});var z=p.useCallback(function(){if(!(!w.current||!n||!l)){v.current&&(v.current.destroy(),D.current(null));var AA=function(aA){Z(aA.placement)};OF(n);var nA=new pBA(OF(n),w.current,k({placement:H},E,{modifiers:k({},s?{}:{preventOverflow:{boundariesElement:"window"}},I,E.modifiers),onCreate:go(AA,E.onCreate),onUpdate:go(AA,E.onUpdate)}));D.current(nA)}},[n,s,I,l,H,E]),O=p.useCallback(function(AA){us(m,AA),z()},[m,z]),Y=function(){M(!1)},T=function(){v.current&&(v.current.destroy(),D.current(null))},q=function(){M(!0),T()};if(p.useEffect(function(){return function(){T()}},[]),p.useEffect(function(){!l&&!Q&&T()},[l,Q]),!g&&!l&&(!Q||N))return null;var j={placement:J};return Q&&(j.TransitionProps={in:l,onEnter:Y,onExited:q}),p.createElement(DM,{disablePortal:s,container:r},p.createElement("div",k({ref:O,role:"tooltip"},d,{style:k({position:"fixed",top:0,left:0,display:!l&&g&&!Q?"none":null},h)}),typeof i=="function"?i(j):i))});const Rw=vBA;var SBA=function(A){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:A.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:A.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(A.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:A.transitions.create("background-color",{duration:A.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:A.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}},DBA=typeof window>"u"?p.useEffect:p.useLayoutEffect,RBA=p.forwardRef(function(A,t){var n=A.alignItems,i=n===void 0?"center":n,r=A.autoFocus,o=r===void 0?!1:r,s=A.button,a=s===void 0?!1:s,g=A.children,I=A.classes,l=A.className,c=A.component,C=A.ContainerComponent,u=C===void 0?"li":C,E=A.ContainerProps;E=E===void 0?{}:E;var B=E.className,h=xA(E,["className"]),f=A.dense,Q=f===void 0?!1:f,d=A.disabled,w=d===void 0?!1:d,m=A.disableGutters,v=m===void 0?!1:m,x=A.divider,D=x===void 0?!1:x,F=A.focusVisibleClassName,N=A.selected,M=N===void 0?!1:N,P=xA(A,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),H=p.useContext(Qu),W={dense:Q||H.dense||!1,alignItems:i},J=p.useRef(null);DBA(function(){o&&J.current&&J.current.focus()},[o]);var Z=p.Children.toArray(g),z=Z.length&&WI(Z[Z.length-1],["ListItemSecondaryAction"]),O=p.useCallback(function(j){J.current=Vt.findDOMNode(j)},[]),Y=it(O,t),T=k({className:vA(I.root,l,W.dense&&I.dense,!v&&I.gutters,D&&I.divider,w&&I.disabled,a&&I.button,i!=="center"&&I.alignItemsFlexStart,z&&I.secondaryAction,M&&I.selected),disabled:w},P),q=c||"li";return a&&(T.component=c||"div",T.focusVisibleClassName=vA(I.focusVisible,F),q=Sc),z?(q=!T.component&&!c?"div":q,u==="li"&&(q==="li"?q="div":T.component==="li"&&(T.component="div")),p.createElement(Qu.Provider,{value:W},p.createElement(u,k({className:vA(I.container,B),ref:Y},h),p.createElement(q,T,Z),Z.pop()))):p.createElement(Qu.Provider,{value:W},p.createElement(q,k({ref:Y},T),Z))});const xBA=se(SBA,{name:"MuiListItem"})(RBA);var FBA=function(A){return{root:k({},A.typography.body1,y({minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",width:"auto",overflow:"hidden",whiteSpace:"nowrap"},A.breakpoints.up("sm"),{minHeight:"auto"})),gutters:{},selected:{},dense:k({},A.typography.body2,{minHeight:"auto"})}},NBA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.component,o=r===void 0?"li":r,s=A.disableGutters,a=s===void 0?!1:s,g=A.ListItemClasses,I=A.role,l=I===void 0?"menuitem":I,c=A.selected,C=A.tabIndex,u=xA(A,["classes","className","component","disableGutters","ListItemClasses","role","selected","tabIndex"]),E;return A.disabled||(E=C!==void 0?C:-1),p.createElement(xBA,k({button:!0,role:l,tabIndex:E,component:o,selected:c,disableGutters:a,classes:k({dense:n.dense},g),className:vA(n.root,i,c&&n.selected,!a&&n.gutters),ref:t},u))});const du=se(FBA,{name:"MuiMenuItem"})(NBA);var xw={},_BA=Qo,LBA=po;Object.defineProperty(xw,"__esModule",{value:!0});var oT=xw.default=void 0,bBA=LBA(p),GBA=_BA(yo()),kBA=(0,GBA.default)(bBA.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"}),"Lens");oT=xw.default=kBA;const MBA=ys(()=>({container:{width:"70px",height:"40px",display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap"},button:{padding:"3px",width:"16px",height:"16px"},icon:{width:"17px",height:"17px"}})),TBA=({handleColorSelect:e})=>{const A=MBA();return b.jsx("div",{className:A.container,"aria-label":"color-swatch",children:ow.map(t=>b.jsx(Bs,{className:A.button,onClick:()=>e(t),children:b.jsx(oT,{fontSize:"small",style:{color:`rgb(${t})`},className:A.icon})},t))})},UBA=TBA,PBA=ys(()=>({paper:{backgroundColor:"rgba(0, 0, 0, 0.75)"},span:{width:"70px",textAlign:"center",paddingLeft:"2px",paddingRight:"2px"},colors:{"&:hover":{backgroundColor:"transparent"},paddingLeft:"2px",paddingRight:"2px"}}));function HBA({handleColorSelect:e,disabled:A,handleModeSelect:t}){const[n,i]=p.useReducer(a=>!a,!1),r=p.useRef(null),o=PBA();function s(a){const{mode:g}=a.currentTarget.dataset;t(g)}return b.jsxs(b.Fragment,{children:[b.jsx(Bs,{"aria-label":"Remove channel",size:"small",onClick:i,ref:r,disabled:A,children:b.jsx(OM,{fontSize:"small"})}),b.jsx(Rw,{open:n,anchorEl:r.current,placement:"bottom-end",children:b.jsx(fo,{className:o.paper,children:b.jsx(th,{onClickAway:i,children:b.jsxs(hw,{id:"channel-options",children:[b.jsx(du,{dense:!0,disableGutters:!0,className:o.colors,children:b.jsx(UBA,{handleColorSelect:e})}),b.jsx(du,{"data-mode":"full",dense:!0,disableGutters:!0,onClick:s,children:b.jsx("span",{className:o.span,children:"Full"})}),b.jsx(du,{"data-mode":"max/min",dense:!0,disableGutters:!0,onClick:s,children:b.jsx("span",{className:o.span,children:"Max/Min"})})]})})})})]})}const qBA=[220,220,220],JBA=(e,A)=>`rgb(${e?qBA:A})`,OBA=(e,A,t)=>A?b.jsx(wM,{size:"50%"}):t&&(e||typeof e=="number")?Iw(e,7):V0;function YBA({name:e,onSelectionChange:A,channelsVisible:t,pixelValue:n,toggleIsOn:i,handleSliderChange:r,domain:o,slider:s,color:a,handleRemoveChannel:g,handleColorSelect:I,isLoading:l}){const c=Fi(),C=ve(N=>N.colormap),[u,E,B]=UA(N=>[N.channelOptions,N.useLinkedView,N.use3d],Ve),h=JBA(C,a),f=({domain:N,mode:M,loader:P})=>{switch(M){case"max/min":return N;case"full":{const{dtype:H}=P[0],{max:W}=P0[H];return[H.startsWith("Int")?-W:0,W]}default:throw new Error}},[Q,d]=p.useState("max/min"),[w,m]=f({domain:o,mode:Q,loader:c}),{dtype:v}=c[0],x=v==="Float32"||v==="Float64",D=m-w<500&&x?(m-w)/500:1,F=!E&&!B;return b.jsxs(re,{container:!0,direction:"column",m:2,justifyContent:"center",children:[b.jsxs(re,{container:!0,direction:"row",justifyContent:"space-between",children:[b.jsx(re,{item:!0,xs:10,children:b.jsx(Dg,{native:!0,value:e,onChange:A,children:u.map(N=>b.jsx("option",{disabled:l,value:N,children:N},N))})}),b.jsx(re,{item:!0,xs:1,children:b.jsx(HBA,{handleColorSelect:I,disabled:l,handleModeSelect:d})}),b.jsx(re,{item:!0,xs:1,children:b.jsx(Bs,{"aria-label":"remove-channel",component:"span",size:"small",onClick:g,children:b.jsx(JM,{fontSize:"small"})})})]}),b.jsxs(re,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[b.jsx(re,{item:!0,xs:2,children:OBA(n,l,F)}),b.jsx(re,{item:!0,xs:2,children:b.jsx(Bw,{onChange:i,disabled:l,checked:t,style:{color:h,"&$checked":{color:h}}})}),b.jsx(re,{item:!0,xs:7,children:b.jsx(Ew,{disabled:l,value:s,onChange:r,valueLabelDisplay:"auto",getAriaLabel:()=>`${e}-${a}-${s}`,valueLabelFormat:N=>Iw(N,5),min:w,max:m,step:D,orientation:"horizontal",style:{color:h,marginTop:"7px"}})})]})]})}var KBA=_4(rr(N4,U4,A8,u8,v8,f8,D8,k8,Cy,AH)),VBA=lJ("div")(KBA,{name:"MuiBox"});const tp=VBA;var WBA=function(A){return{root:k({color:A.palette.text.secondary},A.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:A.palette.primary.main},"&$disabled":{color:A.palette.text.disabled},"&$error":{color:A.palette.error.main}}),colorSecondary:{"&$focused":{color:A.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:A.palette.error.main}}}},zBA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className;A.color;var o=A.component,s=o===void 0?"label":o;A.disabled,A.error,A.filled,A.focused,A.required;var a=xA(A,["children","classes","className","color","component","disabled","error","filled","focused","required"]),g=vg(),I=Sg({props:A,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]});return p.createElement(s,k({className:vA(i.root,i["color".concat(De(I.color||"primary"))],r,I.disabled&&i.disabled,I.error&&i.error,I.filled&&i.filled,I.focused&&i.focused,I.required&&i.required),ref:t},a),n,I.required&&p.createElement("span",{"aria-hidden":!0,className:vA(i.asterisk,I.error&&i.error)}," ","*"))});const jBA=se(WBA,{name:"MuiFormLabel"})(zBA);var XBA=function(A){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:A.transitions.create(["color","transform"],{duration:A.transitions.duration.shorter,easing:A.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}},ZBA=p.forwardRef(function(A,t){var n=A.classes,i=A.className,r=A.disableAnimation,o=r===void 0?!1:r;A.margin;var s=A.shrink;A.variant;var a=xA(A,["classes","className","disableAnimation","margin","shrink","variant"]),g=vg(),I=s;typeof I>"u"&&g&&(I=g.filled||g.focused||g.adornedStart);var l=Sg({props:A,muiFormControl:g,states:["margin","variant"]});return p.createElement(jBA,k({"data-shrink":I,className:vA(n.root,i,g&&n.formControl,!o&&n.animated,I&&n.shrink,l.margin==="dense"&&n.marginDense,{filled:n.filled,outlined:n.outlined}[l.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:t},a))});const Fw=se(XBA,{name:"MuiInputLabel"})(ZBA);var $BA={root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},AEA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className,o=A.color,s=o===void 0?"primary":o,a=A.component,g=a===void 0?"div":a,I=A.disabled,l=I===void 0?!1:I,c=A.error,C=c===void 0?!1:c,u=A.fullWidth,E=u===void 0?!1:u,B=A.focused,h=A.hiddenLabel,f=h===void 0?!1:h,Q=A.margin,d=Q===void 0?"none":Q,w=A.required,m=w===void 0?!1:w,v=A.size,x=A.variant,D=x===void 0?"standard":x,F=xA(A,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),N=p.useState(function(){var nA=!1;return n&&p.Children.forEach(n,function(IA){if(WI(IA,["Input","Select"])){var aA=WI(IA,["Select"])?IA.props.input:IA;aA&&iuA(aA.props)&&(nA=!0)}}),nA}),M=N[0],P=N[1],H=p.useState(function(){var nA=!1;return n&&p.Children.forEach(n,function(IA){WI(IA,["Input","Select"])&&fw(IA.props,!0)&&(nA=!0)}),nA}),W=H[0],J=H[1],Z=p.useState(!1),z=Z[0],O=Z[1],Y=B!==void 0?B:z;l&&Y&&O(!1);var T,q=p.useCallback(function(){J(!0)},[]),j=p.useCallback(function(){J(!1)},[]),AA={adornedStart:M,setAdornedStart:P,color:s,disabled:l,error:C,filled:W,focused:Y,fullWidth:E,hiddenLabel:f,margin:(v==="small"?"dense":void 0)||d,onBlur:function(){O(!1)},onEmpty:j,onFilled:q,onFocus:function(){O(!0)},registerEffect:T,required:m,variant:D};return p.createElement(uw.Provider,{value:AA},p.createElement(g,k({className:vA(i.root,r,d!=="none"&&i["margin".concat(De(d))],E&&i.fullWidth),ref:t},F),n))});const Nw=se($BA,{name:"MuiFormControl"})(AEA);var eEA=function(A){return{root:k({color:A.palette.text.secondary},A.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:A.palette.text.disabled},"&$error":{color:A.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}},tEA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className,o=A.component,s=o===void 0?"p":o;A.disabled,A.error,A.filled,A.focused,A.margin,A.required,A.variant;var a=xA(A,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"]),g=vg(),I=Sg({props:A,muiFormControl:g,states:["variant","margin","disabled","error","filled","focused","required"]});return p.createElement(s,k({className:vA(i.root,(I.variant==="filled"||I.variant==="outlined")&&i.contained,r,I.disabled&&i.disabled,I.error&&i.error,I.filled&&i.filled,I.focused&&i.focused,I.required&&i.required,I.margin==="dense"&&i.marginDense),ref:t},a),n===" "?p.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):n)});const nEA=se(eEA,{name:"MuiFormHelperText"})(tEA);var iEA={standard:dw,filled:kM,outlined:TM},rEA={root:{}},oEA=p.forwardRef(function(A,t){var n=A.autoComplete,i=A.autoFocus,r=i===void 0?!1:i,o=A.children,s=A.classes,a=A.className,g=A.color,I=g===void 0?"primary":g,l=A.defaultValue,c=A.disabled,C=c===void 0?!1:c,u=A.error,E=u===void 0?!1:u,B=A.FormHelperTextProps,h=A.fullWidth,f=h===void 0?!1:h,Q=A.helperText,d=A.hiddenLabel,w=A.id,m=A.InputLabelProps,v=A.inputProps,x=A.InputProps,D=A.inputRef,F=A.label,N=A.multiline,M=N===void 0?!1:N,P=A.name,H=A.onBlur,W=A.onChange,J=A.onFocus,Z=A.placeholder,z=A.required,O=z===void 0?!1:z,Y=A.rows,T=A.rowsMax,q=A.maxRows,j=A.minRows,AA=A.select,nA=AA===void 0?!1:AA,IA=A.SelectProps,aA=A.type,BA=A.value,lA=A.variant,MA=lA===void 0?"standard":lA,EA=xA(A,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","maxRows","minRows","select","SelectProps","type","value","variant"]),pA={};if(MA==="outlined"&&(m&&typeof m.shrink<"u"&&(pA.notched=m.shrink),F)){var qA,NA=(qA=m==null?void 0:m.required)!==null&&qA!==void 0?qA:O;pA.label=p.createElement(p.Fragment,null,F,NA&&" *")}nA&&((!IA||!IA.native)&&(pA.id=void 0),pA["aria-describedby"]=void 0);var JA=Q&&w?"".concat(w,"-helper-text"):void 0,dA=F&&w?"".concat(w,"-label"):void 0,GA=iEA[MA],ie=p.createElement(GA,k({"aria-describedby":JA,autoComplete:n,autoFocus:r,defaultValue:l,fullWidth:f,multiline:M,name:P,rows:Y,rowsMax:T,maxRows:q,minRows:j,type:aA,value:BA,id:w,inputRef:D,onBlur:H,onChange:W,onFocus:J,placeholder:Z,inputProps:v},pA,x));return p.createElement(Nw,k({className:vA(s.root,a),disabled:C,error:E,fullWidth:f,hiddenLabel:d,ref:t,required:O,color:I,variant:MA},EA),F&&p.createElement(Fw,k({htmlFor:w,id:dA},m),F),nA?p.createElement(Dg,k({"aria-describedby":JA,id:w,labelId:dA,value:BA,input:ie},IA),o):ie,Q&&p.createElement(nEA,k({id:JA},B),Q))});const sEA=se(rEA,{name:"MuiTextField"})(oEA);var _w={},aEA=Qo,gEA=po;Object.defineProperty(_w,"__esModule",{value:!0});var sT=_w.default=void 0,IEA=gEA(p),lEA=aEA(yo()),cEA=(0,lEA.default)(IEA.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");sT=_w.default=cEA;var CEA=function(A){return{root:k({},A.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:A.shape.borderRadius,color:A.palette.text.primary,transition:A.transitions.create(["background-color","box-shadow","border"],{duration:A.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:mt(A.palette.text.primary,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:A.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:A.palette.primary.main,"&:hover":{backgroundColor:mt(A.palette.primary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:A.palette.secondary.main,"&:hover":{backgroundColor:mt(A.palette.secondary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat(A.palette.type==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(A.palette.action.disabledBackground)}},outlinedPrimary:{color:A.palette.primary.main,border:"1px solid ".concat(mt(A.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(A.palette.primary.main),backgroundColor:mt(A.palette.primary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:A.palette.secondary.main,border:"1px solid ".concat(mt(A.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(A.palette.secondary.main),backgroundColor:mt(A.palette.secondary.main,A.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(A.palette.action.disabled)}},contained:{color:A.palette.getContrastText(A.palette.grey[300]),backgroundColor:A.palette.grey[300],boxShadow:A.shadows[2],"&:hover":{backgroundColor:A.palette.grey.A100,boxShadow:A.shadows[4],"@media (hover: none)":{boxShadow:A.shadows[2],backgroundColor:A.palette.grey[300]},"&$disabled":{backgroundColor:A.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:A.shadows[6]},"&:active":{boxShadow:A.shadows[8]},"&$disabled":{color:A.palette.action.disabled,boxShadow:A.shadows[0],backgroundColor:A.palette.action.disabledBackground}},containedPrimary:{color:A.palette.primary.contrastText,backgroundColor:A.palette.primary.main,"&:hover":{backgroundColor:A.palette.primary.dark,"@media (hover: none)":{backgroundColor:A.palette.primary.main}}},containedSecondary:{color:A.palette.secondary.contrastText,backgroundColor:A.palette.secondary.main,"&:hover":{backgroundColor:A.palette.secondary.dark,"@media (hover: none)":{backgroundColor:A.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:A.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:A.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:A.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:A.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:A.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:A.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}},uEA=p.forwardRef(function(A,t){var n=A.children,i=A.classes,r=A.className,o=A.color,s=o===void 0?"default":o,a=A.component,g=a===void 0?"button":a,I=A.disabled,l=I===void 0?!1:I,c=A.disableElevation,C=c===void 0?!1:c,u=A.disableFocusRipple,E=u===void 0?!1:u,B=A.endIcon,h=A.focusVisibleClassName,f=A.fullWidth,Q=f===void 0?!1:f,d=A.size,w=d===void 0?"medium":d,m=A.startIcon,v=A.type,x=v===void 0?"button":v,D=A.variant,F=D===void 0?"text":D,N=xA(A,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),M=m&&p.createElement("span",{className:vA(i.startIcon,i["iconSize".concat(De(w))])},m),P=B&&p.createElement("span",{className:vA(i.endIcon,i["iconSize".concat(De(w))])},B);return p.createElement(Sc,k({className:vA(i.root,i[F],r,s==="inherit"?i.colorInherit:s!=="default"&&i["".concat(F).concat(De(s))],w!=="medium"&&[i["".concat(F,"Size").concat(De(w))],i["size".concat(De(w))]],C&&i.disableElevation,l&&i.disabled,Q&&i.fullWidth),component:g,disabled:l,focusRipple:!E,focusVisibleClassName:vA(i.focusVisible,h),ref:t,type:x},N),p.createElement("span",{className:i.label},M,n,P))});const lr=se(CEA,{name:"MuiButton"})(uEA);var Lw={},BEA=Qo,EEA=po;Object.defineProperty(Lw,"__esModule",{value:!0});var aT=Lw.default=void 0,hEA=EEA(p),fEA=BEA(yo()),QEA=(0,fEA.default)(hEA.createElement("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");aT=Lw.default=QEA;var bw={},dEA=Qo,pEA=po;Object.defineProperty(bw,"__esModule",{value:!0});var gT=bw.default=void 0,yEA=pEA(p),mEA=dEA(yo()),wEA=(0,mEA.default)(yEA.createElement("path",{d:"M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.6-1.4-1.4-1.8-1.4-1.8-1-.7.1-.7.1-.7 1.2 0 1.9 1.2 1.9 1.2 1 1.8 2.8 1.3 3.5 1 0-.8.4-1.3.7-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.2.5-2.3 1.3-3.1-.2-.4-.6-1.6 0-3.2 0 0 1-.3 3.4 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.6.2 2.8 0 3.2.9.8 1.3 1.9 1.3 3.2 0 4.6-2.8 5.6-5.5 5.9.5.4.9 1 .9 2.2v3.3c0 .3.1.7.8.6A12 12 0 0 0 12 .3"}),"GitHub");gT=bw.default=wEA;var Gw={},vEA=Qo,SEA=po;Object.defineProperty(Gw,"__esModule",{value:!0});var IT=Gw.default=void 0,DEA=SEA(p),REA=vEA(yo()),xEA=(0,REA.default)(DEA.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");IT=Gw.default=xEA;const FEA={marginRight:"4.5px",marginTop:"3px"};function NEA(){const e=UA(A=>A.toggleIsControllerOn);return b.jsxs(re,{container:!0,direction:"row",justifyContent:"flex-end",alignItems:"center",children:[b.jsx(re,{style:{marginRight:"auto"},item:!0,children:b.jsx(Es,{variant:"body1",children:b.jsx("strong",{children:"AVIVATOR"})})}),b.jsx(re,{item:!0,children:b.jsx(Bs,{href:"https://github.com/hms-dbmi/viv","aria-label":"GitHub Repository",disableRipple:!0,children:b.jsx(gT,{})})}),b.jsx(re,{item:!0,children:b.jsx(Bs,{size:"small",onClick:e,disableRipple:!0,"aria-label":"hide-menu",style:FEA,children:b.jsx(IT,{fontSize:"small"})})})]})}function _EA(){const{getRootProps:e,getInputProps:A}=BM();return b.jsxs(lr,{fullWidth:!0,variant:"outlined",style:{borderStyle:"dashed",backgroundColor:"transparent",height:"2rem"},size:"small",...e(),children:[b.jsx("input",{...A({accept:".tif, .tiff"})}),"Choose a file"]})}const lT=ys(e=>({root:{maxHeight:A=>`${A.maxHeight-e.spacing(4)}px`,width:"365px",overflowX:"hidden",overflowY:"scroll","&::-webkit-scrollbar":{display:"none",background:"transparent"},scrollbarWidth:"none"},typography:{fontSize:".8rem"},paper:{paddingBottom:e.spacing(2),paddingRight:e.spacing(2),paddingLeft:e.spacing(2),backgroundColor:"rgba(0, 0, 0, 0.75)",borderRadius:2},item:{width:"100%"},divider:{paddingBottom:e.spacing(1),paddingTop:e.spacing(2)}}));function LEA(e){const A=bn(C=>C.image),[t,n]=UA(C=>[C.source,C.metadata]),i=(C,u)=>{C.preventDefault();const E={urlOrFile:u,description:cM(u)};UA.setState({source:E})},r=C=>bn.setState({image:C.target.value}),o=typeof t.urlOrFile=="string"?t.urlOrFile:"",[s,a]=p.useState(o),[g,I]=p.useReducer(C=>!C,!1),l=p.useRef(null),c=lT(e);return p.useEffect(()=>a(o),[o]),b.jsxs(re,{container:!0,direction:"column",spacing:0,children:[b.jsx(re,{item:!0,xs:12,children:b.jsx(NEA,{})}),b.jsxs(re,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[b.jsxs(re,{item:!0,xs:1,children:[b.jsx(sT,{onClick:I,ref:l}),b.jsx(Rw,{open:g,anchorEl:l.current,placement:"bottom-start",style:{width:"25%"},children:b.jsx(fo,{style:{padding:8},children:b.jsx(th,{onClickAway:I,children:b.jsxs(Es,{className:c.typography,children:["Provide a URL to an OME-TIFF file or a Bio-Formats Zarr store to view the image. View the"," ",b.jsx(sh,{target:"_blank",rel:"noopener noreferrer",href:"http://viv.gehlenborglab.org",children:"docs"})," ","to learn more about the supported file formats."]})})})})]}),b.jsx(re,{item:!0,xs:11,children:b.jsx("form",{onSubmit:C=>{i(C,s)},children:b.jsx(sEA,{id:"ome-input",label:"OME-TIFF/Bioformats-Zarr URL",variant:"filled",size:"small",fullWidth:!0,value:s,onChange:C=>a(C.target.value)})})})]}),!wIA()&&b.jsx(re,{item:!0,xs:12,style:{paddingTop:16},children:b.jsx(_EA,{})}),Array.isArray(n)&&b.jsx(re,{item:!0,xs:12,children:b.jsx(Dg,{native:!0,value:A,onChange:r,children:n.map((C,u)=>b.jsx("option",{value:u,children:C.Name},C.Name))})}),b.jsx(re,{item:!0,xs:12,className:c.divider,children:b.jsx(Z0,{})})]})}function bEA({children:e,...A}){const t=lT(A),[n,i]=UA(r=>[r.isControllerOn,r.toggleIsControllerOn],Ve);return n?b.jsx(tp,{position:"absolute",right:0,top:0,m:1,className:t.root,children:b.jsxs(fo,{className:t.paper,children:[b.jsx(LEA,{}),b.jsx(re,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:e.map((r,o)=>b.jsx(re,{item:!0,className:t.item,children:r},o))})]})}):b.jsx(tp,{position:"absolute",right:-8,top:-8,m:2,children:b.jsx(lr,{variant:"outlined",color:"default",size:"small",endIcon:b.jsx(aT,{}),onClick:i,"aria-label":"show-menu",children:"AVIVATOR"})})}function GEA(){const e=ve(t=>t.colormap),A=UA(t=>t.isViewerLoading);return b.jsxs(Nw,{fullWidth:!0,children:[b.jsxs(Fw,{htmlFor:"colormap-select",children:["Additive ",e===""?" Blending":"Color Mapping"]}),b.jsxs(Dg,{native:!0,onChange:t=>ve.setState({colormap:t.target.value}),value:e,inputProps:{name:"colormap",id:"colormap-select"},disabled:A,children:[b.jsx("option",{"aria-label":"None",value:""}),sIA.map(t=>b.jsx("option",{value:t,children:t},t))]})]})}function kEA(e){const{size:A,label:t}=e,[n,i]=bn(a=>[a.selections,a.setPropertiesForChannel],Ve),r=Fi(),o=UA(a=>a.globalSelection),s=p.useCallback(mM((a,g)=>{UA.setState({isChannelLoading:n.map(()=>!0)});const I=[...n].map(l=>({...l,[t]:g}));qB({loader:r,selections:I,use3d:!1}).then(({domains:l,contrastLimits:c})=>{Vt.unstable_batchedUpdates(()=>{VI(I.length).forEach((C,u)=>i(C,{domains:l[u],contrastLimits:c[u]}))}),Vt.unstable_batchedUpdates(()=>{ve.setState({onViewportLoad:()=>{ve.setState({onViewportLoad:()=>{}}),UA.setState({isChannelLoading:n.map(()=>!1)})}}),VI(I.length).forEach((C,u)=>i(C,{selections:I[u]}))})})},50,{trailing:!0}),[r,n]);return b.jsxs(re,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[b.jsxs(re,{item:!0,xs:1,children:[t,":"]}),b.jsx(re,{item:!0,xs:11,children:b.jsx(Ew,{value:o[t],onChange:(a,g)=>{UA.setState({globalSelection:{...o,[t]:g}}),a.type==="keydown"&&s(a,g)},onChangeCommitted:s,valueLabelDisplay:"auto",getAriaLabel:()=>`${t} slider`,marks:VI(A).map(a=>({value:a})),min:0,max:A,orientation:"horizontal",style:{marginTop:"7px"},step:null})})]})}function MEA(){const e=bn(s=>s.selections),[A,t,n]=ve(s=>[s.lensEnabled,s.toggleLensEnabled,s.lensSelection],Ve),i=UA(s=>s.channelOptions),r=e.map(s=>s.c),o=`rgb(${[255,255,255]})`;return b.jsxs(re,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[b.jsx(re,{item:!0,xs:2,children:"Lens:"}),b.jsx(re,{item:!0,xs:2,children:b.jsx(Bw,{onChange:t,checked:A,style:{color:o,"&$checked":{color:o}}})}),b.jsx(re,{item:!0,xs:7,children:b.jsx(Dg,{native:!0,value:n,onChange:s=>ve.setState({lensSelection:s.target.value}),children:r.map((s,a)=>b.jsx("option",{value:a,children:i[s]},i[s]+String(a)))})})]})}function TEA(e,A=2){if(e===0)return"0 Bytes";const t=1024,n=A<0?0:A,i=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(n))} ${i[r]}`}const cT=(e,A)=>{const{shape:t,labels:n}=e[A],i=t[n.indexOf("y")],r=t[n.indexOf("x")],o=t[n.indexOf("z")],s=Math.max(1,o>>A),a=4*i*r*s;return{height:i,width:r,depthDownsampled:s,totalBytes:a}},YF=(e,A)=>{var a,g,I;const{totalBytes:t,height:n,width:i,depthDownsampled:r}=cT(e,A),s=((a=window.performance)==null?void 0:a.memory)&&((I=(g=window.performance)==null?void 0:g.memory)==null?void 0:I.jsHeapSizeLimit)/2||2**31-1;return t1},UEA=ys(()=>({paper:{backgroundColor:"rgba(0, 0, 0, 1)"},span:{width:"70px",textAlign:"center",paddingLeft:"2px",paddingRight:"2px"},colors:{"&:hover":{backgroundColor:"transparent"},paddingLeft:"2px",paddingRight:"2px"}}));function PEA(){const[e,A]=bn(u=>[u.selections,u.setPropertiesForChannel],Ve),t=Fi(),[n,i,r,o]=UA(u=>[u.use3d,u.toggleUse3d,u.toggleIsVolumeRenderingWarningOn,u.isViewerLoading],Ve),[s,a]=p.useReducer(u=>!u,!1),g=p.useRef(null),I=UEA(),{shape:l,labels:c}=Array.isArray(t)?t[0]:t,C=Array.from({length:t.length}).filter((u,E)=>YF(t,E)).length;return b.jsxs(b.Fragment,{children:[b.jsxs(lr,{variant:"outlined",size:"small",ref:g,disabled:!(l[c.indexOf("z")]>1)||o||!C,onClick:()=>{a(),n&&(i(),UA.setState({isChannelLoading:Array(e.length).fill(!0)}),qB({loader:t,selections:e,use3d:!n}).then(({domains:u,contrastLimits:E})=>{VI(e.length).forEach((B,h)=>A(B,{domains:u[h],contrastLimits:E[h]})),UA.setState({isChannelLoading:Array(e.length).fill(!1)})}))},fullWidth:!0,children:[n?"Hide":"Show"," Volumetric Rendering"]}),b.jsx(Rw,{open:s,anchorEl:g.current,placement:"bottom-end",children:b.jsx(fo,{className:I.paper,children:b.jsx(th,{onClickAway:a,children:b.jsx(hw,{id:"resolution-options",children:Array.from({length:t.length}).fill(0).map((u,E)=>{if(t&&YF(t,E)){const{height:B,width:h,depthDownsampled:f,totalBytes:Q}=cT(t,E);return b.jsx(du,{dense:!0,disableGutters:!0,onClick:()=>{UA.setState({isChannelLoading:Array(e.length).fill(!0)});const[d,w,m]=lw(t);ve.setState({resolution:E,xSlice:d,ySlice:w,zSlice:m}),a(),qB({loader:t,selections:e,use3d:!0}).then(({domains:v,contrastLimits:x})=>{VI(e.length).forEach((F,N)=>A(F,{domains:v[N],contrastLimits:x[N]})),ve.setState({onViewportLoad:()=>{ve.setState({onViewportLoad:()=>{}}),UA.setState({isChannelLoading:Array(e.length).fill(!1)})}}),i(),!!document.createElement("canvas").getContext("webgl2")||r()})},children:`${E}x Downsampled, ~${TEA(Q)} per channel, (${B}, ${h}, ${f})`},`(${B}, ${h}, ${f})`)}return null})})})})})]})}const KF=Object.values(Na);function HEA(){const e=ve(i=>i.renderingMode),[A,t]=UA(i=>[i.isViewerLoading,i.use3d],Ve),n=t?KF:[...KF,""];return b.jsxs(Nw,{fullWidth:!0,children:[b.jsx(Fw,{htmlFor:"rendering-mode-select",children:"Rendering Mode"}),b.jsx(Dg,{native:!0,onChange:i=>ve.setState({renderingMode:i.target.value}),value:t?e:"",inputProps:{name:"rendering-mode",id:"rendering-mode-select"},disabled:A||!t,children:n.map(i=>b.jsx("option",{value:i,children:i},i))})]})}const qEA=ys(e=>U_({enabled:{},disabled:{color:e.palette.text.disabled,"& .MuiSlider-thumb":{color:"rgb(100, 100, 100, 1.0)"},"& .MuiSlider-track":{color:"rgb(100, 100, 100, 1.0)"}}})),JEA=()=>{const[e,A,t]=ve(l=>[l.xSlice,l.ySlice,l.zSlice],Ve),n=Fi(),i=UA(l=>l.use3d),[r,o,s]=lw(n),a=[[e,l=>ve.setState({xSlice:l}),"x",r],[A,l=>ve.setState({ySlice:l}),"y",o],[t,l=>ve.setState({zSlice:l}),"z",s]],g=qEA(),I=a.map(([l,c,C,[u,E]])=>b.jsxs(re,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[b.jsx(re,{item:!0,xs:1,style:{marginBottom:8},children:b.jsxs(Es,{className:i?g.enabled:g.disabled,style:{marginTop:4},children:[C,":"]})}),b.jsx(re,{item:!0,xs:11,children:b.jsx(Ew,{disabled:!i,className:i?g.enabled:g.disabled,value:l,onChange:(B,h)=>c(h),valueLabelDisplay:"auto",valueLabelFormat:B=>Iw(B,5),getAriaLabel:()=>`${C} slider`,min:u,max:E,step:.005,orientation:"horizontal"})})]},C));return b.jsxs(b.Fragment,{children:[b.jsxs(Es,{className:i?g.enabled:g.disabled,style:{marginTop:16},children:["Clipping Planes:"," "]})," ",I]})},OEA=JEA;var kw={},YEA=Qo,KEA=po;Object.defineProperty(kw,"__esModule",{value:!0});var CT=kw.default=void 0,VEA=KEA(p),WEA=YEA(yo()),zEA=(0,WEA.default)(VEA.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");CT=kw.default=zEA;const jEA=()=>{const[e,A,t,n,i]=UA(c=>[c.globalSelection,c.isViewerLoading,c.use3d,c.setIsChannelLoading,c.addIsChannelLoading],Ve),[r,o,s]=bn(c=>[c.selections,c.addChannel,c.setPropertiesForChannel],Ve),a=Fi(),g=iw(),{labels:I}=a[0],l=p.useCallback(()=>{let c=Object.fromEntries(I.map(u=>[u,0]));c={...c,...e};const C=r.length;gw({loader:a,selection:c,use3d:t}).then(({domain:u,contrastLimits:E})=>{s(C,{domains:u,contrastLimits:E,channelsVisible:!0}),ve.setState({onViewportLoad:()=>{ve.setState({onViewportLoad:()=>{}}),n(C,!1)}}),i(!0);const{Pixels:{Channels:B}}=g,{c:h}=c;o({selections:c,ids:String(Math.random()),channelsVisible:!1,colors:(B[h].Color&&B[h].Color.slice(0,-1))??(ow[h]||[255,255,255])})})},[I,a,e,t,o,i,r,n,s,g]);return b.jsx(lr,{disabled:r.length===rIA||A,onClick:l,fullWidth:!0,variant:"outlined",style:{borderStyle:"dashed"},startIcon:b.jsx(CT,{}),size:"small",children:"Add Channel"})},XEA=jEA,ZEA=()=>{const[e,A]=ve(n=>[n.togglePanLock,n.panLock],Ve),t=UA(n=>n.isViewerLoading);return b.jsxs(lr,{disabled:t,onClick:e,variant:"outlined",size:"small",fullWidth:!0,children:[A?"Unlock":"Lock"," Pan"]})},$EA=ZEA,AhA=()=>{const[e,A]=ve(n=>[n.toggleZoomLock,n.zoomLock],Ve),t=UA(n=>n.isViewerLoading);return b.jsxs(lr,{disabled:t,onClick:e,variant:"outlined",size:"small",fullWidth:!0,children:[A?"Unlock":"Lock"," Zoom"]})},ehA=AhA,thA=()=>{const e=ve(r=>r.isOverviewOn),[A,t,n,i]=UA(r=>[r.isViewerLoading,r.toggleUseLinkedView,r.useLinkedView,r.use3d],Ve);return b.jsxs(lr,{disabled:A||e||i,onClick:t,variant:"outlined",size:"small",fullWidth:!0,children:[n?"Hide":"Show"," Side-by-Side"]})},nhA=thA,ihA=()=>{const[e,A]=ve(r=>[r.isOverviewOn,r.toggleIsOverviewOn],Ve),[t,n,i]=UA(r=>[r.isViewerLoading,r.useLinkedView,r.use3d],Ve);return b.jsxs(lr,{disabled:t||n||i,onClick:A,variant:"outlined",size:"small",fullWidth:!0,children:[e?"Hide":"Show"," Picture-In-Picture"]})},rhA=ihA,ohA=ys(e=>U_({enabled:{marginLeft:"4px"},disabled:{color:e.palette.text.disabled,marginLeft:"4px"}})),shA=()=>{const e=Fi(),[A,t]=ve(I=>[I.useFixedAxis,I.toggleUseFixedAxis],Ve),[n,i]=UA(I=>[I.viewState,I.use3d]),{height:r,width:o}=aw(),s=ohA(),a=b.jsx(re,{item:!0,xs:"auto",children:b.jsxs(re,{container:!0,direction:"row",children:[b.jsx(Bw,{onClick:t,style:{padding:0},disabled:!i,checked:A}),b.jsx(Es,{className:i?s.enabled:s.disabled,children:"Fix Camera Axis"})]})},"toggle-fixed-axis"),g=b.jsx(re,{item:!0,xs:"auto",children:b.jsx(lr,{onClick:()=>UA.setState({viewState:{...n,...eh(e,{height:r,width:o},1,!0),rotationX:0,rotationOrbit:0}}),disabled:!i,style:{padding:0},children:"Re-Center"})},"recenter");return b.jsx(re,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",style:{marginTop:16},children:[a,g]})},ahA=shA;function VF(e){const{children:A,value:t,index:n,...i}=e;return b.jsx("div",{role:"tabpanel",hidden:t!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`,...i,children:t===n&&A})}const ghA=()=>{const[e,A,t,n,i,r,o,s,a]=bn(J=>[J.channelsVisible,J.contrastLimits,J.colors,J.domains,J.selections,J.ids,J.setPropertiesForChannel,J.toggleIsOn,J.removeChannel],Ve),g=Fi(),I=ve(J=>J.colormap),[l,c,C,u,E,B,h,f,Q,d]=UA(J=>[J.channelOptions,J.useLinkedView,J.use3d,J.useColormap,J.useLens,J.isChannelLoading,J.setIsChannelLoading,J.removeIsChannelLoading,J.pixelValues,J.isViewerLoading],Ve),w=iw(),m=aw(),v=w&&uM(w),{shape:x,labels:D}=g[0],F=D.filter(J=>sw.includes(J)),N=r.map((J,Z)=>{const z=AA=>{const nA={...i[Z],c:l.indexOf(AA.target.value)};h(Z,!0),gw({loader:g,selection:nA,use3d:C}).then(({domain:IA,contrastLimits:aA})=>{const{Pixels:{Channels:BA}}=w,{c:lA}=nA,MA={contrastLimits:aA,domains:IA};BA[lA].Color&&(MA.colors=BA[lA].Color.slice(0,-1)),o(Z,MA),ve.setState({onViewportLoad:()=>{ve.setState({onViewportLoad:()=>{}}),h(Z,!1)}}),o(Z,{selections:nA})})},O=()=>s(Z),Y=(AA,nA)=>o(Z,{contrastLimits:nA}),T=()=>{a(Z),f(Z)},q=AA=>{o(Z,{colors:AA})},j=l[i[Z].c];return b.jsx(re,{style:{width:"100%"},item:!0,children:b.jsx(YBA,{name:j,onSelectionChange:z,channelsVisible:e[Z],pixelValue:Q[Z],toggleIsOn:O,handleSliderChange:Y,domain:n[Z],slider:A[Z],color:t[Z],handleRemoveChannel:T,handleColorSelect:q,isLoading:B[Z]})},`channel-controller-${j}-${J}`)}),M=F.map(J=>{const Z=x[D.indexOf(J)];return Z>1?b.jsx(kEA,{size:Z,label:J},J):null}),[P,H]=p.useState(0),W=(J,Z)=>{H(Z)};return b.jsxs(bEA,{maxHeight:m.height,children:[b.jsxs(oCA,{value:P,onChange:W,"aria-label":"simple tabs example",style:{height:"24px",minHeight:"24px"},children:[b.jsx(yF,{label:"Channels",style:{fontSize:".75rem",bottom:12}}),b.jsx(yF,{label:"Volume",style:{fontSize:".75rem",bottom:12}})]}),b.jsx(Z0,{}),b.jsxs(VF,{value:P,index:0,children:[u&&b.jsx(GEA,{}),E&&!I&&!C&&x[D.indexOf("c")]>1&&b.jsx(MEA,{channelOptions:i.map(J=>l[J.c])}),!C&&M,!d&&!v?b.jsx(re,{container:!0,children:N}):b.jsx(re,{container:!0,justifyContent:"center",children:!v&&b.jsx(wM,{})}),!v&&b.jsx(XEA,{})]}),b.jsxs(VF,{value:P,index:1,children:[b.jsx(HEA,{}),b.jsx(OEA,{}),b.jsx(ahA,{})]}),b.jsx(Z0,{style:{marginTop:"8px",marginBottom:"8px"}}),b.jsx(PEA,{}),b.jsx(rhA,{}),b.jsx(nhA,{}),c&&!C&&b.jsxs(b.Fragment,{children:[b.jsx(ehA,{}),b.jsx($EA,{})]})]})},IhA=ghA;function lhA({children:e}){const{getRootProps:A,getInputProps:t}=BM();return b.jsxs("div",{...A({onClick:n=>n.stopPropagation()}),children:[b.jsx("input",{...t()}),e]})}const chA=ys(e=>({typography:{fontSize:".8rem"},paper:{paddingRight:e.spacing(1),paddingLeft:e.spacing(1),backgroundColor:"rgba(0, 0, 0, 0.75)",borderRadius:2}}));function ChA(e,A,t){return`${e}/${A} [${t.join(", ")}]`}function uhA(){const e=chA(),[A,t]=UA(s=>[s.use3d,s.pyramidResolution],Ve),n=Fi(),i=ve(s=>s.resolution),r=A?i:t,o=n[r];return o?b.jsx(tp,{style:{position:"fixed",marginTop:"calc(5% + 60px)",bottom:0},children:b.jsx(fo,{className:e.paper,children:b.jsx(Es,{className:e.typography,children:ChA(r+1,n.length,o.shape)})})}):null}function WF(e){const{history:A,source:t,isDemoImage:n}=e,i=UA(s=>s.isViewerLoading),r=UA(s=>s.source),o=UA(s=>s.useLinkedView);return p.useEffect(()=>{UA.setState({source:t,isNoImageUrlSnackbarOn:n})},[]),DIA(r,A),b.jsxs(b.Fragment,{children:[b.jsx(lhA,{children:!i&&b.jsx(bcA,{})}),b.jsx(IhA,{}),b.jsx(LlA,{}),!o&&b.jsx(uhA,{})]})}const zF=d_({palette:{type:"dark",primary:Cl,secondary:Cl},props:{MuiButtonBase:{disableRipple:!0}}});function BhA(){return YS[Math.floor(Math.random()*YS.length)]}function EhA(){return new URLSearchParams(LP().search)}function hhA(e){const t=EhA().get("image_url"),{routeProps:{history:n}}=e;if(t){const r={urlOrFile:t,description:cM(t)};return b.jsx(OS,{theme:zF,children:b.jsx(WF,{source:r,history:n})})}const i=BhA();return b.jsx(OS,{theme:zF,children:b.jsx(WF,{source:i,history:n,isDemoImage:!0})})}gI.render(b.jsx(bP,{children:b.jsx(NP,{children:b.jsx(RP,{path:"/",render:e=>b.jsx(hhA,{routeProps:e})})})}),document.getElementById("root"));export{UeA as B,khA as L,MhA as a,Gn as g}; diff --git a/assets/jpeg-9b086afd.js b/assets/jpeg-8a2bf234.js similarity index 99% rename from assets/jpeg-9b086afd.js rename to assets/jpeg-8a2bf234.js index 61b144324..7ce4f4870 100644 --- a/assets/jpeg-9b086afd.js +++ b/assets/jpeg-8a2bf234.js @@ -1 +1 @@ -import{B as re}from"./index-fc258553.js";const O=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Y=4017,Z=799,$=3406,N=2276,Q=1567,W=3784,R=5793,K=2896;function ne(q,l){let o=0;const u=[];let T=16;for(;T>0&&!q[T-1];)--T;u.push({children:[],index:0});let w=u[0],C;for(let t=0;t0;)w=u.pop();for(w.index++,u.push(w);u.length<=t;)u.push(C={children:[],index:0}),w.children[w.index]=C.children,w=C;o++}t+10)return d--,i>>d&1;if(i=q[b++],i===255){const a=q[b++];if(a)throw new Error(`unexpected marker: ${(i<<8|a).toString(16)}`)}return d=7,i>>>7}function x(a){let f=a,p;for(;(p=m())!==null;){if(f=f[p],typeof f=="number")return f;if(typeof f!="object")throw new Error("invalid huffman sequence")}return null}function E(a){let f=a,p=0;for(;f>0;){const L=m();if(L===null)return;p=p<<1|L,--f}return p}function k(a){const f=E(a);return f>=1<>4;if(y===0){if(S<15)break;D+=16}else{D+=S;const I=O[D];f[I]=k(y),D++}}}function v(a,f){const p=x(a.huffmanTableDC),L=p===0?0:k(p)<0){n--;return}let p=w;const L=C;for(;p<=L;){const D=x(a.huffmanTableAC),P=D&15,y=D>>4;if(P===0){if(y<15){n=E(y)+(1<>4,I===0)D<15?(n=E(D)+(1<=65488&&z<=65495)b+=2;else break}return b-r}function ie(q,l){const o=[],{blocksPerLine:u,blocksPerColumn:T}=l,w=u<<3,C=new Int32Array(64),t=new Uint8Array(64);function h(F,c,r){const b=l.quantizationTable;let i,d,m,x,E,k,A,v,s;const n=r;let g;for(g=0;g<64;g++)n[g]=F[g]*b[g];for(g=0;g<8;++g){const e=8*g;if(n[1+e]===0&&n[2+e]===0&&n[3+e]===0&&n[4+e]===0&&n[5+e]===0&&n[6+e]===0&&n[7+e]===0){s=R*n[0+e]+512>>10,n[0+e]=s,n[1+e]=s,n[2+e]=s,n[3+e]=s,n[4+e]=s,n[5+e]=s,n[6+e]=s,n[7+e]=s;continue}i=R*n[0+e]+128>>8,d=R*n[4+e]+128>>8,m=n[2+e],x=n[6+e],E=K*(n[1+e]-n[7+e])+128>>8,v=K*(n[1+e]+n[7+e])+128>>8,k=n[3+e]<<4,A=n[5+e]<<4,s=i-d+1>>1,i=i+d+1>>1,d=s,s=m*W+x*Q+128>>8,m=m*Q-x*W+128>>8,x=s,s=E-A+1>>1,E=E+A+1>>1,A=s,s=v+k+1>>1,k=v-k+1>>1,v=s,s=i-x+1>>1,i=i+x+1>>1,x=s,s=d-m+1>>1,d=d+m+1>>1,m=s,s=E*N+v*$+2048>>12,E=E*$-v*N+2048>>12,v=s,s=k*Z+A*Y+2048>>12,k=k*Y-A*Z+2048>>12,A=s,n[0+e]=i+v,n[7+e]=i-v,n[1+e]=d+A,n[6+e]=d-A,n[2+e]=m+k,n[5+e]=m-k,n[3+e]=x+E,n[4+e]=x-E}for(g=0;g<8;++g){const e=g;if(n[1*8+e]===0&&n[2*8+e]===0&&n[3*8+e]===0&&n[4*8+e]===0&&n[5*8+e]===0&&n[6*8+e]===0&&n[7*8+e]===0){s=R*r[g+0]+8192>>14,n[0*8+e]=s,n[1*8+e]=s,n[2*8+e]=s,n[3*8+e]=s,n[4*8+e]=s,n[5*8+e]=s,n[6*8+e]=s,n[7*8+e]=s;continue}i=R*n[0*8+e]+2048>>12,d=R*n[4*8+e]+2048>>12,m=n[2*8+e],x=n[6*8+e],E=K*(n[1*8+e]-n[7*8+e])+2048>>12,v=K*(n[1*8+e]+n[7*8+e])+2048>>12,k=n[3*8+e],A=n[5*8+e],s=i-d+1>>1,i=i+d+1>>1,d=s,s=m*W+x*Q+2048>>12,m=m*Q-x*W+2048>>12,x=s,s=E-A+1>>1,E=E+A+1>>1,A=s,s=v+k+1>>1,k=v-k+1>>1,v=s,s=i-x+1>>1,i=i+x+1>>1,x=s,s=d-m+1>>1,d=d+m+1>>1,m=s,s=E*N+v*$+2048>>12,E=E*$-v*N+2048>>12,v=s,s=k*Z+A*Y+2048>>12,k=k*Y-A*Z+2048>>12,A=s,n[0*8+e]=i+v,n[7*8+e]=i-v,n[1*8+e]=d+A,n[6*8+e]=d-A,n[2*8+e]=m+k,n[5*8+e]=m-k,n[3*8+e]=x+E,n[4*8+e]=x-E}for(g=0;g<64;++g){const e=128+(n[g]+8>>4);e<0?c[g]=0:e>255?c[g]=255:c[g]=e}}for(let F=0;F>4)if(F>>4===1)for(let r=0;r<64;r++){const b=O[r];c[b]=u()}else throw new Error("DQT: invalid table spec");else for(let r=0;r<64;r++){const b=O[r];c[b]=l[o++]}this.quantizationTables[F&15]=c}break}case 65472:case 65473:case 65474:{u();const t={extended:C===65473,progressive:C===65474,precision:l[o++],scanLines:u(),samplesPerLine:u(),components:{},componentsOrder:[]},h=l[o++];let F;for(let c=0;c>4,b=l[o+1]&15,i=l[o+2];t.componentsOrder.push(F),t.components[F]={h:r,v:b,quantizationIdx:i},o+=3}w(t),this.frames.push(t);break}case 65476:{const t=u();for(let h=2;h>4?this.huffmanTablesAC[F&15]=ne(c,b):this.huffmanTablesDC[F&15]=ne(c,b)}break}case 65501:u(),this.resetInterval=u();break;case 65498:{u();const t=l[o++],h=[],F=this.frames[0];for(let d=0;d>4],m.huffmanTableAC=this.huffmanTablesAC[x&15],h.push(m)}const c=l[o++],r=l[o++],b=l[o++],i=ce(l,o,F,h,this.resetInterval,c,r,b>>4,b&15);o+=i;break}case 65535:l[o]!==255&&o--;break;default:if(l[o-3]===255&&l[o-2]>=192&&l[o-2]<=254){o-=3;break}throw new Error(`unknown JPEG marker ${C.toString(16)}`)}C=u()}}getResult(){const{frames:l}=this;if(this.frames.length===0)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let c=0;c0&&!q[T-1];)--T;u.push({children:[],index:0});let w=u[0],C;for(let t=0;t0;)w=u.pop();for(w.index++,u.push(w);u.length<=t;)u.push(C={children:[],index:0}),w.children[w.index]=C.children,w=C;o++}t+10)return d--,i>>d&1;if(i=q[b++],i===255){const a=q[b++];if(a)throw new Error(`unexpected marker: ${(i<<8|a).toString(16)}`)}return d=7,i>>>7}function x(a){let f=a,p;for(;(p=m())!==null;){if(f=f[p],typeof f=="number")return f;if(typeof f!="object")throw new Error("invalid huffman sequence")}return null}function E(a){let f=a,p=0;for(;f>0;){const L=m();if(L===null)return;p=p<<1|L,--f}return p}function k(a){const f=E(a);return f>=1<>4;if(y===0){if(S<15)break;D+=16}else{D+=S;const I=O[D];f[I]=k(y),D++}}}function v(a,f){const p=x(a.huffmanTableDC),L=p===0?0:k(p)<0){n--;return}let p=w;const L=C;for(;p<=L;){const D=x(a.huffmanTableAC),P=D&15,y=D>>4;if(P===0){if(y<15){n=E(y)+(1<>4,I===0)D<15?(n=E(D)+(1<=65488&&z<=65495)b+=2;else break}return b-r}function ie(q,l){const o=[],{blocksPerLine:u,blocksPerColumn:T}=l,w=u<<3,C=new Int32Array(64),t=new Uint8Array(64);function h(F,c,r){const b=l.quantizationTable;let i,d,m,x,E,k,A,v,s;const n=r;let g;for(g=0;g<64;g++)n[g]=F[g]*b[g];for(g=0;g<8;++g){const e=8*g;if(n[1+e]===0&&n[2+e]===0&&n[3+e]===0&&n[4+e]===0&&n[5+e]===0&&n[6+e]===0&&n[7+e]===0){s=R*n[0+e]+512>>10,n[0+e]=s,n[1+e]=s,n[2+e]=s,n[3+e]=s,n[4+e]=s,n[5+e]=s,n[6+e]=s,n[7+e]=s;continue}i=R*n[0+e]+128>>8,d=R*n[4+e]+128>>8,m=n[2+e],x=n[6+e],E=K*(n[1+e]-n[7+e])+128>>8,v=K*(n[1+e]+n[7+e])+128>>8,k=n[3+e]<<4,A=n[5+e]<<4,s=i-d+1>>1,i=i+d+1>>1,d=s,s=m*W+x*Q+128>>8,m=m*Q-x*W+128>>8,x=s,s=E-A+1>>1,E=E+A+1>>1,A=s,s=v+k+1>>1,k=v-k+1>>1,v=s,s=i-x+1>>1,i=i+x+1>>1,x=s,s=d-m+1>>1,d=d+m+1>>1,m=s,s=E*N+v*$+2048>>12,E=E*$-v*N+2048>>12,v=s,s=k*Z+A*Y+2048>>12,k=k*Y-A*Z+2048>>12,A=s,n[0+e]=i+v,n[7+e]=i-v,n[1+e]=d+A,n[6+e]=d-A,n[2+e]=m+k,n[5+e]=m-k,n[3+e]=x+E,n[4+e]=x-E}for(g=0;g<8;++g){const e=g;if(n[1*8+e]===0&&n[2*8+e]===0&&n[3*8+e]===0&&n[4*8+e]===0&&n[5*8+e]===0&&n[6*8+e]===0&&n[7*8+e]===0){s=R*r[g+0]+8192>>14,n[0*8+e]=s,n[1*8+e]=s,n[2*8+e]=s,n[3*8+e]=s,n[4*8+e]=s,n[5*8+e]=s,n[6*8+e]=s,n[7*8+e]=s;continue}i=R*n[0*8+e]+2048>>12,d=R*n[4*8+e]+2048>>12,m=n[2*8+e],x=n[6*8+e],E=K*(n[1*8+e]-n[7*8+e])+2048>>12,v=K*(n[1*8+e]+n[7*8+e])+2048>>12,k=n[3*8+e],A=n[5*8+e],s=i-d+1>>1,i=i+d+1>>1,d=s,s=m*W+x*Q+2048>>12,m=m*Q-x*W+2048>>12,x=s,s=E-A+1>>1,E=E+A+1>>1,A=s,s=v+k+1>>1,k=v-k+1>>1,v=s,s=i-x+1>>1,i=i+x+1>>1,x=s,s=d-m+1>>1,d=d+m+1>>1,m=s,s=E*N+v*$+2048>>12,E=E*$-v*N+2048>>12,v=s,s=k*Z+A*Y+2048>>12,k=k*Y-A*Z+2048>>12,A=s,n[0*8+e]=i+v,n[7*8+e]=i-v,n[1*8+e]=d+A,n[6*8+e]=d-A,n[2*8+e]=m+k,n[5*8+e]=m-k,n[3*8+e]=x+E,n[4*8+e]=x-E}for(g=0;g<64;++g){const e=128+(n[g]+8>>4);e<0?c[g]=0:e>255?c[g]=255:c[g]=e}}for(let F=0;F>4)if(F>>4===1)for(let r=0;r<64;r++){const b=O[r];c[b]=u()}else throw new Error("DQT: invalid table spec");else for(let r=0;r<64;r++){const b=O[r];c[b]=l[o++]}this.quantizationTables[F&15]=c}break}case 65472:case 65473:case 65474:{u();const t={extended:C===65473,progressive:C===65474,precision:l[o++],scanLines:u(),samplesPerLine:u(),components:{},componentsOrder:[]},h=l[o++];let F;for(let c=0;c>4,b=l[o+1]&15,i=l[o+2];t.componentsOrder.push(F),t.components[F]={h:r,v:b,quantizationIdx:i},o+=3}w(t),this.frames.push(t);break}case 65476:{const t=u();for(let h=2;h>4?this.huffmanTablesAC[F&15]=ne(c,b):this.huffmanTablesDC[F&15]=ne(c,b)}break}case 65501:u(),this.resetInterval=u();break;case 65498:{u();const t=l[o++],h=[],F=this.frames[0];for(let d=0;d>4],m.huffmanTableAC=this.huffmanTablesAC[x&15],h.push(m)}const c=l[o++],r=l[o++],b=l[o++],i=ce(l,o,F,h,this.resetInterval,c,r,b>>4,b&15);o+=i;break}case 65535:l[o]!==255&&o--;break;default:if(l[o-3]===255&&l[o-2]>=192&&l[o-2]<=254){o-=3;break}throw new Error(`unknown JPEG marker ${C.toString(16)}`)}C=u()}}getResult(){const{frames:l}=this;if(this.frames.length===0)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let c=0;c>3],B<<=U&7),d=0;d>3]),B&128?(k&&(k[U]=1),s=M.encoding<2?T[V++]:S,l=l>s?s:l,w[U++]=s):(k&&(k[U]=0),w[U++]=i),B<<=1;U+=I}else if(M.encoding<2)for(y=0;ys?s:l,w[U++]=s;U+=I}else for(l=l>S?S:l,y=0;y0){var f=new Uint8Array(Math.ceil(i.width*i.height/8));n=new DataView(r,o,i.mask.numBytes);var v=n.getInt16(0,!0),u=2,h=0;do{if(v>0)for(;v--;)f[h++]=n.getUint8(u++);else{var g=n.getUint8(u++);for(v=-v;v--;)f[h++]=g}v=n.getInt16(u,!0),u+=2}while(u0?1:0),k=s+(i.height%s>0?1:0);i.pixels.blocks=new Array(w*k);for(var D=0,d=0;d3)throw"Invalid block encoding ("+p.encoding+")";if(p.encoding===2){o++;continue}if(c!==0&&c!==2){if(c>>=6,p.offsetType=c,c===2)p.offset=n.getInt8(1),x++;else if(c===1)p.offset=n.getInt16(1,!0),x+=2;else if(c===0)p.offset=n.getFloat32(1,!0),x+=4;else throw"Invalid block offset type";if(p.encoding===1)if(c=n.getUint8(x),x++,p.bitsPerPixel=c&63,c>>=6,p.numValidPixelsType=c,c===2)p.numValidPixels=n.getUint8(x),x++;else if(c===1)p.numValidPixels=n.getUint16(x,!0),x+=2;else if(c===0)p.numValidPixels=n.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type"}if(o+=x,p.encoding!==3){var U,I;if(p.encoding===0){var M=(i.pixels.numBytes-1)/4;if(M!==Math.floor(M))throw"uncompressed block has invalid length";U=new ArrayBuffer(M*4),I=new Uint8Array(U),I.set(new Uint8Array(r,o,M*4));var T=new Float32Array(U);p.rawData=T,o+=M*4}else if(p.encoding===1){var V=Math.ceil(p.numValidPixels*p.bitsPerPixel/8),S=Math.ceil(V/4);U=new ArrayBuffer(S*4),I=new Uint8Array(U),I.set(new Uint8Array(r,o,V)),p.stuffedData=new Uint32Array(U),o+=V}}}return i.eofOffset=o,i},e=function(r,o,a,i,m,n,f){var v=(1<=o)l=s>>>g-o&v,g-=o;else{var D=o-g;l=(s&v)<>>g}n[h]=l=r?(g=l>>>h-r&f,h-=r):(s=r-h,g=(l&f)<>>h),e[u]=a[g];else for(w=Math.ceil((n-i)/m),u=0;u=r?(g=l>>>h-r&f,h-=r):(s=r-h,g=(l&f)<>>h),e[u]=g=e?(h=g>>>u-e&m,u-=e):(v=e-u,h=(g&m)<>>u),l[f]=h=r?(l=s>>>g&f,h-=r,g+=r):(w=r-h,l=s>>>g&f,s=t[v++],h=32-w,l|=(s&(1<=r?(l=s>>>g&f,h-=r,g+=r):(w=r-h,l=s>>>g&f,s=t[v++],h=32-w,l|=(s&(1<=e?(h=l>>>g&m,u-=e,g+=e):(v=e-u,h=l>>>g&m,l=t[n++],u=32-v,h|=(l&(1<=r?(f=v>>>n-r&a,n-=r):(u=r-n,f=(v&a)<>>n),e[m]=f;return e},originalUnstuff2:function(t,e,r,o){var a=(1<=r?(v=u>>>f&a,n-=r,f+=r):(h=r-n,v=u>>>f&a,u=t[i++],n=32-h,v|=(u&(1<=359?359:a;a-=m;do e+=t[i++]<<8,r+=e+=t[i++];while(--m);e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16)}return o&1&&(r+=e+=t[i]<<8),e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16),(r<<16|e)>>>0},readHeaderInfo:function(t,e){var r=e.ptr,o=new Uint8Array(t,r,6),a={};if(a.fileIdentifierString=String.fromCharCode.apply(null,o),a.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+a.fileIdentifierString;r+=6;var i=new DataView(t,r,8),m=i.getInt32(0,!0);a.fileVersion=m,r+=4,m>=3&&(a.checksum=i.getUint32(4,!0),r+=4),i=new DataView(t,r,12),a.height=i.getUint32(0,!0),a.width=i.getUint32(4,!0),r+=8,m>=4?(a.numDims=i.getUint32(8,!0),r+=4):a.numDims=1,i=new DataView(t,r,40),a.numValidPixel=i.getUint32(0,!0),a.microBlockSize=i.getInt32(4,!0),a.blobSize=i.getInt32(8,!0),a.imageType=i.getInt32(12,!0),a.maxZError=i.getFloat64(16,!0),a.zMin=i.getFloat64(24,!0),a.zMax=i.getFloat64(32,!0),r+=40,e.headerInfo=a,e.ptr=r;var n,f;if(m>=3&&(f=m>=4?52:48,n=this.computeChecksumFletcher32(new Uint8Array(t,r-f,a.blobSize-14)),n!==a.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(t,e){var r=e.headerInfo,o=this.getDataTypeArray(r.imageType),a=r.numDims*this.getDataTypeSize(r.imageType),i=this.readSubArray(t,e.ptr,o,a),m=this.readSubArray(t,e.ptr+a,o,a);e.ptr+=2*a;var n,f=!0;for(n=0;n0){f=new Uint8Array(Math.ceil(a/8)),m=new DataView(t,r,n.numBytes);var u=m.getInt16(0,!0),h=2,g=0,l=0;do{if(u>0)for(;u--;)f[g++]=m.getUint8(h++);else for(l=m.getUint8(h++),u=-u;u--;)f[g++]=l;u=m.getInt16(h,!0),h+=2}while(h>3],s<<=w&7):s=f[w>>3],s&128&&(v[w]=1);e.pixels.resultMask=v,n.bitset=f,r+=n.numBytes}return e.ptr=r,e.mask=n,!0},readDataOneSweep:function(t,e,r,o){var a=e.ptr,i=e.headerInfo,m=i.numDims,n=i.width*i.height,f=i.imageType,v=i.numValidPixel*A.getDataTypeSize(f)*m,u,h=e.pixels.resultMask;if(r===Uint8Array)u=new Uint8Array(t,a,v);else{var g=new ArrayBuffer(v),l=new Uint8Array(g);l.set(new Uint8Array(t,a,v)),u=new r(g)}if(u.length===n*m)o?e.pixels.resultPixels=A.swapDimensionOrder(u,n,m,r,!0):e.pixels.resultPixels=u;else{e.pixels.resultPixels=new r(n*m);var s=0,w=0,k=0,D=0;if(m>1){if(o){for(w=0;w=n)return!1;var f=new Uint32Array(n-m);A.decodeBits(t,e,f);var v=[],u,h,g,l;for(u=m;u0&&(v[h].second=x<>>32-l,32-y>=l?(y+=l,y===32&&(y=0,L++,x=d[L])):(y+=l-32,L++,x=d[L],v[h].second|=x>>>32-y));var p=0,c=0,U=new X;for(u=0;u=r?c=r:c=p;var I=[],M,T,V,S,B,C;for(u=m;u0)if(M=[l,h],l<=c)for(T=v[h].second<=0;S--)B=T>>>S&1,B?(C.right||(C.right=new X),C=C.right):(C.left||(C.left=new X),C=C.left),S===0&&!C.val&&(C.val=M[1]);return{decodeLut:I,numBitsLUTQick:c,numBitsLUT:p,tree:U,stuffedData:d,srcPtr:L,bitPos:y}},readHuffman:function(t,e,r,o){var a=e.headerInfo,i=a.numDims,m=e.headerInfo.height,n=e.headerInfo.width,f=n*m,v=this.readHuffmanTree(t,e),u=v.decodeLut,h=v.tree,g=v.stuffedData,l=v.srcPtr,s=v.bitPos,w=v.numBitsLUTQick,k=v.numBitsLUT,D=e.headerInfo.imageType===0?128:0,d,y,x,L=e.pixels.resultMask,p,c,U,I,M,T,V,S=0;s>0&&(l++,s=0);var B=g[l],C=e.encodeMode===1,j=new r(f*i),O=j,b;if(i<2||C){for(b=0;b1&&(O=new r(j.buffer,f*b,f),S=0),e.headerInfo.numValidPixel===n*m)for(T=0,I=0;I>>32-w,c=p,32-s>>64-s-w,c=p),u[c])y=u[c][1],s+=u[c][0];else for(p=B<>>32-k,c=p,32-s>>64-s-k,c=p),d=h,V=0;V>>k-V-1&1,d=U?d.right:d.left,!(d.left||d.right)){y=d.val,s=s+V+1;break}s>=32&&(s-=32,l++,B=g[l]),x=y-D,C?(M>0?x+=S:I>0?x+=O[T-n]:x+=S,x&=255,O[T]=x,S=x):O[T]=x}else for(T=0,I=0;I>>32-w,c=p,32-s>>64-s-w,c=p),u[c])y=u[c][1],s+=u[c][0];else for(p=B<>>32-k,c=p,32-s>>64-s-k,c=p),d=h,V=0;V>>k-V-1&1,d=U?d.right:d.left,!(d.left||d.right)){y=d.val,s=s+V+1;break}s>=32&&(s-=32,l++,B=g[l]),x=y-D,C?(M>0&&L[T-1]?x+=S:I>0&&L[T-n]?x+=O[T-n]:x+=S,x&=255,O[T]=x,S=x):O[T]=x}}else for(T=0,I=0;I>>32-w,c=p,32-s>>64-s-w,c=p),u[c])y=u[c][1],s+=u[c][0];else for(p=B<>>32-k,c=p,32-s>>64-s-k,c=p),d=h,V=0;V>>k-V-1&1,d=U?d.right:d.left,!(d.left||d.right)){y=d.val,s=s+V+1;break}s>=32&&(s-=32,l++,B=g[l]),x=y-D,O[T]=x}e.ptr=e.ptr+(l+1)*4+(s>0?4:0),e.pixels.resultPixels=j,i>1&&!o&&(e.pixels.resultPixels=A.swapDimensionOrder(j,f,i,r))},decodeBits:function(t,e,r,o,a){{var i=e.headerInfo,m=i.fileVersion,n=0,f=t.byteLength-e.ptr>=5?5:t.byteLength-e.ptr,v=new DataView(t,e.ptr,f),u=v.getUint8(0);n++;var h=u>>6,g=h===0?4:3-h,l=(u&32)>0,s=u&31,w=0;if(g===1)w=v.getUint8(n),n++;else if(g===2)w=v.getUint16(n,!0),n+=2;else if(g===4)w=v.getUint32(n,!0),n+=4;else throw"Invalid valid pixel count type";var k=2*i.maxZError,D,d,y,x,L,p,c,U,I,M=i.numDims>1?i.maxValues[a]:i.zMax;if(l){for(e.counter.lut++,U=v.getUint8(n),n++,x=Math.ceil((U-1)*s/8),L=Math.ceil(x/4),d=new ArrayBuffer(L*4),y=new Uint8Array(d),e.ptr+=n,y.set(new Uint8Array(t,e.ptr,x)),c=new Uint32Array(d),e.ptr+=x,I=0;U-1>>>I;)I++;x=Math.ceil(w*I/8),L=Math.ceil(x/4),d=new ArrayBuffer(L*4),y=new Uint8Array(d),y.set(new Uint8Array(t,e.ptr,x)),D=new Uint32Array(d),e.ptr+=x,m>=3?p=F.unstuffLUT2(c,s,U-1,o,k,M):p=F.unstuffLUT(c,s,U-1,o,k,M),m>=3?F.unstuff2(D,r,I,w,p):F.unstuff(D,r,I,w,p)}else e.counter.bitstuffer++,I=s,e.ptr+=n,I>0&&(x=Math.ceil(w*I/8),L=Math.ceil(x/4),d=new ArrayBuffer(L*4),y=new Uint8Array(d),y.set(new Uint8Array(t,e.ptr,x)),D=new Uint32Array(d),e.ptr+=x,m>=3?o==null?F.originalUnstuff2(D,r,I,w):F.unstuff2(D,r,I,w,!1,o,k,M):o==null?F.originalUnstuff(D,r,I,w):F.unstuff(D,r,I,w,!1,o,k,M))}},readTiles:function(t,e,r,o){var a=e.headerInfo,i=a.width,m=a.height,n=i*m,f=a.microBlockSize,v=a.imageType,u=A.getDataTypeSize(v),h=Math.ceil(i/f),g=Math.ceil(m/f);e.pixels.numBlocksY=g,e.pixels.numBlocksX=h,e.pixels.ptr=0;var l=0,s=0,w=0,k=0,D=0,d=0,y=0,x=0,L=0,p=0,c=0,U=0,I=0,M=0,T=0,V=0,S,B,C,j,O,b,Q=new r(f*f),ne=m%f||f,ae=i%f||f,G,H,q=a.numDims,_,E=e.pixels.resultMask,z=e.pixels.resultPixels,fe=a.fileVersion,ee=fe>=5?14:15,Z,J=a.zMax,N;for(w=0;w1?(N=z,c=w*i*f+k*f,z=new r(e.pixels.resultPixels.buffer,n*_*u,n),J=a.maxValues[_]):N=null,y=t.byteLength-e.ptr,S=new DataView(t,e.ptr,Math.min(10,y)),B={},V=0,x=S.getUint8(0),V++,Z=a.fileVersion>=5?x&4:0,L=x>>6&255,p=x>>2&ee,p!==(k*f>>3&ee)||Z&&_===0)throw"integrity issue";if(b=x&3,b>3)throw e.ptr+=V,"Invalid block encoding ("+b+")";if(b===2){if(Z)if(E)for(l=0;l1&&!o&&(e.pixels.resultPixels=A.swapDimensionOrder(e.pixels.resultPixels,n,q,r))},formatFileInfo:function(t){return{fileIdentifierString:t.headerInfo.fileIdentifierString,fileVersion:t.headerInfo.fileVersion,imageType:t.headerInfo.imageType,height:t.headerInfo.height,width:t.headerInfo.width,numValidPixel:t.headerInfo.numValidPixel,microBlockSize:t.headerInfo.microBlockSize,blobSize:t.headerInfo.blobSize,maxZError:t.headerInfo.maxZError,pixelType:A.getPixelType(t.headerInfo.imageType),eofOffset:t.eofOffset,mask:t.mask?{numBytes:t.mask.numBytes}:null,pixels:{numBlocksX:t.pixels.numBlocksX,numBlocksY:t.pixels.numBlocksY,maxValue:t.headerInfo.zMax,minValue:t.headerInfo.zMin,noDataValue:t.noDataValue}}},constructConstantSurface:function(t,e){var r=t.headerInfo.zMax,o=t.headerInfo.zMin,a=t.headerInfo.maxValues,i=t.headerInfo.numDims,m=t.headerInfo.height*t.headerInfo.width,n=0,f=0,v=0,u=t.pixels.resultMask,h=t.pixels.resultPixels;if(u)if(i>1){if(e)for(n=0;n1&&o!==r)if(e)for(n=0;n=-128&&e<=127;break;case 1:r=e>=0&&e<=255;break;case 2:r=e>=-32768&&e<=32767;break;case 3:r=e>=0&&e<=65536;break;case 4:r=e>=-2147483648&&e<=2147483647;break;case 5:r=e>=0&&e<=4294967296;break;case 6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:r=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(t){var e=0;switch(t){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=t}return e},getDataTypeUsed:function(t,e){var r=t;switch(t){case 2:case 4:r=t-e;break;case 3:case 5:r=t-2*e;break;case 6:e===0?r=t:e===1?r=2:r=1;break;case 7:e===0?r=t:r=t-2*e+1;break;default:r=t;break}return r},getOnePixel:function(t,e,r,o){var a=0;switch(r){case 0:a=o.getInt8(e);break;case 1:a=o.getUint8(e);break;case 2:a=o.getInt16(e,!0);break;case 3:a=o.getUint16(e,!0);break;case 4:a=o.getInt32(e,!0);break;case 5:a=o.getUInt32(e,!0);break;case 6:a=o.getFloat32(e,!0);break;case 7:a=o.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return a},swapDimensionOrder:function(t,e,r,o,a){var i=0,m=0,n=0,f=0,v=t;if(r>1)if(v=new o(e*r),a)for(i=0;i5)throw"unsupported lerc version 2."+m;A.readMask(t,a),i.numValidPixel!==i.width*i.height&&!a.pixels.resultMask&&(a.pixels.resultMask=e.maskData);var f=i.width*i.height;a.pixels.resultPixels=new n(f*i.numDims),a.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var v=!e.returnPixelInterleavedDims;if(i.numValidPixel!==0)if(i.zMax===i.zMin)A.constructConstantSurface(a,v);else if(m>=4&&A.checkMinMaxRanges(t,a))A.constructConstantSurface(a,v);else{var u=new DataView(t,a.ptr,2),h=u.getUint8(0);if(a.ptr++,h)A.readDataOneSweep(t,a,n,v);else if(m>1&&i.imageType<=1&&Math.abs(i.maxZError-.5)<1e-5){var g=u.getUint8(1);if(a.ptr++,a.encodeMode=g,g>2||m<4&&g>1)throw"Invalid Huffman flag "+g;g?A.readHuffman(t,a,n,v):A.readTiles(t,a,n,v)}else A.readTiles(t,a,n,v)}a.eofOffset=a.ptr;var l;e.inputOffset?(l=a.headerInfo.blobSize+e.inputOffset-a.ptr,Math.abs(l)>=1&&(a.eofOffset=e.inputOffset+a.headerInfo.blobSize)):(l=a.headerInfo.blobSize-a.ptr,Math.abs(l)>=1&&(a.eofOffset=a.headerInfo.blobSize));var s={width:i.width,height:i.height,pixelData:a.pixels.resultPixels,minValue:i.zMin,maxValue:i.zMax,validPixelCount:i.numValidPixel,dimCount:i.numDims,dimStats:{minValues:i.minValues,maxValues:i.maxValues},maskData:a.pixels.resultMask};if(a.pixels.resultMask&&A.isValidPixelValue(i.imageType,r)){var w=a.pixels.resultMask;for(o=0;o1&&(f&&m.push(f),h.fileInfo.mask&&h.fileInfo.mask.numBytes>0&&u++),o++,v.pixels.push(h.pixelData),v.statistics.push({minValue:h.minValue,maxValue:h.maxValue,noDataValue:h.noDataValue,dimStats:h.dimStats})}var g,l,s;if(r>1&&u>1){for(s=v.width*v.height,v.bandMasks=m,f=new Uint8Array(s),f.set(m[0]),g=1;g>3],B<<=U&7),d=0;d>3]),B&128?(k&&(k[U]=1),s=M.encoding<2?T[V++]:S,l=l>s?s:l,w[U++]=s):(k&&(k[U]=0),w[U++]=i),B<<=1;U+=I}else if(M.encoding<2)for(y=0;ys?s:l,w[U++]=s;U+=I}else for(l=l>S?S:l,y=0;y0){var f=new Uint8Array(Math.ceil(i.width*i.height/8));n=new DataView(r,o,i.mask.numBytes);var v=n.getInt16(0,!0),u=2,h=0;do{if(v>0)for(;v--;)f[h++]=n.getUint8(u++);else{var g=n.getUint8(u++);for(v=-v;v--;)f[h++]=g}v=n.getInt16(u,!0),u+=2}while(u0?1:0),k=s+(i.height%s>0?1:0);i.pixels.blocks=new Array(w*k);for(var D=0,d=0;d3)throw"Invalid block encoding ("+p.encoding+")";if(p.encoding===2){o++;continue}if(c!==0&&c!==2){if(c>>=6,p.offsetType=c,c===2)p.offset=n.getInt8(1),x++;else if(c===1)p.offset=n.getInt16(1,!0),x+=2;else if(c===0)p.offset=n.getFloat32(1,!0),x+=4;else throw"Invalid block offset type";if(p.encoding===1)if(c=n.getUint8(x),x++,p.bitsPerPixel=c&63,c>>=6,p.numValidPixelsType=c,c===2)p.numValidPixels=n.getUint8(x),x++;else if(c===1)p.numValidPixels=n.getUint16(x,!0),x+=2;else if(c===0)p.numValidPixels=n.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type"}if(o+=x,p.encoding!==3){var U,I;if(p.encoding===0){var M=(i.pixels.numBytes-1)/4;if(M!==Math.floor(M))throw"uncompressed block has invalid length";U=new ArrayBuffer(M*4),I=new Uint8Array(U),I.set(new Uint8Array(r,o,M*4));var T=new Float32Array(U);p.rawData=T,o+=M*4}else if(p.encoding===1){var V=Math.ceil(p.numValidPixels*p.bitsPerPixel/8),S=Math.ceil(V/4);U=new ArrayBuffer(S*4),I=new Uint8Array(U),I.set(new Uint8Array(r,o,V)),p.stuffedData=new Uint32Array(U),o+=V}}}return i.eofOffset=o,i},e=function(r,o,a,i,m,n,f){var v=(1<=o)l=s>>>g-o&v,g-=o;else{var D=o-g;l=(s&v)<>>g}n[h]=l=r?(g=l>>>h-r&f,h-=r):(s=r-h,g=(l&f)<>>h),e[u]=a[g];else for(w=Math.ceil((n-i)/m),u=0;u=r?(g=l>>>h-r&f,h-=r):(s=r-h,g=(l&f)<>>h),e[u]=g=e?(h=g>>>u-e&m,u-=e):(v=e-u,h=(g&m)<>>u),l[f]=h=r?(l=s>>>g&f,h-=r,g+=r):(w=r-h,l=s>>>g&f,s=t[v++],h=32-w,l|=(s&(1<=r?(l=s>>>g&f,h-=r,g+=r):(w=r-h,l=s>>>g&f,s=t[v++],h=32-w,l|=(s&(1<=e?(h=l>>>g&m,u-=e,g+=e):(v=e-u,h=l>>>g&m,l=t[n++],u=32-v,h|=(l&(1<=r?(f=v>>>n-r&a,n-=r):(u=r-n,f=(v&a)<>>n),e[m]=f;return e},originalUnstuff2:function(t,e,r,o){var a=(1<=r?(v=u>>>f&a,n-=r,f+=r):(h=r-n,v=u>>>f&a,u=t[i++],n=32-h,v|=(u&(1<=359?359:a;a-=m;do e+=t[i++]<<8,r+=e+=t[i++];while(--m);e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16)}return o&1&&(r+=e+=t[i]<<8),e=(e&65535)+(e>>>16),r=(r&65535)+(r>>>16),(r<<16|e)>>>0},readHeaderInfo:function(t,e){var r=e.ptr,o=new Uint8Array(t,r,6),a={};if(a.fileIdentifierString=String.fromCharCode.apply(null,o),a.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+a.fileIdentifierString;r+=6;var i=new DataView(t,r,8),m=i.getInt32(0,!0);a.fileVersion=m,r+=4,m>=3&&(a.checksum=i.getUint32(4,!0),r+=4),i=new DataView(t,r,12),a.height=i.getUint32(0,!0),a.width=i.getUint32(4,!0),r+=8,m>=4?(a.numDims=i.getUint32(8,!0),r+=4):a.numDims=1,i=new DataView(t,r,40),a.numValidPixel=i.getUint32(0,!0),a.microBlockSize=i.getInt32(4,!0),a.blobSize=i.getInt32(8,!0),a.imageType=i.getInt32(12,!0),a.maxZError=i.getFloat64(16,!0),a.zMin=i.getFloat64(24,!0),a.zMax=i.getFloat64(32,!0),r+=40,e.headerInfo=a,e.ptr=r;var n,f;if(m>=3&&(f=m>=4?52:48,n=this.computeChecksumFletcher32(new Uint8Array(t,r-f,a.blobSize-14)),n!==a.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(t,e){var r=e.headerInfo,o=this.getDataTypeArray(r.imageType),a=r.numDims*this.getDataTypeSize(r.imageType),i=this.readSubArray(t,e.ptr,o,a),m=this.readSubArray(t,e.ptr+a,o,a);e.ptr+=2*a;var n,f=!0;for(n=0;n0){f=new Uint8Array(Math.ceil(a/8)),m=new DataView(t,r,n.numBytes);var u=m.getInt16(0,!0),h=2,g=0,l=0;do{if(u>0)for(;u--;)f[g++]=m.getUint8(h++);else for(l=m.getUint8(h++),u=-u;u--;)f[g++]=l;u=m.getInt16(h,!0),h+=2}while(h>3],s<<=w&7):s=f[w>>3],s&128&&(v[w]=1);e.pixels.resultMask=v,n.bitset=f,r+=n.numBytes}return e.ptr=r,e.mask=n,!0},readDataOneSweep:function(t,e,r,o){var a=e.ptr,i=e.headerInfo,m=i.numDims,n=i.width*i.height,f=i.imageType,v=i.numValidPixel*A.getDataTypeSize(f)*m,u,h=e.pixels.resultMask;if(r===Uint8Array)u=new Uint8Array(t,a,v);else{var g=new ArrayBuffer(v),l=new Uint8Array(g);l.set(new Uint8Array(t,a,v)),u=new r(g)}if(u.length===n*m)o?e.pixels.resultPixels=A.swapDimensionOrder(u,n,m,r,!0):e.pixels.resultPixels=u;else{e.pixels.resultPixels=new r(n*m);var s=0,w=0,k=0,D=0;if(m>1){if(o){for(w=0;w=n)return!1;var f=new Uint32Array(n-m);A.decodeBits(t,e,f);var v=[],u,h,g,l;for(u=m;u0&&(v[h].second=x<>>32-l,32-y>=l?(y+=l,y===32&&(y=0,L++,x=d[L])):(y+=l-32,L++,x=d[L],v[h].second|=x>>>32-y));var p=0,c=0,U=new X;for(u=0;u=r?c=r:c=p;var I=[],M,T,V,S,B,C;for(u=m;u0)if(M=[l,h],l<=c)for(T=v[h].second<=0;S--)B=T>>>S&1,B?(C.right||(C.right=new X),C=C.right):(C.left||(C.left=new X),C=C.left),S===0&&!C.val&&(C.val=M[1]);return{decodeLut:I,numBitsLUTQick:c,numBitsLUT:p,tree:U,stuffedData:d,srcPtr:L,bitPos:y}},readHuffman:function(t,e,r,o){var a=e.headerInfo,i=a.numDims,m=e.headerInfo.height,n=e.headerInfo.width,f=n*m,v=this.readHuffmanTree(t,e),u=v.decodeLut,h=v.tree,g=v.stuffedData,l=v.srcPtr,s=v.bitPos,w=v.numBitsLUTQick,k=v.numBitsLUT,D=e.headerInfo.imageType===0?128:0,d,y,x,L=e.pixels.resultMask,p,c,U,I,M,T,V,S=0;s>0&&(l++,s=0);var B=g[l],C=e.encodeMode===1,j=new r(f*i),O=j,b;if(i<2||C){for(b=0;b1&&(O=new r(j.buffer,f*b,f),S=0),e.headerInfo.numValidPixel===n*m)for(T=0,I=0;I>>32-w,c=p,32-s>>64-s-w,c=p),u[c])y=u[c][1],s+=u[c][0];else for(p=B<>>32-k,c=p,32-s>>64-s-k,c=p),d=h,V=0;V>>k-V-1&1,d=U?d.right:d.left,!(d.left||d.right)){y=d.val,s=s+V+1;break}s>=32&&(s-=32,l++,B=g[l]),x=y-D,C?(M>0?x+=S:I>0?x+=O[T-n]:x+=S,x&=255,O[T]=x,S=x):O[T]=x}else for(T=0,I=0;I>>32-w,c=p,32-s>>64-s-w,c=p),u[c])y=u[c][1],s+=u[c][0];else for(p=B<>>32-k,c=p,32-s>>64-s-k,c=p),d=h,V=0;V>>k-V-1&1,d=U?d.right:d.left,!(d.left||d.right)){y=d.val,s=s+V+1;break}s>=32&&(s-=32,l++,B=g[l]),x=y-D,C?(M>0&&L[T-1]?x+=S:I>0&&L[T-n]?x+=O[T-n]:x+=S,x&=255,O[T]=x,S=x):O[T]=x}}else for(T=0,I=0;I>>32-w,c=p,32-s>>64-s-w,c=p),u[c])y=u[c][1],s+=u[c][0];else for(p=B<>>32-k,c=p,32-s>>64-s-k,c=p),d=h,V=0;V>>k-V-1&1,d=U?d.right:d.left,!(d.left||d.right)){y=d.val,s=s+V+1;break}s>=32&&(s-=32,l++,B=g[l]),x=y-D,O[T]=x}e.ptr=e.ptr+(l+1)*4+(s>0?4:0),e.pixels.resultPixels=j,i>1&&!o&&(e.pixels.resultPixels=A.swapDimensionOrder(j,f,i,r))},decodeBits:function(t,e,r,o,a){{var i=e.headerInfo,m=i.fileVersion,n=0,f=t.byteLength-e.ptr>=5?5:t.byteLength-e.ptr,v=new DataView(t,e.ptr,f),u=v.getUint8(0);n++;var h=u>>6,g=h===0?4:3-h,l=(u&32)>0,s=u&31,w=0;if(g===1)w=v.getUint8(n),n++;else if(g===2)w=v.getUint16(n,!0),n+=2;else if(g===4)w=v.getUint32(n,!0),n+=4;else throw"Invalid valid pixel count type";var k=2*i.maxZError,D,d,y,x,L,p,c,U,I,M=i.numDims>1?i.maxValues[a]:i.zMax;if(l){for(e.counter.lut++,U=v.getUint8(n),n++,x=Math.ceil((U-1)*s/8),L=Math.ceil(x/4),d=new ArrayBuffer(L*4),y=new Uint8Array(d),e.ptr+=n,y.set(new Uint8Array(t,e.ptr,x)),c=new Uint32Array(d),e.ptr+=x,I=0;U-1>>>I;)I++;x=Math.ceil(w*I/8),L=Math.ceil(x/4),d=new ArrayBuffer(L*4),y=new Uint8Array(d),y.set(new Uint8Array(t,e.ptr,x)),D=new Uint32Array(d),e.ptr+=x,m>=3?p=F.unstuffLUT2(c,s,U-1,o,k,M):p=F.unstuffLUT(c,s,U-1,o,k,M),m>=3?F.unstuff2(D,r,I,w,p):F.unstuff(D,r,I,w,p)}else e.counter.bitstuffer++,I=s,e.ptr+=n,I>0&&(x=Math.ceil(w*I/8),L=Math.ceil(x/4),d=new ArrayBuffer(L*4),y=new Uint8Array(d),y.set(new Uint8Array(t,e.ptr,x)),D=new Uint32Array(d),e.ptr+=x,m>=3?o==null?F.originalUnstuff2(D,r,I,w):F.unstuff2(D,r,I,w,!1,o,k,M):o==null?F.originalUnstuff(D,r,I,w):F.unstuff(D,r,I,w,!1,o,k,M))}},readTiles:function(t,e,r,o){var a=e.headerInfo,i=a.width,m=a.height,n=i*m,f=a.microBlockSize,v=a.imageType,u=A.getDataTypeSize(v),h=Math.ceil(i/f),g=Math.ceil(m/f);e.pixels.numBlocksY=g,e.pixels.numBlocksX=h,e.pixels.ptr=0;var l=0,s=0,w=0,k=0,D=0,d=0,y=0,x=0,L=0,p=0,c=0,U=0,I=0,M=0,T=0,V=0,S,B,C,j,O,b,Q=new r(f*f),ne=m%f||f,ae=i%f||f,G,H,q=a.numDims,_,E=e.pixels.resultMask,z=e.pixels.resultPixels,fe=a.fileVersion,ee=fe>=5?14:15,Z,J=a.zMax,N;for(w=0;w1?(N=z,c=w*i*f+k*f,z=new r(e.pixels.resultPixels.buffer,n*_*u,n),J=a.maxValues[_]):N=null,y=t.byteLength-e.ptr,S=new DataView(t,e.ptr,Math.min(10,y)),B={},V=0,x=S.getUint8(0),V++,Z=a.fileVersion>=5?x&4:0,L=x>>6&255,p=x>>2&ee,p!==(k*f>>3&ee)||Z&&_===0)throw"integrity issue";if(b=x&3,b>3)throw e.ptr+=V,"Invalid block encoding ("+b+")";if(b===2){if(Z)if(E)for(l=0;l1&&!o&&(e.pixels.resultPixels=A.swapDimensionOrder(e.pixels.resultPixels,n,q,r))},formatFileInfo:function(t){return{fileIdentifierString:t.headerInfo.fileIdentifierString,fileVersion:t.headerInfo.fileVersion,imageType:t.headerInfo.imageType,height:t.headerInfo.height,width:t.headerInfo.width,numValidPixel:t.headerInfo.numValidPixel,microBlockSize:t.headerInfo.microBlockSize,blobSize:t.headerInfo.blobSize,maxZError:t.headerInfo.maxZError,pixelType:A.getPixelType(t.headerInfo.imageType),eofOffset:t.eofOffset,mask:t.mask?{numBytes:t.mask.numBytes}:null,pixels:{numBlocksX:t.pixels.numBlocksX,numBlocksY:t.pixels.numBlocksY,maxValue:t.headerInfo.zMax,minValue:t.headerInfo.zMin,noDataValue:t.noDataValue}}},constructConstantSurface:function(t,e){var r=t.headerInfo.zMax,o=t.headerInfo.zMin,a=t.headerInfo.maxValues,i=t.headerInfo.numDims,m=t.headerInfo.height*t.headerInfo.width,n=0,f=0,v=0,u=t.pixels.resultMask,h=t.pixels.resultPixels;if(u)if(i>1){if(e)for(n=0;n1&&o!==r)if(e)for(n=0;n=-128&&e<=127;break;case 1:r=e>=0&&e<=255;break;case 2:r=e>=-32768&&e<=32767;break;case 3:r=e>=0&&e<=65536;break;case 4:r=e>=-2147483648&&e<=2147483647;break;case 5:r=e>=0&&e<=4294967296;break;case 6:r=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:r=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:r=!1}return r},getDataTypeSize:function(t){var e=0;switch(t){case 0:case 1:e=1;break;case 2:case 3:e=2;break;case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=t}return e},getDataTypeUsed:function(t,e){var r=t;switch(t){case 2:case 4:r=t-e;break;case 3:case 5:r=t-2*e;break;case 6:e===0?r=t:e===1?r=2:r=1;break;case 7:e===0?r=t:r=t-2*e+1;break;default:r=t;break}return r},getOnePixel:function(t,e,r,o){var a=0;switch(r){case 0:a=o.getInt8(e);break;case 1:a=o.getUint8(e);break;case 2:a=o.getInt16(e,!0);break;case 3:a=o.getUint16(e,!0);break;case 4:a=o.getInt32(e,!0);break;case 5:a=o.getUInt32(e,!0);break;case 6:a=o.getFloat32(e,!0);break;case 7:a=o.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return a},swapDimensionOrder:function(t,e,r,o,a){var i=0,m=0,n=0,f=0,v=t;if(r>1)if(v=new o(e*r),a)for(i=0;i5)throw"unsupported lerc version 2."+m;A.readMask(t,a),i.numValidPixel!==i.width*i.height&&!a.pixels.resultMask&&(a.pixels.resultMask=e.maskData);var f=i.width*i.height;a.pixels.resultPixels=new n(f*i.numDims),a.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var v=!e.returnPixelInterleavedDims;if(i.numValidPixel!==0)if(i.zMax===i.zMin)A.constructConstantSurface(a,v);else if(m>=4&&A.checkMinMaxRanges(t,a))A.constructConstantSurface(a,v);else{var u=new DataView(t,a.ptr,2),h=u.getUint8(0);if(a.ptr++,h)A.readDataOneSweep(t,a,n,v);else if(m>1&&i.imageType<=1&&Math.abs(i.maxZError-.5)<1e-5){var g=u.getUint8(1);if(a.ptr++,a.encodeMode=g,g>2||m<4&&g>1)throw"Invalid Huffman flag "+g;g?A.readHuffman(t,a,n,v):A.readTiles(t,a,n,v)}else A.readTiles(t,a,n,v)}a.eofOffset=a.ptr;var l;e.inputOffset?(l=a.headerInfo.blobSize+e.inputOffset-a.ptr,Math.abs(l)>=1&&(a.eofOffset=e.inputOffset+a.headerInfo.blobSize)):(l=a.headerInfo.blobSize-a.ptr,Math.abs(l)>=1&&(a.eofOffset=a.headerInfo.blobSize));var s={width:i.width,height:i.height,pixelData:a.pixels.resultPixels,minValue:i.zMin,maxValue:i.zMax,validPixelCount:i.numValidPixel,dimCount:i.numDims,dimStats:{minValues:i.minValues,maxValues:i.maxValues},maskData:a.pixels.resultMask};if(a.pixels.resultMask&&A.isValidPixelValue(i.imageType,r)){var w=a.pixels.resultMask;for(o=0;o1&&(f&&m.push(f),h.fileInfo.mask&&h.fileInfo.mask.numBytes>0&&u++),o++,v.pixels.push(h.pixelData),v.statistics.push({minValue:h.minValue,maxValue:h.maxValue,noDataValue:h.noDataValue,dimStats:h.dimStats})}var g,l,s;if(r>1&&u>1){for(s=v.width*v.height,v.bandMasks=m,f=new Uint8Array(s),f.set(m[0]),g=1;g=c.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),p;let u=c[n]&2**(8-i)-1;u<<=r-h;let s=u;if(n+1>>l;f<<=Math.max(0,r-w),s+=f}if(g>8&&n+2>>f;s+=t}return s}function D(c,o){for(let r=o.length-1;r>=0;r--)c.push(o[r]);return c}function A(c){const o=new Uint16Array(4093),r=new Uint8Array(4093);for(let e=0;e<=257;e++)o[e]=4096,r[e]=e;let i=258,n=B,h=0;function g(){i=258,n=B}function l(e){const a=x(e,h,n);return h+=n,a}function w(e,a){return r[i]=a,o[i]=e,i++,i-1}function u(e){const a=[];for(let y=e;y!==4096;y=o[y])a.push(r[y]);return a}const s=[];g();const f=new Uint8Array(c);let t=l(f),d;for(;t!==p;){if(t===E){for(g(),t=l(f);t===E;)t=l(f);if(t===p)break;if(t>E)throw new Error(`corrupted code at scanline ${t}`);{const e=u(t);D(s,e),d=t}}else if(t=2**n&&(n===k?d=void 0:n++),t=l(f)}return new Uint8Array(s)}class m extends b{decodeBlock(o){return A(o).buffer}}export{m as default}; +import{B as b}from"./index-5def9da2.js";const B=9,E=256,p=257,k=12;function x(c,o,r){const i=o%8,n=Math.floor(o/8),h=8-i,g=o+r-(n+1)*8;let l=8*(n+2)-(o+r);const w=(n+2)*8-o;if(l=Math.max(0,l),n>=c.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),p;let u=c[n]&2**(8-i)-1;u<<=r-h;let s=u;if(n+1>>l;f<<=Math.max(0,r-w),s+=f}if(g>8&&n+2>>f;s+=t}return s}function D(c,o){for(let r=o.length-1;r>=0;r--)c.push(o[r]);return c}function A(c){const o=new Uint16Array(4093),r=new Uint8Array(4093);for(let e=0;e<=257;e++)o[e]=4096,r[e]=e;let i=258,n=B,h=0;function g(){i=258,n=B}function l(e){const a=x(e,h,n);return h+=n,a}function w(e,a){return r[i]=a,o[i]=e,i++,i-1}function u(e){const a=[];for(let y=e;y!==4096;y=o[y])a.push(r[y]);return a}const s=[];g();const f=new Uint8Array(c);let t=l(f),d;for(;t!==p;){if(t===E){for(g(),t=l(f);t===E;)t=l(f);if(t===p)break;if(t>E)throw new Error(`corrupted code at scanline ${t}`);{const e=u(t);D(s,e),d=t}}else if(t=2**n&&(n===k?d=void 0:n++),t=l(f)}return new Uint8Array(s)}class m extends b{decodeBlock(o){return A(o).buffer}}export{m as default}; diff --git a/assets/packbits-635cec19.js b/assets/packbits-7b7e1ed7.js similarity index 81% rename from assets/packbits-635cec19.js rename to assets/packbits-7b7e1ed7.js index b2dcf5c1b..dd82db88a 100644 --- a/assets/packbits-635cec19.js +++ b/assets/packbits-7b7e1ed7.js @@ -1 +1 @@ -import{B as c}from"./index-fc258553.js";class l extends c{decodeBlock(s){const n=new DataView(s),r=[];for(let e=0;e"u")throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if(typeof document>"u"&&typeof OffscreenCanvas>"u")throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(i,n){const o=new Blob([n]),e=await createImageBitmap(o);let t;typeof document<"u"?(t=document.createElement("canvas"),t.width=e.width,t.height=e.height):t=new OffscreenCanvas(e.width,e.height);const a=t.getContext("2d");return a.drawImage(e,0,0),a.getImageData(0,0,e.width,e.height).data.buffer}}export{s as default}; +import{B as r}from"./index-5def9da2.js";class s extends r{constructor(){if(super(),typeof createImageBitmap>"u")throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if(typeof document>"u"&&typeof OffscreenCanvas>"u")throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(i,n){const o=new Blob([n]),e=await createImageBitmap(o);let t;typeof document<"u"?(t=document.createElement("canvas"),t.width=e.width,t.height=e.height):t=new OffscreenCanvas(e.width,e.height);const a=t.getContext("2d");return a.drawImage(e,0,0),a.getImageData(0,0,e.width,e.height).data.buffer}}export{s as default}; diff --git a/index.html b/index.html index 3d8531b81..a831cd535 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ content="A viewer for high bit depth, high resolution, multi-channel images" /> AVIVATOR - +